vendor: 5,855 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/db-CZt8W1uq.js","assets/logger-ICeyLgXh.js","assets/index-CiQvndaL.js"])))=>i.map(i=>d[i]); 2var vD=Object.defineProperty;var Eb=s=>{throw TypeError(s)};var jD=(s,t,n)=>t in s?vD(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n;var fe=(s,t,n)=>jD(s,typeof t!="symbol"?t+"":t,n),Oy=(s,t,n)=>t.has(s)||Eb("Cannot "+n);var oe=(s,t,n)=>(Oy(s,t,"read from private field"),n?n.call(s):t.get(s)),Ot=(s,t,n)=>t.has(s)?Eb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),ft=(s,t,n,r)=>(Oy(s,t,"write to private field"),r?r.call(s,n):t.set(s,n),n),Ht=(s,t,n)=>(Oy(s,t,"access private method"),n);var ex=(s,t,n,r)=>({set _(a){ft(s,t,a,n)},get _(){return oe(s,t,r)}});function bD(s,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in s)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(s,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function r8(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Fy={exports:{}},Qm={},Ry={exports:{}},$s={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var Tb;function ND(){if(Tb)return $s;Tb=1;var s=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,N={};function k(G,Ae,Fe){this.props=G,this.context=Ae,this.refs=N,this.updater=Fe||b}k.prototype.isReactComponent={},k.prototype.setState=function(G,Ae){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,Ae,"setState")},k.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function E(){}E.prototype=k.prototype;function P(G,Ae,Fe){this.props=G,this.context=Ae,this.refs=N,this.updater=Fe||b}var M=P.prototype=new E;M.constructor=P,w(M,k.prototype),M.isPureReactComponent=!0;var L=Array.isArray,B=Object.prototype.hasOwnProperty,z={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function T(G,Ae,Fe){var be,Me={},R=null,re=null;if(Ae!=null)for(be in Ae.ref!==void 0&&(re=Ae.ref),Ae.key!==void 0&&(R=""+Ae.key),Ae)B.call(Ae,be)&&!H.hasOwnProperty(be)&&(Me[be]=Ae[be]);var O=arguments.length-2;if(O===1)Me.children=Fe;else if(1<O){for(var me=Array(O),Y=0;Y<O;Y++)me[Y]=arguments[Y+2];Me.children=me}if(G&&G.defaultProps)for(be in O=G.defaultProps,O)Me[be]===void 0&&(Me[be]=O[be]);return{$$typeof:s,type:G,key:R,ref:re,props:Me,_owner:z.current}}function U(G,Ae){return{$$typeof:s,type:G.type,key:Ae,ref:G.ref,props:G.props,_owner:G._owner}}function _(G){return typeof G=="object"&&G!==null&&G.$$typeof===s}function se(G){var Ae={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(Fe){return Ae[Fe]})}var ae=/\/+/g;function W(G,Ae){return typeof G=="object"&&G!==null&&G.key!=null?se(""+G.key):Ae.toString(36)}function J(G,Ae,Fe,be,Me){var R=typeof G;(R==="undefined"||R==="boolean")&&(G=null);var re=!1;if(G===null)re=!0;else switch(R){case"string":case"number":re=!0;break;case"object":switch(G.$$typeof){case s:case t:re=!0}}if(re)return re=G,Me=Me(re),G=be===""?"."+W(re,0):be,L(Me)?(Fe="",G!=null&&(Fe=G.replace(ae,"$&/")+"/"),J(Me,Ae,Fe,"",function(Y){return Y})):Me!=null&&(_(Me)&&(Me=U(Me,Fe+(!Me.key||re&&re.key===Me.key?"":(""+Me.key).replace(ae,"$&/")+"/")+G)),Ae.push(Me)),1;if(re=0,be=be===""?".":be+":",L(G))for(var O=0;O<G.length;O++){R=G[O];var me=be+W(R,O);re+=J(R,Ae,Fe,me,Me)}else if(me=y(G),typeof me=="function")for(G=me.call(G),O=0;!(R=G.next()).done;)R=R.value,me=be+W(R,O++),re+=J(R,Ae,Fe,me,Me);else if(R==="object")throw Ae=String(G),Error("Objects are not valid as a React child (found: "+(Ae==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":Ae)+"). If you meant to render a collection of children, use an array instead.");return re}function ne(G,Ae,Fe){if(G==null)return G;var be=[],Me=0;return J(G,be,"","",function(R){return Ae.call(Fe,R,Me++)}),be}function le(G){if(G._status===-1){var Ae=G._result;Ae=Ae(),Ae.then(function(Fe){(G._status===0||G._status===-1)&&(G._status=1,G._result=Fe)},function(Fe){(G._status===0||G._status===-1)&&(G._status=2,G._result=Fe)}),G._status===-1&&(G._status=0,G._result=Ae)}
vendor: 4,925 bytes, lines 10-26
10if(G._status===1)return G._result.default;throw G._result}var V={current:null},Z={transition:null},ue={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:Z,ReactCurrentOwner:z};function ge(){throw Error("act(...) is not supported in production builds of React.")}return $s.Children={map:ne,forEach:function(G,Ae,Fe){ne(G,function(){Ae.apply(this,arguments)},Fe)},count:function(G){var Ae=0;return ne(G,function(){Ae++}),Ae},toArray:function(G){return ne(G,function(Ae){return Ae})||[]},only:function(G){if(!_(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},$s.Component=k,$s.Fragment=n,$s.Profiler=a,$s.PureComponent=P,$s.StrictMode=r,$s.Suspense=h,$s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,$s.act=ge,$s.cloneElement=function(G,Ae,Fe){if(G==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+G+".");var be=w({},G.props),Me=G.key,R=G.ref,re=G._owner;if(Ae!=null){if(Ae.ref!==void 0&&(R=Ae.ref,re=z.current),Ae.key!==void 0&&(Me=""+Ae.key),G.type&&G.type.defaultProps)var O=G.type.defaultProps;for(me in Ae)B.call(Ae,me)&&!H.hasOwnProperty(me)&&(be[me]=Ae[me]===void 0&&O!==void 0?O[me]:Ae[me])}var me=arguments.length-2;if(me===1)be.children=Fe;else if(1<me){O=Array(me);for(var Y=0;Y<me;Y++)O[Y]=arguments[Y+2];be.children=O}return{$$typeof:s,type:G.type,key:Me,ref:R,props:be,_owner:re}},$s.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},G.Provider={$$typeof:o,_context:G},G.Consumer=G},$s.createElement=T,$s.createFactory=function(G){var Ae=T.bind(null,G);return Ae.type=G,Ae},$s.createRef=function(){return{current:null}},$s.forwardRef=function(G){return{$$typeof:u,render:G}},$s.isValidElement=_,$s.lazy=function(G){return{$$typeof:m,_payload:{_status:-1,_result:G},_init:le}},$s.memo=function(G,Ae){return{$$typeof:x,type:G,compare:Ae===void 0?null:Ae}},$s.startTransition=function(G){var Ae=Z.transition;Z.transition={};try{G()}finally{Z.transition=Ae}},$s.unstable_act=ge,$s.useCallback=function(G,Ae){return V.current.useCallback(G,Ae)},$s.useContext=function(G){return V.current.useContext(G)},$s.useDebugValue=function(){},$s.useDeferredValue=function(G){return V.current.useDeferredValue(G)},$s.useEffect=function(G,Ae){return V.current.useEffect(G,Ae)},$s.useId=function(){return V.current.useId()},$s.useImperativeHandle=function(G,Ae,Fe){return V.current.useImperativeHandle(G,Ae,Fe)},$s.useInsertionEffect=function(G,Ae){return V.current.useInsertionEffect(G,Ae)},$s.useLayoutEffect=function(G,Ae){return V.current.useLayoutEffect(G,Ae)},$s.useMemo=function(G,Ae){return V.current.useMemo(G,Ae)},$s.useReducer=function(G,Ae,Fe){return V.current.useReducer(G,Ae,Fe)},$s.useRef=function(G){return V.current.useRef(G)},$s.useState=function(G){return V.current.useState(G)},$s.useSyncExternalStore=function(G,Ae,Fe){return V.current.useSyncExternalStore(G,Ae,Fe)},$s.useTransition=function(){return V.current.useTransition()},$s.version="18.3.1",$s}var _b;function A0(){return _b||(_b=1,Ry.exports=ND()),Ry.exports}/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var Ib;function wD(){if(Ib)return Qm;Ib=1;var s=A0(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,x){var m,g={},y=null,b=null;x!==void 0&&(y=""+x),h.key!==void 0&&(y=""+h.key),h.ref!==void 0&&(b=h.ref);for(m in h)r.call(h,m)&&!o.hasOwnProperty(m)&&(g[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)g[m]===void 0&&(g[m]=h[m]);return{$$typeof:t,type:u,key:y,ref:b,props:g,_owner:a.current}}return Qm.Fragment=n,Qm.jsx=c,Qm.jsxs=c,Qm}var Db;function AD(){return Db||(Db=1,Fy.exports=wD()),Fy.exports}var e=AD(),tx={},My={exports:{}},ua={},Ly={exports:{}},Vy={};/** 19 * @license React 20 * scheduler.production.min.js 21 * 22 * Copyright (c) Facebook, Inc. and its affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var Ob;function CD(){return Ob||(Ob=1,function(s){function t(Z,ue){var ge=Z.length;Z.push(ue);e:for(;0<ge;){var G=ge-1>>>1,Ae=Z[G];if(0<a(Ae,ue))Z[G]=ue,Z[ge]=Ae,ge=G;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var ue=Z[0],ge=Z.pop();if(ge!==ue){Z[0]=ge;e:for(var G=0,Ae=Z.length,Fe=Ae>>>1;G<Fe;){var be=2*(G+1)-1,Me=Z[be],R=be+1,re=Z[R];if(0>a(Me,ge))R<Ae&&0>a(re,Me)?(Z[G]=re,Z[R]=ge,G=R):(Z[G]=Me,Z[be]=ge,G=be);else if(R<Ae&&0>a(re,ge))Z[G]=re,Z[R]=ge,G=R;else break e}}return ue}
vendor: 5,108 bytes, lines 26-34
26function a(Z,ue){var ge=Z.sortIndex-ue.sortIndex;return ge!==0?ge:Z.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();s.unstable_now=function(){return c.now()-u}}var h=[],x=[],m=1,g=null,y=3,b=!1,w=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(Z){for(var ue=n(x);ue!==null;){if(ue.callback===null)r(x);else if(ue.startTime<=Z)r(x),ue.sortIndex=ue.expirationTime,t(h,ue);else break;ue=n(x)}}function L(Z){if(N=!1,M(Z),!w)if(n(h)!==null)w=!0,le(B);else{var ue=n(x);ue!==null&&V(L,ue.startTime-Z)}}function B(Z,ue){w=!1,N&&(N=!1,E(T),T=-1),b=!0;var ge=y;try{for(M(ue),g=n(h);g!==null&&(!(g.expirationTime>ue)||Z&&!se());){var G=g.callback;if(typeof G=="function"){g.callback=null,y=g.priorityLevel;var Ae=G(g.expirationTime<=ue);ue=s.unstable_now(),typeof Ae=="function"?g.callback=Ae:g===n(h)&&r(h),M(ue)}else r(h);g=n(h)}if(g!==null)var Fe=!0;else{var be=n(x);be!==null&&V(L,be.startTime-ue),Fe=!1}return Fe}finally{g=null,y=ge,b=!1}}var z=!1,H=null,T=-1,U=5,_=-1;function se(){return!(s.unstable_now()-_<U)}function ae(){if(H!==null){var Z=s.unstable_now();_=Z;var ue=!0;try{ue=H(!0,Z)}finally{ue?W():(z=!1,H=null)}}else z=!1}var W;if(typeof P=="function")W=function(){P(ae)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ne=J.port2;J.port1.onmessage=ae,W=function(){ne.postMessage(null)}}else W=function(){k(ae,0)};function le(Z){H=Z,z||(z=!0,W())}function V(Z,ue){T=k(function(){Z(s.unstable_now())},ue)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Z){Z.callback=null},s.unstable_continueExecution=function(){w||b||(w=!0,le(B))},s.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},s.unstable_getCurrentPriorityLevel=function(){return y},s.unstable_getFirstCallbackNode=function(){return n(h)},s.unstable_next=function(Z){switch(y){case 1:case 2:case 3:var ue=3;break;default:ue=y}var ge=y;y=ue;try{return Z()}finally{y=ge}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(Z,ue){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ge=y;y=Z;try{return ue()}finally{y=ge}},s.unstable_scheduleCallback=function(Z,ue,ge){var G=s.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?G+ge:G):ge=G,Z){case 1:var Ae=-1;break;case 2:Ae=250;break;case 5:Ae=1073741823;break;case 4:Ae=1e4;break;default:Ae=5e3}return Ae=ge+Ae,Z={id:m++,callback:ue,priorityLevel:Z,startTime:ge,expirationTime:Ae,sortIndex:-1},ge>G?(Z.sortIndex=ge,t(x,Z),n(h)===null&&Z===n(x)&&(N?(E(T),T=-1):N=!0,V(L,ge-G))):(Z.sortIndex=Ae,t(h,Z),w||b||(w=!0,le(B))),Z},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(Z){var ue=y;return function(){var ge=y;y=ue;try{return Z.apply(this,arguments)}finally{y=ge}}}}(Vy)),Vy}var Fb;function SD(){return Fb||(Fb=1,Ly.exports=CD()),Ly.exports}/** 27 * @license React 28 * react-dom.production.min.js 29 * 30 * Copyright (c) Facebook, Inc. and its affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var Rb;function kD(){if(Rb)return ua;Rb=1;var s=A0(),t=SD();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(i,l){c(i,l),c(i+"Capture",l)}function c(i,l){for(a[i]=l,i=0;i<l.length;i++)r.add(l[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,x=/^[: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]*$/,m={},g={};function y(i){return h.call(g,i)?!0:h.call(m,i)?!1:x.test(i)?g[i]=!0:(m[i]=!0,!1)}function b(i,l,d,f){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return f?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function w(i,l,d,f){if(l===null||typeof l>"u"||b(i,l,d,f))return!0;
vendor: 36,053 bytes, lines 34-38
34if(f)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function N(i,l,d,f,j,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=f,this.attributeNamespace=j,this.mustUseProperty=d,this.propertyName=i,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){k[i]=new N(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];k[l]=new N(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){k[i]=new N(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){k[i]=new N(i,2,!1,i,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(i){k[i]=new N(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){k[i]=new N(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){k[i]=new N(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){k[i]=new N(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){k[i]=new N(i,5,!1,i.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(i){return i[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(i){var l=i.replace(E,P);k[l]=new N(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(E,P);k[l]=new N(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(E,P);k[l]=new N(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){k[i]=new N(i,1,!1,i.toLowerCase(),null,!1,!1)}),k.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){k[i]=new N(i,1,!1,i.toLowerCase(),null,!0,!0)});function M(i,l,d,f){var j=k.hasOwnProperty(l)?k[l]:null;(j!==null?j.type!==0:f||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,d,j,f)&&(d=null),f||j===null?y(l)&&(d===null?i.removeAttribute(l):i.setAttribute(l,""+d)):j.mustUseProperty?i[j.propertyName]=d===null?j.type===3?!1:"":d:(l=j.attributeName,f=j.attributeNamespace,d===null?i.removeAttribute(l):(j=j.type,d=j===3||j===4&&d===!0?"":""+d,f?i.setAttributeNS(f,l,d):i.setAttribute(l,d))))}var L=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),z=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),se=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),Z=Symbol.iterator;function ue(i){return i===null||typeof i!="object"?null:(i=Z&&i[Z]||i["@@iterator"],typeof i=="function"?i:null)}var ge=Object.assign,G;function Ae(i){if(G===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);G=l&&l[1]||""}return` 35`+G+i}var Fe=!1;function be(i,l){if(!i||Fe)return"";Fe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(Oe){var f=Oe}Reflect.construct(i,[],l)}else{try{l.call()}catch(Oe){f=Oe}i.call(l.prototype)}else{try{throw Error()}catch(Oe){f=Oe}i()}}catch(Oe){if(Oe&&f&&typeof Oe.stack=="string"){for(var j=Oe.stack.split(` 36`),C=f.stack.split(` 37`),I=j.length-1,ee=C.length-1;1<=I&&0<=ee&&j[I]!==C[ee];)ee--;for(;1<=I&&0<=ee;I--,ee--)if(j[I]!==C[ee]){if(I!==1||ee!==1)do if(I--,ee--,0>ee||j[I]!==C[ee]){var pe=` 38`+j[I].replace(" at new "," at ");return i.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",i.displayName)),pe}while(1<=I&&0<=ee);break}}}finally{Fe=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?Ae(i):""}function Me(i){switch(i.tag){case 5:return Ae(i.type);case 16:return Ae("Lazy");case 13:return Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 2:case 15:return i=be(i.type,!1),i;case 11:return i=be(i.type.render,!1),i;case 1:return i=be(i.type,!0),i;default:return""}}function R(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case H:return"Fragment";case z:return"Portal";case U:return"Profiler";case T:return"StrictMode";case W:return"Suspense";case J:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case se:return(i.displayName||"Context")+".Consumer";case _:return(i._context.displayName||"Context")+".Provider";case ae:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ne:return l=i.displayName||null,l!==null?l:R(i.type)||"Memo";case le:l=i._payload,i=i._init;try{return R(i(l))}catch{}}return null}function re(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(l);case 8:return l===T?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function O(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function me(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Y(i){var l=me(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),f=""+i[l];if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var j=d.get,C=d.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return j.call(this)},set:function(I){f=""+I,C.call(this,I)}}),Object.defineProperty(i,l,{enumerable:d.enumerable}),{getValue:function(){return f},setValue:function(I){f=""+I},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Te(i){i._valueTracker||(i._valueTracker=Y(i))}function Be(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var d=l.getValue(),f="";return i&&(f=me(i)?i.checked?"true":"false":i.value),i=f,i!==d?(l.setValue(i),!0):!1}function ht(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Mt(i,l){var d=l.checked;return ge({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function $(i,l){var d=l.defaultValue==null?"":l.defaultValue,f=l.checked!=null?l.checked:l.defaultChecked;d=O(l.value!=null?l.value:d),i._wrapperState={initialChecked:f,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function K(i,l){l=l.checked,l!=null&&M(i,"checked",l,!1)}function xe(i,l){K(i,l);var d=O(l.value),f=l.type;if(d!=null)f==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?X(i,l.type,d):l.hasOwnProperty("defaultValue")&&X(i,l.type,O(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function De(i,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var f=l.type;if(!(f!=="submit"&&f!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,d||l===i.value||(i.value=l),i.defaultValue=l}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function X(i,l,d){(l!=="number"||ht(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var _e=Array.isArray;function Le(i,l,d,f){if(i=i.options,l){l={};for(var j=0;j<d.length;j++)l["$"+d[j]]=!0;for(d=0;d<i.length;d++)j=l.hasOwnProperty("$"+i[d].value),i[d].selected!==j&&(i[d].selected=j),j&&f&&(i[d].defaultSelected=!0)}else{for(d=""+O(d),l=null,j=0;j<i.length;j++){if(i[j].value===d){i[j].selected=!0,f&&(i[j].defaultSelected=!0);return}l!==null||i[j].disabled||(l=i[j])}l!==null&&(l.selected=!0)}}function A(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return ge({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function D(i,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(_e(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}i._wrapperState={initialValue:O(d)}}function ie(i,l){var d=O(l.value),f=O(l.defaultValue);d!=null&&(d=""+d,d!==i.value&&(i.value=d),l.defaultValue==null&&i.defaultValue!==d&&(i.defaultValue=d)),f!=null&&(i.defaultValue=""+f)}function $e(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function ke(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function S(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?ke(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var ve,Ze=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,f,j){MSApp.execUnsafeLocalFunction(function(){return i(l,d,f,j)})}:i}(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(ve=ve||document.createElement("div"),ve.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=ve.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function Qe(i,l){if(l){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=l;return}}i.textContent=l}var ct={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},It=["Webkit","ms","Moz","O"];Object.keys(ct).forEach(function(i){It.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),ct[l]=ct[i]})});function Zs(i,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||ct.hasOwnProperty(i)&&ct[i]?(""+l).trim():l+"px"}function Zt(i,l){i=i.style;for(var d in l)if(l.hasOwnProperty(d)){var f=d.indexOf("--")===0,j=Zs(d,l[d],f);d==="float"&&(d="cssFloat"),f?i.setProperty(d,j):i[d]=j}}var qn=ge({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 xn(i,l){if(l){if(qn[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function un(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 Rt=null;function Os(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var vs=null,cs=null,Ts=null;function mn(i){if(i=Fm(i)){if(typeof vs!="function")throw Error(n(280));var l=i.stateNode;l&&(l=pp(l),vs(i.stateNode,i.type,l))}}function ds(i){cs?Ts?Ts.push(i):Ts=[i]:cs=i}function ms(){if(cs){var i=cs,l=Ts;if(Ts=cs=null,mn(i),l)for(i=0;i<l.length;i++)mn(l[i])}}function Yt(i,l){return i(l)}function Ls(){}var xl=!1;function bn(i,l,d){if(xl)return i(l,d);xl=!0;try{return Yt(i,l,d)}finally{xl=!1,(cs!==null||Ts!==null)&&(Ls(),ms())}}function ya(i,l){var d=i.stateNode;if(d===null)return null;var f=pp(d);if(f===null)return null;d=f[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var ur=!1;if(u)try{var ni={};Object.defineProperty(ni,"passive",{get:function(){ur=!0}}),window.addEventListener("test",ni,ni),window.removeEventListener("test",ni,ni)}catch{ur=!1}function Fi(i,l,d,f,j,C,I,ee,pe){var Oe=Array.prototype.slice.call(arguments,3);try{l.apply(d,Oe)}catch(et){this.onError(et)}}var Ri=!1,ri=null,gl=!1,ai=null,ii={onError:function(i){Ri=!0,ri=i}};function li(i,l,d,f,j,C,I,ee,pe){Ri=!1,ri=null,Fi.apply(ii,arguments)}function Ss(i,l,d,f,j,C,I,ee,pe){if(li.apply(this,arguments),Ri){if(Ri){var Oe=ri;Ri=!1,ri=null}else throw Error(n(198));gl||(gl=!0,ai=Oe)}}function na(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function Mi(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function en(i){if(na(i)!==i)throw Error(n(188))}function hs(i){var l=i.alternate;if(!l){if(l=na(i),l===null)throw Error(n(188));return l!==i?null:i}for(var d=i,f=l;;){var j=d.return;if(j===null)break;var C=j.alternate;if(C===null){if(f=j.return,f!==null){d=f;continue}break}if(j.child===C.child){for(C=j.child;C;){if(C===d)return en(j),i;if(C===f)return en(j),l;C=C.sibling}throw Error(n(188))}if(d.return!==f.return)d=j,f=C;else{for(var I=!1,ee=j.child;ee;){if(ee===d){I=!0,d=j,f=C;break}if(ee===f){I=!0,f=j,d=C;break}ee=ee.sibling}if(!I){for(ee=C.child;ee;){if(ee===d){I=!0,d=C,f=j;break}if(ee===f){I=!0,f=C,d=j;break}ee=ee.sibling}if(!I)throw Error(n(189))}}if(d.alternate!==f)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?i:l}function he(i){return i=hs(i),i!==null?q(i):null}function q(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=q(i);if(l!==null)return l;i=i.sibling}return null}var Xe=t.unstable_scheduleCallback,Lt=t.unstable_cancelCallback,js=t.unstable_shouldYield,ps=t.unstable_requestPaint,Xt=t.unstable_now,Nn=t.unstable_getCurrentPriorityLevel,wn=t.unstable_ImmediatePriority,En=t.unstable_UserBlockingPriority,yl=t.unstable_NormalPriority,rt=t.unstable_LowPriority,uc=t.unstable_IdlePriority,Tn=null,Qs=null;function xg(i){if(Qs&&typeof Qs.onCommitFiberRoot=="function")try{Qs.onCommitFiberRoot(Tn,i,void 0,(i.current.flags&128)===128)}catch{}}var va=Math.clz32?Math.clz32:Mr,Vs=Math.log,Wj=Math.LN2;function Mr(i){return i>>>=0,i===0?32:31-(Vs(i)/Wj|0)|0}var ra=64,dm=4194304;function br(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function mc(i,l){var d=i.pendingLanes;if(d===0)return 0;var f=0,j=i.suspendedLanes,C=i.pingedLanes,I=d&268435455;if(I!==0){var ee=I&~j;ee!==0?f=br(ee):(C&=I,C!==0&&(f=br(C)))}else I=d&~j,I!==0?f=br(I):C!==0&&(f=br(C));if(f===0)return 0;if(l!==0&&l!==f&&(l&j)===0&&(j=f&-f,C=l&-l,j>=C||j===16&&(C&4194240)!==0))return l;if((f&4)!==0&&(f|=d&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=f;0<l;)d=31-va(l),j=1<<d,f|=i[d],l&=~j;return f}function um(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mm(i,l){for(var d=i.suspendedLanes,f=i.pingedLanes,j=i.expirationTimes,C=i.pendingLanes;0<C;){var I=31-va(C),ee=1<<I,pe=j[I];pe===-1?((ee&d)===0||(ee&f)!==0)&&(j[I]=um(ee,l)):pe<=l&&(i.expiredLanes|=ee),C&=~ee}}function Us(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Of(){var i=ra;return ra<<=1,(ra&4194240)===0&&(ra=64),i}function Ff(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function ja(i,l,d){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-va(l),i[l]=d}function Nd(i,l){var d=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<d;){var j=31-va(d),C=1<<j;l[j]=0,f[j]=-1,i[j]=-1,d&=~C}}function wd(i,l){var d=i.entangledLanes|=l;for(i=i.entanglements;d;){var f=31-va(d),j=1<<f;j&l|i[f]&l&&(i[f]|=l),d&=~j}}var Fs=0;function Lr(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Rf,cn,Mf,gg,vl,Ad=!1,Cd=[],Li=null,Vi=null,ks=null,to=new Map,hc=new Map,Ui=[],yg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fc(i,l){switch(i){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":ks=null;break;case"pointerover":case"pointerout":to.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":hc.delete(l.pointerId)}}function pc(i,l,d,f,j,C){return i===null||i.nativeEvent!==C?(i={blockedOn:l,domEventName:d,eventSystemFlags:f,nativeEvent:C,targetContainers:[j]},l!==null&&(l=Fm(l),l!==null&&cn(l)),i):(i.eventSystemFlags|=f,l=i.targetContainers,j!==null&&l.indexOf(j)===-1&&l.push(j),i)}function vg(i,l,d,f,j){switch(l){case"focusin":return Li=pc(Li,i,l,d,f,j),!0;case"dragenter":return Vi=pc(Vi,i,l,d,f,j),!0;case"mouseover":return ks=pc(ks,i,l,d,f,j),!0;case"pointerover":var C=j.pointerId;return to.set(C,pc(to.get(C)||null,i,l,d,f,j)),!0;case"gotpointercapture":return C=j.pointerId,hc.set(C,pc(hc.get(C)||null,i,l,d,f,j)),!0}return!1}function Lf(i){var l=Cc(i.target);if(l!==null){var d=na(l);if(d!==null){if(l=d.tag,l===13){if(l=Mi(d),l!==null){i.blockedOn=l,vl(i.priority,function(){Mf(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function so(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var d=xm(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(d===null){d=i.nativeEvent;var f=new d.constructor(d.type,d);Rt=f,d.target.dispatchEvent(f),Rt=null}else return l=Fm(d),l!==null&&cn(l),i.blockedOn=d,!1;l.shift()}return!0}function hm(i,l,d){so(i)&&d.delete(l)}function fm(){Ad=!1,Li!==null&&so(Li)&&(Li=null),Vi!==null&&so(Vi)&&(Vi=null),ks!==null&&so(ks)&&(ks=null),to.forEach(hm),hc.forEach(hm)}function Nr(i,l){i.blockedOn===l&&(i.blockedOn=null,Ad||(Ad=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fm)))}function no(i){function l(j){return Nr(j,i)}if(0<Cd.length){Nr(Cd[0],i);for(var d=1;d<Cd.length;d++){var f=Cd[d];f.blockedOn===i&&(f.blockedOn=null)}}for(Li!==null&&Nr(Li,i),Vi!==null&&Nr(Vi,i),ks!==null&&Nr(ks,i),to.forEach(l),hc.forEach(l),d=0;d<Ui.length;d++)f=Ui[d],f.blockedOn===i&&(f.blockedOn=null);for(;0<Ui.length&&(d=Ui[0],d.blockedOn===null);)Lf(d),d.blockedOn===null&&Ui.shift()}var ro=L.ReactCurrentBatchConfig,Sd=!0;function pm(i,l,d,f){var j=Fs,C=ro.transition;ro.transition=null;try{Fs=1,tr(i,l,d,f)}finally{Fs=j,ro.transition=C}}function xc(i,l,d,f){var j=Fs,C=ro.transition;ro.transition=null;try{Fs=4,tr(i,l,d,f)}finally{Fs=j,ro.transition=C}}function tr(i,l,d,f){if(Sd){var j=xm(i,l,d,f);if(j===null)Cg(i,l,f,kd,d),fc(i,f);else if(vg(j,i,l,d,f))f.stopPropagation();else if(fc(i,f),l&4&&-1<yg.indexOf(i)){for(;j!==null;){var C=Fm(j);if(C!==null&&Rf(C),C=xm(i,l,d,f),C===null&&Cg(i,l,f,kd,d),C===j)break;j=C}j!==null&&f.stopPropagation()}else Cg(i,l,f,null,d)}}var kd=null;function xm(i,l,d,f){if(kd=null,i=Os(f),i=Cc(i),i!==null)if(l=na(i),l===null)i=null;else if(d=l.tag,d===13){if(i=Mi(l),i!==null)return i;i=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return kd=i,null}function gm(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Nn()){case wn:return 1;case En:return 4;case yl:case rt:return 16;case uc:return 536870912;default:return 16}default:return 16}}var oi=null,gc=null,$d=null;function ym(){if($d)return $d;var i,l=gc,d=l.length,f,j="value"in oi?oi.value:oi.textContent,C=j.length;for(i=0;i<d&&l[i]===j[i];i++);var I=d-i;for(f=1;f<=I&&l[d-f]===j[C-f];f++);return $d=j.slice(i,1<f?1-f:void 0)}function Pd(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Ed(){return!0}function Vf(){return!1}function Vr(i){function l(d,f,j,C,I){this._reactName=d,this._targetInst=j,this.type=f,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var ee in i)i.hasOwnProperty(ee)&&(d=i[ee],this[ee]=d?d(C):C[ee]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Ed:Vf,this.isPropagationStopped=Vf,this}return ge(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),l}var ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vm=Vr(ao),yc=ge({},ao,{view:0,detail:0}),jg=Vr(yc),jm,bm,io,vc=ge({},yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==io&&(io&&i.type==="mousemove"?(jm=i.screenX-io.screenX,bm=i.screenY-io.screenY):bm=jm=0,io=i),jm)},movementY:function(i){return"movementY"in i?i.movementY:bm}}),Nm=Vr(vc),Uf=ge({},vc,{dataTransfer:0}),zf=Vr(Uf),Td=ge({},yc,{relatedTarget:0}),_d=Vr(Td),qf=ge({},ao,{animationName:0,elapsedTime:0,pseudoElement:0}),Wf=Vr(qf),Bf=ge({},ao,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Kf=Vr(Bf),Hf=ge({},ao,{data:0}),wm=Vr(Hf),Gf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Yf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qf(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=Yf[i])?!!l[i]:!1}function Id(){return Qf}var Xf=ge({},yc,{key:function(i){if(i.key){var l=Gf[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Pd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Zf[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(i){return i.type==="keypress"?Pd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Pd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Jf=Vr(Xf),ep=ge({},vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Am=Vr(ep),tp=ge({},yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),sp=Vr(tp),np=ge({},ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),rp=Vr(np),ap=ge({},vc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ip=Vr(ap),lp=[9,13,27,32],Dd=u&&"CompositionEvent"in window,lo=null;u&&"documentMode"in document&&(lo=document.documentMode);var op=u&&"TextEvent"in window&&!lo,Cm=u&&(!Dd||lo&&8<lo&&11>=lo),Sm=" ",km=!1;function $m(i,l){switch(i){case"keyup":return lp.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pm(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var jl=!1;function cp(i,l){switch(i){case"compositionend":return Pm(l);case"keypress":return l.which!==32?null:(km=!0,Sm);case"textInput":return i=l.data,i===Sm&&km?null:i;default:return null}}function v(i,l){if(jl)return i==="compositionend"||!Dd&&$m(i,l)?(i=ym(),$d=gc=oi=null,jl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Cm&&l.locale!=="ko"?null:l.data;default:return null}}var Q={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pe(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Q[i.type]:l==="textarea"}function qe(i,l,d,f){ds(f),l=mp(l,"onChange"),0<l.length&&(d=new vm("onChange","change",null,d,f),i.push({event:d,listeners:l}))}var dt=null,bs=null;function _s(i){Kj(i,0)}function Wt(i){var l=Ld(i);if(Be(l))return i}function Yn(i,l){if(i==="change")return l}var bl=!1;if(u){var tn;if(u){var oo="oninput"in document;if(!oo){var jc=document.createElement("div");jc.setAttribute("oninput","return;"),oo=typeof jc.oninput=="function"}tn=oo}else tn=!1;bl=tn&&(!document.documentMode||9<document.documentMode)}function is(){dt&&(dt.detachEvent("onpropertychange",fs),bs=dt=null)}function fs(i){if(i.propertyName==="value"&&Wt(bs)){var l=[];qe(l,bs,i,Os(i)),bn(_s,l)}}function mr(i,l,d){i==="focusin"?(is(),dt=l,bs=d,dt.attachEvent("onpropertychange",fs)):i==="focusout"&&is()}function Wn(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Wt(bs)}function co(i,l){if(i==="click")return Wt(l)}function bg(i,l){if(i==="input"||i==="change")return Wt(l)}function Ns(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var An=typeof Object.is=="function"?Object.is:Ns;function wr(i,l){if(An(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var d=Object.keys(i),f=Object.keys(l);if(d.length!==f.length)return!1;for(f=0;f<d.length;f++){var j=d[f];if(!h.call(l,j)||!An(i[j],l[j]))return!1}return!0}function Qn(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Ar(i,l){var d=Qn(i);i=0;for(var f;d;){if(d.nodeType===3){if(f=i+d.textContent.length,i<=l&&f>=l)return{node:d,offset:l-i};i=f}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Qn(d)}}function Cr(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Cr(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function Ma(){for(var i=window,l=ht();l instanceof i.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)i=l.contentWindow;else break;l=ht(i.document)}return l}function ci(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function di(i){var l=Ma(),d=i.focusedElem,f=i.selectionRange;if(l!==d&&d&&d.ownerDocument&&Cr(d.ownerDocument.documentElement,d)){if(f!==null&&ci(d)){if(l=f.start,i=f.end,i===void 0&&(i=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(i,d.value.length);else if(i=(l=d.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var j=d.textContent.length,C=Math.min(f.start,j);f=f.end===void 0?C:Math.min(f.end,j),!i.extend&&C>f&&(j=f,f=C,C=j),j=Ar(d,C);var I=Ar(d,f);j&&I&&(i.rangeCount!==1||i.anchorNode!==j.node||i.anchorOffset!==j.offset||i.focusNode!==I.node||i.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(j.node,j.offset),i.removeAllRanges(),C>f?(i.addRange(l),i.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),i.addRange(l)))}}for(l=[],i=d;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)i=l[d],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var aa=u&&"documentMode"in document&&11>=document.documentMode,Sr=null,Od=null,Nl=null,wl=!1;function zi(i,l,d){var f=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;wl||Sr==null||Sr!==ht(f)||(f=Sr,"selectionStart"in f&&ci(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Nl&&wr(Nl,f)||(Nl=f,f=mp(Od,"onSelect"),0<f.length&&(l=new vm("onSelect","select",null,l,d),i.push({event:l,listeners:f}),l.target=Sr)))}function ui(i,l){var d={};return d[i.toLowerCase()]=l.toLowerCase(),d["Webkit"+i]="webkit"+l,d["Moz"+i]="moz"+l,d}var ba={animationend:ui("Animation","AnimationEnd"),animationiteration:ui("Animation","AnimationIteration"),animationstart:ui("Animation","AnimationStart"),transitionend:ui("Transition","TransitionEnd")},Fd={},bc={};u&&(bc=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function Em(i){if(Fd[i])return Fd[i];if(!ba[i])return i;var l=ba[i],d;for(d in l)if(l.hasOwnProperty(d)&&d in bc)return Fd[i]=l[d];return i}var dp=Em("animationend"),Tm=Em("animationiteration"),Nc=Em("animationstart"),wc=Em("transitionend"),Ac=new Map,zs="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ur(i,l){Ac.set(i,l),o(l,[i])}for(var Ng=0;Ng<zs.length;Ng++){var wg=zs[Ng],$I=wg.toLowerCase(),PI=wg[0].toUpperCase()+wg.slice(1);Ur($I,"on"+PI)}Ur(dp,"onAnimationEnd"),Ur(Tm,"onAnimationIteration"),Ur(Nc,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(wc,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focu
38sin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _m="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),EI=new Set("cancel close invalid load scroll toggle".split(" ").concat(_m));function Bj(i,l,d){var f=i.type||"unknown-event";i.currentTarget=d,Ss(f,l,void 0,i),i.currentTarget=null}function Kj(i,l){l=(l&4)!==0;for(var d=0;d<i.length;d++){var f=i[d],j=f.event;f=f.listeners;e:{var C=void 0;if(l)for(var I=f.length-1;0<=I;I--){var ee=f[I],pe=ee.instance,Oe=ee.currentTarget;if(ee=ee.listener,pe!==C&&j.isPropagationStopped())break e;Bj(j,ee,Oe),C=pe}else for(I=0;I<f.length;I++){if(ee=f[I],pe=ee.instance,Oe=ee.currentTarget,ee=ee.listener,pe!==C&&j.isPropagationStopped())break e;Bj(j,ee,Oe),C=pe}}}if(gl)throw i=ai,gl=!1,ai=null,i}function gn(i,l){var d=l[Tg];d===void 0&&(d=l[Tg]=new Set);var f=i+"__bubble";d.has(f)||(Hj(l,i,2,!1),d.add(f))}function Ag(i,l,d){var f=0;l&&(f|=4),Hj(d,i,f,l)}var up="_reactListening"+Math.random().toString(36).slice(2);function Im(i){if(!i[up]){i[up]=!0,r.forEach(function(d){d!=="selectionchange"&&(EI.has(d)||Ag(d,!1,i),Ag(d,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[up]||(l[up]=!0,Ag("selectionchange",!1,l))}}function Hj(i,l,d,f){switch(gm(l)){case 1:var j=pm;break;case 4:j=xc;break;default:j=tr}d=j.bind(null,l,d,i),j=void 0,!ur||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(j=!0),f?j!==void 0?i.addEventListener(l,d,{capture:!0,passive:j}):i.addEventListener(l,d,!0):j!==void 0?i.addEventListener(l,d,{passive:j}):i.addEventListener(l,d,!1)}function Cg(i,l,d,f,j){var C=f;if((l&1)===0&&(l&2)===0&&f!==null)e:for(;;){if(f===null)return;var I=f.tag;if(I===3||I===4){var ee=f.stateNode.containerInfo;if(ee===j||ee.nodeType===8&&ee.parentNode===j)break;if(I===4)for(I=f.return;I!==null;){var pe=I.tag;if((pe===3||pe===4)&&(pe=I.stateNode.containerInfo,pe===j||pe.nodeType===8&&pe.parentNode===j))return;I=I.return}for(;ee!==null;){if(I=Cc(ee),I===null)return;if(pe=I.tag,pe===5||pe===6){f=C=I;continue e}ee=ee.parentNode}}f=f.return}bn(function(){var Oe=C,et=Os(d),at=[];e:{var Je=Ac.get(i);if(Je!==void 0){var Nt=vm,Et=i;switch(i){case"keypress":if(Pd(d)===0)break e;case"keydown":case"keyup":Nt=Jf;break;case"focusin":Et="focus",Nt=_d;break;case"focusout":Et="blur",Nt=_d;break;case"beforeblur":case"afterblur":Nt=_d;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Nt=Nm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Nt=zf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Nt=sp;break;case dp:case Tm:case Nc:Nt=Wf;break;case wc:Nt=rp;break;case"scroll":Nt=jg;break;case"wheel":Nt=ip;break;case"copy":case"cut":case"paste":Nt=Kf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Nt=Am}var Tt=(l&4)!==0,Rn=!Tt&&i==="scroll",Ee=Tt?Je!==null?Je+"Capture":null:Je;Tt=[];for(var ye=Oe,Ie;ye!==null;){Ie=ye;var ot=Ie.stateNode;if(Ie.tag===5&&ot!==null&&(Ie=ot,Ee!==null&&(ot=ya(ye,Ee),ot!=null&&Tt.push(Dm(ye,ot,Ie)))),Rn)break;ye=ye.return}0<Tt.length&&(Je=new Nt(Je,Et,null,d,et),at.push({event:Je,listeners:Tt}))}}if((l&7)===0){e:{if(Je=i==="mouseover"||i==="pointerover",Nt=i==="mouseout"||i==="pointerout",Je&&d!==Rt&&(Et=d.relatedTarget||d.fromElement)&&(Cc(Et)||Et[Al]))break e;if((Nt||Je)&&(Je=et.window===et?et:(Je=et.ownerDocument)?Je.defaultView||Je.parentWindow:window,Nt?(Et=d.relatedTarget||d.toElement,Nt=Oe,Et=Et?Cc(Et):null,Et!==null&&(Rn=na(Et),Et!==Rn||Et.tag!==5&&Et.tag!==6)&&(Et=null)):(Nt=null,Et=Oe),Nt!==Et)){if(Tt=Nm,ot="onMouseLeave",Ee="onMouseEnter",ye="mouse",(i==="pointerout"||i==="pointerover")&&(Tt=Am,ot="onPointerLeave",Ee="onPointerEnter",ye="pointer"),Rn=Nt==null?Je:Ld(Nt),Ie=Et==null?Je:Ld(Et),Je=new Tt(ot,ye+"leave",Nt,d,et),Je.target=Rn,Je.relatedTarget=Ie,ot=null,Cc(et)===Oe&&(Tt=new Tt(Ee,ye+"enter",Et,d,et),Tt.target=Ie,Tt.relatedTarget=Rn,ot=Tt),Rn=ot,Nt&&Et)t:{for(Tt=Nt,Ee=Et,ye=0,Ie=Tt;Ie;Ie=Rd(Ie))ye++;for(Ie=0,ot=Ee;ot;ot=Rd(ot))Ie++;for(;0<ye-Ie;)Tt=Rd(Tt),ye--;for(;0<Ie-ye;)Ee=Rd(Ee),Ie--;for(;ye--;){if(Tt===Ee||Ee!==null&&Tt===Ee.alternate)break t;Tt=Rd(Tt),Ee=Rd(Ee)}Tt=null}else Tt=null;Nt!==null&&Gj(at,Je,Nt,Tt,!1),Et!==null&&Rn!==null&&Gj(at,Rn,Et,Tt,!0)}}
vendor: 1,777 bytes, line 38
38e:{if(Je=Oe?Ld(Oe):window,Nt=Je.nodeName&&Je.nodeName.toLowerCase(),Nt==="select"||Nt==="input"&&Je.type==="file")var Dt=Yn;else if(Pe(Je))if(bl)Dt=bg;else{Dt=Wn;var Bt=mr}else(Nt=Je.nodeName)&&Nt.toLowerCase()==="input"&&(Je.type==="checkbox"||Je.type==="radio")&&(Dt=co);if(Dt&&(Dt=Dt(i,Oe))){qe(at,Dt,d,et);break e}Bt&&Bt(i,Je,Oe),i==="focusout"&&(Bt=Je._wrapperState)&&Bt.controlled&&Je.type==="number"&&X(Je,"number",Je.value)}switch(Bt=Oe?Ld(Oe):window,i){case"focusin":(Pe(Bt)||Bt.contentEditable==="true")&&(Sr=Bt,Od=Oe,Nl=null);break;case"focusout":Nl=Od=Sr=null;break;case"mousedown":wl=!0;break;case"contextmenu":case"mouseup":case"dragend":wl=!1,zi(at,d,et);break;case"selectionchange":if(aa)break;case"keydown":case"keyup":zi(at,d,et)}var Kt;if(Dd)e:{switch(i){case"compositionstart":var ls="onCompositionStart";break e;case"compositionend":ls="onCompositionEnd";break e;case"compositionupdate":ls="onCompositionUpdate";break e}ls=void 0}else jl?$m(i,d)&&(ls="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(ls="onCompositionStart");ls&&(Cm&&d.locale!=="ko"&&(jl||ls!=="onCompositionStart"?ls==="onCompositionEnd"&&jl&&(Kt=ym()):(oi=et,gc="value"in oi?oi.value:oi.textContent,jl=!0)),Bt=mp(Oe,ls),0<Bt.length&&(ls=new wm(ls,i,null,d,et),at.push({event:ls,listeners:Bt}),Kt?ls.data=Kt:(Kt=Pm(d),Kt!==null&&(ls.data=Kt)))),(Kt=op?cp(i,d):v(i,d))&&(Oe=mp(Oe,"onBeforeInput"),0<Oe.length&&(et=new wm("onBeforeInput","beforeinput",null,d,et),at.push({event:et,listeners:Oe}),et.data=Kt))}Kj(at,l)})}function Dm(i,l,d){return{instance:i,listener:l,currentTarget:d}}function mp(i,l){for(var d=l+"Capture",f=[];i!==null;){var j=i,C=j.stateNode;j.tag===5&&C!==null&&(j=C,C=ya(i,d),C!=null&&f.unshift(Dm(i,C,j)),C=ya(i,l),C!=null&&f.push(Dm(i,C,j))),i=i.return}return f}
vendor: 6,673 bytes, lines 38-39
38function Rd(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Gj(i,l,d,f,j){for(var C=l._reactName,I=[];d!==null&&d!==f;){var ee=d,pe=ee.alternate,Oe=ee.stateNode;if(pe!==null&&pe===f)break;ee.tag===5&&Oe!==null&&(ee=Oe,j?(pe=ya(d,C),pe!=null&&I.unshift(Dm(d,pe,ee))):j||(pe=ya(d,C),pe!=null&&I.push(Dm(d,pe,ee)))),d=d.return}I.length!==0&&i.push({event:l,listeners:I})}var TI=/\r\n?/g,_I=/\u0000|\uFFFD/g;function Zj(i){return(typeof i=="string"?i:""+i).replace(TI,` 39`).replace(_I,"")}function hp(i,l,d){if(l=Zj(l),Zj(i)!==l&&d)throw Error(n(425))}function fp(){}var Sg=null,kg=null;function $g(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Pg=typeof setTimeout=="function"?setTimeout:void 0,II=typeof clearTimeout=="function"?clearTimeout:void 0,Yj=typeof Promise=="function"?Promise:void 0,DI=typeof queueMicrotask=="function"?queueMicrotask:typeof Yj<"u"?function(i){return Yj.resolve(null).then(i).catch(OI)}:Pg;function OI(i){setTimeout(function(){throw i})}function Eg(i,l){var d=l,f=0;do{var j=d.nextSibling;if(i.removeChild(d),j&&j.nodeType===8)if(d=j.data,d==="/$"){if(f===0){i.removeChild(j),no(l);return}f--}else d!=="$"&&d!=="$?"&&d!=="$!"||f++;d=j}while(d);no(l)}function uo(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function Qj(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return i;l--}else d==="/$"&&l++}i=i.previousSibling}return null}var Md=Math.random().toString(36).slice(2),qi="__reactFiber$"+Md,Om="__reactProps$"+Md,Al="__reactContainer$"+Md,Tg="__reactEvents$"+Md,FI="__reactListeners$"+Md,RI="__reactHandles$"+Md;function Cc(i){var l=i[qi];if(l)return l;for(var d=i.parentNode;d;){if(l=d[Al]||d[qi]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(i=Qj(i);i!==null;){if(d=i[qi])return d;i=Qj(i)}return l}i=d,d=i.parentNode}return null}function Fm(i){return i=i[qi]||i[Al],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Ld(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function pp(i){return i[Om]||null}var _g=[],Vd=-1;function mo(i){return{current:i}}function yn(i){0>Vd||(i.current=_g[Vd],_g[Vd]=null,Vd--)}function fn(i,l){Vd++,_g[Vd]=i.current,i.current=l}var ho={},kr=mo(ho),ia=mo(!1),Sc=ho;function Ud(i,l){var d=i.type.contextTypes;if(!d)return ho;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===l)return f.__reactInternalMemoizedMaskedChildContext;var j={},C;for(C in d)j[C]=l[C];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=j),j}function la(i){return i=i.childContextTypes,i!=null}function xp(){yn(ia),yn(kr)}function Xj(i,l,d){if(kr.current!==ho)throw Error(n(168));fn(kr,l),fn(ia,d)}function Jj(i,l,d){var f=i.stateNode;if(l=l.childContextTypes,typeof f.getChildContext!="function")return d;f=f.getChildContext();for(var j in f)if(!(j in l))throw Error(n(108,re(i)||"Unknown",j));return ge({},d,f)}function gp(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ho,Sc=kr.current,fn(kr,i),fn(ia,ia.current),!0}function e4(i,l,d){var f=i.stateNode;if(!f)throw Error(n(169));d?(i=Jj(i,l,Sc),f.__reactInternalMemoizedMergedChildContext=i,yn(ia),yn(kr),fn(kr,i)):yn(ia),fn(ia,d)}var Cl=null,yp=!1,Ig=!1;function t4(i){Cl===null?Cl=[i]:Cl.push(i)}function MI(i){yp=!0,t4(i)}function fo(){if(!Ig&&Cl!==null){Ig=!0;var i=0,l=Fs;try{var d=Cl;for(Fs=1;i<d.length;i++){var f=d[i];do f=f(!0);while(f!==null)}Cl=null,yp=!1}catch(j){throw Cl!==null&&(Cl=Cl.slice(i+1)),Xe(wn,fo),j}finally{Fs=l,Ig=!1}}return null}var zd=[],qd=0,vp=null,jp=0,La=[],Va=0,kc=null,Sl=1,kl="";function $c(i,l){zd[qd++]=jp,zd[qd++]=vp,vp=i,jp=l}function s4(i,l,d){La[Va++]=Sl,La[Va++]=kl,La[Va++]=kc,kc=i;var f=Sl;i=kl;var j=32-va(f)-1;f&=~(1<<j),d+=1;var C=32-va(l)+j;if(30<C){var I=j-j%5;C=(f&(1<<I)-1).toString(32),f>>=I,j-=I,Sl=1<<32-va(l)+j|d<<j|f,kl=C+i}else Sl=1<<C|d<<j|f,kl=i}function Dg(i){i.return!==null&&($c(i,1),s4(i,1,0))}function Og(i){for(;i===vp;)vp=zd[--qd],zd[qd]=null,jp=zd[--qd],zd[qd]=null;for(;i===kc;)kc=La[--Va],La[Va]=null,kl=La[--Va],La[Va]=null,Sl=La[--Va],La[Va]=null}var Na=null,wa=null,jn=!1,mi=null;function n4(i,l){var d=Wa(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=i,l=i.deletions,l===null?(i.deletions=[d],i.flags|=16):l.push(d)}function r4(i,l){switch(i.tag){case 5:var d=i.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,Na=i,wa=uo(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,Na=i,wa=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=kc!==null?{id:Sl,overflow:kl}:null,i.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=Wa(18,null,null,0),d.stateNode=l,d.return=i,i.child=d,Na=i,wa=null,!0):!1;default:return!1}}function Fg(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Rg(i){if(jn){var l=wa;if(l){var d=l;if(!r4(i,l)){if(Fg(i))throw Error(n(418));l=uo(d.nextSibling);var f=Na;l&&r4(i,l)?n4(f,d):(i.flags=i.flags&-4097|2,jn=!1,Na=i)}}else{if(Fg(i))throw Error(n(418));i.flags=i.flags&-4097|2,jn=!1,Na=i}}}function a4(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Na=i}function bp(i){if(i!==Na)return!1;if(!jn)return a4(i),jn=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!$g(i.type,i.memoizedProps)),l&&(l=wa)){if(Fg(i))throw i4(),Error(n(418));for(;l;)n4(i,l),l=uo(l.nextSibling)}if(a4(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="/$"){if(l===0){wa=uo(i.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}i=i.nextSibling}wa=null}}else wa=Na?uo(i.stateNode.nextSibling):null;return!0}function i4(){for(var i=wa;i;)i=uo(i.nextSibling)}function Wd(){wa=Na=null,jn=!1}function Mg(i){mi===null?mi=[i]:mi.push(i)}var LI=L.ReactCurrentBatchConfig;function Rm(i,l,d){if(i=d.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var f=d.stateNode}if(!f)throw Error(n(147,i));var j=f,C=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(I){var ee=j.refs;I===null?delete ee[C]:ee[C]=I},l._stringRef=C,l)}
vendor: 4,800 bytes, line 39
39if(typeof i!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,i))}return i}function Np(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function l4(i){var l=i._init;return l(i._payload)}function o4(i){function l(Ee,ye){if(i){var Ie=Ee.deletions;Ie===null?(Ee.deletions=[ye],Ee.flags|=16):Ie.push(ye)}}function d(Ee,ye){if(!i)return null;for(;ye!==null;)l(Ee,ye),ye=ye.sibling;return null}function f(Ee,ye){for(Ee=new Map;ye!==null;)ye.key!==null?Ee.set(ye.key,ye):Ee.set(ye.index,ye),ye=ye.sibling;return Ee}function j(Ee,ye){return Ee=No(Ee,ye),Ee.index=0,Ee.sibling=null,Ee}function C(Ee,ye,Ie){return Ee.index=Ie,i?(Ie=Ee.alternate,Ie!==null?(Ie=Ie.index,Ie<ye?(Ee.flags|=2,ye):Ie):(Ee.flags|=2,ye)):(Ee.flags|=1048576,ye)}function I(Ee){return i&&Ee.alternate===null&&(Ee.flags|=2),Ee}function ee(Ee,ye,Ie,ot){return ye===null||ye.tag!==6?(ye=Py(Ie,Ee.mode,ot),ye.return=Ee,ye):(ye=j(ye,Ie),ye.return=Ee,ye)}function pe(Ee,ye,Ie,ot){var Dt=Ie.type;return Dt===H?et(Ee,ye,Ie.props.children,ot,Ie.key):ye!==null&&(ye.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===le&&l4(Dt)===ye.type)?(ot=j(ye,Ie.props),ot.ref=Rm(Ee,ye,Ie),ot.return=Ee,ot):(ot=Kp(Ie.type,Ie.key,Ie.props,null,Ee.mode,ot),ot.ref=Rm(Ee,ye,Ie),ot.return=Ee,ot)}function Oe(Ee,ye,Ie,ot){return ye===null||ye.tag!==4||ye.stateNode.containerInfo!==Ie.containerInfo||ye.stateNode.implementation!==Ie.implementation?(ye=Ey(Ie,Ee.mode,ot),ye.return=Ee,ye):(ye=j(ye,Ie.children||[]),ye.return=Ee,ye)}function et(Ee,ye,Ie,ot,Dt){return ye===null||ye.tag!==7?(ye=Fc(Ie,Ee.mode,ot,Dt),ye.return=Ee,ye):(ye=j(ye,Ie),ye.return=Ee,ye)}function at(Ee,ye,Ie){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return ye=Py(""+ye,Ee.mode,Ie),ye.return=Ee,ye;if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case B:return Ie=Kp(ye.type,ye.key,ye.props,null,Ee.mode,Ie),Ie.ref=Rm(Ee,null,ye),Ie.return=Ee,Ie;case z:return ye=Ey(ye,Ee.mode,Ie),ye.return=Ee,ye;case le:var ot=ye._init;return at(Ee,ot(ye._payload),Ie)}if(_e(ye)||ue(ye))return ye=Fc(ye,Ee.mode,Ie,null),ye.return=Ee,ye;Np(Ee,ye)}return null}function Je(Ee,ye,Ie,ot){var Dt=ye!==null?ye.key:null;if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number")return Dt!==null?null:ee(Ee,ye,""+Ie,ot);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case B:return Ie.key===Dt?pe(Ee,ye,Ie,ot):null;case z:return Ie.key===Dt?Oe(Ee,ye,Ie,ot):null;case le:return Dt=Ie._init,Je(Ee,ye,Dt(Ie._payload),ot)}if(_e(Ie)||ue(Ie))return Dt!==null?null:et(Ee,ye,Ie,ot,null);Np(Ee,Ie)}return null}function Nt(Ee,ye,Ie,ot,Dt){if(typeof ot=="string"&&ot!==""||typeof ot=="number")return Ee=Ee.get(Ie)||null,ee(ye,Ee,""+ot,Dt);if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case B:return Ee=Ee.get(ot.key===null?Ie:ot.key)||null,pe(ye,Ee,ot,Dt);case z:return Ee=Ee.get(ot.key===null?Ie:ot.key)||null,Oe(ye,Ee,ot,Dt);case le:var Bt=ot._init;return Nt(Ee,ye,Ie,Bt(ot._payload),Dt)}if(_e(ot)||ue(ot))return Ee=Ee.get(Ie)||null,et(ye,Ee,ot,Dt,null);Np(ye,ot)}return null}function Et(Ee,ye,Ie,ot){for(var Dt=null,Bt=null,Kt=ye,ls=ye=0,rr=null;Kt!==null&&ls<Ie.length;ls++){Kt.index>ls?(rr=Kt,Kt=null):rr=Kt.sibling;var Ys=Je(Ee,Kt,Ie[ls],ot);if(Ys===null){Kt===null&&(Kt=rr);break}i&&Kt&&Ys.alternate===null&&l(Ee,Kt),ye=C(Ys,ye,ls),Bt===null?Dt=Ys:Bt.sibling=Ys,Bt=Ys,Kt=rr}if(ls===Ie.length)return d(Ee,Kt),jn&&$c(Ee,ls),Dt;if(Kt===null){for(;ls<Ie.length;ls++)Kt=at(Ee,Ie[ls],ot),Kt!==null&&(ye=C(Kt,ye,ls),Bt===null?Dt=Kt:Bt.sibling=Kt,Bt=Kt);return jn&&$c(Ee,ls),Dt}for(Kt=f(Ee,Kt);ls<Ie.length;ls++)rr=Nt(Kt,Ee,ls,Ie[ls],ot),rr!==null&&(i&&rr.alternate!==null&&Kt.delete(rr.key===null?ls:rr.key),ye=C(rr,ye,ls),Bt===null?Dt=rr:Bt.sibling=rr,Bt=rr);return i&&Kt.forEach(function(wo){return l(Ee,wo)}),jn&&$c(Ee,ls),Dt}function Tt(Ee,ye,Ie,ot){var Dt=ue(Ie);if(typeof Dt!="function")throw Error(n(150));if(Ie=Dt.call(Ie),Ie==null)throw Error(n(151));for(var Bt=Dt=null,Kt=ye,ls=ye=0,rr=null,Ys=Ie.next();Kt!==null&&!Ys.done;ls++,Ys=Ie.next()){Kt.index>ls?(rr=Kt,Kt=null):rr=Kt.sibling;var wo=Je(Ee,Kt,Ys.value,ot);if(wo===null){Kt===null&&(Kt=rr);break}i&&Kt&&wo.alternate===null&&l(Ee,Kt),ye=C(wo,ye,ls),Bt===null?Dt=wo:Bt.sibling=wo,Bt=wo,Kt=rr}if(Ys.done)return d(Ee,Kt),jn&&$c(Ee,ls),Dt;if(Kt===null){for(;!Ys.done;ls++,Ys=Ie.next())Ys=at(Ee,Ys.value,ot),Ys!==null&&(ye=C(Ys,ye,ls),Bt===null?Dt=Ys:Bt.sibling=Ys,Bt=Ys);return jn&&$c(Ee,ls),Dt}for(Kt=f(Ee,Kt);!Ys.done;ls++,Ys=Ie.next())Ys=Nt(Kt,Ee,ls,Ys.value,ot),Ys!==null&&(i&&Ys.alternate!==null&&Kt.delete(Ys.key===null?ls:Ys.key),ye=C(Ys,ye,ls),Bt===null?Dt=Ys:Bt.sibling=Ys,Bt=Ys);return i&&Kt.forEach(function(yD){return l(Ee,yD)}),jn&&$c(Ee,ls),Dt}function Rn(Ee,ye,Ie,ot){if(typeof Ie=="object"&&Ie!==null&&Ie.type===
vendor: 8,388 bytes, line 39
39H&&Ie.key===null&&(Ie=Ie.props.children),typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case B:e:{for(var Dt=Ie.key,Bt=ye;Bt!==null;){if(Bt.key===Dt){if(Dt=Ie.type,Dt===H){if(Bt.tag===7){d(Ee,Bt.sibling),ye=j(Bt,Ie.props.children),ye.return=Ee,Ee=ye;break e}}else if(Bt.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===le&&l4(Dt)===Bt.type){d(Ee,Bt.sibling),ye=j(Bt,Ie.props),ye.ref=Rm(Ee,Bt,Ie),ye.return=Ee,Ee=ye;break e}d(Ee,Bt);break}else l(Ee,Bt);Bt=Bt.sibling}Ie.type===H?(ye=Fc(Ie.props.children,Ee.mode,ot,Ie.key),ye.return=Ee,Ee=ye):(ot=Kp(Ie.type,Ie.key,Ie.props,null,Ee.mode,ot),ot.ref=Rm(Ee,ye,Ie),ot.return=Ee,Ee=ot)}return I(Ee);case z:e:{for(Bt=Ie.key;ye!==null;){if(ye.key===Bt)if(ye.tag===4&&ye.stateNode.containerInfo===Ie.containerInfo&&ye.stateNode.implementation===Ie.implementation){d(Ee,ye.sibling),ye=j(ye,Ie.children||[]),ye.return=Ee,Ee=ye;break e}else{d(Ee,ye);break}else l(Ee,ye);ye=ye.sibling}ye=Ey(Ie,Ee.mode,ot),ye.return=Ee,Ee=ye}return I(Ee);case le:return Bt=Ie._init,Rn(Ee,ye,Bt(Ie._payload),ot)}if(_e(Ie))return Et(Ee,ye,Ie,ot);if(ue(Ie))return Tt(Ee,ye,Ie,ot);Np(Ee,Ie)}return typeof Ie=="string"&&Ie!==""||typeof Ie=="number"?(Ie=""+Ie,ye!==null&&ye.tag===6?(d(Ee,ye.sibling),ye=j(ye,Ie),ye.return=Ee,Ee=ye):(d(Ee,ye),ye=Py(Ie,Ee.mode,ot),ye.return=Ee,Ee=ye),I(Ee)):d(Ee,ye)}return Rn}var Bd=o4(!0),c4=o4(!1),wp=mo(null),Ap=null,Kd=null,Lg=null;function Vg(){Lg=Kd=Ap=null}function Ug(i){var l=wp.current;yn(wp),i._currentValue=l}function zg(i,l,d){for(;i!==null;){var f=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,f!==null&&(f.childLanes|=l)):f!==null&&(f.childLanes&l)!==l&&(f.childLanes|=l),i===d)break;i=i.return}}function Hd(i,l){Ap=i,Lg=Kd=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(oa=!0),i.firstContext=null)}function Ua(i){var l=i._currentValue;if(Lg!==i)if(i={context:i,memoizedValue:l,next:null},Kd===null){if(Ap===null)throw Error(n(308));Kd=i,Ap.dependencies={lanes:0,firstContext:i}}else Kd=Kd.next=i;return l}var Pc=null;function qg(i){Pc===null?Pc=[i]:Pc.push(i)}function d4(i,l,d,f){var j=l.interleaved;return j===null?(d.next=d,qg(l)):(d.next=j.next,j.next=d),l.interleaved=d,$l(i,f)}function $l(i,l){i.lanes|=l;var d=i.alternate;for(d!==null&&(d.lanes|=l),d=i,i=i.return;i!==null;)i.childLanes|=l,d=i.alternate,d!==null&&(d.childLanes|=l),d=i,i=i.return;return d.tag===3?d.stateNode:null}var po=!1;function Wg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u4(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Pl(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function xo(i,l,d){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(Bs&2)!==0){var j=f.pending;return j===null?l.next=l:(l.next=j.next,j.next=l),f.pending=l,$l(i,d)}return j=f.interleaved,j===null?(l.next=l,qg(f)):(l.next=j.next,j.next=l),f.interleaved=l,$l(i,d)}function Cp(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var f=l.lanes;f&=i.pendingLanes,d|=f,l.lanes=d,wd(i,d)}}function m4(i,l){var d=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,d===f)){var j=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var I={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?j=C=I:C=C.next=I,d=d.next}while(d!==null);C===null?j=C=l:C=C.next=l}else j=C=l;d={baseState:f.baseState,firstBaseUpdate:j,lastBaseUpdate:C,shared:f.shared,effects:f.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}function Sp(i,l,d,f){var j=i.updateQueue;po=!1;var C=j.firstBaseUpdate,I=j.lastBaseUpdate,ee=j.shared.pending;if(ee!==null){j.shared.pending=null;var pe=ee,Oe=pe.next;pe.next=null,I===null?C=Oe:I.next=Oe,I=pe;var et=i.alternate;et!==null&&(et=et.updateQueue,ee=et.lastBaseUpdate,ee!==I&&(ee===null?et.firstBaseUpdate=Oe:ee.next=Oe,et.lastBaseUpdate=pe))}if(C!==null){var at=j.baseState;I=0,et=Oe=pe=null,ee=C;do{var Je=ee.lane,Nt=ee.eventTime;if((f&Je)===Je){et!==null&&(et=et.next={eventTime:Nt,lane:0,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null});e:{var Et=i,Tt=ee;switch(Je=l,Nt=d,Tt.tag){case 1:if(Et=Tt.payload,typeof Et=="function"){at=Et.call(Nt,at,Je);break e}at=Et;break e;case 3:Et.flags=Et.flags&-65537|128;case 0:if(Et=Tt.payload,Je=typeof Et=="function"?Et.call(Nt,at,Je):Et,Je==null)break e;at=ge({},at,Je);break e;case 2:po=!0}}ee.callback!==null&&ee.lane!==0&&(i.flags|=64,Je=j.effects,Je===null?j.effects=[ee]:Je.push(ee))}else Nt={eventTime:Nt,lane:Je,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},et===null?(Oe=et=Nt,pe=at):et=et.next=Nt,I|=Je;if(ee=ee.next,ee===null){if(ee=j.shared.pending,ee===null)break;Je=ee,ee=Je.next,Je.next=null,j.lastBaseUpdate=Je,j.shared.pending=null}}while(!0);if(et===null&&(pe=at),j.baseState=pe,j.firstBaseUpdate=Oe,j.lastBaseUpdate=et,l=j.shared.interleaved,l!==null){j=l;do I|=j.lane,j=j.next;while(j!==l)}else C===null&&(j.shared.lanes=0);_c|=I,i.lanes=I,i.memoizedState=at}}function h4(i,l,d){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var f=i[l],j=f.callback;if(j!==null){if(f.callback=null,f=d,typeof j!="function")throw Error(n(191,j));j.call(f)}}}var Mm={},Wi=mo(Mm),Lm=mo(Mm),Vm=mo(Mm);function Ec(i){if(i===Mm)throw Error(n(174));return i}function Bg(i,l){switch(fn(Vm,l),fn(Lm,i),fn(Wi,Mm),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:S(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=S(l,i)}yn(Wi),fn(Wi,l)}function Gd(){yn(Wi),yn(Lm),yn(Vm)}function f4(i){Ec(Vm.current);var l=Ec(Wi.current),d=S(l,i.type);l!==d&&(fn(Lm,i),fn(Wi,d))}function Kg(i){Lm.current===i&&(yn(Wi),yn(Lm))}var Cn=mo(0);function kp(i){for(var l=i;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Hg=[];function Gg(){for(var i=0;i<Hg.length;i++)Hg[i]._workInProgressVersionPrimary=null;Hg.length=0}var $p=L.ReactCurrentDispatcher,Zg=L.ReactCurrentBatchConfig,Tc=0,Sn=null,Xn=null,sr=null,Pp=!1,Um=!1,zm=0,VI=0;function $r(){throw Error(n(321))}function Yg(i,l){if(l===null)return!1;for(var d=0;d<l.length&&d<i.length;d++)if(!An(i[d],l[d]))return!1;return!0}function Qg(i,l,d,f,j,C){if(Tc=C,Sn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,$p.current=i===null||i.memoizedState===null?WI:BI,i=d(f,j),Um){C=0;do{if(Um=!1,zm=0,25<=C)throw Error(n(301));C+=1,sr=Xn=null,l.updateQueue=null,$p.current=KI,i=d(f,j)}while(Um)}if($p.current=_p,l=Xn!==null&&Xn.next!==null,Tc=0,sr=Xn=Sn=null,Pp=!1,l)throw Error(n(300));return i}function Xg(){var i=zm!==0;return zm=0,i}function Bi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?Sn.memoizedState=sr=i:sr=sr.next=i,sr}function za(){if(Xn===null){var i=Sn.alternate;i=i!==null?i.memoizedState:null}else i=Xn.next;var l=sr===null?Sn.memoizedState:sr.next;if(l!==null)sr=l,Xn=i;else{if(i===null)throw Error(n(310));Xn=i,i={memoizedState:Xn.memoizedState,baseState:Xn.baseState,baseQueue:Xn.baseQueue,queue:Xn.queue,next:null},sr===null?Sn.memoizedState=sr=i:sr=sr.next=i}return sr}function qm(i,l){return typeof l=="function"?l(i):l}function Jg(i){var l=za(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=i;var f=Xn,j=f.baseQueue,C=d.pending;if(C!==null){if(j!==null){var I=j.next;j.next=C.next,C.next=I}f.baseQueue=j=C,d.pending=null}if(j!==null){C=j.next,f=f.baseState;var ee=I=null,pe=null,Oe=C;do{var et=Oe.lane;if((Tc&et)===et)pe!==null&&(pe=pe.next={lane:0,action:Oe.action,hasEagerState:Oe.hasEagerState,eagerState:Oe.eagerState,next:null}),f=Oe.hasEagerState?Oe.eagerState:i(f,Oe.action);else{var at={lane:et,action:Oe.action,hasEagerState:Oe.hasEagerState,eagerState:Oe.eagerState,next:null};pe===null?(ee=pe=at,I=f):pe=pe.next=at,Sn.lanes|=et,_c|=et}Oe=Oe.next}
vendor: 4,724 bytes, line 39
39while(Oe!==null&&Oe!==C);pe===null?I=f:pe.next=ee,An(f,l.memoizedState)||(oa=!0),l.memoizedState=f,l.baseState=I,l.baseQueue=pe,d.lastRenderedState=f}if(i=d.interleaved,i!==null){j=i;do C=j.lane,Sn.lanes|=C,_c|=C,j=j.next;while(j!==i)}else j===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function ey(i){var l=za(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=i;var f=d.dispatch,j=d.pending,C=l.memoizedState;if(j!==null){d.pending=null;var I=j=j.next;do C=i(C,I.action),I=I.next;while(I!==j);An(C,l.memoizedState)||(oa=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,f]}function p4(){}function x4(i,l){var d=Sn,f=za(),j=l(),C=!An(f.memoizedState,j);if(C&&(f.memoizedState=j,oa=!0),f=f.queue,ty(v4.bind(null,d,f,i),[i]),f.getSnapshot!==l||C||sr!==null&&sr.memoizedState.tag&1){if(d.flags|=2048,Wm(9,y4.bind(null,d,f,j,l),void 0,null),nr===null)throw Error(n(349));(Tc&30)!==0||g4(d,l,j)}return j}function g4(i,l,d){i.flags|=16384,i={getSnapshot:l,value:d},l=Sn.updateQueue,l===null?(l={lastEffect:null,stores:null},Sn.updateQueue=l,l.stores=[i]):(d=l.stores,d===null?l.stores=[i]:d.push(i))}function y4(i,l,d,f){l.value=d,l.getSnapshot=f,j4(l)&&b4(i)}function v4(i,l,d){return d(function(){j4(l)&&b4(i)})}function j4(i){var l=i.getSnapshot;i=i.value;try{var d=l();return!An(i,d)}catch{return!0}}function b4(i){var l=$l(i,1);l!==null&&xi(l,i,1,-1)}function N4(i){var l=Bi();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qm,lastRenderedState:i},l.queue=i,i=i.dispatch=qI.bind(null,Sn,i),[l.memoizedState,i]}function Wm(i,l,d,f){return i={tag:i,create:l,destroy:d,deps:f,next:null},l=Sn.updateQueue,l===null?(l={lastEffect:null,stores:null},Sn.updateQueue=l,l.lastEffect=i.next=i):(d=l.lastEffect,d===null?l.lastEffect=i.next=i:(f=d.next,d.next=i,i.next=f,l.lastEffect=i)),i}function w4(){return za().memoizedState}function Ep(i,l,d,f){var j=Bi();Sn.flags|=i,j.memoizedState=Wm(1|l,d,void 0,f===void 0?null:f)}function Tp(i,l,d,f){var j=za();f=f===void 0?null:f;var C=void 0;if(Xn!==null){var I=Xn.memoizedState;if(C=I.destroy,f!==null&&Yg(f,I.deps)){j.memoizedState=Wm(l,d,C,f);return}}Sn.flags|=i,j.memoizedState=Wm(1|l,d,C,f)}function A4(i,l){return Ep(8390656,8,i,l)}function ty(i,l){return Tp(2048,8,i,l)}function C4(i,l){return Tp(4,2,i,l)}function S4(i,l){return Tp(4,4,i,l)}function k4(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function $4(i,l,d){return d=d!=null?d.concat([i]):null,Tp(4,4,k4.bind(null,l,i),d)}function sy(){}function P4(i,l){var d=za();l=l===void 0?null:l;var f=d.memoizedState;return f!==null&&l!==null&&Yg(l,f[1])?f[0]:(d.memoizedState=[i,l],i)}function E4(i,l){var d=za();l=l===void 0?null:l;var f=d.memoizedState;return f!==null&&l!==null&&Yg(l,f[1])?f[0]:(i=i(),d.memoizedState=[i,l],i)}function T4(i,l,d){return(Tc&21)===0?(i.baseState&&(i.baseState=!1,oa=!0),i.memoizedState=d):(An(d,l)||(d=Of(),Sn.lanes|=d,_c|=d,i.baseState=!0),l)}function UI(i,l){var d=Fs;Fs=d!==0&&4>d?d:4,i(!0);var f=Zg.transition;Zg.transition={};try{i(!1),l()}finally{Fs=d,Zg.transition=f}}function _4(){return za().memoizedState}function zI(i,l,d){var f=jo(i);if(d={lane:f,action:d,hasEagerState:!1,eagerState:null,next:null},I4(i))D4(l,d);else if(d=d4(i,l,d,f),d!==null){var j=qr();xi(d,i,f,j),O4(d,l,f)}}function qI(i,l,d){var f=jo(i),j={lane:f,action:d,hasEagerState:!1,eagerState:null,next:null};if(I4(i))D4(l,j);else{var C=i.alternate;if(i.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var I=l.lastRenderedState,ee=C(I,d);if(j.hasEagerState=!0,j.eagerState=ee,An(ee,I)){var pe=l.interleaved;pe===null?(j.next=j,qg(l)):(j.next=pe.next,pe.next=j),l.interleaved=j;return}}catch{}finally{}d=d4(i,l,j,f),d!==null&&(j=qr(),xi(d,i,f,j),O4(d,l,f))}}function I4(i){var l=i.alternate;return i===Sn||l!==null&&l===Sn}function D4(i,l){Um=Pp=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function O4(i,l,d){if((d&4194240)!==0){var f=l.lanes;f&=i.pendingLanes,d|=f,l.lanes=d,wd(i,d)}}var _p={readContext:Ua,useCallback:$r,useContext:$r,useEffect:$r,useImperativeHandle:$r,useInsertionEffect:$r,useLayoutEffect:$r,useMemo:$r,useReducer:$r,useRef:$r,useState:$r,useDebugValue:$r,useDeferredValue:$r,useTransition:$r,useMutableSource:$r,useSyncExternalStore:$r,useId:$r,unstable_isNewReconciler:!1},WI={readContext:Ua,useCallback:function(i,l){return Bi().memoizedState=[i,l===void 0?null:l],i},useContext:Ua,useEffect:A4,useImperativeHandle:function(i,l,d){return d=d!=null?d.concat([i]):null,Ep(4194308,4,k4.bind(null,l,
vendor: 7,918 bytes, lines 39-41
39i),d)},useLayoutEffect:function(i,l){return Ep(4194308,4,i,l)},useInsertionEffect:function(i,l){return Ep(4,2,i,l)},useMemo:function(i,l){var d=Bi();return l=l===void 0?null:l,i=i(),d.memoizedState=[i,l],i},useReducer:function(i,l,d){var f=Bi();return l=d!==void 0?d(l):l,f.memoizedState=f.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},f.queue=i,i=i.dispatch=zI.bind(null,Sn,i),[f.memoizedState,i]},useRef:function(i){var l=Bi();return i={current:i},l.memoizedState=i},useState:N4,useDebugValue:sy,useDeferredValue:function(i){return Bi().memoizedState=i},useTransition:function(){var i=N4(!1),l=i[0];return i=UI.bind(null,i[1]),Bi().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,d){var f=Sn,j=Bi();if(jn){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),nr===null)throw Error(n(349));(Tc&30)!==0||g4(f,l,d)}j.memoizedState=d;var C={value:d,getSnapshot:l};return j.queue=C,A4(v4.bind(null,f,C,i),[i]),f.flags|=2048,Wm(9,y4.bind(null,f,C,d,l),void 0,null),d},useId:function(){var i=Bi(),l=nr.identifierPrefix;if(jn){var d=kl,f=Sl;d=(f&~(1<<32-va(f)-1)).toString(32)+d,l=":"+l+"R"+d,d=zm++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=VI++,l=":"+l+"r"+d.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},BI={readContext:Ua,useCallback:P4,useContext:Ua,useEffect:ty,useImperativeHandle:$4,useInsertionEffect:C4,useLayoutEffect:S4,useMemo:E4,useReducer:Jg,useRef:w4,useState:function(){return Jg(qm)},useDebugValue:sy,useDeferredValue:function(i){var l=za();return T4(l,Xn.memoizedState,i)},useTransition:function(){var i=Jg(qm)[0],l=za().memoizedState;return[i,l]},useMutableSource:p4,useSyncExternalStore:x4,useId:_4,unstable_isNewReconciler:!1},KI={readContext:Ua,useCallback:P4,useContext:Ua,useEffect:ty,useImperativeHandle:$4,useInsertionEffect:C4,useLayoutEffect:S4,useMemo:E4,useReducer:ey,useRef:w4,useState:function(){return ey(qm)},useDebugValue:sy,useDeferredValue:function(i){var l=za();return Xn===null?l.memoizedState=i:T4(l,Xn.memoizedState,i)},useTransition:function(){var i=ey(qm)[0],l=za().memoizedState;return[i,l]},useMutableSource:p4,useSyncExternalStore:x4,useId:_4,unstable_isNewReconciler:!1};function hi(i,l){if(i&&i.defaultProps){l=ge({},l),i=i.defaultProps;for(var d in i)l[d]===void 0&&(l[d]=i[d]);return l}return l}function ny(i,l,d,f){l=i.memoizedState,d=d(f,l),d=d==null?l:ge({},l,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var Ip={isMounted:function(i){return(i=i._reactInternals)?na(i)===i:!1},enqueueSetState:function(i,l,d){i=i._reactInternals;var f=qr(),j=jo(i),C=Pl(f,j);C.payload=l,d!=null&&(C.callback=d),l=xo(i,C,j),l!==null&&(xi(l,i,j,f),Cp(l,i,j))},enqueueReplaceState:function(i,l,d){i=i._reactInternals;var f=qr(),j=jo(i),C=Pl(f,j);C.tag=1,C.payload=l,d!=null&&(C.callback=d),l=xo(i,C,j),l!==null&&(xi(l,i,j,f),Cp(l,i,j))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var d=qr(),f=jo(i),j=Pl(d,f);j.tag=2,l!=null&&(j.callback=l),l=xo(i,j,f),l!==null&&(xi(l,i,f,d),Cp(l,i,f))}};function F4(i,l,d,f,j,C,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,C,I):l.prototype&&l.prototype.isPureReactComponent?!wr(d,f)||!wr(j,C):!0}function R4(i,l,d){var f=!1,j=ho,C=l.contextType;return typeof C=="object"&&C!==null?C=Ua(C):(j=la(l)?Sc:kr.current,f=l.contextTypes,C=(f=f!=null)?Ud(i,j):ho),l=new l(d,C),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Ip,i.stateNode=l,l._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=j,i.__reactInternalMemoizedMaskedChildContext=C),l}function M4(i,l,d,f){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,f),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,f),l.state!==i&&Ip.enqueueReplaceState(l,l.state,null)}function ry(i,l,d,f){var j=i.stateNode;j.props=d,j.state=i.memoizedState,j.refs={},Wg(i);var C=l.contextType;typeof C=="object"&&C!==null?j.context=Ua(C):(C=la(l)?Sc:kr.current,j.context=Ud(i,C)),j.state=i.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(ny(i,l,C,d),j.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(l=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),l!==j.state&&Ip.enqueueReplaceState(j,j.state,null),Sp(i,d,j,f),j.state=i.memoizedState),typeof j.componentDidMount=="function"&&(i.flags|=4194308)}function Zd(i,l){try{var d="",f=l;do d+=Me(f),f=f.return;while(f);var j=d}catch(C){j=` 40Error generating stack: `+C.message+` 41`+C.stack}return{value:i,source:l,stack:j,digest:null}}function ay(i,l,d){return{value:i,source:null,stack:d??null,digest:l??null}}function iy(i,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var HI=typeof WeakMap=="function"?WeakMap:Map;function L4(i,l,d){d=Pl(-1,d),d.tag=3,d.payload={element:null};var f=l.value;return d.callback=function(){Vp||(Vp=!0,by=f),iy(i,l)},d}function V4(i,l,d){d=Pl(-1,d),d.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var j=l.value;d.payload=function(){return f(j)},d.callback=function(){iy(i,l)}}var C=i.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){iy(i,l),typeof f!="function"&&(yo===null?yo=new Set([this]):yo.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),d}function U4(i,l,d){var f=i.pingCache;if(f===null){f=i.pingCache=new HI;var j=new Set;f.set(l,j)}else j=f.get(l),j===void 0&&(j=new Set,f.set(l,j));j.has(d)||(j.add(d),i=lD.bind(null,i,l,d),l.then(i,i))}function z4(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function q4(i,l,d,f,j){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Pl(-1,1),l.tag=2,xo(d,l,1))),d.lanes|=1),i):(i.flags|=65536,i.lanes=j,i)}var GI=L.ReactCurrentOwner,oa=!1;function zr(i,l,d,f){l.child=i===null?c4(l,null,d,f):Bd(l,i.child,d,f)}function W4(i,l,d,f,j){d=d.render;var C=l.ref;return Hd(l,j),f=Qg(i,l,d,f,C,j),d=Xg(),i!==null&&!oa?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~j,El(i,l,j)):(jn&&d&&Dg(l),l.flags|=1,zr(i,l,f,j),l.child)}function B4(i,l,d,f,j){if(i===null){var C=d.type;return typeof C=="function"&&!$y(C)&&C.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=C,K4(i,l,C,f,j)):(i=Kp(d.type,null,f,l,l.mode,j),i.ref=l.ref,i.return=l,l.child=i)}if(C=i.child,(i.lanes&j)===0){var I=C.memoizedProps;if(d=d.compare,d=d!==null?d:wr,d(I,f)&&i.ref===l.ref)return El(i,l,j)}return l.flags|=1,i=No(C,f),i.ref=l.ref,i.return=l,l.child=i}function K4(i,l,d,f,j){if(i!==null){var C=i.memoizedProps;if(wr(C,f)&&i.ref===l.ref)if(oa=!1,l.pendingProps=f=C,(i.lanes&j)!==0)(i.flags&131072)!==0&&(oa=!0);else return l.lanes=i.lanes,El(i,l,j)}return ly(i,l,d,f,j)}function H4(i,l,d){var f=l.pendingProps,j=f.children,C=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},fn(Qd,Aa),Aa|=d;else{if((d&1073741824)===0)return i=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,fn(Qd,Aa),Aa|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=C!==null?C.baseLanes:d,fn(Qd,Aa),Aa|=f}else C!==null?(f=C.baseLanes|d,l.memoizedState=null):f=d,fn(Qd,Aa),Aa|=f;return zr(i,l,j,d),l.child}function G4(i,l){var d=l.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(l.flags|=512,l.flags|=2097152)}
vendor: 13,878 bytes, line 41
41function ly(i,l,d,f,j){var C=la(d)?Sc:kr.current;return C=Ud(l,C),Hd(l,j),d=Qg(i,l,d,f,C,j),f=Xg(),i!==null&&!oa?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~j,El(i,l,j)):(jn&&f&&Dg(l),l.flags|=1,zr(i,l,d,j),l.child)}function Z4(i,l,d,f,j){if(la(d)){var C=!0;gp(l)}else C=!1;if(Hd(l,j),l.stateNode===null)Op(i,l),R4(l,d,f),ry(l,d,f,j),f=!0;else if(i===null){var I=l.stateNode,ee=l.memoizedProps;I.props=ee;var pe=I.context,Oe=d.contextType;typeof Oe=="object"&&Oe!==null?Oe=Ua(Oe):(Oe=la(d)?Sc:kr.current,Oe=Ud(l,Oe));var et=d.getDerivedStateFromProps,at=typeof et=="function"||typeof I.getSnapshotBeforeUpdate=="function";at||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(ee!==f||pe!==Oe)&&M4(l,I,f,Oe),po=!1;var Je=l.memoizedState;I.state=Je,Sp(l,f,I,j),pe=l.memoizedState,ee!==f||Je!==pe||ia.current||po?(typeof et=="function"&&(ny(l,d,et,f),pe=l.memoizedState),(ee=po||F4(l,d,ee,f,Je,pe,Oe))?(at||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=f,l.memoizedState=pe),I.props=f,I.state=pe,I.context=Oe,f=ee):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),f=!1)}else{I=l.stateNode,u4(i,l),ee=l.memoizedProps,Oe=l.type===l.elementType?ee:hi(l.type,ee),I.props=Oe,at=l.pendingProps,Je=I.context,pe=d.contextType,typeof pe=="object"&&pe!==null?pe=Ua(pe):(pe=la(d)?Sc:kr.current,pe=Ud(l,pe));var Nt=d.getDerivedStateFromProps;(et=typeof Nt=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(ee!==at||Je!==pe)&&M4(l,I,f,pe),po=!1,Je=l.memoizedState,I.state=Je,Sp(l,f,I,j);var Et=l.memoizedState;ee!==at||Je!==Et||ia.current||po?(typeof Nt=="function"&&(ny(l,d,Nt,f),Et=l.memoizedState),(Oe=po||F4(l,d,Oe,f,Je,Et,pe)||!1)?(et||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(f,Et,pe),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(f,Et,pe)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||ee===i.memoizedProps&&Je===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||ee===i.memoizedProps&&Je===i.memoizedState||(l.flags|=1024),l.memoizedProps=f,l.memoizedState=Et),I.props=f,I.state=Et,I.context=pe,f=Oe):(typeof I.componentDidUpdate!="function"||ee===i.memoizedProps&&Je===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||ee===i.memoizedProps&&Je===i.memoizedState||(l.flags|=1024),f=!1)}return oy(i,l,d,f,C,j)}function oy(i,l,d,f,j,C){G4(i,l);var I=(l.flags&128)!==0;if(!f&&!I)return j&&e4(l,d,!1),El(i,l,C);f=l.stateNode,GI.current=l;var ee=I&&typeof d.getDerivedStateFromError!="function"?null:f.render();return l.flags|=1,i!==null&&I?(l.child=Bd(l,i.child,null,C),l.child=Bd(l,null,ee,C)):zr(i,l,ee,C),l.memoizedState=f.state,j&&e4(l,d,!0),l.child}function Y4(i){var l=i.stateNode;l.pendingContext?Xj(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Xj(i,l.context,!1),Bg(i,l.containerInfo)}function Q4(i,l,d,f,j){return Wd(),Mg(j),l.flags|=256,zr(i,l,d,f),l.child}var cy={dehydrated:null,treeContext:null,retryLane:0};function dy(i){return{baseLanes:i,cachePool:null,transitions:null}}function X4(i,l,d){var f=l.pendingProps,j=Cn.current,C=!1,I=(l.flags&128)!==0,ee;if((ee=I)||(ee=i!==null&&i.memoizedState===null?!1:(j&2)!==0),ee?(C=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(j|=1),fn(Cn,j&1),i===null)return Rg(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=f.children,i=f.fallback,C?(f=l.mode,C=l.child,I={mode:"hidden",children:I},(f&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=I):C=Hp(I,f,0,null),i=Fc(i,f,d,null),C.return=l,i.return=l,C.sibling=i,l.child=C,l.child.memoizedState=dy(d),l.memoizedState=cy,i):uy(l,I));if(j=i.memoizedState,j!==null&&(ee=j.dehydrated,ee!==null))return ZI(i,l,I,f,ee,j,d);if(C){C=f.fallback,I=l.mode,j=i.child,ee=j.sibling;var pe={mode:"hidden",children:f.children};return(I&1)===0&&l.child!==j?(f=l.child,f.childLanes=0,f.pendingProps=pe,l.deletions=null):(f=No(j,pe),f.subtreeFlags=j.subtreeFlags&14680064),ee!==null?C=No(ee,C):(C=Fc(C,I,d,null),C.flags|=2),C.return=l,f.return=l,f.sibling=C,l.child=f,f=C,C=l.child,I=i.child.memoizedState,I=I===null?dy(d):{baseLanes:I.baseLanes|d,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=i.childLanes&~d,l.memoizedState=cy,f}return C=i.child,i=C.sibling,f=No(C,{mode:"visible",children:f.children}),(l.mode&1)===0&&(f.lanes=d),f.return=l,f.sibling=null,i!==null&&(d=l.deletions,d===null?(l.deletions=[i],l.flags|=16):d.push(i)),l.child=f,l.memoizedState=null,f}function uy(i,l){return l=Hp({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function Dp(i,l,d,f){return f!==null&&Mg(f),Bd(l,i.child,null,d),i=uy(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function ZI(i,l,d,f,j,C,I){if(d)return l.flags&256?(l.flags&=-257,f=ay(Error(n(422))),Dp(i,l,I,f)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(C=f.fallback,j=l.mode,f=Hp({mode:"visible",children:f.children},j,0,null),C=Fc(C,j,I,null),C.flags|=2,f.return=l,C.return=l,f.sibling=C,l.child=f,(l.mode&1)!==0&&Bd(l,i.child,null,I),l.child.memoizedState=dy(I),l.memoizedState=cy,C);if((l.mode&1)===0)return Dp(i,l,I,null);if(j.data==="$!"){if(f=j.nextSibling&&j.nextSibling.dataset,f)var ee=f.dgst;return f=ee,C=Error(n(419)),f=ay(C,f,void 0),Dp(i,l,I,f)}if(ee=(I&i.childLanes)!==0,oa||ee){if(f=nr,f!==null){switch(I&-I){case 4:j=2;break;case 16:j=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=(j&(f.suspendedLanes|I))!==0?0:j,j!==0&&j!==C.retryLane&&(C.retryLane=j,$l(i,j),xi(f,i,j,-1))}return ky(),f=ay(Error(n(421))),Dp(i,l,I,f)}return j.data==="$?"?(l.flags|=128,l.child=i.child,l=oD.bind(null,i),j._reactRetry=l,null):(i=C.treeContext,wa=uo(j.nextSibling),Na=l,jn=!0,mi=null,i!==null&&(La[Va++]=Sl,La[Va++]=kl,La[Va++]=kc,Sl=i.id,kl=i.overflow,kc=l),l=uy(l,f.children),l.flags|=4096,l)}function J4(i,l,d){i.lanes|=l;var f=i.alternate;f!==null&&(f.lanes|=l),zg(i.return,l,d)}function my(i,l,d,f,j){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:f,tail:d,tailMode:j}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=f,C.tail=d,C.tailMode=j)}function eb(i,l,d){var f=l.pendingProps,j=f.revealOrder,C=f.tail;if(zr(i,l,f.children,d),f=Cn.current,(f&2)!==0)f=f&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&J4(i,d,l);else if(i.tag===19)J4(i,d,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(fn(Cn,f),(l.mode&1)===0)l.memoizedState=null;else switch(j){case"forwards":for(d=l.child,j=null;d!==null;)i=d.alternate,i!==null&&kp(i)===null&&(j=d),d=d.sibling;d=j,d===null?(j=l.child,l.child=null):(j=d.sibling,d.sibling=null),my(l,!1,j,d,C);break;case"backwards":for(d=null,j=l.child,l.child=null;j!==null;){if(i=j.alternate,i!==null&&kp(i)===null){l.child=j;break}i=j.sibling,j.sibling=d,d=j,j=i}my(l,!0,d,null,C);break;case"together":my(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Op(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function El(i,l,d){if(i!==null&&(l.dependencies=i.dependencies),_c|=l.lanes,(d&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,d=No(i,i.pendingProps),l.child=d,d.return=l;i.sibling!==null;)i=i.sibling,d=d.sibling=No(i,i.pendingProps),d.return=l;d.sibling=null}return l.child}function YI(i,l,d){switch(l.tag){case 3:Y4(l),Wd();break;case 5:f4(l);break;case 1:la(l.type)&&gp(l);break;case 4:Bg(l,l.stateNode.containerInfo);break;case 10:var f=l.type._context,j=l.memoizedProps.value;fn(wp,f._currentValue),f._currentValue=j;break;case 13:if(f=l.memoizedState,f!==null)return f.dehydrated!==null?(fn(Cn,Cn.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?X4(i,l,d):(fn(Cn,Cn.current&1),i=El(i,l,d),i!==null?i.sibling:null);fn(Cn,Cn.current&1);break;case 19:if(f=(d&l.childLanes)!==0,(i.flags&128)!==0){if(f)return eb(i,l,d);l.flags|=128}if(j=l.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),fn(Cn,Cn.current),f)break;return null;case 22:case 23:return l.lanes=0,H4(i,l,d)}return El(i,l,d)}var tb,hy,sb,nb;tb=function(i,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},hy=function(){},sb=function(i,l,d,f){var j=i.memoizedProps;if(j!==f){i=l.stateNode,Ec(Wi.current);var C=null;switch(d){case"input":j=Mt(i,j),f=Mt(i,f),C=[];break;case"select":j=ge({},j,{value:void 0}),f=ge({},f,{value:void 0}),C=[];break;case"textarea":j=A(i,j),f=A(i,f),C=[];break;default:typeof j.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=fp)}xn(d,f);var I;d=null;for(Oe in j)if(!f.hasOwnProperty(Oe)&&j.hasOwnProperty(Oe)&&j[Oe]!=null)if(Oe==="style"){var ee=j[Oe];for(I in ee)ee.hasOwnProperty(I)&&(d||(d={}),d[I]="")}else Oe!=="dangerouslySetInnerHTML"&&Oe!=="children"&&Oe!=="suppressContentEditableWarning"&&Oe!=="suppressHydrationWarning"&&Oe!=="autoFocus"&&(a.hasOwnProperty(Oe)?C||(C=[]):(C=C||[]).push(Oe,null));for(Oe in f){var pe=f[Oe];if(ee=j!=null?j[Oe]:void 0,f.hasOwnProperty(Oe)&&pe!==ee&&(pe!=null||ee!=null))if(Oe==="style")if(ee){for(I in ee)!ee.hasOwnProperty(I)||pe&&pe.hasOwnProperty(I)||(d||(d={}),d[I]="");for(I in pe)pe.hasOwnProperty(I)&&ee[I]!==pe[I]&&(d||(d={}),d[I]=pe[I])}else d||(C||(C=[]),C.push(Oe,d)),d=pe;else Oe==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,ee=ee?ee.__html:void 0,pe!=null&&ee!==pe&&(C=C||[]).push(Oe,pe)):Oe==="children"?typeof pe!="string"&&typeof pe!="number"||(C=C||[]).push(Oe,""+pe):Oe!=="suppressContentEditableWarning"&&Oe!=="suppressHydrationWarning"&&(a.hasOwnProperty(Oe)?(pe!=null&&Oe==="onScroll"&&gn("scroll",i),C||ee===pe||(C=[])):(C=C||[]).push(Oe,pe))}d&&(C=C||[]).push("style",d);var Oe=C;(l.updateQueue=Oe)&&(l.flags|=4)}},nb=function(i,l,d,f){d!==f&&(l.flags|=4)};function Bm(i,l){if(!jn)switch(i.tailMode){case"hidden":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var f=null;d!==null;)d.alternate!==null&&(f=d),d=d.sibling;f===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function Pr(i){var l=i.alternate!==null&&i.alternate.child===i.child,d=0,f=0;if(l)for(var j=i.child;j!==null;)d|=j.lanes|j.childLanes,f|=j.subtreeFlags&14680064,f|=j.flags&14680064,j.return=i,j=j.sibling;else for(j=i.child;j!==null;)d|=j.lanes|j.childLanes,f|=j.subtreeFlags,f|=j.flags,j.return=i,j=j.sibling;return i.subtreeFlags|=f,i.childLanes=d,l}function QI(i,l,d){var f=l.pendingProps;switch(Og(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pr(l),null;case 1:return la(l.type)&&xp(),Pr(l),null;case 3:return f=l.stateNode,Gd(),yn(ia),yn(kr),Gg(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(bp(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,mi!==null&&(Ay(mi),mi=null))),hy(i,l),Pr(l),null;case 5:Kg(l);var j=Ec(Vm.current);if(d=l.type,i!==null&&l.stateNode!=null)sb(i,l,d,f,j),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!f){if(l.stateNode===null)throw Error(n(166));return Pr(l),null}if(i=Ec(Wi.current),bp(l)){f=l.stateNode,d=l.type;var C=l.memoizedProps;switch(f[qi]=l,f[Om]=C,i=(l.mode&1)!==0,d){case"dialog":gn("cancel",f),gn("close",f);break;case"iframe":case"object":case"embed":gn("load",f);break;case"video":case"audio":for(j=0;j<_m.length;j++)gn(_m[j],f);break;case"source":gn("error",f);break;case"img":case"image":case"link":gn("error",f),gn("load",f);break;case"details":gn("toggle",f);break;case"input":$(f,C),gn("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!C.multiple},gn("invalid",f);break;case"textarea":D(f,C),gn("invalid",f)}xn(d,C),j=null;for(var I in C)if(C.hasOwnProperty(I)){var ee=C[I];I==="children"?typeof ee=="string"?f.textContent!==ee&&(C.suppressHydrationWarning!==!0&&hp(f.textContent,ee,i),j=["children",ee]):typeof ee=="number"&&f.textContent!==""+ee&&(C.suppressHydrationWarning!==!0&&hp(f.textContent,ee,i),j=["children",""+ee]):a.hasOwnProperty(I)&&ee!=null&&I==="onScroll"&&gn("scroll",f)}switch(d){case"input":Te(f),De(f,C,!0);break;case"textarea":Te(f),$e(f);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(f.onclick=fp)}f=j,l.updateQueue=f,f!==null&&(l.flags|=4)}else{I=j.nodeType===9?j:j.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=ke(d)),i==="http://www.w3.org/1999/xhtml"?d==="script"?(i=I.createElement("div"),i.innerHTML="<script><\/script>
41",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=I.createElement(d,{is:f.is}):(i=I.createElement(d),d==="select"&&(I=i,f.multiple?I.multiple=!0:f.size&&(I.size=f.size))):i=I.createElementNS(i,d),i[qi]=l,i[Om]=f,tb(i,l,!1,!1),l.stateNode=i;e:{switch(I=un(d,f),d){case"dialog":gn("cancel",i),gn("close",i),j=f;break;case"iframe":case"object":case"embed":gn("load",i),j=f;break;case"video":case"audio":for(j=0;j<_m.length;j++)gn(_m[j],i);j=f;break;case"source":gn("error",i),j=f;break;case"img":case"image":case"link":gn("error",i),gn("load",i),j=f;break;case"details":gn("toggle",i),j=f;break;case"input":$(i,f),j=Mt(i,f),gn("invalid",i);break;case"option":j=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},j=ge({},f,{value:void 0}),gn("invalid",i);break;case"textarea":D(i,f),j=A(i,f),gn("invalid",i);break;default:j=f}xn(d,j),ee=j;for(C in ee)if(ee.hasOwnProperty(C)){var pe=ee[C];C==="style"?Zt(i,pe):C==="dangerouslySetInnerHTML"?(pe=pe?pe.__html:void 0,pe!=null&&Ze(i,pe)):C==="children"?typeof pe=="string"?(d!=="textarea"||pe!=="")&&Qe(i,pe):typeof pe=="number"&&Qe(i,""+pe):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(a.hasOwnProperty(C)?pe!=null&&C==="onScroll"&&gn("scroll",i):pe!=null&&M(i,C,pe,I))}switch(d){case"input":Te(i),De(i,f,!1);break;case"textarea":Te(i),$e(i);break;case"option":f.value!=null&&i.setAttribute("value",""+O(f.value));break;case"select":i.multiple=!!f.multiple,C=f.value,C!=null?Le(i,!!f.multiple,C,!1):f.defaultValue!=null&&Le(i,!!f.multiple,f.defaultValue,!0);break;default:typeof j.onClick=="function"&&(i.onclick=fp)}switch(d){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Pr(l),null;case 6:if(i&&l.stateNode!=null)nb(i,l,i.memoizedProps,f);else{if(typeof f!="string"&&l.stateNode===null)throw Error(n(166));if(d=Ec(Vm.current),Ec(Wi.current),bp(l)){if(f=l.stateNode,d=l.memoizedProps,f[qi]=l,(C=f.nodeValue!==d)&&(i=Na,i!==null))switch(i.tag){case 3:hp(f.nodeValue,d,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&hp(f.nodeValue,d,(i.mode&1)!==0)}C&&(l.flags|=4)}else f=(d.nodeType===9?d:d.ownerDocument).createTextNode(f),f[qi]=l,l.stateNode=f}return Pr(l),null;case 13:if(yn(Cn),f=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(jn&&wa!==null&&(l.mode&1)!==0&&(l.flags&128)===0)i4(),Wd(),l.flags|=98560,C=!1;else if(C=bp(l),f!==null&&f.dehydrated!==null){if(i===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[qi]=l}else Wd(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pr(l),C=!1}else mi!==null&&(Ay(mi),mi=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(Cn.current&1)!==0?Jn===0&&(Jn=3):ky())),l.updateQueue!==null&&(l.flags|=4),Pr(l),null);case 4:return Gd(),hy(i,l),i===null&&Im(l.stateNode.containerInfo),Pr(l),null;case 10:return Ug(l.type._context),Pr(l),null;case 17:return la(l.type)&&xp(),Pr(l),null;case 19:if(yn(Cn),C=l.memoizedState,C===null)return Pr(l),null;if(f=(l.flags&128)!==0,I=C.rendering,I===null)if(f)Bm(C,!1);else{if(Jn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(I=kp(i),I!==null){for(l.flags|=128,Bm(C,!1),f=I.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),l.subtreeFlags=0,f=d,d=l.child;d!==null;)C=d,i=f,C.flags&=14680066,I=C.alternate,I===null?(C.childLanes=0,C.lanes=i,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=I.childLanes,C.lanes=I.lanes,C.child=I.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=I.memoizedProps,C.memoizedState=I.memoizedState,C.updateQueue=I.updateQueue,C.type=I.type,i=I.dependencies,C.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),d=d.sibling;return fn(Cn,Cn.current&1|2),l.child}i=i.sibling}C.tail!==null&&Xt()>Xd&&(l.flags|=128,f=!0,Bm(C,!1),l.lanes=4194304)}else{if(!f)if(i=kp(I),i!==null){if(l.flags|=128,f=!0,d=i.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Bm(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!jn)return Pr(l),null}else 2*Xt()-C.renderingStartTime>Xd&&d!==1073741824&&(l.flags|=128,f=!0,Bm(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(d=C.last,d!==null?d.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Xt(),l.sibling=null,d=Cn.current,fn(Cn,f?d&1|2:d&1),l):(Pr(l),null);case 22:case 23:return Sy(),f=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(l.flags|=8192),f&&(l.mode&1)!==0?(Aa&1073741824)!==0&&(Pr(l),l.subtreeFlags&6&&(l.flags|=8192)):Pr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function XI(i,l){switch(Og(l),l.tag){case 1:return la(l.type)&&xp(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Gd(),yn(ia),yn(kr),Gg(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return Kg(l),null;case 13:if(yn(Cn),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Wd()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return yn(Cn),null;case 4:return Gd(),null;
vendor: 21,891 bytes, line 41
41case 10:return Ug(l.type._context),null;case 22:case 23:return Sy(),null;case 24:return null;default:return null}}var Fp=!1,Er=!1,JI=typeof WeakSet=="function"?WeakSet:Set,$t=null;function Yd(i,l){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(f){_n(i,l,f)}else d.current=null}function fy(i,l,d){try{d()}catch(f){_n(i,l,f)}}var rb=!1;function eD(i,l){if(Sg=Sd,i=Ma(),ci(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var f=d.getSelection&&d.getSelection();if(f&&f.rangeCount!==0){d=f.anchorNode;var j=f.anchorOffset,C=f.focusNode;f=f.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var I=0,ee=-1,pe=-1,Oe=0,et=0,at=i,Je=null;t:for(;;){for(var Nt;at!==d||j!==0&&at.nodeType!==3||(ee=I+j),at!==C||f!==0&&at.nodeType!==3||(pe=I+f),at.nodeType===3&&(I+=at.nodeValue.length),(Nt=at.firstChild)!==null;)Je=at,at=Nt;for(;;){if(at===i)break t;if(Je===d&&++Oe===j&&(ee=I),Je===C&&++et===f&&(pe=I),(Nt=at.nextSibling)!==null)break;at=Je,Je=at.parentNode}at=Nt}d=ee===-1||pe===-1?null:{start:ee,end:pe}}else d=null}d=d||{start:0,end:0}}else d=null;for(kg={focusedElem:i,selectionRange:d},Sd=!1,$t=l;$t!==null;)if(l=$t,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,$t=i;else for(;$t!==null;){l=$t;try{var Et=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Et!==null){var Tt=Et.memoizedProps,Rn=Et.memoizedState,Ee=l.stateNode,ye=Ee.getSnapshotBeforeUpdate(l.elementType===l.type?Tt:hi(l.type,Tt),Rn);Ee.__reactInternalSnapshotBeforeUpdate=ye}break;case 3:var Ie=l.stateNode.containerInfo;Ie.nodeType===1?Ie.textContent="":Ie.nodeType===9&&Ie.documentElement&&Ie.removeChild(Ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ot){_n(l,l.return,ot)}if(i=l.sibling,i!==null){i.return=l.return,$t=i;break}$t=l.return}return Et=rb,rb=!1,Et}function Km(i,l,d){var f=l.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var j=f=f.next;do{if((j.tag&i)===i){var C=j.destroy;j.destroy=void 0,C!==void 0&&fy(l,d,C)}j=j.next}while(j!==f)}}function Rp(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&i)===i){var f=d.create;d.destroy=f()}d=d.next}while(d!==l)}}function py(i){var l=i.ref;if(l!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof l=="function"?l(i):l.current=i}}function ab(i){var l=i.alternate;l!==null&&(i.alternate=null,ab(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[qi],delete l[Om],delete l[Tg],delete l[FI],delete l[RI])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function ib(i){return i.tag===5||i.tag===3||i.tag===4}function lb(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ib(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function xy(i,l,d){var f=i.tag;if(f===5||f===6)i=i.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(i,l):d.insertBefore(i,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(i,d)):(l=d,l.appendChild(i)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=fp));else if(f!==4&&(i=i.child,i!==null))for(xy(i,l,d),i=i.sibling;i!==null;)xy(i,l,d),i=i.sibling}function gy(i,l,d){var f=i.tag;if(f===5||f===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(gy(i,l,d),i=i.sibling;i!==null;)gy(i,l,d),i=i.sibling}var hr=null,fi=!1;function go(i,l,d){for(d=d.child;d!==null;)ob(i,l,d),d=d.sibling}function ob(i,l,d){if(Qs&&typeof Qs.onCommitFiberUnmount=="function")try{Qs.onCommitFiberUnmount(Tn,d)}catch{}switch(d.tag){case 5:Er||Yd(d,l);case 6:var f=hr,j=fi;hr=null,go(i,l,d),hr=f,fi=j,hr!==null&&(fi?(i=hr,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):hr.removeChild(d.stateNode));break;case 18:hr!==null&&(fi?(i=hr,d=d.stateNode,i.nodeType===8?Eg(i.parentNode,d):i.nodeType===1&&Eg(i,d),no(i)):Eg(hr,d.stateNode));break;case 4:f=hr,j=fi,hr=d.stateNode.containerInfo,fi=!0,go(i,l,d),hr=f,fi=j;break;case 0:case 11:case 14:case 15:if(!Er&&(f=d.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){j=f=f.next;do{var C=j,I=C.destroy;C=C.tag,I!==void 0&&((C&2)!==0||(C&4)!==0)&&fy(d,l,I),j=j.next}while(j!==f)}go(i,l,d);break;case 1:if(!Er&&(Yd(d,l),f=d.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=d.memoizedProps,f.state=d.memoizedState,f.componentWillUnmount()}catch(ee){_n(d,l,ee)}go(i,l,d);break;case 21:go(i,l,d);break;case 22:d.mode&1?(Er=(f=Er)||d.memoizedState!==null,go(i,l,d),Er=f):go(i,l,d);break;default:go(i,l,d)}}function cb(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new JI),l.forEach(function(f){var j=cD.bind(null,i,f);d.has(f)||(d.add(f),f.then(j,j))})}}function pi(i,l){var d=l.deletions;if(d!==null)for(var f=0;f<d.length;f++){var j=d[f];try{var C=i,I=l,ee=I;e:for(;ee!==null;){switch(ee.tag){case 5:hr=ee.stateNode,fi=!1;break e;case 3:hr=ee.stateNode.containerInfo,fi=!0;break e;case 4:hr=ee.stateNode.containerInfo,fi=!0;break e}ee=ee.return}if(hr===null)throw Error(n(160));ob(C,I,j),hr=null,fi=!1;var pe=j.alternate;pe!==null&&(pe.return=null),j.return=null}catch(Oe){_n(j,l,Oe)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)db(l,i),l=l.sibling}function db(i,l){var d=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(pi(l,i),Ki(i),f&4){try{Km(3,i,i.return),Rp(3,i)}catch(Tt){_n(i,i.return,Tt)}try{Km(5,i,i.return)}catch(Tt){_n(i,i.return,Tt)}}break;case 1:pi(l,i),Ki(i),f&512&&d!==null&&Yd(d,d.return);break;case 5:if(pi(l,i),Ki(i),f&512&&d!==null&&Yd(d,d.return),i.flags&32){var j=i.stateNode;try{Qe(j,"")}catch(Tt){_n(i,i.return,Tt)}}if(f&4&&(j=i.stateNode,j!=null)){var C=i.memoizedProps,I=d!==null?d.memoizedProps:C,ee=i.type,pe=i.updateQueue;if(i.updateQueue=null,pe!==null)try{ee==="input"&&C.type==="radio"&&C.name!=null&&K(j,C),un(ee,I);var Oe=un(ee,C);for(I=0;I<pe.length;I+=2){var et=pe[I],at=pe[I+1];et==="style"?Zt(j,at):et==="dangerouslySetInnerHTML"?Ze(j,at):et==="children"?Qe(j,at):M(j,et,at,Oe)}switch(ee){case"input":xe(j,C);break;case"textarea":ie(j,C);break;case"select":var Je=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!C.multiple;var Nt=C.value;Nt!=null?Le(j,!!C.multiple,Nt,!1):Je!==!!C.multiple&&(C.defaultValue!=null?Le(j,!!C.multiple,C.defaultValue,!0):Le(j,!!C.multiple,C.multiple?[]:"",!1))}j[Om]=C}catch(Tt){_n(i,i.return,Tt)}}break;case 6:if(pi(l,i),Ki(i),f&4){if(i.stateNode===null)throw Error(n(162));j=i.stateNode,C=i.memoizedProps;try{j.nodeValue=C}catch(Tt){_n(i,i.return,Tt)}}break;case 3:if(pi(l,i),Ki(i),f&4&&d!==null&&d.memoizedState.isDehydrated)try{no(l.containerInfo)}catch(Tt){_n(i,i.return,Tt)}break;case 4:pi(l,i),Ki(i);break;case 13:pi(l,i),Ki(i),j=i.child,j.flags&8192&&(C=j.memoizedState!==null,j.stateNode.isHidden=C,!C||j.alternate!==null&&j.alternate.memoizedState!==null||(jy=Xt())),f&4&&cb(i);break;case 22:if(et=d!==null&&d.memoizedState!==null,i.mode&1?(Er=(Oe=Er)||et,pi(l,i),Er=Oe):pi(l,i),Ki(i),f&8192){if(Oe=i.memoizedState!==null,(i.stateNode.isHidden=Oe)&&!et&&(i.mode&1)!==0)for($t=i,et=i.child;et!==null;){for(at=$t=et;$t!==null;){switch(Je=$t,Nt=Je.child,Je.tag){case 0:case 11:case 14:case 15:Km(4,Je,Je.return);break;case 1:Yd(Je,Je.return);var Et=Je.stateNode;if(typeof Et.componentWillUnmount=="function"){f=Je,d=Je.return;try{l=f,Et.props=l.memoizedProps,Et.state=l.memoizedState,Et.componentWillUnmount()}catch(Tt){_n(f,d,Tt)}}break;case 5:Yd(Je,Je.return);break;case 22:if(Je.memoizedState!==null){hb(at);continue}}Nt!==null?(Nt.return=Je,$t=Nt):hb(at)}et=et.sibling}e:for(et=null,at=i;;){if(at.tag===5){if(et===null){et=at;try{j=at.stateNode,Oe?(C=j.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(ee=at.stateNode,pe=at.memoizedProps.style,I=pe!=null&&pe.hasOwnProperty("display")?pe.display:null,ee.style.display=Zs("display",I))}catch(Tt){_n(i,i.return,Tt)}}}else if(at.tag===6){if(et===null)try{at.stateNode.nodeValue=Oe?"":at.memoizedProps}catch(Tt){_n(i,i.return,Tt)}}else if((at.tag!==22&&at.tag!==23||at.memoizedState===null||at===i)&&at.child!==null){at.child.return=at,at=at.child;continue}if(at===i)break e;for(;at.sibling===null;){if(at.return===null||at.return===i)break e;et===at&&(et=null),at=at.return}et===at&&(et=null),at.sibling.return=at.return,at=at.sibling}}break;case 19:pi(l,i),Ki(i),f&4&&cb(i);break;case 21:break;default:pi(l,i),Ki(i)}}function Ki(i){var l=i.flags;if(l&2){try{e:{for(var d=i.return;d!==null;){if(ib(d)){var f=d;break e}d=d.return}throw Error(n(160))}switch(f.tag){case 5:var j=f.stateNode;f.flags&32&&(Qe(j,""),f.flags&=-33);var C=lb(i);gy(i,C,j);break;case 3:case 4:var I=f.stateNode.containerInfo,ee=lb(i);xy(i,ee,I);break;default:throw Error(n(161))}}catch(pe){_n(i,i.return,pe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function tD(i,l,d){$t=i,ub(i)}function ub(i,l,d){for(var f=(i.mode&1)!==0;$t!==null;){var j=$t,C=j.child;if(j.tag===22&&f){var I=j.memoizedState!==null||Fp;if(!I){var ee=j.alternate,pe=ee!==null&&ee.memoizedState!==null||Er;ee=Fp;var Oe=Er;if(Fp=I,(Er=pe)&&!Oe)for($t=j;$t!==null;)I=$t,pe=I.child,I.tag===22&&I.memoizedState!==null?fb(j):pe!==null?(pe.return=I,$t=pe):fb(j);for(;C!==null;)$t=C,ub(C),C=C.sibling;$t=j,Fp=ee,Er=Oe}mb(i)}else(j.subtreeFlags&8772)!==0&&C!==null?(C.return=j,$t=C):mb(i)}}function mb(i){for(;$t!==null;){var l=$t;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Er||Rp(5,l);break;case 1:var f=l.stateNode;if(l.flags&4&&!Er)if(d===null)f.componentDidMount();else{var j=l.elementType===l.type?d.memoizedProps:hi(l.type,d.memoizedProps);f.componentDidUpdate(j,d.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&h4(l,C,f);break;case 3:var I=l.updateQueue;if(I!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}h4(l,I,d)}break;case 5:var ee=l.stateNode;if(d===null&&l.flags&4){d=ee;var pe=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":pe.autoFocus&&d.focus();break;case"img":pe.src&&(d.src=pe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Oe=l.alternate;if(Oe!==null){var et=Oe.memoizedState;if(et!==null){var at=et.dehydrated;at!==null&&no(at)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Er||l.flags&512&&py(l)}catch(Je){_n(l,l.return,Je)}}if(l===i){$t=null;break}if(d=l.sibling,d!==null){d.return=l.return,$t=d;break}$t=l.return}}function hb(i){for(;$t!==null;){var l=$t;if(l===i){$t=null;break}var d=l.sibling;if(d!==null){d.return=l.return,$t=d;break}$t=l.return}}function fb(i){for(;$t!==null;){var l=$t;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Rp(4,l)}catch(pe){_n(l,d,pe)}break;case 1:var f=l.stateNode;if(typeof f.componentDidMount=="function"){var j=l.return;try{f.componentDidMount()}catch(pe){_n(l,j,pe)}}var C=l.return;try{py(l)}catch(pe){_n(l,C,pe)}break;case 5:var I=l.return;try{py(l)}catch(pe){_n(l,I,pe)}}}catch(pe){_n(l,l.return,pe)}if(l===i){$t=null;break}var ee=l.sibling;if(ee!==null){ee.return=l.return,$t=ee;break}$t=l.return}}var sD=Math.ceil,Mp=L.ReactCurrentDispatcher,yy=L.ReactCurrentOwner,qa=L.ReactCurrentBatchConfig,Bs=0,nr=null,Bn=null,fr=0,Aa=0,Qd=mo(0),Jn=0,Hm=null,_c=0,Lp=0,vy=0,Gm=null,ca=null,jy=0,Xd=1/0,Tl=null,Vp=!1,by=null,yo=null,Up=!1,vo=null,zp=0,Zm=0,Ny=null,qp=-1,Wp=0;function qr(){return(Bs&6)!==0?Xt():qp!==-1?qp:qp=Xt()}function jo(i){return(i.mode&1)===0?1:(Bs&2)!==0&&fr!==0?fr&-fr:LI.transition!==null?(Wp===0&&(Wp=Of()),Wp):(i=Fs,i!==0||(i=window.event,i=i===void 0?16:gm(i.type)),i)}function xi(i,l,d,f){if(50<Zm)throw Zm=0,Ny=null,Error(n(185));ja(i,d,f),((Bs&2)===0||i!==nr)&&(i===nr&&((Bs&2)===0&&(Lp|=d),Jn===4&&bo(i,fr)),da(i,f),d===1&&Bs===0&&(l.mode&1)===0&&(Xd=Xt()+500,yp&&fo()))}function da(i,l){var d=i.callbackNode;mm(i,l);var f=mc(i,i===nr?fr:0);if(f===0)d!==null&&Lt(d),i.callbackNode=null,i.callbackPriority=0;else if(l=f&-f,i.callbackPriority!==l){if(d!=null&&Lt(d),l===1)i.tag===0?MI(xb.bind(null,i)):t4(xb.bind(null,i)),DI(function(){(Bs&6)===0&&fo()}),d=null;else{switch(Lr(f)){case 1:d=wn;break;case 4:d=En;break;case 16:d=yl;break;case 536870912:d=uc;break;default:d=yl}d=Ab(d,pb.bind(null,i))}i.callbackPriority=l,i.callbackNode=d}}function pb(i,l){if(qp=-1,Wp=0,(Bs&6)!==0)throw Error(n(327));var d=i.callbackNode;if(Jd()&&i.callbackNode!==d)return null;var f=mc(i,i===nr?fr:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||l)l=Bp(i,f);else{l=f;var j=Bs;Bs|=2;var C=yb();(nr!==i||fr!==l)&&(Tl=null,Xd=Xt()+500,Dc(i,l));do try{aD();break}catch(ee){gb(i,ee)}while(!0);Vg(),Mp.current=C,Bs=j,Bn!==null?l=0:(nr=null,fr=0,l=Jn)}if(l!==0){if(l===2&&(j=Us(i),j!==0&&(f=j,l=wy(i,j))),l===1)throw d=Hm,Dc(i,0),bo(i,f),da(i,Xt()),d;if(l===6)bo(i,f);else{if(j=i.current.alternate,(f&30)===0&&!nD(j)&&(l=Bp(i,f),l===2&&(C=Us(i),C!==0&&(f=C,l=wy(i,C))),l===1))throw d=Hm,Dc(i,0),bo(i,f),da(i,Xt()),d;switch(i.finishedWork=j,i.finishedLanes=f,l){case 0:case 1:throw Error(n(345));case 2:Oc(i,ca,Tl);break;case 3:if(bo(i,f),(f&130023424)===f&&(l=jy+500-Xt(),10<l)){if(mc(i,0)!==0)break;if(j=i.suspendedLanes,(j&f)!==f){qr(),i.pingedLanes|=i.suspendedLanes&j;break}i.timeoutHandle=Pg(Oc.bind(null,i,ca,Tl),l);break}Oc(i,ca,Tl);break;case 4:if(bo(i,f),(f&4194240)===f)break;for(l=i.eventTimes,j=-1;0<f;){var I=31-va(f);C=1<<I,I=l[I],I>j&&(j=I),f&=~C}if(f=j,f=Xt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*sD(f/1960))-f,10<f){i.timeoutHandle=Pg(Oc.bind(null,i,ca,Tl),f);break}Oc(i,ca,Tl);break;case 5:Oc(i,ca,Tl);break;default:throw Error(n(329))}}}return da(i,Xt()),i.callbackNode===d?pb.bind(null,i):null}function wy(i,l){var d=Gm;return i.current.memoizedState.isDehydrated&&(Dc(i,l).flags|=256),i=Bp(i,l),i!==2&&(l=ca,ca=d,l!==null&&Ay(l)),i}function Ay(i){ca===null?ca=i:ca.push.apply(ca,i)}function nD(i){for(var l=i;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var f=0;f<d.length;f++){var j=d[f],C=j.getSnapshot;j=j.value;try{if(!An(C(),j))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function bo(i,l){for(l&=~vy,l&=~Lp,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var d=31-va(l),f=1<<d;i[d]=-1,l&=~f}}function xb(i){if((Bs&6)!==0)throw Error(n(327));Jd();var l=mc(i,0);if((l&1)===0)return da(i,Xt()),null;var d=Bp(i,l);if(i.tag!==0&&d===2){var f=Us(i);f!==0&&(l=f,d=wy(i,f))}if(d===1)throw d=Hm,Dc(i,0),bo(i,l),da(i,Xt()),d;if(d===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Oc(i,ca,Tl),da(i,Xt()),null}function Cy(i,l){var d=Bs;Bs|=1;try{return i(l)}finally{Bs=d,Bs===0&&(Xd=Xt()+500,yp&&fo())}}function Ic(i){vo!==null&&vo.tag===0&&(Bs&6)===0&&Jd();var l=Bs;Bs|=1;var d=qa.transition,f=Fs;try{if(qa.transition=null,Fs=1,i)return i()}finally{Fs=f,qa.transition=d,Bs=l,(Bs&6)===0&&fo()}}function Sy(){Aa=Qd.current,yn(Qd)}function Dc(i,l){i.finishedWork=null,i.finishedLanes=0;var d=i.timeoutHandle;if(d!==-1&&(i.timeoutHandle=-1,II(d)),Bn!==null)for(d=Bn.return;d!==null;){var f=d;switch(Og(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&xp();break;case 3:Gd(),yn(ia),yn(kr),Gg();break;case 5:Kg(f);break;case 4:Gd();break;case 13:yn(Cn);break;case 19:yn(Cn);break;case 10:Ug(f.type._context);break;case 22:case 23:Sy()}d=d.return}if(nr=i,Bn=i=No(i.current,null),fr=Aa=l,Jn=0,Hm=null,vy=Lp=_c=0,ca=Gm=null,Pc!==null){for(l=0;l<Pc.length;l++)if(d=Pc[l],f=d.interleaved,f!==null){d.interleaved=null;var j=f.next,C=d.pending;if(C!==null){var I=C.next;C.next=j,f.next=I}d.pending=f}Pc=null}return i}function gb(i,l){do{var d=Bn;try{if(Vg(),$p.current=_p,Pp){for(var f=Sn.memoizedState;f!==null;){var j=f.queue;j!==null&&(j.pending=null),f=f.next}Pp=!1}if(Tc=0,sr=Xn=Sn=null,Um=!1,zm=0,yy.current=null,d===null||d.return===null){Jn=1,Hm=l,Bn=null;break}e:{var C=i,I=d.return,ee=d,pe=l;if(l=fr,ee.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Oe=pe,et=ee,at=et.tag;if((et.mode&1)===0&&(at===0||at===11||at===15)){var Je=et.alternate;Je?(et.updateQueue=Je.updateQueue,et.memoizedState=Je.memoizedState,et.lanes=Je.lanes):(et.updateQueue=null,et.memoizedState=null)}var Nt=z4(I);if(Nt!==null){Nt.flags&=-257,q4(Nt,I,ee,C,l),Nt.mode&1&&U4(C,Oe,l),l=Nt,pe=Oe;var Et=l.updateQueue;if(Et===null){var Tt=new Set;Tt.add(pe),l.updateQueue=Tt}else Et.add(pe);break e}else{if((l&1)===0){U4(C,Oe,l),ky();break e}pe=Error(n(426))}}else if(jn&&ee.mode&1){var Rn=z4(I);if(Rn!==null){(Rn.flags&65536)===0&&(Rn.flags|=256),q4(Rn,I,ee,C,l),Mg(Zd(pe,ee));break e}}C=pe=Zd(pe,ee),Jn!==4&&(Jn=2),Gm===null?Gm=[C]:Gm.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Ee=L4(C,pe,l);m4(C,Ee);break e;case 1:ee=pe;var ye=C.type,Ie=C.stateNode;if((C.flags&128)===0&&(typeof ye.getDerivedStateFromError=="function"||Ie!==null&&typeof Ie.componentDidCatch=="function"&&(yo===null||!yo.has(Ie)))){C.flags|=65536,l&=-l,C.lanes|=l;var ot=V4(C,ee,l);m4(C,ot);break e}}C=C.return}while(C!==null)}jb(d)}catch(Dt){l=Dt,Bn===d&&d!==null&&(Bn=d=d.return);continue}break}while(!0)}function yb(){var i=Mp.current;return Mp.current=_p,i===null?_p:i}function ky(){(Jn===0||Jn===3||Jn===2)&&(Jn=4),nr===null||(_c&268435455)===0&&(Lp&268435455)===0||bo(nr,fr)}function Bp(i,l){var d=Bs;Bs|=2;var f=yb();(nr!==i||fr!==l)&&(Tl=null,Dc(i,l));do try{rD();break}catch(j){gb(i,j)}while(!0);if(Vg(),Bs=d,Mp.current=f,Bn!==null)throw Error(n(261));return nr=null,fr=0,Jn}function rD(){for(;Bn!==null;)vb(Bn)}function aD(){for(;Bn!==null&&!js();)vb(Bn)}function vb(i){var l=wb(i.alternate,i,Aa);i.memoizedProps=i.pendingProps,l===null?jb(i):Bn=l,yy.current=null}function jb(i){var l=i;do{var d=l.alternate;if(i=l.return,(l.flags&32768)===0){if(d=QI(d,l,Aa),d!==null){Bn=d;return}}else{if(d=XI(d,l),d!==null){d.flags&=32767,Bn=d;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Jn=6,Bn=null;return}}if(l=l.sibling,l!==null){Bn=l;return}Bn=l=i}while(l!==null);Jn===0&&(Jn=5)}function Oc(i,l,d){var f=Fs,j=qa.transition;try{qa.transition=null,Fs=1,iD(i,l,d,f)}finally{qa.transition=j,Fs=f}return null}function iD(i,l,d,f){do Jd();while(vo!==null);if((Bs&6)!==0)throw Error(n(327));d=i.finishedWork;var j=i.finishedLanes;if(d===null)return null;if(i.finishedWork=null,i.finishedLanes=0,d===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var C=d.lanes|d.childLanes;if(Nd(i,C),i===nr&&(Bn=nr=null,fr=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Up||(Up=!0,Ab(yl,function(){return Jd(),null})),C=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||C){C=qa.transition,qa.transition=null;var I=Fs;Fs=1;var ee=Bs;Bs|=4,yy.current=null,eD(i,d),db(d,i),di(kg),Sd=!!Sg,kg=Sg=null,i.current=d,tD(d),ps(),Bs=ee,Fs=I,qa.transition=C}else i.current=d;if(Up&&(Up=!1,vo=i,zp=j),C=i.pendingLanes,C===0&&(yo=null),xg(d.stateNode),da(i,Xt()),l!==null)for(f=i.onRecoverableError,d=0;d<l.length;d++)j=l[d],f(j.value,{componentStack:j.stack,digest:j.digest});if(Vp)throw Vp=!1,i=by,by=null,i;return(zp&1)!==0&&i.tag!==0&&Jd(),C=i.pendingLanes,(C&1)!==0?i===Ny?Zm++:(Zm=0,Ny=i):Zm=0,fo(),null}function Jd(){if(vo!==null){var i=Lr(zp),l=qa.transition,d=Fs;try{if(qa.transition=null,Fs=16>i?16:i,vo===null)var f=!1;else{if(i=vo,vo=null,zp=0,(Bs&6)!==0)throw Error(n(331));var j=Bs;for(Bs|=4,$t=i.current;$t!==null;){var C=$t,I=C.child;if(($t.flags&16)!==0){var ee=C.deletions;if(ee!==null){for(var pe=0;pe<ee.length;pe++){var Oe=ee[pe];for($t=Oe;$t!==null;){var et=$t;switch(et.tag){case 0:case 11:case 15:Km(8,et,C)}var at=et.child;if(at!==null)at.return=et,$t=at;else for(;$t!==null;){et=$t;var Je=et.sibling,Nt=et.return;if(ab(et),et===Oe){$t=null;break}if(Je!==null){Je.return=Nt,$t=Je;break}$t=Nt}}}var Et=C.alternate;if(Et!==null){var Tt=Et.child;if(Tt!==null){Et.child=null;do{var Rn=Tt.sibling;Tt.sibling=null,Tt=Rn}while(Tt!==null)}}$t=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,$t=I;else e:for(;$t!==null;){if(C=$t,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Km(9,C,C.return)}var Ee=C.sibling;if(Ee!==null){Ee.return=C.return,$t=Ee;break e}$t=C.return}}var ye=i.current;for($t=ye;$t!==null;){I=$t;var Ie=I.child;if((I.subtreeFlags&2064)!==0&&Ie!==null)Ie.return=I,$t=Ie;else e:for(I=ye;$t!==null;){if(ee=$t,(ee.flags&2048)!==0)try{switch(ee.tag){case 0:case 11:case 15:Rp(9,ee)}}catch(Dt){_n(ee,ee.return,Dt)}if(ee===I){$t=null;break e}var ot=ee.sibling;if(ot!==null){ot.return=ee.return,$t=ot;break e}$t=ee.return}}if(Bs=j,fo(),Qs&&typeof Qs.onPostCommitFiberRoot=="function")try{Qs.onPostCommitFiberRoot(Tn,i)}catch{}f=!0}return f}finally{Fs=d,qa.transition=l}}return!1}function bb(i,l,d){l=Zd(d,l),l=L4(i,l,1),i=xo(i,l,1),l=qr(),i!==null&&(ja(i,1,l),da(i,l))}function _n(i,l,d){if(i.tag===3)bb(i,i,d);else for(;l!==null;){if(l.tag===3){bb(l,i,d);break}else if(l.tag===1){var f=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(yo===null||!yo.has(f))){i=Zd(d,i),i=V4(l,i,1),l=xo(l,i,1),i=qr(),l!==null&&(ja(l,1,i),da(l,i));break}}l=l.return}}function lD(i,l,d){var f=i.pingCache;f!==null&&f.delete(l),l=qr(),i.pingedLanes|=i.suspendedLanes&d,nr===i&&(fr&d)===d&&(Jn===4||Jn===3&&(fr&130023424)===fr&&500>Xt()-jy?Dc(i,0):vy|=d),da(i,l)}function Nb(i,l){l===0&&((i.mode&1)===0?l=1:(l=dm,dm<<=1,(dm&130023424)===0&&(
vendor: 4,014 bytes, line 41
41dm=4194304)));var d=qr();i=$l(i,l),i!==null&&(ja(i,l,d),da(i,d))}function oD(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),Nb(i,d)}function cD(i,l){var d=0;switch(i.tag){case 13:var f=i.stateNode,j=i.memoizedState;j!==null&&(d=j.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(l),Nb(i,d)}var wb;wb=function(i,l,d){if(i!==null)if(i.memoizedProps!==l.pendingProps||ia.current)oa=!0;else{if((i.lanes&d)===0&&(l.flags&128)===0)return oa=!1,YI(i,l,d);oa=(i.flags&131072)!==0}else oa=!1,jn&&(l.flags&1048576)!==0&&s4(l,jp,l.index);switch(l.lanes=0,l.tag){case 2:var f=l.type;Op(i,l),i=l.pendingProps;var j=Ud(l,kr.current);Hd(l,d),j=Qg(null,l,f,i,j,d);var C=Xg();return l.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,la(f)?(C=!0,gp(l)):C=!1,l.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,Wg(l),j.updater=Ip,l.stateNode=j,j._reactInternals=l,ry(l,f,i,d),l=oy(null,l,f,!0,C,d)):(l.tag=0,jn&&C&&Dg(l),zr(null,l,j,d),l=l.child),l;case 16:f=l.elementType;e:{switch(Op(i,l),i=l.pendingProps,j=f._init,f=j(f._payload),l.type=f,j=l.tag=uD(f),i=hi(f,i),j){case 0:l=ly(null,l,f,i,d);break e;case 1:l=Z4(null,l,f,i,d);break e;case 11:l=W4(null,l,f,i,d);break e;case 14:l=B4(null,l,f,hi(f.type,i),d);break e}throw Error(n(306,f,""))}return l;case 0:return f=l.type,j=l.pendingProps,j=l.elementType===f?j:hi(f,j),ly(i,l,f,j,d);case 1:return f=l.type,j=l.pendingProps,j=l.elementType===f?j:hi(f,j),Z4(i,l,f,j,d);case 3:e:{if(Y4(l),i===null)throw Error(n(387));f=l.pendingProps,C=l.memoizedState,j=C.element,u4(i,l),Sp(l,f,null,d);var I=l.memoizedState;if(f=I.element,C.isDehydrated)if(C={element:f,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){j=Zd(Error(n(423)),l),l=Q4(i,l,f,d,j);break e}else if(f!==j){j=Zd(Error(n(424)),l),l=Q4(i,l,f,d,j);break e}else for(wa=uo(l.stateNode.containerInfo.firstChild),Na=l,jn=!0,mi=null,d=c4(l,null,f,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Wd(),f===j){l=El(i,l,d);break e}zr(i,l,f,d)}l=l.child}return l;case 5:return f4(l),i===null&&Rg(l),f=l.type,j=l.pendingProps,C=i!==null?i.memoizedProps:null,I=j.children,$g(f,j)?I=null:C!==null&&$g(f,C)&&(l.flags|=32),G4(i,l),zr(i,l,I,d),l.child;case 6:return i===null&&Rg(l),null;case 13:return X4(i,l,d);case 4:return Bg(l,l.stateNode.containerInfo),f=l.pendingProps,i===null?l.child=Bd(l,null,f,d):zr(i,l,f,d),l.child;case 11:return f=l.type,j=l.pendingProps,j=l.elementType===f?j:hi(f,j),W4(i,l,f,j,d);case 7:return zr(i,l,l.pendingProps,d),l.child;case 8:return zr(i,l,l.pendingProps.children,d),l.child;case 12:return zr(i,l,l.pendingProps.children,d),l.child;case 10:e:{if(f=l.type._context,j=l.pendingProps,C=l.memoizedProps,I=j.value,fn(wp,f._currentValue),f._currentValue=I,C!==null)if(An(C.value,I)){if(C.children===j.children&&!ia.current){l=El(i,l,d);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var ee=C.dependencies;if(ee!==null){I=C.child;for(var pe=ee.firstContext;pe!==null;){if(pe.context===f){if(C.tag===1){pe=Pl(-1,d&-d),pe.tag=2;var Oe=C.updateQueue;if(Oe!==null){Oe=Oe.shared;var et=Oe.pending;et===null?pe.next=pe:(pe.next=et.next,et.next=pe),Oe.pending=pe}}C.lanes|=d,pe=C.alternate,pe!==null&&(pe.lanes|=d),zg(C.return,d,l),ee.lanes|=d;break}pe=pe.next}}else if(C.tag===10)I=C.type===l.type?null:C.child;else if(C.tag===18){if(I=C.return,I===null)throw Error(n(341));I.lanes|=d,ee=I.alternate,ee!==null&&(ee.lanes|=d),zg(I,d,l),I=C.sibling}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===l){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}zr(i,l,j.children,d),l=l.child}return l;case 9:return j=l.type,f=l.pendingProps.children,Hd(l,d),j=Ua(j),f=f(j),l.flags|=1,zr(i,l,f,d),l.child;case 14:return f=l.type,j=hi(f,l.pendingProps),j=hi(f.type,j),B4(i,l,f,j,d);
vendor: 7,997 bytes, line 41
41case 15:return K4(i,l,l.type,l.pendingProps,d);case 17:return f=l.type,j=l.pendingProps,j=l.elementType===f?j:hi(f,j),Op(i,l),l.tag=1,la(f)?(i=!0,gp(l)):i=!1,Hd(l,d),R4(l,f,j),ry(l,f,j,d),oy(null,l,f,!0,i,d);case 19:return eb(i,l,d);case 22:return H4(i,l,d)}throw Error(n(156,l.tag))};function Ab(i,l){return Xe(i,l)}function dD(i,l,d,f){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wa(i,l,d,f){return new dD(i,l,d,f)}function $y(i){return i=i.prototype,!(!i||!i.isReactComponent)}function uD(i){if(typeof i=="function")return $y(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ae)return 11;if(i===ne)return 14}return 2}function No(i,l){var d=i.alternate;return d===null?(d=Wa(i.tag,l,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=l,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,l=i.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function Kp(i,l,d,f,j,C){var I=2;if(f=i,typeof i=="function")$y(i)&&(I=1);else if(typeof i=="string")I=5;else e:switch(i){case H:return Fc(d.children,j,C,l);case T:I=8,j|=8;break;case U:return i=Wa(12,d,l,j|2),i.elementType=U,i.lanes=C,i;case W:return i=Wa(13,d,l,j),i.elementType=W,i.lanes=C,i;case J:return i=Wa(19,d,l,j),i.elementType=J,i.lanes=C,i;case V:return Hp(d,j,C,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case _:I=10;break e;case se:I=9;break e;case ae:I=11;break e;case ne:I=14;break e;case le:I=16,f=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=Wa(I,d,l,j),l.elementType=i,l.type=f,l.lanes=C,l}function Fc(i,l,d,f){return i=Wa(7,i,f,l),i.lanes=d,i}function Hp(i,l,d,f){return i=Wa(22,i,f,l),i.elementType=V,i.lanes=d,i.stateNode={isHidden:!1},i}function Py(i,l,d){return i=Wa(6,i,null,l),i.lanes=d,i}function Ey(i,l,d){return l=Wa(4,i.children!==null?i.children:[],i.key,l),l.lanes=d,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function mD(i,l,d,f,j){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ff(0),this.expirationTimes=Ff(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ff(0),this.identifierPrefix=f,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Ty(i,l,d,f,j,C,I,ee,pe){return i=new mD(i,l,d,ee,pe),l===1?(l=1,C===!0&&(l|=8)):l=0,C=Wa(3,null,null,l),i.current=C,C.stateNode=i,C.memoizedState={element:f,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wg(C),i}function hD(i,l,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:z,key:f==null?null:""+f,children:i,containerInfo:l,implementation:d}}function Cb(i){if(!i)return ho;i=i._reactInternals;e:{if(na(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(la(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var d=i.type;if(la(d))return Jj(i,d,l)}return l}function Sb(i,l,d,f,j,C,I,ee,pe){return i=Ty(d,f,!0,i,j,C,I,ee,pe),i.context=Cb(null),d=i.current,f=qr(),j=jo(d),C=Pl(f,j),C.callback=l??null,xo(d,C,j),i.current.lanes=j,ja(i,j,f),da(i,f),i}function Gp(i,l,d,f){var j=l.current,C=qr(),I=jo(j);return d=Cb(d),l.context===null?l.context=d:l.pendingContext=d,l=Pl(C,I),l.payload={element:i},f=f===void 0?null:f,f!==null&&(l.callback=f),i=xo(j,l,I),i!==null&&(xi(i,j,I,C),Cp(i,j,I)),I}function Zp(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function kb(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<l?d:l}}function _y(i,l){kb(i,l),(i=i.alternate)&&kb(i,l)}function fD(){return null}var $b=typeof reportError=="function"?reportError:function(i){console.error(i)};function Iy(i){this._internalRoot=i}Yp.prototype.render=Iy.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));Gp(i,l,null,null)},Yp.prototype.unmount=Iy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ic(function(){Gp(null,i,null,null)}),l[Al]=null}};function Yp(i){this._internalRoot=i}Yp.prototype.unstable_scheduleHydration=function(i){if(i){var l=gg();i={blockedOn:null,target:i,priority:l};for(var d=0;d<Ui.length&&l!==0&&l<Ui[d].priority;d++);Ui.splice(d,0,i),d===0&&Lf(i)}};function Dy(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Qp(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Pb(){}function pD(i,l,d,f,j){if(j){if(typeof f=="function"){var C=f;f=function(){var Oe=Zp(I);C.call(Oe)}}var I=Sb(l,f,i,0,null,!1,!1,"",Pb);return i._reactRootContainer=I,i[Al]=I.current,Im(i.nodeType===8?i.parentNode:i),Ic(),I}for(;j=i.lastChild;)i.removeChild(j);if(typeof f=="function"){var ee=f;f=function(){var Oe=Zp(pe);ee.call(Oe)}}var pe=Ty(i,0,!1,null,null,!1,!1,"",Pb);return i._reactRootContainer=pe,i[Al]=pe.current,Im(i.nodeType===8?i.parentNode:i),Ic(function(){Gp(l,pe,d,f)}),pe}function Xp(i,l,d,f,j){var C=d._reactRootContainer;if(C){var I=C;if(typeof j=="function"){var ee=j;j=function(){var pe=Zp(I);ee.call(pe)}}Gp(l,I,i,j)}else I=pD(d,l,i,j,f);return Zp(I)}Rf=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var d=br(l.pendingLanes);d!==0&&(wd(l,d|1),da(l,Xt()),(Bs&6)===0&&(Xd=Xt()+500,fo()))}break;case 13:Ic(function(){var f=$l(i,1);if(f!==null){var j=qr();xi(f,i,1,j)}}),_y(i,1)}},cn=function(i){if(i.tag===13){var l=$l(i,134217728);if(l!==null){var d=qr();xi(l,i,134217728,d)}_y(i,134217728)}},Mf=function(i){if(i.tag===13){var l=jo(i),d=$l(i,l);if(d!==null){var f=qr();xi(d,i,l,f)}_y(i,l)}},gg=function(){return Fs},vl=function(i,l){var d=Fs;try{return Fs=i,l()}finally{Fs=d}},vs=function(i,l,d){switch(l){case"input":if(xe(i,d),l=d.name,d.type==="radio"&&l!=null){for(d=i;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var f=d[l];if(f!==i&&f.form===i.form){var j=pp(f);if(!j)throw Error(n(90));Be(f),xe(f,j)}}}break;case"textarea":ie(i,d);break;case"select":l=d.value,l!=null&&Le(i,!!d.multiple,l,!1)}},Yt=Cy,Ls=Ic;var xD={usingClientEntryPoint:!1,Events:[Fm,Ld,pp,ds,ms,Cy]},Ym={findFiberByHostInstance:Cc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gD={bundleType:Ym.bundleType,version:Ym.version,rendererPackageName:Ym.rendererPackageName,rendererConfig:Ym.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=he(i),i===null?null:i.stateNode},findFiberByHostInstance:Ym.findFiberByHostInstance||fD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{Tn=Jp.inject(gD),Qs=Jp}catch{}}return ua.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xD,ua.createPortal=function(i,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dy(l))throw Error(n(200));return hD(i,l,null,d)},ua.createRoot=function(i,l){if(!Dy(i))throw Error(n(299));var d=!1,f="",j=$b;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onRecoverableError!==void 0&&(j=l.onRecoverableError)),l=Ty(i,1,!1,null,null,d,!1,f,j),i[Al]=l.current,Im(i.nodeType===8?i.parentNode:i),new Iy(l)},ua.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=he(l),i=i===null?null:i.stateNode,i},ua.flushSync=function(i){return Ic(i)},ua.hydrate=function(i,l,d){if(!Qp(l))throw Error(n(200));return Xp(null,i,l,!0,d)},ua.hydrateRoot=function(i,l,d){if(!Dy(i))throw Error(n(405));var f=d!=null&&d.hydratedSources||null,j=!1,C="",I=$b;if(d!=null&&(d.unstable_strictMode===!0&&(j=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onRecoverableError!==void 0&&(I=d.onRecoverableError)),l=Sb(l,null,i,1,d??null,j,!1,C,I),i[Al]=l.current,Im(i),f)for(i=0;i<f.length;i++)d=f[i],j=d._getVersion,j=j(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,j]:l.mutableSourceEagerHydrationData.push(d,j);return new Yp(l)},ua.render=function(i,l,d){if(!Qp(l))throw Error(n(200));return Xp(null,i,l,!1,d)},ua.unmountComponentAtNode=function(i){if(!Qp(i))throw Error(n(40));return i._reactRootContainer?(Ic(function(){Xp(null,null,i,!1,function(){i._reactRootContainer=null,i[Al]=null})}),!0):!1},ua.unstable_batchedUpdates=Cy,ua.unstable_renderSubtreeIntoContainer=function(i,l,d,f){if(!Qp(d))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Xp(i,l,d,!1,f)},ua.version="18.3.1-next-f1338f8080-20240426",ua}var Mb;function a8(){if(Mb)return My.exports;Mb=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(t){console.error(t)}}return s(),My.exports=kD(),My.exports}var Lb;function $D(){if(Lb)return tx;Lb=1;var s=a8();return tx.createRoot=s.createRoot,tx.hydrateRoot=s.hydrateRoot,tx}var PD=$D();function ED(s,t){if(s instanceof RegExp)return{keys:!1,pattern:s};var n,r,a,o,c=[],u="",h=s.split("/");for(h[0]||h.shift();a=h.shift();)n=a[0],n==="*"?(c.push(n),u+=a[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=a.indexOf("?",1),o=a.indexOf(".",1),c.push(a.substring(1,~r?r:~o?o:a.length)),u+=~r&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(u+=(~r?"?":"")+"\\"+a.substring(o))):u+="/"+a;return{keys:c,pattern:new RegExp("^"+u+(t?"(?=$|/)":"/?$"),"i")}}var p=A0();const Ut=r8(p),i8=bD({__proto__:null,default:Ut},[p]);var Uy={exports:{}},zy={};/** 42 * @license React 43 * use-sync-external-store-shim.production.js 44 * 45 * Copyright (c) Meta Platforms, Inc. and affiliates. 46 * 47 * This source code is licensed under the MIT license found in the 48 * LICENSE file in the root directory of this source tree. 49 */var Vb;function TD(){if(Vb)return zy;Vb=1;var s=A0();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=s.useState,a=s.useEffect,o=s.useLayoutEffect,c=s.useDebugValue;function u(g,y){var b=y(),w=r({inst:{value:b,getSnapshot:y}}),N=w[0].inst,k=w[1];return o(function(){N.value=b,N.getSnapshot=y,h(N)&&k({inst:N})},[g,b,y]),a(function(){return h(N)&&k({inst:N}),g(function(){h(N)&&k({inst:N})})},[g]),c(b),b}function h(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function x(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:u;return zy.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,zy}var Ub;function _D(){return Ub||(Ub=1,Uy.exports=TD()),Uy.exports}var ID=_D();const DD=i8.useInsertionEffect,OD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FD=OD?p.useLayoutEffect:p.useEffect,RD=DD||FD,l8=s=>{const t=p.useRef([s,(...n)=>t[0](...n)]).current;return RD(()=>{t[0]=s}),t[1]},MD="popstate",o2="pushState",c2="replaceState",LD="hashchange",zb=[MD,o2,c2,LD],VD=s=>{for(const t of zb)addEventListener(t,s);return()=>{for(const t of zb)removeEventListener(t,s)}},o8=(s,t)=>ID.useSyncExternalStore(VD,s,t),UD=()=>location.search,zD=({ssrSearch:s=""}={})=>o8(UD,()=>s),qb=()=>location.pathname,qD=({ssrPath:s}={})=>o8(qb,s?()=>s:qb),WD=(s,{replace:t=!1,state:n=null}={})=>history[t?c2:o2](n,"",s),BD=(s={})=>[qD(s),WD],Wb=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Wb]>"u"){for(const s of[o2,c2]){const t=history[s];history[s]=function(){const n=t.apply(this,arguments),r=new Event(s);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Wb,{value:!0})}const KD=(s,t)=>t.toLowerCase().indexOf(s.toLowerCase())?"~"+t:t.slice(s.length)||"/",c8=(s="")=>s==="/"?"":s,HD=(s,t)=>s[0]==="~"?s.slice(1):c8(t)+s,GD=(s="",t)=>KD(Bb(c8(s)),Bb(t)),Bb=s=>{try{return decodeURI(s)}catch{return s}},d8={hook:BD,searchHook:zD,parser:ED,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:s=>s},u8=p.createContext(d8),uf=()=>p.useContext(u8),m8={},h8=p.createContext(m8),ZD=()=>p.useContext(h8),C0=s=>{const[t,n]=s.hook(s);return[GD(s.base,t),l8((r,a)=>n(HD(r,s.base),a))]},hl=()=>C0(uf()),f8=(s,t,n,r)=>{const{pattern:a,keys:o}=t instanceof RegExp?{keys:!1,pattern:t}:s(t||"*",r),c=a.exec(n)||[],[u,...h]=c;return u!==void 0?[!0,(()=>{const x=o!==!1?Object.fromEntries(o.map((g,y)=>[g,h[y]])):c.groups;let m={...h};return x&&Object.assign(m,x),m})(),...r?[u]:[]]:[!1,null]},YD=({children:s,...t})=>{var m,g;const n=uf(),r=t.hook?d8:n;let a=r;const[o,c]=((m=t.ssrPath)==null?void 0:m.split("?"))??[];c&&(t.ssrSearch=c,t.ssrPath=o),t.hrefs=t.hrefs??((g=t.hook)==null?void 0:g.hrefs);let u=p.useRef({}),h=u.current,x=h;for(let y in r){const b=y==="base"?r[y]+(t[y]||""):t[y]||r[y];h===x&&b!==x[y]&&(u.current=x={...x}),x[y]=b,b!==r[y]&&(a=x)}return p.createElement(u8.Provider,{value:a,children:s})},Kb=({children:s,component:t},n)=>t?p.createElement(t,{params:n}):typeof s=="function"?s(n):s,QD=s=>{let t=p.useRef(m8),n=t.current;for(const r in s)s[r]!==n[r]&&(n=s);return Object.keys(s).length===0&&(n=s),t.current=n},xt=({path:s,nest:t,match:n,...r})=>{const a=uf(),[o]=C0(a),[c,u,h]=n??f8(a.parser,s,o,t),x=QD({...ZD(),...u});if(!c)return null;const m=h?p.createElement(YD,{base:h},Kb(r,x)):Kb(r,x);return p.createElement(h8.Provider,{value:x,children:m})},Wl=p.forwardRef((s,t)=>
49{const n=uf(),[r,a]=C0(n),{to:o="",href:c=o,onClick:u,asChild:h,children:x,className:m,replace:g,state:y,...b}=s,w=l8(k=>{k.ctrlKey||k.metaKey||k.altKey||k.shiftKey||k.button!==0||(u==null||u(k),k.defaultPrevented||(k.preventDefault(),a(c,s)))}),N=n.hrefs(c[0]==="~"?c.slice(1):n.base+c,n);return h&&p.isValidElement(x)?p.cloneElement(x,{onClick:w,href:N}):p.createElement("a",{...b,onClick:w,href:N,className:m!=null&&m.call?m(r===c):m,children:x,ref:t})}),p8=s=>Array.isArray(s)?s.flatMap(t=>p8(t&&t.type===p.Fragment?t.props.children:t)):[s],sx=({children:s,location:t})=>{const n=uf(),[r]=C0(n);for(const a of p8(s)){let o=0;if(p.isValidElement(a)&&(o=f8(n.parser,a.props.path,t||r,a.props.nest))[0])return p.cloneElement(a,{match:o})}return null};var xd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ld=typeof window>"u"||"Deno"in globalThis;function Ga(){}function XD(s,t){return typeof s=="function"?s(t):s}function Tv(s){return typeof s=="number"&&s>=0&&s!==1/0}function x8(s,t){return Math.max(s+(t||0)-Date.now(),0)}function hu(s,t){return typeof s=="function"?s(t):s}function Ni(s,t){return typeof s=="function"?s(t):s}function Hb(s,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:c,stale:u}=s;if(c){if(r){if(t.queryHash!==d2(c,t.options))return!1}else if(!Sh(t.queryKey,c))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||a&&a!==t.state.fetchStatus||o&&!o(t))}function Gb(s,t){const{exact:n,status:r,predicate:a,mutationKey:o}=s;if(o){if(!t.options.mutationKey)return!1;if(n){if(od(t.options.mutationKey)!==od(o))return!1}else if(!Sh(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function d2(s,t){return((t==null?void 0:t.queryKeyHashFn)||od)(s)}function od(s){return JSON.stringify(s,(t,n)=>_v(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Sh(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Sh(s[n],t[n])):!1}function u2(s,t){if(s===t)return s;const n=Zb(s)&&Zb(t);if(n||_v(s)&&_v(t)){const r=n?s:Object.keys(s),a=r.length,o=n?t:Object.keys(t),c=o.length,u=n?[]:{};let h=0;for(let x=0;x<c;x++){const m=n?x:o[x];(!n&&r.includes(m)||n)&&s[m]===void 0&&t[m]===void 0?(u[m]=void 0,h++):(u[m]=u2(s[m],t[m]),u[m]===s[m]&&s[m]!==void 0&&h++)}return a===c&&h===a?s:u}return t}function Mx(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const n in s)if(s[n]!==t[n])return!1;return!0}function Zb(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function _v(s){if(!Yb(s))return!1;const t=s.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Yb(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Yb(s){return Object.prototype.toString.call(s)==="[object Object]"}function JD(s){return new Promise(t=>{setTimeout(t,s)})}function Iv(s,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(s,t):n.structuralSharing!==!1?u2(s,t):t}function eO(s,t,n=0){const r=[...s,t];return n&&r.length>n?r.slice(1):r}function tO(s,t,n=0){const r=[t,...s];return n&&r.length>n?r.slice(0,-1):r}var m2=Symbol();function g8(s,t){return!s.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!s.queryFn||s.queryFn===m2?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}var Zc,Do,wu,K3,sO=(K3=class extends xd{constructor(){super();Ot(this,Zc);Ot(this,Do);Ot(this,wu);ft(this,wu,t=>{if(!ld&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Do)||this.setEventListener(oe(this,wu))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Do))==null||t.call(this),ft(this,Do,void 0))}setEventListener(t){var n;ft(this,wu,t),(n=oe(this,Do))==null||n.call(this),ft(this,Do,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){oe(this,Zc)!==t&&(ft(this,Zc,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 30,886 bytes, line 49
49this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof oe(this,Zc)=="boolean"?oe(this,Zc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zc=new WeakMap,Do=new WeakMap,wu=new WeakMap,K3),h2=new sO,Au,Oo,Cu,H3,nO=(H3=class extends xd{constructor(){super();Ot(this,Au,!0);Ot(this,Oo);Ot(this,Cu);ft(this,Cu,t=>{if(!ld&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){oe(this,Oo)||this.setEventListener(oe(this,Cu))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Oo))==null||t.call(this),ft(this,Oo,void 0))}setEventListener(t){var n;ft(this,Cu,t),(n=oe(this,Oo))==null||n.call(this),ft(this,Oo,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Au)!==t&&(ft(this,Au,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return oe(this,Au)}},Au=new WeakMap,Oo=new WeakMap,Cu=new WeakMap,H3),Lx=new nO;function Dv(){let s,t;const n=new Promise((a,o)=>{s=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),s(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function rO(s){return Math.min(1e3*2**s,3e4)}function y8(s){return(s??"online")==="online"?Lx.isOnline():!0}var v8=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function qy(s){return s instanceof v8}function j8(s){let t=!1,n=0,r=!1,a;const o=Dv(),c=N=>{var k;r||(y(new v8(N)),(k=s.abort)==null||k.call(s))},u=()=>{t=!0},h=()=>{t=!1},x=()=>h2.isFocused()&&(s.networkMode==="always"||Lx.isOnline())&&s.canRun(),m=()=>y8(s.networkMode)&&s.canRun(),g=N=>{var k;r||(r=!0,(k=s.onSuccess)==null||k.call(s,N),a==null||a(),o.resolve(N))},y=N=>{var k;r||(r=!0,(k=s.onError)==null||k.call(s,N),a==null||a(),o.reject(N))},b=()=>new Promise(N=>{var k;a=E=>{(r||x())&&N(E)},(k=s.onPause)==null||k.call(s)}).then(()=>{var N;a=void 0,r||(N=s.onContinue)==null||N.call(s)}),w=()=>{if(r)return;let N;const k=n===0?s.initialPromise:void 0;try{N=k??s.fn()}catch(E){N=Promise.reject(E)}Promise.resolve(N).then(g).catch(E=>{var z;if(r)return;const P=s.retry??(ld?0:3),M=s.retryDelay??rO,L=typeof M=="function"?M(n,E):M,B=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,E);if(t||!B){y(E);return}n++,(z=s.onFail)==null||z.call(s,n,E),JD(L).then(()=>x()?void 0:b()).then(()=>{t?y(E):w()})})};return{promise:o,cancel:c,continue:()=>(a==null||a(),o),cancelRetry:u,continueRetry:h,canStart:m,start:()=>(m()?w():b().then(w),o)}}function aO(){let s=[],t=0,n=u=>{u()},r=u=>{u()},a=u=>setTimeout(u,0);const o=u=>{t?s.push(u):a(()=>{n(u)})},c=()=>{const u=s;s=[],u.length&&a(()=>{r(()=>{u.forEach(h=>{n(h)})})})};return{batch:u=>{let h;t++;try{h=u()}finally{t--,t||c()}return h},batchCalls:u=>(...h)=>{o(()=>{u(...h)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{a=u}}}var Fn=aO(),Yc,G3,b8=(G3=class{constructor(){Ot(this,Yc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tv(this.gcTime)&&ft(this,Yc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(ld?1/0:300*1e3))}clearGcTimeout(){oe(this,Yc)&&(clearTimeout(oe(this,Yc)),ft(this,Yc,void 0))}},Yc=new WeakMap,G3),Su,ku,Ka,Tr,rf,Qc,bi,Ol,Z3,iO=(Z3=class extends b8{constructor(t){super();Ot(this,bi);Ot(this,Su);Ot(this,ku);Ot(this,Ka);Ot(this,Tr);Ot(this,rf);Ot(this,Qc);ft(this,Qc,!1),ft(this,rf,t.defaultOptions),this.setOptions(t.options),this.observers=[],ft(this,Ka,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ft(this,Su,lO(this.options)),this.state=t.state??oe(this,Su),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=oe(this,Tr))==null?void 0:t.promise}setOptions(t){this.options={...oe(this,rf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,Ka).remove(this)}setData(t,n){const r=Iv(this.state.data,t,this.options);return Ht(this,bi,Ol).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ht(this,bi,Ol).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=oe(this,Tr))==null?void 0:r.promise;return(a=oe(this,Tr))==null||a.cancel(t),n?n.then(Ga).catch(Ga):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,Su))}isActive(){return this.observers.some(t=>Ni(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===m2||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!x8(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Tr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Tr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),oe(this,Ka).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(oe(this,Tr)&&(oe(this,Qc)?oe(this,Tr).cancel({revert:!0}):oe(this,Tr).cancelRetry()),this.scheduleGc()),oe(this,Ka).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ht(this,bi,Ol).call(this,{type:"invalidate"})}fetch(t,n){var h,x,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,Tr))return oe(this,Tr).continueRetry(),oe(this,Tr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,a=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(ft(this,Qc,!0),r.signal)})},o=()=>{const g=g8(this.options,n),y={queryKey:this.queryKey,meta:this.meta};return a(y),ft(this,Qc,!1),this.options.persister?this.options.persister(g,y,this):g(y)},c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};a(c),(h=this.options.behavior)==null||h.onFetch(c,this),ft(this,ku,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=c.fetchOptions)==null?void 0:x.meta))&&Ht(this,bi,Ol).call(this,{type:"fetch",meta:(m=c.fetchOptions)==null?void 0:m.meta});const u=g=>{var y,b,w,N;qy(g)&&g.silent||Ht(this,bi,Ol).call(this,{type:"error",error:g}),qy(g)||((b=(y=oe(this,Ka).config).onError)==null||b.call(y,g,this),(N=(w=oe(this,Ka).config).onSettled)==null||N.call(w,this.state.data,g,this)),this.scheduleGc()};return ft(this,Tr,j8({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,b,w,N;if(g===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(k){u(k);return}(b=(y=oe(this,Ka).config).onSuccess)==null||b.call(y,g,this),(N=(w=oe(this,Ka).config).onSettled)==null||N.call(w,g,this.state.error,this),this.scheduleGc()},onError:u,onFail:(g,y)=>{Ht(this,bi,Ol).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{Ht(this,bi,Ol).call(this,{type:"pause"})},onContinue:()=>{Ht(this,bi,Ol).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0})),oe(this,Tr).start()}},Su=new WeakMap,ku=new WeakMap,Ka=new WeakMap,Tr=new WeakMap,rf=new WeakMap,Qc=new WeakMap,bi=new WeakSet,Ol=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...N8(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return qy(a)&&a.revert&&oe(this,ku)?{...oe(this,ku),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Fn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),oe(this,Ka).notify({query:this,type:"updated",action:t})})},Z3);function N8(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y8(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function lO(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,n=t!==void 0,r=n?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Gi,Y3,oO=(Y3=class extends xd{constructor(t={}){super();Ot(this,Gi);this.config=t,ft(this,Gi,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??d2(a,n);let c=this.get(o);return c||(c=new iO({cache:this,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(c)),c}add(t){oe(this,Gi).has(t.queryHash)||(oe(this,Gi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,Gi).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,Gi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Fn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,Gi).get(t)}getAll(){return[...oe(this,Gi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hb(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Hb(t,r)):n}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gi=new WeakMap,Y3),Zi,Wr,Xc,Yi,$o,Q3,cO=(Q3=class extends b8{constructor(t){super();Ot(this,Yi);Ot(this,Zi);Ot(this,Wr);Ot(this,Xc);this.mutationId=t.mutationId,ft(this,Wr,t.mutationCache),ft(this,Zi,[]),this.state=t.state||w8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,Zi).includes(t)||(oe(this,Zi).push(t),this.clearGcTimeout(),oe(this,Wr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ft(this,Zi,oe(this,Zi).filter(n=>n!==t)),this.scheduleGc(),oe(this,Wr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,Zi).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Wr).remove(this))}continue(){var t;return((t=oe(this,Xc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,c,u,h,x,m,g,y,b,w,N,k,E,P,M,L,B,z,H;ft(this,Xc,j8({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,U)=>{Ht(this,Yi,$o).call(this,{type:"failed",failureCount:T,error:U})},onPause:()=>{Ht(this,Yi,$o).call(this,{type:"pause"})},onContinue:()=>{Ht(this,Yi,$o).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Wr).canRun(this)}));const n=this.state.status==="pending",r=!oe(this,Xc).canStart();try{if(!n){Ht(this,Yi,$o).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(a=oe(this,Wr).config).onMutate)==null?void 0:o.call(a,t,this));const U=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t));U!==this.state.context&&Ht(this,Yi,$o).call(this,{type:"pending",context:U,variables:t,isPaused:r})}const T=await oe(this,Xc).start();return await((x=(h=oe(this,Wr).config).onSuccess)==null?void 0:x.call(h,T,t,this.state.context,this)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,T,t,this.state.context)),await((b=(y=oe(this,Wr).config).onSettled)==null?void 0:b.call(y,T,null,this.state.variables,this.state.context,this)),await((N=(w=this.options).onSettled)==null?void 0:N.call(w,T,null,t,this.state.context)),Ht(this,Yi,$o).call(this,{type:"success",data:T}),T}catch(T){try{throw await((E=(k=oe(this,Wr).config).onError)==null?void 0:E.call(k,T,t,this.state.context,this)),await((M=(P=this.options).onError)==null?void 0:M.call(P,T,t,this.state.context)),await((B=(L=oe(this,Wr).config).onSettled)==null?void 0:B.call(L,void 0,T,this.state.variables,this.state.context,this)),await((H=(z=this.options).onSettled)==null?void 0:H.call(z,void 0,T,t,this.state.context)),T}finally{Ht(this,Yi,$o).call(this,{type:"error",error:T})}}finally{oe(this,Wr).runNext(this)}}},Zi=new WeakMap,Wr=new WeakMap,Xc=new WeakMap,Yi=new WeakSet,$o=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Fn.batch(()=>{oe(this,Zi).forEach(r=>{r.onMutationUpdate(t)}),oe(this,Wr).notify({mutation:this,type:"updated",action:t})})},Q3);function w8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ca,af,X3,dO=(X3=class extends xd{constructor(t={}){super();Ot(this,Ca);Ot(this,af);this.config=t,ft(this,Ca,new Map),ft(this,af,Date.now())}build(t,n,r){const a=new cO({mutationCache:this,mutationId:++ex(this,af)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){const n=nx(t),r=oe(this,Ca).get(n)??[];r.push(t),oe(this,Ca).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=nx(t);if(oe(this,Ca).has(n)){const a=(r=oe(this,Ca).get(n))==null?void 0:r.filter(o=>o!==t);a&&(a.length===0?oe(this,Ca).delete(n):oe(this,Ca).set(n,a))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=oe(this,Ca).get(nx(t)))==null?void 0:r.find(a=>a.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=oe(this,Ca).get(nx(t)))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Fn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...oe(this,Ca).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gb(n,r))}findAll(t={}){return this.getAll().filter(n=>Gb(t,n))}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Fn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ga))))}},Ca=new WeakMap,af=new WeakMap,X3);function nx(s){var t;return((t=s.options.scope)==null?void 0:t.id)??String(s.mutationId)}function Qb(s){return{onFetch:(t,n)=>{var m,g,y,b,w;const r=t.options,a=(y=(g=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],c=((w=t.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const x=async()=>{let N=!1;const k=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(t.signal.aborted?N=!0:t.signal.addEventListener("abort",()=>{N=!0}),t.signal)})},E=g8(t.options,t.fetchOptions),P=async(M,L,B)=>{if(N)return Promise.reject();if(L==null&&M.pages.length)return Promise.resolve(M);const z={queryKey:t.queryKey,pageParam:L,direction:B?"backward":"forward",meta:t.options.meta};k(z);const H=await E(z),{maxPages:T}=t.options,U=B?tO:eO;return{pages:U(M.pages,H,T),pageParams:U(M.pageParams,L,T)}};if(a&&o.length){const M=a==="backward",L=M?uO:Xb,B={pages:o,pageParams:c},z=L(r,B);u=await P(B,z,M)}else{const M=s??o.length;do{const L=h===0?c[0]??r.initialPageParam:Xb(r,u);if(h>0&&L==null)break;u=await P(u,L),h++}while(h<M)}return u};t.options.persister?t.fetchFn=()=>{var N,k;return(k=(N=t.options).persister)==null?void 0:k.call(N,x,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=x}}}function Xb(s,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?s.getNextPageParam(t[r],t,n[r],n):void 0}function uO(s,{pages:t,pageParams:n}){var r;return t.length>0?(r=s.getPreviousPageParam)==null?void 0:r.call(s,t[0],t,n[0],n):void 0}var In,Fo,Ro,$u,Pu,Mo,Eu,Tu,J3,mO=(J3=class{constructor(s={}){Ot(this,In);Ot(this,Fo);Ot(this,Ro);Ot(this,$u);Ot(this,Pu);Ot(this,Mo);Ot(this,Eu);Ot(this,Tu);ft(this,In,s.queryCache||new oO),ft(this,Fo,s.mutationCache||new dO),ft(this,Ro,s.defaultOptions||{}),ft(this,$u,new Map),ft(this,Pu,new Map),ft(this,Mo,0)}mount(){ex(this,Mo)._++,oe(this,Mo)===1&&(ft(this,Eu,h2.subscribe(async s=>{s&&(await this.resumePausedMutations(),oe(this,In).onFocus())})),ft(this,Tu,Lx.subscribe(async s=>{s&&(await this.resumePausedMutations(),oe(this,In).onOnline())})))}unmount(){var s,t;ex(this,Mo)._--,oe(this,Mo)===0&&((s=oe(this,Eu))==null||s.call(this),ft(this,Eu,void 0),(t=oe(this,Tu))==null||t.call(this),ft(this,Tu,void 0))}isFetching(s){return oe(this,In).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return oe(this,Fo).findAll({...s,status:"pending"}).length}getQueryData(s){var n;const t=this.defaultQueryOptions({queryKey:s});return(n=oe(this,In).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(s){const t=this.getQueryData(s.queryKey);if(t===void 0)return this.fetchQuery(s);{const n=this.defaultQueryOptions(s),r=oe(this,In).build(this,n);return s.revalidateIfStale&&r.isStaleByTime(hu(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(s){return oe(this,In).findAll(s).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(s,t,n){const r=this.defaultQueryOptions({queryKey:s}),a=oe(this,In).get(r.queryHash),o=a==null?void 0:a.state.data,c=XD(t,o);if(c!==void 0)return oe(this,In).build(this,r).setData(c,{...n,manual:!0})}setQueriesData(s,t,n){return Fn.batch(()=>oe(this,In).findAll(s).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(s){var n;const t=this.defaultQueryOptions({queryKey:s});return(n=oe(this,In).get(t.queryHash))==null?void 0:n.state}removeQueries(s){const t=oe(this,In);Fn.batch(()=>{t.findAll(s).forEach(n=>{t.remove(n)})})}resetQueries(s,t){const n=oe(this,In),r={type:"active",...s};return Fn.batch(()=>(n.findAll(s).forEach(a=>{a.reset()}),this.refetchQueries(r,t)))}cancelQueries(s={},t={}){const n={revert:!0,...t},r=Fn.batch(()=>oe(this,In).findAll(s).map(a=>a.cancel(n)));return Promise.all(r).then(Ga).catch(Ga)}invalidateQueries(s={},t={}){return Fn.batch(()=>{if(oe(this,In).findAll(s).forEach(r=>{r.invalidate()}),s.refetchType==="none")return Promise.resolve();const n={...s,type:s.refetchType??s.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(s={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Fn.batch(()=>oe(this,In).findAll(s).filter(a=>!a.isDisabled()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ga)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ga)}fetchQuery(s){const t=this.defaultQueryOptions(s);t.retry===void 0&&(t.retry=!1);const n=oe(this,In).build(this,t);return n.isStaleByTime(hu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Ga).catch(Ga)}fetchInfiniteQuery(s){return s.behavior=Qb(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Ga).catch(Ga)}ensureInfiniteQueryData(s){return s.behavior=Qb(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return Lx.isOnline()?oe(this,Fo).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,In)}getMutationCache(){return oe(this,Fo)}getDefaultOptions(){return oe(this,Ro)}setDefaultOptions(s){ft(this,Ro,s)}setQueryDefaults(s,t){oe(this,$u).set(od(s),{queryKey:s,defaultOptions:t})}getQueryDefaults(s){const t=[...oe(this,$u).values()];let n={};return t.forEach(r=>{Sh(s,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(s,t){oe(this,Pu).set(od(s),{mutationKey:s,defaultOptions:t})}getMutationDefaults(s){const t=[...oe(this,Pu).values()];let n={};return t.forEach(r=>{Sh(s,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(s){if(s._defaulted)return s;const t={...oe(this,Ro).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return t.queryHash||(t.queryHash=d2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===m2&&(t.enabled=!1),t}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...oe(this,Ro).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){oe(this,In).clear(),oe(this,Fo).clear()}},In=new WeakMap,Fo=new WeakMap,Ro=new WeakMap,$u=new WeakMap,Pu=new WeakMap,Mo=new WeakMap,Eu=new WeakMap,Tu=new WeakMap,J3),ma,Rs,lf,Br,Jc,_u,Lo,Qi,of,Iu,Du,ed,td,Vo,Ou,ln,dh,Ov,Fv,Rv,Mv,Lv,Vv,Uv,A8,e6,f2=(e6=class extends xd{constructor(t,n){super();Ot(this,ln);Ot(this,ma);Ot(this,Rs);Ot(this,lf);Ot(this,Br);Ot(this,Jc);Ot(this,_u);Ot(this,Lo);Ot(this,Qi);Ot(this,of);Ot(this,Iu);Ot(this,Du);Ot(this,ed);Ot(this,td);Ot(this,Vo);Ot(this,Ou,new Set);this.options=n,ft(this,ma,t),ft(this,Qi,null),ft(this,Lo,Dv()),this.options.experimental_prefetchInRender||oe(this,Lo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,Rs).addObserver(this),Jb(oe(this,Rs),this.options)?Ht(this,ln,dh).call(this):this.updateResult(),Ht(this,ln,Mv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zv(oe(this,Rs),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zv(oe(this,Rs),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ht(this,ln,Lv).call(this),Ht(this,ln,Vv).call(this),oe(this,Rs).removeObserver(this)}setOptions(t,n){const r=this.options,a=oe(this,Rs);if(this.options=oe(this,ma).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ni(this.options.enabled,oe(this,Rs))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ht(this,ln,Uv).call(this),oe(this,Rs).setOptions(this.options),r._defaulted&&!Mx(this.options,r)&&oe(this,ma).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,Rs),observer:this});const o=this.hasListeners();o&&eN(oe(this,Rs),a,this.options,r)&&Ht(this,ln,dh).call(this),this.updateResult(n),o&&(oe(this,Rs)!==a||Ni(this.options.enabled,oe(this,Rs))!==Ni(r.enabled,oe(this,Rs))||hu(this.options.staleTime,oe(this,Rs))!==hu(r.staleTime,oe(this,Rs)))&&Ht(this,ln,Ov).call(this);const c=Ht(this,ln,Fv).call(this);o&&(oe(this,Rs)!==a||Ni(this.options.enabled,oe(this,Rs))!==Ni(r.enabled,oe(this,Rs))||c!==oe(this,Vo))&&Ht(this,ln,Rv).call(this,c)}getOptimisticResult(t){const n=oe(this,ma).getQueryCache().build(oe(this,ma),t),r=this.createResult(n,t);return fO(this,r)&&(ft(this,Br,r),ft(this,_u,this.options),ft(this,Jc,oe(this,Rs).state)),r}getCurrentResult(){return oe(this,Br)}trackResult(t,n){const r={};return Object.keys(t).forEach(a=>{Object.defineProperty(r,a,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(a),n==null||n(a),t[a])})}),r}trackProp(t){oe(this,Ou).add(t)}getCurrentQuery(){return oe(this,Rs)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=oe(this,ma).defaultQueryOptions(t),r=oe(this,ma).getQueryCache().build(oe(this,ma),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ht(this,ln,dh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,Br)))}createResult(t,n){var T;const r=oe(this,Rs),a=this.options,o=oe(this,Br),c=oe(this,Jc),u=oe(this,_u),x=t!==r?t.state:oe(this,lf),{state:m}=t;let g={...m},y=!1,b;if(n._optimisticResults){const U=this.hasListeners(),_=!U&&Jb(t,n),se=U&&eN(t,r,n,a);(_||se)&&(g={...g,...N8(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:w,errorUpdatedAt:N,status:k}=g;if(n.select&&g.data!==void 0)if(o&&g.data===(c==null?void 0:c.data)&&n.select===oe(this,of))b=oe(this,Iu);else try{ft(this,of,n.select),b=n.select(g.data),b=Iv(o==null?void 0:o.data,b,n),ft(this,Iu,b),ft(this,Qi,null)}catch(U){ft(this,Qi,U)}else b=g.data;if(n.placeholderData!==void 0&&b===void 0&&k==="pending"){let U;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))U=o.data;else if(U=typeof n.placeholderData=="function"?n.placeholderData((T=oe(this,Du))==null?void 0:T.state.data,oe(this,Du)):n.placeholderData,n.select&&U!==void 0)try{U=n.select(U),ft(this,Qi,null)}catch(_){ft(this,Qi,_)}U!==void 0&&(k="success",b=Iv(o==null?void 0:o.data,U,n),y=!0)}oe(this,Qi)&&(w=oe(this,Qi),b=oe(this,Iu),N=Date.now(),k="error");const E=g.fetchStatus==="fetching",P=k==="pending",M=k==="error",L=P&&E,B=b!==void 0,H={status:k,fetchStatus:g.fetchStatus,isPending:P,isSuccess:k==="success",isError:M,isInitialLoading:L,isLoading:L,data:b,dataUpdatedAt:g.dataUpdatedAt,error:w,errorUpdatedAt:N,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>x.dataUpdateCount||g.errorUpdateCount>x.errorUpdateCount,isFetching:E,isRefetching:E&&!P,isLoadingError:M&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&B,isStale:p2(t,n),refetch:this.refetch,promise:oe(this,Lo)};if(this.options.experimental_prefetchInRender){const U=ae=>{H.status==="error"?ae.reject(H.error):H.data!==void 0&&ae.resolve(H.data)},_=()=>{const ae=ft(this,Lo,H.promise=Dv());U(ae)},se=oe(this,Lo);switch(se.status){case"pending":t.queryHash===r.queryHash&&U(se);break;case"fulfilled":(H.status==="error"||H.data!==se.value)&&_();break;case"rejected":(H.status!=="error"||H.error!==se.reason)&&_();break}}return H}updateResult(t){const n=oe(this,Br),r=this.createResult(oe(this,Rs),this.options);if(ft(this,Jc,oe(this,Rs).state),ft(this,_u,this.options),oe(this,Jc).data!==void 0&&ft(this,Du,oe(this,Rs)),Mx(r,n))return;ft(this,Br,r);const a={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:c}=this.options,u=typeof c=="function"?c():c;if(u==="all"||!u&&!oe(this,Ou).size)return!0;const h=new Set(u??oe(this,Ou));return this.options.throwOnError&&h.add("error"),Object.keys(oe(this,Br)).some(x=>{const m=x;return oe(this,Br)[m]!==n[m]&&h.has(m)})};(t==null?void 0:t.listeners)!==!1&&o()&&(a.listeners=!0),Ht(this,ln,A8).call(this,{...a,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ht(this,ln,Mv).call(this)}},ma=new WeakMap,Rs=new WeakMap,lf=new WeakMap,Br=new WeakMap,Jc=new WeakMap,_u=new WeakMap,Lo=new WeakMap,Qi=new WeakMap,of=new WeakMap,Iu=new WeakMap,Du=new WeakMap,ed=new WeakMap,td=new WeakMap,Vo=new WeakMap,Ou=new WeakMap,ln=new WeakSet,dh=function(t){Ht(this,ln,Uv).call(this);let n=oe(this,Rs).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ga)),n},Ov=function(){Ht(this,ln,Lv).call(this);const t=hu(this.options.staleTime,oe(this,Rs));if(ld||oe(this,Br).isStale||!Tv(t))return;const r=x8(oe(this,Br).dataUpdatedAt,t)+1;ft(this,ed,setTimeout(()=>{oe(this,Br).isStale||this.updateResult()},r))},Fv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,Rs)):this.options.refetchInterval)??!1},Rv=function(t){Ht(this,ln,Vv).call(this),ft(this,Vo,t),!(ld||Ni(this.options.enabled,oe(this,Rs))===!1||!Tv(oe(this,Vo))||oe(this,Vo)===0)&&ft(this,td,setInterval(()=>{(this.options.refetchIntervalInBackground||h2.isFocused())&&Ht(this,ln,dh).call(this)},oe(this,Vo)))},Mv=function(){Ht(this,ln,Ov).call(this),Ht(this,ln,Rv).call(this,Ht(this,ln,Fv).call(this))},Lv=function(){oe(this,ed)&&(clearTimeout(oe(this,ed)),ft(this,ed,void 0))},Vv=function(){oe(this,td)&&(clearInterval(oe(this,td)),ft(this,td,void 0))},Uv=function(){const t=oe(this,ma).getQueryCache().build(oe(this,ma),this.options);if(t===oe(this,Rs))return;const n=oe(this,Rs);ft(this,Rs,t),ft(this,lf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},A8=function(t){Fn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(oe(this,Br))}),oe(this,ma).getQueryCache().notify({query:oe(this,Rs),type:"observerResultsUpdated"})})},e6);function hO(s,t){return Ni(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&t.retryOnMount===!1)}function Jb(s,t){return hO(s,t)||s.state.data!==void 0&&zv(s,t,t.refetchOnMount)}function zv(s,t,n){if(Ni(t.enabled,s)!==!1){const r=typeof n=="function"?n(s):n;return r==="always"||r!==!1&&p2(s,t)}return!1}function eN(s,t,n,r){return(s!==t||Ni(r.enabled,s)===!1)&&(!n.suspense||s.state.status!=="error")&&p2(s,n)}function p2(s,t){return Ni(t.enabled,s)!==!1&&s.isStaleByTime(hu(t.staleTime,s))}function fO(s,t){return!Mx(s.getCurrentResult(),t)}function tN(s,t){return s.filter(n=>!t.includes(n))}function pO(s,t,n){const r=s.slice(0);return r[t]=n,r}var Fu,Ha,sd,Ru,Sa,Uo,cf,df,lr,qv,Wv,jx,Bv,Kv,t6,xO=(t6=class extends xd{constructor(t,n,r){super();Ot(this,lr);Ot(this,Fu);Ot(this,Ha);Ot(this,sd);Ot(this,Ru);Ot(this,Sa);Ot(this,Uo);Ot(this,cf);Ot(this,df);ft(this,Fu,t),ft(this,Ru,r),ft(this,sd,[]),ft(this,Sa,[]),ft(this,Ha,[]),this.setQueries(n)}
49onSubscribe(){this.listeners.size===1&&oe(this,Sa).forEach(t=>{t.subscribe(n=>{Ht(this,lr,Bv).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,oe(this,Sa).forEach(t=>{t.destroy()})}setQueries(t,n,r){ft(this,sd,t),ft(this,Ru,n),Fn.batch(()=>{const a=oe(this,Sa),o=Ht(this,lr,jx).call(this,oe(this,sd));o.forEach(x=>x.observer.setOptions(x.defaultedQueryOptions,r));const c=o.map(x=>x.observer),u=c.map(x=>x.getCurrentResult()),h=c.some((x,m)=>x!==a[m]);a.length===c.length&&!h||(ft(this,Sa,c),ft(this,Ha,u),this.hasListeners()&&(tN(a,c).forEach(x=>{x.destroy()}),tN(c,a).forEach(x=>{x.subscribe(m=>{Ht(this,lr,Bv).call(this,x,m)})}),Ht(this,lr,Kv).call(this)))})}getCurrentResult(){return oe(this,Ha)}getQueries(){return oe(this,Sa).map(t=>t.getCurrentQuery())}getObservers(){return oe(this,Sa)}getOptimisticResult(t,n){const a=Ht(this,lr,jx).call(this,t).map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions));return[a,o=>Ht(this,lr,Wv).call(this,o??a,n),()=>Ht(this,lr,qv).call(this,a,t)]}},Fu=new WeakMap,Ha=new WeakMap,sd=new WeakMap,Ru=new WeakMap,Sa=new WeakMap,Uo=new WeakMap,cf=new WeakMap,df=new WeakMap,lr=new WeakSet,qv=function(t,n){const r=Ht(this,lr,jx).call(this,n);return r.map((a,o)=>{const c=t[o];return a.defaultedQueryOptions.notifyOnChangeProps?c:a.observer.trackResult(c,u=>{r.forEach(h=>{h.observer.trackProp(u)})})})},Wv=function(t,n){return n?((!oe(this,Uo)||oe(this,Ha)!==oe(this,df)||n!==oe(this,cf))&&(ft(this,cf,n),ft(this,df,oe(this,Ha)),ft(this,Uo,u2(oe(this,Uo),n(t)))),oe(this,Uo)):t},jx=function(t){const n=new Map(oe(this,Sa).map(a=>[a.options.queryHash,a])),r=[];return t.forEach(a=>{const o=oe(this,Fu).defaultQueryOptions(a),c=n.get(o.queryHash);if(c)r.push({defaultedQueryOptions:o,observer:c});else{const u=oe(this,Sa).find(h=>h.options.queryHash===o.queryHash);r.push({defaultedQueryOptions:o,observer:u??new f2(oe(this,Fu),o)})}}
49),r.sort((a,o)=>t.findIndex(c=>c.queryHash===a.defaultedQueryOptions.queryHash)-t.findIndex(c=>c.queryHash===o.defaultedQueryOptions.queryHash))},Bv=function(t,n){const r=oe(this,Sa).indexOf(t);r!==-1&&(ft(this,Ha,pO(oe(this,Ha),r,n)),Ht(this,lr,Kv).call(this))},Kv=function(){var t;if(this.hasListeners()){const n=oe(this,Uo),r=Ht(this,lr,Wv).call(this,Ht(this,lr,qv).call(this,oe(this,Ha),oe(this,sd)),(t=oe(this,Ru))==null?void 0:t.combine);n!==r&&Fn.batch(()=>{this.listeners.forEach(a=>{a(oe(this,Ha))})})}},t6),zo,qo,ha,Ul,ql,bx,Hv,s6,gO=(s6=class extends xd{constructor(n,r){super();Ot(this,ql);Ot(this,zo);Ot(this,qo);Ot(this,ha);Ot(this,Ul);ft(this,zo,n),this.setOptions(r),this.bindMethods(),Ht(this,ql,bx).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=oe(this,zo).defaultMutationOptions(n),Mx(this.options,r)||oe(this,zo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:oe(this,ha),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&od(r.mutationKey)!==od(this.options.mutationKey)?this.reset():((a=oe(this,ha))==null?void 0:a.state.status)==="pending"&&oe(this,ha).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=oe(this,ha))==null||n.removeObserver(this)}onMutationUpdate(n){Ht(this,ql,bx).call(this),Ht(this,ql,Hv).call(this,n)}getCurrentResult(){return oe(this,qo)}reset(){var n;(n=oe(this,ha))==null||n.removeObserver(this),ft(this,ha,void 0),Ht(this,ql,bx).call(this),Ht(this,ql,Hv).call(this)}mutate(n,r){var a;return ft(this,Ul,r),(a=oe(this,ha))==null||a.removeObserver(this),ft(this,ha,oe(this,zo).getMutationCache().build(oe(this,zo),this.options)),oe(this,ha).addObserver(this),oe(this,ha).execute(n)}},zo=new WeakMap,qo=new WeakMap,ha=new WeakMap,Ul=new WeakMap,ql=new WeakSet,bx=function(){var r;const n=((r=oe(this,ha))==null?void 0:r.state)??w8();ft(this,qo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Hv=function(n){Fn.batch(()=>{var r,a,o,c,u,h,x,m;if(oe(this,Ul)&&this.hasListeners()){const g=oe(this,qo).variables,y=oe(this,qo).context;(n==null?void 0:n.type)==="success"?((a=(r=oe(this,Ul)).onSuccess)==null||a.call(r,n.data,g,y),(c=(o=oe(this,Ul)).onSettled)==null||c.call(o,n.data,null,g,y)):(n==null?void 0:n.type)==="error"&&((h=(u=oe(this,Ul)).onError)==null||h.call(u,n.error,g,y),(m=(x=oe(this,Ul)).onSettled)==null||m.call(x,void 0,n.error,g,y))}this.listeners.forEach(g=>{g(oe(this,qo))})})},s6),C8=p.createContext(void 0),dn=s=>{const t=p.useContext(C8);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sN=({client:s,children:t})=>(p.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),e.jsx(C8.Provider,{value:s,children:t})),S8=p.createContext(!1),k8=()=>p.useContext(S8);S8.Provider;function yO(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var vO=p.createContext(yO()),$8=()=>p.useContext(vO);function P8(s,t){return typeof s=="function"?s(...t):!!s}function Vx(){}var E8=(s,t)=>{(s.suspense||s.throwOnError||s.experimental_prefetchInRender)&&(t.isReset()||(s.retryOnMount=!1))},T8=s=>{p.useEffect(()=>{s.clearReset()},[s])},_8=({result:s,errorResetBoundary:t,throwOnError:n,query:r})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&P8(n,[s.error,r]),I8=s=>{s.suspense&&(s.staleTime===void 0&&(s.staleTime=1e3),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3)))},D8=(s,t)=>s.isLoading&&s.isFetching&&!t,Gv=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,Ux=(s,t,n)=>t.fetchOptimistic(s).catch(()=>{n.clearReset()});function jO({queries:s,...t},n){const r=dn(),a=k8(),o=$8(),c=p.useMemo(()=>s.map(w=>{const N=r.defaultQueryOptions(w);return N._optimisticResults=a?"isRestoring":"optimistic",N}),[s,r,a]);c.forEach(w=>{I8(w),E8(w,o)}),T8(o);const[u]=p.useState(()=>new xO(r,c,t)),[h,x,m]=u.getOptimisticResult(c,t.combine);p.useSyncExternalStore(p.useCallback(w=>a?Vx:u.subscribe(Fn.batchCalls(w)),[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),p.useEffect(()=>{u.setQueries(c,t,{listeners:!1})},[c,t,u]);const y=h.some((w,N)=>Gv(c[N],w))?h.flatMap((w,N)=>{const k=c[N];if(k){const E=new f2(r,k);if(Gv(k,w))return Ux(k,E,o);D8(w,a)&&Ux(k,E,o)}return[]}):[];if(y.length>0)throw Promise.all(y);const b=h.find((w,N)=>{const k=c[N];return k&&_8({result:w,errorResetBoundary:o,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash)})});if(b!=null&&b.error)throw b.error;return x(m())}function bO(s,t,n){var m,g,y,b,w;const r=dn(),a=k8(),o=$8(),c=r.defaultQueryOptions(s);(g=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||g.call(m,c),c._optimisticResults=a?"isRestoring":"optimistic",I8(c),E8(c,o),T8(o);const u=!r.getQueryCache().get(c.queryHash),[h]=p.useState(()=>new t(r,c)),x=h.getOptimisticResult(c);if(p.useSyncExternalStore(p.useCallback(N=>{const k=a?Vx:h.subscribe(Fn.batchCalls(N));return h.updateResult(),k}
49,[h,a]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),p.useEffect(()=>{h.setOptions(c,{listeners:!1})},[c,h]),Gv(c,x))throw Ux(c,h,o);if(_8({result:x,errorResetBoundary:o,throwOnError:c.throwOnError,query:r.getQueryCache().get(c.queryHash)}))throw x.error;if((b=(y=r.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||b.call(y,c,x),c.experimental_prefetchInRender&&!ld&&D8(x,a)){const N=u?Ux(c,h,o):(w=r.getQueryCache().get(c.queryHash))==null?void 0:w.promise;N==null||N.catch(Vx).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?x:h.trackResult(x)}function nt(s,t){return bO(s,f2)}function bt(s,t){const n=dn(),[r]=p.useState(()=>new gO(n,s));p.useEffect(()=>{r.setOptions(s)},[r,s]);const a=p.useSyncExternalStore(p.useCallback(c=>r.subscribe(Fn.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=p.useCallback((c,u)=>{r.mutate(c,u).catch(Vx)},[r]);if(a.error&&P8(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}async function O8(s){if(!s.ok){const t=await s.text()||s.statusText;if(s.status===302)try{const n=JSON.parse(t),r=new Error(`${s.status}: ${n.message||t}`);throw r.status=s.status,r.redirectTo=n.redirectTo,r}catch{}throw new Error(`${s.status}: ${t}`)}}async function st(s,t,n){const r=s.toUpperCase(),a=await fetch(t,{method:r,headers:{"Content-Type":"application/json",...n?{}:{}},body:n?JSON.stringify(n):void 0,credentials:"include"});return await O8(a),a}const Nx=({on401:s})=>async({queryKey:t})=>{const n=await fetch(t[0],{credentials:"include"});if(s==="returnNull"&&n.status===401)return null;if(n.status===302){console.log("Query function detected 302 response for:",t[0]);const r=await n.text();console.log("302 response text:",r);try{const a=JSON.parse(r);console.log("302 parsed data:",a);const o=new Error(`${n.status}: ${a.message||r}`);throw o.status=n.status,o.redirectTo=a.redirectTo,console.log("Throwing 302 error:",o),o}catch{throw console.log("JSON parse failed, throwing generic 302 error"),new Error(`${n.status}: ${r}`)}}return await O8(n),await n.json()},Xi=new mO({defaultOptions:{queries:{queryFn:Nx({on401:"returnNull"}),refetchInterval:!1,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!1,staleTime:1/0,gcTime:1/0},mutations:{retry:!1}}}),NO=1,wO=1e6;let Wy=0;function AO(){return Wy=(Wy+1)%Number.MAX_SAFE_INTEGER,Wy.toString()}const By=new Map,nN=s=>{if(By.has(s))return;const t=setTimeout(()=>{By.delete(s),jh({type:"REMOVE_TOAST",toastId:s})},wO);By.set(s,t)},CO=(s,t)=>{switch(t.type){case"ADD_TOAST":return{...s,toasts:[t.toast,...s.toasts].slice(0,NO)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?nN(n):s.toasts.forEach(r=>{nN(r.id)}),{...s,toasts:s.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(n=>n.id!==t.toastId)}}},wx=[];let Ax={toasts:[]};function jh(s){Ax=CO(Ax,s),wx.forEach(t=>{t(Ax)})}function SO({...s}){const t=AO(),n=a=>jh({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>jh({type:"DISMISS_TOAST",toastId:t});return jh({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Is(){const[s,t]=p.useState(Ax);return p.useEffect(()=>(wx.push(t),()=>{const n=wx.indexOf(t);n>-1&&wx.splice(n,1)}),[s]),{...s,toast:SO,dismiss:n=>jh({type:"DISMISS_TOAST",toastId:n})}}var Qu=a8();const kO=r8(Qu);function ut(s,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(s==null||s(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function rN(s,t){if(typeof s=="function")return s(t);s!=null&&(s.current=t)}function S0(...s){return t=>{let n=!1;const r=s.map(a=>{const o=rN(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():rN(s[a],null)}}}}function Cs(...s){return p.useCallback(S0(...s),s)}function $O(s,t){const n=p.createContext(t),r=o=>{const{children:c,...u}=o,h=p.useMemo(()=>u,Object.values(u));return e.jsx(n.Provider,{value:h,children:c})};r.displayName=s+"Provider";function a(o){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${s}\``)}return[r,a]}function or(s,t=[]){let n=[];function r(o,c){const u=p.createContext(c),h=n.length;n=[...n,c];const x=g=>{var E;const{scope:y,children:b,...w}=g,N=((E=y==null?void 0:y[s])==null?void 0:E[h])||u,k=p.useMemo(()=>w,Object.values(w));return e.jsx(N.Provider,{value:k,children:b})};x.displayName=o+"Provider";function m(g,y){var N;const b=((N=y==null?void 0:y[s])==null?void 0:N[h])||u,w=p.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[x,m]}const a=()=>{const o=n.map(c=>p.createContext(c));return function(u){const h=(u==null?void 0:u[s])||o;return p.useMemo(()=>({[`__scope${s}`]:{...u,[s]:h}}),[u,h])}};return a.scopeName=s,[r,PO(a,...t)]}function PO(...s){const t=s[0];if(s.length===1)return t;const n=()=>{const r=s.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const c=r.reduce((u,{useScope:h,scopeName:x})=>{const g=h(o)[`__scope${x}`];return{...u,...g}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Qo(s){const t=EO(s),n=p.forwardRef((r,a)=>{const{children:o,...c}=r,u=p.Children.toArray(o),h=u.find(TO);if(h){const x=h.props.children,m=u.map(g=>g===h?p.Children.count(x)>1?p.Children.only(null):p.isValidElement(x)?x.props.children:null:g);return e.jsx(t,{...c,ref:a,children:p.isValidElement(x)?p.cloneElement(x,void 0,m):null})}return e.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${s}.Slot`,n}var F8=Qo("Slot");function EO(s){const t=p.forwardRef((n,r)=>{const{children:a,...o}=n;if(p.isValidElement(a)){const c=IO(a),u=_O(o,a.props);return a.type!==p.Fragment&&(u.ref=r?S0(r,c):c),p.cloneElement(a,u)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${s}.SlotClone`,t}var R8=Symbol("radix.slottable");function M8(s){const t=({children:n})=>e.jsx(e.Fragment,{children:n});return t.displayName=`${s}.Slottable`,t.__radixId=R8,t}function TO(s){return p.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===R8}function _O(s,t){const n={...t};for(const r in t){const a=s[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{o(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}
vendor: 6,077 bytes, line 49
49:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...s,...n}}function IO(s){var r,a;let t=(r=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?s.ref:(t=(a=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?s.props.ref:s.props.ref||s.ref)}function mf(s){const t=s+"CollectionProvider",[n,r]=or(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=N=>{const{scope:k,children:E}=N,P=Ut.useRef(null),M=Ut.useRef(new Map).current;return e.jsx(a,{scope:k,itemMap:M,collectionRef:P,children:E})};c.displayName=t;const u=s+"CollectionSlot",h=Qo(u),x=Ut.forwardRef((N,k)=>{const{scope:E,children:P}=N,M=o(u,E),L=Cs(k,M.collectionRef);return e.jsx(h,{ref:L,children:P})});x.displayName=u;const m=s+"CollectionItemSlot",g="data-radix-collection-item",y=Qo(m),b=Ut.forwardRef((N,k)=>{const{scope:E,children:P,...M}=N,L=Ut.useRef(null),B=Cs(k,L),z=o(m,E);return Ut.useEffect(()=>(z.itemMap.set(L,{ref:L,...M}),()=>void z.itemMap.delete(L))),e.jsx(y,{[g]:"",ref:B,children:P})});b.displayName=m;function w(N){const k=o(s+"CollectionConsumer",N);return Ut.useCallback(()=>{const P=k.collectionRef.current;if(!P)return[];const M=Array.from(P.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort((z,H)=>M.indexOf(z.ref.current)-M.indexOf(H.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:c,Slot:x,ItemSlot:b},w,r]}var DO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_t=DO.reduce((s,t)=>{const n=Qo(`Primitive.${t}`),r=p.forwardRef((a,o)=>{const{asChild:c,...u}=a,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(h,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...s,[t]:r}},{});function x2(s,t){s&&Qu.flushSync(()=>s.dispatchEvent(t))}function vr(s){const t=p.useRef(s);return p.useEffect(()=>{t.current=s}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function OO(s,t=globalThis==null?void 0:globalThis.document){const n=vr(s);p.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var FO="DismissableLayer",Zv="dismissableLayer.update",RO="dismissableLayer.pointerDownOutside",MO="dismissableLayer.focusOutside",aN,L8=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gd=p.forwardRef((s,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:u,...h}=s,x=p.useContext(L8),[m,g]=p.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=Cs(t,H=>g(H)),N=Array.from(x.layers),[k]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),E=N.indexOf(k),P=m?N.indexOf(m):-1,M=x.layersWithOutsidePointerEventsDisabled.size>0,L=P>=E,B=VO(H=>{const T=H.target,U=[...x.branches].some(_=>_.contains(T));!L||U||(a==null||a(H),c==null||c(H),H.defaultPrevented||u==null||u())},y),z=UO(H=>{const T=H.target;[...x.branches].some(_=>_.contains(T))||(o==null||o(H),c==null||c(H),H.defaultPrevented||u==null||u())},y);return OO(H=>{P===x.layers.size-1&&(r==null||r(H),!H.defaultPrevented&&u&&(H.preventDefault(),u()))},y),p.useEffect(()=>{if(m)return n&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(aN=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(m)),x.layers.add(m),iN(),()=>{n&&x.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=aN)}},[m,y,n,x]),p.useEffect(()=>()=>{m&&(x.layers.delete(m),x.layersWithOutsidePointerEventsDisabled.delete(m),iN())},[m,x]),p.useEffect(()=>{const H=()=>b({});return document.addEventListener(Zv,H),()=>document.removeEventListener(Zv,H)},[]),e.jsx(_t.div,{...h,ref:w,style:{pointerEvents:M?L?"auto":"none":void 0,...s.style},onFocusCapture:ut(s.onFocusCapture,z.onFocusCapture),onBlurCapture:ut(s.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ut(s.onPointerDownCapture,B.onPointerDownCapture)})});gd.displayName=FO;var LO="DismissableLayerBranch",V8=p.forwardRef((s,t)=>{const n=p.useContext(L8),r=p.useRef(null),a=Cs(t,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),e.jsx(_t.div,{...s,ref:a})});V8.displayName=LO;function VO(s,t=globalThis==null?void 0:globalThis.document){const n=vr(s),r=p.useRef(!1),a=p.useRef(()=>{});return p.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let h=function(){U8(RO,n,x,{discrete:!0})};const x={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=h,t.addEventListener("click",a.current,{once:!0})):h()}else t.removeEventListener("click",a.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function UO(s,t=globalThis==null?void 0:globalThis.document){const n=vr(s),r=p.useRef(!1);return p.useEffect(()=>{const a=o=>{o.target&&!r.current&&U8(MO,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function iN(){const s=new CustomEvent(Zv);document.dispatchEvent(s)}function U8(s,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(s,t,{once:!0}),r?x2(a,o):a.dispatchEvent(o)}var zO=gd,qO=V8,Zn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},WO="Portal",Xu=p.forwardRef((s,t)=>{var u;const{container:n,...r}=s,[a,o]=p.useState(!1);Zn(()=>o(!0),[]);const c=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?kO.createPortal(e.jsx(_t.div,{...r,ref:t}),c):null});
49Xu.displayName=WO;function BO(s,t){return p.useReducer((n,r)=>t[n][r]??n,s)}var ea=s=>{const{present:t,children:n}=s,r=KO(t),a=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Cs(r.ref,HO(a));return typeof n=="function"||r.isPresent?p.cloneElement(a,{ref:o}):null};ea.displayName="Presence";function KO(s){const[t,n]=p.useState(),r=p.useRef({}),a=p.useRef(s),o=p.useRef("none"),c=s?"mounted":"unmounted",[u,h]=BO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const x=rx(r.current);o.current=u==="mounted"?x:"none"},[u]),Zn(()=>{const x=r.current,m=a.current;if(m!==s){const y=o.current,b=rx(x);s?h("MOUNT"):b==="none"||(x==null?void 0:x.display)==="none"?h("UNMOUNT"):h(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=s}},[s,h]),Zn(()=>{if(t){let x;const m=t.ownerDocument.defaultView??window,g=b=>{const N=rx(r.current).includes(b.animationName);if(b.target===t&&N&&(h("ANIMATION_END"),!a.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",x=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},y=b=>{b.target===t&&(o.current=rx(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(x),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:p.useCallback(x=>{x&&(r.current=getComputedStyle(x)),n(x)},[])}}function rx(s){return(s==null?void 0:s.animationName)||"none"}function HO(s){var r,a;let t=(r=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?s.ref:(t=(a=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?s.props.ref:s.props.ref||s.ref)}function ga({prop:s,defaultProp:t,onChange:n=()=>{}}){const[r,a]=GO({defaultProp:t,onChange:n}),o=s!==void 0,c=o?s:r,u=vr(n),h=p.useCallback(x=>{if(o){const g=typeof x=="function"?x(s):x;g!==s&&u(g)}else a(x)},[o,s,a,u]);return[c,h]}function GO({defaultProp:s,onChange:t}){const n=p.useState(s),[r]=n,a=p.useRef(r),o=vr(t);return p.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}var ZO="VisuallyHidden",hf=p.forwardRef((s,t)=>e.jsx(_t.span,{...s,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...s.style}}));hf.displayName=ZO;var YO=hf,g2="ToastProvider",[y2,QO,XO]=mf("Toast"),[z8]=or("Toast",[XO]),[JO,k0]=z8(g2),q8=s=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:c}=s,[u,h]=p.useState(null),[x,m]=p.useState(0),g=p.useRef(!1),y=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${g2}\`. Expected non-empty \`string\`.`),e.jsx(y2.Provider,{scope:t,children:e.jsx(JO,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:x,viewport:u,onViewportChange:h,onToastAdd:p.useCallback(()=>m(b=>b+1),[]),onToastRemove:p.useCallback(()=>m(b=>b-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:y,children:c})})};q8.displayName=g2;var W8="ToastViewport",eF=["F8"],Yv="toast.viewportPause",Qv="toast.viewportResume",B8=p.forwardRef((s,t)=>{const{__scopeToast:n,hotkey:r=eF,label:a="Notifications ({hotkey})",...o}=s,c=k0(W8,n),u=QO(n),h=p.useRef(null),x=p.useRef(null),m=p.useRef(null),g=p.useRef(null),y=Cs(t,g,c.onViewportChange),b=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=c.toastCount>0;p.useEffect(()=>{const k=E=>{var M;r.length!==0&&r.every(L=>E[L]||E.code===L)&&((M=g.current)==null||M.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r]),p.useEffect(()=>{const k=h.current,E=g.current;if(w&&k&&E){const P=()=>{if(!c.isClosePausedRef.current){const z=new CustomEvent(Yv);E.dispatchEvent(z),c.isClosePausedRef.current=!0}},M=()=>
49{if(c.isClosePausedRef.current){const z=new CustomEvent(Qv);E.dispatchEvent(z),c.isClosePausedRef.current=!1}},L=z=>{!k.contains(z.relatedTarget)&&M()},B=()=>{k.contains(document.activeElement)||M()};return k.addEventListener("focusin",P),k.addEventListener("focusout",L),k.addEventListener("pointermove",P),k.addEventListener("pointerleave",B),window.addEventListener("blur",P),window.addEventListener("focus",M),()=>{k.removeEventListener("focusin",P),k.removeEventListener("focusout",L),k.removeEventListener("pointermove",P),k.removeEventListener("pointerleave",B),window.removeEventListener("blur",P),window.removeEventListener("focus",M)}}},[w,c.isClosePausedRef]);const N=p.useCallback(({tabbingDirection:k})=>{const P=u().map(M=>{const L=M.ref.current,B=[L,...hF(L)];return k==="forwards"?B:B.reverse()});return(k==="forwards"?P.reverse():P).flat()},[u]);return p.useEffect(()=>{const k=g.current;if(k){const E=P=>{var B,z,H;const M=P.altKey||P.ctrlKey||P.metaKey;if(P.key==="Tab"&&!M){const T=document.activeElement,U=P.shiftKey;if(P.target===k&&U){(B=x.current)==null||B.focus();return}const ae=N({tabbingDirection:U?"backwards":"forwards"}),W=ae.findIndex(J=>J===T);Ky(ae.slice(W+1))?P.preventDefault():U?(z=x.current)==null||z.focus():(H=m.current)==null||H.focus()}};return k.addEventListener("keydown",E),()=>k.removeEventListener("keydown",E)}},[u,N]),e.jsxs(qO,{ref:h,role:"region","aria-label":a.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&e.jsx(Xv,{ref:x,onFocusFromOutsideViewport:()=>{const k=N({tabbingDirection:"forwards"});Ky(k)}}),e.jsx(y2.Slot,{scope:n,children:e.jsx(_t.ol,{tabIndex:-1,...o,ref:y})}),w&&e.jsx(Xv,{ref:m,onFocusFromOutsideViewport:()=>{const k=N({tabbingDirection:"backwards"});Ky(k)}})]})});B8.displayName=W8;var K8="ToastFocusProxy",Xv=p.forwardRef((s,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=s,o=k0(K8,n);return e.jsx(hf,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var x;const u=c.relatedTarget;!((x=o.viewport)!=null&&x.contains(u))&&r()}})});Xv.displayName=K8;var $0="Toast",tF="toast.swipeStart",sF="toast.swipeMove",nF="toast.swipeCancel",rF="toast.swipeEnd",H8=p.forwardRef((s,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...c}=s,[u=!0,h]=ga({prop:r,defaultProp:a,onChange:o});return e.jsx(ea,{present:n||u,children:e.jsx(lF,{open:u,...c,ref:t,onClose:()=>h(!1),onPause:vr(s.onPause),onResume:vr(s.onResume),onSwipeStart:ut(s.onSwipeStart,x=>{x.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ut(s.onSwipeMove,x=>{const{x:m,y:g}=x.detail.delta;x.currentTarget.setAttribute("data-swipe","move"),x.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),x.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:ut(s.onSwipeCancel,x=>{x.currentTarget.setAttribute("data-swipe","cancel"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),x.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ut(s.onSwipeEnd,x=>{const{x:m,y:g}=x.detail.delta;x.currentTarget.setAttribute("data-swipe","end"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),x.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),x.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),h(!1)})})})});H8.displayName=$0;var[aF,iF]=z8($0,{onClose(){}}),lF=p.forwardRef((s,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:c,onEscapeKeyDown:u,onPause:h,onResume:x,onSwipeStart:m,onSwipeMove:g,onSwipeCancel:y,onSwipeEnd:b,...w}=s,N=k0($0,n),[k,E]=p.useState(null),P=Cs(t,J=>E(J)),M=p.useRef(null),L=p.useRef(null),B=a||N.duration,z=p.useRef(0),H=p.useRef(B),T=p.useRef(0),{onToastAdd:U,onToastRemove:_}=N,se=vr(()=>{var ne;(k==null?void 0:k.contains(document.activeElement))&&((ne=N.viewport)==null||ne.focu
49s()),c()}),ae=p.useCallback(J=>{!J||J===1/0||(window.clearTimeout(T.current),z.current=new Date().getTime(),T.current=window.setTimeout(se,J))},[se]);p.useEffect(()=>{const J=N.viewport;if(J){const ne=()=>{ae(H.current),x==null||x()},le=()=>{const V=new Date().getTime()-z.current;H.current=H.current-V,window.clearTimeout(T.current),h==null||h()};return J.addEventListener(Yv,le),J.addEventListener(Qv,ne),()=>{J.removeEventListener(Yv,le),J.removeEventListener(Qv,ne)}}},[N.viewport,B,h,x,ae]),p.useEffect(()=>{o&&!N.isClosePausedRef.current&&ae(B)},[o,B,N.isClosePausedRef,ae]),p.useEffect(()=>(U(),()=>_()),[U,_]);const W=p.useMemo(()=>k?e7(k):null,[k]);return N.viewport?e.jsxs(e.Fragment,{children:[W&&e.jsx(oF,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),e.jsx(aF,{scope:n,onClose:se,children:Qu.createPortal(e.jsx(y2.ItemSlot,{scope:n,children:e.jsx(zO,{asChild:!0,onEscapeKeyDown:ut(u,()=>{N.isFocusedToastEscapeKeyDownRef.current||se(),N.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(_t.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":N.swipeDirection,...w,ref:P,style:{userSelect:"none",touchAction:"none",...s.style},onKeyDown:ut(s.onKeyDown,J=>{J.key==="Escape"&&(u==null||u(J.nativeEvent),J.nativeEvent.defaultPrevented||(N.isFocusedToastEscapeKeyDownRef.current=!0,se()))}),onPointerDown:ut(s.onPointerDown,J=>{J.button===0&&(M.current={x:J.clientX,y:J.clientY})}),onPointerMove:ut(s.onPointerMove,J=>{if(!M.current)return;const ne=J.clientX-M.current.x,le=J.clientY-M.current.y,V=!!L.current,Z=["left","right"].includes(N.swipeDirection),ue=["left","up"].includes(N.swipeDirection)?Math.min:Math.max,ge=Z?ue(0,ne):0,G=Z?0:ue(0,le),Ae=J.pointerType==="touch"?10:2,Fe={x:ge,y:G},be={originalEvent:J,delta:Fe};V?(L.current=Fe,ax(sF,g,be,{discrete:!1})):lN(Fe,N.swipeDirection,Ae)?(L.current=Fe,ax(tF,m,be,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(ne)>Ae||Math.abs(le)>Ae)&&(M.current=null)}),onPointerUp:ut(s.onPointerUp,J=>{const ne=L.current,le=J.target;if(le.hasPointerCapture(J.pointerId)&&le.releasePointerCapture(J.pointerId),L.current=null,M.current=null,ne){const V=J.currentTarget,Z={originalEvent:J,delta:ne};lN(ne,N.swipeDirection,N.swipeThreshold)?ax(rF,b,Z,{discrete:!0}):ax(nF,y,Z,{discrete:!0}),V.addEventListener("click",ue=>ue.preventDefault(),{once:!0})}})})})}),N.viewport)})]}):null}),oF=s=>{const{__scopeToast:t,children:n,...r}=s,a=k0($0,t),[o,c]=p.useState(!1),[u,h]=p.useState(!1);return uF(()=>c(!0)),p.useEffect(()=>{const x=window.setTimeout(()=>h(!0),1e3);return()=>window.clearTimeout(x)},[]),u?null:e.jsx(Xu,{asChild:!0,children:e.jsx(hf,{...r,children:o&&e.jsxs(e.Fragment,{children:[a.label," ",n]})})})},cF="ToastTitle",G8=p.forwardRef((s,t)=>{const{__scopeToast:n,...r}=s;return e.jsx(_t.div,{...r,ref:t})});G8.displayName=cF;var dF="ToastDescription",Z8=p.forwardRef((s,t)=>{const{__scopeToast:n,...r}=s;return e.jsx(_t.div,{...r,ref:t})});Z8.displayName=dF;var Y8="ToastAction",Q8=p.forwardRef((s,t)=>{const{altText:n,...r}=s;return n.trim()?e.jsx(J8,{altText:n,asChild:!0,children:e.jsx(v2,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Y8}\`. Expected non-empty \`string\`.`),null)});Q8.displayName=Y8;var X8="ToastClose",v2=p.forwardRef((s,t)=>{const{__scopeToast:n,...r}=s,a=iF(X8,n);return e.jsx(J8,{asChild:!0,children:e.jsx(_t.button,{type:"button",...r,ref:t,onClick:ut(s.onClick,a.onClose)})})});v2.displayName=X8;var J8=p.forwardRef((s,t)=>{const{__scopeToast:n,altText:r,...a}=s;return e.jsx(_t.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function e7(s){const t=[];return Array.from(s.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),mF(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const c=r.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...e7(r))}}),t}function ax(s,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,o=new CustomEvent(s,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(s,t,{once:!0}),r?x2(a,o):a.dispatchEvent(o)}var lN=(s,t,n=0)=>{const r=Math.abs(s.x),a=Math.abs(s.y),o=r>a;return t==="left"||t==="right"?o&&r>n:!o&&a>n};function uF(s=()=>{}){const t=vr(s);Zn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function mF(s){return s.nodeType===s.ELEMENT_NODE}function hF(s){const t=[],n=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ky(s){const t=document.activeElement;return s.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var fF=q8,t7=B8,s7=H8,n7=G8,r7=Z8,a7=Q8,i7=v2;function l7(s){var t,n,r="";if(typeof s=="string"||typeof s=="number")r+=s;else if(typeof s=="object")if(Array.isArray(s)){var a=s.length;for(t=0;t<a;t++)s[t]&&(n=l7(s[t]))&&(r&&(r+=" "),r+=n)}else for(n in s)s[n]&&(r&&(r+=" "),r+=n);return r}function o7(){for(var s,t,n=0,r="",a=arguments.length;n<a;n++)(s=arguments[n])&&(t=l7(s))&&(r&&(r+=" "),r+=t);return r}const oN=s=>typeof s=="boolean"?`${s}`:s===0?"0":s,cN=o7,ff=(s,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cN(s,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,c=Object.keys(a).map(x=>{const m=n==null?void 0:n[x],g=o==null?void 0:o[x];if(m===null)return null;const y=oN(m)||oN(g);return a[x][y]}),u=n&&Object.entries(n).reduce((x,m)=>{let[g,y]=m;return y===void 0||(x[g]=y),x},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((x,m)=>{let{class:g,className:y,...b}=m;return Object.entries(b).every(w=>{let[N,k]=w;return Array.isArray(k)?k.includes({...o,...u}[N]):{...o,...u}[N]===k}
vendor: 4,742 bytes, lines 49-114
49)?[...x,g,y]:x},[]);return cN(s,c,h,n==null?void 0:n.class,n==null?void 0:n.className)};/** 50 * @license lucide-react v0.453.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const pF=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c7=(...s)=>s.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** 55 * @license lucide-react v0.453.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */var xF={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"};/** 60 * @license lucide-react v0.453.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const gF=p.forwardRef(({color:s="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:c,...u},h)=>p.createElement("svg",{ref:h,...xF,width:t,height:t,stroke:s,strokeWidth:r?Number(n)*24/Number(t):n,className:c7("lucide",a),...u},[...c.map(([x,m])=>p.createElement(x,m)),...Array.isArray(o)?o:[o]]));/** 65 * @license lucide-react v0.453.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const mt=(s,t)=>{const n=p.forwardRef(({className:r,...a},o)=>p.createElement(gF,{ref:o,iconNode:t,className:c7(`lucide-${pF(s)}`,r),...a}));return n.displayName=`${s}`,n};/** 70 * @license lucide-react v0.453.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const yF=mt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 75 * @license lucide-react v0.453.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const Wo=mt("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** 80 * @license lucide-react v0.453.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const Mu=mt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 85 * @license lucide-react v0.453.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const Rl=mt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 90 * @license lucide-react v0.453.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const vF=mt("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 95 * @license lucide-react v0.453.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const Hy=mt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 100 * @license lucide-react v0.453.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const d7=mt("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** 105 * @license lucide-react v0.453.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Pn=mt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 110 * @license lucide-react v0.453.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const jF=mt("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
114],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 115 * @license lucide-react v0.453.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const bF=mt("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 120 * @license lucide-react v0.453.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const an=mt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 125 * @license lucide-react v0.453.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const zx=mt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 130 * @license lucide-react v0.453.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const j2=mt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 135 * @license lucide-react v0.453.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const ac=mt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 140 * @license lucide-react v0.453.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const Bc=mt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 145 * @license lucide-react v0.453.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const pf=mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 150 * @license lucide-react v0.453.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree. 154 */const Qr=mt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 155 * @license lucide-react v0.453.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const As=mt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 160 * @license lucide-react v0.453.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const qx=mt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 165 * @license lucide-react v0.453.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const NF=mt("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** 170 * @license lucide-react v0.453.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const P0=mt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 175 * @license lucide-react v0.453.0 - ISC 176 * 177 * This source code is licensed under the ISC license. 178 * See the LICENSE file in the root directory of this source tree. 179 */const wF=mt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 180 * @license lucide-react v0.453.0 - ISC 181 * 182 * This source code is licensed under the ISC license. 183 * See the LICENSE file in the root directory of this source tree. 184 */const ys=mt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 185 * @license lucide-react v0.453.0 - ISC 186 * 187 * This source code is licensed under the ISC license. 188 * See the LICENSE file in the root directory of this source tree.
189 */const u7=mt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 190 * @license lucide-react v0.453.0 - ISC 191 * 192 * This source code is licensed under the ISC license. 193 * See the LICENSE file in the root directory of this source tree. 194 */const Or=mt("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 195 * @license lucide-react v0.453.0 - ISC 196 * 197 * This source code is licensed under the ISC license. 198 * See the LICENSE file in the root directory of this source tree. 199 */const dN=mt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 200 * @license lucide-react v0.453.0 - ISC 201 * 202 * This source code is licensed under the ISC license. 203 * See the LICENSE file in the root directory of this source tree. 204 */const xr=mt("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 205 * @license lucide-react v0.453.0 - ISC 206 * 207 * This source code is licensed under the ISC license. 208 * See the LICENSE file in the root directory of this source tree. 209 */const Xr=mt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 210 * @license lucide-react v0.453.0 - ISC 211 * 212 * This source code is licensed under the ISC license. 213 * See the LICENSE file in the root directory of this source tree. 214 */const AF=mt("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** 215 * @license lucide-react v0.453.0 - ISC 216 * 217 * This source code is licensed under the ISC license. 218 * See the LICENSE file in the root directory of this source tree. 219 */const Ya=mt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 220 * @license lucide-react v0.453.0 - ISC 221 * 222 * This source code is licensed under the ISC license. 223 * See the LICENSE file in the root directory of this source tree. 224 */const nd=mt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 225 * @license lucide-react v0.453.0 - ISC 226 * 227 * This source code is licensed under the ISC license. 228 * See the LICENSE file in the root directory of this source tree. 229 */const Ea=mt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 230 * @license lucide-react v0.453.0 - ISC 231 * 232 * This source code is licensed under the ISC license. 233 * See the LICENSE file in the root directory of this source tree. 234 */const CF=mt("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 235 * @license lucide-react v0.453.0 - ISC 236 * 237 * This source code is licensed under the ISC license. 238 * See the LICENSE file in the root directory of this source tree. 239 */const Js=mt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 240 * @license lucide-react v0.453.0 - ISC 241 * 242 * This source code is licensed under the ISC license. 243 * See the LICENSE file in the root directory of this source tree. 244 */const Wx=mt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 245 * @license lucide-react v0.453.0 - ISC 246 * 247 * This source code is licensed under the ISC license. 248 * See the LICENSE file in the root directory of this source tree. 249 */const Bx=mt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** 250 * @license lucide-react v0.453.0 - ISC 251 * 252 * This source code is licensed under the ISC license. 253 * See the LICENSE file in the root directory of this source tree. 254 */const uN=mt("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** 255 * @license lucide-react v0.453.0 - ISC 256 * 257 * This source code is licensed under the ISC license. 258 * See the LICENSE file in the root directory of this source tree. 259 */const ar=mt("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 260 * @license lucide-react v0.453.0 - ISC 261 * 262 * This source code is licensed under the ISC license. 263 * See the LICENSE file in the root directory of this source tree. 264 */const m7=mt("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 265 * @license lucide-react v0.453.0 - ISC 266 * 267 * This source code is licensed under the ISC license. 268 * See the LICENSE file in the root directory of this source tree. 269 */const Bo=mt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 270 * @license lucide-react v0.453.0 - ISC 271 * 272 * This source code is licensed under the ISC license. 273 * See the LICENSE file in the root directory of this source tree. 274 */const h7=mt("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** 275 * @license lucide-react v0.453.0 - ISC 276 * 277 * This source code is licensed under the ISC license. 278 * See the LICENSE file in the root directory of this source tree. 279 */const SF=mt("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 280 * @license lucide-react v0.453.0 - ISC 281 * 282 * This source code is licensed under the ISC license. 283 * See the LICENSE file in the root directory of this source tree. 284 */const b2=mt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** 285 * @license lucide-react v0.453.0 - ISC 286 * 287 * This source code is licensed under the ISC license. 288 * See the LICENSE file in the root directory of this source tree. 289 */const f7=mt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** 290 * @license lucide-react v0.453.0 - ISC 291 * 292 * This source code is licensed under the ISC license. 293 * See the LICENSE file in the root directory of this source tree. 294 */const kF=mt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 295 * @license lucide-react v0.453.0 - ISC 296 * 297 * This source code is licensed under the ISC license. 298 * See the LICENSE file in the root directory of this source tree.
299 */const N2=mt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 300 * @license lucide-react v0.453.0 - ISC 301 * 302 * This source code is licensed under the ISC license. 303 * See the LICENSE file in the root directory of this source tree. 304 */const $F=mt("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 305 * @license lucide-react v0.453.0 - ISC 306 * 307 * This source code is licensed under the ISC license. 308 * See the LICENSE file in the root directory of this source tree. 309 */const ir=mt("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 310 * @license lucide-react v0.453.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */const uh=mt("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 315 * @license lucide-react v0.453.0 - ISC 316 * 317 * This source code is licensed under the ISC license. 318 * See the LICENSE file in the root directory of this source tree. 319 */const PF=mt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 320 * @license lucide-react v0.453.0 - ISC 321 * 322 * This source code is licensed under the ISC license. 323 * See the LICENSE file in the root directory of this source tree. 324 */const rd=mt("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 325 * @license lucide-react v0.453.0 - ISC 326 * 327 * This source code is licensed under the ISC license. 328 * See the LICENSE file in the root directory of this source tree. 329 */const Ir=mt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 330 * @license lucide-react v0.453.0 - ISC 331 * 332 * This source code is licensed under the ISC license. 333 * See the LICENSE file in the root directory of this source tree. 334 */const Jv=mt("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 335 * @license lucide-react v0.453.0 - ISC 336 * 337 * This source code is licensed under the ISC license. 338 * See the LICENSE file in the root directory of this source tree. 339 */const Gy=mt("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 340 * @license lucide-react v0.453.0 - ISC 341 * 342 * This source code is licensed under the ISC license. 343 * See the LICENSE file in the root directory of this source tree. 344 */const mN=mt("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 345 * @license lucide-react v0.453.0 - ISC 346 * 347 * This source code is licensed under the ISC license. 348 * See the LICENSE file in the root directory of this source tree. 349 */const EF=mt("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** 350 * @license lucide-react v0.453.0 - ISC 351 * 352 * This source code is licensed under the ISC license. 353 * See the LICENSE file in the root directory of this source tree. 354 */const E0=mt("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 355 * @license lucide-react v0.453.0 - ISC 356 * 357 * This source code is licensed under the ISC license. 358 * See the LICENSE file in the root directory of this source tree. 359 */const TF=mt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 360 * @license lucide-react v0.453.0 - ISC 361 * 362 * This source code is licensed under the ISC license. 363 * See the LICENSE file in the root directory of this source tree. 364 */const fa=mt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 365 * @license lucide-react v0.453.0 - ISC 366 * 367 * This source code is licensed under the ISC license. 368 * See the LICENSE file in the root directory of this source tree. 369 */const _F=mt("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** 370 * @license lucide-react v0.453.0 - ISC 371 * 372 * This source code is licensed under the ISC license. 373 * See the LICENSE file in the root directory of this source tree. 374 */const Ko=mt("RefreshCw",[["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"}]]);/** 375 * @license lucide-react v0.453.0 - ISC 376 * 377 * This source code is licensed under the ISC license. 378 * See the LICENSE file in the root directory of this source tree. 379 */const IF=mt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 380 * @license lucide-react v0.453.0 - ISC 381 * 382 * This source code is licensed under the ISC license. 383 * See the LICENSE file in the root directory of this source tree. 384 */const Cx=mt("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 385 * @license lucide-react v0.453.0 - ISC 386 * 387 * This source code is licensed under the ISC license. 388 * See the LICENSE file in the root directory of this source tree. 389 */const Bl=mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 390 * @license lucide-react v0.453.0 - ISC 391 * 392 * This source code is licensed under the ISC license. 393 * See the LICENSE file in the root directory of this source tree. 394 */const ad=mt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 395 * @license lucide-react v0.453.0 - ISC 396 * 397 * This source code is licensed under the ISC license. 398 * See the LICENSE file in the root directory of this source tree. 399 */const p7=mt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 400 * @license lucide-react v0.453.0 - ISC 401 * 402 * This source code is licensed under the ISC license. 403 * See the LICENSE file in the root directory of this source tree. 404 */const x7=mt("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
404y:"oel41y"}]]);/** 405 * @license lucide-react v0.453.0 - ISC 406 * 407 * This source code is licensed under the ISC license. 408 * See the LICENSE file in the root directory of this source tree. 409 */const mh=mt("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 410 * @license lucide-react v0.453.0 - ISC 411 * 412 * This source code is licensed under the ISC license. 413 * See the LICENSE file in the root directory of this source tree. 414 */const g7=mt("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** 415 * @license lucide-react v0.453.0 - ISC 416 * 417 * This source code is licensed under the ISC license. 418 * See the LICENSE file in the root directory of this source tree. 419 */const Zr=mt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 420 * @license lucide-react v0.453.0 - ISC 421 * 422 * This source code is licensed under the ISC license. 423 * See the LICENSE file in the root directory of this source tree. 424 */const Zy=mt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 425 * @license lucide-react v0.453.0 - ISC 426 * 427 * This source code is licensed under the ISC license. 428 * See the LICENSE file in the root directory of this source tree. 429 */const pa=mt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 430 * @license lucide-react v0.453.0 - ISC 431 * 432 * This source code is licensed under the ISC license. 433 * See the LICENSE file in the root directory of this source tree. 434 */const DF=mt("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 435 * @license lucide-react v0.453.0 - ISC 436 * 437 * This source code is licensed under the ISC license. 438 * See the LICENSE file in the root directory of this source tree. 439 */const xf=mt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 440 * @license lucide-react v0.453.0 - ISC 441 * 442 * This source code is licensed under the ISC license. 443 * See the LICENSE file in the root directory of this source tree. 444 */const rl=mt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 445 * @license lucide-react v0.453.0 - ISC 446 * 447 * This source code is licensed under the ISC license. 448 * See the LICENSE file in the root directory of this source tree. 449 */const OF=mt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/** 450 * @license lucide-react v0.453.0 - ISC 451 * 452 * This source code is licensed under the ISC license. 453 * See the LICENSE file in the root directory of this source tree. 454 */const y7=mt("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/** 455 * @license lucide-react v0.453.0 - ISC 456 * 457 * This source code is licensed under the ISC license. 458 * See the LICENSE file in the root directory of this source tree. 459 */const gr=mt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 460 * @license lucide-react v0.453.0 - ISC 461 * 462 * This source code is licensed under the ISC license. 463 * See the LICENSE file in the root directory of this source tree. 464 */const hN=mt("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 465 * @license lucide-react v0.453.0 - ISC 466 * 467 * This source code is licensed under the ISC license. 468 * See the LICENSE file in the root directory of this source tree. 469 */const ti=mt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 470 * @license lucide-react v0.453.0 - ISC 471 * 472 * This source code is licensed under the ISC license. 473 * See the LICENSE file in the root directory of this source tree. 474 */const Ms=mt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 475 * @license lucide-react v0.453.0 - ISC 476 * 477 * This source code is licensed under the ISC license. 478 * See the LICENSE file in the root directory of this source tree. 479 */const v7=mt("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 480 * @license lucide-react v0.453.0 - ISC 481 * 482 * This source code is licensed under the ISC license. 483 * See the LICENSE file in the root directory of this source tree. 484 */const FF=mt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 485 * @license lucide-react v0.453.0 - ISC 486 * 487 * This source code is licensed under the ISC license. 488 * See the LICENSE file in the root directory of this source tree. 489 */const Gr=mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,296 bytes, lines 489-494
489],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 490 * @license lucide-react v0.453.0 - ISC 491 * 492 * This source code is licensed under the ISC license. 493 * See the LICENSE file in the root directory of this source tree. 494 */const fN=mt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),w2="-",RF=s=>{const t=LF(s),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=s;return{getClassGroupId:c=>{const u=c.split(w2);return u[0]===""&&u.length!==1&&u.shift(),j7(u,t)||MF(c)},getConflictingClassGroupIds:(c,u)=>{const h=n[c]||[];return u&&r[c]?[...h,...r[c]]:h}}},j7=(s,t)=>{var c;if(s.length===0)return t.classGroupId;const n=s[0],r=t.nextPart.get(n),a=r?j7(s.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const o=s.join(w2);return(c=t.validators.find(({validator:u})=>u(o)))==null?void 0:c.classGroupId},pN=/^\[(.+)\]$/,MF=s=>{if(pN.test(s)){const t=pN.exec(s)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},LF=s=>{const{theme:t,prefix:n}=s,r={nextPart:new Map,validators:[]};return UF(Object.entries(s.classGroups),n).forEach(([o,c])=>{e1(c,r,o,t)}),r},e1=(s,t,n,r)=>{s.forEach(a=>{if(typeof a=="string"){const o=a===""?t:xN(t,a);o.classGroupId=n;return}if(typeof a=="function"){if(VF(a)){e1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,c])=>{e1(c,xN(t,o),n,r)})})},xN=(s,t)=>{let n=s;return t.split(w2).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},VF=s=>s.isThemeGetter,UF=(s,t)=>t?s.map(([n,r])=>{const a=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,u])=>[t+c,u])):o);return[n,a]}):s,zF=s=>{if(s<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(o,c)=>{n.set(o,c),t++,t>s&&(t=0,r=n,n=new Map)};return{get(o){let c=n.get(o);if(c!==void 0)return c;if((c=r.get(o))!==void 0)return a(o,c),c},set(o,c){n.has(o)?n.set(o,c):a(o,c)}}},b7="!",qF=s=>{const{separator:t,experimentalParseClassName:n}=s,r=t.length===1,a=t[0],o=t.length,c=u=>{const h=[];let x=0,m=0,g;for(let k=0;k<u.length;k++){let E=u[k];if(x===0){if(E===a&&(r||u.slice(k,k+o)===t)){h.push(u.slice(m,k)),m=k+o;continue}if(E==="/"){g=k;continue}}E==="["?x++:E==="]"&&x--}const y=h.length===0?u:u.substring(m),b=y.startsWith(b7),w=b?y.substring(1):y,N=g&&g>m?g-m:void 0;return{modifiers:h,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:N}};return n?u=>n({className:u,parseClassName:c}):c},WF=s=>{if(s.length<=1)return s;const t=[];let n=[];return s.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},BF=s=>({cache:zF(s.cacheSize),parseClassName:qF(s),...RF(s)}),KF=/\s+/,HF=(s,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=[],c=s.trim().split(KF);let u="";for(let h=c.length-1;h>=0;h-=1){const x=c[h],{modifiers:m,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}=n(x);let w=!!b,N=r(w?y.substring(0,b):y);if(!N){if(!w){u=x+(u.length>0?" "+u:u);continue}if(N=r(y),!N){u=x+(u.length>0?" "+u:u);continue}w=!1}const k=WF(m).join(":"),E=g?k+b7:k,P=E+N;if(o.includes(P))continue;o.push(P);const M=a(N,w);for(let L=0;L<M.length;++L){const B=M[L];o.push(E+B)}u=x+(u.length>0?" "+u:u)}return u};function GF(){let s=0,t,n,r="";for(;s<arguments.length;)(t=arguments[s++])&&(n=N7(t))&&(r&&(r+=" "),r+=n);return r}const N7=s=>{if(typeof s=="string")return s;let t,n="";for(let r=0;r<s.length;r++)s[r]&&(t=N7(s[r]))&&(n&&(n+=" "),n+=t);return n};function ZF(s,...t){let n,r,a,o=c;function c(h){const x=t.reduce((m,g)=>g(m),s());return n=BF(x),r=n.cache.get,a=n.cache.set,o=u,u(h)}function u(h){const x=r(h);if(x)return x;const m=HF(h,n);return a(h,m),m}return function(){return o(GF.apply(null,arguments))}}const vn=s=>{const t=n=>n[s]||[];return t.isThemeGetter=!0,t},w7=/^\[(?:([a-z-]+):)?(.+)\]$/i,YF=/^\d+\/\d+$/,QF=new Set(["px","full","screen"]),XF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_l=s=>fu(s)||QF.has(s)||YF.test(s),Ao=s=>Ju(s,"length",dR),fu=s=>!!s&&!Number.isNaN(Number(s)),Yy=s=>Ju(s,"number",fu),Xm=s=>!!s&&Number.isInteger(Number(s)),nR=s=>s.endsWith("%")&&fu(s.slice(0,-1)),gs=s=>w7.test(s),Co=s=>XF.test(s),rR=new Set(["length","size","percentage"]),aR=s=>Ju(s,rR,A7),iR=s=>Ju(s,"position",A7),lR=new Set(["image","url"]),oR=s=>Ju(s,lR,mR),cR=s=>Ju(s,"",uR),Jm=()=>!0,Ju=(s,t,n)=>{const r=w7.exec(s);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},dR=s=>JF.test(s)&&!eR.test(s),A7=()=>!1,uR=s=>tR.test(s),mR=s=>sR.test(s),hR=()=>{const s=vn("colors"),t=vn("spacing"),n=vn("blur"),r=vn("brightness"),a=vn("borderColor"),o=vn("borderRadius"),c=vn("borderSpacing"),u=vn("borderWidth"),h=vn("contrast"),x=vn("grayscale"),m=vn("hueRotate"),g=vn("invert"),y=vn("gap"),b=vn("gradientColorStops"),w=vn("gradientColorStopPositions"),N=vn("inset"),k=vn("margin"),E=vn("opacity"),P=vn("padding"),M=vn("saturate"),L=vn("scale"),B=vn("sepia"),z=vn("skew"),H=vn("space"),T=vn("translate"),U=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],se=()=>["auto",gs,t],ae=()=>[gs,t],W=()=>["",_l,Ao],J=()=>["auto",fu,gs],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ue=()=>["","0",gs],ge=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[fu,gs];return{cacheSize:500,separator:":",theme:{colors:[Jm],spacing:[_l,Ao],blur:["none","",Co,gs],brightness:G(),borderColor:[s],borderRadius:["n
494one","","full",Co,gs],borderSpacing:ae(),borderWidth:W(),contrast:G(),grayscale:ue(),hueRotate:G(),invert:ue(),gap:ae(),gradientColorStops:[s],gradientColorStopPositions:[nR,Ao],inset:se(),margin:se(),opacity:G(),padding:ae(),saturate:G(),scale:G(),sepia:ue(),skew:G(),space:ae(),translate:ae()},classGroups:{aspect:[{aspect:["auto","square","video",gs]}],container:["container"],columns:[{columns:[Co]}],"break-after":[{"break-after":ge()}],"break-before":[{"break-before":ge()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),gs]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xm,gs]}],basis:[{basis:se()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gs]}],grow:[{grow:ue()}],shrink:[{shrink:ue()}],order:[{order:["first","last","none",Xm,gs]}],"grid-cols":[{"grid-cols":[Jm]}],"col-start-end":[{col:["auto",{span:["full",Xm,gs]},gs]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Jm]}],"row-start-end":[{row:["auto",{span:[Xm,gs]},gs]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gs]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gs]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gs,t]}],"min-w":[{"min-w":[gs,t,"min","max","fit"]}],"max-w":[{"max-w":[gs,t,"none","full","min","max","fit","prose",{screen:[Co]},Co]}],h:[{h:[gs,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gs,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gs,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gs,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Co,Ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yy]}],"font-family":[{font:[Jm]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gs]}],"line-clamp":[{"line-clamp":["none",fu,Yy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_l,gs]}],"list-image":[{"list-image":["none",gs]}],"list-style-type":[{list:["none","disc","decimal",gs]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_l,Ao]}],"underline-offset":[{"underline-offset":["auto",_l,gs]}],"text-decoration-color":[{decoration:[s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ae()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gs]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gs]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),iR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",aR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oR]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[w]}
vendor: 4,542 bytes, line 494
494],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:le()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[_l,gs]}],"outline-w":[{outline:[_l,Ao]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[_l,Ao]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",Co,cR]}],"shadow-color":[{shadow:[Jm]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",Co,gs]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[g]}],saturate:[{saturate:[M]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gs]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",gs]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",gs]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[Xm,gs]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gs]}],accent:[{accent:["auto",s]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gs]}],"caret-color":[{caret:[s]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ae()}],"scroll-mx":[{"scroll-mx":ae()}],"scroll-my":[{"scroll-my":ae()}],"scroll-ms":[{"scroll-ms":ae()}
494],"scroll-me":[{"scroll-me":ae()}],"scroll-mt":[{"scroll-mt":ae()}],"scroll-mr":[{"scroll-mr":ae()}],"scroll-mb":[{"scroll-mb":ae()}],"scroll-ml":[{"scroll-ml":ae()}],"scroll-p":[{"scroll-p":ae()}],"scroll-px":[{"scroll-px":ae()}],"scroll-py":[{"scroll-py":ae()}],"scroll-ps":[{"scroll-ps":ae()}],"scroll-pe":[{"scroll-pe":ae()}],"scroll-pt":[{"scroll-pt":ae()}],"scroll-pr":[{"scroll-pr":ae()}],"scroll-pb":[{"scroll-pb":ae()}],"scroll-pl":[{"scroll-pl":ae()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gs]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[_l,Ao,Yy]}],stroke:[{stroke:[s,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},fR=ZF(hR);function pt(...s){return fR(o7(s))}function t1(s,t){if(!t)return console.warn(`Week ${s}: Dates not available`),`Week ${s}: Dates not available`;const n=new Date(t.startDate).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=new Date(t.endDate).toLocaleDateString("en-US",{month:"short",day:"numeric"});return t.isBreakWeek?`Week ${s}: ${n}-${r} (Break)`:`Week ${s}: ${n}-${r}`}const pR=fF,C7=p.forwardRef(({className:s,...t},n)=>e.jsx(t7,{ref:n,className:pt("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",s),...t}));C7.displayName=t7.displayName;const xR=ff("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),S7=p.forwardRef(({className:s,variant:t,...n},r)=>e.jsx(s7,{ref:r,className:pt(xR({variant:t}),s),...n}));S7.displayName=s7.displayName;const gR=p.forwardRef(({className:s,...t},n)=>e.jsx(a7,{ref:n,className:pt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",s),...t}));gR.displayName=a7.displayName;
vendor: 4,291 bytes, line 494
494const k7=p.forwardRef(({className:s,...t},n)=>e.jsx(i7,{ref:n,className:pt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",s),"toast-close":"",...t,children:e.jsx(Gr,{className:"h-4 w-4"})}));k7.displayName=i7.displayName;const $7=p.forwardRef(({className:s,...t},n)=>e.jsx(n7,{ref:n,className:pt("text-sm font-semibold",s),...t}));$7.displayName=n7.displayName;const P7=p.forwardRef(({className:s,...t},n)=>e.jsx(r7,{ref:n,className:pt("text-sm opacity-90",s),...t}));P7.displayName=r7.displayName;function gN(){const{toasts:s}=Is();return e.jsxs(pR,{children:[s.map(function({id:t,title:n,description:r,action:a,...o}){return e.jsxs(S7,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[n&&e.jsx($7,{children:n}),r&&e.jsx(P7,{children:r})]}),a,e.jsx(k7,{})]},t)}),e.jsx(C7,{})]})}var yR=i8[" useId ".trim().toString()]||(()=>{}),vR=0;function xa(s){const[t,n]=p.useState(yR());return Zn(()=>{n(r=>r??String(vR++))},[s]),t?`radix-${t}`:""}const jR=["top","right","bottom","left"],Xo=Math.min,$a=Math.max,Kx=Math.round,ix=Math.floor,tl=s=>({x:s,y:s}),bR={left:"right",right:"left",bottom:"top",top:"bottom"},NR={start:"end",end:"start"};function s1(s,t,n){return $a(s,Xo(t,n))}function Kl(s,t){return typeof s=="function"?s(t):s}function Hl(s){return s.split("-")[0]}function em(s){return s.split("-")[1]}function A2(s){return s==="x"?"y":"x"}function C2(s){return s==="y"?"height":"width"}function Jo(s){return["top","bottom"].includes(Hl(s))?"y":"x"}function S2(s){return A2(Jo(s))}function wR(s,t,n){n===void 0&&(n=!1);const r=em(s),a=S2(s),o=C2(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Hx(c)),[c,Hx(c)]}function AR(s){const t=Hx(s);return[n1(s),t,n1(t)]}function n1(s){return s.replace(/start|end/g,t=>NR[t])}function CR(s,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],c=["bottom","top"];switch(s){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:c;default:return[]}}function SR(s,t,n,r){const a=em(s);let o=CR(Hl(s),n==="start",r);return a&&(o=o.map(c=>c+"-"+a),t&&(o=o.concat(o.map(n1)))),o}function Hx(s){return s.replace(/left|right|bottom|top/g,t=>bR[t])}function kR(s){return{top:0,right:0,bottom:0,left:0,...s}}function E7(s){return typeof s!="number"?kR(s):{top:s,right:s,bottom:s,left:s}}function Gx(s){const{x:t,y:n,width:r,height:a}=s;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function yN(s,t,n){let{reference:r,floating:a}=s;const o=Jo(t),c=S2(t),u=C2(c),h=Hl(t),x=o==="y",m=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,y=r[u]/2-a[u]/2;let b;switch(h){case"top":b={x:m,y:r.y-a.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(em(t)){case"start":b[c]-=y*(n&&x?-1:1);break;case"end":b[c]+=y*(n&&x?-1:1);break}return b}const $R=async(s,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let x=await c.getElementRects({reference:s,floating:t,strategy:a}),{x:m,y:g}=yN(x,r,h),y=r,b={},w=0;for(let N=0;N<u.length;N++){const{name:k,fn:E}=u[N],{x:P,y:M,data:L,reset:B}=await E({x:m,y:g,initialPlacement:r,placement:y,strategy:a,middlewareData:b,rects:x,platform:c,elements:{reference:s,floating:t}});m=P??m,g=M??g,b={...b,[k]:{...b[k],...L}},B&&w<=50&&(w++,typeof B=="object"&&(B.placement&&(y=B.placement),B.rects&&(x=B.rects===!0?await c.getElementRects({reference:s,floating:t,strategy:a}):B.rects),{x:m,y:g}=yN(x,y,h)),N=-1)}return{x:m,y:g,placement:y,strategy:a,middlewareData:b}};async function kh(s,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:c,elements:u,strategy:h}=s,{boundary:x="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=Kl(t,s),w=E7(b),k=u[y?g==="floating"?"reference":"floating":g],E=Gx(await o.getClippingRect
vendor: 7,314 bytes, line 494
494({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:x,rootBoundary:m,strategy:h})),P=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),L=await(o.isElement==null?void 0:o.isElement(M))?await(o.getScale==null?void 0:o.getScale(M))||{x:1,y:1}:{x:1,y:1},B=Gx(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:M,strategy:h}):P);return{top:(E.top-B.top+w.top)/L.y,bottom:(B.bottom-E.bottom+w.bottom)/L.y,left:(E.left-B.left+w.left)/L.x,right:(B.right-E.right+w.right)/L.x}}const PR=s=>({name:"arrow",options:s,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:c,elements:u,middlewareData:h}=t,{element:x,padding:m=0}=Kl(s,t)||{};if(x==null)return{};const g=E7(m),y={x:n,y:r},b=S2(a),w=C2(b),N=await c.getDimensions(x),k=b==="y",E=k?"top":"left",P=k?"bottom":"right",M=k?"clientHeight":"clientWidth",L=o.reference[w]+o.reference[b]-y[b]-o.floating[w],B=y[b]-o.reference[b],z=await(c.getOffsetParent==null?void 0:c.getOffsetParent(x));let H=z?z[M]:0;(!H||!await(c.isElement==null?void 0:c.isElement(z)))&&(H=u.floating[M]||o.floating[w]);const T=L/2-B/2,U=H/2-N[w]/2-1,_=Xo(g[E],U),se=Xo(g[P],U),ae=_,W=H-N[w]-se,J=H/2-N[w]/2+T,ne=s1(ae,J,W),le=!h.arrow&&em(a)!=null&&J!==ne&&o.reference[w]/2-(J<ae?_:se)-N[w]/2<0,V=le?J<ae?J-ae:J-W:0;return{[b]:y[b]+V,data:{[b]:ne,centerOffset:J-ne-V,...le&&{alignmentOffset:V}},reset:le}}}),ER=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:c,initialPlacement:u,platform:h,elements:x}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:N=!0,...k}=Kl(s,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Hl(a),P=Jo(u),M=Hl(u)===u,L=await(h.isRTL==null?void 0:h.isRTL(x.floating)),B=y||(M||!N?[Hx(u)]:AR(u)),z=w!=="none";!y&&z&&B.push(...SR(u,N,w,L));const H=[u,...B],T=await kh(t,k),U=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&U.push(T[E]),g){const J=wR(a,c,L);U.push(T[J[0]],T[J[1]])}if(_=[..._,{placement:a,overflows:U}],!U.every(J=>J<=0)){var se,ae;const J=(((se=o.flip)==null?void 0:se.index)||0)+1,ne=H[J];if(ne)return{data:{index:J,overflows:_},reset:{placement:ne}};let le=(ae=_.filter(V=>V.overflows[0]<=0).sort((V,Z)=>V.overflows[1]-Z.overflows[1])[0])==null?void 0:ae.placement;if(!le)switch(b){case"bestFit":{var W;const V=(W=_.filter(Z=>{if(z){const ue=Jo(Z.placement);return ue===P||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,ge)=>ue+ge,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:W[0];V&&(le=V);break}case"initialPlacement":le=u;break}if(a!==le)return{reset:{placement:le}}}return{}}}};function vN(s,t){return{top:s.top-t.height,right:s.right-t.width,bottom:s.bottom-t.height,left:s.left-t.width}}function jN(s){return jR.some(t=>s[t]>=0)}const TR=function(s){return s===void 0&&(s={}),{name:"hide",options:s,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Kl(s,t);switch(r){case"referenceHidden":{const o=await kh(t,{...a,elementContext:"reference"}),c=vN(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:jN(c)}}}case"escaped":{const o=await kh(t,{...a,altBoundary:!0}),c=vN(o,n.floating);return{data:{escapedOffsets:c,escaped:jN(c)}}}default:return{}}}}};async function _R(s,t){const{placement:n,platform:r,elements:a}=s,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Hl(n),u=em(n),h=Jo(n)==="y",x=["left","top"].includes(c)?-1:1,m=o&&h?-1:1,g=Kl(t,s);let{mainAxis:y,crossAxis:b,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof w=="number"&&(b=u==="end"?w*-1:w),h?{x:b*m,y:y*x}:{x:y*x,y:b*m}}const IR=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(t){var n,r;const{x:a,y:o,placement:c,middlewareData:u}=t,h=await _R(t,s);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+h.x,y:o+h.y,data:{...h,placement:c}}}}},DR=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:k=>{let{x:E,y:P}=k;return{x:E,y:P}}},...h}=Kl(s,t),x={x:n,y:r},m=await kh(t,h),g=Jo(Hl(a)),y=A2(g);let b=x[y],w=x[g];if(o){const k=y==="y"?"top":"left",E=y==="y"?"bottom":"right",P=b+m[k],M=b-m[E];b=s1(P,b,M)}if(c){const k=g==="y"?"top":"left",E=g==="y"?"bottom":"right",P=w+m[k],M=w-m[E];w=s1(P,w,M)}const N=u.fn({...t,[y]:b,[g]:w});return{...N,data:{x:N.x-n,y:N.y-r,enabled:{[y]:o,[g]:c}}}}}},OR=function(s){return s===void 0&&(s={}),{options:s,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:h=!0,crossAxis:x=!0}=Kl(s,t),m={x:n,y:r},g=Jo(a),y=A2(g);let b=m[y],w=m[g];const N=Kl(u,t),k=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(h){const M=y==="y"?"height":"width",L=o.reference[y]-o.floating[M]+k.mainAxis,B=o.reference[y]+o.reference[M]-k.mainAxis;b<L?b=L:b>B&&(b=B)}if(x){var E,P;const M=y==="y"?"width":"height",L=["top","left"].includes(Hl(a)),B=o.reference[g]-o.floating[M]+(L&&((E=c.offset)==null?void 0:E[g])||0)+(L?0:k.crossAxis),z=o.reference[g]+o.reference[M]+(L?0:((P=c.offset)==null?void 0:P[g])||0)-(L?k.crossAxis:0);w<B?w=B:w>z&&(w=z)}return{[y]:b,[g]:w}}}},FR=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(t){var n,r;const{placement:a,rects:o,platform:c,elements:u}=t,{apply:h=()=>{},...x}=Kl(s,t),m=await kh(t,x),g=Hl(a),y=em(a),b=Jo(a)==="y",{width:w,height:N}=o.floating;let k,E;g==="top"||g==="bottom"?(k=g,E=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(E=g,k=y==="end"?"top":"bottom");const P=N-m.top-m.bottom,M=w-m.left-m.right,L=Xo(N-m[k],P),B=Xo(w-m[E],M),z=!t.middlewareData.shift;let H=L,T=B;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=M),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(H=P),z&&!y){const _=$a(m.left,0),se=$a(m.right,0),ae=$a(m.top,0),W=$a(m.bottom,0);b?T=w-2*(_!==0||se!==0?_+se:$a(m.left,m.right)):H=N-2*(ae!==0||W!==0?ae+W:$a(m.top,m.bottom))}await h({...t,availableWidth:T,availableHeight:H});const U=await c.getDimensions(u.floating);return w!==U.width||N!==U.height?{reset:{rects:!0}}:{}}}};function T0(){return typeof window<"u"}function tm(s){return T7(s)?(s.nodeName||"").toLowerCase():"#document"}function Ta(s){var t;return(s==null||(t=s.ownerDocument)==null?void 0:t.defaultView)||window}function fl(s){var t;return(t=(T7(s)?s.ownerDocument:s.document)||window.document)==null?void 0:t.documentElement}function T7(s){return T0()?s instanceof Node||s instanceof Ta(s).Node:!1}function Ei(s){return T0()?s instanceof Element||s instanceof Ta(s).Element:!1}function al(s){return T0()?s instanceof HTMLElement||s instanceof Ta(s).HTMLElement:!1}function bN(s){return!T0()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof Ta(s).ShadowRoot}function gf(s){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ti(s);
vendor: 8,865 bytes, line 494
494return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function RR(s){return["table","td","th"].includes(tm(s))}function _0(s){return[":popover-open",":modal"].some(t=>{try{return s.matches(t)}catch{return!1}})}function k2(s){const t=$2(),n=Ei(s)?Ti(s):s;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MR(s){let t=ec(s);for(;al(t)&&!Lu(t);){if(k2(t))return t;if(_0(t))return null;t=ec(t)}return null}function $2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Lu(s){return["html","body","#document"].includes(tm(s))}function Ti(s){return Ta(s).getComputedStyle(s)}function I0(s){return Ei(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function ec(s){if(tm(s)==="html")return s;const t=s.assignedSlot||s.parentNode||bN(s)&&s.host||fl(s);return bN(t)?t.host:t}function _7(s){const t=ec(s);return Lu(t)?s.ownerDocument?s.ownerDocument.body:s.body:al(t)&&gf(t)?t:_7(t)}function $h(s,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=_7(s),o=a===((r=s.ownerDocument)==null?void 0:r.body),c=Ta(a);if(o){const u=r1(c);return t.concat(c,c.visualViewport||[],gf(a)?a:[],u&&n?$h(u):[])}return t.concat(a,$h(a,[],n))}function r1(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function I7(s){const t=Ti(s);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=al(s),o=a?s.offsetWidth:n,c=a?s.offsetHeight:r,u=Kx(n)!==o||Kx(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function P2(s){return Ei(s)?s:s.contextElement}function pu(s){const t=P2(s);if(!al(t))return tl(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=I7(t);let c=(o?Kx(n.width):n.width)/r,u=(o?Kx(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const LR=tl(0);function D7(s){const t=Ta(s);return!$2()||!t.visualViewport?LR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function VR(s,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ta(s)?!1:t}function cd(s,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=s.getBoundingClientRect(),o=P2(s);let c=tl(1);t&&(r?Ei(r)&&(c=pu(r)):c=pu(s));const u=VR(o,n,r)?D7(o):tl(0);let h=(a.left+u.x)/c.x,x=(a.top+u.y)/c.y,m=a.width/c.x,g=a.height/c.y;if(o){const y=Ta(o),b=r&&Ei(r)?Ta(r):r;let w=y,N=r1(w);for(;N&&r&&b!==w;){const k=pu(N),E=N.getBoundingClientRect(),P=Ti(N),M=E.left+(N.clientLeft+parseFloat(P.paddingLeft))*k.x,L=E.top+(N.clientTop+parseFloat(P.paddingTop))*k.y;h*=k.x,x*=k.y,m*=k.x,g*=k.y,h+=M,x+=L,w=Ta(N),N=r1(w)}}return Gx({width:m,height:g,x:h,y:x})}function E2(s,t){const n=I0(s).scrollLeft;return t?t.left+n:cd(fl(s)).left+n}function O7(s,t,n){n===void 0&&(n=!1);const r=s.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:E2(s,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function UR(s){let{elements:t,rect:n,offsetParent:r,strategy:a}=s;const o=a==="fixed",c=fl(r),u=t?_0(t.floating):!1;if(r===c||u&&o)return n;let h={scrollLeft:0,scrollTop:0},x=tl(1);const m=tl(0),g=al(r);if((g||!g&&!o)&&((tm(r)!=="body"||gf(c))&&(h=I0(r)),al(r))){const b=cd(r);x=pu(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!o?O7(c,h,!0):tl(0);return{width:n.width*x.x,height:n.height*x.y,x:n.x*x.x-h.scrollLeft*x.x+m.x+y.x,y:n.y*x.y-h.scrollTop*x.y+m.y+y.y}}function zR(s){return Array.from(s.getClientRects())}function qR(s){const t=fl(s),n=I0(s),r=s.ownerDocument.body,a=$a(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=$a(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+E2(s);const u=-n.scrollTop;return Ti(r).direction==="rtl"&&(c+=$a(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:c,y:u}}function WR(s,t){const n=Ta(s),r=fl(s),a=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,h=0;if(a){o=a.width,c=a.height;const x=$2();(!x||x&&t==="fixed")&&(u=a.offsetLeft,h=a.offsetTop)}return{width:o,height:c,x:u,y:h}}function BR(s,t){const n=cd(s,!0,t==="fixed"),r=n.top+s.clientTop,a=n.left+s.clientLeft,o=al(s)?pu(s):tl(1),c=s.clientWidth*o.x,u=s.clientHeight*o.y,h=a*o.x,x=r*o.y;return{width:c,height:u,x:h,y:x}}function NN(s,t,n){let r;if(t==="viewport")r=WR(s,n);else if(t==="document")r=qR(fl(s));else if(Ei(t))r=BR(t,n);else{const a=D7(s);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Gx(r)}function F7(s,t){const n=ec(s);return n===t||!Ei(n)||Lu(n)?!1:Ti(n).position==="fixed"||F7(n,t)}function KR(s,t){const n=t.get(s);if(n)return n;let r=$h(s,[],!1).filter(u=>Ei(u)&&tm(u)!=="body"),a=null;const o=Ti(s).position==="fixed";let c=o?ec(s):s;for(;Ei(c)&&!Lu(c);){const u=Ti(c),h=k2(c);!h&&u.position==="fixed"&&(a=null),(o?!h&&!a:!h&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||gf(c)&&!h&&F7(s,c))?r=r.filter(m=>m!==c):a=u,c=ec(c)}return t.set(s,r),r}function HR(s){let{element:t,boundary:n,rootBoundary:r,strategy:a}=s;const c=[...n==="clippingAncestors"?_0(t)?[]:KR(t,this._c):[].concat(n),r],u=c[0],h=c.reduce((x,m)=>{const g=NN(t,m,a);return x.top=$a(g.top,x.top),x.right=Xo(g.right,x.right),x.bottom=Xo(g.bottom,x.bottom),x.left=$a(g.left,x.left),x},NN(t,u,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function GR(s){const{width:t,height:n}=I7(s);return{width:t,height:n}}function ZR(s,t,n){const r=al(t),a=fl(t),o=n==="fixed",c=cd(s,!0,o,t);let u={scrollLeft:0,scrollTop:0};const h=tl(0);if(r||!r&&!o)if((tm(t)!=="body"||gf(a))&&(u=I0(t)),r){const y=cd(t,!0,o,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else a&&(h.x=E2(a));const x=a&&!r&&!o?O7(a,u):tl(0),m=c.left+u.scrollLeft-h.x-x.x,g=c.top+u.scrollTop-h.y-x.y;return{x:m,y:g,width:c.width,height:c.height}}function Qy(s){return Ti(s).position==="static"}function wN(s,t){if(!al(s)||Ti(s).position==="fixed")return null;if(t)return t(s);let n=s.offsetParent;return fl(s)===n&&(n=n.ownerDocument.body),n}function R7(s,t){const n=Ta(s);if(_0(s))return n;if(!al(s)){let a=ec(s);for(;a&&!Lu(a);){if(Ei(a)&&!Qy(a))return a;a=ec(a)}return n}let r=wN(s,t);for(;r&&RR(r)&&Qy(r);)r=wN(r,t);return r&&Lu(r)&&Qy(r)&&!k2(r)?n:r||MR(s)||n}const YR=async function(s){const t=this.getOffsetParent||R7,n=this.getDimensions,r=await n(s.floating);return{reference:ZR(s.reference,await t(s.floating),s.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QR(s){return Ti(s).direction==="rtl"}const XR={convertOffsetParentRelativeRectToViewportRelativeRect:UR,getDocumentElement:fl,getClippingRect:HR,getOffsetParent:R7,getElementRects:YR,getClientRects:zR,getDimensions:GR,getScale:pu,isElement:Ei,isRTL:QR};function M7(s,t){return s.x===t.x&&s.y===t.y&&s.width===t.width&&s.height===t.height}function JR(s,t){let n=null,r;const a=fl(s);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),o();const x=s.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=x;if(u||t(),!y||!b)return;const w=ix(g),N=ix(a.clientWidth-(m+y)),k=ix(a.clientHeight-(g+b)),E=ix(m),M={rootMargin:-w+"px "+-N+"px "+-k+"px "+-E+"px",threshold:$a(0,Xo(1,h))||1};let L=!0;function B(z){const H=z[0].intersectionRatio;if(H!==h){if(!L)return c();H?c(!1,H):r=setTimeout(()=>{c(!1,1e-7)},1e3)}H===1&&!M7(x,s.getBoundingClientRect())&&c(),L=!1}try{n=new IntersectionObserver(B,{...M,root:a.ownerDocument})}catch{n=new IntersectionObserver(B,M)}n.observe(s)}return c(!0),o}function eM(s,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,x=P2(s),m=a||o?[...x?$h(x):[],...$h(t)]:[];m.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const g=x&&u?JR(x,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(E=>{let[P]=E;P&&P.target===x&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var M;(M=b)==null||M.observe(t)})),n()}),x&&!h&&b.observe(x),b.observe(t));let w,N=h?cd(s):null;h&&k();function k(){const E=cd(s);N&&!M7(N,E)&&n(),N=E,w=requestAnimationFrame(k)}return n(),()=>{var E;m.forEach(P=>{a&&P.removeEventListener("scroll",n),o&&P.removeEventListener("resize",n)}),g==null||g(),(E=b)==null||E.disconnect(),b=null,h&&cancelAnimationFrame(w)}}const tM=IR,sM=DR,nM=ER,rM=FR,aM=TR,AN=PR,iM=OR,lM=(s,t,n)=>{const r=new Map,a={platform:XR,...n},o={...a.platform,_c:r};return $R(s,t,{...a,platform:o})};var Sx=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Zx(s,t){if(s===t)return!0;
vendor: 6,551 bytes, line 494
494if(typeof s!=typeof t)return!1;if(typeof s=="function"&&s.toString()===t.toString())return!0;let n,r,a;if(s&&t&&typeof s=="object"){if(Array.isArray(s)){if(n=s.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Zx(s[r],t[r]))return!1;return!0}if(a=Object.keys(s),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&s.$$typeof)&&!Zx(s[o],t[o]))return!1}return!0}return s!==s&&t!==t}function L7(s){return typeof window>"u"?1:(s.ownerDocument.defaultView||window).devicePixelRatio||1}function CN(s,t){const n=L7(s);return Math.round(t*n)/n}function Xy(s){const t=p.useRef(s);return Sx(()=>{t.current=s}),t}function oM(s){s===void 0&&(s={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:h,open:x}=s,[m,g]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=p.useState(r);Zx(y,r)||b(r);const[w,N]=p.useState(null),[k,E]=p.useState(null),P=p.useCallback(Z=>{Z!==z.current&&(z.current=Z,N(Z))},[]),M=p.useCallback(Z=>{Z!==H.current&&(H.current=Z,E(Z))},[]),L=o||w,B=c||k,z=p.useRef(null),H=p.useRef(null),T=p.useRef(m),U=h!=null,_=Xy(h),se=Xy(a),ae=Xy(x),W=p.useCallback(()=>{if(!z.current||!H.current)return;const Z={placement:t,strategy:n,middleware:y};se.current&&(Z.platform=se.current),lM(z.current,H.current,Z).then(ue=>{const ge={...ue,isPositioned:ae.current!==!1};J.current&&!Zx(T.current,ge)&&(T.current=ge,Qu.flushSync(()=>{g(ge)}))})},[y,t,n,se,ae]);Sx(()=>{x===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,g(Z=>({...Z,isPositioned:!1})))},[x]);const J=p.useRef(!1);Sx(()=>(J.current=!0,()=>{J.current=!1}),[]),Sx(()=>{if(L&&(z.current=L),B&&(H.current=B),L&&B){if(_.current)return _.current(L,B,W);W()}},[L,B,W,_,U]);const ne=p.useMemo(()=>({reference:z,floating:H,setReference:P,setFloating:M}),[P,M]),le=p.useMemo(()=>({reference:L,floating:B}),[L,B]),V=p.useMemo(()=>{const Z={position:n,left:0,top:0};if(!le.floating)return Z;const ue=CN(le.floating,m.x),ge=CN(le.floating,m.y);return u?{...Z,transform:"translate("+ue+"px, "+ge+"px)",...L7(le.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ue,top:ge}},[n,u,le.floating,m.x,m.y]);return p.useMemo(()=>({...m,update:W,refs:ne,elements:le,floatingStyles:V}),[m,W,ne,le,V])}const cM=s=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:s,fn(n){const{element:r,padding:a}=typeof s=="function"?s(n):s;return r&&t(r)?r.current!=null?AN({element:r.current,padding:a}).fn(n):{}:r?AN({element:r,padding:a}).fn(n):{}}}},dM=(s,t)=>({...tM(s),options:[s,t]}),uM=(s,t)=>({...sM(s),options:[s,t]}),mM=(s,t)=>({...iM(s),options:[s,t]}),hM=(s,t)=>({...nM(s),options:[s,t]}),fM=(s,t)=>({...rM(s),options:[s,t]}),pM=(s,t)=>({...aM(s),options:[s,t]}),xM=(s,t)=>({...cM(s),options:[s,t]});var gM="Arrow",V7=p.forwardRef((s,t)=>{const{children:n,width:r=10,height:a=5,...o}=s;return e.jsx(_t.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:s.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});V7.displayName=gM;var yM=V7;function T2(s){const[t,n]=p.useState(void 0);return Zn(()=>{if(s){n({width:s.offsetWidth,height:s.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let c,u;if("borderBoxSize"in o){const h=o.borderBoxSize,x=Array.isArray(h)?h[0]:h;c=x.inlineSize,u=x.blockSize}else c=s.offsetWidth,u=s.offsetHeight;n({width:c,height:u})});return r.observe(s,{box:"border-box"}),()=>r.unobserve(s)}else n(void 0)},[s]),t}var _2="Popper",[U7,ic]=or(_2),[vM,z7]=U7(_2),q7=s=>{const{__scopePopper:t,children:n}=s,[r,a]=p.useState(null);return e.jsx(vM,{scope:t,anchor:r,onAnchorChange:a,children:n})};q7.displayName=_2;var W7="PopperAnchor",B7=p.forwardRef((s,t)=>{const{__scopePopper:n,virtualRef:r,...a}=s,o=z7(W7,n),c=p.useRef(null),u=Cs(t,c);return p.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||c.current)}),r?null:e.jsx(_t.div,{...a,ref:u})});B7.displayName=W7;var I2="PopperContent",[jM,bM]=U7(I2),K7=p.forwardRef((s,t)=>{var re,O,me,Y,Te,Be;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:x=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...N}=s,k=z7(I2,n),[E,P]=p.useState(null),M=Cs(t,ht=>P(ht)),[L,B]=p.useState(null),z=T2(L),H=(z==null?void 0:z.width)??0,T=(z==null?void 0:z.height)??0,U=r+(o!=="center"?"-"+o:""),_=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},se=Array.isArray(x)?x:[x],ae=se.length>0,W={padding:_,boundary:se.filter(wM),altBoundary:ae},{refs:J,floatingStyles:ne,placement:le,isPositioned:V,middlewareData:Z}=oM({strategy:"fixed",placement:U,whileElementsMounted:(...ht)=>eM(...ht,{animationFrame:b==="always"}),elements:{reference:k.anchor},middleware:[dM({mainAxis:a+T,alignmentAxis:c}),h&&uM({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?mM():void 0,...W}),h&&hM({...W}),fM({...W,apply:({elements:ht,rects:Mt,availableWidth:$,availableHeight:K})=>{const{width:xe,height:De}=Mt.reference,X=ht.floating.style;X.setProperty("--radix-popper-available-width",`${$}px`),X.setProperty("--radix-popper-available-height",`${K}px`),X.setProperty("--radix-popper-anchor-width",`${xe}px`),X.setProperty("--radix-popper-anchor-height",`${De}px`)}}),L&&xM({element:L,padding:u}),AM({arrowWidth:H,arrowHeight:T}),y&&pM({strategy:"referenceHidden",...W})]}),[ue,ge]=Z7(le),G=vr(w);Zn(()=>{V&&(G==null||G())},[V,G]);const Ae=(re=Z.arrow)==null?void 0:re.x,Fe=(O=Z.arrow)==null?void 0:O.y,be=((me=Z.arrow)==null?void 0:me.centerOffset)!==0,[Me,R]=p.useState();return Zn(()=>{E&&R(window.getComputedStyle(E).zIndex)},[E]),e.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:V?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(Y=Z.transformOrigin)==null?void 0:Y.x,(Te=Z.transformOrigin)==null?void 0:Te.y].join(" "),...((Be=Z.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:s.dir,children:e.jsx(jM,{scope:n,placedSide:ue,onArrowChange:B,arrowX:Ae,arrowY:Fe,shouldHideArrow:be,children:e.jsx(_t.div,{"data-side":ue,"data-align":ge,...N,ref:M,style:{...N.style,animation:V?void 0:"none"}})})})});K7.displayName=I2;var H7="PopperArrow",NM={top:"bottom",right:"left",bottom:"top",left:"r
494ight"},G7=p.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=bM(H7,r),c=NM[o.placedSide];return e.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:e.jsx(yM,{...a,ref:n,style:{...a.style,display:"block"}})})});G7.displayName=H7;function wM(s){return s!==null}var AM=s=>({name:"transformOrigin",options:s,fn(t){var k,E,P;const{placement:n,rects:r,middlewareData:a}=t,c=((k=a.arrow)==null?void 0:k.centerOffset)!==0,u=c?0:s.arrowWidth,h=c?0:s.arrowHeight,[x,m]=Z7(n),g={start:"0%",center:"50%",end:"100%"}[m],y=(((E=a.arrow)==null?void 0:E.x)??0)+u/2,b=(((P=a.arrow)==null?void 0:P.y)??0)+h/2;let w="",N="";return x==="bottom"?(w=c?g:`${y}px`,N=`${-h}px`):x==="top"?(w=c?g:`${y}px`,N=`${r.floating.height+h}px`):x==="right"?(w=`${-h}px`,N=c?g:`${b}px`):x==="left"&&(w=`${r.floating.width+h}px`,N=c?g:`${b}px`),{data:{x:w,y:N}}}});function Z7(s){const[t,n="center"]=s.split("-");return[t,n]}var D0=q7,yf=B7,O0=K7,F0=G7,[R0]=or("Tooltip",[ic]),M0=ic(),Y7="TooltipProvider",CM=700,a1="tooltip.open",[SM,D2]=R0(Y7),Q7=s=>{const{__scopeTooltip:t,delayDuration:n=CM,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=s,c=p.useRef(!0),u=p.useRef(!1),h=p.useRef(0);return p.useEffect(()=>{const x=h.current;return()=>window.clearTimeout(x)},[]),e.jsx(SM,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:p.useCallback(x=>{u.current=x},[]),disableHoverableContent:a,children:o})};Q7.displayName=Y7;var L0="Tooltip",[kM,V0]=R0(L0),X7=s=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:c,delayDuration:u}=s,h=D2(L0,s.__scopeTooltip),x=M0(t),[m,g]=p.useState(null),y=xa(),b=p.useRef(0),w=c??h.disableHoverableContent,N=u??h.delayDuration,k=p.useRef(!1),[E=!1,P]=ga({prop:r,defaultProp:a,onChange:H=>{H?(h.onOpen(),document.dispatchEvent(new CustomEvent(a1))):h.onClose(),o==null||o(H)}}),M=p.useMemo(()=>E?k.current?"delayed-open":"instant-open":"closed",[E]),L=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k.current=!1,P(!0)},[P]),B=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,P(!1)},[P]),z=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{k.current=!0,P(!0),b.current=0},N)},[N,P]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),e.jsx(D0,{...x,children:e.jsx(kM,{scope:t,contentId:y,open:E,stateAttribute:M,trigger:m,onTriggerChange:g,onTriggerEnter:p.useCallback(()=>{h.isOpenDelayedRef.current?z():L()},[h.isOpenDelayedRef,z,L]),onTriggerLeave:p.useCallback(()=>{w?B():(window.clearTimeout(b.current),b.current=0)},[B,w]),onOpen:L,onClose:B,disableHoverableContent:w,children:n})})};X7.displayName=L0;var i1="TooltipTrigger",J7=p.forwardRef((s,t)=>{const{__scopeTooltip:n,...r}=s,a=V0(i1,n),o=D2(i1,n),c=M0(n),u=p.useRef(null),h=Cs(t,u,a.onTriggerChange),x=p.useRef(!1),m=p.useRef(!1),g=p.useCallback(()=>x.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),e.jsx(yf,{asChild:!0,...c,children:e.jsx(_t.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:h,onPointerMove:ut(s.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:ut(s.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:ut(s.onPointerDown,()=>{a.open&&a.onClose(),x.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ut(s.onFocus,()=>{x.current||a.onOpen()}),onBlur:ut(s.onBlur,a.onClose),onClick:ut(s.onClick,a.onClose)})})});J7.displayName=i1;var $M="TooltipPortal",[kJ,PM]=R0($M,{forceMount:void 0}),Vu="TooltipContent",eC=p.forwardRef((s,t)=>{const n=PM(Vu,s.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=s,c=V0(Vu,s.__scopeTooltip);return e.jsx(ea,{present:r||c.open,children:c.disableHoverableContent?e.jsx(tC,{side:a,...o,ref:t}):e.jsx(EM,{side:a,...o,ref:t})})}),EM=p.forwardRef((s,t)=>{const n=V0(Vu,s.__scopeTooltip),r=D2(Vu,s.__scopeTooltip),a=p.useRef(null),o=Cs(t,a),[c,u]=
vendor: 4,298 bytes, line 494
494p.useState(null),{trigger:h,onClose:x}=n,m=a.current,{onPointerInTransitChange:g}=r,y=p.useCallback(()=>{u(null),g(!1)},[g]),b=p.useCallback((w,N)=>{const k=w.currentTarget,E={x:w.clientX,y:w.clientY},P=OM(E,k.getBoundingClientRect()),M=FM(E,P),L=RM(N.getBoundingClientRect()),B=LM([...M,...L]);u(B),g(!0)},[g]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(h&&m){const w=k=>b(k,m),N=k=>b(k,h);return h.addEventListener("pointerleave",w),m.addEventListener("pointerleave",N),()=>{h.removeEventListener("pointerleave",w),m.removeEventListener("pointerleave",N)}}},[h,m,b,y]),p.useEffect(()=>{if(c){const w=N=>{const k=N.target,E={x:N.clientX,y:N.clientY},P=(h==null?void 0:h.contains(k))||(m==null?void 0:m.contains(k)),M=!MM(E,c);P?y():M&&(y(),x())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,m,c,x,y]),e.jsx(tC,{...s,ref:o})}),[TM,_M]=R0(L0,{isInside:!1}),IM=M8("TooltipContent"),tC=p.forwardRef((s,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:c,...u}=s,h=V0(Vu,n),x=M0(n),{onClose:m}=h;return p.useEffect(()=>(document.addEventListener(a1,m),()=>document.removeEventListener(a1,m)),[m]),p.useEffect(()=>{if(h.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(h.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,m]),e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:e.jsxs(O0,{"data-state":h.stateAttribute,...x,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(IM,{children:r}),e.jsx(TM,{scope:n,isInside:!0,children:e.jsx(YO,{id:h.contentId,role:"tooltip",children:a||r})})]})})});eC.displayName=Vu;var sC="TooltipArrow",DM=p.forwardRef((s,t)=>{const{__scopeTooltip:n,...r}=s,a=M0(n);return _M(sC,n).isInside?null:e.jsx(F0,{...a,...r,ref:t})});DM.displayName=sC;function OM(s,t){const n=Math.abs(t.top-s.y),r=Math.abs(t.bottom-s.y),a=Math.abs(t.right-s.x),o=Math.abs(t.left-s.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FM(s,t,n=5){const r=[];switch(t){case"top":r.push({x:s.x-n,y:s.y+n},{x:s.x+n,y:s.y+n});break;case"bottom":r.push({x:s.x-n,y:s.y-n},{x:s.x+n,y:s.y-n});break;case"left":r.push({x:s.x+n,y:s.y-n},{x:s.x+n,y:s.y+n});break;case"right":r.push({x:s.x-n,y:s.y-n},{x:s.x-n,y:s.y+n});break}return r}function RM(s){const{top:t,right:n,bottom:r,left:a}=s;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function MM(s,t){const{x:n,y:r}=s;let a=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const u=t[o].x,h=t[o].y,x=t[c].x,m=t[c].y;h>r!=m>r&&n<(x-u)*(r-h)/(m-h)+u&&(a=!a)}return a}function LM(s){const t=s.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),VM(t)}function VM(s){if(s.length<=1)return s.slice();const t=[];for(let r=0;r<s.length;r++){const a=s[r];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=s.length-1;r>=0;r--){const a=s[r];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var UM=Q7,zM=X7,qM=J7,nC=eC;const Ml=UM,wi=zM,Ai=qM,Qa=p.forwardRef(({className:s,sideOffset:t=4,...n},r)=>e.jsx(nC,{ref:r,sideOffset:t,className:pt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
494de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",s),...n}));Qa.displayName=nC.displayName;function U0(){const{data:s,isLoading:t,error:n,refetch:r}=nt({queryKey:["/api/auth/user"],retry:1,retryDelay:500,refetchOnWindowFocus:!1,staleTime:3e4,throwOnError:!1,queryFn:async()=>{try{const o=await fetch("/api/auth/user",{credentials:"include"});if(!o.ok)throw new Error("Not authenticated");return o.json()}catch(o){throw o}}});return{user:s||null,isLoading:t,isAuthenticated:!!s&&!n,requiresPasswordChange:(s==null?void 0:s.requiresPasswordChange)??!1,refetch:r}}function WM({children:s}){const[t,n]=p.useState(null),[r,a]=p.useState(!0);return p.useEffect(()=>{(async()=>{try{const c=await fetch("/api/database/verify"),u=await c.json();c.ok?n({isValid:!0,currentDatabase:u.currentDatabase}):n({isValid:!1,currentDatabase:u.currentDatabase||"unknown",error:u.error||"Database verification failed"})}catch{n({isValid:!1,currentDatabase:"connection failed",error:"Cannot verify database connection"})}finally{a(!1)}})()},[]),r?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(dN,{className:"h-12 w-12 animate-pulse mx-auto text-blue-500"}),e.jsx("p",{className:"text-lg font-medium",children:"Verifying FERPA compliance..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking database connection"})]})}):t!=null&&t.isValid?e.jsx(e.Fragment,{children:s}):(fetch("/api/admin/database-alert",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentDatabase:(t==null?void 0:t.currentDatabase)||"unknown",error:(t==null?void 0:t.error)||"Database verification failed",timestamp:new Date().toISOString()})}).catch(o=>console.error("Failed to send admin alert:",o)),e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-950 flex items-center justify-center p-4",children:e.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(dN,{className:"h-16 w-16 mx-auto text-gray-400"}),e.jsx("h1",{className:"text-2xl font-bold text-gray-800 dark:text-gray-200",children:"System Temporarily Unavailable"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"We're experiencing technical difficulties and our system is currently down for maintenance."}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-500",children:"Please try again in a few minutes. If the problem persists, contact support."})]}),e.jsx("div",{className:"pt-4",children:e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Try Again"})})]})}))}const O2=ff("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),F=p.forwardRef(({className:s,variant:t,size:n,asChild:r=!1,...a},o)=>{const c=r?F8:"button";return e.jsx(c,{className:pt(O2({variant:t,size:n,className:s})),ref:o,...a})});F.displayName="Button";var Jy=0;function z0(){p.useEffect(()=>{const s=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",s[0]??SN()),document.body.insertAdjacentElement("beforeend",s[1]??SN()),Jy++,()=>{Jy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jy--}},[])}function SN(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var ev="focusScope.autoFocusOnMount",tv="focusScope.autoFocusOnUnmount",kN={bubbles:!1,cancelable:!0},BM="FocusScope",vf=p.forwardRef((s,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...c}=s,[u,h]=p.useState(null),x=vr(a),m=vr(o),g=p.useRef(null),y=Cs(t,N=>h(N)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let N=function(M){if(b.paused||!u)return;const L=M.target;u.contains(L)?g.current=L:Po(g.current,{select:!0})},k=function(M){if(b.paused||!u)return;const L=M.relatedTarget;L!==null&&(u.contains(L)||Po(g.current,{select:!0}))},E=function(M){if(document.activeElement===document.body)for(const B of M)B.removedNodes.length>0&&Po(u)};document.addEventListener("focusin",N),document.addEventListener("focusout",k);const P=new MutationObserver(E);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",k),P.disconnect()}}},[r,u,b.paused]),p.useEffect(()=>{if(u){PN.add(b);const N=document.activeElement;if(!u.contains(N)){const E=new CustomEvent(ev,kN);u.addEventListener(ev,x),u.dispatchEvent(E),E.defaultPrevented||(KM(QM(rC(u)),{select:!0}),document.activeElement===N&&Po(u))}return()=>{u.removeEventListener(ev,x),setTimeout(()=>{const E=new CustomEvent(tv,kN);u.addEventListener(tv,m),u.dispatchEvent(E),E.defaultPrevented||Po(N??document.body,{select:!0}),u.removeEventListener(tv,m),PN.remove(b)},0)}}},[u,x,m,b]);const w=p.useCallback(N=>{if(!n&&!r||b.paused)return;const k=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,E=document.activeElement;if(k&&E){const P=N.currentTarget,[M,L]=HM(P);M&&L?!N.shiftKey&&E===L?(N.preventDefault(),n&&Po(M,{select:!0})):N.shiftKey&&E===M&&(N.preventDefault(),n&&Po(L,{select:!0})):E===P&&N.preventDefault()}},[n,r,b.paused]);return e.jsx(_t.div,{tabIndex:-1,...c,ref:y,onKeyDown:w})});
vendor: 18,974 bytes, lines 494-534
494vf.displayName=BM;function KM(s,{select:t=!1}={}){const n=document.activeElement;for(const r of s)if(Po(r,{select:t}),document.activeElement!==n)return}function HM(s){const t=rC(s),n=$N(t,s),r=$N(t.reverse(),s);return[n,r]}function rC(s){const t=[],n=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $N(s,t){for(const n of s)if(!GM(n,{upTo:t}))return n}function GM(s,{upTo:t}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(t!==void 0&&s===t)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function ZM(s){return s instanceof HTMLInputElement&&"select"in s}function Po(s,{select:t=!1}={}){if(s&&s.focus){const n=document.activeElement;s.focus({preventScroll:!0}),s!==n&&ZM(s)&&t&&s.select()}}var PN=YM();function YM(){let s=[];return{add(t){const n=s[0];t!==n&&(n==null||n.pause()),s=EN(s,t),s.unshift(t)},remove(t){var n;s=EN(s,t),(n=s[0])==null||n.resume()}}}function EN(s,t){const n=[...s],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function QM(s){return s.filter(t=>t.tagName!=="A")}var XM=function(s){if(typeof document>"u")return null;var t=Array.isArray(s)?s[0]:s;return t.ownerDocument.body},eu=new WeakMap,lx=new WeakMap,ox={},sv=0,aC=function(s){return s&&(s.host||aC(s.parentNode))},JM=function(s,t){return t.map(function(n){if(s.contains(n))return n;var r=aC(n);return r&&s.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",s,". Doing nothing"),null)}).filter(function(n){return!!n})},eL=function(s,t,n,r){var a=JM(t,Array.isArray(s)?s:[s]);ox[n]||(ox[n]=new WeakMap);var o=ox[n],c=[],u=new Set,h=new Set(a),x=function(g){!g||u.has(g)||(u.add(g),x(g.parentNode))};a.forEach(x);var m=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))m(y);else try{var b=y.getAttribute(r),w=b!==null&&b!=="false",N=(eu.get(y)||0)+1,k=(o.get(y)||0)+1;eu.set(y,N),o.set(y,k),c.push(y),N===1&&w&&lx.set(y,!0),k===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",y,E)}})};return m(t),u.clear(),sv++,function(){c.forEach(function(g){var y=eu.get(g)-1,b=o.get(g)-1;eu.set(g,y),o.set(g,b),y||(lx.has(g)||g.removeAttribute(r),lx.delete(g)),b||g.removeAttribute(n)}),sv--,sv||(eu=new WeakMap,eu=new WeakMap,lx=new WeakMap,ox={})}},q0=function(s,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(s)?s:[s]),a=XM(s);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),eL(r,a,n,"aria-hidden")):function(){return null}},Ji=function(){return Ji=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ji.apply(this,arguments)};function iC(s,t){var n={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&t.indexOf(r)<0&&(n[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(s);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(s,r[a])&&(n[r[a]]=s[r[a]]);return n}function tL(s,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return s.concat(o||Array.prototype.slice.call(t))}var kx="right-scroll-bar-position",$x="width-before-scroll-bar",sL="with-scroll-bars-hidden",nL="--removed-body-scroll-bar-size";function nv(s,t){return typeof s=="function"?s(t):s&&(s.current=t),s}function rL(s,t){var n=p.useState(function(){return{value:s,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var aL=typeof window<"u"?p.useLayoutEffect:p.useEffect,TN=new WeakMap;function iL(s,t){var n=rL(null,function(r){return s.forEach(function(a){return nv(a,r)})});return aL(function(){var r=TN.get(n);if(r){var a=new Set(r),o=new Set(s),c=n.current;a.forEach(function(u){o.has(u)||nv(u,null)}),o.forEach(function(u){a.has(u)||nv(u,c)})}TN.set(n,s)},[s]),n}function lL(s){return s}function oL(s,t){t===void 0&&(t=lL);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:s},useMedium:function(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var h=function(){var m=c;c=[],m.forEach(o)},x=function(){return Promise.resolve().then(h)};x(),n={push:function(m){c.push(m),x()},filter:function(m){return c=c.filter(m),n}}}};return a}function cL(s){s===void 0&&(s={});var t=oL(null);return t.options=Ji({async:!0,ssr:!1},s),t}var lC=function(s){var t=s.sideCar,n=iC(s,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Ji({},n))};lC.isSideCarExport=!0;function dL(s,t){return s.useMedium(t),lC}var oC=cL(),rv=function(){},W0=p.forwardRef(function(s,t){var n=p.useRef(null),r=p.useState({onScrollCapture:rv,onWheelCapture:rv,onTouchMoveCapture:rv}),a=r[0],o=r[1],c=s.forwardProps,u=s.children,h=s.className,x=s.removeScrollBar,m=s.enabled,g=s.shards,y=s.sideCar,b=s.noIsolation,w=s.inert,N=s.allowPinchZoom,k=s.as,E=k===void 0?"div":k,P=s.gapMode,M=iC(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=y,B=iL([n,t]),z=Ji(Ji({},M),a);return p.createElement(p.Fragment,null,m&&p.createElement(L,{sideCar:oC,removeScrollBar:x,shards:g,noIsolation:b,inert:w,setCallbacks:o,allowPinchZoom:!!N,lockRef:n,gapMode:P}),c?p.cloneElement(p.Children.only(u),Ji(Ji({},z),{ref:B})):p.createElement(E,Ji({},z,{className:h,ref:B}),u))});W0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};W0.classNames={fullWidth:$x,zeroRight:kx};var uL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mL(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var t=uL();return t&&s.setAttribute("nonce",t),s}function hL(s,t){s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}function fL(s){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(s)}var pL=function(){var s=0,t=null;return{add:function(n){s==0&&(t=mL())&&(hL(t,n),fL(t)),s++},remove:function(){s--,!s&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xL=function(){var s=pL();return function(t,n){p.useEffect(function(){return s.add(t),function(){s.remove()}},[t&&n])}},cC=function(){var s=xL(),t=function(n){var r=n.styles,a=n.dynamic;return s(r,a),null};return t},gL={left:0,top:0,right:0,gap:0},av=function(s){return parseInt(s||"",10)||0},yL=function(s){var t=window.getComputedStyle(document.body),n=t[s==="padding"?"paddingLeft":"marginLeft"],r=t[s==="padding"?"paddingTop":"marginTop"],a=t[s==="padding"?"paddingRight":"marginRight"];return[av(n),av(r),av(a)]},vL=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return gL;var t=yL(s),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jL=cC(),xu="data-scroll-locked",bL=function(s,t,n,r){var a=s.left,o=s.top,c=s.right,u=s.gap;return n===void 0&&(n="margin"),` 495 .`.concat(sL,` { 496 overflow: hidden `).concat(r,`; 497 padding-right: `).concat(u,"px ").concat(r,`; 498 } 499 body[`).concat(xu,`] { 500 overflow: hidden `).concat(r,`; 501 overscroll-behavior: contain; 502 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 503 padding-left: `.concat(a,`px; 504 padding-top: `).concat(o,`px; 505 padding-right: `).concat(c,`px; 506 margin-left:0; 507 margin-top:0; 508 margin-right: `).concat(u,"px ").concat(r,`; 509 `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` 510 } 511 512 .`).concat(kx,` { 513 right: `).concat(u,"px ").concat(r,`; 514 } 515 516 .`).concat($x,` { 517 margin-right: `).concat(u,"px ").concat(r,`; 518 } 519 520 .`).concat(kx," .").concat(kx,` { 521 right: 0 `).concat(r,`; 522 } 523 524 .`).concat($x," .").concat($x,` { 525 margin-right: 0 `).concat(r,`; 526 } 527 528 body[`).concat(xu,`] { 529 `).concat(nL,": ").concat(u,`px; 530 } 531`)},_N=function(){var s=parseInt(document.body.getAttribute(xu)||"0",10);return isFinite(s)?s:0},NL=function(){p.useEffect(function(){return document.body.setAttribute(xu,(_N()+1).toString()),function(){var s=_N()-1;s<=0?document.body.removeAttribute(xu):document.body.setAttribute(xu,s.toString())}},[])},wL=function(s){var t=s.noRelative,n=s.noImportant,r=s.gapMode,a=r===void 0?"margin":r;NL();var o=p.useMemo(function(){return vL(a)},[a]);return p.createElement(jL,{styles:bL(o,!t,a,n?"":"!important")})},l1=!1;if(typeof window<"u")try{var cx=Object.defineProperty({},"passive",{get:function(){return l1=!0,!0}});window.addEventListener("test",cx,cx),window.removeEventListener("test",cx,cx)}catch{l1=!1}var tu=l1?{passive:!1}:!1,AL=function(s){return s.tagName==="TEXTAREA"},dC=function(s,t){if(!(s instanceof Element))return!1;var n=window.getComputedStyle(s);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!AL(s)&&n[t]==="visible")},CL=function(s){return dC(s,"overflowY")},SL=function(s){return dC(s,"overflowX")},IN=function(s,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=uC(s,r);if(a){var o=mC(s,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kL=function(s){var t=s.scrollTop,n=s.scrollHeight,r=s.clientHeight;return[t,n,r]},$L=function(s){var t=s.scrollLeft,n=s.scrollWidth,r=s.clientWidth;return[t,n,r]},uC=function(s,t){return s==="v"?CL(t):SL(t)},mC=function(s,t){return s==="v"?kL(t):$L(t)},PL=function(s,t){return s==="h"&&t==="rtl"?-1:1},EL=function(s,t,n,r,a){var o=PL(s,window.getComputedStyle(t).direction),c=o*r,u=n.target,h=t.contains(u),x=!1,m=c>0,g=0,y=0;do{var b=mC(s,u),w=b[0],N=b[1],k=b[2],E=N-k-o*w;(w||E)&&uC(s,u)&&(g+=E,y+=w),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(x=!0),x},dx=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},DN=function(s){return[s.deltaX,s.deltaY]},ON=function(s){return s&&"current"in s?s.current:s},TL=function(s,t){return s[0]===t[0]&&s[1]===t[1]},_L=function(s){return` 532 .block-interactivity-`.concat(s,` {pointer-events: none;} 533 .allow-interactivity-`).concat(s,` {pointer-events: all;} 534`)},IL=0,su=[];function DL(s){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),a=p.useState(IL++)[0],o=p.useState(cC)[0],c=p.useRef(s);p.useEffect(function(){c.current=s},[s]),p.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(a));var N=tL([s.lockRef.current],(s.shards||[]).map(ON),!0).filter(Boolean);return N.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),N.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[s.inert,s.lockRef.current,s.shards]);var u=p.useCallback(function(N,k){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!c.current.allowPinchZoom;var E=dx(N),P=n.current,M="deltaX"in N?N.deltaX:P[0]-E[0],L="deltaY"in N?N.deltaY:P[1]-E[1],B,z=N.target,H=Math.abs(M)>Math.abs(L)?"h":"v";if("touches"in N&&H==="h"&&z.type==="range")return!1;var T=IN(H,z);if(!T)return!0;if(T?B=H:(B=H==="v"?"h":"v",T=IN(H,z)),!T)return!1;if(!r.current&&"changedTouches"in N&&(M||L)&&(r.current=B),!B)return!0;var U=r.current||B;return EL(U,k,N,U==="h"?M:L)},[]),h=p.useCallback(function(N){var k=N;if(!(!su.length||su[su.length-1]!==o)){var E="deltaY"in k?DN(k):dx(k),P=t.current.filter(function(B){return B.name===k.type&&(B.target===k.target||k.target===B.shadowParent)&&TL(B.delta,E)})[0];if(P&&P.should){k.cancelable&&k.preventDefault();return}if(!P){var M=(c.current.shards||[]).map(ON).filter(Boolean).filter(function(B){return B.contains(k.target)}),L=M.length>0?u(k,M[0]):!c.current.noIsolation;L&&k.cancelable&&k.preventDefault()}}},[]),x=p.useCallback(function(N,k,E,P){var M={name:N,delta:k,target:E,should:P,shadowParent:OL(E)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(L){return L!==M})},1)},[]),m=p.useCallback(function(N){n.current=dx(N),r.current=void 0},[]),g=p.useCallback(function(N){x(N.type,DN(N),N.target,u(N,s.lockRef.current))},[]),y=p.useCallback(function(N){x(N.type,dx(N),N.target,u(N,s.lockRef.current))},[]);p.useEffect(function(){return su.push(o),s.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",h,tu),document.addEventListener("touchmove",h,tu),document.addEventListener("touchstart",m,tu),function(){su=su.filter(function(N){return N!==o}),document.removeEventListener("wheel",h,tu),document.removeEventListener("touchmove",h,tu),document.removeEventListener("touchstart",m,tu)}},[]);var b=s.removeScrollBar,w=s.inert;return p.createElement(p.Fragment,null,w?p.createElement(o,{styles:_L(a)}):null,b?p.createElement(wL,{gapMode:s.gapMode}):null)}function OL(s){for(var t=null;s!==null;)s instanceof ShadowRoot&&(t=s.host,s=s.host),s=s.parentNode;return t}const FL=dL(oC,DL);var jf=p.forwardRef(function(s,t){return p.createElement(W0,Ji({},s,{ref:t,sideCar:FL}))});jf.classNames=W0.classNames;var F2="Popover",[hC]=or(F2,[ic]),bf=ic(),[RL,lc]=hC(F2),fC=s=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:c=!1}=s,u=bf(t),h=p.useRef(null),[x,m]=p.useState(!1),[g=!1,y]=ga({prop:r,defaultProp:a,onChange:o});return e.jsx(D0,{...u,children:e.jsx(RL,{scope:t,contentId:xa(),triggerRef:h,open:g,onOpenChange:y,onOpenToggle:p.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:x,onCustomAnchorAdd:p.useCallback(()=>m(!0),[]),onCustomAnchorRemove:p.useCallback(()=>m(!1),[]),modal:c,children:n})})};fC.displayName=F2;var pC="PopoverAnchor",ML=p.forwardRef((s,t)=>{const{__scopePopover:n,...r}=s,a=lc(pC,n),o=bf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=a;return p.useEffect(()=>(c(),()=>u()),[c,u]),e.jsx(yf,{...o,...r,ref:t})});ML.displayName=pC;var xC="PopoverTrigger",gC=p.forwardRef((s,t)=>{const{__scopePopover:n,...r}=s,a=lc(xC,n),o=bf(n),c=Cs(t,a.triggerRef),u=e.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":NC(a.open),...r,ref:c,onClick:ut(s.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:e.jsx(yf,{asChild:!0,...o,children:u})});gC.displayName=xC;var R2="PopoverPortal",[LL,VL]=hC(R2,{forceMount:void 0}),yC=s=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=s,o=lc(R2,t);return e.jsx(LL,{scope:t,forceMount:n,children:e.jsx(ea,{present:n||o.open,children:e.jsx(Xu,{asChild:!0,container:a,children:r})})})};yC.displayName=R2;var Uu="PopoverContent",vC=p.forwardRef((s,t)=>{const n=VL(Uu,s.__scopePopover),{forceMount:r=n.forceMount,...a}=s,o=lc(Uu,s.__scopePopover);return e.jsx(ea,{present:r||o.open,children:o.modal?e.jsx(zL,{...a,ref:t}):e.jsx(qL,{...a,ref:t})})});vC.displayName=Uu;var UL=Qo("PopoverContent.RemoveScroll"),zL=p.forwardRef((s,t)=>{const n=lc(Uu,s.__scopePopover),r=p.useRef(null),a=Cs(t,r),o=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return q0(c)},[]),e.jsx(jf,{as:UL,allowPinchZoom:!0,children:e.jsx(jC,{...s,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(s.onCloseAutoFocus,c=>{var u;c.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ut(s.onPointerDownOutside,c=>{const u=c.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,x=u.button===2||h;o.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:ut(s.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),qL=p.forwardRef((s,t)=>{const n=lc(Uu,s.__scopePopover),r=p.useRef(!1),a=p.useRef(!1);return e.jsx(jC,{...s,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=s.onCloseAutoFocus)==null||c.call(s,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{var h,x;(h=s.onInteractOutside)==null||h.call(s,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=o.target;((x=n.triggerRef.current)==null?void 0:x.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),jC=p.forwardRef((s,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:x,onInteractOutside:m,...g}=s,y=lc(Uu,n),b=bf(n);return z0(),e.jsx(vf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:x,onDismiss:()=>y.onOpenChange(!1),children:e.jsx(O0,{"data-state":NC(y.open),role:"dialog",id:y.contentId,...b,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),bC="PopoverClose",WL=p.forwardRef((s,t)=>{const{__scopePopover:n,...r}=s,a=lc(bC,n);return e.jsx(_t.button,{type:"button",...r,ref:t,onClick:ut(s.onClick,()=>a.onOpenChange(!1))})});WL.displayName=bC;var BL="PopoverArrow",KL=p.forwardRef((s,t)=>{const{__scopePopover:n,...r}=s,a=bf(n);return e.jsx(F0,{...a,...r,ref:t})});KL.displayName=BL;function NC(s){return s?"open":"closed"}var HL=fC,GL=gC,ZL=yC,wC=vC;const YL=HL,QL=GL,AC=p.forwardRef(({className:s,align:t="center",sideOffset:n=4,...r},a)=>e.jsx(ZL,{children:e.jsx(wC,{ref:a,align:t,sideOffset:n,className:pt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
534de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})}));AC.displayName=wC.displayName;function XL(){var x,m,g,y,b,w,N,k,E,P;const[s,t]=p.useState(!1);p.useEffect(()=>{s||document.querySelectorAll("[data-radix-tooltip-content]").forEach(L=>{L instanceof HTMLElement&&(L.style.display="none")})},[s]);const[,n]=hl(),{data:r}=nt({queryKey:["/api/notifications/count"],refetchInterval:3e4}),{data:a}=nt({queryKey:["/api/notifications/detailed"],refetchInterval:3e4}),o=(r==null?void 0:r.total)||0,c=M=>{n(M)},u=()=>{if(a&&a.length>0){const M=a[0];n(M.targetUrl)}},h=M=>{if(!a||a.length===0)return null;const L=a.find(H=>{switch(M){case"enrollment":return H.type==="enrollment";case"student":return H.type==="student";case"payment":return H.type==="payment";case"pending_payment":return H.type==="pending_payment";case"incomplete_review":return H.type==="incomplete_review";default:return!1}});if(!L)return null;const B=L.familyName,z=L.details.replace(" for undefined","").replace("undefined","class enrollment");return{name:B,details:z}};return e.jsx("div",{className:"relative",children:o===1?e.jsxs(F,{variant:"ghost",size:"sm",className:"relative text-aac-text hover:text-aac-text hover:bg-white/20",onClick:u,children:[e.jsx(Hy,{className:"w-4 h-4"}),e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center font-bold",children:"1"})]}):e.jsxs(YL,{open:s,onOpenChange:t,children:[e.jsx(QL,{asChild:!0,children:e.jsxs(F,{variant:"ghost",size:"sm",className:"relative text-aac-text hover:text-aac-text hover:bg-white/20",children:[e.jsx(Hy,{className:"w-4 h-4"}),o>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center font-bold",children:o>99?"99+":o})]})}),e.jsxs(AC,{className:"w-80 p-0",align:"end",children:[e.jsxs("div",{className:"p-4 border-b bg-gradient-to-r from-[#adcfff] to-[#bfddff]",children:[e.jsx("h3",{className:"font-semibold text-[#4A4A4A]",children:"Recent Activity"}),e.jsx("p",{className:"text-sm text-[#4A4A4A]/70",children:"New items requiring attention"})]}),e.jsx("div",{className:"p-4 space-y-3",children:r?e.jsxs(Ml,{delayDuration:300,children:[r.newEnrollments>0&&e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"w-full justify-between py-3 px-3 bg-blue-50 hover:bg-blue-100 rounded-lg h-auto",onClick:()=>c("/admin/enrollment"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm text-[#4A4A4A]",children:"New Class Enrollments"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-blue-600",children:r.newEnrollments}),e.jsx(Bc,{className:"w-3 h-3 text-blue-400"})]})]})}),h("enrollment")&&e.jsx(Qa,{side:"top",className:"bg-white border border-gray-200 shadow-lg rounded-lg p-3 max-w-[250px] z-[9999] animate-in fade-in-0 duration-200",sideOffset:8,"aria-label":"Enrollment notification details",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:(x=h("enrollment"))==null?void 0:x.name}),e.jsx("div",{className:"text-gray-600 mt-1",children:(m=h("enrollment"))==null?void 0:m.details})]})})]}),r.newStudents>0&&e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"w-full justify-between py-3 px-3 bg-green-50 hover:bg-green-100 rounded-lg h-auto",onClick:()=>c("/admin/students"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(hN,{className:"w-4 h-4 text-green-600"}),e.jsx("span",{className:"text-sm text-[#4A4A4A]",children:"New Student Registrations"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-green-600",children:r.newStudents}),e.jsx(Bc,{className:"w-3 h-3 text-green-400"})]})]})}),h("student")&&e.jsx(Qa,{side:"top",className:"bg-white border border-gray-200 shadow-lg rounded-lg p-3 max-w-[250px] z-[9999] animate-in fade-in-0 duration-200",sideOffset:8,"aria-label":"Student registration notification details",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:(g=h("student"))==null?void 0:g.name}
534),e.jsx("div",{className:"text-gray-600 mt-1",children:(y=h("student"))==null?void 0:y.details})]})})]}),r.newPayments>0&&e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"w-full justify-between py-3 px-3 bg-emerald-50 hover:bg-emerald-100 rounded-lg h-auto",onClick:()=>c("/admin/billing-dashboard"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Or,{className:"w-4 h-4 text-emerald-600"}),e.jsx("span",{className:"text-sm text-[#4A4A4A]",children:"New Payments Received"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-emerald-600",children:r.newPayments}),e.jsx(Bc,{className:"w-3 h-3 text-emerald-400"})]})]})}),h("payment")&&e.jsx(Qa,{side:"top",className:"bg-white border border-gray-200 shadow-lg rounded-lg p-3 max-w-[250px] z-[9999] animate-in fade-in-0 duration-200",sideOffset:8,"aria-label":"Payment notification details",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:(b=h("payment"))==null?void 0:b.name}),e.jsx("div",{className:"text-gray-600 mt-1",children:(w=h("payment"))==null?void 0:w.details})]})})]}),r.pendingPayments>0&&e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"w-full justify-between py-3 px-3 bg-orange-50 hover:bg-orange-100 rounded-lg h-auto",onClick:()=>c("/admin/billing-dashboard"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xr,{className:"w-4 h-4 text-orange-600"}),e.jsx("span",{className:"text-sm text-[#4A4A4A]",children:"Payment Reminders Due"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-orange-600",children:r.pendingPayments}),e.jsx(Bc,{className:"w-3 h-3 text-orange-400"})]})]})}),h("pending_payment")&&e.jsx(Qa,{side:"top",className:"bg-white border border-gray-200 shadow-lg rounded-lg p-3 max-w-[250px] z-[9999] animate-in fade-in-0 duration-200",sideOffset:8,"aria-label":"Payment reminder notification details",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:(N=h("pending_payment"))==null?void 0:N.name}),e.jsx("div",{className:"text-gray-600 mt-1",children:(k=h("pending_payment"))==null?void 0:k.details})]})})]}),r.incompleteRegistrations>0&&e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"w-full justify-between py-3 px-3 bg-red-50 hover:bg-red-100 rounded-lg h-auto",onClick:()=>c("/admin/incomplete-registrations"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(hN,{className:"w-4 h-4 text-red-600"}),e.jsx("span",{className:"text-sm text-[#4A4A4A]",children:"Incomplete Registrations"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-red-600",children:r.incompleteRegistrations}),e.jsx(Bc,{className:"w-3 h-3 text-red-400"})]})]})}),h("incomplete_review")&&e.jsx(Qa,{side:"top",className:"bg-white border border-gray-200 shadow-lg rounded-lg p-3 max-w-[250px] z-[9999] animate-in fade-in-0 duration-200",sideOffset:8,"aria-label":"Incomplete registration notification details",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:(E=h("incomplete_review"))==null?void 0:E.name}),e.jsx("div",{className:"text-gray-600 mt-1",children:(P=h("incomplete_review"))==null?void 0:P.details})]})})]}),o===0&&e.jsxs("div",{className:"text-center py-4",children:[e.jsx(Hy,{className:"w-8 h-8 mx-auto text-gray-300 mb-2"}),e.jsx("p",{className:"text-sm text-[#4A4A4A]/60",children:"No new activity"})]})]}):e.jsx("div",{className:"text-center py-4",children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mx-auto mb-2"}),e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2 mx-auto"})]})})}),o>0&&e.jsx("div",{className:"p-3 border-t bg-gray-50",children:e.jsx(F,{variant:"ghost",size:"sm",className:"w-full text-[#77dbf6] hover:bg-[#77dbf6]/10",onClick:()=>
534c("/admin/dashboard"),children:"View Full Dashboard"})})]})]})})}function Gt(){var g;const[s]=hl(),[t,n]=p.useState(!1),{user:r}=U0(),{data:a}=nt({queryKey:["/api/portal/family"],enabled:(r==null?void 0:r.role)==="family"}),o=()=>{localStorage.removeItem("aac-auth-user"),localStorage.removeItem("aac-auth-timestamp"),window.location.href="/api/auth/logout"},c=[{path:"/admin",label:"Dashboard",icon:uN},{path:"/admin/enrollment",label:"Enrollment",icon:Ms},{path:"/admin/payment-enrollment",label:"Payment Enrollment",icon:xr},{path:"/admin/billing-dashboard",label:"Billing Dashboard",icon:xf},{path:"/admin/incomplete-registrations",label:"Incomplete Registrations",icon:rl},{path:"/admin/communications",label:"Communications",icon:Ir},{path:"/admin/resources",label:"Resources",icon:Bx},{path:"/admin/weekly-passwords",label:"Weekly Passwords",icon:SF},{path:"/admin/family-portal",label:"Family Portal",icon:m7}],h=(((g=a==null?void 0:a.students)==null?void 0:g.length)||0)===1?"Student":"Students",x=[{path:"/portal?tab=overview",label:"Dashboard",icon:uN},{path:"/portal?tab=students",label:h,icon:Ms},{path:"/portal?tab=classes",label:"Classes",icon:Pn},{path:"/portal?tab=payments",label:"Payments",icon:Or},{path:"/portal?tab=family",label:"Caregiver Info",icon:ti},{path:"/portal?tab=program-info",label:"Program Information",icon:Bx}],m=(r==null?void 0:r.role)==="admin"||(r==null?void 0:r.role)==="both"?c:x;return e.jsx("nav",{className:"shadow-lg sticky top-0 z-50 w-full border-b-4",style:{backgroundColor:"#77dbf6",borderBottomColor:"#feea6a"},children:e.jsxs("div",{className:"w-full px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("div",{className:"flex items-center flex-shrink-0",children:e.jsx(Wl,{href:(r==null?void 0:r.role)==="admin"||(r==null?void 0:r.role)==="both"?"/admin":"/portal",children:e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices Logo",className:"h-10 w-auto object-contain cursor-pointer hover:opacity-80 transition-opacity duration-200"})})}),e.jsxs("div",{className:"flex items-center space-x-4 flex-shrink-0",children:[((r==null?void 0:r.role)==="admin"||(r==null?void 0:r.role)==="both")&&e.jsx(XL,{}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center",style:{backgroundColor:"#fff45d"},children:e.jsx("span",{className:"text-xs font-bold text-gray-800",children:r!=null&&r.firstName&&(r!=null&&r.lastName)?`${r.firstName[0]}${r.lastName[0]}`.toUpperCase():"KA"})}),e.jsx("span",{className:"text-sm text-aac-text font-normal hidden sm:inline",children:(r==null?void 0:r.firstName)||"Kate"})]}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!t),className:"text-aac-text hover:bg-white/20",children:t?e.jsx(Gr,{className:"w-5 h-5"}):e.jsx(PF,{className:"w-5 h-5"})})]})]}),t&&e.jsxs("div",{className:"border-t border-aac-yellow py-4 bg-white shadow-lg",children:[e.jsx("div",{className:"space-y-2 px-2",children:m.map((y,b)=>{const w=y.icon,N=s===y.path||y.path.includes("?tab=")&&s==="/portal";return y.path.includes("?tab=")?e.jsxs(F,{variant:"ghost",size:"sm",className:`w-full justify-start space-x-3 py-4 rounded-lg transition-all duration-200 ${N?"bg-aac-blue/10 border-l-4 border-aac-blue shadow-sm":"hover:bg-aac-blue/5"}`,style:{color:"#4A4A4A"},onClick:()=>{n(!1);const k=y.path.split("?tab=")[1],E=new URL(window.location.href);E.searchParams.set("tab",k),window.history.pushState({},"",E.toString()),window.dispatchEvent(new CustomEvent("portal-tab-change",{detail:k}))},children:[e.jsx("div",{className:`p-2 rounded-lg ${N?"bg-aac-yellow/20":"bg-gray-100"}`,children:e.jsx(w,{className:"w-4 h-4",style:{color:"#4A4A4A"}})}),e.jsx("span",{className:"text-sm font-medium",children:y.label})]}):e.jsx(Wl,{href:y.path,children:e.jsxs(F,{variant:"ghost",size:"sm",className:`group w-full justify-start space-x-3 py-4 rounded-lg transition-all duration-200 ${N?"bg-aac-blue/10 border-l-4 border-aac-blue shadow-sm":"hover:bg-aac-blue/10 hover:border-l-4 hover:border-aac-blue/50"}`,style:{color:"#4A4A4A"},onClick:()=>n(!1),children:[e.jsx("div",{className:`p-2 rounded-lg transition-all duration-200 ${N?"bg-aac-yellow/20":"bg-gray-100 group-hover:bg-aac-yellow/15"}`,children:e.jsx(w,{className:"w-4 h-4",style:{color:"#4A4A4A"}})}),e.jsx("span",{className:"text-sm font-medium",children:y.label})]})})})}),e.jsx("div",{className:"border-t border-aac-blue/20 pt-4 mt-4",children:e.jsxs(F,{variant:"ghost",size:"sm",className:"w-full justify-start space-x-3 py-4 rounded-lg transition-all duration-200 hover:bg-red-50",style:{color:"#dc2626"},onClick:o,children:[e.jsx("div",{className:"p-2 rounded-lg bg-gray-100",children:e.jsx($F,{className:"w-4 h-4",style:{color:"#dc2626"}})}),e.jsx("span",{className:"text-sm font-medium",children:"Logout"})]})})]})]})})}const Ce=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("rounded-lg border bg-card text-card-foreground shadow-sm",s),...t}));
vendor: 5,697 bytes, line 534
534Ce.displayName="Card";const Ve=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("flex flex-col space-y-1.5 p-6",s),...t}));Ve.displayName="CardHeader";const Ue=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("text-2xl font-semibold leading-none tracking-tight",s),...t}));Ue.displayName="CardTitle";const rn=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("text-sm text-muted-foreground",s),...t}));rn.displayName="CardDescription";const Se=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("p-6 pt-0",s),...t}));Se.displayName="CardContent";const JL=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("flex items-center p-6 pt-0",s),...t}));JL.displayName="CardFooter";const eV=ff("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function we({className:s,variant:t,...n}){return e.jsx("div",{className:pt(eV({variant:t}),s),...n})}var M2="Dialog",[CC,SC]=or(M2),[tV,Oi]=CC(M2),kC=s=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:c=!0}=s,u=p.useRef(null),h=p.useRef(null),[x=!1,m]=ga({prop:r,defaultProp:a,onChange:o});return e.jsx(tV,{scope:t,triggerRef:u,contentRef:h,contentId:xa(),titleId:xa(),descriptionId:xa(),open:x,onOpenChange:m,onOpenToggle:p.useCallback(()=>m(g=>!g),[m]),modal:c,children:n})};kC.displayName=M2;var $C="DialogTrigger",PC=p.forwardRef((s,t)=>{const{__scopeDialog:n,...r}=s,a=Oi($C,n),o=Cs(t,a.triggerRef);return e.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":U2(a.open),...r,ref:o,onClick:ut(s.onClick,a.onOpenToggle)})});PC.displayName=$C;var L2="DialogPortal",[sV,EC]=CC(L2,{forceMount:void 0}),TC=s=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=s,o=Oi(L2,t);return e.jsx(sV,{scope:t,forceMount:n,children:p.Children.map(r,c=>e.jsx(ea,{present:n||o.open,children:e.jsx(Xu,{asChild:!0,container:a,children:c})}))})};TC.displayName=L2;var Yx="DialogOverlay",_C=p.forwardRef((s,t)=>{const n=EC(Yx,s.__scopeDialog),{forceMount:r=n.forceMount,...a}=s,o=Oi(Yx,s.__scopeDialog);return o.modal?e.jsx(ea,{present:r||o.open,children:e.jsx(rV,{...a,ref:t})}):null});_C.displayName=Yx;var nV=Qo("DialogOverlay.RemoveScroll"),rV=p.forwardRef((s,t)=>{const{__scopeDialog:n,...r}=s,a=Oi(Yx,n);return e.jsx(jf,{as:nV,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(_t.div,{"data-state":U2(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),dd="DialogContent",IC=p.forwardRef((s,t)=>{const n=EC(dd,s.__scopeDialog),{forceMount:r=n.forceMount,...a}=s,o=Oi(dd,s.__scopeDialog);return e.jsx(ea,{present:r||o.open,children:o.modal?e.jsx(aV,{...a,ref:t}):e.jsx(iV,{...a,ref:t})})});IC.displayName=dd;var aV=p.forwardRef((s,t)=>{const n=Oi(dd,s.__scopeDialog),r=p.useRef(null),a=Cs(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return q0(o)},[]),e.jsx(DC,{...s,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(s.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ut(s.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:ut(s.onFocusOutside,o=>o.preventDefault())})}),iV=p.forwardRef((s,t)=>{const n=Oi(dd,s.__scopeDialog),r=p.useRef(!1),a=p.useRef(!1);return e.jsx(DC,{...s,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=s.onCloseAutoFocus)==null||c.call(s,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{var h,x;(h=s.onInteractOutside)==null||h.call(s,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=o.target;((x=n.triggerRef.current)==null?void 0:x.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),DC=p.forwardRef((s,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...c}=s,u=Oi(dd,n),h=p.useRef(null),x=Cs(t,h);return z0(),e.jsxs(e.Fragment,{children:[e.jsx(vf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:e.jsx(gd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":U2(u.open),...c,ref:x,onDismiss:()=>u.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(oV,{titleId:u.titleId}),e.jsx(dV,{contentRef:h,descriptionId:u.descriptionId})]})]})}),V2="DialogTitle",OC=p.forwardRef((s,t)=>{const{__scopeDialog:n,...r}=s,a=Oi(V2,n);return e.jsx(_t.h2,{id:a.titleId,...r,ref:t})});OC.displayName=V2;var FC="DialogDescription",RC=p.forwardRef((s,t)=>{const{__scopeDialog:n,...r}=s,a=Oi(FC,n);return e.jsx(_t.p,{id:a.descriptionId,...r,ref:t})});RC.displayName=FC;var MC="DialogClose",LC=p.forwardRef((s,t)=>{const{__scopeDialog:n,...r}=s,a=Oi(MC,n);return e.jsx(_t.button,{type:"button",...r,ref:t,onClick:ut(s.onClick,()=>a.onOpenChange(!1))})});LC.displayName=MC;function U2(s){return s?"open":"closed"}var VC="DialogTitleWarning",[lV,UC]=$O(VC,{contentName:dd,titleName:V2,docsSlug:"dialog"}),oV=({titleId:s}
534)=>{const t=UC(VC),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 535 536If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 537 538For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{s&&(document.getElementById(s)||console.error(n))},[n,s]),null},cV="DialogDescriptionWarning",dV=({contentRef:s,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UC(cV).contentName}}.`;return p.useEffect(()=>{var o;const a=(o=s.current)==null?void 0:o.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,s,t]),null},zC=kC,qC=PC,WC=TC,z2=_C,q2=IC,W2=OC,B2=RC,K2=LC;const es=zC,jr=qC,uV=WC,BC=p.forwardRef(({className:s,...t},n)=>e.jsx(z2,{ref:n,className:pt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t}));BC.displayName=z2.displayName;const ts=p.forwardRef(({className:s,children:t,...n},r)=>e.jsxs(uV,{children:[e.jsx(BC,{}),e.jsxs(q2,{ref:r,className:pt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[t,e.jsxs(K2,{className:"absolute right-4 top-4 roun
538ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Gr,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ts.displayName=q2.displayName;const ss=({className:s,...t})=>e.jsx("div",{className:pt("flex flex-col space-y-1.5 text-center sm:text-left",s),...t});ss.displayName="DialogHeader";const sl=({className:s,...t})=>e.jsx("div",{className:pt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});sl.displayName="DialogFooter";const ns=p.forwardRef(({className:s,...t},n)=>e.jsx(W2,{ref:n,className:pt("text-lg font-semibold leading-none tracking-tight",s),...t}));ns.displayName=W2.displayName;const Pa=p.forwardRef(({className:s,...t},n)=>e.jsx(B2,{ref:n,className:pt("text-sm text-muted-foreground",s),...t}));Pa.displayName=B2.displayName;const je=p.forwardRef(({className:s,type:t,...n},r)=>e.jsx("input",{type:t,className:pt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:r,...n}));je.displayName="Input";var mV="Label",KC=p.forwardRef((s,t)=>e.jsx(_t.label,{...s,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=s.onMouseDown)==null||a.call(s,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));KC.displayName=mV;var HC=KC;const hV=ff("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ne=p.forwardRef(({className:s,...t},n)=>e.jsx(HC,{ref:n,className:pt(hV(),s),...t}));Ne.displayName=HC.displayName;const fV=ff("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),B0=p.forwardRef(({className:s,variant:t,...n},r)=>e.jsx("div",{ref:r,role:"alert",className:pt(fV({variant:t}),s),...n}));B0.displayName="Alert";const K0=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:pt("text-sm [&_p]:leading-relaxed",s),...t}));K0.displayName="AlertDescription";const pV=p.forwardRef(({className:s,...t},n)=>e.jsx("h5",{ref:n,className:pt("mb-1 font-medium leading-none tracking-tight",s),...t}));pV.displayName="AlertTitle";function GC({isOpen:s,onClose:t,userEmail:n}){const[r,a]=p.useState(""),[o,c]=p.useState(""),[u,h]=p.useState(""),[x,m]=p.useState(""),[g,y]=p.useState(!1),[b,w]=p.useState(!1),[N,k]=p.useState(!1),E=dn(),P=bt({mutationFn:async L=>st("POST","/api/auth/change-password",L),onSuccess:()=>{E.invalidateQueries({queryKey:["/api/auth/user"]}),a(""),c(""),h(""),m(""),t()},onError:L=>{m(L.message||"Failed to change password")}}),M=L=>{if(L.preventDefault(),m(""),!r.trim()){m("Please enter your current password");return}if(o.length<8){m("New password must be at least 8 characters long");return}if(o!==u){m("New passwords do not match");return}P.mutate({currentPassword:r,newPassword:o})};return e.jsx(es,{open:s,onOpenChange:()=>{},children:e.jsxs(ts,{className:"sm:max-w-md",style:{backgroundColor:"#77dbf6"},children:[e.jsxs(ss,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 w-fit",children:e.jsx("img",{src:"/images/forgotpasswordlogo.png",alt:"Password Reset",className:"w-16 h-16 object-contain"})}),e.jsx(ns,{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Password Change Required"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:"For security, please change your default password before continuing"})]}),e.jsxs("form",{onSubmit:M,className:"space-y-4",children:[x&&e.jsxs(B0,{className:"border-red-200 bg-red-50",children:[e.jsx(Qr,{className:"h-4 w-4 text-red-600"}),e.jsx(K0,{className:"text-red-800",children:x})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"current-password",children:"Current Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{id:"current-password",type:g?"text":"password",value:r,onChange:L=>a(L.target.value),placeholder:"Enter your current password",required:!0,className:"pr-10"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>y(!g),children:g?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"new-password",children:"New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{id:"new-password",type:b?"text":"password",value:o,onChange:L=>c(L.target.value),placeholder:"Enter your new password",required:!0,minLength:8,className:"pr-10"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>w(!b),children:b?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"confirm-password",children:"Confirm New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{id:"confirm-password",type:N?"text":"password",value:u,onChange:L=>h(L.target.value),placeholder:"Confirm your new password",required:!0,minLength:8,className:"pr-10"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>k(!N),children:N?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})]}),e.jsx("div",{className:"flex gap-3 pt-4",children:e.jsx(F,{type:"submit",disabled:P.isPending,className:"flex-1",style:{backgroundColor:"#feea6a",color:"#4A4A4A",border:"none"},children:P.isPending?"Changing...":"Change Password"})})]})]})})}function iv(){const[,s]=hl(),[t,n]=p.useState(!1),{data:r}=nt({queryKey:["/api/auth/user"]}),{data:a}=nt({queryKey:["/api/dashboard/stats"]}),{data:o}=nt({queryKey:["/api/admin/login-activity"]}),{data:c=[]}=nt({queryKey:["/api/admin/incomplete-registrations"]}),{data:u}=nt({queryKey:["/api/admin/contracts"]});p.useEffect(()=>{r!=null&&r.requiresPasswordChange&&n(!0)},[r]);const h=y=>{const w=Math.abs(new Date().getTime()-new Date(y).getTime()),N=Math.floor(w/(1e3*60*60*24));return N===0?"Today":N===1?"Yesterday":N<7?`${N} days ago`:new Date(y).toLocaleDateString()},x=y=>{const b=y.lastEngagement||y.createdAt;return Math.floor((Date.now()-new Date(b).getTime())/(1440*60*1e3))},m=y=>
538{switch(y){case"phase1":return"Phase 1";case"phase2":return"Phase 2";case"phase3_lockout":return"Phase 3";case"expired":return"Expired";default:return"Pre-Phase 1"}},g={total:c.length,needsReview:c.filter(y=>y.remindersSent>=3&&x(y)>=30).length,highReminders:c.filter(y=>y.remindersSent>=3).length,longInactive:c.filter(y=>x(y)>=30).length};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-[#77dbf6]/10 to-white pt-16",children:[e.jsxs("div",{className:"container mx-auto px-4 sm:px-6 py-4 sm:py-8",children:[e.jsxs("div",{className:"mb-6 sm:mb-8",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-[#4A4A4A]",children:"Dashboard"}),e.jsx("p",{className:"text-[#4A4A4A]/80 mt-2 text-sm sm:text-base",children:"Real-time overview of your AAC Voices community"})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 mb-6 sm:mb-8",children:e.jsx(Ce,{className:"bg-gradient-to-r from-[#77dbf6]/20 to-[#77dbf6]/10 border-[#77dbf6]/30 shadow-lg",children:e.jsx(Se,{className:"p-4 sm:p-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[e.jsx("img",{src:"/images/readerbee.png",alt:"Spring 2026",className:"h-12 sm:h-16 w-12 sm:w-16 object-contain"}),e.jsxs("div",{className:"flex-1 text-center sm:text-left",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-[#4A4A4A] mb-1",children:"Enroll for Spring 2026 Classes Now!"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-xs sm:text-sm mb-3",children:"Ahern Academy, Open Enrollment classes, and Young Adult Chat starting January 5th"}),e.jsxs(F,{className:"bg-[#77dbf6] hover:bg-[#77dbf6]/90 text-white font-medium h-9 sm:h-10 shadow-md transition-all",onClick:()=>s("/admin/class-enrollment"),children:["View Classes",e.jsx(Rl,{className:"ml-2 h-3 w-3 sm:h-4 sm:w-4"})]})]})]})})})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 sm:gap-6 mb-6 sm:mb-8",children:[e.jsxs(Ce,{className:"shadow-md border-[#77dbf6]/20 hover:shadow-lg transition-shadow",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-xs sm:text-sm font-medium text-[#4A4A4A]",children:"Students & Families"}),e.jsx(Ms,{className:"h-4 w-4 text-[#77dbf6]"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:[(a==null?void 0:a.activeStudents)||0," / ",(a==null?void 0:a.totalFamilies)||0]}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/60",children:"Students / Families"}),e.jsxs(F,{variant:"ghost",size:"sm",className:"mt-2 p-0 h-auto text-[#77dbf6] hover:text-[#5DCFF2]",onClick:()=>s("/admin/students"),children:["Manage Students ",e.jsx(Rl,{className:"w-3 h-3 sm:w-4 sm:h-4 ml-1"})]})]})]}),e.jsxs(Ce,{className:"shadow-md border-[#feea6a]/20 hover:shadow-lg transition-shadow",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-xs sm:text-sm font-medium text-[#4A4A4A]",children:"Program Enrollment"}),e.jsx(ar,{className:"h-4 w-4 text-[#feea6a]"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"Ahern Academy:"}),e.jsx(we,{className:"bg-[#77dbf6]/20 text-[#4A4A4A] border-[#77dbf6]/30",children:(a==null?void 0:a.enrollmentBreakdown.ahernAcademy)||0})]}),e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"Open Enrollment:"}),e.jsx(we,{className:"bg-[#77dbf6]/20 text-[#4A4A4A] border-[#77dbf6]/30",children:(a==null?void 0:a.enrollmentBreakdown.openEnrollment)||0})]}),e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"1:1 Sessions:"}),e.jsx(we,{className:"bg-[#77dbf6]/20 text-[#4A4A4A] border-[#77dbf6]/30",children:(a==null?void 0:a.enrollmentBreakdown.oneOnOne)||0})]}),e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"Young Adult Chat:"}),e.jsx(we,{className:"bg-[#77dbf6]/20 text-[#4A4A4A] border-[#77dbf6]/30",children:(a==null?void 0:a.enrollmentBreakdown.youngAdultChat)||0})]})]}),e.jsxs(F,{variant:"ghost",size:"sm",className:"mt-2 p-0 h-auto text-[#feea6a] hover:text-[#feea6a]/80",onClick:()=>s("/admin/class-enrollment"),children:["View Enrollment ",e.jsx(Rl,{className:"w-3 h-3 sm:w-4 sm:h-4 ml-1"})]})]})]}),e.jsxs(Ce,{className:"shadow-md border-[#feea6a]/20 hover:shadow-lg transition-shadow",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-xs sm:text-sm font-medium text-[#4A4A4A]",children:"Pending Payments"}),e.jsx(xr,{className:"h-4 w-4 text-[#feea6a]"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:(a==null?void 0:a.pendingPayments)||"$0"}),e.jsxs(F,{variant:"ghost",size:"sm",className:"mt-2 p-0 h-auto text-[#feea6a] hover:text-[#feea6a]/80",onClick:()=>
538s("/admin/billing-dashboard"),children:["Track Payments ",e.jsx(Rl,{className:"w-3 h-3 sm:w-4 sm:h-4 ml-1"})]})]})]}),e.jsxs(Ce,{className:"shadow-md border-[#77dbf6]/20 hover:shadow-lg transition-shadow",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-xs sm:text-sm font-medium text-[#4A4A4A]",children:"Contract Tracking"}),e.jsx(Js,{className:"h-4 w-4 text-[#77dbf6]"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"Ahern Academy Families:"}),e.jsx(we,{className:"bg-[#77dbf6]/20 text-[#4A4A4A] border-[#77dbf6]/30",children:u!=null&&u.stats?`${u.stats.signedContracts}/${u.stats.totalFamilies}`:(a==null?void 0:a.enrollmentBreakdown.ahernAcademy)||0})]}),e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-[#4A4A4A]",children:"Phase:"}),e.jsx(we,{className:"bg-[#feea6a]/20 text-[#4A4A4A] border-[#feea6a]/30",children:u!=null&&u.stats.currentPhase?m(u.stats.currentPhase):"Loading..."})]})]}),e.jsxs(F,{variant:"ghost",size:"sm",className:"mt-2 p-0 h-auto text-[#77dbf6] hover:text-[#5DCFF2]",onClick:()=>s("/admin/contract-tracking"),children:["View Contracts ",e.jsx(Rl,{className:"w-3 h-3 sm:w-4 sm:h-4 ml-1"})]})]})]}),e.jsxs(Ce,{className:`shadow-md hover:shadow-lg transition-shadow ${g.needsReview>0?"border-red-300 bg-red-50":"border-orange-300"}`,children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-xs sm:text-sm font-medium text-[#4A4A4A]",children:"Incomplete Registrations"}),e.jsx(rl,{className:`h-4 w-4 ${g.needsReview>0?"text-red-500":"text-orange-500"}`})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:g.total}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/60",children:"Total Incomplete"}),g.needsReview>0&&e.jsx("div",{className:"mt-1",children:e.jsxs(we,{className:"bg-red-100 text-red-800 border-red-300 text-xs",children:[g.needsReview," need review"]})}),e.jsxs(F,{variant:"ghost",size:"sm",className:`mt-2 p-0 h-auto ${g.needsReview>0?"text-red-600 hover:text-red-500":"text-orange-600 hover:text-orange-500"}`,onClick:()=>s("/admin/incomplete-registrations"),children:["Manage Incomplete ",e.jsx(Rl,{className:"w-3 h-3 sm:w-4 sm:h-4 ml-1"})]})]})]})]}),e.jsx("div",{className:"mb-8",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(yF,{className:"w-5 h-5"}),"Family Portal Access Tracking"]}),e.jsxs("div",{className:"text-sm text-gray-600 mt-2 p-3 bg-blue-50 rounded-lg border-l-4 border-blue-400",children:[e.jsx("strong",{children:"Data Scope:"})," Shows only families with complete portal accounts (account + family record + students). Does not include incomplete registrations or users without family records."]})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 gap-4 mb-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:(o==null?void 0:o.summary.everLoggedIn)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Families Logged In"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-600",children:(o==null?void 0:o.summary.neverLoggedIn)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Never Accessed Portal"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600",children:(o==null?void 0:o.summary.withStudents)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Families w/ Students"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-orange-600",children:(o==null?void 0:o.summary.withoutStudents)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Missing Students"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:(o==null?void 0:o.summary.withEnrollments)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Families w/ Classes"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-pink-600",children:[(o==null?void 0:o.summary.averageCompletion)||0,"%"]}),e.jsx("div",{className:"text-xs text-gray-600",children:"Profile Completion"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:(o==null?void 0:o.summary.totalEnrollments)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Class Enrollments*"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-600",children:(o==null?void 0:o.summary.totalProblems)||0}),e.jsx("div",{className:"text-xs text-gray-600",children:"Data Issues"})]})]}),e.jsxs("div",{className:"text-xs text-gray-500 mb-4 p-2 bg-gray-50 rounded",children:[e.jsx("strong",{children:"*Enrollment Count:"})," Includes Ahern Academy automatic enrollments (literacy + math = 2 per student) plus actual class enrollments. This explains higher enrollment numbers compared to raw database counts."]}),e.jsx("div",{className:"max-h-96 overflow-y-auto border rounded-lg",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50 sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Family"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Students"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Completion"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Enrollments"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Problems"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Logins"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Login"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o==null?void 0:o.loginActivity.map(y=>e.jsxs("tr",{className:y.role==="admin"?"bg-purple-50":"",children:[e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[y.role==="admin"?e.jsx(x7,{className:"w-4 h-4 mr-2 text-purple-600"}):e.jsx(Ms,{className:"w-4 h-4 mr-2 text-blue-600"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:y.name}),e.jsx("div",{className:"text-sm text-gray-500",children:y.email}),e.jsx(we,{variant:y.role==="admin"?"default":"secondary",className:"mt-1",children:y.role==="admin"?"Admin":"Family"})]})]})}),e.jsxs("td",{className:"px-4 py-3 whitespace-nowrap",children:[e.jsx("div",{className:"text-sm text-gray-900",children:y.studentNames}),e.jsxs("div",{className:"text-xs text-gray-500",children:[y.studentCount," student(s)"]})]}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsxs(we,{variant:"outline",className:y.completionPercentage>=80?"bg-green-100 text-green-800 border-green-300":y.completionPercentage>=60?"bg-yellow-100 text-yellow-800 border-yellow-300":"bg-pink-100 text-pink-800 border-pink-300",children:[y.completionPercentage,"%"]})}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs(we,{variant:"outline",className:y.enrollmentCount>0?"bg-blue-100 text-blue-800 border-blue-300":"bg-gray-100 text-gray-800 border-gray-300",children:[y.enrollmentCount," total"]}),y.ahernAcademyCount>0&&e.jsxs(we,{variant:"outline",className:"bg-purple-100 text-purple-800 border-purple-300 text-xs",children:[y.ahernAcademyCount," AA"]}),y.oneOnOneCount>0&&e.jsxs(we,{variant:"outline",className:"bg-orange-100 text-orange-800 border-orange-300 text-xs",children:[y.oneOnOneCount," 1:1"]})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("div",{className:"flex flex-wrap gap-1 max-w-32",children:y.problems&&y.problems.length>0?y.problems.map((b,w)=>e.jsx(we,{variant:"outline",className:"bg-red-100 text-red-800 border-red-300 text-xs",children:b},w)):e.jsx(we,{variant:"outline",className:"bg-green-100 text-green-800 border-green-300",children:"No issues"})})}),e.jsxs("td",{className:"px-4 py-3 whitespace-nowrap",children:[e.jsx("div",{className:"text-sm text-gray-900",children:y.totalLogins}),e.jsx("div",{className:`text-xs ${y.hasLoggedIn?"text-green-600":"text-red-600"}`,children:y.hasLoggedIn?"Has logged in":"Never logged in"})]}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-sm text-gray-500",children:y.lastLoginDate?h(new Date(y.lastLoginDate)):"Never"})]},y.email))})]})}),e.jsxs("div",{className:"mt-6 p-4 bg-gray-50 rounded-lg border",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Color Co
538de Legend"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-xs font-medium text-gray-600 mb-2",children:"Registration Completion"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(we,{variant:"outline",className:"bg-green-100 text-green-800 border-green-300",children:"80%+ Complete"}),e.jsx(we,{variant:"outline",className:"bg-yellow-100 text-yellow-800 border-yellow-300",children:"60-79% Complete"}),e.jsx(we,{variant:"outline",className:"bg-pink-100 text-pink-800 border-pink-300",children:"Below 60%"})]})]}),e.jsxs("div",{children:[e.jsx("h5",{className:"text-xs font-medium text-gray-600 mb-2",children:"Class Enrollments"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(we,{variant:"outline",className:"bg-blue-100 text-blue-800 border-blue-300",children:"Total Classes"}),e.jsx(we,{variant:"outline",className:"bg-purple-100 text-purple-800 border-purple-300",children:"AA (Ahern Academy)"}),e.jsx(we,{variant:"outline",className:"bg-orange-100 text-orange-800 border-orange-300",children:"1:1 Sessions"}),e.jsx(we,{variant:"outline",className:"bg-gray-100 text-gray-800 border-gray-300",children:"No Enrollments"})]})]})]})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:[e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(ar,{className:"w-5 h-5"}),"Program Enrollment"]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Ahern Academy"}),e.jsx(we,{variant:"default",children:(a==null?void 0:a.enrollmentBreakdown.ahernAcademy)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Open Enrollment"}),e.jsx(we,{variant:"secondary",children:(a==null?void 0:a.enrollmentBreakdown.openEnrollment)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"1:1 Sessions"}),e.jsx(we,{variant:"outline",children:(a==null?void 0:a.enrollmentBreakdown.oneOnOne)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Young Adult Chat"}),e.jsx(we,{variant:"outline",children:(a==null?void 0:a.enrollmentBreakdown.youngAdultChat)||0})]}),e.jsx(F,{variant:"outline",size:"sm",className:"w-full mt-4",onClick:()=>s("/admin/students"),children:"View All Students"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(xr,{className:"w-5 h-5"}),"Payment Summary"]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Total Payments"}),e.jsx(we,{variant:"default",children:(a==null?void 0:a.paymentBreakdown.totalPayments)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-green-600",children:"Paid"}),e.jsx(we,{variant:"default",className:"bg-green-100 text-green-800",children:(a==null?void 0:a.paymentBreakdown.paidPayments)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-yellow-600",children:"Pending"}),e.jsx(we,{variant:"default",className:"bg-yellow-100 text-yellow-800",children:(a==null?void 0:a.paymentBreakdown.pendingPayments)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-red-600",children:"Overdue"}),e.jsx(we,{variant:"default",className:"bg-red-100 text-red-800",children:(a==null?void 0:a.paymentBreakdown.overduePayments)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Total Collected"}),e.jsx("span",{className:"font-bold text-green-600",children:(a==null?void 0:a.paymentBreakdown.totalCollected)||"$0.00"})]}),e.jsx(F,{variant:"outline",size:"sm",className:"w-full mt-4",onClick:()=>
538s("/admin/billing-dashboard"),children:"Manage Payments"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"w-5 h-5"}),"Resource Center"]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Total Resources"}),e.jsx(we,{variant:"default",children:(a==null?void 0:a.resourceBreakdown.totalFiles)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(gr,{className:"w-3 h-3"}),"Files"]}),e.jsx(we,{variant:"secondary",children:(a==null?void 0:a.resourceBreakdown.fileUploads)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(Ya,{className:"w-3 h-3"}),"Links"]}),e.jsx(we,{variant:"outline",children:(a==null?void 0:a.resourceBreakdown.externalLinks)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(ys,{className:"w-3 h-3"}),"Recent (7 days)"]}),e.jsx(we,{variant:"default",className:"bg-blue-100 text-blue-800",children:(a==null?void 0:a.resourceBreakdown.recentUploads)||0})]}),e.jsx(F,{variant:"outline",size:"sm",className:"w-full mt-4",onClick:()=>s("/admin/resources"),children:"Browse Resources"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Ir,{className:"w-5 h-5"}),"Communication Activity"]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm",children:"Total Messages"}),e.jsx(we,{variant:"default",children:(a==null?void 0:a.messageBreakdown.totalMessages)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(ir,{className:"w-3 h-3"}),"Email Messages"]}),e.jsx(we,{variant:"secondary",children:(a==null?void 0:a.messageBreakdown.emailMessages)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(E0,{className:"w-3 h-3"}),"SMS Messages"]}),e.jsx(we,{variant:"outline",children:(a==null?void 0:a.messageBreakdown.smsMessages)||0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm flex items-center gap-1",children:[e.jsx(ys,{className:"w-3 h-3"}),"Recent (7 days)"]}),e.jsx(we,{variant:"default",className:"bg-green-100 text-green-800",children:(a==null?void 0:a.messageBreakdown.recentMessages)||0})]}),e.jsx(F,{variant:"outline",size:"sm",className:"w-full mt-4",onClick:()=>s("/admin/messages"),children:"Message Center"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(xf,{className:"w-5 h-5"}),"Recent Activity"]})}),e.jsxs(Se,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx(As,{className:"w-5 h-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-green-800",children:"System Status: Operational"}),e.jsx("p",{className:"text-xs text-green-600",children:"All systems running normally"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx(Ir,{className:"w-5 h-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:"Payment-Enrollment Linkage"}),e.jsx("p",{className:"text-xs text-blue-600",children:"Successfully connecting payments to enrollments"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsx(Js,{className:"w-5 h-5 text-purple-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-purple-800",children:"Database Status"}),e.jsx("p",{className:"text-xs text-purple-600",children:"FERPA-compliant database active"})]})]})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(an,{className:"w-5 h-5"}),"Quick Actions"]})}),e.jsxs(Se,{className:"space-y-3",children:[e.jsxs(F,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>s("/admin/students"),children:[e.jsx(Ms,{className:"w-4 h-4 mr-2"}),"Register New Family"]}),e.jsxs(F,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>s("/admin/messages"),children:[e.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Send Message"]}),e.jsxs(F,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>s("/admin/resources"),children:[e.jsx(gr,{className:"w-4 h-4 mr-2"}),"Upload Resource"]}),e.jsxs(F,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>
538s("/admin/billing-dashboard"),children:[e.jsx(xr,{className:"w-4 h-4 mr-2"}),"Create Payment"]}),e.jsxs(F,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:async()=>{try{const y=await fetch("/api/zoom/auth",{credentials:"include"});if(y.ok){const b=await y.json();window.open(b.authUrl,"_blank")}else console.error("Failed to get Zoom auth URL")}catch(y){console.error("Error connecting to Zoom:",y)}},children:[e.jsx(Ya,{className:"w-4 h-4 mr-2"}),"Connect Zoom (1:1 Sessions)"]})]})]})]})]}),e.jsx(GC,{isOpen:t,onClose:()=>n(!1),userEmail:(r==null?void 0:r.email)||""})]})}var H2="Avatar",[xV]=or(H2),[gV,ZC]=xV(H2),YC=p.forwardRef((s,t)=>{const{__scopeAvatar:n,...r}=s,[a,o]=p.useState("idle");return e.jsx(gV,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:e.jsx(_t.span,{...r,ref:t})})});YC.displayName=H2;var QC="AvatarImage",XC=p.forwardRef((s,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...o}=s,c=ZC(QC,n),u=yV(r,o),h=vr(x=>{a(x),c.onImageLoadingStatusChange(x)});return Zn(()=>{u!=="idle"&&h(u)},[u,h]),u==="loaded"?e.jsx(_t.img,{...o,ref:t,src:r}):null});XC.displayName=QC;var JC="AvatarFallback",eS=p.forwardRef((s,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=s,o=ZC(JC,n),[c,u]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const h=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(h)}},[r]),c&&o.imageLoadingStatus!=="loaded"?e.jsx(_t.span,{...a,ref:t}):null});eS.displayName=JC;function FN(s,t){return s?t?(s.src!==t&&(s.src=t),s.complete&&s.naturalWidth>0?"loaded":"loading"):"error":"idle"}function yV(s,{referrerPolicy:t,crossOrigin:n}){const r=jV(),a=p.useRef(null),o=r?(a.current||(a.current=new window.Image),a.current):null,[c,u]=p.useState(()=>FN(o,s));return Zn(()=>{u(FN(o,s))},[o,s]),Zn(()=>{const h=g=>()=>{u(g)};if(!o)return;const x=h("loaded"),m=h("error");return o.addEventListener("load",x),o.addEventListener("error",m),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",x),o.removeEventListener("error",m)}},[o,n,t]),c}function vV(){return()=>{}}function jV(){return p.useSyncExternalStore(vV,()=>!0,()=>!1)}var tS=YC,sS=XC,nS=eS;const Ph=p.forwardRef(({className:s,...t},n)=>e.jsx(tS,{ref:n,className:pt("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...t}));Ph.displayName=tS.displayName;const Eh=p.forwardRef(({className:s,...t},n)=>e.jsx(sS,{ref:n,className:pt("aspect-square h-full w-full",s),...t}));Eh.displayName=sS.displayName;const Th=p.forwardRef(({className:s,...t},n)=>e.jsx(nS,{ref:n,className:pt("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...t}));Th.displayName=nS.displayName;function zu(s){if(s!=null&&s.includes("scholarship"))return{text:s,variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200"};if(s==="third party")return{text:"third party",variant:"outline",className:"bg-purple-50 text-purple-700 border-purple-200"};switch(s){case"paid":return{text:"paid",variant:"default",className:"bg-green-50 text-green-700 border-green-200"};case"payment due":return{text:"payment due",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"};case"pay to confirm enrollment":return{text:"pay to confirm enrollment",variant:"outline",className:"bg-orange-50 text-orange-700 border-orange-200"};case"upcoming payment due":return{text:"upcoming payment due",variant:"secondary",className:"bg-yellow-50 text-yellow-700 border-yellow-200"};case"unenrolled":return{text:"unenrolled",variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200"};case"paid_in_full":return{text:"paid",variant:"default",className:"bg-green-50 text-green-700 border-green-200"};case"balance_due":return{text:"payment due",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"};case"overpaid":return{text:"paid",variant:"default",className:"bg-green-50 text-green-700 border-green-200"};case"unconfirmed_enrollment":return{text:"pay to confirm enrollment",variant:"outline",className:"bg-orange-50 text-orange-700 border-orange-200"};case"no_payments":return{text:"upcoming payment due",variant:"secondary",className:"bg-yellow-50 text-yellow-700 border-yellow-200"};case"no_enrollments":return{text:"unenrolled",variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200"};case"scholarship_100":return{text:"scholarship (100%)",variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200"};case"partial_payment":return{text:"payment due",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"};
vendor: 4,949 bytes, line 538
538case"pending":return{text:"payment due",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"};case"overdue":return{text:"payment overdue",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"};default:return{text:"payment due",variant:"destructive",className:"bg-red-50 text-red-700 border-red-200"}}}function RN(s,[t,n]){return Math.min(n,Math.max(t,s))}var bV=p.createContext(void 0);function Nf(s){const t=p.useContext(bV);return s||t||"ltr"}function G2(s){const t=p.useRef({value:s,previous:s});return p.useMemo(()=>(t.current.value!==s&&(t.current.previous=t.current.value,t.current.value=s),t.current.previous),[s])}var NV=[" ","Enter","ArrowUp","ArrowDown"],wV=[" ","Enter"],wf="Select",[H0,G0,AV]=mf(wf),[sm]=or(wf,[AV,ic]),Z0=ic(),[CV,oc]=sm(wf),[SV,kV]=sm(wf),rS=s=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:c,defaultValue:u,onValueChange:h,dir:x,name:m,autoComplete:g,disabled:y,required:b,form:w}=s,N=Z0(t),[k,E]=p.useState(null),[P,M]=p.useState(null),[L,B]=p.useState(!1),z=Nf(x),[H=!1,T]=ga({prop:r,defaultProp:a,onChange:o}),[U,_]=ga({prop:c,defaultProp:u,onChange:h}),se=p.useRef(null),ae=k?w||!!k.closest("form"):!0,[W,J]=p.useState(new Set),ne=Array.from(W).map(le=>le.props.value).join(";");return e.jsx(D0,{...N,children:e.jsxs(CV,{required:b,scope:t,trigger:k,onTriggerChange:E,valueNode:P,onValueNodeChange:M,valueNodeHasChildren:L,onValueNodeHasChildrenChange:B,contentId:xa(),value:U,onValueChange:_,open:H,onOpenChange:T,dir:z,triggerPointerDownPosRef:se,disabled:y,children:[e.jsx(H0.Provider,{scope:t,children:e.jsx(SV,{scope:s.__scopeSelect,onNativeOptionAdd:p.useCallback(le=>{J(V=>new Set(V).add(le))},[]),onNativeOptionRemove:p.useCallback(le=>{J(V=>{const Z=new Set(V);return Z.delete(le),Z})},[]),children:n})}),ae?e.jsxs(PS,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:le=>_(le.target.value),disabled:y,form:w,children:[U===void 0?e.jsx("option",{value:""}):null,Array.from(W)]},ne):null]})})};rS.displayName=wf;var aS="SelectTrigger",iS=p.forwardRef((s,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=s,o=Z0(n),c=oc(aS,n),u=c.disabled||r,h=Cs(t,c.onTriggerChange),x=G0(n),m=p.useRef("touch"),[g,y,b]=ES(N=>{const k=x().filter(M=>!M.disabled),E=k.find(M=>M.value===c.value),P=TS(k,N,E);P!==void 0&&c.onValueChange(P.value)}),w=N=>{u||(c.onOpenChange(!0),b()),N&&(c.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return e.jsx(yf,{asChild:!0,...o,children:e.jsx(_t.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":$S(c.value)?"":void 0,...a,ref:h,onClick:ut(a.onClick,N=>{N.currentTarget.focus(),m.current!=="mouse"&&w(N)}),onPointerDown:ut(a.onPointerDown,N=>{m.current=N.pointerType;const k=N.target;k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(w(N),N.preventDefault())}),onKeyDown:ut(a.onKeyDown,N=>{const k=g.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&y(N.key),!(k&&N.key===" ")&&NV.includes(N.key)&&(w(),N.preventDefault())})})})});iS.displayName=aS;var lS="SelectValue",oS=p.forwardRef((s,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:c="",...u}=s,h=oc(lS,n),{onValueNodeHasChildrenChange:x}=h,m=o!==void 0,g=Cs(t,h.onValueNodeChange);return Zn(()=>{x(m)},[x,m]),e.jsx(_t.span,{...u,ref:g,style:{pointerEvents:"none"},children:$S(h.value)?e.jsx(e.Fragment,{children:c}):o})});oS.displayName=lS;var $V="SelectIcon",cS=p.forwardRef((s,t)=>{const{__scopeSelect:n,children:r,...a}=s;return e.jsx(_t.span,{"aria-hidden":!0,...a,ref:t,children:r||"â¼"})});cS.displayName=$V;var PV="SelectPortal",dS=s=>e.jsx(Xu,{asChild:!0,...s});dS.displayName=PV;var ud="SelectContent",uS=p.forwardRef((s,t)=>{const n=oc(ud,s.__scopeSelect),[r,a]=p.useState();if(Zn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Qu.createPortal(e.jsx(mS,{scope:s.__scopeSelect,children:e.jsx(H0.Slot,{scope:s.__scopeSelect,children:e.jsx("div",{children:s.children})})}),o):null}return e.jsx(hS,{...s,ref:t})});uS.displayName=ud;var ji=10,[mS,cc]=sm(ud),EV="SelectContentImpl",TV=Qo("SelectContent.RemoveScroll"),hS=p.forwardRef((s,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:c,side:u,sideOffset:h,align:x,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:w,hideWhenDetached:N,avoidCollisions:k,...E}=s,P=oc(ud,n),[M,L]=p.useState(null),[B,z]=p.useState(null),H=Cs(t,re=>L(re)),[T,U]=p.useState(null),[_,se]=p.useState(null),ae=G0(n),[W,J]=p.useState(!1),ne=p.useRef(!1);p.useEffect(()=>{if(M)return q0(M)},[M]),z0();const le=p.useCallback(re=>{const[O,...me]=ae().map(Be=>
vendor: 13,966 bytes, line 538
538Be.ref.current),[Y]=me.slice(-1),Te=document.activeElement;for(const Be of re)if(Be===Te||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===O&&B&&(B.scrollTop=0),Be===Y&&B&&(B.scrollTop=B.scrollHeight),Be==null||Be.focus(),document.activeElement!==Te))return},[ae,B]),V=p.useCallback(()=>le([T,M]),[le,T,M]);p.useEffect(()=>{W&&V()},[W,V]);const{onOpenChange:Z,triggerPointerDownPosRef:ue}=P;p.useEffect(()=>{if(M){let re={x:0,y:0};const O=Y=>{var Te,Be;re={x:Math.abs(Math.round(Y.pageX)-(((Te=ue.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Y.pageY)-(((Be=ue.current)==null?void 0:Be.y)??0))}},me=Y=>{re.x<=10&&re.y<=10?Y.preventDefault():M.contains(Y.target)||Z(!1),document.removeEventListener("pointermove",O),ue.current=null};return ue.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",me,{capture:!0})}}},[M,Z,ue]),p.useEffect(()=>{const re=()=>Z(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[Z]);const[ge,G]=ES(re=>{const O=ae().filter(Te=>!Te.disabled),me=O.find(Te=>Te.ref.current===document.activeElement),Y=TS(O,re,me);Y&&setTimeout(()=>Y.ref.current.focus())}),Ae=p.useCallback((re,O,me)=>{const Y=!ne.current&&!me;(P.value!==void 0&&P.value===O||Y)&&(U(re),Y&&(ne.current=!0))},[P.value]),Fe=p.useCallback(()=>M==null?void 0:M.focus(),[M]),be=p.useCallback((re,O,me)=>{const Y=!ne.current&&!me;(P.value!==void 0&&P.value===O||Y)&&se(re)},[P.value]),Me=r==="popper"?o1:fS,R=Me===o1?{side:u,sideOffset:h,align:x,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:w,hideWhenDetached:N,avoidCollisions:k}:{};return e.jsx(mS,{scope:n,content:M,viewport:B,onViewportChange:z,itemRefCallback:Ae,selectedItem:T,onItemLeave:Fe,itemTextRefCallback:be,focusSelectedItem:V,selectedItemText:_,position:r,isPositioned:W,searchRef:ge,children:e.jsx(jf,{as:TV,allowPinchZoom:!0,children:e.jsx(vf,{asChild:!0,trapped:P.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:ut(a,re=>{var O;(O=P.trigger)==null||O.focus({preventScroll:!0}),re.preventDefault()}),children:e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:e.jsx(Me,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:re=>re.preventDefault(),...E,...R,onPlaced:()=>J(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ut(E.onKeyDown,re=>{const O=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!O&&re.key.length===1&&G(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Y=ae().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Te=re.target,Be=Y.indexOf(Te);Y=Y.slice(Be+1)}setTimeout(()=>le(Y)),re.preventDefault()}})})})})})})});hS.displayName=EV;var _V="SelectItemAlignedPosition",fS=p.forwardRef((s,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=s,o=oc(ud,n),c=cc(ud,n),[u,h]=p.useState(null),[x,m]=p.useState(null),g=Cs(t,H=>m(H)),y=G0(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:N,selectedItem:k,selectedItemText:E,focusSelectedItem:P}=c,M=p.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&x&&N&&k&&E){const H=o.trigger.getBoundingClientRect(),T=x.getBoundingClientRect(),U=o.valueNode.getBoundingClientRect(),_=E.getBoundingClientRect();if(o.dir!=="rtl"){const Te=_.left-T.left,Be=U.left-Te,ht=H.left-Be,Mt=H.width+ht,$=Math.max(Mt,T.width),K=window.innerWidth-ji,xe=RN(Be,[ji,Math.max(ji,K-$)]);u.style.minWidth=Mt+"px",u.style.left=xe+"px"}else{const Te=T.right-_.right,Be=window.innerWidth-U.right-Te,ht=window.innerWidth-H.right-Be,Mt=H.width+ht,$=Math.max(Mt,T.width),K=window.innerWidth-ji,xe=RN(Be,[ji,Math.max(ji,K-$)]);u.style.minWidth=Mt+"px",u.style.right=xe+"px"}const se=y(),ae=window.innerHeight-ji*2,W=N.scrollHeight,J=window.getComputedStyle(x),ne=parseInt(J.borderTopWidth,10),le=parseInt(J.paddingTop,10),V=parseInt(J.borderBottomWidth,10),Z=parseInt(J.paddingBottom,10),ue=ne+le+W+Z+V,ge=Math.min(k.offsetHeight*5,ue),G=window.getComputedStyle(N),Ae=parseInt(G.paddingTop,10),Fe=parseInt(G.paddingBottom,10),be=H.top+H.height/2-ji,Me=ae-be,R=k.offsetHeight/2,re=k.offsetTop+R,O=ne+le+re,me=ue-O;if(O<=be){const Te=se.length>0&&k===se[se.length-1].ref.current;u.style.bottom="0px";const Be=x.clientHeight-N.offsetTop-N.offsetHeight,ht=Math.max(Me,R+(Te?Fe:0)+Be+V),Mt=O+ht;u.style.height=Mt+"px"}else{const Te=se.length>0&&k===se[0].ref.current;u.style.top="0px";const ht=Math.max(be,ne+N.offsetTop+(Te?Ae:0)+R)+me;u.style.height=ht+"px",N.scrollTop=O-be+N.offsetTop}u.style.margin=`${ji}px 0`,u.style.minHeight=ge+"px",u.style.maxHeight=ae+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[y,o.trigger,o.valueNode,u,x,N,k,E,o.dir,r]);Zn(()=>M(),[M]);const[L,B]=p.useState();Zn(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]);const z=p.useCallback(H=>{H&&w.current===!0&&(M(),P==null||P(),w.current=!1)},[M,P]);return e.jsx(DV,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:z,children:e.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:e.jsx(_t.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});fS.displayName=_V;var IV="SelectPopperPosition",o1=p.forwardRef((s,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=ji,...o}=s,c=Z0(n);return e.jsx(O0,{...c,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});o1.displayName=IV;var[DV,Z2]=sm(ud,{}),c1="SelectViewport",pS=p.forwardRef((s,t)=>{const{__scopeSelect:n,nonce:r,...a}=s,o=cc(c1,n),c=Z2(c1,n),u=Cs(t,o.onViewportChange),h=p.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),e.jsx(H0.Slot,{scope:n,children:e.jsx(_t.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ut(a.onScroll,x=>{const m=x.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const b=Math.abs(h.current-m.scrollTop);if(b>0){const w=window.innerHeight-ji*2,N=parseFloat(g.style.minHeight),k=parseFloat(g.style.height),E=Math.max(N,k);if(E<w){const P=E+b,M=Math.min(w,P),L=P-M;g.style.height=M+"px",g.style.bottom==="0px"&&(m.scrollTop=L>0?L:0,g.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});pS.displayName=c1;var xS="SelectGroup",[OV,FV]=sm(xS),RV=p.forwardRef((s,t)=>{const{__scopeSelect:n,...r}=s,a=xa();return e.jsx(OV,{scope:n,id:a,children:e.jsx(_t.div,{role:"group","aria-labelledby":a,...r,ref:t})})});RV.displayName=xS;var gS="SelectLabel",yS=p.forwardRef((s,t)=>{const{__scopeSelect:n,...r}=s,a=FV(gS,n);return e.jsx(_t.div,{id:a.id,...r,ref:t})});yS.displayName=gS;var Qx="SelectItem",[MV,vS]=sm(Qx),jS=p.forwardRef((s,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...c}=s,u=oc(Qx,n),h=cc(Qx,n),x=u.value===r,[m,g]=p.useState(o??""),[y,b]=p.useState(!1),w=Cs(t,P=>{var M;return(M=h.itemRefCallback)==null?void 0:M.call(h,P,r,a)}),N=xa(),k=p.useRef("touch"),E=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(MV,{scope:n,value:r,disabled:a,textId:N,isSelected:x,onItemTextChange:p.useCallback(P=>{g(M=>M||((P==null?void 0:P.textContent)??"").trim())},[]),children:e.jsx(H0.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:e.jsx(_t.div,{role:"option","aria-labelledby":N,"data-highlighted":y?"":void 0,"aria-selected":x&&y,"data-state":x?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:w,onFocus:ut(c.onFocus,()=>b(!0)),onBlur:ut(c.onBlur,()=>b(!1)),onClick:ut(c.onClick,()=>{k.current!=="mouse"&&E()}),onPointerUp:ut(c.onPointerUp,()=>{k.current==="mouse"&&E()}),onPointerDown:ut(c.onPointerDown,P=>{k.current=P.pointerType}),onPointerMove:ut(c.onPointerMove,P=>{var M;k.current=P.pointerType,a?(M=h.onItemLeave)==null||M.call(h):k.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ut(c.onPointerLeave,P=>{var M;P.currentTarget===document.activeElement&&((M=h.onItemLeave)==null||M.call(h))}),onKeyDown:ut(c.onKeyDown,P=>{var L;((L=h.searchRef)==null?void 0:L.current)!==""&&P.key===" "||(wV.includes(P.key)&&E(),P.key===" "&&P.preventDefault())})})})})});jS.displayName=Qx;var hh="SelectItemText",bS=p.forwardRef((s,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=s,c=oc(hh,n),u=cc(hh,n),h=vS(hh,n),x=kV(hh,n),[m,g]=p.useState(null),y=Cs(t,E=>g(E),h.onItemTextChange,E=>{var P;return(P=u.itemTextRefCallback)==null?void 0:P.call(u,E,h.value,h.disabled)}),b=m==null?void 0:m.textContent,w=p.useMemo(()=>e.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:N,onNativeOptionRemove:k}=x;return Zn(()=>(N(w),()=>k(w)),[N,k,w]),e.jsxs(e.Fragment,{children:[e.jsx(_t.span,{id:h.textId,...o,ref:y}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Qu.createPortal(o.children,c.valueNode):null]})});bS.displayName=hh;var NS="SelectItemIndicator",wS=p.forwardRef((s,t)=>{const{__scopeSelect:n,...r}=s;return vS(NS,n).isSelected?e.jsx(_t.span,{"aria-hidden":!0,...r,ref:t}):null});wS.displayName=NS;var d1="SelectScrollUpButton",AS=p.forwardRef((s,t)=>{const n=cc(d1,s.__scopeSelect),r=Z2(d1,s.__scopeSelect),[a,o]=p.useState(!1),c=Cs(t,r.onScrollButtonChange);return Zn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const x=h.scrollTop>0;o(x)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?e.jsx(SS,{...s,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});AS.displayName=d1;var u1="SelectScrollDownButton",CS=p.forwardRef((s,t)=>{const n=cc(u1,s.__scopeSelect),r=Z2(u1,s.__scopeSelect),[a,o]=p.useState(!1),c=Cs(t,r.onScrollButtonChange);return Zn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const x=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<x;o(m)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?e.jsx(SS,{...s,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});CS.displayName=u1;var SS=p.forwardRef((s,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=s,o=cc("SelectScrollButton",n),c=p.useRef(null),u=G0(n),h=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>h(),[h]),Zn(()=>{var m;const x=u().find(g=>g.ref.current===document.activeElement);(m=x==null?void 0:x.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),e.jsx(_t.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ut(a.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:ut(a.onPointerMove,()=>{var x;(x=o.onItemLeave)==null||x.call(o),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:ut(a.onPointerLeave,()=>{h()})})}),LV="SelectSeparator",kS=p.forwardRef((s,t)=>{const{__scopeSelect:n,...r}=s;return e.jsx(_t.div,{"aria-hidden":!0,...r,ref:t})});kS.displayName=LV;var m1="SelectArrow",VV=p.forwardRef((s,t)=>{const{__scopeSelect:n,...r}=s,a=Z0(n),o=oc(m1,n),c=cc(m1,n);return o.open&&c.position==="popper"?e.jsx(F0,{...a,...r,ref:t}):null});VV.displayName=m1;function $S(s){return s===""||s===void 0}var PS=p.forwardRef((s,t)=>{const{value:n,...r}=s,a=p.useRef(null),o=Cs(t,a),c=G2(n);return p.useEffect(()=>{const u=a.current,h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==n&&m){const g=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(g)}},[c,n]),e.jsx(hf,{asChild:!0,children:e.jsx("select",{...r,ref:o,defaultValue:n})})});PS.displayName="BubbleSelect";function ES(s){const t=vr(s),n=p.useRef(""),r=p.useRef(0),a=p.useCallback(c=>{const u=n.current+c;t(u),function h(x){n.current=x,window.clearTimeout(r.current),x!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}(u)},[t]),o=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function TS(s,t,n){const a=t.length>1&&Array.from(t).every(x=>x===t[0])?t[0]:t,o=n?s.indexOf(n):-1;let c=UV(s,Math.max(o,0));a.length===1&&(c=c.filter(x=>x!==n));const h=c.find(x=>x.textValue.toLowerCase().startsWith(a.toLowerCase()));return h!==n?h:void 0}function UV(s,t){return s.map((n,r)=>s[(t+r)%s.length])}var zV=rS,_S=iS,qV=oS,WV=cS,BV=dS,IS=uS,KV=pS,DS=yS,OS=jS,HV=bS,GV=wS,FS=AS,RS=CS,MS=kS;const St=zV,kt=qV,At=p.forwardRef(({className:s,children:t,...n},r)=>e.jsxs(_S,{ref:r,className:pt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
538ing-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[t,e.jsx(WV,{asChild:!0,children:e.jsx(ac,{className:"h-4 w-4 opacity-50"})})]}));At.displayName=_S.displayName;const LS=p.forwardRef(({className:s,...t},n)=>e.jsx(FS,{ref:n,className:pt("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(pf,{className:"h-4 w-4"})}));LS.displayName=FS.displayName;const VS=p.forwardRef(({className:s,...t},n)=>e.jsx(RS,{ref:n,className:pt("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ac,{className:"h-4 w-4"})}));VS.displayName=RS.displayName;const Ct=p.forwardRef(({className:s,children:t,position:n="popper",...r},a)=>e.jsx(BV,{children:e.jsxs(IS,{ref:a,className:pt("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...r,children:[e.jsx(LS,{}),e.jsx(KV,{className:pt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(VS,{})]})}));Ct.displayName=IS.displayName;const ZV=p.forwardRef(({className:s,...t},n)=>e.jsx(DS,{ref:n,className:pt("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...t}));ZV.displayName=DS.displayName;const ce=p.forwardRef(({className:s,children:t,...n},r)=>e.jsxs(OS,{ref:r,className:pt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(GV,{children:e.jsx(j2,{className:"h-4 w-4"})})}),e.jsx(HV,{children:t})]}));ce.displayName=OS.displayName;const YV=p.forwardRef(({className:s,...t},n)=>e.jsx(MS,{ref:n,className:pt("-mx-1 my-1 h-px bg-muted",s),...t}));YV.displayName=MS.displayName;var Y2="Collapsible",[QV,US]=or(Y2),[XV,Q2]=QV(Y2),zS=p.forwardRef((s,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:c,...u}=s,[h=!1,x]=ga({prop:r,defaultProp:a,onChange:c});return e.jsx(XV,{scope:n,disabled:o,contentId:xa(),open:h,onOpenToggle:p.useCallback(()=>x(m=>!m),[x]),children:e.jsx(_t.div,{"data-state":tj(h),"data-disabled":o?"":void 0,...u,ref:t})})});zS.displayName=Y2;var qS="CollapsibleTrigger",X2=p.forwardRef((s,t)=>{const{__scopeCollapsible:n,...r}=s,a=Q2(qS,n);return e.jsx(_t.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":tj(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:ut(s.onClick,a.onOpenToggle)})});X2.displayName=qS;var J2="CollapsibleContent",ej=p.forwardRef((s,t)=>{const{forceMount:n,...r}=s,a=Q2(J2,s.__scopeCollapsible);return e.jsx(ea,{present:n||a.open,children:({present:o})=>e.jsx(JV,{...r,ref:t,present:o})})});ej.displayName=J2;var JV=p.forwardRef((s,t)=>{const{__scopeCollapsible:n,present:r,children:a,...o}=s,c=Q2(J2,n),[u,h]=p.useState(r),x=p.useRef(null),m=Cs(t,x),g=p.useRef(0),y=g.current,b=p.useRef(0),w=b.current,N=c.open||u,k=p.useRef(N),E=p.useRef(void 0);return p.useEffect(()=>{const P=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(P)},[]),Zn(()=>{const P=x.current;if(P){E.current=E.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";const M=P.getBoundingClientRect();g.current=M.height,b.current=M.width,k.current||(P.style.transitionDuration=E.current.transitionDuration,P.style.animationName=E.current.animationName),h(r)}}
538,[c.open,r]),e.jsx(_t.div,{"data-state":tj(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!N,...o,ref:m,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...s.style},children:N&&a})});function tj(s){return s?"open":"closed"}var WS=zS,eU=X2,tU=ej;const sj=WS,BS=X2,nj=ej;var sU="Separator",MN="horizontal",nU=["horizontal","vertical"],KS=p.forwardRef((s,t)=>{const{decorative:n,orientation:r=MN,...a}=s,o=rU(r)?r:MN,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return e.jsx(_t.div,{"data-orientation":o,...u,...a,ref:t})});KS.displayName=sU;function rU(s){return nU.includes(s)}var HS=KS;const gu=p.forwardRef(({className:s,orientation:t="horizontal",decorative:n=!0,...r},a)=>e.jsx(HS,{ref:a,decorative:n,orientation:t,className:pt("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...r}));gu.displayName=HS.displayName;const Pt=p.forwardRef(({className:s,...t},n)=>e.jsx("textarea",{className:pt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:n,...t}));Pt.displayName="Textarea";var rj="Checkbox",[aU]=or(rj),[iU,lU]=aU(rj),GS=p.forwardRef((s,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:c,disabled:u,value:h="on",onCheckedChange:x,form:m,...g}=s,[y,b]=p.useState(null),w=Cs(t,L=>b(L)),N=p.useRef(!1),k=y?m||!!y.closest("form"):!0,[E=!1,P]=ga({prop:a,defaultProp:o,onChange:x}),M=p.useRef(E);return p.useEffect(()=>{const L=y==null?void 0:y.form;if(L){const B=()=>P(M.current);return L.addEventListener("reset",B),()=>L.removeEventListener("reset",B)}},[y,P]),e.jsxs(iU,{scope:n,state:E,disabled:u,children:[e.jsx(_t.button,{type:"button",role:"checkbox","aria-checked":Ho(E)?"mixed":E,"aria-required":c,"data-state":QS(E),"data-disabled":u?"":void 0,disabled:u,value:h,...g,ref:w,onKeyDown:ut(s.onKeyDown,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:ut(s.onClick,L=>{P(B=>Ho(B)?!0:!B),k&&(N.current=L.isPropagationStopped(),N.current||L.stopPropagation())})}),k&&e.jsx(oU,{control:y,bubbles:!N.current,name:r,value:h,checked:E,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Ho(o)?!1:o})]})});GS.displayName=rj;var ZS="CheckboxIndicator",YS=p.forwardRef((s,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=s,o=lU(ZS,n);return e.jsx(ea,{present:r||Ho(o.state)||o.state===!0,children:e.jsx(_t.span,{"data-state":QS(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...s.style}})})});YS.displayName=ZS;var oU=s=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=s,c=p.useRef(null),u=G2(n),h=T2(t);p.useEffect(()=>{const m=c.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&b){const w=new Event("click",{bubbles:r});m.indeterminate=Ho(n),b.call(m,Ho(n)?!1:n),m.dispatchEvent(w)}},[u,n,r]);const x=p.useRef(Ho(n)?!1:n);return e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,...o,tabIndex:-1,ref:c,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ho(s){return s==="indeterminate"}function QS(s){return Ho(s)?"indeterminate":s?"checked":"unchecked"}var XS=GS,cU=YS;const Gs=p.forwardRef(({className:s,...t},n)=>e.jsx(XS,{ref:n,className:pt("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...t,children:e.jsx(cU,{className:pt("flex items-center justify-center text-current"),children:e.jsx(j2,{className:"h-4 w-4"})})}));Gs.displayName=XS.displayName;function dU({student:s,uploaderName:t,showDeleteButton:n=!0}){const[r,a]=p.useState(!1),[o,c]=p.useState(s.photoUrl),[u,h]=p.useState({uploadedBy:s.photoUploadedBy,uploadedDate:s.photoUploadedDate}),x=dn(),{toast:m}=Is(),g=bt({mutationFn:async k=>{const E=new FormData;E.append("photo",k),E.append("uploadedBy",t);const P=await fetch(`/api/students/${s.id}/photo`,{method:"POST",body:E});if(!P.ok){const M=await P.json();throw new Error(M.message||"Failed to upload photo")}return P.json()},onSuccess:k=>{c(k.photoUrl),h({uploadedBy:t,uploadedDate:new Date().toISOString()}),x.invalidateQueries({queryKey:["/api/families"]}),x.invalidateQueries({queryKey:["/api/students-with-families"]}),m({title:"Success",description:"Photo uploaded successfully!"}),a(!1)},onError:k=>{m({title:"Error",description:k.message||"Failed to upload photo",variant:"destructive"}),a(!1)}}),y=bt({mutationFn:async()=>{const k=await fetch(`/api/students/${s.id}/photo`,{method:"DELETE"});if(!k.ok){const E=await k.json();throw new Error(E.message||"Failed to delete photo")}return k.json()},onSuccess:()=>{c(null),h({uploadedBy:null,uploadedDate:null}),x.invalidateQueries({queryKey:["/api/families"]}),x.invalidateQueries({queryKey:["/api/students-with-families"]}),m({title:"Success",description:"Photo removed successfully!"})},onError:k=>{m({title:"Error",description:k.message||"Failed to delete photo",variant:"destructive"})}}),b=k=>{var P;const E=(P=k.target.files)==null?void 0:P[0];if(E){if(E.size>5*1024*1024){m({title:"File too large",description:"Please select a photo smaller than 5MB",variant:"destructive"});return}if(!E.type.startsWith("image/")){m({title:"Invalid file type",description:"Please select an image file",variant:"destructive"});return}a(!0),g.mutate(E)}},w=()=>{confirm(`Remove photo for ${s.name}?`)&&y.mutate()},N=k=>k.split(" ").map(E=>E[0]).join("").toUpperCase();return e.jsx(Ce,{className:"w-full max-w-sm",children:e.jsx(Se,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(Ph,{className:"w-24 h-24",children:[e.jsx(Eh,{src:o||void 0,alt:`${s.name}
538's photo`}),e.jsx(Th,{className:"text-lg bg-blue-100 text-blue-600",children:N(s.name)})]}),!o&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 bg-opacity-75 rounded-full",children:e.jsx(zx,{className:"w-8 h-8 text-gray-400"})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h4",{className:"font-medium",children:s.name}),u.uploadedBy&&e.jsxs("p",{className:"text-sm text-gray-500",children:["Photo by ",u.uploadedBy,u.uploadedDate&&e.jsx("span",{className:"block",children:new Date(u.uploadedDate).toLocaleDateString()})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(F,{variant:"outline",size:"sm",disabled:r||g.isPending,onClick:()=>{var k;return(k=document.getElementById(`photo-input-${s.id}`))==null?void 0:k.click()},children:[e.jsx(gr,{className:"w-4 h-4 mr-2"}),o?"Change Photo":"Upload Photo"]}),o&&n&&e.jsx(F,{variant:"outline",size:"sm",disabled:y.isPending,onClick:w,children:e.jsx(pa,{className:"w-4 h-4"})})]}),e.jsx("input",{id:`photo-input-${s.id}`,type:"file",accept:"image/*",onChange:b,className:"hidden"}),r&&e.jsx("div",{className:"text-sm text-gray-500",children:"Uploading..."})]})})})}function h1(){var _e,Le,A,D,ie,$e,ke;const[s,t]=p.useState(""),[n,r]=p.useState(!1),[a,o]=p.useState("all"),[c,u]=p.useState(new Set),[h,x]=p.useState(null),[m,g]=p.useState({}),[y,b]=p.useState(!1),[w,N]=p.useState(null),[k,E]=p.useState(null),[P,M]=p.useState(null),[L,B]=p.useState(null),[z,H]=p.useState(""),T=dn(),{toast:U}=Is(),{data:_,isLoading:se}=nt({queryKey:["/api/students-with-families"],enabled:!0}),{data:ae}=nt({queryKey:["/api/families-without-students"],enabled:!0}),{data:W}=nt({queryKey:["/api/class-enrollments"],enabled:!0}),{data:J}=nt({queryKey:["/api/payments"],enabled:!0}),{data:ne}=nt({queryKey:["/api/ahern-academy-applications",P],enabled:P!==null}),le=bt({mutationFn:S=>st("PUT",`/api/students/${S.id}`,{archived:S.archived}),onSuccess:()=>{T.invalidateQueries({queryKey:["/api/students-with-families"]}),U({title:"Student Updated",description:"Student archive status updated successfully."})}}),V=bt({mutationFn:({studentId:S,data:ve})=>st("PUT",`/api/students/${S}`,ve),onSuccess:()=>{T.invalidateQueries({queryKey:["/api/students-with-families"]}
538),T.invalidateQueries({queryKey:["/api/families"]}),T.invalidateQueries({queryKey:["/api/dashboard/stats"]}),T.invalidateQueries({queryKey:["/api/portal/family"]}),x(null),g({}),U({title:"Student Updated",description:"Student information updated successfully."})}}),Z=bt({mutationFn:({familyId:S,data:ve})=>st("PUT",`/api/families/${S}`,ve),onSuccess:()=>{T.invalidateQueries({queryKey:["/api/students-with-families"]}),T.invalidateQueries({queryKey:["/api/families"]}),T.invalidateQueries({queryKey:["/api/dashboard/stats"]}),T.invalidateQueries({queryKey:["/api/portal/family"]}),U({title:"Family Updated",description:"Family information updated successfully."})}}),ue=bt({mutationFn:({studentId:S,notes:ve,noteType:Ze})=>{const Qe=Ze==="administrative"?{administrativeNotes:ve}:{educationalNotes:ve};return st("PUT",`/api/students/${S}`,Qe)},onSuccess:()=>{T.invalidateQueries({queryKey:["/api/students-with-families"]}),E(null),U({title:"Notes Updated",description:"Student notes updated successfully."})}}),ge=bt({mutationFn:({applicationId:S,rejectionReason:ve})=>st("PATCH",`/api/ahern-academy-applications/${S}/reject`,{rejectionReason:ve}),onSuccess:()=>{T.invalidateQueries({queryKey:["/api/students-with-families"]}
538),B(null),H(""),U({title:"Application Rejected",description:"Application has been rejected and family has been notified."})},onError:S=>{U({title:"Error",description:S.message||"Failed to reject application",variant:"destructive"})}}),G=bt({mutationFn:async S=>{console.log("Creating student with data:",S);const ve=await st("POST","/api/students",S);if(!ve.ok){const Ze=await ve.json();throw new Error(Ze.message||"Failed to create student")}return ve.json()},onSuccess:S=>{console.log("Student created successfully:",S),T.invalidateQueries({queryKey:["/api/students-with-families"]}),T.invalidateQueries({queryKey:["/api/families-without-students"]}),T.refetchQueries({queryKey:["/api/students-with-families"]}),b(!1),g({}),U({title:"Student Created",description:"New student added successfully."})},onError:S=>{console.error("Error creating student:",S);let ve="Failed to create student";S.message.includes("already exists in this family")?ve="A student with this name already exists in this family":S.message.includes("primary key conflict")?ve="Database conflict - please try again":S.message.includes("Invalid family ID")?ve="Family must be created first":S.message&&(ve=S.message),U({title:"Error",description:ve,variant:"destructive"})}}),Ae=bt({mutationFn:async S=>{const ve=await st("DELETE",`/api/families/${S}`);if(!ve.ok){const Ze=await ve.json();throw new Error(Ze.message||"Failed to delete family")}return ve.json()},onSuccess:()=>{T.invalidateQueries({queryKey:["/api/families-without-students"]}
538),T.invalidateQueries({queryKey:["/api/students-with-families"]}),U({title:"Family Deleted",description:"The family has been successfully removed from the system."})},onError:S=>{console.error("Family deletion failed:",S),U({title:"Deletion Failed",description:S.message||"Failed to delete family. Please try again.",variant:"destructive"})}}),Fe=bt({mutationFn:async S=>{console.log("Creating family with data:",S);const ve=await st("POST","/api/families",S);if(!ve.ok){const Ze=await ve.json();throw new Error(Ze.message||"Failed to create family")}return ve.json()},onSuccess:S=>{console.log("Family created successfully:",S),T.invalidateQueries({queryKey:["/api/students-with-families"]}),U({title:"Family Created",description:"New family created successfully."})},onError:S=>{console.error("Error creating family:",S);let ve="Failed to create family";S.message.includes("email already exists")?ve="A family with this email already exists":S.message.includes("primary key conflict")?ve="Database conflict - please try again":S.message&&(ve=S.message),U({title:"Error",description:ve,variant:"destructive"})}}),be=Array.isArray(_)?_:[],Me=S=>{if(!S)return"";const Ze=S.replace(/\s*\([^)]*\)\s*/g,"").trim().split(/\s+/);return Ze[Ze.length-1]||""},R=be.filter(S=>{var ct,It,Zs,Zt,qn,xn,un;const ve=s.toLowerCase(),Ze=S.name.toLowerCase().includes(ve)||((It=(ct=S.family)==null?void 0:ct.caregiverOneName)==null?void 0:It.toLowerCase().includes(ve))||((Zt=(Zs=S.family)==null?void 0:Zs.email)==null?void 0:Zt.toLowerCase().includes(ve))||(((qn=S.family)==null?void 0:qn.caregiverOneEmail)??"").toLowerCase().includes(ve)||(((xn=S.family)==null?void 0:xn.caregiverTwoEmail)??"").toLowerCase().includes(ve)||(((un=S.family)==null?void 0:un.caregiverThreeEmail)??"").toLowerCase().includes(ve),Qe=n||!S.archived;return Ze&&Qe}).sort((S,ve)=>{const Ze=Me(S.name).toLowerCase(),Qe=Me(ve.name).toLowerCase();return Ze.localeCompare(Qe)}),re=S=>{const ve=new Set(c);ve.has(S)?ve.delete(S):ve.add(S),u(ve)},O=S=>{le.mutate({id:S.id,archived:!S.archived})},me=S=>{var ve,Ze,Qe,ct,It,Zs,Zt,qn,xn,un,Rt,Os,vs;x(S),g({name:S.name||"",nicknames:S.nicknames||"",birthday:S.birthday||"",age:S.age||"",gradeEquivalent:S.gradeEquivalent||"",streetAddress:S.streetAddress||"",city:S.city||"",state:S.state||"",country:S.country||"",postalCode:S.postalCode||"",diagnosis:S.diagnosis||"",currentAacSystems:Array.isArray(S.currentAacSystems)?S.currentAacSystems.join(", "):"",accommodations:Array.isArray(S.accommodations)?S.accommodations.join(", "):"",studentCategories:S.studentCategories||[],openEnrollmentClasses:S.openEnrollmentClasses||1,contractSigned:S.contractSigned||!1,photoPermissionSigned:S.photoPermissionSigned||!1,oneOnOneApproved:S.oneOnOneApproved||!1,ahernAcademyApproved:S.ahernAcademyApproved||!1,specialInterests:S.specialInterests||"",calmingStrategies:S.calmingStrategies||"",upsetTriggers:S.upsetTriggers||"",alphabetAccess:S.alphabetAccess||"",yesNoMethod:S.yesNoMethod||"",aacProficiency:S.aacProficiency||"",ahernLiteracyClass:S.ahernLiteracyClass||"",ahernMathClass:S.ahernMathClass||"",caregiverOneName:((ve=S.family)==null?void 0:ve.caregiverOneName)||"",caregiverOneEmail:((Ze=S.family)==null?void 0:Ze.caregiverOneEmail)||"",caregiverOnePhone:((Qe=S.family)==null?void 0:Qe.caregiverOnePhone)||"",caregiverTwoName:((ct=S.family)==null?void 0:ct.caregiverTwoName)||"",caregiverTwoEmail:((It=S.family)==null?void 0:It.caregiverTwoEmail)||"",caregiverTwoPhone:((Zs=S.family)==null?void 0:Zs.caregiverTwoPhone)||"",paymentPreference:((Zt=S.family)==null?void 0:Zt.paymentPreference)||"monthly",paymentMethod:((qn=S.family)==null?void 0:qn.paymentMethod)||"family",scholarshipPercentage:((xn=S.family)==null?void 0:xn.scholarshipPercentage)||0,scholarshipInfo:((un=S.family)==null?void 0:un.scholarshipInfo)||"",thirdPartyPayerName:((Rt=S.family)==null?void 0:Rt.thirdPartyPayerName)||"",thirdPartyContact:((Os=S.family)==null?void 0:Os.thirdPartyContact)||"",contractExemption:((vs=S.family)==null?void 0:vs.contractExemption)||!1})},Y=()=>{var Ze;if(!h)return;const S={name:m.name,nicknames:m.nicknames,birthday:m.birthday,age:parseInt(m.age)||null,gradeEquivalent:m.gradeEquivalent,streetAddress:m.streetAddress,city:m.city,state:m.state,country:m.country,postalCode:m.postalCode,diagnosis:m.diagnosis,currentAacSystems:m.currentAacSystems?m.currentAacSystems.split(",").map(Qe=>
538Qe.trim()).filter(Boolean):[],accommodations:m.accommodations?m.accommodations.split(",").map(Qe=>Qe.trim()).filter(Boolean):[],studentCategories:m.studentCategories,openEnrollmentClasses:parseInt(m.openEnrollmentClasses)||1,contractSigned:m.contractSigned,photoPermissionSigned:m.photoPermissionSigned,oneOnOneApproved:m.oneOnOneApproved,ahernAcademyApproved:m.ahernAcademyApproved,specialInterests:m.specialInterests,calmingStrategies:m.calmingStrategies,upsetTriggers:m.upsetTriggers,alphabetAccess:m.alphabetAccess,yesNoMethod:m.yesNoMethod,aacProficiency:m.aacProficiency,ahernLiteracyClass:m.ahernLiteracyClass,ahernMathClass:m.ahernMathClass},ve={caregiverOneName:m.caregiverOneName,caregiverOneEmail:m.caregiverOneEmail,caregiverOnePhone:m.caregiverOnePhone,caregiverTwoName:m.caregiverTwoName,caregiverTwoEmail:m.caregiverTwoEmail,caregiverTwoPhone:m.caregiverTwoPhone,paymentPreference:m.paymentPreference,paymentMethod:m.paymentMethod,scholarshipPercentage:parseInt(m.scholarshipPercentage)||0,scholarshipInfo:m.scholarshipInfo,thirdPartyPayerName:m.thirdPartyPayerName,thirdPartyContact:m.thirdPartyContact,contractExemption:m.contractExemption||!1};V.mutate({studentId:h.id,data:S}),(Ze=h.family)!=null&&Ze.id&&Z.mutate({familyId:h.family.id,data:ve})},Te=()=>{x(null),g({})},Be=()=>{b(!0),g({name:"",nicknames:"",birthday:"",age:"",gradeEquivalent:"",streetAddress:"",city:"",state:"",country:"",postalCode:"",diagnosis:"",currentAacSystems:"",accommodations:"",studentCategories:[],openEnrollmentClasses:1,contractSigned:!1,photoPermissionSigned:!1,specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",caregiverOneName:"",caregiverOneEmail:"",caregiverOnePhone:"",caregiverTwoName:"",caregiverTwoEmail:"",caregiverTwoPhone:"",paymentPreference:"monthly",paymentMethod:"family",scholarshipPercentage:0,scholarshipInfo:"",thirdPartyPayerName:"",thirdPartyContact:"",email:""})},ht=()=>{if(console.log("Starting student creation process..."),console.log("Current form data:",m),!m.name){U({title:"Validation Error",description:"Student name is required",variant:"destructive"});return}if(!m.email&&!m.caregiverOneEmail){U({title:"Validation Error",description:"Family email is required",variant:"destructive"});return}if(m.existingFamilyId){console.log("Adding student to existing family ID:",m.existingFamilyId);const ve={name:m.name,nicknames:m.nicknames||"",birthday:m.birthday||null,age:m.age?parseInt(m.age):null,gradeEquivalent:m.gradeEquivalent||"",streetAddress:m.streetAddress||"",city:m.city||"",state:m.state||"",country:m.country||"",postalCode:m.postalCode||"",diagnosis:m.diagnosis||"",currentAacSystems:m.currentAacSystems?m.currentAacSystems.split(",").map(Ze=>Ze.trim()).filter(Boolean):[],accommodations:m.accommodations?m.accommodations.split(",").map(Ze=>Ze.trim()).filter(Boolean):[],studentCategories:m.studentCategories||[],openEnrollmentClasses:m.openEnrollmentClasses?parseInt(m.openEnrollmentClasses):1,contractSigned:m.contractSigned||!1,photoPermissionSigned:m.photoPermissionSigned||!1,specialInterests:m.specialInterests||"",calmingStrategies:m.calmingStrategies||"",upsetTriggers:m.upsetTriggers||"",alphabetAccess:m.alphabetAccess||"",yesNoMethod:m.yesNoMethod||"",aacProficiency:m.aacProficiency||"",familyId:m.existingFamilyId};console.log("About to create student with data:",ve),G.mutate(ve);return}const S={email:m.email||m.caregiverOneEmail,caregiverOneName:m.caregiverOneName||"Parent/Caregiver",caregiverOneEmail:m.caregiverOneEmail||m.email,caregiverOnePhone:m.caregiverOnePhone||"",caregiverTwoName:m.caregiverTwoName||"",caregiverTwoEmail:m.caregiverTwoEmail||"",caregiverTwoPhone:m.caregiverTwoPhone||"",paymentPreference:m.paymentPreference||"monthly",paymentMethod:m.paymentMethod||"family",scholarshipPercentage:m.scholarshipPercentage?parseInt(m.scholarshipPercentage):0,scholarshipInfo:m.scholarshipInfo||"",thirdPartyPayerName:m.thirdPartyPayerName||"",thirdPartyContact:m.thirdPartyContact||"",contractExemption:m.contractExemption||!1};console.log("About to create family with data:",S),Fe.mutate(S,{onSuccess:ve=>{console.log("Family creation successful, now creating student..."),console.log("Family created:",ve);const Ze={name:m.name,nicknames:m.nicknames||"",birthday:m.birthday||null,age:m.age?parseInt(m.age):null,gradeEquivalent:m.gradeEquivalent||"",streetAddress:m.streetAddress||"",city:m.city||"",state:m.state||"",country:m.country||"",postalCode:m.postalCode||"",diagnosis:m.diagnosis||"",currentAacSystems:m.currentAacSystems?m.currentAacSystems.split(",").map(Qe=>
538Qe.trim()).filter(Boolean):[],accommodations:m.accommodations?m.accommodations.split(",").map(Qe=>Qe.trim()).filter(Boolean):[],studentCategories:m.studentCategories||[],openEnrollmentClasses:m.openEnrollmentClasses?parseInt(m.openEnrollmentClasses):1,contractSigned:m.contractSigned||!1,photoPermissionSigned:m.photoPermissionSigned||!1,specialInterests:m.specialInterests||"",calmingStrategies:m.calmingStrategies||"",upsetTriggers:m.upsetTriggers||"",alphabetAccess:m.alphabetAccess||"",yesNoMethod:m.yesNoMethod||"",aacProficiency:m.aacProficiency||"",familyId:ve.id};console.log("About to create student with data:",Ze),G.mutate(Ze)},onError:ve=>{console.error("Family creation failed:",ve)}})},Mt=()=>{b(!1),g({})},$=S=>S.split(" ").map(ve=>ve[0]).join("").toUpperCase(),K=S=>[S.streetAddress,S.city,S.state,S.country,S.postalCode].filter(Boolean).join(", ")||"No address provided",xe=S=>{if(!S)return null;let ve;if(typeof S=="string")if(S.includes("-")){const[It,Zs,Zt]=S.split("-").map(Number);ve=new Date(It,Zs-1,Zt)}else ve=new Date(S);else ve=new Date(S);if(isNaN(ve.getTime()))return null;const Ze=new Date;let Qe=Ze.getFullYear()-ve.getFullYear();const ct=Ze.getMonth()-ve.getMonth();return(ct<0||ct===0&&Ze.getDate()<ve.getDate())&&Qe--,Qe},De=S=>!S||S<3?"PreK":{3:"PreK-3",4:"PreK-4",5:"Kindergarten",6:"1st Grade",7:"2nd Grade",8:"3rd Grade",9:"4th Grade",10:"5th Grade",11:"6th Grade",12:"7th Grade",13:"8th Grade",14:"9th Grade",15:"10th Grade",16:"11th Grade",17:"12th Grade",18:"12th Grade+"}[S]||(S>18?"Adult":"12th Grade+"),X=S=>{if(!S.family||!Array.isArray(J))return{totalDue:0,totalPaid:0,currentBalance:0};const Ze=J.filter(Qe=>Qe.familyId===S.familyId).reduce((Qe,ct)=>{const It=parseFloat(ct.amount)||0;return ct.status==="paid"?Qe.totalPaid+=It:ct.status==="pending"&&(Qe.totalDue+=It),Qe},{totalDue:0,totalPaid:0,currentBalance:0});return Ze.currentBalance=Ze.totalDue-Ze.totalPaid,Ze};return se?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-64 bg-gray-200 rounded animate-pulse"})]}):e.jsxs("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:"Student Management"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Manage students and caregiver information"})]}),e.jsxs(F,{onClick:Be,className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-white font-medium h-11 shadow-md transition-all",children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Add Student"]})]})}),e.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Bl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4"}),e.jsx(je,{placeholder:"Search students by name, caregiver name, or any caregiver email...",value:s,onChange:S=>t(S.target.value),className:"pl-10 border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A]"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs(St,{value:a,onValueChange:o,children:[e.jsx(At,{className:"w-40 border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 h-11",children:e.jsx(kt,{placeholder:"Filter view"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Information"}),e.jsx(ce,{value:"biographical",children:"Biographical"}),e.jsx(ce,{value:"educational",children:"Educational"}),e.jsx(ce,{value:"financial",children:"Financial"})]})]}),e.jsxs(F,{variant:"outline",onClick:()=>r(!n),className:"border-[#feea6a] text-[#4A4A4A] hover:bg-[#feea6a]/10 h-11",children:[n?e.jsx(nd,{className:"h-4 w-4 mr-1"}):e.jsx(Ea,{className:"h-4 w-4 mr-1"}),n?"Hide Archived":"Show Archived"]})]})]}),be&&be.filter(S=>S.ahernAcademyApplicationSubmitted&&!S.ahernAcademyApproved&&!S.archived).length>0&&e.jsxs(Ce,{className:"border-purple-300 bg-purple-50 mb-6",children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"text-purple-900 flex items-center gap-2",children:[e.jsx(ar,{className:"h-5 w-5"}),"Pending Ahern Academy Applications (",be.filter(S=>S.ahernAcademyApplicationSubmitted&&!S.ahernAcademyApproved&&!S.archived).length,")"]}),e.jsx("p",{className:"text-purple-700 text-sm",children:"These students have submitted Ahern Academy applications and are awaiting your approval. Click to review and approve/deny."})]}),e.jsx(Se,{children:e.jsx("div",{className:"grid gap-2",children:be.filter(S=>S.ahernAcademyApplicationSubmitted&&!S.ahernAcademyApproved&&!S.archived).map(S=>{var ve,Ze;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded border border-purple-200",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-lg",children:S.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Family: ",(ve=S.family)==null?void 0:ve.caregiverOneName," (",(Ze=S.family)==null?void 0:Ze.email,")"]}),S.age&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Age: ",S.age]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{const Qe=be.find(ct=>ct.id===S.id);Qe&&me(Qe)},children:[e.jsx(Ea,{className:"h-4 w-4 mr-1"}),"Review Application"]}),e.jsxs(F,{size:"sm",variant:"outline",className:"border-red-300 text-red-700 hover:bg-red-50",onClick:async()=>{const{data:Qe}=await T.fetchQuery({queryKey:["/api/ahern-academy-applications",S.id]});Qe&&B({studentId:S.id,studentName:S.name,applicationId:Qe.id})},children:[e.jsx(P0,{className:"h-4 w-4 mr-1"}),"Reject"]}),e.jsxs(F,{size:"sm",className:"bg-green-600 hover:bg-green-700 text-white",onClick:async()=>{try{await st("PUT",`/api/students/${S.id}`,{ahernAcademyApproved:!0,studentCategories:[...S.studentCategories||[],"Ahern Academy"].filter((Qe,ct,It)=>It.indexOf(Qe)===ct)}
538),U({title:"Application Approved",description:`${S.name} has been approved for Ahern Academy enrollment.`}),T.invalidateQueries({queryKey:["/api/students"]})}catch(Qe){U({title:"Error",description:Qe.message||"Failed to approve application",variant:"destructive"})}},children:[e.jsx(As,{className:"h-4 w-4 mr-1"}),"Approve"]})]})]},S.id)})})})]}),ae&&ae.length>0&&e.jsxs(Ce,{className:"border-orange-200 bg-orange-50",children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"text-orange-800 flex items-center gap-2",children:[e.jsx(rl,{className:"h-5 w-5"}),"Families Missing Students (",ae.length,")"]}),e.jsx("p",{className:"text-orange-700 text-sm",children:`These families are registered but don't have student profiles yet. Click "Add Student" to create their student information.`})]}),e.jsx(Se,{children:e.jsx("div",{className:"grid gap-2",children:ae.map(S=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:S.caregiverOneName}),S.caregiverTwoName&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["& ",S.caregiverTwoName]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:S.email})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(F,{size:"sm",onClick:()=>{g({caregiverOneName:S.caregiverOneName,caregiverTwoName:S.caregiverTwoName||"",email:S.email,name:"",nicknames:"",birthday:"",age:"",gradeEquivalent:"",streetAddress:"",city:"",state:"",country:"",postalCode:"",diagnosis:"",currentAacSystems:"",accommodations:"",studentCategories:[],openEnrollmentClasses:1,contractSigned:!1,photoPermissionSigned:!1,specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",caregiverOneEmail:S.email,caregiverOnePhone:"",caregiverThreeName:"",caregiverThreeEmail:"",caregiverThreePhone:"",paymentPreference:"monthly",paymentMethod:"family",scholarshipPercentage:0,scholarshipInfo:"",thirdPartyPayerName:"",thirdPartyContact:"",existingFamilyId:S.id}),b(!0)},className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-[#4A4A4A] font-medium",children:[e.jsx(fa,{className:"h-4 w-4 mr-1"}),"Add Student"]}),e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{confirm(`Are you sure you want to delete ${S.caregiverOneName}? This action cannot be undone.`)&&Ae.mutate(S.id)},disabled:Ae.isPending,className:"border-red-300 text-red-600 hover:bg-red-50 hover:text-red-700 hover:border-red-400",children:[e.jsx(pa,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]},S.id))})})]}),e.jsx("div",{className:"grid gap-4",children:R.length===0?e.jsx(Ce,{children:e.jsx(Se,{className:"p-8 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"No students found matching your criteria."})})}):R.map(S=>{var Qe,ct,It,Zs,Zt,qn,xn,un,Rt,Os,vs,cs,Ts,mn;const ve=c.has(S.id),Ze=X(S);return e.jsxs(Ce,{className:`relative ${S.archived?"opacity-50":""}`,children:[S.archived&&e.jsx(we,{className:"absolute top-2 right-2 bg-red-100 text-red-800",children:"ARCHIVED"}),e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(Ph,{className:"h-12 w-12",children:[e.jsx(Eh,{src:S.photoUrl}),e.jsx(Th,{children:$(S.name)})]}),e.jsx(F,{onClick:()=>N(S),size:"sm",className:"absolute -bottom-1 -right-1 h-6 w-6 rounded-full p-0",children:e.jsx(zx,{className:"h-3 w-3"})})]}),e.jsxs("div",{children:[e.jsx(Ue,{className:"text-lg",children:S.name}),S.nicknames&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:['"',S.nicknames,'"']}),e.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(Qe=S.studentCategories)==null?void 0:Qe.map(ds=>e.jsx(we,{variant:"secondary",className:"text-xs",children:ds},ds)),(((ct=S.family)==null?void 0:ct.scholarshipPercentage)||0)>0&&e.jsxs(we,{className:"bg-green-100 text-green-800 text-xs",children:[S.family.scholarshipPercentage,"% Scholarship"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>re(S.id),children:ve?e.jsx(pf,{className:"h-4 w-4"}):e.jsx(ac,{className:"h-4 w-4"})}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>me(S),className:"bg-white/80 hover:bg-white border border-white/50 shadow-sm text-gray-700 hover:text-gray-900","data-testid":`button-edit-student-${S.id}`,children:e.jsx(Zr,{className:"h-4 w-4"})}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>O(S),className:"bg-white/80 hover:bg-white border border-white/50 shadow-sm text-gray-700 hover:text-gray-900",children:e.jsx(Wo,{className:"h-4 w-4"})})]})]})}),e.jsx(sj,{open:ve,children:e.jsx(nj,{children:e.jsx(Se,{className:"p-4 md:p-6 bg-gray-50/50",children:e.jsxs("div",{className:"grid gap-4 md:gap-6 md:grid-cols-2 lg:grid-cols-3",children:[(a==="all"||a==="biographical")&&e.jsxs("div",{className:"p-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl border border-blue-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(ti,{className:"h-4 w-4",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Biographical"})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[S.birthday&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Birthday:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:new Date(S.birthday).toLocaleDateString()})]}),(()=>{const ds=S.birthday?xe(S.birthday):S.age,ms=S.gradeEquivalent||(ds?De(ds):null);return e.jsxs(e.Fragment,{children:[ds&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Age:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:ds})]}),ms&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Grade:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:ms})]})]})})(),e.jsxs("div",{className:"pt-2 border-t border-blue-200",children:[e.jsx("span",{className:"font-medium block mb-1",style:{color:"#4A4A4A"},children:"Address:"}),e.jsx("div",{className:"text-xs",style:{color:"#4A4A4A"},children:K(S)})]}),S.enrollmentDate&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Enrollment:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:new Date(S.enrollmentDate).toLocaleDateString()})]}),((It=S.family)==null?void 0:It.timeZone)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Time Zone:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:S.family.timeZone})]})]}),e.jsxs("div",{className:"mt-4 pt-3 border-t border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-2",style:{color:"#4A4A4A"},children:"Primary Caregiver"}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsx("div",{className:"font-medium",style:{color:"#4A4A4A"},children:(Zs=S.family)==null?void 0:Zs.caregiverOneName}),((Zt=S.family)==null?void 0:Zt.caregiverOneEmail)&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverOneEmail}),((qn=S.family)==null?void 0:qn.caregiverOnePhone)&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverOnePhone})]})]}),((xn=S.family)==null?void 0:xn.caregiverTwoName)&&e.jsxs("div",{className:"mt-3 pt-2 border-t border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-2",style:{color:"#4A4A4A"},children:"Secondary Caregiver"}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsx("div",{className:"font-medium",style:{color:"#4A4A4A"},children:S.family.caregiverTwoName}),S.family.caregiverTwoEmail&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverTwoEmail}),S.family.caregiverTwoPhone&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverTwoPhone})]})]}),((un=S.family)==null?void 0:un.caregiverThreeName)&&e.jsxs("div",{className:"mt-3 pt-2 border-t border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-2",style:{color:"#4A4A4A"},children:"Third Caregiver"}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsx("div",{className:"font-medium",style:{color:"#4A4A4A"},children:S.family.caregiverThreeName}),S.family.caregiverThreeEmail&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverThreeEmail}),S.family.caregiverThreePhone&&e.jsx("div",{className:"text-xs",style:{color:"#6B7280"},children:S.family.caregiverThreePhone})]})]})]}),(a==="all"||a==="educational")&&e.jsxs("div",{className:"p-4 bg-gradient-to-br from-green-50 to-emerald-50 rounded-xl border border-green-100 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(Pn,{className:"h-4 w-4",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Educational"})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[S.diagnosis&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Diagnosis:"})," ",e.jsx("span",{style:{color:"#4A4A4A"},children:S.diagnosis})]}),S.currentAacSystems&&S.currentAacSystems.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"AAC Systems:"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:S.currentAacSystems.map((ds,ms)=>e.jsx(we,{variant:"outline",className:"text-xs",children:ds},ms))})]}),S.aacFileUrl&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"AAC Backup File:"}),e.jsx("div",{className:"flex items-center gap-2 mt-1",children:e.jsxs("div",{className:"p-2 border rounded bg-green-50 border-green-200 flex items-center gap-2",children:[e.jsx(As,{className:"w-4 h-4 text-green-600"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-green-900 font-medium",children:S.aacFileName}),S.aacFileSize&&e.jsxs("span",{className:"text-green-700 text-xs ml-2",children:["(",(S.aacFileSize/(1024*1024)).toFixed(1)," MB)"]})]}),e.jsxs(F,{variant:"outline",size:"sm",onClick:async()=>{try{const ds=await fetch(`/api/students/${S.id}/download-aac`);if(ds.ok){const ms=await ds.blob(),Yt=window.URL.createObjectURL(ms),Ls=document.createElement("a");Ls.href=Yt,Ls.download=S.aacFileName||"aac-file",document.body.appendChild(Ls),Ls.click(),window.URL.revokeObjectURL(Yt),document.body.removeChild(Ls)}}catch(ds){console.error("Download failed:",ds)}},className:"text-green-700 border-green-300 hover:bg-green-100 text-xs px-2 py-1",children:[e.jsx(Xr,{className:"w-3 h-3 mr-1"}),"Download"]})]})}),S.aacFileUploadedBy&&e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Uploaded by ",S.aacFileUploadedBy," ",S.aacFileUploadedDate&&`on ${new Date(S.aacFileUploadedDate).toLocaleDateString()}`]})]}),S.accommodations&&S.accommodations.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Accommodations:"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:S.accommodations.map((ds,ms)=>e.jsx(we,{variant:"outline",className:"text-xs",children:ds},ms))})]}),((Rt=S.studentCategories)==null?void 0:Rt.includes("Open Enrollment"))&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Classes per Week:"})," ",e.jsx("span",{style:{color:"#4A4A4A"},children:S.openEnrollmentClasses||1})]})]}),((Os=S.studentCategories)==null?void 0:Os.includes("Ahern Academy"))&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Ahern Academy Profile"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[S.specialInterests&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Special Interests:"}
538)," ",S.specialInterests]}),S.calmingStrategies&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Calming Strategies:"})," ",S.calmingStrategies]}),S.upsetTriggers&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Upset Triggers:"})," ",S.upsetTriggers]}),S.alphabetAccess&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Alphabet Access:"})," ",S.alphabetAccess]}),S.yesNoMethod&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Yes/No Method:"})," ",S.yesNoMethod]}),S.aacProficiency&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"AAC Proficiency:"})," ",S.aacProficiency]}),e.jsxs("div",{className:"border-t pt-2 mt-3",children:[e.jsx("h5",{className:"font-medium mb-2",children:"Class Assignments (Spring 2026)"}),e.jsxs("div",{className:"space-y-1 text-sm",children:[S.ahernLiteracyClass&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Literacy:"})," ",S.ahernLiteracyClass]}),S.ahernMathClass&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Math:"})," ",S.ahernMathClass]}),!S.ahernLiteracyClass&&!S.ahernMathClass&&e.jsx("div",{className:"text-gray-500 italic",children:"No class assignments yet"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Permissions"}),e.jsxs("div",{className:"flex gap-2",children:[S.contractSigned?e.jsxs("div",{className:"space-y-1",children:[e.jsx(we,{className:"bg-green-100 text-green-800 text-xs",children:"Contract Signed"}),S.contractSignedDate&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Signed: ",new Date(S.contractSignedDate).toLocaleDateString()]}),S.contractSignedBy&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["By: ",S.contractSignedBy]})]}):e.jsx(we,{variant:"destructive",className:"text-xs",children:"Contract Pending"}),S.photoPermissionSigned?e.jsxs("div",{className:"space-y-1",children:[e.jsx(we,{className:"bg-green-100 text-green-800 text-xs",children:"Photo Permission"}),S.photoUploadedDate&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Photo: ",new Date(S.photoUploadedDate).toLocaleDateString()]}),S.photoUploadedBy&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["By: ",S.photoUploadedBy]})]}):e.jsx(we,{variant:"destructive",className:"text-xs",children:"No Photo Permission"})]})]})]}),(a==="all"||a==="financial")&&e.jsxs("div",{className:"p-4 bg-gradient-to-br from-green-50 to-emerald-50 rounded-xl border border-green-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(Or,{className:"h-4 w-4",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Financial"})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Payment Method:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:((vs=S.family)==null?void 0:vs.paymentMethod)||"family"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Billing Frequency:"}),e.jsx("span",{style:{color:"#4A4A4A"},children:((cs=S.family)==null?void 0:cs.paymentPreference)||"monthly"})]}),((Ts=S.family)==null?void 0:Ts.scholarshipPercentage)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Scholarship:"})," ",S.family.scholarshipPercentage,"%",S.family.scholarshipInfo&&e.jsx("div",{className:"text-muted-foreground text-xs mt-1",children:S.family.scholarshipInfo})]}),((mn=S.family)==null?void 0:mn.thirdPartyPayerName)&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Third-Party Payer:"})," ",S.family.thirdPartyPayerName,S.family.thirdPartyContact&&e.jsx("div",{className:"text-muted-foreground text-xs",children:S.family.thirdPartyContact})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Current Account Balance"}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Total Due:"}),e.jsxs("span",{children:["$",Ze.totalDue.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-green-600",children:[e.jsx("span",{children:"Total Paid:"}),e.jsxs("span",{children:["-$",Ze.totalPaid.toFixed(2)]})]}),e.jsx(gu,{}),e.jsxs("div",{className:"flex justify-between font-medium",children:[e.jsx("span",{className:"text-blue-900",children:"Current Balance:"}),e.jsxs("span",{className:`${Ze.currentBalance>0?"text-red-600":Ze.currentBalance<0?"text-green-600":"text-gray-600"}`,children:["$",Ze.currentBalance>=0?Ze.currentBalance.toFixed(2):`(${Math.abs(Ze.currentBalance).toFixed(2)} credit)`]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Payment Records"}),(()=>{const ds=(J||[]).filter(ms=>{var Yt;return ms.studentId===S.id||ms.familyId===((Yt=S.family)==null?void 0:Yt.id)});return ds.length>0?e.jsx("div",{className:"space-y-2",children:ds.map(ms=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-white rounded border",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:ms.description}),e.jsxs("div",{className:"text-xs text-gray-500",children:[ms.serviceType," ⢠Due: ",new Date(ms.dueDate).toLocaleDateString(),ms.paidDate&&e.jsxs("span",{children:[" ⢠Paid: ",new Date(ms.paidDate).toLocaleDateString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium",children:["$",parseFloat(ms.amount).toFixed(2)]}),(()=>{const Yt=ms.status==="paid"||ms.paidDate?"paid":ms.status==="overdue"&&!ms.paidDate?"overdue":"pending",Ls=zu(Yt);return e.jsx(we,{variant:Ls.variant,className:Ls.className,children:Ls.text})})()]})]},ms.id))}):e.jsx("div",{className:"text-sm text-gray-500 italic p-2 bg-gray-50 rounded border",children:"No payment records foun
538d"})})()]})]}),a==="all"&&e.jsxs("div",{className:"p-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl border border-blue-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(ys,{className:"h-4 w-4",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Administrative"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",style:{color:"#4A4A4A"},children:"Administrative Notes"}),e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>E({studentId:S.id,notes:S.administrativeNotes||"",noteType:"administrative"}),children:[e.jsx(Zr,{className:"h-3 w-3 mr-1"}),S.administrativeNotes?"Edit":"Add"]})]}),S.administrativeNotes?e.jsx("div",{className:"text-sm bg-blue-50 p-3 rounded border",children:e.jsx("div",{className:"whitespace-pre-wrap",style:{color:"#4A4A4A"},children:S.administrativeNotes})}):e.jsx("div",{className:"text-sm text-muted-foreground italic p-3 bg-gray-50 rounded border",children:"No administrative notes added yet"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",style:{color:"#4A4A4A"},children:"Educational Notes"}),e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>E({studentId:S.id,notes:S.educationalNotes||"",noteType:"educational"}),children:[e.jsx(Zr,{className:"h-3 w-3 mr-1"}),S.educationalNotes?"Edit":"Add"]})]}),S.educationalNotes?e.jsx("div",{className:"text-sm bg-green-50 p-3 rounded border",children:e.jsx("div",{className:"whitespace-pre-wrap",style:{color:"#4A4A4A"},children:S.educationalNotes})}):e.jsx("div",{className:"text-sm text-muted-foreground italic p-3 bg-gray-50 rounded border",children:"No educational notes added yet"})]}),S.enrollmentDate&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",style:{color:"#4A4A4A"},children:"System Information"}),e.jsx("div",{className:"text-sm",children:e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",style:{color:"#4A4A4A"},children:"Enrolled:"})," ",e.jsx("span",{style:{color:"#4A4A4A"},children:new Date(S.enrollmentDate).toLocaleDateString()})]})})]})]})]})})})})]},S.id)})}),e.jsx(es,{open:!!h,onOpenChange:()=>x(null),children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Edit Student & Family Information"})}),h&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Student Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"name",children:"Name *"}),e.jsx(je,{id:"name",value:m.name,onChange:S=>g({...m,name:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"nicknames",children:"Nicknames"}),e.jsx(je,{id:"nicknames",value:m.nicknames,onChange:S=>g({...m,nicknames:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"birthday",children:"Birthday"}),e.jsx(je,{id:"birthday",type:"date",value:m.birthday,onChange:S=>g({...m,birthday:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"age",children:"Age"}),e.jsx(je,{id:"age",type:"number",value:m.age,onChange:S=>g({...m,age:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"gradeEquivalent",children:"Grade Level"}),e.jsx(je,{id:"gradeEquivalent",value:m.gradeEquivalent,onChange:S=>g({...m,gradeEquivalent:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"diagnosis",children:"Diagnosis"}),e.jsx(je,{id:"diagnosis",value:m.diagnosis,onChange:S=>g({...m,diagnosis:S.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Address"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(Ne,{htmlFor:"streetAddress",children:"Street Address"}),e.jsx(je,{id:"streetAddress",value:m.streetAddress,onChange:S=>g({...m,streetAddress:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"city",children:"City"}),e.jsx(je,{id:"city",value:m.city,onChange:S=>g({...m,city:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"state",children:"State/Province"}),e.jsx(je,{id:"state",value:m.state,onChange:S=>g({...m,state:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"country",children:"Country"}),e.jsx(je,{id:"country",value:m.country,onChange:S=>g({...m,country:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"postalCode",children:"Postal Code"}),e.jsx(je,{id:"postalCode",value:m.postalCode,onChange:S=>g({...m,postalCode:S.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-2 bg-gradient-to-r from-blue-50 to-purple-50 p-4 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium text-blue-900",children:"Educational Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"currentAacSystems",children:"AAC Systems (comma-separated)"}),e.jsx(Pt,{id:"currentAacSystems",value:m.currentAacSystems,onChange:S=>g({...m,currentAacSystems:S.target.value})}),e.jsxs("div",{className:"space-y-3 mt-3",children:[h!=null&&h.aacFileUrl?e.jsx("div",{className:"p-3 border rounded-lg bg-green-50 border-green-200",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(As,{className:"w-4 h-4 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-green-900",children:"AAC File Uploaded"}),e.jsxs("p",{className:"text-xs text-green-700",children:[h.aacFileName," ⢠",h.aacFileSize?`${(h.aacFileSize/(1024*1024)).toFixed(1)} MB`:"Unknown size"]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(F,{variant:"outline",size:"sm",onClick:async()=>{try{const S=await fetch(`/api/students/${h.id}/download-aac`);if(S.ok){const ve=await S.blob(),Ze=window.URL.createObjectURL(ve),Qe=document.createElement("a");Qe.href=Ze,Qe.download=h.aacFileName||"aac-file",document.body.appendChild(Qe),Qe.click(),window.URL.revokeObjectURL(Ze),document.body.removeChild(Qe)}}catch(S){console.error("Download failed:",S)}},className:"text-green-700 border-green-300 hover:bg-green-100 text-xs px-2 py-1",children:[e.jsx(Xr,{className:"w-3 h-3 mr-1"}),"Download"]}),e.jsxs(F,{variant:"outline",size:"sm",onClick:async()=>
538{if(window.confirm("Are you sure you want to delete this AAC file?"))try{await st("DELETE",`/api/students/${h.id}/aac-file`),T.invalidateQueries({queryKey:["/api/students"]}),window.location.reload()}catch(S){console.error("Delete failed:",S)}},className:"text-red-700 border-red-300 hover:bg-red-100 text-xs px-2 py-1",children:[e.jsx(pa,{className:"w-3 h-3 mr-1"}),"Delete"]})]})]})}):e.jsxs("div",{className:"p-3 border-2 border-dashed border-gray-300 rounded-lg text-center",children:[e.jsx(gr,{className:"w-6 h-6 text-gray-400 mx-auto mb-1"}),e.jsx("p",{className:"text-xs text-gray-500",children:"No AAC backup file uploaded"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"aac-file-upload",className:"text-sm",children:h!=null&&h.aacFileUrl?"Replace AAC File":"Upload AAC File"}),e.jsx(je,{id:"aac-file-upload",type:"file",accept:".ce,.p2gbk,.wf,.gridset,.gridsetx,.mti,.sps,.azt,.avrt,.jmm",onChange:async S=>{var Ze;const ve=(Ze=S.target.files)==null?void 0:Ze[0];if(ve){if(ve.size>200*1024*1024){alert("File size must be less than 200MB");return}const Qe=new FormData;Qe.append("file",ve);try{const ct=await fetch(`/api/students/${h.id}/aac-upload`,{method:"POST",body:Qe});if(ct.ok)T.invalidateQueries({queryKey:["/api/students"]}),window.location.reload();else{const It=await ct.text();alert(`Upload failed: ${It}`)}}catch(ct){console.error("Upload failed:",ct),alert("Upload failed. Please try again.")}}},className:"mt-1 text-sm"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supported: .ce, .p2gbk, .wf, .gridset, .gridsetx, .mti, .sps, .azt, .avrt, .jmm (Max 200MB)"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"accommodations",children:"Accommodations (comma-separated)"}),e.jsx(Pt,{id:"accommodations",value:m.accommodations,onChange:S=>g({...m,accommodations:S.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Program Enrollment"}),e.jsx("div",{className:"space-y-2",children:["Ahern Academy","Open Enrollment","1:1 Sessions","Young Adult Chat","Chit Chat Club"].map(S=>{var ve;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:S,checked:(ve=m.studentCategories)==null?void 0:ve.includes(S),onCheckedChange:Ze=>{var Qe;g(Ze?{...m,studentCategories:[...m.studentCategories||[],S],ahernAcademyApproved:S==="Ahern Academy"?!0:m.ahernAcademyApproved}:{...m,studentCategories:(Qe=m.studentCategories)==null?void 0:Qe.filter(ct=>ct!==S),ahernAcademyApproved:S==="Ahern Academy"?!1:m.ahernAcademyApproved})}}),e.jsx(Ne,{htmlFor:S,children:S})]},S)})}),((_e=m.studentCategories)==null?void 0:_e.includes("Open Enrollment"))&&e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"openEnrollmentClasses",children:"Open Enrollment Classes per Week"}),e.jsxs(St,{value:(Le=m.openEnrollmentClasses)==null?void 0:Le.toString(),onValueChange:S=>g({...m,openEnrollmentClasses:parseInt(S)}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"1",children:"1 class"}),e.jsx(ce,{value:"2",children:"2 classes"}),e.jsx(ce,{value:"3",children:"3 classes"}),e.jsx(ce,{value:"4",children:"4 classes"})]})]})]}),((A=m.studentCategories)==null?void 0:A.includes("Ahern Academy"))&&e.jsxs("div",{className:"mt-4 p-3 bg-purple-50 border border-purple-200 rounded",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"ahernAcademyApproved",checked:m.ahernAcademyApproved,onCheckedChange:S=>{g({...m,ahernAcademyApproved:S})}}),e.jsx(Ne,{htmlFor:"ahernAcademyApproved",className:"font-medium text-purple-900",children:"Ahern Academy Enrollment Approved"})]}),e.jsxs("div",{className:"flex gap-2",children:[(h==null?void 0:h.ahernAcademyApplicationSubmitted)&&e.jsxs(F,{type:"button",variant:"outline",size:"sm",onClick:()=>M(h.id),className:"border-purple-300 text-purple-900 hover:bg-purple-100",children:[e.jsx(Js,{className:"h-4 w-4 mr-1"}),"View Application"]}),e.jsx(F,{type:"button",variant:m.ahernAcademyApproved?"default":"outline",size:"sm",onClick:()=>{g({...m,ahernAcademyApproved:!m.ahernAcademyApproved})},className:m.ahernAcademyApproved?"bg-green-600 hover:bg-green-700":"",children:m.ahernAcademyApproved?"â Approved for Ahern Academy":"Approve Ahern Academy"})]})]}),e.jsx("p",{className:"text-sm text-purple-700 mt-1 ml-6",children:"When approved, family will see contract requirement and gain full Ahern Academy access. Approval required before enrollment is finalized."})]}),((D=m.studentCategories)==null?void 0:D.includes("1:1 Sessions"))&&e.jsxs("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"oneOnOneApproved",checked:m.oneOnOneApproved,onCheckedChange:S=>{g({...m,oneOnOneApproved:S})}}),e.jsx(Ne,{htmlFor:"oneOnOneApproved",className:"font-medium text-blue-900",children:"Family Portal Access for 1:1 Sessions"})]}),e.jsx(F,{type:"button",variant:m.oneOnOneApproved?"default":"outline",size:"sm",onClick:()=>{g({...m,oneOnOneApproved:!m.oneOnOneApproved})},className:m.oneOnOneApproved?"bg-green-600 hover:bg-green-700":"",children:m.oneOnOneApproved?"â Admin Approved 1:1":"Admin Approve 1:1"})]}),e.jsx("p",{className:"text-sm text-blue-700 mt-1 ml-6",children:"When approved, family can view, cancel, and reschedule paid 1:1 sessions through their portal. Free sessions remain admin-managed only."})]})]}),((ie=m.studentCategories)==null?void 0:ie.includes("Ahern Academy"))&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Ahern Academy Academic Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"specialInterests",children:"Special Interests"}),e.jsx(Pt,{id:"specialInterests",value:m.specialInterests,onChange:S=>g({...m,specialInterests:S.target.value}
538),placeholder:"What does this student love and enjoy?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"calmingStrategies",children:"Calming Strategies"}),e.jsx(Pt,{id:"calmingStrategies",value:m.calmingStrategies,onChange:S=>g({...m,calmingStrategies:S.target.value}),placeholder:"What helps calm this student when upset?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"upsetTriggers",children:"Upset Triggers"}),e.jsx(Pt,{id:"upsetTriggers",value:m.upsetTriggers,onChange:S=>g({...m,upsetTriggers:S.target.value}),placeholder:"What might upset or trigger this student?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"alphabetAccess",children:"Alphabet Access Method"}),e.jsx(Pt,{id:"alphabetAccess",value:m.alphabetAccess,onChange:S=>g({...m,alphabetAccess:S.target.value}),placeholder:"How does this student access the alphabet?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"yesNoMethod",children:"Yes/No Communication Method"}),e.jsx(Pt,{id:"yesNoMethod",value:m.yesNoMethod,onChange:S=>g({...m,yesNoMethod:S.target.value}),placeholder:"How does this student communicate yes and no?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"aacProficiency",children:"AAC Proficiency Level"}),e.jsx(Pt,{id:"aacProficiency",value:m.aacProficiency,onChange:S=>g({...m,aacProficiency:S.target.value}),placeholder:"Student's current AAC skill level and abilities"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"ahernLiteracyClass",children:"Literacy Class Assignment"}),e.jsxs(St,{value:m.ahernLiteracyClass||"",onValueChange:S=>g({...m,ahernLiteracyClass:S}),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select literacy class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:15 Literacy",children:"9:15 Literacy (UFLI 1-30)"}),e.jsx(ce,{value:"10:30 Literacy",children:"10:30 Literacy (UFLI 60-90)"}),e.jsx(ce,{value:"11:15 Literacy",children:"11:15 Literacy (UFLI 30-60)"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"ahernMathClass",children:"Math Class Assignment"}),e.jsxs(St,{value:m.ahernMathClass||"",onValueChange:S=>g({...m,ahernMathClass:S}),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select math class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:50 Math",children:"9:50 Math"}),e.jsx(ce,{value:"11:45 Math",children:"11:45 Math"}),e.jsx(ce,{value:"12:15 Math",children:"12:15 Math"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Permissions"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"contractSigned",checked:m.contractSigned,onCheckedChange:S=>g({...m,contractSigned:S})}),e.jsx(Ne,{htmlFor:"contractSigned",children:"Contract Signed"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"photoPermissionSigned",checked:m.photoPermissionSigned,onCheckedChange:S=>g({...m,photoPermissionSigned:S})}),e.jsx(Ne,{htmlFor:"photoPermissionSigned",children:"Photo Permission Signed"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"contractExemption",checked:m.contractExemption||!1,onCheckedChange:S=>g({...m,contractExemption:S})}),e.jsx(Ne,{htmlFor:"contractExemption",children:"Contract Waived"})]})]})]})]}),e.jsx(gu,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Family & Caregiver Information"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Primary Caregiver"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverOneName",children:"Name *"}),e.jsx(je,{id:"caregiverOneName",value:m.caregiverOneName,onChange:S=>g({...m,caregiverOneName:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverOneEmail",children:"Email"}),e.jsx(je,{id:"caregiverOneEmail",type:"email",value:m.caregiverOneEmail,onChange:S=>g({...m,caregiverOneEmail:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverOnePhone",children:"Phone"}),e.jsx(je,{id:"caregiverOnePhone",value:m.caregiverOnePhone,onChange:S=>g({...m,caregiverOnePhone:S.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Secondary Caregiver (Optional)"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverTwoName",children:"Name"}),e.jsx(je,{id:"caregiverTwoName",value:m.caregiverTwoName,onChange:S=>g({...m,caregiverTwoName:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverTwoEmail",children:"Email"}),e.jsx(je,{id:"caregiverTwoEmail",type:"email",value:m.caregiverTwoEmail,onChange:S=>g({...m,caregiverTwoEmail:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiverTwoPhone",children:"Phone"}),e.jsx(je,{id:"caregiverTwoPhone",value:m.caregiverTwoPhone,onChange:S=>g({...m,caregiverTwoPhone:S.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Payment Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"paymentPreference",children:"Billing Frequency"}),e.jsxs(St,{value:m.paymentPreference,onValueChange:S=>g({...m,paymentPreference:S}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"weekly",children:"Weekly"}),e.jsx(ce,{value:"monthly",children:"Monthly"}),e.jsx(ce,{value:"trimester",children:"Trimester"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"paymentMethod",children:"Payment Method"}),e.jsxs(St,{value:m.paymentMethod,onValueChange:S=>g({...m,paymentMethod:S}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"family",children:"Family Pays"}),e.jsx(ce,{value:"third-party",children:"Third-Party Payer"}),e.jsx(ce,{value:"scholarship",children:"Scholarship"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"scholarshipPercentage",children:"Scholarship Percentage"}),e.jsxs(St,{value:($e=m.scholarshipPercentage)==null?void 0:$e.toString(),onValueChange:S=>g({...m,scholarshipPercentage:parseInt(S)}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsx(Ct,{children:[0,10,15,20,25,30,40,50,60,75,100].map(S=>e.jsxs(ce,{value:S.toString(),children:[S,"%"]},S))})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"scholarshipInfo",children:"Scholarship Information"}),e.jsx(je,{id:"scholarshipInfo",value:m.scholarshipInfo,onChange:S=>g({...m,scholarshipInfo:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"thirdPartyPayerName",children:"Third-Party Payer Name"}),e.jsx(je,{id:"thirdPartyPayerName",value:m.thirdPartyPayerName,onChange:S=>g({...m,thirdPartyPayerName:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"thirdPartyContact",children:"Third-Party Contact"}),e.jsx(je,{id:"thirdPartyContact",value:m.thirdPartyContact,onChange:S=>g({...m,thirdPartyContact:S.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-medium",children:"AAC File Management"}),e.jsxs("div",{className:"space-y-3",children:[h!=null&&h.aacFileUrl?e.jsx("div",{className:"p-4 border rounded-lg bg-green-50 border-green-200",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center",children:e.jsx(As,{className:"w-5 h-5 text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-900",children:"AAC File Uploaded"}),e.jsxs("p",{className:"text-sm text-green-700",children:[h.aacFileName," ⢠",h.aacFileSize?`${(h.aacFileSize/(1024*1024)).toFixed(1)} MB`:"Unknown size"]}),h.aacUploadedBy&&e.jsxs("p",{className:"text-xs text-green-600",children:["Uploaded by ",h.aacUploadedBy," on ",h.aacUploadedAt?new Date(h.aacUploadedAt).toLocaleDateString():"Unknown date"]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(F,{variant:"outline",size:"sm",onClick:async()=>{try{const S=await fetch(`/api/students/${h.id}/download-aac`);if(S.ok){const ve=await S.blob(),Ze=window.URL.createObjectURL(ve),Qe=document.createElement("a");Qe.href=Ze,Qe.download=h.aacFileName||"aac-file",document.body.appendChild(Qe),Qe.click(),window.URL.revokeObjectURL(Ze),document.body.removeChild(Qe)}}catch(S){console.error("Download failed:",S)}},className:"text-green-700 border-green-300 hover:bg-green-100",children:[e.jsx(Xr,{className:"w-4 h-4 mr-1"}),"Download"]}),e.jsxs(F,{variant:"outline",size:"sm",onClick:async()=>
538{if(window.confirm("Are you sure you want to delete this AAC file? This action cannot be undone."))try{await st("DELETE",`/api/students/${h.id}/aac-file`),T.invalidateQueries({queryKey:["/api/students"]}),window.location.reload()}catch(S){console.error("Delete failed:",S)}},className:"text-red-700 border-red-300 hover:bg-red-100",children:[e.jsx(pa,{className:"w-4 h-4 mr-1"}),"Delete"]})]})]})}):e.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-lg text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-100 rounded-lg flex items-center justify-center",children:e.jsx(gr,{className:"w-5 h-5 text-gray-500"})}),e.jsx("p",{className:"text-sm text-gray-600",children:"No AAC backup file uploaded"})]})}),e.jsx("div",{className:"flex gap-2 items-end",children:e.jsxs("div",{className:"flex-1",children:[e.jsx(Ne,{htmlFor:"aac-file-upload",className:"text-sm font-medium text-gray-700",children:h!=null&&h.aacFileUrl?"Replace AAC File":"Upload AAC File"}),e.jsx(je,{id:"aac-file-upload",type:"file",accept:".ce,.p2gbk,.wf,.gridset,.gridsetx,.mti,.sps,.azt,.avrt,.jmm",onChange:async S=>{var Ze;const ve=(Ze=S.target.files)==null?void 0:Ze[0];if(ve){if(ve.size>200*1024*1024){alert("File size must be less than 200MB");return}const Qe=new FormData;Qe.append("file",ve);try{const ct=await fetch(`/api/students/${h.id}/aac-upload`,{method:"POST",body:Qe});if(ct.ok)T.invalidateQueries({queryKey:["/api/students"]}),window.location.reload();else{const It=await ct.text();alert(`Upload failed: ${It}`)}}catch(ct){console.error("Upload failed:",ct),alert("Upload failed. Please try again.")}}},className:"mt-1"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Supported formats: .ce, .p2gbk, .wf, .gridset, .gridsetx, .mti, .sps, .azt, .avrt, .jmm (Max 200MB)"})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[e.jsx(F,{variant:"outline",onClick:Te,"data-testid":"button-cancel-edit",children:"Cancel"}),e.jsx(F,{onClick:Y,disabled:V.isPending||Z.isPending,"data-testid":"button-save-student",children:V.isPending||Z.isPending?"Saving...":"Save Changes"})]})]})]})}),e.jsx(es,{open:y,onOpenChange:()=>b(!1),children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Add New Student & Family"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Student Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-name",children:"Name *"}),e.jsx(je,{id:"add-name",value:m.name,onChange:S=>g({...m,name:S.target.value}),placeholder:"Student's full name"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-nicknames",children:"Nicknames"}),e.jsx(je,{id:"add-nicknames",value:m.nicknames,onChange:S=>g({...m,nicknames:S.target.value}),placeholder:"How they prefer to be called"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-birthday",children:"Birthday"}),e.jsx(je,{id:"add-birthday",type:"date",value:m.birthday,onChange:S=>g({...m,birthday:S.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-age",children:"Age"}),e.jsx(je,{id:"add-age",type:"number",value:m.age,onChange:S=>g({...m,age:S.target.value}),placeholder:"Student's current age"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Program Enrollment"}),e.jsx("div",{className:"space-y-2",children:["Ahern Academy","Open Enrollment","1:1 Sessions","Young Adult Chat","Chit Chat Club"].map(S=>{var ve;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:`add-${S}`,checked:(ve=m.studentCategories)==null?void 0:ve.includes(S),onCheckedChange:Ze=>{var Qe;g(Ze?{...m,studentCategories:[...m.studentCategories||[],S]}:{...m,studentCategories:(Qe=m.studentCategories)==null?void 0:Qe.filter(ct=>ct!==S)})}}),e.jsx(Ne,{htmlFor:`add-${S}`,children:S})]},S)})})]})]}),e.jsx(gu,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Family & Caregiver Information"}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-email",children:"Family Email *"}),e.jsx(je,{id:"add-email",type:"email",value:m.email,onChange:S=>g({...m,email:S.target.value}),placeholder:"Primary family contact email"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Primary Caregiver"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-caregiverOneName",children:"Name *"}),e.jsx(je,{id:"add-caregiverOneName",value:m.caregiverOneName,onChange:S=>g({...m,caregiverOneName:S.target.value}),placeholder:"Primary caregiver name"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-caregiverOneEmail",children:"Email"}),e.jsx(je,{id:"add-caregiverOneEmail",type:"email",value:m.caregiverOneEmail,onChange:S=>g({...m,caregiverOneEmail:S.target.value}),placeholder:"Caregiver's email"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-caregiverOnePhone",children:"Phone"}),e.jsx(je,{id:"add-caregiverOnePhone",value:m.caregiverOnePhone,onChange:S=>g({...m,caregiverOnePhone:S.target.value}),placeholder:"Phone number"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Payment Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-paymentPreference",children:"Billing Frequency"}),e.jsxs(St,{value:m.paymentPreference,onValueChange:S=>g({...m,paymentPreference:S}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"weekly",children:"Weekly"}),e.jsx(ce,{value:"monthly",children:"Monthly"}),e.jsx(ce,{value:"trimester",children:"Trimester"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"add-scholarshipPercentage",children:"Scholarship Percentage"}),e.jsxs(St,{value:(ke=m.scholarshipPercentage)==null?void 0:ke.toString(),onValueChange:S=>g({...m,scholarshipPercentage:parseInt(S)}),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsx(Ct,{children:[0,10,15,20,25,30,40,50,60,75,100].map(S=>e.jsxs(ce,{value:S.toString(),children:[S,"%"]},S))})]})]})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[e.jsx(F,{variant:"outline",onClick:Mt,children:"Cancel"}
538),e.jsx(F,{onClick:ht,disabled:G.isPending||Fe.isPending||!m.name||!m.caregiverOneName,children:G.isPending||Fe.isPending?"Creating...":"Create Student"})]})]})]})}),e.jsx(es,{open:!!w,onOpenChange:()=>N(null),children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsxs(ns,{children:["Manage Photo for ",w==null?void 0:w.name]})}),w&&e.jsx(dU,{student:w,uploaderName:"Admin"})]})}),e.jsx(es,{open:!!k,onOpenChange:()=>E(null),children:e.jsxs(ts,{className:"max-w-2xl",children:[e.jsx(ss,{children:e.jsxs(ns,{children:["Edit ",(k==null?void 0:k.noteType)==="administrative"?"Administrative":"Educational"," Notes"]})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs(Ne,{htmlFor:"student-notes",children:[k.noteType==="administrative"?"Administrative":"Educational"," Notes"]}),e.jsx(Pt,{id:"student-notes",value:k.notes,onChange:S=>E({...k,notes:S.target.value}),placeholder:`Add ${k.noteType} notes about the student...`,className:"min-h-[200px]"})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(F,{variant:"outline",onClick:()=>E(null),children:"Cancel"}),e.jsx(F,{onClick:()=>ue.mutate({studentId:k.studentId,notes:k.notes,noteType:k.noteType}),disabled:ue.isPending,children:ue.isPending?"Saving...":"Save Notes"})]})]})]})}),e.jsx(es,{open:P!==null,onOpenChange:()=>M(null),children:e.jsxs(ts,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Ahern Academy Application"})}),ne&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Family Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Why Homeschool:"})," ",e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.homeschoolReasoning})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"How Heard About Us:"})," ",ne.howHeardAbout]})]})]}),e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Communication & Academic Skills"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Communication Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.communicationSkills})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Reading Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.readingSkills})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Math Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.mathSkills})]})]})]}),e.jsxs("div",{className:"p-4 bg-yellow-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Student Information"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Special Interests:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.specialInterestsDetail})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Self-Advocacy Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.selfAdvocacySkills})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Strengths:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.studentStrengths})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Motor Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.motorSkills})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Term Goals:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.termGoals})]})]})]}),e.jsxs("div",{className:"p-4 bg-orange-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Regulation & Support Needs"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Regulation Skills:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.regulationSkills})]}),ne.regulationSupports&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Regulation Supports:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.regulationSupports})]}),ne.traumaAndSupport&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Trauma & Support:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.traumaAndSupport})]}),ne.knownTriggers&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Known Triggers:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.knownTriggers})]})]})]}),e.jsxs("div",{className:"p-4 bg-indigo-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Learning Coach"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Name:"})," ",ne.learningCoachName]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Agrees to Attend:"})," ",ne.learningCoachAgreesToAttend?"Yes":"No"]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Comfort Level:"})," ",ne.learningCoachComfortLevel?`Level ${ne.learningCoachComfortLevel}`:"Not specified"]})]})]}),e.jsxs("div",{className:"p-4 bg-pink-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Technology Access"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Device for Classes:"})," ",ne.deviceForClasses]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Reliable Internet:"})," ",ne.reliableInternet?"Yes":"No"]}),ne.technologyIssues&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Technology Issues:"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:ne.technologyIssues})]})]})]}),e.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Contract & Commitment"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Understands Year Commitment:"})," ",ne.understandsYearCommitment?"Yes":"No"]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Affirms Accuracy:"})," ",ne.affirmationAccurate?"Yes":"No"]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Electronic Signature:"})," ",ne.electronicSignature]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Signature Date:"})," ",ne.signatureDate?new Date(ne.signatureDate).toLocaleDateString():"Not provided"]})]})]}),ne.additionalInfo&&e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Additional Information"}),e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ne.additionalInfo})]}),e.jsx("div",{className:"p-4 bg-gray-100 rounded-lg text-sm text-gray-600",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{children:["Submitted: ",new Date(ne.submittedAt).toLocaleStr
538ing()]}),ne.adminNotifiedAt&&e.jsxs("span",{children:["Admin Notified: ",new Date(ne.adminNotifiedAt).toLocaleString()]})]})})]})]})}),e.jsx(es,{open:L!==null,onOpenChange:()=>{B(null),H("")},children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Reject Ahern Academy Application"})}),L&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You are about to reject the Ahern Academy application for ",e.jsx("strong",{children:L.studentName}),". The family will be notified via email with the reason you provide below."]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"rejection-reason",children:"Reason for Rejection *"}),e.jsx(Pt,{id:"rejection-reason",value:z,onChange:S=>H(S.target.value),placeholder:"Please provide a clear explanation for the rejection...",className:"mt-1 min-h-[120px]"})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{variant:"outline",onClick:()=>{B(null),H("")},children:"Cancel"}),e.jsx(F,{variant:"destructive",onClick:()=>{if(z.trim().length===0){U({title:"Rejection Reason Required",description:"Please provide a reason for the rejection.",variant:"destructive"});return}ge.mutate({applicationId:L.applicationId,rejectionReason:z.trim()})},disabled:ge.isPending||z.trim().length===0,children:ge.isPending?"Rejecting...":"Reject Application"})]})]})]})})]})}var Af=s=>s.type==="checkbox",Hc=s=>s instanceof Date,Hr=s=>s==null;const JS=s=>typeof s=="object";var zn=s=>!Hr(s)&&!Array.isArray(s)&&JS(s)&&!Hc(s),ek=s=>zn(s)&&s.target?Af(s.target)?s.target.checked:s.target.value:s,uU=s=>s.substring(0,s.search(/\.\d+(\.|$)/))||s,tk=(s,t)=>s.has(uU(t)),mU=s=>{const t=s.constructor&&s.constructor.prototype;return zn(t)&&t.hasOwnProperty("isPrototypeOf")},aj=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function pr(s){let t;const n=Array.isArray(s),r=typeof FileList<"u"?s instanceof FileList:!1;if(s instanceof Date)t=new Date(s);else if(s instanceof Set)t=new Set(s);else if(!(aj&&(s instanceof Blob||r))&&(n||zn(s)))if(t=n?[]:{},!n&&!mU(s))t=s;else for(const a in s)s.hasOwnProperty(a)&&(t[a]=pr(s[a]));else return s;return t}var Y0=s=>Array.isArray(s)?s.filter(Boolean):[],Vn=s=>s===void 0,gt=(s,t,n)=>{if(!t||!zn(s))return n;const r=Y0(t.split(/[,[\].]+?/)).reduce((a,o)=>Hr(a)?a:a[o],s);return Vn(r)||r===s?Vn(s[t])?n:s[t]:r},ka=s=>typeof s=="boolean",ij=s=>/^\w*$/.test(s),sk=s=>Y0(s.replace(/["|']|\]/g,"").split(/\.|\[/)),sn=(s,t,n)=>{let r=-1;const a=ij(t)?[t]:sk(t),o=a.length,c=o-1;for(;++r<o;){const u=a[r];let h=n;if(r!==c){const x=s[u];h=zn(x)||Array.isArray(x)?x:isNaN(+a[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;s[u]=h,s=s[u]}};const Xx={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ci={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Il={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},nk=Ut.createContext(null),Q0=()=>Ut.useContext(nk),hU=s=>{const{children:t,...n}=s;return Ut.createElement(nk.Provider,{value:n},t)};var rk=(s,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in s)Object.defineProperty(a,o,{get:()=>{const c=o;return t._proxyFormState[c]!==Ci.all&&(t._proxyFormState[c]=!r||Ci.all),n&&(n[c]=!0),s[c]}});return a};function fU(s){const t=Q0(),{control:n=t.control,disabled:r,name:a,exact:o}=s||{},[c,u]=Ut.useState(n._formState),h=Ut.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=Ut.useRef(a);return x.current=a,Ut.useEffect(()=>n._subscribe({name:x.current,formState:h.current,exact:o,callback:m=>{!r&&u({...n._formState,...m})}}),[n,r,o]),Ut.useEffect(()=>{h.current.isValid&&n._setValid(!0)},[n]),Ut.useMemo(()=>rk(c,n,h.current,!1),[c,n])}var el=s=>typeof s=="string",ak=(s,t,n,r,a)=>el(s)?(r&&t.watch.add(s),gt(n,s,a)):Array.isArray(s)?s.map(o=>(r&&t.watch.add(o),gt(n,o))):(r&&(t.watchAll=!0),n);function pU(s){const t=Q0(),{control:n=t.control,name:r,defaultValue:a,disabled:o,exact:c}=s||{},u=Ut.useRef(r),h=Ut.useRef(a);u.current=r,Ut.useEffect(()=>n._subscribe({name:u.current,formState:{values:!0},exact:c,callback:g=>!o&&m(ak(u.current,n._names,g.values||n._formValues,!1,h.current))}
vendor: 9,867 bytes, line 538
538),[n,o,c]);const[x,m]=Ut.useState(n._getWatch(r,a));return Ut.useEffect(()=>n._removeUnmounted()),x}function xU(s){const t=Q0(),{name:n,disabled:r,control:a=t.control,shouldUnregister:o}=s,c=tk(a._names.array,n),u=pU({control:a,name:n,defaultValue:gt(a._formValues,n,gt(a._defaultValues,n,s.defaultValue)),exact:!0}),h=fU({control:a,name:n,exact:!0}),x=Ut.useRef(s),m=Ut.useRef(a.register(n,{...s.rules,value:u,...ka(s.disabled)?{disabled:s.disabled}:{}})),g=Ut.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!gt(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!gt(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!gt(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!gt(h.validatingFields,n)},error:{enumerable:!0,get:()=>gt(h.errors,n)}}),[h,n]),y=Ut.useCallback(k=>m.current.onChange({target:{value:ek(k),name:n},type:Xx.CHANGE}),[n]),b=Ut.useCallback(()=>m.current.onBlur({target:{value:gt(a._formValues,n),name:n},type:Xx.BLUR}),[n,a._formValues]),w=Ut.useCallback(k=>{const E=gt(a._fields,n);E&&k&&(E._f.ref={focus:()=>k.focus(),select:()=>k.select(),setCustomValidity:P=>k.setCustomValidity(P),reportValidity:()=>k.reportValidity()})},[a._fields,n]),N=Ut.useMemo(()=>({name:n,value:u,...ka(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:y,onBlur:b,ref:w}),[n,r,h.disabled,y,b,w,u]);return Ut.useEffect(()=>{const k=a._options.shouldUnregister||o;a.register(n,{...x.current.rules,...ka(x.current.disabled)?{disabled:x.current.disabled}:{}});const E=(P,M)=>{const L=gt(a._fields,P);L&&L._f&&(L._f.mount=M)};if(E(n,!0),k){const P=pr(gt(a._options.defaultValues,n));sn(a._defaultValues,n,P),Vn(gt(a._formValues,n))&&sn(a._formValues,n,P)}return!c&&a.register(n),()=>{(c?k&&!a._state.action:k)?a.unregister(n):E(n,!1)}},[n,a,c,o]),Ut.useEffect(()=>{a._setDisabledField({disabled:r,name:n})},[r,n,a]),Ut.useMemo(()=>({field:N,formState:h,fieldState:g}),[N,h,g])}const gU=s=>s.render(xU(s));var ik=(s,t,n,r,a)=>t?{...n[s],types:{...n[s]&&n[s].types?n[s].types:{},[r]:a||!0}}:{},bh=s=>Array.isArray(s)?s:[s],LN=()=>{let s=[];return{get observers(){return s},next:a=>{for(const o of s)o.next&&o.next(a)},subscribe:a=>(s.push(a),{unsubscribe:()=>{s=s.filter(o=>o!==a)}}),unsubscribe:()=>{s=[]}}},f1=s=>Hr(s)||!JS(s);function _o(s,t){if(f1(s)||f1(t))return s===t;if(Hc(s)&&Hc(t))return s.getTime()===t.getTime();const n=Object.keys(s),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const o=s[a];if(!r.includes(a))return!1;if(a!=="ref"){const c=t[a];if(Hc(o)&&Hc(c)||zn(o)&&zn(c)||Array.isArray(o)&&Array.isArray(c)?!_o(o,c):o!==c)return!1}}return!0}var Kr=s=>zn(s)&&!Object.keys(s).length,lj=s=>s.type==="file",Si=s=>typeof s=="function",Jx=s=>{if(!aj)return!1;const t=s?s.ownerDocument:0;return s instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lk=s=>s.type==="select-multiple",oj=s=>s.type==="radio",yU=s=>oj(s)||Af(s),lv=s=>Jx(s)&&s.isConnected;function vU(s,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)s=Vn(s)?r++:s[t[r++]];return s}function jU(s){for(const t in s)if(s.hasOwnProperty(t)&&!Vn(s[t]))return!1;return!0}function er(s,t){const n=Array.isArray(t)?t:ij(t)?[t]:sk(t),r=n.length===1?s:vU(s,n),a=n.length-1,o=n[a];return r&&delete r[o],a!==0&&(zn(r)&&Kr(r)||Array.isArray(r)&&jU(r))&&er(s,n.slice(0,-1)),s}var ok=s=>{for(const t in s)if(Si(s[t]))return!0;return!1};function e0(s,t={}){const n=Array.isArray(s);if(zn(s)||n)for(const r in s)Array.isArray(s[r])||zn(s[r])&&!ok(s[r])?(t[r]=Array.isArray(s[r])?[]:{},e0(s[r],t[r])):Hr(s[r])||(t[r]=!0);return t}function ck(s,t,n){const r=Array.isArray(s);if(zn(s)||r)for(const a in s)Array.isArray(s[a])||zn(s[a])&&!ok(s[a])?Vn(t)||f1(n[a])?n[a]=Array.isArray(s[a])?e0(s[a],[]):{...e0(s[a])}:ck(s[a],Hr(t)?{}:t[a],n[a]):n[a]=!_o(s[a],t[a]);return n}var eh=(s,t)=>ck(s,t,e0(t));const VN={value:!1,isValid:!1},UN={value:!0,isValid:!0};var dk=s=>{if(Array.isArray(s)){if(s.length>1){const t=s.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return s[0].checked&&!s[0].disabled?s[0].attributes&&!Vn(s[0].attributes.value)?Vn(s[0].value)||s[0].value===""?UN:{value:s[0].value,isValid:!0}:UN:VN}return VN},uk=(s,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Vn(s)?s:t?s===""?NaN:s&&+s:n&&el(s)?new Date(s):r?r(s):s;const zN={isValid:!1,value:null};var mk=s=>Array.isArray(s)?s.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,zN):zN;function qN(s){const t=s.ref;return lj(t)?t.files:oj(t)?mk(s.refs).value:lk(t)?[...t.selectedOptions].map(({value:n})=>n):Af(t)?dk(s.refs).value:uk(Vn(t.value)?s.ref.value:t.value,s)}var bU=(s,t,n,r)=>{const a={};for(const o of s){const c=gt(t,o);c&&sn(a,o,c._f)}return{criteriaMode:n,names:[...s],fields:a,shouldUseNativeValidation:r}},t0=s=>s instanceof RegExp,th=s=>Vn(s)?s:t0(s)?s.source:zn(s)?t0(s.value)?s.value.source:s.value:s,WN=s=>({isOnSubmit:!s||s===Ci.onSubmit,isOnBlur:s===Ci.onBlur,isOnChange:s===Ci.onChange,isOnAll:s===Ci.all,isOnTouch:s===Ci.onTouched});const BN="AsyncFunction";var NU=s=>!!s&&!!s.validate&&!!(Si(s.validate)&&s.validate.constructor.name===BN||zn(s.validate)&&Object.values(s.validate).find(t=>t.constructor.name===BN)),wU=s=>s.mount&&(s.required||s.min||s.max||s.maxLength||s.minLength||s.pattern||s.validate),KN=(s,t,n)=>!n&&(t.watchAll||t.watch.has(s)||[...t.watch].some(r=>s.startsWith(r)&&/^\.\w+/.test(s.slice(r.length))));const Nh=(s,t,n,r)=>{for(const a of n||Object.keys(s)){const o=gt(s,a);if(o){const{_f:c,...u}=o;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],a)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Nh(u,t))break}else if(zn(u)&&Nh(u,t))break}}};function HN(s,t,n){const r=gt(s,n);if(r||ij(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const o=a.join("."),c=gt(t,o),u=gt(s,o);if(c&&!Array.isArray(c)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};a.pop()}return{name:n}}var AU=(s,t,n,r)=>{n(s);const{name:a,...o}=s;return Kr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(c=>t[c]===(!r||Ci.all))},CU=(s,t,n)=>!s||!t||s===t||bh(s).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),SU=(s,t,n,r,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||s):(n?r.isOnBlur:a.isOnBlur)?!s:(n?r.isOnChange:a.isOnChange)?s:!0,kU=(s,t)=>!Y0(gt(s,t)).length&&er(s,t),$U=(s,t,n)=>{const r=bh(gt(s,n));return sn(r,"root",t[n]),sn(s,n,r),s},Px=s=>el(s);function GN(s,t,n="validate"){if(Px(s)||Array.isArray(s)&&s.every(Px)||ka(s)&&!s)return{type:n,message:Px(s)?s:"",ref:t}}var nu=s=>zn(s)&&!t0(s)?s:{value:s,message:""},ZN=async(s,t,n,r,a,o)=>{const{ref:c,refs:u,required:h,maxLength:x,minLength:m,min:g,max:y,pattern:b,validate:w,name:N,valueAsNumber:k,mount:E}=s._f,P=gt(n,N);if(!E||t.has(N))return{};const M=u?u[0]:c,L=ae=>{a&&M.reportValidity&&(M.setCustomValidity(ka(ae)?"":ae||""),M.reportValidity())},B={},z=oj(c),H=Af(c),T=z||H,U=(k||lj(c))&&Vn(c.value)&&Vn(P)||Jx(c)&&c.value===""||P===""||Array.isArray(P)&&!P.length,_=ik.bind(null,N,r,B),se=(ae,W,J,ne=Il.maxLength,le=Il.minLength)=>{const V=ae?W:J;B[N]={type:ae?ne:le,message:V,ref:c,..._(ae?ne:le,V)}};if(o?!Array.isArray(P)||!P.length:h&&(!T&&(U||Hr(P))||ka(P)&&!P||H&&!dk(u).isValid||z&&!mk(u).isValid)){const{value:ae,message:W}=Px(h)?{value:!!h,message:h}:nu(h);if(ae&&(B[N]={type:Il.required,message:W,ref:M,..._(Il.required,W)},!r))return L(W),B}if(!U&&(!Hr(g)||!Hr(y))){let ae,W;const J=nu(y),ne=nu(g);if(!Hr(P)&&!isNaN(P)){const le=c.valueAsNumber||P&&+P;Hr(J.value)||(ae=le>J.value),Hr(ne.value)||(W=le<ne.value)}else{const le=c.valueAsDate||new Date(P),V=ge=>new Date(new Date().toDateString()+" "+ge),Z=c.type=="time",ue=c.type=="week";el(J.value)&&P&&(ae=Z?V(P)>V(J.value):ue?P>J.value:le>new Date(J.value)),el(ne.value)&&P&&(W=Z?V(P)<V(ne.value):ue?P<ne.value:le<new Date(ne.value))}if((ae||W)&&(se(!!ae,J.message,ne.message,Il.max,Il.min),!r))return L(B[N].message),B}if((x||m)&&!U&&(el(P)||o&&Array.isArray(P))){const ae=nu(x),W=nu(m),J=!Hr(ae.value)&&P.length>+ae.value,ne=!Hr(W.value)&&P.length<+W.value;if((J||ne)&&(se(J,ae.message,W.message),!r))return L(B[N].message),B}if(b&&!U&&el(P)){const{value:ae,message:W}=nu(b);if(t0(ae)&&!P.match(ae)&&(B[N]={type:Il.pattern,message:W,ref:c,..._(Il.pattern,W)},!r))return L(W),B}if(w){if(Si(w)){const ae=await w(P,n),W=GN(ae,M);if(W&&(B[N]={...W,..._(Il.validate,W.message)},!r))return L(W.message),B}else if(zn(w)){let ae={};for(const W in w){if(!Kr(ae)&&!r)break;const J=GN(await w[W](P,n),M,W);J&&(ae={...J,..._(W,J.message)},L(J.message),r&&(B[N]=ae))}if(!Kr(ae)&&(B[N]={ref:M,...ae},!r))return B}}return L(!0),B};const PU={mode:Ci.onSubmit,reValidateMode:Ci.onChange,shouldFocusError:!0};function EU(s={}){let t={...PU,...s},n={submitCount:0,isDirty:!1,isLoading:Si(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let a=zn(t.defaultValues)||zn(t.values)?pr(t.values||t.defaultValues)||{}:{},o=t.shouldUnregister?{}:pr(a),c={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},h,x=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...m};const y={array:LN(),state:LN()},b=WN(t.mode),w=WN(t.reValidateMode),N=t.criteriaMode===Ci.all,k=A=>D=>{clearTimeout(x),x=setTimeout(A,D)},E=async A=>{if(!t.disabled&&(m.isValid||g.isValid||A)){const D=t.resolver?Kr((await U()).errors):await se(r,!0);D!==n.isValid&&y.state.next({isValid:D})}},P=(A,D)=>{!t.disabled&&(m.isValidating||m.validatingFields||g.isValidating||g.validatingFields)&&((A||Array.from(u.mount)).forEach(ie=>{ie&&(D?sn(n.validatingFields,ie,D):er(n.validatingFields,ie))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Kr(n.validatingFields)}))},M=(A,D=[],ie,$e,ke=!0,S=!0)=>
vendor: 11,976 bytes, line 538
538{if($e&&ie&&!t.disabled){if(c.action=!0,S&&Array.isArray(gt(r,A))){const ve=ie(gt(r,A),$e.argA,$e.argB);ke&&sn(r,A,ve)}if(S&&Array.isArray(gt(n.errors,A))){const ve=ie(gt(n.errors,A),$e.argA,$e.argB);ke&&sn(n.errors,A,ve),kU(n.errors,A)}if((m.touchedFields||g.touchedFields)&&S&&Array.isArray(gt(n.touchedFields,A))){const ve=ie(gt(n.touchedFields,A),$e.argA,$e.argB);ke&&sn(n.touchedFields,A,ve)}(m.dirtyFields||g.dirtyFields)&&(n.dirtyFields=eh(a,o)),y.state.next({name:A,isDirty:W(A,D),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else sn(o,A,D)},L=(A,D)=>{sn(n.errors,A,D),y.state.next({errors:n.errors})},B=A=>{n.errors=A,y.state.next({errors:n.errors,isValid:!1})},z=(A,D,ie,$e)=>{const ke=gt(r,A);if(ke){const S=gt(o,A,Vn(ie)?gt(a,A):ie);Vn(S)||$e&&$e.defaultChecked||D?sn(o,A,D?S:qN(ke._f)):le(A,S),c.mount&&E()}},H=(A,D,ie,$e,ke)=>{let S=!1,ve=!1;const Ze={name:A};if(!t.disabled){if(!ie||$e){(m.isDirty||g.isDirty)&&(ve=n.isDirty,n.isDirty=Ze.isDirty=W(),S=ve!==Ze.isDirty);const Qe=_o(gt(a,A),D);ve=!!gt(n.dirtyFields,A),Qe?er(n.dirtyFields,A):sn(n.dirtyFields,A,!0),Ze.dirtyFields=n.dirtyFields,S=S||(m.dirtyFields||g.dirtyFields)&&ve!==!Qe}if(ie){const Qe=gt(n.touchedFields,A);Qe||(sn(n.touchedFields,A,ie),Ze.touchedFields=n.touchedFields,S=S||(m.touchedFields||g.touchedFields)&&Qe!==ie)}S&&ke&&y.state.next(Ze)}return S?Ze:{}},T=(A,D,ie,$e)=>{const ke=gt(n.errors,A),S=(m.isValid||g.isValid)&&ka(D)&&n.isValid!==D;if(t.delayError&&ie?(h=k(()=>L(A,ie)),h(t.delayError)):(clearTimeout(x),h=null,ie?sn(n.errors,A,ie):er(n.errors,A)),(ie?!_o(ke,ie):ke)||!Kr($e)||S){const ve={...$e,...S&&ka(D)?{isValid:D}:{},errors:n.errors,name:A};n={...n,...ve},y.state.next(ve)}},U=async A=>{P(A,!0);const D=await t.resolver(o,t.context,bU(A||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return P(A),D},_=async A=>{const{errors:D}=await U(A);if(A)for(const ie of A){const $e=gt(D,ie);$e?sn(n.errors,ie,$e):er(n.errors,ie)}else n.errors=D;return D},se=async(A,D,ie={valid:!0})=>{for(const $e in A){const ke=A[$e];if(ke){const{_f:S,...ve}=ke;if(S){const Ze=u.array.has(S.name),Qe=ke._f&&NU(ke._f);Qe&&m.validatingFields&&P([$e],!0);const ct=await ZN(ke,u.disabled,o,N,t.shouldUseNativeValidation&&!D,Ze);if(Qe&&m.validatingFields&&P([$e]),ct[S.name]&&(ie.valid=!1,D))break;!D&&(gt(ct,S.name)?Ze?$U(n.errors,ct,S.name):sn(n.errors,S.name,ct[S.name]):er(n.errors,S.name))}!Kr(ve)&&await se(ve,D,ie)}}return ie.valid},ae=()=>{for(const A of u.unMount){const D=gt(r,A);D&&(D._f.refs?D._f.refs.every(ie=>!lv(ie)):!lv(D._f.ref))&&me(A)}u.unMount=new Set},W=(A,D)=>!t.disabled&&(A&&D&&sn(o,A,D),!_o(Ae(),a)),J=(A,D,ie)=>ak(A,u,{...c.mount?o:Vn(D)?a:el(A)?{[A]:D}:D},ie,D),ne=A=>Y0(gt(c.mount?o:a,A,t.shouldUnregister?gt(a,A,[]):[])),le=(A,D,ie={})=>{const $e=gt(r,A);let ke=D;if($e){const S=$e._f;S&&(!S.disabled&&sn(o,A,uk(D,S)),ke=Jx(S.ref)&&Hr(D)?"":D,lk(S.ref)?[...S.ref.options].forEach(ve=>ve.selected=ke.includes(ve.value)):S.refs?Af(S.ref)?S.refs.length>1?S.refs.forEach(ve=>(!ve.defaultChecked||!ve.disabled)&&(ve.checked=Array.isArray(ke)?!!ke.find(Ze=>Ze===ve.value):ke===ve.value)):S.refs[0]&&(S.refs[0].checked=!!ke):S.refs.forEach(ve=>ve.checked=ve.value===ke):lj(S.ref)?S.ref.value="":(S.ref.value=ke,S.ref.type||y.state.next({name:A,values:pr(o)})))}(ie.shouldDirty||ie.shouldTouch)&&H(A,ke,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&G(A)},V=(A,D,ie)=>{for(const $e in D){const ke=D[$e],S=`${A}.${$e}`,ve=gt(r,S);(u.array.has(A)||zn(ke)||ve&&!ve._f)&&!Hc(ke)?V(S,ke,ie):le(S,ke,ie)}},Z=(A,D,ie={})=>{const $e=gt(r,A),ke=u.array.has(A),S=pr(D);sn(o,A,S),ke?(y.array.next({name:A,values:pr(o)}),(m.isDirty||m.dirtyFields||g.isDirty||g.dirtyFields)&&ie.shouldDirty&&y.state.next({name:A,dirtyFields:eh(a,o),isDirty:W(A,S)})):$e&&!$e._f&&!Hr(S)?V(A,S,ie):le(A,S,ie),KN(A,u)&&y.state.next({...n}),y.state.next({name:c.mount?A:void 0,values:pr(o)})},ue=async A=>{c.mount=!0;const D=A.target;let ie=D.name,$e=!0;const ke=gt(r,ie),S=ve=>{$e=Number.isNaN(ve)||Hc(ve)&&isNaN(ve.getTime())||_o(ve,gt(o,ie,ve))};if(ke){let ve,Ze;const Qe=D.type?qN(ke._f):ek(A),ct=A.type===Xx.BLUR||A.type===Xx.FOCUS_OUT,It=!wU(ke._f)&&!t.resolver&&!gt(n.errors,ie)&&!ke._f.deps||SU(ct,gt(n.touchedFields,ie),n.isSubmitted,w,b),Zs=KN(ie,u,ct);sn(o,ie,Qe),ct?(ke._f.onBlur&&ke._f.onBlur(A),h&&h(0)):ke._f.onChange&&ke._f.onChange(A);const Zt=H(ie,Qe,ct),qn=!Kr(Zt)||Zs;if(!ct&&y.state.next({name:ie,type:A.type,values:pr(o)}),It)return(m.isValid||g.isValid)&&(t.mode==="onBlur"?ct&&E():ct||E()),qn&&y.state.next({name:ie,...Zs?{}:Zt});if(!ct&&Zs&&y.state.next({...n}),t.resolver){const{errors:xn}=await U([ie]);if(S(Qe),$e){const un=HN(n.errors,r,ie),Rt=HN(xn,r,un.name||ie);ve=Rt.error,ie=Rt.name,Ze=Kr(xn)}}else P([ie],!0),ve=(await ZN(ke,u.disabled,o,N,t.shouldUseNativeValidation))[ie],P([ie]),S(Qe),$e&&(ve?Ze=!1:(m.isValid||g.isValid)&&(Ze=await se(r,!0)));$e&&(ke._f.deps&&G(ke._f.deps),T(ie,Ze,ve,Zt))}},ge=(A,D)=>{if(gt(n.errors,D)&&A.focus)return A.focus(),1},G=async(A,D={})=>{let ie,$e;const ke=bh(A);if(t.resolver){const S=await _(Vn(A)?A:ke);ie=Kr(S),$e=A?!ke.some(ve=>gt(S,ve)):ie}else A?($e=(await Promise.all(ke.map(async S=>{const ve=gt(r,S);return await se(ve&&ve._f?{[S]:ve}:ve)}))).every(Boolean),!(!$e&&!n.isValid)&&E()):$e=ie=await se(r);return y.state.next({...!el(A)||(m.isValid||g.isValid)&&ie!==n.isValid?{}:{name:A},...t.resolver||!A?{isValid:ie}:{},errors:n.errors}),D.shouldFocus&&!$e&&Nh(r,ge,A?ke:u.mount),$e},Ae=A=>{const D={...c.mount?o:a};return Vn(A)?D:el(A)?gt(D,A):A.map(ie=>gt(D,ie))},Fe=(A,D)=>({invalid:!!gt((D||n).errors,A),isDirty:!!gt((D||n).dirtyFields,A),error:gt((D||n).errors,A),isValidating:!!gt(n.validatingFields,A),isTouched:!!gt((D||n).touchedFields,A)}),be=A=>{A&&bh(A).forEach(D=>er(n.errors,D)),y.state.next({errors:A?n.errors:{}})},Me=(A,D,ie)=>{const $e=(gt(r,A,{_f:{}})._f||{}).ref,ke=gt(n.errors,A)||{},{ref:S,message:ve,type:Ze,...Qe}=ke;sn(n.errors,A,{...Qe,...D,ref:$e}),y.state.next({name:A,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&$e&&$e.focus&&$e.focus()},R=(A,D)=>Si(A)?y.state.subscribe({next:ie=>A(J(void 0,D),ie)}):J(A,D,!0),re=A=>y.state.subscribe({next:D=>{CU(A.name,D.name,A.exact)&&AU(D,A.formState||m,X,A.reRenderRoot)&&A.callback({values:{...o},...n,...D})}}).unsubscribe,O=A=>(c.mount=!0,g={...g,...A.formState},re({...A,formState:g})),me=(A,D={})=>{for(const ie of A?bh(A):u.mount)u.mount.delete(ie),u.array.delete(ie),D.keepValue||(er(r,ie),er(o,ie)),!D.keepError&&er(n.errors,ie),!D.keepDirty&&er(n.dirtyFields,ie),!D.keepTouched&&er(n.touchedFields,ie),!D.keepIsValidating&&er(n.validatingFields,ie),!t.shouldUnregister&&!D.keepDefaultValue&&er(a,ie);y.state.next({values:pr(o)}),y.state.next({...n,...D.keepDirty?{isDirty:W()}:{}}),!D.keepIsValid&&E()},Y=({disabled:A,name:D})=>{(ka(A)&&c.mount||A||u.disabled.has(D))&&(A?u.disabled.add(D):u.disabled.delete(D))},Te=(A,D={})=>{let ie=gt(r,A);const $e=ka(D.disabled)||ka(t.disabled);return sn(r,A,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:A}},name:A,mount:!0,...D}}),u.mount.add(A),ie?Y({disabled:ka(D.disabled)?D.disabled:t.disabled,name:A}):z(A,!0,D.value),{...$e?{disabled:D.disabled||t.disabled}:{},...t.progressive?{required:!!D.required,min:th(D.min),max:th(D.max),minLength:th(D.minLength),maxLength:th(D.maxLength),pattern:th(D.pattern)}:{},name:A,onChange:ue,onBlur:ue,ref:ke=>{if(ke){Te(A,D),ie=gt(r,A);const S=Vn(ke.value)&&ke.querySelectorAll&&ke.querySelectorAll("input,select,textarea")[0]||ke,ve=yU(S),Ze=ie._f.refs||[];if(ve?Ze.find(Qe=>Qe===S):S===ie._f.ref)return;sn(r,A,{_f:{...ie._f,...ve?{refs:[...Ze.filter(lv),S,...Array.isArray(gt(a,A))?[{}]:[]],ref:{type:S.type,name:A}}:{ref:S}}}),z(A,!1,void 0,S)}else ie=gt(r,A,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(tk(u.array,A)&&c.action)&&u.unMount.add(A)}}},Be=()=>t.shouldFocusError&&Nh(r,ge,u.mount),ht=A=>{ka(A)&&(y.state.next({disabled:A}),Nh(r,(D,ie)=>{const $e=gt(r,ie);$e&&(D.disabled=$e._f.disabled||A,Array.isArray($e._f.refs)&&$e._f.refs.forEach(ke=>{ke.disabled=$e._f.disabled||A}))},0,!1))},Mt=(A,D)=>async ie=>{let $e;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let ke=pr(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:S,values:ve}=await U();n.errors=S,ke=ve}else await se(r);if(u.disabled.size)for(const S of u.disabled)sn(ke,S,void 0);if(er(n.errors,"root"),Kr(n.errors)){y.state.next({errors:{}});try{await A(ke,ie)}catch(S){$e=S}}else D&&await D({...n.errors},ie),Be(),setTimeout(Be);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Kr(n.errors)&&!$e,submitCount:n.submitCount+1,errors:n.errors}),$e)throw $e},$=(A,D={})=>{gt(r,A)&&(Vn(D.defaultValue)?Z(A,pr(gt(a,A))):(Z(A,D.defaultValue),sn(a,A,pr(D.defaultValue))),D.keepTouched||er(n.touchedFields,A),D.keepDirty||(er(n.dirtyFields,A),n.isDirty=D.defaultValue?W(A,pr(gt(a,A))):W()),D.keepError||(er(n.errors,A),m.isValid&&E()),y.state.next({...n}))},K=(A,D={})=>{const ie=A?pr(A):a,$e=pr(ie),ke=Kr(A),S=ke?a:$e;if(D.keepDefaultValues||(a=ie),!D.keepValues){if(D.keepDirtyValues){const ve=new Set([...u.mount,...Object.keys(eh(a,o))]);for(const Ze of Array.from(ve))gt(n.dirtyFields,Ze)?sn(S,Ze,gt(o,Ze)):Z(Ze,gt(S,Ze))}else{if(aj&&Vn(A))for(const ve of u.mount){const Ze=gt(r,ve);if(Ze&&Ze._f){const Qe=Array.isArray(Ze._f.refs)?Ze._f.refs[0]:Ze._f.ref;if(Jx(Qe)){const ct=Qe.closest("form");if(ct){ct.reset();break}}}}for(const ve of u.mount)Z(ve,gt(S,ve))}o=pr(S),y.array.next({values:{...S}}),y.state.next({values:{...S}})}u={mount:D.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!m.isValid||!!D.keepIsValid||!!D.keepDirtyValues,c.watch=!!t.shouldUnregister,y.state.next({submitCount:D.keepSubmitCount?n.submitCount:0,isDirty:ke?!1:D.keepDirty?n.isDirty:!!(D.keepDefaultValues&&!_o(A,a)),isSubmitted:D.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ke?{}:D.keepDirtyValues?D.keepDefaultValues&&o?eh(a,o):n.dirtyFields:D.keepDefaultValues&&A?eh(a,A):D.keepDirty?n.dirtyFields:{},touchedFields:D.keepTouched?n.touchedFields:{},errors:D.keepErrors?n.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},xe=(A,D)=>K(Si(A)?A(o):A,D),De=(A,D={})=>{const ie=gt(r,A),$e=ie&&ie._f;if($e){const ke=$e.refs?$e.refs[0]:$e.ref;ke.focus&&(ke.focus(),D.shouldSelect&&Si(ke.select)&&ke.select())}},X=A=>{n={...n,...A}},Le={control:{register:Te,unregister:me,getFieldState:Fe,handleSubmit:Mt,setError:Me,_subscribe:re,_runSchema:U,_getWatch:J,_getDirty:W,_setValid:E,_setFieldArray:M,_setDisabledField:Y,_setErrors:B,_getFieldArray:ne,_reset:K,_resetDefaultValues:()=>Si(t.defaultValues)&&t.defaultValues().then(A=>{xe(A,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:ae,_disableForm:ht,_subjects:y,_proxyFormState:m,get _fields(){return r},get _formValues(){return o},get _state(){return c},set _state(A){c=A},get _defaultValues(){return a},get _names(){return u},set _names(A){u=A},get _formState(){return n},get _options(){return t},set _options(A){t={...t,...A}}},subscribe:O,trigger:G,register:Te,handleSubmit:Mt,watch:R,setValue:Z,getValues:Ae,reset:xe,resetField:$,clearErrors:be,unregister:me,setError:Me,setFocus:De,getFieldState:Fe};return{...Le,formControl:Le}}function Da(s={}){const t=Ut.useRef(void 0),n=Ut.useRef(void 0),[r,a]=Ut.useState({isDirty:!1,isValidating:!1,isLoading:Si(s.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1,defaultValues:Si(s.defaultValues)?void 0:s.defaultValues});t.current||(t.current={...s.formControl?s.formControl:EU(s),formState:r},s.formControl&&s.defaultValues&&!Si(s.defaultValues)&&s.formControl.reset(s.defaultValues,s.resetOptions));const o=t.current.control;return o._options=s,Ut.useLayoutEffect(()=>o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}
vendor: 58,335 bytes, line 538
538),reRenderRoot:!0}),[o]),Ut.useEffect(()=>o._disableForm(s.disabled),[o,s.disabled]),Ut.useEffect(()=>{if(o._proxyFormState.isDirty){const c=o._getDirty();c!==r.isDirty&&o._subjects.state.next({isDirty:c})}},[o,r.isDirty]),Ut.useEffect(()=>{s.values&&!_o(s.values,n.current)?(o._reset(s.values,o._options.resetOptions),n.current=s.values,a(c=>({...c}))):o._resetDefaultValues()},[s.values,o]),Ut.useEffect(()=>{s.errors&&!Kr(s.errors)&&o._setErrors(s.errors)},[s.errors,o]),Ut.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Ut.useEffect(()=>{s.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[s.shouldUnregister,o]),t.current.formState=rk(r,o),t.current}const YN=(s,t,n)=>{if(s&&"reportValidity"in s){const r=gt(n,t);s.setCustomValidity(r&&r.message||""),s.reportValidity()}},hk=(s,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?YN(r.ref,n,s):r.refs&&r.refs.forEach(a=>YN(a,n,s))}},TU=(s,t)=>{t.shouldUseNativeValidation&&hk(s,t);const n={};for(const r in s){const a=gt(t.fields,r),o=Object.assign(s[r]||{},{ref:a&&a.ref});if(_U(t.names||Object.keys(s),r)){const c=Object.assign({},gt(n,r));sn(c,"root",o),sn(n,r,c)}else sn(n,r,o)}return n},_U=(s,t)=>s.some(n=>n.startsWith(t+"."));var IU=function(s,t){for(var n={};s.length;){var r=s[0],a=r.code,o=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[c]={message:u.message,type:u.code}}else n[c]={message:o,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(g){return s.push(g)})}),t){var h=n[c].types,x=h&&h[r.code];n[c]=ik(c,t,n,a,x?[].concat(x,r.message):r.message)}s.shift()}return n},Oa=function(s,t,n){return n===void 0&&(n={}),function(r,a,o){try{return Promise.resolve(function(c,u){try{var h=Promise.resolve(s[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(x){return o.shouldUseNativeValidation&&hk({},o),{errors:{},values:n.raw?r:x}})}catch(x){return u(x)}return h&&h.then?h.then(void 0,u):h}(0,function(c){if(function(u){return Array.isArray(u==null?void 0:u.errors)}(c))return{values:{},errors:TU(IU(c.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw c}))}catch(c){return Promise.reject(c)}}},Ws;(function(s){s.assertEqual=a=>a;function t(a){}s.assertIs=t;function n(a){throw new Error}s.assertNever=n,s.arrayToEnum=a=>{const o={};for(const c of a)o[c]=c;return o},s.getValidEnumValues=a=>{const o=s.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),c={};for(const u of o)c[u]=a[u];return s.objectValues(c)},s.objectValues=a=>s.objectKeys(a).map(function(o){return a[o]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&o.push(c);return o},s.find=(a,o)=>{for(const c of a)if(o(c))return c},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}s.joinValues=r,s.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(Ws||(Ws={}));var p1;(function(s){s.mergeShapes=(t,n)=>({...t,...n})})(p1||(p1={}));const wt=Ws.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ll=s=>{switch(typeof s){case"undefined":return wt.undefined;case"string":return wt.string;case"number":return isNaN(s)?wt.nan:wt.number;case"boolean":return wt.boolean;case"function":return wt.function;case"bigint":return wt.bigint;case"symbol":return wt.symbol;case"object":return Array.isArray(s)?wt.array:s===null?wt.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?wt.promise:typeof Map<"u"&&s instanceof Map?wt.map:typeof Set<"u"&&s instanceof Set?wt.set:typeof Date<"u"&&s instanceof Date?wt.date:wt.object;default:return wt.unknown}},lt=Ws.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),DU=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class _a extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},a=o=>{for(const c of o.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let u=r,h=0;for(;h<c.path.length;){const x=c.path[h];h===c.path.length-1?(u[x]=u[x]||{_errors:[]},u[x]._errors.push(n(c))):u[x]=u[x]||{_errors:[]},u=u[x],h++}}};return a(this),r}static assert(t){if(!(t instanceof _a))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ws.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_a.create=s=>new _a(s);const qu=(s,t)=>{let n;switch(s.code){case lt.invalid_type:s.received===wt.undefined?n="Required":n=`Expected ${s.expected}, received ${s.received}`;break;case lt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(s.expected,Ws.jsonStringifyReplacer)}`;break;case lt.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ws.joinValues(s.keys,", ")}`;break;case lt.invalid_union:n="Invalid input";break;case lt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ws.joinValues(s.options)}`;break;case lt.invalid_enum_value:n=`Invalid enum value. Expected ${Ws.joinValues(s.options)}, received '${s.received}'`;break;case lt.invalid_arguments:n="Invalid function arguments";break;case lt.invalid_return_type:n="Invalid function return type";break;case lt.invalid_date:n="Invalid date";break;case lt.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(n=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?n=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?n=`Invalid input: must end with "${s.validation.endsWith}"`:Ws.assertNever(s.validation):s.validation!=="regex"?n=`Invalid ${s.validation}`:n="Invalid";break;case lt.too_small:s.type==="array"?n=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?n=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?n=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?n=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:n="Invalid input";break;case lt.too_big:s.type==="array"?n=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?n=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?n=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?n=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?n=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:n="Invalid input";break;case lt.custom:n="Invalid input";break;case lt.invalid_intersection_types:n="Intersection results could not be merged";break;case lt.not_multiple_of:n=`Number must be a multiple of ${s.multipleOf}`;break;case lt.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ws.assertNever(s)}return{message:n}};let fk=qu;function OU(s){fk=s}function s0(){return fk}const n0=s=>{const{data:t,path:n,errorMaps:r,issueData:a}=s,o=[...n,...a.path||[]],c={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let u="";const h=r.filter(x=>!!x).slice().reverse();for(const x of h)u=x(c,{data:t,defaultError:u}).message;return{...a,path:o,message:u}},FU=[];function yt(s,t){const n=s0(),r=n0({issueData:t,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,n,n===qu?void 0:qu].filter(a=>!!a)});s.common.issues.push(r)}class Fr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return rs;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const o=await a.key,c=await a.value;r.push({key:o,value:c})}return Fr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:o,value:c}=a;if(o.status==="aborted"||c.status==="aborted")return rs;o.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(r[o.value]=c.value)}return{status:t.value,value:r}}}const rs=Object.freeze({status:"aborted"}),uu=s=>({status:"dirty",value:s}),Jr=s=>({status:"valid",value:s}),x1=s=>s.status==="aborted",g1=s=>s.status==="dirty",md=s=>s.status==="valid",_h=s=>typeof Promise<"u"&&s instanceof Promise;function r0(s,t,n,r){if(typeof t=="function"?s!==t||!0:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(s)}function pk(s,t,n,r,a){if(typeof t=="function"?s!==t||!0:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(s,n),n}var Ft;(function(s){s.errToObj=t=>typeof t=="string"?{message:t}:t||{},s.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ft||(Ft={}));var fh,ph;class il{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const QN=(s,t)=>{if(md(t))return{success:!0,data:t.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new _a(s.common.issues);return this._error=n,this._error}}};function xs(s){if(!s)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=s;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(c,u)=>{var h,x;const{message:m}=s;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(h=m??r)!==null&&h!==void 0?h:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(x=m??n)!==null&&x!==void 0?x:u.defaultError}},description:a}}class ws{get description(){return this._def.description}_getType(t){return Ll(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ll(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fr,ctx:{common:t.parent.common,data:t.data,parsedType:Ll(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(_h(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ll(t)},o=this._parseSync({data:t,path:a.path,parent:a});return QN(a,o)}"~validate"(t){var n,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ll(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:a});return md(o)?{value:o.value}:{issues:a.common.issues}}catch(o){!((r=(n=o==null?void 0:o.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(o=>md(o)?{value:o.value}:{issues:a.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ll(t)},a=this._parse({data:t,path:r.path,parent:r}),o=await(_h(a)?a:Promise.resolve(a));return QN(r,o)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,o)=>{const c=t(a),u=()=>o.addIssue({code:lt.custom,...r(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new _i({schema:this,typeName:Jt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nl.create(this,this._def)}nullable(){return rc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pi.create(this)}promise(){return Bu.create(this,this._def)}or(t){return Fh.create([this,t],this._def)}and(t){return Rh.create(this,t,this._def)}transform(t){return new _i({...xs(this._def),schema:this,typeName:Jt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new zh({...xs(this._def),innerType:this,defaultValue:n,typeName:Jt.ZodDefault})}brand(){return new cj({typeName:Jt.ZodBranded,type:this,...xs(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qh({...xs(this._def),innerType:this,catchValue:n,typeName:Jt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Cf.create(this,t)}readonly(){return Wh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const RU=/^c[^\s-]{8,}$/i,MU=/^[0-9a-z]+$/,LU=/^[0-9A-HJKMNP-TV-Z]{26}$/i,VU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UU=/^[a-z0-9_-]{21}$/i,zU=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qU=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,WU=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ov;const KU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,HU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,GU=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZU=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YU=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QU=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xk="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",XU=new RegExp(`^${xk}$`);function gk(s){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?t=`${t}\\.\\d{${s.precision}}`:s.precision==null&&(t=`${t}(\\.\\d+)?`),t}function JU(s){return new RegExp(`^${gk(s)}$`)}function yk(s){let t=`${xk}T${gk(s)}`;const n=[];return n.push(s.local?"Z?":"Z"),s.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ez(s,t){return!!((t==="v4"||!t)&&KU.test(s)||(t==="v6"||!t)&&GU.test(s))}function tz(s,t){if(!zU.test(s))return!1;try{const[n]=s.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function sz(s,t){return!!((t==="v4"||!t)&&HU.test(s)||(t==="v6"||!t)&&ZU.test(s))}class ki extends ws{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==wt.string){const o=this._getOrReturnCtx(t);return yt(o,{code:lt.invalid_type,expected:wt.string,received:o.parsedType}),rs}const r=new Fr;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const c=t.data.length>o.value,u=t.data.length<o.value;(c||u)&&(a=this._getOrReturnCtx(t,a),c?yt(a,{code:lt.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&yt(a,{code:lt.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")WU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"email",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")ov||(ov=new RegExp(BU,"u")),ov.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"emoji",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")VU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"uuid",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")UU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"nanoid",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")RU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"cuid",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")MU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"cuid2",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")LU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"ulid",code:lt.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),yt(a,{validation:"url",code:lt.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"regex",code:lt.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?yk(o).test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?XU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?JU(o).test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?qU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"duration",code:lt.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?ez(t.data,o.version)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"ip",code:lt.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?tz(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"jwt",code:lt.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?sz(t.data,o.version)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"cidr",code:lt.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?YU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"base64",code:lt.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?QU.test(t.data)||(a=this._getOrReturnCtx(t,a),yt(a,{validation:"base64url",code:lt.invalid_string,message:o.message}),r.dirty()):Ws.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:lt.invalid_string,...Ft.errToObj(r)})}_addCheck(t){return new ki({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ft.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ft.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ft.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ft.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ft.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ft.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ft.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ft.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ft.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ft.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ft.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ft.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ft.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ft.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ft.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ft.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ft.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ft.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ft.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ft.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ft.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ft.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ft.errToObj(n)})}nonempty(t){return this.min(1,Ft.errToObj(t))}trim(){return new ki({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ki({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ki({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ki.create=s=>{var t;return new ki({checks:[],typeName:Jt.ZodString,coerce:(t=s==null?void 0:s.coerce)!==null&&t!==void 0?t:!1,...xs(s)})};function nz(s,t){const n=(s.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,o=parseInt(s.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return o%c/Math.pow(10,a)}class tc extends ws{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==wt.number){const o=this._getOrReturnCtx(t);return yt(o,{code:lt.invalid_type,expected:wt.number,received:o.parsedType}),rs}let r;const a=new Fr;for(const o of this._def.checks)o.kind==="int"?Ws.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?nz(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_finite,message:o.message}),a.dirty()):Ws.assertNever(o);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ft.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ft.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ft.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ft.toString(n))}setLimit(t,n,r,a){return new tc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ft.toString(a)}]})}_addCheck(t){return new tc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ft.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ft.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ft.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ft.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ft.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ft.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ft.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ft.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ws.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}tc.create=s=>new tc({checks:[],typeName:Jt.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...xs(s)});class sc extends ws{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==wt.bigint)return this._getInvalidInput(t);let r;const a=new Fr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):Ws.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return yt(n,{code:lt.invalid_type,expected:wt.bigint,received:n.parsedType}),rs}gte(t,n){return this.setLimit("min",t,!0,Ft.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ft.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ft.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ft.toString(n))}setLimit(t,n,r,a){return new sc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ft.toString(a)}]})}_addCheck(t){return new sc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}sc.create=s=>{var t;return new sc({checks:[],typeName:Jt.ZodBigInt,coerce:(t=s==null?void 0:s.coerce)!==null&&t!==void 0?t:!1,...xs(s)})};class Ih extends ws{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==wt.boolean){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.boolean,received:r.parsedType}),rs}return Jr(t.data)}}Ih.create=s=>new Ih({typeName:Jt.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...xs(s)});class hd extends ws{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==wt.date){const o=this._getOrReturnCtx(t);return yt(o,{code:lt.invalid_type,expected:wt.date,received:o.parsedType}),rs}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return yt(o,{code:lt.invalid_date}),rs}const r=new Fr;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),yt(a,{code:lt.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ws.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hd({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ft.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ft.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}hd.create=s=>new hd({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:Jt.ZodDate,...xs(s)});class a0 extends ws{_parse(t){if(this._getType(t)!==wt.symbol){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.symbol,received:r.parsedType}),rs}return Jr(t.data)}}a0.create=s=>new a0({typeName:Jt.ZodSymbol,...xs(s)});class Dh extends ws{_parse(t){if(this._getType(t)!==wt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.undefined,received:r.parsedType}),rs}return Jr(t.data)}}Dh.create=s=>new Dh({typeName:Jt.ZodUndefined,...xs(s)});class Oh extends ws{_parse(t){if(this._getType(t)!==wt.null){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.null,received:r.parsedType}),rs}return Jr(t.data)}}Oh.create=s=>new Oh({typeName:Jt.ZodNull,...xs(s)});class Wu extends ws{constructor(){super(...arguments),this._any=!0}_parse(t){return Jr(t.data)}}Wu.create=s=>new Wu({typeName:Jt.ZodAny,...xs(s)});class id extends ws{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Jr(t.data)}}id.create=s=>new id({typeName:Jt.ZodUnknown,...xs(s)});class Gl extends ws{_parse(t){const n=this._getOrReturnCtx(t);return yt(n,{code:lt.invalid_type,expected:wt.never,received:n.parsedType}),rs}}Gl.create=s=>new Gl({typeName:Jt.ZodNever,...xs(s)});class i0 extends ws{_parse(t){if(this._getType(t)!==wt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.void,received:r.parsedType}),rs}return Jr(t.data)}}i0.create=s=>new i0({typeName:Jt.ZodVoid,...xs(s)});class Pi extends ws{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==wt.array)return yt(n,{code:lt.invalid_type,expected:wt.array,received:n.parsedType}),rs;if(a.exactLength!==null){const c=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(c||u)&&(yt(n,{code:c?lt.too_big:lt.too_small,minimum:u?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(yt(n,{code:lt.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(yt(n,{code:lt.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>a.type._parseAsync(new il(n,c,n.path,u)))).then(c=>Fr.mergeArray(r,c));const o=[...n.data].map((c,u)=>a.type._parseSync(new il(n,c,n.path,u)));return Fr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Pi({...this._def,minLength:{value:t,message:Ft.toString(n)}})}max(t,n){return new Pi({...this._def,maxLength:{value:t,message:Ft.toString(n)}})}length(t,n){return new Pi({...this._def,exactLength:{value:t,message:Ft.toString(n)}})}nonempty(t){return this.min(1,t)}}Pi.create=(s,t)=>new Pi({type:s,minLength:null,maxLength:null,exactLength:null,typeName:Jt.ZodArray,...xs(t)});function du(s){if(s instanceof $n){const t={};for(const n in s.shape){const r=s.shape[n];t[n]=nl.create(du(r))}return new $n({...s._def,shape:()=>t})}else return s instanceof Pi?new Pi({...s._def,type:du(s.element)}):s instanceof nl?nl.create(du(s.unwrap())):s instanceof rc?rc.create(du(s.unwrap())):s instanceof ll?ll.create(s.items.map(t=>du(t))):s}class $n extends ws{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ws.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==wt.object){const x=this._getOrReturnCtx(t);return yt(x,{code:lt.invalid_type,expected:wt.object,received:x.parsedType}),rs}const{status:r,ctx:a}=this._processInputParams(t),{shape:o,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Gl&&this._def.unknownKeys==="strip"))for(const x in a.data)c.includes(x)||u.push(x);const h=[];for(const x of c){const m=o[x],g=a.data[x];h.push({key:{status:"valid",value:x},value:m._parse(new il(a,g,a.path,x)),alwaysSet:x in a.data})}if(this._def.catchall instanceof Gl){const x=this._def.unknownKeys;if(x==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(x==="strict")u.length>0&&(yt(a,{code:lt.unrecognized_keys,keys:u}),r.dirty());else if(x!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const x=this._def.catchall;for(const m of u){const g=a.data[m];h.push({key:{status:"valid",value:m},value:x._parse(new il(a,g,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const x=[];for(const m of h){const g=await m.key,y=await m.value;x.push({key:g,value:y,alwaysSet:m.alwaysSet})}return x}).then(x=>Fr.mergeObjectSync(r,x)):Fr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return Ft.errToObj,new $n({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o,c,u;const h=(c=(o=(a=this._def).errorMap)===null||o===void 0?void 0:o.call(a,n,r).message)!==null&&c!==void 0?c:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Ft.errToObj(t).message)!==null&&u!==void 0?u:h}:{message:h}}}:{}})}strip(){return new $n({...this._def,unknownKeys:"strip"})}passthrough(){return new $n({...this._def,unknownKeys:"passthrough"})}extend(t){return new $n({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new $n({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Jt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new $n({...this._def,catchall:t})}pick(t){const n={};return Ws.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new $n({...this._def,shape:()=>n})}omit(t){const n={};return Ws.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new $n({...this._def,shape:()=>n})}deepPartial(){return du(this)}partial(t){const n={};return Ws.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new $n({...this._def,shape:()=>n})}required(t){const n={};return Ws.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof nl;)o=o._def.innerType;n[r]=o}}),new $n({...this._def,shape:()=>n})}keyof(){return vk(Ws.objectKeys(this.shape))}}$n.create=(s,t)=>new $n({shape:()=>s,unknownKeys:"strip",catchall:Gl.create(),typeName:Jt.ZodObject,...xs(t)});$n.strictCreate=(s,t)=>new $n({shape:()=>s,unknownKeys:"strict",catchall:Gl.create(),typeName:Jt.ZodObject,...xs(t)});$n.lazycreate=(s,t)=>new $n({shape:s,unknownKeys:"strip",catchall:Gl.create(),typeName:Jt.ZodObject,...xs(t)});class Fh extends ws{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=o.map(u=>new _a(u.ctx.common.issues));return yt(n,{code:lt.invalid_union,unionErrors:c}),rs}if(n.common.async)return Promise.all(r.map(async o=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(a);{let o;const c=[];for(const h of r){const x={...n,common:{...n.common,issues:[]},parent:null},m=h._parseSync({data:n.data,path:n.path,parent:x});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:x}),x.common.issues.length&&c.push(x.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=c.map(h=>new _a(h));return yt(n,{code:lt.invalid_union,unionErrors:u}),rs}}get options(){return this._def.options}}Fh.create=(s,t)=>new Fh({options:s,typeName:Jt.ZodUnion,...xs(t)});const Fl=s=>s instanceof Lh?Fl(s.schema):s instanceof _i?Fl(s.innerType()):s instanceof Vh?[s.value]:s instanceof nc?s.options:s instanceof Uh?Ws.objectValues(s.enum):s instanceof zh?Fl(s._def.innerType):s instanceof Dh?[void 0]:s instanceof Oh?[null]:s instanceof nl?[void 0,...Fl(s.unwrap())]:s instanceof rc?[null,...Fl(s.unwrap())]:s instanceof cj||s instanceof Wh?Fl(s.unwrap()):s instanceof qh?Fl(s._def.innerType):[];class X0 extends ws{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==wt.object)return yt(n,{code:lt.invalid_type,expected:wt.object,received:n.parsedType}),rs;const r=this.discriminator,a=n.data[r],o=this.optionsMap.get(a);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(yt(n,{code:lt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),rs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const o of n){const c=Fl(o.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(a.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);a.set(u,o)}}return new X0({typeName:Jt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...xs(r)})}}function y1(s,t){const n=Ll(s),r=Ll(t);if(s===t)return{valid:!0,data:s};if(n===wt.object&&r===wt.object){const a=Ws.objectKeys(t),o=Ws.objectKeys(s).filter(u=>a.indexOf(u)!==-1),c={...s,...t};for(const u of o){const h=y1(s[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===wt.array&&r===wt.array){if(s.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<s.length;o++){const c=s[o],u=t[o],h=y1(c,u);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return n===wt.date&&r===wt.date&&+s==+t?{valid:!0,data:s}:{valid:!1}}class Rh extends ws{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(o,c)=>{if(x1(o)||x1(c))return rs;const u=y1(o.value,c.value);return u.valid?((g1(o)||g1(c))&&n.dirty(),{status:n.value,value:u.data}):(yt(r,{code:lt.invalid_intersection_types}),rs)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,c])=>a(o,c)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Rh.create=(s,t,n)=>new Rh({left:s,right:t,typeName:Jt.ZodIntersection,...xs(n)});class ll extends ws{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==wt.array)return yt(r,{code:lt.invalid_type,expected:wt.array,received:r.parsedType}),rs;if(r.data.length<this._def.items.length)return yt(r,{code:lt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),rs;!this._def.rest&&r.data.length>this._def.items.length&&(yt(r,{code:lt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((c,u)=>{const h=this._def.items[u]||this._def.rest;return h?h._parse(new il(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(o).then(c=>Fr.mergeArray(n,c)):Fr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ll({...this._def,rest:t})}}ll.create=(s,t)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ll({items:s,typeName:Jt.ZodTuple,rest:null,...xs(t)})};class Mh extends ws{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==wt.object)return yt(r,{code:lt.invalid_type,expected:wt.object,received:r.parsedType}),rs;const a=[],o=this._def.keyType,c=this._def.valueType;for(const u in r.data)a.push({key:o._parse(new il(r,u,r.path,u)),value:c._parse(new il(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?Fr.mergeObjectAsync(n,a):Fr.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ws?new Mh({keyType:t,valueType:n,typeName:Jt.ZodRecord,...xs(r)}):new Mh({keyType:ki.create(),valueType:t,typeName:Jt.ZodRecord,...xs(n)})}}class l0 extends ws{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==wt.map)return yt(r,{code:lt.invalid_type,expected:wt.map,received:r.parsedType}),rs;const a=this._def.keyType,o=this._def.valueType,c=[...r.data.entries()].map(([u,h],x)=>({key:a._parse(new il(r,u,r.path,[x,"key"])),value:o._parse(new il(r,h,r.path,[x,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const h of c){const x=await h.key,m=await h.value;if(x.status==="aborted"||m.status==="aborted")return rs;(x.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(x.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const h of c){const x=h.key,m=h.value;if(x.status==="aborted"||m.status==="aborted")return rs;(x.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(x.value,m.value)}return{status:n.value,value:u}}}}l0.create=(s,t,n)=>new l0({valueType:t,keyType:s,typeName:Jt.ZodMap,...xs(n)});class fd extends ws{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==wt.set)return yt(r,{code:lt.invalid_type,expected:wt.set,received:r.parsedType}),rs;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(yt(r,{code:lt.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(yt(r,{code:lt.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const o=this._def.valueType;function c(h){const x=new Set;for(const m of h){if(m.status==="aborted")return rs;m.status==="dirty"&&n.dirty(),x.add(m.value)}return{status:n.value,value:x}}const u=[...r.data.values()].map((h,x)=>o._parse(new il(r,h,r.path,x)));return r.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new fd({...this._def,minSize:{value:t,message:Ft.toString(n)}})}max(t,n){return new fd({...this._def,maxSize:{value:t,message:Ft.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fd.create=(s,t)=>new fd({valueType:s,minSize:null,maxSize:null,typeName:Jt.ZodSet,...xs(t)});class yu extends ws{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==wt.function)return yt(n,{code:lt.invalid_type,expected:wt.function,received:n.parsedType}),rs;function r(u,h){return n0({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s0(),qu].filter(x=>!!x),issueData:{code:lt.invalid_arguments,argumentsError:h}})}function a(u,h){return n0({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s0(),qu].filter(x=>!!x),issueData:{code:lt.invalid_return_type,returnTypeError:h}})}const o={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof Bu){const u=this;return Jr(async function(...h){const x=new _a([]),m=await u._def.args.parseAsync(h,o).catch(b=>{throw x.addIssue(r(h,b)),x}),g=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(g,o).catch(b=>{throw x.addIssue(a(g,b)),x})})}else{const u=this;return Jr(function(...h){const x=u._def.args.safeParse(h,o);if(!x.success)throw new _a([r(h,x.error)]);const m=Reflect.apply(c,this,x.data),g=u._def.returns.safeParse(m,o);if(!g.success)throw new _a([a(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new yu({...this._def,args:ll.create(t).rest(id.create())})}returns(t){return new yu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new yu({args:t||ll.create([]).rest(id.create()),returns:n||id.create(),typeName:Jt.ZodFunction,...xs(r)})}}class Lh extends ws{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Lh.create=(s,t)=>new Lh({getter:s,typeName:Jt.ZodLazy,...xs(t)});class Vh extends ws{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return yt(n,{received:n.data,code:lt.invalid_literal,expected:this._def.value}),rs}return{status:"valid",value:t.data}}get value(){return this._def.value}}Vh.create=(s,t)=>new Vh({value:s,typeName:Jt.ZodLiteral,...xs(t)});function vk(s,t){return new nc({values:s,typeName:Jt.ZodEnum,...xs(t)})}class nc extends ws{constructor(){super(...arguments),fh.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{expected:Ws.joinValues(r),received:n.parsedType,code:lt.invalid_type}),rs}if(r0(this,fh)||pk(this,fh,new Set(this._def.values)),!r0(this,fh).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{received:n.data,code:lt.invalid_enum_value,options:r}),rs}return Jr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return nc.create(t,{...this._def,...n})}exclude(t,n=this._def){return nc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}fh=new WeakMap;nc.create=vk;class Uh extends ws{constructor(){super(...arguments),ph.set(this,void 0)}_parse(t){const n=Ws.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==wt.string&&r.parsedType!==wt.number){const a=Ws.objectValues(n);return yt(r,{expected:Ws.joinValues(a),received:r.parsedType,code:lt.invalid_type}),rs}if(r0(this,ph)||pk(this,ph,new Set(Ws.getValidEnumValues(this._def.values))),!r0(this,ph).has(t.data)){const a=Ws.objectValues(n);return yt(r,{received:r.data,code:lt.invalid_enum_value,options:a}),rs}return Jr(t.data)}get enum(){return this._def.values}}ph=new WeakMap;Uh.create=(s,t)=>new Uh({values:s,typeName:Jt.ZodNativeEnum,...xs(t)});class Bu extends ws{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==wt.promise&&n.common.async===!1)return yt(n,{code:lt.invalid_type,expected:wt.promise,received:n.parsedType}),rs;const r=n.parsedType===wt.promise?n.data:Promise.resolve(n.data);return Jr(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Bu.create=(s,t)=>new Bu({type:s,typeName:Jt.ZodPromise,...xs(t)});class _i extends ws{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Jt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:c=>{yt(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const c=a.transform(r.data,o);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return rs;const h=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return h.status==="aborted"?rs:h.status==="dirty"||n.value==="dirty"?uu(h.value):h});{if(n.value==="aborted")return rs;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?rs:u.status==="dirty"||n.value==="dirty"?uu(u.value):u}}if(a.type==="refinement"){const c=u=>{const h=a.refinement(u,o);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?rs:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?rs:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!md(c))return c;const u=a.transform(c.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>md(c)?Promise.resolve(a.transform(c.value,o)).then(u=>({status:n.value,value:u})):c);Ws.assertNever(a)}}_i.create=(s,t,n)=>new _i({schema:s,typeName:Jt.ZodEffects,effect:t,...xs(n)});_i.createWithPreprocess=(s,t,n)=>new _i({schema:t,effect:{type:"preprocess",transform:s},typeName:Jt.ZodEffects,...xs(n)});class nl extends ws{_parse(t){return this._getType(t)===wt.undefined?Jr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}nl.create=(s,t)=>new nl({innerType:s,typeName:Jt.ZodOptional,...xs(t)});class rc extends ws{_parse(t){return this._getType(t)===wt.null?Jr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rc.create=(s,t)=>new rc({innerType:s,typeName:Jt.ZodNullable,...xs(t)});class zh extends ws{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===wt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}zh.create=(s,t)=>new zh({innerType:s,typeName:Jt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xs(t)});class qh extends ws{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _h(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _a(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new _a(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qh.create=(s,t)=>
vendor: 4,860 bytes, line 538
538new qh({innerType:s,typeName:Jt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xs(t)});class o0 extends ws{_parse(t){if(this._getType(t)!==wt.nan){const r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:wt.nan,received:r.parsedType}),rs}return{status:"valid",value:t.data}}}o0.create=s=>new o0({typeName:Jt.ZodNaN,...xs(s)});const rz=Symbol("zod_brand");class cj extends ws{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Cf extends ws{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?rs:o.status==="dirty"?(n.dirty(),uu(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?rs:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new Cf({in:t,out:n,typeName:Jt.ZodPipeline})}}class Wh extends ws{_parse(t){const n=this._def.innerType._parse(t),r=a=>(md(a)&&(a.value=Object.freeze(a.value)),a);return _h(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}Wh.create=(s,t)=>new Wh({innerType:s,typeName:Jt.ZodReadonly,...xs(t)});function XN(s,t){const n=typeof s=="function"?s(t):typeof s=="string"?{message:s}:s;return typeof n=="string"?{message:n}:n}function jk(s,t={},n){return s?Wu.create().superRefine((r,a)=>{var o,c;const u=s(r);if(u instanceof Promise)return u.then(h=>{var x,m;if(!h){const g=XN(t,r),y=(m=(x=g.fatal)!==null&&x!==void 0?x:n)!==null&&m!==void 0?m:!0;a.addIssue({code:"custom",...g,fatal:y})}});if(!u){const h=XN(t,r),x=(c=(o=h.fatal)!==null&&o!==void 0?o:n)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...h,fatal:x})}}):Wu.create()}const az={object:$n.lazycreate};var Jt;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(Jt||(Jt={}));const iz=(s,t={message:`Input not instance of ${s.name}`})=>jk(n=>n instanceof s,t),bk=ki.create,Nk=tc.create,lz=o0.create,oz=sc.create,wk=Ih.create,cz=hd.create,dz=a0.create,uz=Dh.create,mz=Oh.create,hz=Wu.create,fz=id.create,pz=Gl.create,xz=i0.create,gz=Pi.create,yz=$n.create,vz=$n.strictCreate,jz=Fh.create,bz=X0.create,Nz=Rh.create,wz=ll.create,Az=Mh.create,Cz=l0.create,Sz=fd.create,kz=yu.create,$z=Lh.create,Pz=Vh.create,Ez=nc.create,Tz=Uh.create,_z=Bu.create,JN=_i.create,Iz=nl.create,Dz=rc.create,Oz=_i.createWithPreprocess,Fz=Cf.create,Rz=()=>bk().optional(),Mz=()=>Nk().optional(),Lz=()=>wk().optional(),Vz={string:s=>ki.create({...s,coerce:!0}),number:s=>tc.create({...s,coerce:!0}),boolean:s=>Ih.create({...s,coerce:!0}),bigint:s=>sc.create({...s,coerce:!0}),date:s=>hd.create({...s,coerce:!0})},Uz=rs;var te=Object.freeze({__proto__:null,defaultErrorMap:qu,setErrorMap:OU,getErrorMap:s0,makeIssue:n0,EMPTY_PATH:FU,addIssueToContext:yt,ParseStatus:Fr,INVALID:rs,DIRTY:uu,OK:Jr,isAborted:x1,isDirty:g1,isValid:md,isAsync:_h,get util(){return Ws},get objectUtil(){return p1},ZodParsedType:wt,getParsedType:Ll,ZodType:ws,datetimeRegex:yk,ZodString:ki,ZodNumber:tc,ZodBigInt:sc,ZodBoolean:Ih,ZodDate:hd,ZodSymbol:a0,ZodUndefined:Dh,ZodNull:Oh,ZodAny:Wu,ZodUnknown:id,ZodNever:Gl,ZodVoid:i0,ZodArray:Pi,ZodObject:$n,ZodUnion:Fh,ZodDiscriminatedUnion:X0,ZodIntersection:Rh,ZodTuple:ll,ZodRecord:Mh,ZodMap:l0,ZodSet:fd,ZodFunction:yu,ZodLazy:Lh,ZodLiteral:Vh,ZodEnum:nc,ZodNativeEnum:Uh,ZodPromise:Bu,ZodEffects:_i,ZodTransformer:_i,ZodOptional:nl,ZodNullable:rc,ZodDefault:zh,ZodCatch:qh,ZodNaN:o0,BRAND:rz,ZodBranded:cj,ZodPipeline:Cf,ZodReadonly:Wh,custom:jk,Schema:ws,ZodSchema:ws,late:az,get ZodFirstPartyTypeKind(){return Jt},coerce:Vz,any:hz,array:gz,bigint:oz,boolean:wk,date:cz,discriminatedUnion:bz,effect:JN,enum:Ez,function:kz,instanceof:iz,intersection:Nz,lazy:$z,literal:Pz,map:Cz,nan:lz,n
538ativeEnum:Tz,never:pz,null:mz,nullable:Dz,number:Nk,object:yz,oboolean:Lz,onumber:Mz,optional:Iz,ostring:Rz,pipeline:Fz,preprocess:Oz,promise:_z,record:Az,set:Sz,strictObject:vz,string:bk,symbol:dz,transformer:JN,tuple:wz,undefined:uz,union:jz,unknown:fz,void:xz,NEVER:Uz,ZodIssueCode:lt,quotelessJson:DU,ZodError:_a});const zz=({onLinkInsert:s})=>{const[t,n]=p.useState(!1),[r,a]=p.useState(""),[o,c]=p.useState(""),u=p.useRef(null),h=()=>{const g=window.getSelection();g&&!g.isCollapsed&&g.rangeCount>0?(u.current=g.getRangeAt(0).cloneRange(),c(g.toString().trim())):(u.current=null,c("")),n(!0)},x=()=>{if(r.trim()){const g=r.startsWith("http://")||r.startsWith("https://")?r:`https://${r}`;s(g,u.current,o),a(""),c(""),u.current=null,n(!1)}},m=()=>{a(""),u.current=null,n(!1)};return e.jsxs(es,{open:t,onOpenChange:n,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:g=>g.preventDefault(),onClick:h,className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Link","data-toolbar":"true",children:e.jsx(b2,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"sm:max-w-md","data-toolbar":"true",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Link"})}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"url",className:"text-sm font-medium",children:"URL"}),e.jsx(je,{id:"url",placeholder:"Enter URL (e.g., https://example.com)",value:r,onChange:g=>a(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),x()),g.key==="Escape"&&m()},autoFocus:!0})]})}),e.jsxs(sl,{className:"flex gap-2",children:[e.jsx(F,{variant:"outline",onClick:m,"data-toolbar":"true",children:"Cancel"}),e.jsx(F,{onClick:x,disabled:!r.trim(),className:"bg-aac-primary hover:bg-aac-primary/90","data-toolbar":"true",children:"Insert Link"})]})]})]})};function qz({onEmojiSelect:s}){const[t,n]=p.useState(!1),r=["ð","ð","ð","ð","â¤ï¸","ð¥","â¨","ð","ð","ð","ð¯","ð¡","ð","ð","ð","ð","ð","ð¤","ðª","ð","ð
","â","â
","ð","ð¢","ðµ","ð¨","ð¸","ð","âï¸","ð","â¡"];return e.jsxs(es,{open:t,onOpenChange:n,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Emoji",children:e.jsx(g7,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Emoji"})}),e.jsx("div",{className:"grid grid-cols-8 gap-2 p-4",children:r.map((a,o)=>e.jsx(F,{variant:"ghost",size:"sm",className:"h-10 w-10 text-lg hover:bg-blue-50",onClick:()=>{s(a),n(!1)},children:a},o))})]})]})}function Wz({onImageSelect:s,onBeforeOpen:t}){const[n,r]=p.useState(!1),[a,o]=p.useState([]),[c,u]=p.useState(!1),h=async()=>{u(!0);try{const m=await fetch("/api/images");if(m.ok){const g=await m.json();o(g)}else console.error("Failed to fetch images, status:",m.status)}catch(m){console.error("Failed to load images:",m)}finally{u(!1)}},x=m=>{r(m),m&&h()};return e.jsxs(es,{open:n,onOpenChange:x,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:m=>{m.preventDefault(),t&&t()},className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Image",children:e.jsx(Bo,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Image from Gallery"})}),e.jsx("div",{className:"overflow-y-auto max-h-96",children:c?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx("div",{className:"text-gray-500",children:"Loading images..."})}):a.length===0?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx("div",{className:"text-gray-500",children:"No images found in /public/images"})}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-4",children:a.map((m,g)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden cursor-pointer hover:border-blue-400 hover:shadow-md transition-all",onClick:()=>{s(`/images/${m}`),r(!1)},children:[e.jsx("div",{className:"h-24 w-full flex items-center justify-center bg-gray-50 p-2",children:e.jsx("img",{src:`/images/${m}`,alt:m,className:"max-h-full max-w-full object-contain"})}),e.jsx("div",{className:"p-2 text-xs text-gray-600 truncate",children:m})]},g))})})]})]})}function Bz({value:s,onChange:t,placeholder:n="Type your message here...",height:r="200px",className:a=""}){const[o,c]=p.useState(!1),[u,h]=p.useState(!1),[x,m]=p.useState(!1),g=p.useRef(null),y=p.useRef(!1),b=p.useRef(null),w=()=>{const z=window.getSelection();z&&z.rangeCount>0?b.current=z.getRangeAt(0).cloneRange():b.current=null},N=z=>{if(!z||!g.current)return!1;try{const H=window.getSelection();if(H)return H.removeAllRanges(),H.addRange(z),!0}catch{}return!1},k=z=>{if(!g.current)return;const H=`<img src="${z}" alt="Email Image" style="max-width: 300px; height: auto; display: block; margin: 8px 0; border: none;" />`;if(g.current.focus(),!N(b.current)){const U=window.getSelection();if(U&&U.rangeCount>0){const _=U.getRangeAt(0);if(!g.current.contains(_.commonAncestorContainer)){const se=document.createRange();se.selectNodeContents(g.current),se.collapse(!1),U.removeAllRanges(),U.addRange(se)}}}document.execCommand("insertHTML",!1,H),t(g.current.innerHTML),c(!0),b.current=null};p.useEffect(()=>{g.current&&s!==g.current.innerHTML&&(g.current.innerHTML=s)},[s]);const E=(z,H,T,U)=>{if(g.current){if(g.current.focus(),z==="createLink"&&H){const _=U!==void 0?U:b.current;if(_){const se=window.getSelection();se&&(se.removeAllRanges(),se.addRange(_)),document.execCommand("createLink",!1,H);const ae=window.getSelection();if(ae&&ae.rangeCount>0){let W=ae.getRangeAt(0).commonAncestorContainer;for(;W&&W.nodeName!=="A";)W=W.parentNode;W&&W.nodeName==="A"&&(W.setAttribute("target","_blank"),W.setAttribute("rel","noopener"))}}else{const se=`<a href="${H}" target="_blank" rel="noopener">${H}</a>`;document.execCommand("insertHTML",!1," "+se)}t(g.current.innerHTML);return}document.execCommand(z,!1,H),t(g.current.innerHTML)}},P=()=>{g.current&&(c(!0),t(g.current.innerHTML))},M=()=>{m(!0),h(!0)},L=z=>{const H=z.relatedTarget;if(H&&H.closest('[data-toolbar="true"]')){y.current=!0;return}setTimeout(()=>{y.current||(m(!1),h(!1)),y.current=!1},100)},B=z=>{z.preventDefault();const H=z.clipboardData.getData("text/plain");document.execCommand("insertText",!1,H)};return e.jsxs("div",{className:`relative border border-aac-neutral-200 rounded-md transition-colors ${x?"ring-2 ring-aac-primary border-aac-primary":""} ${a}`,children:[e.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-aac-neutral-200 bg-gray-50 rounded-t-md","data-toolbar":"true",children:[e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:z=>z.preventDefault(),onClick:()=>E("bold"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Bold","data-toolbar":"true",children:e.jsx(d7,{className:"h-4 w-4"})}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:z=>z.preventDefault(),onClick:()=>E("italic"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Italic",children:e.jsx(h7,{className:"h-4 w-4"})}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:z=>z.preventDefault(),onClick:()=>E("underline"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Underline",children:e.jsx(y7,{className:"h-4 w-4"})}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:z=>z.preventDefault(),onClick:()=>E("insertUnorderedList"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Bullet List",children:e.jsx(f7,{className:"h-4 w-4"})}),e.jsx(zz,{onLinkInsert:(z,H,T)=>{E("createLink",z,T,H)}}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsx(qz,{onEmojiSelect:z=>{var H;(H=g.current)==null||H.focus(),document.execCommand("insertText",!1,z),g.current&&t(g.current.innerHTML)}}),e.jsx(Wz,{onImageSelect:k,onBeforeOpen:w}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsxs("select",{onChange:z=>E("formatBlock",z.target.value),className:"text-sm border-0 bg-transparent px-2 py-1 rounded hover:bg-gray-200",title:"Text Style",children:[e.jsx("option",{value:"div",children:"Normal"}),e.jsx("option",{value:"h1",children:"Heading 1"}),e.jsx("option",{value:"h2",children:"Heading 2"}),e.jsx("option",{value:"h3",children:"Heading 3"})]})]}),e.jsx("div",{ref:g,className:"p-4 prose max-w-none bg-white rounded-b-md overflow-y-auto",style:{minHeight:r,outline:"none"},contentEditable:!0,suppressContentEditableWarning:!0,onFocus:M,onBlur:L,onInput:P,onPaste:B}),!s&&!u&&e.jsx("div",{className:"absolute pointer-events-none text-gray-400",style:{to
538p:"60px",left:"16px"},children:n})]})}function Ak({purpose:s,newsletter:t=!1}){return e.jsx("div",{className:"rounded border border-blue-200 bg-blue-50 p-3 text-xs text-blue-900",role:"note",children:t||s==="promotional"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-semibold",children:"Marketing subscription rules apply"}),e.jsx("p",{className:"mt-1",children:"Addresses must have confirmed subscription permission and an active subscriber record. Unsubscribed, unconfirmed, inactive, or invalid addresses are excluded. A more recent unsubscribe is also honored."}),e.jsx("p",{className:"mt-1",children:"Selecting Weekly Password or including a password does not override these rules. For password/access-only information, use Messages â Class or account, without promotional content."})]}):s==="transactional"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-semibold",children:"Essential class/account information only"}),e.jsx("p",{className:"mt-1",children:"Use this for password/access-only messages and necessary class or account information. Marketing unsubscribes do not exclude otherwise eligible recipients from these messages. Do not include newsletter or promotional content."}),e.jsx("p",{className:"mt-1",children:"This does not subscribe anyone to marketing or change their saved preferences."})]}):e.jsx("p",{children:"Choose Promotional for newsletters or marketing, even if they contain a password. Choose Class or account for essential password/access-only or necessary account information. Selecting Weekly Password chooses an audience, not an email purpose."})})}const Fa=hU,Ck=p.createContext({}),Ke=({...s})=>e.jsx(Ck.Provider,{value:{name:s.name},children:e.jsx(gU,{...s})}),J0=()=>{const s=p.useContext(Ck),t=p.useContext(Sk),{getFieldState:n,formState:r}=Q0(),a=n(s.name,r);if(!s)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:s.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...a}},Sk=p.createContext({}),We=p.forwardRef(({className:s,...t},n)=>{const r=p.useId();return e.jsx(Sk.Provider,{value:{id:r},children:e.jsx("div",{ref:n,className:pt("space-y-2",s),...t})})});We.displayName="FormItem";const ze=p.forwardRef(({className:s,...t},n)=>{const{error:r,formItemId:a}=J0();return e.jsx(Ne,{ref:n,className:pt(r&&"text-destructive",s),htmlFor:a,...t})});ze.displayName="FormLabel";const He=p.forwardRef(({...s},t)=>{const{error:n,formItemId:r,formDescriptionId:a,formMessageId:o}=J0();return e.jsx(F8,{ref:t,id:r,"aria-describedby":n?`${a} ${o}`:`${a}`,"aria-invalid":!!n,...s})});He.displayName="FormControl";const Mn=p.forwardRef(({className:s,...t},n)=>{const{formDescriptionId:r}=J0();return e.jsx("p",{ref:n,id:r,className:pt("text-sm text-muted-foreground",s),...t})});Mn.displayName="FormDescription";const Ye=p.forwardRef(({className:s,children:t,...n},r)=>{const{error:a,formMessageId:o}=J0(),c=a?String((a==null?void 0:a.message)??""):t;return c?e.jsx("p",{ref:r,id:o,className:pt("text-sm font-medium text-destructive",s),...n,children:c}):null});Ye.displayName="FormMessage";var cv="rovingFocusGroup.onEntryFocus",Kz={bubbles:!1,cancelable:!0},eg="RovingFocusGroup",[v1,kk,Hz]=mf(eg),[Gz,tg]=or(eg,[Hz]),[Zz,Yz]=Gz(eg),$k=p.forwardRef((s,t)=>e.jsx(v1.Provider,{scope:s.__scopeRovingFocusGroup,children:e.jsx(v1.Slot,{scope:s.__scopeRovingFocusGroup,children:e.jsx(Qz,{...s,ref:t})})}));$k.displayName=eg;var Qz=p.forwardRef((s,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:x,preventScrollOnEntryFocus:m=!1,...g}=s,y=p.useRef(null),b=Cs(t,y),w=Nf(o),[N=null,k]=ga({prop:c,defaultProp:u,onChange:h}),[E,P]=p.useState(!1),M=vr(x),L=kk(n),B=p.useRef(!1),[z,H]=p.useState(0);return p.useEffect(()=>{const T=y.current;if(T)return T.addEventListener(cv,M),()=>T.removeEventListener(cv,M)},[M]),e.jsx(Zz,{scope:n,orientation:r,dir:w,loop:a,currentTabStopId:N,onItemFocus:p.useCallback(T=>k(T),[k]),onItemShiftTab:p.useCallback(()=>P(!0),[]),onFocusableItemAdd:p.useCallback(()=>H(T=>T+1),[]),onFocusableItemRemove:p.useCallback(()=>H(T=>T-1),[]),children:e.jsx(_t.div,{tabIndex:E||z===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...s.style},onMouseDown:ut(s.onMouseDown,()=>
vendor: 23,188 bytes, line 538
538{B.current=!0}),onFocus:ut(s.onFocus,T=>{const U=!B.current;if(T.target===T.currentTarget&&U&&!E){const _=new CustomEvent(cv,Kz);if(T.currentTarget.dispatchEvent(_),!_.defaultPrevented){const se=L().filter(le=>le.focusable),ae=se.find(le=>le.active),W=se.find(le=>le.id===N),ne=[ae,W,...se].filter(Boolean).map(le=>le.ref.current);Tk(ne,m)}}B.current=!1}),onBlur:ut(s.onBlur,()=>P(!1))})})}),Pk="RovingFocusGroupItem",Ek=p.forwardRef((s,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,...c}=s,u=xa(),h=o||u,x=Yz(Pk,n),m=x.currentTabStopId===h,g=kk(n),{onFocusableItemAdd:y,onFocusableItemRemove:b}=x;return p.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),e.jsx(v1.ItemSlot,{scope:n,id:h,focusable:r,active:a,children:e.jsx(_t.span,{tabIndex:m?0:-1,"data-orientation":x.orientation,...c,ref:t,onMouseDown:ut(s.onMouseDown,w=>{r?x.onItemFocus(h):w.preventDefault()}),onFocus:ut(s.onFocus,()=>x.onItemFocus(h)),onKeyDown:ut(s.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){x.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=eq(w,x.orientation,x.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=g().filter(P=>P.focusable).map(P=>P.ref.current);if(N==="last")E.reverse();else if(N==="prev"||N==="next"){N==="prev"&&E.reverse();const P=E.indexOf(w.currentTarget);E=x.loop?tq(E,P+1):E.slice(P+1)}setTimeout(()=>Tk(E))}})})})});Ek.displayName=Pk;var Xz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jz(s,t){return t!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function eq(s,t,n){const r=Jz(s.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Xz[r]}function Tk(s,t=!1){const n=document.activeElement;for(const r of s)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tq(s,t){return s.map((n,r)=>s[(t+r)%s.length])}var _k=$k,Ik=Ek,dj="Tabs",[sq]=or(dj,[tg]),Dk=tg(),[nq,uj]=sq(dj),Ok=p.forwardRef((s,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:c="horizontal",dir:u,activationMode:h="automatic",...x}=s,m=Nf(u),[g,y]=ga({prop:r,onChange:a,defaultProp:o});return e.jsx(nq,{scope:n,baseId:xa(),value:g,onValueChange:y,orientation:c,dir:m,activationMode:h,children:e.jsx(_t.div,{dir:m,"data-orientation":c,...x,ref:t})})});Ok.displayName=dj;var Fk="TabsList",Rk=p.forwardRef((s,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=s,o=uj(Fk,n),c=Dk(n);return e.jsx(_k,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:r,children:e.jsx(_t.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});Rk.displayName=Fk;var Mk="TabsTrigger",Lk=p.forwardRef((s,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=s,c=uj(Mk,n),u=Dk(n),h=zk(c.baseId,r),x=qk(c.baseId,r),m=r===c.value;return e.jsx(Ik,{asChild:!0,...u,focusable:!a,active:m,children:e.jsx(_t.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":x,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:h,...o,ref:t,onMouseDown:ut(s.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:ut(s.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:ut(s.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!a&&g&&c.onValueChange(r)})})})});Lk.displayName=Mk;var Vk="TabsContent",Uk=p.forwardRef((s,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...c}=s,u=uj(Vk,n),h=zk(u.baseId,r),x=qk(u.baseId,r),m=r===u.value,g=p.useRef(m);return p.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),e.jsx(ea,{present:a||m,children:({present:y})=>e.jsx(_t.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":h,hidden:!y,id:x,tabIndex:0,...c,ref:t,style:{...s.style,animationDuration:g.current?"0s":void 0},children:y&&o})})});Uk.displayName=Vk;function zk(s,t){return`${s}-trigger-${t}`}function qk(s,t){return`${s}-content-${t}`}var rq=Ok,Wk=Rk,Bk=Lk,Kk=Uk;const Ql=rq,pl=p.forwardRef(({className:s,...t},n)=>e.jsx(Wk,{ref:n,className:pt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...t}));pl.displayName=Wk.displayName;const qs=p.forwardRef(({className:s,...t},n)=>e.jsx(Bk,{ref:n,className:pt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...t}));qs.displayName=Bk.displayName;const Hs=p.forwardRef(({className:s,...t},n)=>e.jsx(Kk,{ref:n,className:pt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...t}));Hs.displayName=Kk.displayName;var j1=["Enter"," "],aq=["ArrowDown","PageUp","Home"],Hk=["ArrowUp","PageDown","End"],iq=[...aq,...Hk],lq={ltr:[...j1,"ArrowRight"],rtl:[...j1,"ArrowLeft"]},oq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sf="Menu",[Bh,cq,dq]=mf(Sf),[yd,Gk]=or(Sf,[dq,ic,tg]),sg=ic(),Zk=tg(),[uq,vd]=yd(Sf),[mq,kf]=yd(Sf),Yk=s=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:c=!0}=s,u=sg(t),[h,x]=p.useState(null),m=p.useRef(!1),g=vr(o),y=Nf(a);return p.useEffect(()=>{const b=()=>{m.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>m.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),e.jsx(D0,{...u,children:e.jsx(uq,{scope:t,open:n,onOpenChange:g,content:h,onContentChange:x,children:e.jsx(mq,{scope:t,onClose:p.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:m,dir:y,modal:c,children:r})})})};Yk.displayName=Sf;var hq="MenuAnchor",mj=p.forwardRef((s,t)=>{const{__scopeMenu:n,...r}=s,a=sg(n);return e.jsx(yf,{...a,...r,ref:t})});mj.displayName=hq;var hj="MenuPortal",[fq,Qk]=yd(hj,{forceMount:void 0}),Xk=s=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=s,o=vd(hj,t);return e.jsx(fq,{scope:t,forceMount:n,children:e.jsx(ea,{present:n||o.open,children:e.jsx(Xu,{asChild:!0,container:a,children:r})})})};Xk.displayName=hj;var si="MenuContent",[pq,fj]=yd(si),Jk=p.forwardRef((s,t)=>{const n=Qk(si,s.__scopeMenu),{forceMount:r=n.forceMount,...a}=s,o=vd(si,s.__scopeMenu),c=kf(si,s.__scopeMenu);return e.jsx(Bh.Provider,{scope:s.__scopeMenu,children:e.jsx(ea,{present:r||o.open,children:e.jsx(Bh.Slot,{scope:s.__scopeMenu,children:c.modal?e.jsx(xq,{...a,ref:t}):e.jsx(gq,{...a,ref:t})})})})}),xq=p.forwardRef((s,t)=>{const n=vd(si,s.__scopeMenu),r=p.useRef(null),a=Cs(t,r);return p.useEffect(()=>{const o=r.current;if(o)return q0(o)},[]),e.jsx(pj,{...s,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(s.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),gq=p.forwardRef((s,t)=>{const n=vd(si,s.__scopeMenu);return e.jsx(pj,{...s,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yq=Qo("MenuContent.ScrollLock"),pj=p.forwardRef((s,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:x,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:y,onDismiss:b,disableOutsideScroll:w,...N}=s,k=vd(si,n),E=kf(si,n),P=sg(n),M=Zk(n),L=cq(n),[B,z]=p.useState(null),H=p.useRef(null),T=Cs(t,H,k.onContentChange),U=p.useRef(0),_=p.useRef(""),se=p.useRef(0),ae=p.useRef(null),W=p.useRef("right"),J=p.useRef(0),ne=w?jf:p.Fragment,le=w?{as:yq,allowPinchZoom:!0}:void 0,V=ue=>{var re,O;const ge=_.current+ue,G=L().filter(me=>!me.disabled),Ae=document.activeElement,Fe=(re=G.find(me=>me.ref.current===Ae))==null?void 0:re.textValue,be=G.map(me=>me.textValue),Me=Eq(be,ge,Fe),R=(O=G.find(me=>me.textValue===Me))==null?void 0:O.ref.current;(function me(Y){_.current=Y,window.clearTimeout(U.current),Y!==""&&(U.current=window.setTimeout(()=>me(""),1e3))})(ge),R&&setTimeout(()=>R.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),z0();const Z=p.useCallback(ue=>{var G,Ae;return W.current===((G=ae.current)==null?void 0:G.side)&&_q(ue,(Ae=ae.current)==null?void 0:Ae.area)},[]);return e.jsx(pq,{scope:n,searchRef:_,onItemEnter:p.useCallback(ue=>{Z(ue)&&ue.preventDefault()},[Z]),onItemLeave:p.useCallback(ue=>{var ge;Z(ue)||((ge=H.current)==null||ge.focus(),z(null))},[Z]),onTriggerLeave:p.useCallback(ue=>{Z(ue)&&ue.preventDefault()},[Z]),pointerGraceTimerRef:se,onPointerGraceIntentChange:p.useCallback(ue=>{ae.current=ue},[]),children:e.jsx(ne,{...le,children:e.jsx(vf,{asChild:!0,trapped:a,onMountAutoFocus:ut(o,ue=>{var ge;ue.preventDefault(),(ge=H.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:x,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:y,onDismiss:b,children:e.jsx(_k,{asChild:!0,...M,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:B,onCurrentTabStopIdChange:z,onEntryFocus:ut(h,ue=>{E.isUsingKeyboardRef.current||ue.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(O0,{role:"menu","aria-orientation":"vertical","data-state":p$(k.open),"data-radix-menu-content":"",dir:E.dir,...P,...N,ref:T,style:{outline:"none",...N.style},onKeyDown:ut(N.onKeyDown,ue=>{const G=ue.target.closest("[data-radix-menu-content]")===ue.currentTarget,Ae=ue.ctrlKey||ue.altKey||ue.metaKey,Fe=ue.key.length===1;G&&(ue.key==="Tab"&&ue.preventDefault(),!Ae&&Fe&&V(ue.key));const be=H.current;if(ue.target!==be||!iq.includes(ue.key))return;ue.preventDefault();const R=L().filter(re=>!re.disabled).map(re=>re.ref.current);Hk.includes(ue.key)&&R.reverse(),$q(R)}),onBlur:ut(s.onBlur,ue=>{ue.currentTarget.contains(ue.target)||(window.clearTimeout(U.current),_.current="")}),onPointerMove:ut(s.onPointerMove,Kh(ue=>{const ge=ue.target,G=J.current!==ue.clientX;if(ue.currentTarget.contains(ge)&&G){const Ae=ue.clientX>J.current?"right":"left";W.current=Ae,J.current=ue.clientX}}))})})})})})})});Jk.displayName=si;var vq="MenuGroup",xj=p.forwardRef((s,t)=>{const{__scopeMenu:n,...r}=s;return e.jsx(_t.div,{role:"group",...r,ref:t})});xj.displayName=vq;var jq="MenuLabel",e$=p.forwardRef((s,t)=>{const{__scopeMenu:n,...r}=s;return e.jsx(_t.div,{...r,ref:t})});e$.displayName=jq;var c0="MenuItem",ew="menu.itemSelect",ng=p.forwardRef((s,t)=>{const{disabled:n=!1,onSelect:r,...a}=s,o=p.useRef(null),c=kf(c0,s.__scopeMenu),u=fj(c0,s.__scopeMenu),h=Cs(t,o),x=p.useRef(!1),m=()=>{const g=o.current;if(!n&&g){const y=new CustomEvent(ew,{bubbles:!0,cancelable:!0});g.addEventListener(ew,b=>r==null?void 0:r(b),{once:!0}),x2(g,y),y.defaultPrevented?x.current=!1:c.onClose()}};return e.jsx(t$,{...a,ref:h,disabled:n,onClick:ut(s.onClick,m),onPointerDown:g=>{var y;(y=s.onPointerDown)==null||y.call(s,g),x.current=!0},onPointerUp:ut(s.onPointerUp,g=>{var y;x.current||(y=g.currentTarget)==null||y.click()}),onKeyDown:ut(s.onKeyDown,g=>{const y=u.searchRef.current!=="";n||y&&g.key===" "||j1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});ng.displayName=c0;var t$=p.forwardRef((s,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=s,c=fj(c0,n),u=Zk(n),h=p.useRef(null),x=Cs(t,h),[m,g]=p.useState(!1),[y,b]=p.useState("");return p.useEffect(()=>{const w=h.current;w&&b((w.textContent??"").trim())},[o.children]),e.jsx(Bh.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:e.jsx(Ik,{asChild:!0,...u,focusable:!r,children:e.jsx(_t.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:x,onPointerMove:ut(s.onPointerMove,Kh(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(s.onPointerLeave,Kh(w=>c.onItemLeave(w))),onFocus:ut(s.onFocus,()=>g(!0)),onBlur:ut(s.onBlur,()=>g(!1))})})})}),bq="MenuCheckboxItem",s$=p.forwardRef((s,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=s;return e.jsx(l$,{scope:s.__scopeMenu,checked:n,children:e.jsx(ng,{role:"menuitemcheckbox","aria-checked":d0(n)?"mixed":n,...a,ref:t,"data-state":yj(n),onSelect:ut(a.onSelect,()=>r==null?void 0:r(d0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});s$.displayName=bq;var n$="MenuRadioGroup",[Nq,wq]=yd(n$,{value:void 0,onValueChange:()=>{}}),r$=p.forwardRef((s,t)=>{const{value:n,onValueChange:r,...a}=s,o=vr(r);return e.jsx(Nq,{scope:s.__scopeMenu,value:n,onValueChange:o,children:e.jsx(xj,{...a,ref:t})})});r$.displayName=n$;var a$="MenuRadioItem",i$=p.forwardRef((s,t)=>{const{value:n,...r}=s,a=wq(a$,s.__scopeMenu),o=n===a.value;return e.jsx(l$,{scope:s.__scopeMenu,checked:o,children:e.jsx(ng,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":yj(o),onSelect:ut(r.onSelect,()=>{var c;return(c=a.onValueChange)==null?void 0:c.call(a,n)},{checkForDefaultPrevented:!1})})})});i$.displayName=a$;var gj="MenuItemIndicator",[l$,Aq]=yd(gj,{checked:!1}),o$=p.forwardRef((s,t)=>{const{__scopeMenu:n,forceMount:r,...a}=s,o=Aq(gj,n);return e.jsx(ea,{present:r||d0(o.checked)||o.checked===!0,children:e.jsx(_t.span,{...a,ref:t,"data-state":yj(o.checked)})})});o$.displayName=gj;var Cq="MenuSeparator",c$=p.forwardRef((s,t)=>{const{__scopeMenu:n,...r}=s;return e.jsx(_t.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});c$.displayName=Cq;var Sq="MenuArrow",d$=p.forwardRef((s,t)=>{const{__scopeMenu:n,...r}=s,a=sg(n);return e.jsx(F0,{...a,...r,ref:t})});d$.displayName=Sq;var kq="MenuSub",[$J,u$]=yd(kq),xh="MenuSubTrigger",m$=p.forwardRef((s,t)=>{const n=vd(xh,s.__scopeMenu),r=kf(xh,s.__scopeMenu),a=u$(xh,s.__scopeMenu),o=fj(xh,s.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=o,x={__scopeMenu:s.__scopeMenu},m=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>m,[m]),p.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),h(null)}},[u,h]),e.jsx(mj,{asChild:!0,...x,children:e.jsx(t$,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":p$(n.open),...s,ref:S0(t,a.onTriggerChange),onClick:g=>{var y;(y=s.onClick)==null||y.call(s,g),!(s.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ut(s.onPointerMove,Kh(g=>{o.onItemEnter(g),!g.defaultPrevented&&!s.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:ut(s.onPointerLeave,Kh(g=>{var b,w;m();const y=(b=n.content)==null?void 0:b.getBoundingClientRect();if(y){const N=(w=n.content)==null?void 0:w.dataset.side,k=N==="right",E=k?-5:5,P=y[k?"left":"right"],M=y[k?"right":"left"];o.onPointerGraceIntentChange({area:[{x:g.clientX+E,y:g.clientY},{x:P,y:y.top},{x:M,y:y.top},{x:M,y:y.bottom},{x:P,y:y.bottom}],side:N}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(g),g.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ut(s.onKeyDown,g=>{var b;const y=o.searchRef.current!=="";s.disabled||y&&g.key===" "||lq[r.dir].includes(g.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),g.preventDefault())})})})});m$.displayName=xh;var h$="MenuSubContent",f$=p.forwardRef((s,t)=>{const n=Qk(si,s.__scopeMenu),{forceMount:r=n.forceMount,...a}=s,o=vd(si,s.__scopeMenu),c=kf(si,s.__scopeMenu),u=u$(h$,s.__scopeMenu),h=p.useRef(null),x=Cs(t,h);return e.jsx(Bh.Provider,{scope:s.__scopeMenu,children:e.jsx(ea,{present:r||o.open,children:e.jsx(Bh.Slot,{scope:s.__scopeMenu,children:e.jsx(pj,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:x,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var g;c.isUsingKeyboardRef.current&&((g=h.current)==null||g.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ut(s.onFocusOutside,m=>{m.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ut(s.onEscapeKeyDown,m=>{c.onClose(),m.preventDefault()}),onKeyDown:ut(s.onKeyDown,m=>{var b;const g=m.currentTarget.contains(m.target),y=oq[c.dir].includes(m.key);g&&y&&(o.onOpenChange(!1),(b=u.trigger)==null||b.focus(),m.preventDefault())})})})})})});f$.displayName=h$;function p$(s){return s?"open":"closed"}function d0(s){return s==="indeterminate"}function yj(s){return d0(s)?"indeterminate":s?"checked":"unchecked"}function $q(s){const t=document.activeElement;for(const n of s)if(n===t||(n.focus(),document.activeElement!==t))return}function Pq(s,t){return s.map((n,r)=>s[(t+r)%s.length])}function Eq(s,t,n){const a=t.length>1&&Array.from(t).every(x=>x===t[0])?t[0]:t,o=n?s.indexOf(n):-1;let c=Pq(s,Math.max(o,0));a.length===1&&(c=c.filter(x=>x!==n));const h=c.find(x=>x.toLowerCase().startsWith(a.toLowerCase()));return h!==n?h:void 0}function Tq(s,t){const{x:n,y:r}=s;let a=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const u=t[o].x,h=t[o].y,x=t[c].x,m=t[c].y;h>r!=m>r&&n<(x-u)*(r-h)/(m-h)+u&&(a=!a)}return a}function _q(s,t){if(!t)return!1;const n={x:s.clientX,y:s.clientY};return Tq(n,t)}function Kh(s){return t=>t.pointerType==="mouse"?s(t):void 0}var Iq=Yk,Dq=mj,Oq=Xk,Fq=Jk,Rq=xj,Mq=e$,Lq=ng,Vq=s$,Uq=r$,zq=i$,qq=o$,Wq=c$,Bq=d$,Kq=m$,Hq=f$,vj="DropdownMenu",[Gq]=or(vj,[Gk]),ta=Gk(),[Zq,x$]=Gq(vj),g$=s=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:c,modal:u=!0}=s,h=ta(t),x=p.useRef(null),[m=!1,g]=ga({prop:a,defaultProp:o,onChange:c});return e.jsx(Zq,{scope:t,triggerId:xa(),triggerRef:x,contentId:xa(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(y=>!y),[g]),modal:u,children:e.jsx(Iq,{...h,open:m,onOpenChange:g,dir:r,modal:u,children:n})})};g$.displayName=vj;var y$="DropdownMenuTrigger",v$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=s,o=x$(y$,n),c=ta(n);return e.jsx(Dq,{asChild:!0,...c,children:e.jsx(_t.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:S0(t,o.triggerRef),onPointerDown:ut(s.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:ut(s.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});v$.displayName=y$;var Yq="DropdownMenuPortal",j$=s=>{const{__scopeDropdownMenu:t,...n}=s,r=ta(t);return e.jsx(Oq,{...r,...n})};j$.displayName=Yq;var b$="DropdownMenuContent",N$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=x$(b$,n),o=ta(n),c=p.useRef(!1);return e.jsx(Fq,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:ut(s.onCloseAutoFocus,u=>{var h;c.current||(h=a.triggerRef.current)==null||h.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:ut(s.onInteractOutside,u=>{const h=u.detail.originalEvent,x=h.button===0&&h.ctrlKey===!0,m=h.button===2||x;(!a.modal||m)&&(c.current=!0)}),style:{...s.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});N$.displayName=b$;var Qq="DropdownMenuGroup",Xq=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Rq,{...a,...r,ref:t})});Xq.displayName=Qq;var Jq="DropdownMenuLabel",w$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Mq,{...a,...r,ref:t})});w$.displayName=Jq;var eW="DropdownMenuItem",A$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Lq,{...a,...r,ref:t})});A$.displayName=eW;var tW="DropdownMenuCheckboxItem",C$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Vq,{...a,...r,ref:t})});C$.displayName=tW;var sW="DropdownMenuRadioGroup",nW=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Uq,{...a,...r,ref:t})});nW.displayName=sW;var rW="DropdownMenuRadioItem",S$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(zq,{...a,...r,ref:t})});S$.displayName=rW;var aW="DropdownMenuItemIndicator",k$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(qq,{...a,...r,ref:t})});k$.displayName=aW;var iW="DropdownMenuSeparator",$$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Wq,{...a,...r,ref:t})});$$.displayName=iW;var lW="DropdownMenuArrow",oW=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Bq,{...a,...r,ref:t})});oW.displayName=lW;var cW="DropdownMenuSubTrigger",P$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Kq,{...a,...r,ref:t})});P$.displayName=cW;var dW="DropdownMenuSubContent",E$=p.forwardRef((s,t)=>{const{__scopeDropdownMenu:n,...r}=s,a=ta(n);return e.jsx(Hq,{...a,...r,ref:t,style:{...s.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E$.displayName=dW;var uW=g$,mW=v$,hW=j$,T$=N$,_$=w$,I$=A$,D$=C$,O$=S$,F$=k$,R$=$$,M$=P$,L$=E$;const fW=uW,pW=mW,xW=p.forwardRef(({className:s,inset:t,children:n,...r},a)=>e.jsxs(M$,{ref:a,className:pt("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",s),...r,children:[n,e.jsx(Bc,{className:"ml-auto"})]}));xW.displayName=M$.displayName;const gW=p.forwardRef(({className:s,...t},n)=>e.jsx(L$,{ref:n,className:pt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
538de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...t}));gW.displayName=L$.displayName;const V$=p.forwardRef(({className:s,sideOffset:t=4,...n},r)=>e.jsx(hW,{children:e.jsx(T$,{ref:r,sideOffset:t,className:pt("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...n})}));V$.displayName=T$.displayName;const b1=p.forwardRef(({className:s,inset:t,...n},r)=>e.jsx(I$,{ref:r,className:pt("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",s),...n}));b1.displayName=I$.displayName;const yW=p.forwardRef(({className:s,children:t,checked:n,...r},a)=>e.jsxs(D$,{ref:a,className:pt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:n,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F$,{children:e.jsx(j2,{className:"h-4 w-4"})})}),t]}));yW.displayName=D$.displayName;const vW=p.forwardRef(({className:s,children:t,...n},r)=>e.jsxs(O$,{ref:r,className:pt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F$,{children:e.jsx(wF,{className:"h-2 w-2 fill-current"})})}),t]}));vW.displayName=O$.displayName;const jW=p.forwardRef(({className:s,inset:t,...n},r)=>e.jsx(_$,{ref:r,className:pt("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",s),...n}));jW.displayName=_$.displayName;const bW=p.forwardRef(({className:s,...t},n)=>e.jsx(R$,{ref:n,className:pt("-mx-1 my-1 h-px bg-muted",s),...t}));bW.displayName=R$.displayName;function NW(){const[s,t]=p.useState(null),[n,r]=p.useState(""),[a,o]=p.useState(!1),[c,u]=p.useState(""),[h,x]=p.useState(""),[m,g]=p.useState(""),[y,b]=p.useState([]),[w,N]=p.useState([]),[k,E]=p.useState(!1),[P,M]=p.useState([]),[L,B]=p.useState(!1),[z,H]=p.useState(null),[T,U]=p.useState([]),[_,se]=p.useState(!1),[ae,W]=p.useState(null),J=p.useRef(null),{toast:ne}=Is(),{user:le,isLoading:V,isAuthenticated:Z}=U0(),ue=dn(),{data:ge,isLoading:G,error:Ae}=nt({queryKey:["/api/group-chats"],enabled:Z&&!!le}),{data:Fe,isLoading:be,error:Me}=nt({queryKey:["/api/group-chats",s,"messages"],enabled:!!s&&Z&&!!le,retry:3,retryDelay:1e3,queryFn:async()=>{console.log("Fetching messages for group:",s,"User:",le==null?void 0:le.email);const A=await fetch(`/api/group-chats/${s}/messages`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(console.log("Messages response status:",A.status),!A.ok){const ie=await A.text();throw console.error("Messages fetch error:",A.status,ie),new Error(`Failed to fetch messages: ${A.status} ${ie}`)}const D=await A.json();return console.log("Messages data received:",D),D}}),{data:R,isLoading:re,error:O}=nt({queryKey:["/api/group-chats",s,"members"],enabled:!!s&&Z&&!!le,retry:3,retryDelay:1e3,queryFn:async()=>{console.log("Fetching members for group:",s,"User:",le==null?void 0:le.email);const A=await fetch(`/api/group-chats/${s}/members`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(console.log("Members response status:",A.status),!A.ok){const ie=await A.text();throw console.error("Members fetch error:",A.status,ie),new Error(`Failed to fetch members: ${A.status} ${ie}`)}const D=await A.json();return console.log("Members data received:",D),D}}),{data:me}=nt({queryKey:["/api/images/list"],enabled:Z&&!!le}),Y=bt({mutationFn:async A=>(await st("POST","/api/group-chats",A)).json(),onSuccess:A=>{ne({title:"Group Chat Created!",description:`${A.name} has been created successfully with ${T.length} members.`}
538),o(!1),u(""),x(""),g(""),B(!1),H(null),U([]),ue.invalidateQueries({queryKey:["/api/group-chats"]})},onError:A=>{ne({title:"Error",description:A.message||"Failed to create group chat",variant:"destructive"})}}),Te=bt({mutationFn:async A=>{if(!(le!=null&&le.id))throw new Error("User authentication required to send messages");let D=[];if(A.images&&A.images.length>0){const $e=A.images.map(async ke=>{const S=new FormData;S.append("file",ke);const ve=await fetch("/api/upload-image",{method:"POST",body:S});if(!ve.ok)throw new Error("Failed to upload image");return(await ve.json()).url});D=await Promise.all($e)}return(await st("POST",`/api/group-chats/${A.groupId}/messages`,{content:A.content,messageType:A.images&&A.images.length>0?"media":"text",mediaUrls:D.length>0?D:null,senderType:"admin",senderId:(le==null?void 0:le.id)||(le==null?void 0:le.email)||"admin",senderName:(le==null?void 0:le.email)||"Admin User"})).json()},onSuccess:()=>{r(""),b([]),N([]),ne({title:"Message Sent!",description:y.length>0?`Message with ${y.length} image(s) sent to all group members`:"SMS sent to all group members",variant:"default"}),ue.invalidateQueries({queryKey:["/api/group-chats",s,"messages"]}),ue.invalidateQueries({queryKey:["/api/group-chats",s,"members"]}),ue.invalidateQueries({queryKey:["/api/group-chats"]})},onError:A=>{ne({title:"Error",description:A.message||"Failed to send message",variant:"destructive"})}});p.useEffect(()=>{var A;(A=J.current)==null||A.scrollIntoView({behavior:"smooth"})},[Fe]),p.useEffect(()=>{console.log("ð GroupChatInterface Frontend Debug:",{selectedGroupId:s,isAuthenticated:Z,user:le==null?void 0:le.email,messages:Fe?`${Fe.length} messages`:"No messages data",members:R?`${R.length} members`:"No members data",messagesLoading:be,membersLoading:re,messagesError:Me==null?void 0:Me.message,membersError:O==null?void 0:O.message,groupChatsCount:(ge==null?void 0:ge.length)||0,membersData:R,messagesData:Fe}),O&&console.error("Members query error:",O),Me&&console.error("Messages query error:",Me)},[s,Z,le,Fe,R,be,re,Me,O,ge]);const Be=async A=>{const D=await fetch(`/api/group-chats/auto-populate/${encodeURIComponent(A)}`);if(!D.ok)throw new Error("Failed to fetch families for auto-population");return D.json()},ht=async A=>{if(g(A),A&&A!=="General")try{const D=await Be(A);D.length>0?(H({category:A,families:D}),U(D.map(ie=>ie.id)),B(!0)):(H(null),U([]))}catch(D){console.error("Error fetching auto-population families:",D),ne({title:"Warning",description:"Could not load families for auto-population",variant:"destructive"})}else H(null),U([])},Mt=()=>{if(!c.trim()){ne({title:"Error",description:"Please enter a group name",variant:"destructive"});return}Y.mutate({name:c,description:h,category:m||"general",memberIds:T})},$=()=>{!n.trim()&&y.length===0||!s||Te.mutate({groupId:s,content:n,images:y})},K=A=>{const D=Array.from(A.target.files||[]),ie=D.filter(ke=>ke.type.startsWith("image/"));if(ie.length!==D.length){ne({title:"Invalid Files",description:"Only image files are supported",variant:"destructive"});return}if(y.length+ie.length>5){ne({title:"Too Many Images",description:"Maximum 5 images allowed per message",variant:"destructive"});return}b(ke=>[...ke,...ie]);const $e=ie.map(ke=>URL.createObjectURL(ke));N(ke=>[...ke,...$e])},xe=A=>{URL.revokeObjectURL(w[A]),b(D=>D.filter((ie,$e)=>$e!==A)),N(D=>D.filter((ie,$e)=>$e!==A))},De=async()=>{if(P.length===0){ne({title:"No Images Selected",description:"Please select at least one image from the gallery",variant:"destructive"});return}try{const A=P.map(async $e=>{const S=await(await fetch(`/images/${$e}`)).blob();return new File([S],$e,{type:S.type})}),D=await Promise.all(A);if(y.length+D.length>5){ne({title:"Too Many Images",description:"Maximum 5 images allowed per message",variant:"destructive"});return}b($e=>[...$e,...D]);const ie=P.map($e=>`/images/${$e}`);N($e=>[...$e,...ie]),M([]),E(!1),ne({title:"Images Added",description:`${D.length} image(s) added from gallery`})}catch{ne({title:"Error",description:"Failed to load images from gallery",variant:"destructive"})}},X=A=>{M(D=>D.includes(A)?D.filter(ie=>ie!==A):[...D,A])},_e=A=>new Date(A).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Le=ge==null?void 0:ge.find(A=>A.id===s);return V?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#77dbf6] mx-auto mb-4"}),e.jsx("p",{className:"text-[#4A4A4A]",children:"Loading..."})]})}):!Z||!le?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ir,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-[#4A4A4A] mb-2",children:"Session Expired"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Please refresh the page or log in again to access Group Text Chat"}),e.jsxs("div",{className:"space-x-3",children:[e.jsx(F,{onClick:()=>window.location.reload(),className:"bg-[#77dbf6] hover:bg-[#77dbf6]/90",children:"Refresh Page"}),e.jsx(F,{onClick:()=>window.location.href="/admin",variant:"outline",className:"border-[#77dbf6] text-[#77dbf6] hover:bg-[#77dbf6] hover:text-white",children:"Go to Login"})]})]})}):Ae?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ir,{className:"w-12 h-12 text-red-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-[#4A4A4A] mb-2",children:"Unable to Load Group Chats"}),e.jsx("p",{className:"text-gray-600 mb-4",children:(Ae==null?void 0:Ae.message)||"Failed to connect to messaging service"}),e.jsx(F,{onClick:()=>
538ue.invalidateQueries({queryKey:["/api/group-chats"]}),className:"bg-[#77dbf6] hover:bg-[#77dbf6]/90",children:"Try Again"})]})}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 h-[calc(100vh-200px)]",children:[e.jsx("div",{className:"lg:col-span-1",children:e.jsxs(Ce,{className:"h-full",children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ue,{className:"flex items-center space-x-2",children:[e.jsx(Ir,{className:"w-5 h-5 text-aac-primary"}),e.jsx("span",{children:"Group Chats"})]}),e.jsx("div",{className:"flex space-x-2",children:e.jsxs(es,{open:a,onOpenChange:o,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{size:"sm",className:"bg-aac-primary hover:bg-aac-primary/90",children:[e.jsx(fa,{className:"w-4 h-4 mr-1"}),"New"]})}),e.jsxs(ts,{children:[e.jsx(ss,{children:e.jsx(ns,{children:"Create New Group Chat"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium block mb-2",children:"Group Name"}),e.jsx(je,{placeholder:"e.g., AAC Voices Updates",value:c,onChange:A=>u(A.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium block mb-2",children:"Description (optional)"}),e.jsx(Pt,{placeholder:"Brief description of the group's purpose",value:h,onChange:A=>x(A.target.value),rows:3})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium block mb-2",children:"Category"}),e.jsxs(St,{value:m,onValueChange:ht,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select category"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"Program",children:"Ahern Academy"}),e.jsx(ce,{value:"Open Enrollment",children:"Open Enrollment Classes"}),e.jsx(ce,{value:"Young Adult Chat",children:"Young Adult Chat"}),e.jsx(ce,{value:"1:1 Sessions",children:"1:1 Tutoring"}),e.jsx(ce,{value:"AAC Support",children:"AAC Device Support"}),e.jsx(ce,{value:"Caregiver Resources",children:"Caregiver Resources"}),e.jsx(ce,{value:"Emergency Updates",children:"Emergency/Weather"}),e.jsx(ce,{value:"General",children:"General Announcements"})]})]})]}),L&&z&&e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{children:[e.jsxs("label",{className:"text-sm font-medium block mb-2",children:["Add Members from ",z.category," (",z.families.length," families)"]}),e.jsxs("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3 space-y-2",children:[e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(F,{type:"button",variant:"outline",size:"sm",onClick:()=>U(z.families.map(A=>A.id)),children:"Select All"}),e.jsx(F,{type:"button",variant:"outline",size:"sm",onClick:()=>U([]),children:"Clear All"})]}),z.families.map(A=>e.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:T.includes(A.id),onChange:D=>{D.target.checked?U([...T,A.id]):U(T.filter(ie=>ie!==A.id))},className:"rounded"}),e.jsx("span",{className:"text-sm",children:A.name})]},A.id))]})]})}),e.jsx(F,{onClick:Mt,disabled:Y.isPending,className:"w-full bg-aac-primary hover:bg-aac-primary/90",children:Y.isPending?"Creating...":"Create Group Chat"})]})]})]})})]})}),e.jsx(Se,{className:"p-0",children:G?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(A=>e.jsx("div",{className:"animate-pulse",children:e.jsx("div",{className:"h-16 bg-gray-200 rounded-lg"})},A))}):ge&&ge.length>0?e.jsx("div",{className:"space-y-1 p-2",children:ge.map(A=>e.jsxs("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${s===A.id?"bg-aac-primary/10 border-l-4 border-aac-primary":"hover:bg-aac-neutral-50"}`,onClick:()=>{console.log("Selecting group:",A.id,A.name),t(A.id),ue.invalidateQueries({queryKey:["/api/group-chats",A.id,"members"]}),ue.invalidateQueries({queryKey:["/api/group-chats",A.id,"messages"]})},children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[e.jsx("h4",{className:"font-medium text-sm truncate",children:A.name}),A.name.includes("Ahern Academy")&&e.jsxs("div",{className:"flex items-center space-x-1 flex-shrink-0",children:[e.jsx(mh,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-green-600 font-medium",children:"SMS"})]})]}),e.jsx(we,{variant:"secondary",className:"text-xs flex-shrink-0 cursor-pointer hover:bg-yellow-100",onClick:D=>{D.stopPropagation(),W(A.id),t(A.id),se(!0)},children:A.memberCount||0})]}),e.jsx("p",{className:"text-xs text-aac-neutral-600 truncate",children:A.description||A.category.replace("-"," ")}),e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsx("div",{className:"text-xs text-aac-neutral-500",children:s===A.id&&Fe&&Fe.length>0?`${Fe.length} messages`:"Click to view messages"}),s===A.id?e.jsx("div",{className:"text-xs text-aac-neutral-500",children:re?"Loading...":R?`${R.length} members`:"No members"}):null]})]},A.id))}):e.jsxs("div",{className:"text-center py-8 px-4",children:[e.jsx(Ir,{className:"w-12 h-12 mx-auto mb-3 text-aac-neutral-400"}),e.jsx("p",{className:"text-aac-neutral-600 mb-2",children:"No group chats yet"}),e.jsx("p",{className:"text-xs text-aac-neutral-500",children:"Create your first group chat to get started"})]})})]})}),e.jsx("div",{className:"lg:col-span-2",children:Le?e.jsxs(Ce,{className:"h-full flex flex-col",children:[e.jsx(Ve,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(F,{variant:"ghost",size:"sm",className:"lg:hidden",onClick:()=>t(null),children:e.jsx(Mu,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:Le.name}),e.jsx("p",{className:"text-sm text-aac-neutral-600",children:re?"Loading members...":O?`Error: ${O.message}`:R?`${R.length} members`:"No members"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(we,{variant:"outline",className:"text-xs",children:Le.category.replace("-"," ")}),e.jsx(F,{size:"sm",variant:"ghost",onClick:()=>
538{ue.invalidateQueries({queryKey:["/api/group-chats",s,"members"]}),ue.invalidateQueries({queryKey:["/api/group-chats",s,"messages"]})},className:"text-xs h-6 px-2",children:"Refresh"})]})]})}),e.jsxs(Se,{className:"flex-1 flex flex-col p-0",children:[e.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:be?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(A=>e.jsx("div",{className:"animate-pulse",children:e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-3/4"})]})]})},A))}):Fe&&Fe.length>0?e.jsxs(e.Fragment,{children:[Fe.map(A=>e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-aac-primary/10 rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-aac-primary",children:(A.senderName||"U").charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:A.senderName||"Unknown User"}),e.jsx("span",{className:"text-xs text-aac-neutral-500",children:_e(A.sentAt)}),A.senderType==="admin"&&e.jsx(we,{variant:"secondary",className:"text-xs",children:"Admin"})]}),A.content&&e.jsx("p",{className:"text-sm text-aac-neutral-700 mb-2",children:A.content}),A.mediaUrls&&A.mediaUrls.length>0&&e.jsx("div",{className:"grid grid-cols-2 gap-2 max-w-sm",children:A.mediaUrls.map((D,ie)=>e.jsx("img",{src:D,alt:`Image ${ie+1}`,className:"w-full h-24 object-cover rounded-lg border border-aac-neutral-200 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>window.open(D,"_blank")},ie))})]})]},A.id)),e.jsx("div",{ref:J})]}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ir,{className:"w-12 h-12 mx-auto mb-3 text-aac-neutral-400"}),e.jsx("p",{className:"text-aac-neutral-600",children:"No messages yet"}),e.jsx("p",{className:"text-sm text-aac-neutral-500",children:"Start the conversation!"})]})}),e.jsxs("div",{className:"p-4 border-t space-y-3",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsx("div",{className:"border-2 border-dashed border-aac-neutral-300 rounded-lg p-3",children:e.jsxs("div",{className:"text-center",children:[e.jsx(gr,{className:"mx-auto h-5 w-5 text-aac-neutral-400 mb-1"}),e.jsx("label",{htmlFor:"group-image-upload",className:"cursor-pointer",children:e.jsx("span",{className:"text-xs text-aac-blue hover:text-aac-blue-dark font-medium",children:"Upload images"})}),e.jsx(je,{id:"group-image-upload",type:"file",multiple:!0,accept:"image/*",onChange:K,className:"hidden"})]})}),e.jsxs(es,{open:k,onOpenChange:E,children:[e.jsx(jr,{asChild:!0,children:e.jsx("div",{className:"border-2 border-dashed border-aac-primary-300 rounded-lg p-3 cursor-pointer hover:border-aac-primary-500 transition-colors",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Bx,{className:"mx-auto h-5 w-5 text-aac-primary-500 mb-1"}),e.jsx("span",{className:"text-xs text-aac-primary font-medium",children:"Gallery"}),e.jsxs("p",{className:"text-xs text-aac-neutral-500",children:[(me==null?void 0:me.length)||0," bee images"]})]})})}),e.jsxs(ts,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{className:"text-aac-neutral-800",children:"Select Images from Gallery"})}),me&&me.length>0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:me.map(A=>e.jsxs("div",{className:`relative cursor-pointer rounded-lg border-2 transition-all ${P.includes(A)?"border-aac-primary bg-aac-primary/10":"border-aac-neutral-200 hover:border-aac-primary/50"}`,onClick:()=>X(A),children:[e.jsx("img",{src:`/images/${A}`,alt:A,className:"w-full h-24 object-cover rounded-md"}),P.includes(A)&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-aac-primary/20 rounded-md",children:e.jsx("div",{className:"w-6 h-6 bg-aac-primary text-white rounded-full flex items-center justify-center",children:"â"})}),e.jsxs("div",{className:"absolute bottom-1 left-1 bg-black bg-opacity-50 text-white text-xs px-1 rounded",children:[A.replace(/\.[^/.]+$/,"").substring(0,8),"..."]})]},A))}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[e.jsxs("span",{className:"text-sm text-aac-neutral-600",children:[P.length," image(s) selected"]}),e.jsxs("div",{className:"space-x-2",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{M([]),E(!1)},children:"Cancel"}),e.jsx(F,{size:"sm",onClick:De,disabled:P.length===0,className:"bg-aac-primary hover:bg-aac-primary-dark text-white",children:"Add Selected Images"})]})]})]}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Bx,{className:"mx-auto h-12 w-12 text-aac-neutral-400 mb-4"}),e.jsx("p",{className:"text-aac-neutral-600",children:"No images found in gallery"})]})]})]})]}),w.length>0&&e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:w.map((A,D)=>e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:A,alt:`Preview ${D+1}`,className:"w-full h-16 object-cover rounded-lg border border-aac-neutral-200"}),e.jsx("button",{type:"button",onClick:()=>xe(D),className:"absolute -top-1 -right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Gr,{className:"h-2 w-2"})})]},D))})]}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(je,{placeholder:"Type your message...",value:n,onChange:A=>r(A.target.value),onKeyPress:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),$())},className:"flex-1"}),e.jsx(F,{onClick:$,disabled:!n.trim()&&y.length===0||Te.isPending,className:"bg-aac-primary hover:bg-aac-primary/90",children:e.jsx(ad,{
538className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-aac-neutral-500",children:"Press Enter to send, Shift+Enter for new line"}),y.length>0&&e.jsxs("p",{className:"text-xs text-green-600 font-medium",children:[y.length," image(s) attached"]})]})]})]})]}):e.jsx(Ce,{className:"h-full flex items-center justify-center",children:e.jsxs(Se,{className:"text-center",children:[e.jsx(Ir,{className:"w-16 h-16 mx-auto mb-4 text-aac-neutral-400"}),e.jsx("h3",{className:"text-lg font-medium text-aac-neutral-800 mb-2",children:"Select a Group Chat"}),e.jsx("p",{className:"text-aac-neutral-600",children:"Choose a group from the left to start messaging"})]})})}),e.jsx(es,{open:_,onOpenChange:se,children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Group Members"})}),e.jsx("div",{className:"space-y-3",children:ae&&R&&R.length>0?e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-aac-neutral-600 mb-3",children:[R.length," members in this group:"]}),e.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2",children:R.map(A=>{var D;return e.jsxs("div",{className:"flex items-center space-x-3 p-2 bg-aac-neutral-50 rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 bg-aac-primary/20 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-sm font-medium text-aac-primary",children:((D=A.familyName)==null?void 0:D.charAt(0))||"?"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:A.familyName}),e.jsx("p",{className:"text-xs text-aac-neutral-500",children:A.familyEmail})]})]},A.id)})})]}):e.jsx("p",{className:"text-sm text-aac-neutral-500",children:"No members found in this group."})})]})})]})}const wW=te.object({type:te.enum(["sms","email","push"]),recipients:te.union([te.string(),te.array(te.string())]),subject:te.string().nullable().optional(),content:te.string().min(1,"Message content is required"),sentBy:te.string(),messagePurpose:te.enum(["promotional","transactional"]).optional()}).superRefine((s,t)=>{s.type==="email"&&!s.messagePurpose&&t.addIssue({code:te.ZodIssueCode.custom,path:["messagePurpose"],message:"Select whether this email is promotional or class/account-related"})}),N1=s=>/<[a-z][\s\S]*>/i.test(s),AW=(s,t=!1)=>{if(!s)return null;let n=s;return t&&s.length>100&&(n=s.substring(0,100)+"..."),N1(n)?e.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:n}}):e.jsx("span",{className:"whitespace-pre-wrap",children:n})};function w1(){const[s,t]=p.useState(""),[n,r]=p.useState("all"),[a,o]=p.useState("all"),[c,u]=p.useState("all"),[h,x]=p.useState("all"),[m,g]=p.useState("all"),[y,b]=p.useState(""),[w,N]=p.useState(!1),[k,E]=p.useState([]),[P,M]=p.useState(""),[L,B]=p.useState(""),[z,H]=p.useState([]),[T,U]=p.useState([]),[_,se]=p.useState(!1),[ae,W]=p.useState(!1),[J,ne]=p.useState(!1),[le,V]=p.useState(!1),[Z,ue]=p.useState(null),[ge,G]=p.useState("formatted"),[Ae,Fe]=p.useState("medium"),[be,Me]=p.useState(!0),[R,re]=p.useState(!1),{toast:O}=Is(),me=dn(),Y=async q=>{try{await navigator.clipboard.writeText(q),O({title:"Copied to clipboard",description:"Message content copied successfully"})}catch{O({title:"Copy failed",description:"Unable to copy to clipboard",variant:"destructive"})}},Te=q=>{const Xe=document.getElementById(q);Xe&&Xe.scrollTo({top:0,behavior:"smooth"})},Be=q=>{const Xe=document.getElementById(q);Xe&&Xe.scrollTo({top:Xe.scrollHeight,behavior:"smooth"})},ht=()=>{switch(Ae){case"small":return"text-xs";case"large":return"text-base";default:return"text-sm"}},Mt=(q,Xe)=>q?ge==="raw"?e.jsx("pre",{className:`whitespace-pre-wrap font-mono ${ht()} ${be?"":"whitespace-nowrap overflow-x-auto"}`,children:q}):N1(q)?e.jsx("div",{className:`prose prose-sm max-w-none ${ht()} ${be?"":"overflow-x-auto"}`,dangerouslySetInnerHTML:{__html:q}}):e.jsx("span",{className:`whitespace-pre-wrap ${ht()} ${be?"":"whitespace-nowrap overflow-x-auto"}`,children:q}):null,$=q=>{var js,ps;const Xe=window.open("","_blank");if(!Xe)return;const Lt=` 539 <!DOCTYPE html> 540 <html> 541 <head> 542 <title>Message: ${q.subject||"No Subject"}</title> 543 <style> 544 body { font-family: Arial, sans-serif; margin: 20px; line-height: 1.6; } 545 .header { border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; } 546 .meta { background: #f9f9f9; padding: 10px; border-radius: 5px; margin-bottom: 20px; } 547 .content { border: 1px solid #ddd; padding: 15px; border-radius: 5px; } 548 .recipients { margin-top: 20px; font-size: 0.9em; } 549 </style> 550 </head> 551 <body> 552 <div class="header"> 553 <h1>${q.subject||"No Subject"}</h1> 554 <p><strong>Type:</strong> ${(q.type||"MESSAGE").toUpperCase()}</p> 555 </div> 556 <div class="meta"> 557 <p><strong>Sent by:</strong> ${q.sentBy}</p> 558 <p><strong>Date:</strong> ${hs(q.sentDate)}</p> 559 <p><strong>Status:</strong> ${q.deliveryStatus}</p> 560 <p><strong>Audience:</strong>
560 ${q.audienceDisplayName||"Not specified"}</p> 561 </div> 562 <div class="content"> 563 <h3>Message Content:</h3> 564 ${N1(q.content)?q.content:`<pre>${q.content}</pre>`} 565 </div> 566 <div class="recipients"> 567 <h3>Recipients (${((js=q.recipients)==null?void 0:js.length)||0}):</h3> 568 ${((ps=q.recipients)==null?void 0:ps.map(Xt=>`<p>⢠${Xt}</p>`).join(""))||"<p>No recipients specified</p>"} 569 </div> 570 </body> 571 </html> 572 `;Xe.document.write(Lt),Xe.document.close(),Xe.print()},K=q=>{var Xt,Nn,wn;const Xe=` 573MESSAGE DETAILS 574=============== 575 576Subject: ${q.subject||"No Subject"} 577Type: ${(q.type||"MESSAGE").toUpperCase()} 578Sent by: ${q.sentBy} 579Date: ${hs(q.sentDate)} 580Status: ${q.deliveryStatus} 581Audience: ${q.audienceDisplayName||"Not specified"} 582 583CONTENT: 584-------- 585${q.content} 586 587RECIPIENTS (${((Xt=q.recipients)==null?void 0:Xt.length)||0}): 588${((Nn=q.recipients)==null?void 0:Nn.map(En=>`⢠${En}`).join(` 589`))||"No recipients specified"} 590 `.trim(),Lt=new Blob([Xe],{type:"text/plain"}),js=URL.createObjectURL(Lt),ps=document.createElement("a");ps.href=js,ps.download=`message-${q.id}-${((wn=q.subject)==null?void 0:wn.replace(/[^a-zA-Z0-9]/g,"-"))||"no-subject"}.txt`,document.body.appendChild(ps),ps.click(),document.body.removeChild(ps),URL.revokeObjectURL(js),O({title:"Export successful",description:"Message exported as text file"})},xe=(q,Xe)=>{if(q.key!=="Escape"&&(q.ctrlKey||q.metaKey))switch(q.key){case"c":q.preventDefault(),Y(Xe.content||"");break;case"p":q.preventDefault(),$(Xe);break;case"e":q.preventDefault(),K(Xe);break}},{data:De,isLoading:X}=nt({queryKey:["/api/messages"]}),{data:_e}=nt({queryKey:["/api/images/list"]}),Le=async q=>{W(!0);try{const Xe=new FormData;Xe.append("file",q);const Lt=await fetch("/api/upload-image",{method:"POST",body:Xe});if(!Lt.ok)throw new Error("Upload failed");const js=await Lt.json();H(ps=>[...ps,js.url]),me.invalidateQueries({queryKey:["/api/images/list"]}),O({title:"Image uploaded successfully",description:`${js.filename} has been added to your message`})}catch{O({title:"Upload failed",description:"Failed to upload image. Please try again.",variant:"destructive"})}finally{W(!1)}},A=async q=>{ne(!0);try{const Xe=new FormData;
590Xe.append("file",q),console.log("Uploading document:",q.name,q.size,q.type);const Lt=await fetch("/api/upload-resource",{method:"POST",body:Xe});if(console.log("Upload response status:",Lt.status),!Lt.ok){const ps=await Lt.text();throw console.error("Upload failed with response:",ps),new Error(`Upload failed: ${Lt.status} ${Lt.statusText}`)}const js=await Lt.json();console.log("Upload result:",js),U(ps=>[...ps,{url:js.url,name:js.originalName||q.name,size:js.size||q.size}]),O({title:"Document uploaded successfully",description:`${js.originalName||q.name} has been added to your message`})}catch(Xe){console.error("Document upload error:",Xe),O({title:"Upload failed",description:Xe instanceof Error?Xe.message:"Failed to upload document. Please try again.",variant:"destructive"})}finally{ne(!1)}},D=Da({resolver:Oa(wW),defaultValues:{type:"email",recipients:[],subject:"",content:"",sentBy:"Admin User"}}),ie=D.watch("recipients"),$e=Array.isArray(ie)?ie:ie?[ie]:[],ke=D.watch("type"),S=D.watch("messagePurpose"),ve=$e.join(","),Ze=ke==="email"?"email":"sms",Qe=ke==="email"?S:"transactional",ct=`${ve}|${Ze}|${Qe||""}`,It=$e.length>0&&!$e.includes("custom");p.useEffect(()=>{$e.includes("custom")||b(""),It||M("")},[ve]);const Zs=`/api/messages/recipients/multi?${new URLSearchParams({audiences:ve,type:Ze,messagePurpose:Qe||"transactional"})}`,{data:Zt,isPending:qn,isFetching:xn,isError:un}=nt({queryKey:[Zs],staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,refetchInterval:6e4,queryFn:async({signal:q})=>{const Xe=await fetch(Zs,{signal:q});if(!Xe.ok)throw new Error(`Failed to fetch recipients (${Xe.status})`);return Xe.json()},enabled:It&&!!Qe});p.useEffect(()=>{Zt!=null&&Zt.families&&!xn&&!un&&It&&P!==ct&&(E(Zt.families.map(q=>q.id)),M(ct))},[Zt,xn,un,It,P,ct]);const Rt=(Zt==null?void 0:Zt.families.filter(q=>k.includes(q.id)).map(q=>q.id))??[],Os=!!Zt&&Rt.length!==Zt.families.length,vs=L.split(",").map(q=>q.trim()).filter(Boolean).join(","),[cs,Ts]=p.useState("");p.useEffect(()=>{const q=setTimeout(()=>Ts(vs),300);return()=>clearTimeout(q)},[vs]);const mn=Os||!!cs,ds=`/api/messages/recipients/multi?${new URLSearchParams({audiences:ve,type:Ze,messagePurpose:Qe||"transactional",...Os?{selectedFamilyIds:Rt.join(",")}:{},...cs?{additionalRecipients:cs}:{}})}`,ms=nt({queryKey:[ds],staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,refetchInterval:6e4,queryFn:async({signal:q})=>{const Xe=await fetch(ds,{signal:q});if(!Xe.ok)throw new Error(`Failed to fetch selected recipients (${Xe.status})`);return Xe.json()},enabled:It&&!!Qe&&!!Zt&&P===ct&&mn}),Yt=mn?ms.data:Zt,Ls=vs===cs&&It&&P===ct&&!qn&&!xn&&!un&&!!Zt&&(!mn||ms.isSuccess&&!ms.isFetching),xl=un||mn&&ms.isError,{data:bn}=nt({queryKey:["/api/messages/service-status"]}),ya=bt({mutationFn:async q=>{let Xe=[];if(z.length>0){const wn=z.map(En=>En.startsWith("/uploads/")?En:`/images/${En}`);Xe.push(...wn)}if(T.length>0){const wn=T.map(En=>En.url);Xe.push(...wn)}const Lt=Array.isArray(q.recipients)?q.recipients.includes("custom"):q.recipients==="custom",{messagePurpose:js,...ps}=q,Xt={...ps,...q.type==="email"&&js?{messagePurpose:js}:{},customRecipients:Lt?q.customRecipients:void 0,...!Lt&&q.selectedFamilyIds!==void 0?{selectedFamilyIds:q.selectedFamilyIds}:{},...!Lt&&q.additionalRecipients?{additionalRecipients:q.additionalRecipients}:{},mediaUrls:Xe.length>0?Xe:void 0,attachmentDetails:T.length>0?T.map(wn=>({url:wn.url,name:wn.name,size:wn.size,type:"document"})):void 0};return(await st("POST","/api/messages/send",Xt)).json()},onMutate:()=>{O({title:"Sending your message...",description:"Working on it â large audiences may take up to a minute."})},onSuccess:q=>{const Xe=q==null?void 0:q.deliveryWarning;let Lt="Your message has been sent successfully!";if(q.successSummary)Lt=q.successSummary;else if(q.familiesContacted&&q.familiesContacted.length>0){const js=q.familiesContacted.map(ps=>ps.name).join(", ");Lt=`Message sent to ${q.familyCount} families: ${js}`}else q.recipientCount>0&&(Lt=`Message sent to ${q.recipientCount} recipients`);if(O({title:"Message Sent!",description:Xe?`${Lt} ${q.deliveryWarning}`:Lt,variant:"default",duration:Xe?8e3:5e3}),q.filteredRecipients&&q.filteredRecipients.filteredCount>0){const{filteredCount:js,filteredEntries:ps,emailCount:Xt,invali
590dCount:Nn}=q.filteredRecipients;let wn="Recipients Filtered",En="";Xt>0&&Nn>0?En=`${Xt} email(s) and ${Nn} invalid entrie(s) were excluded for SMS: ${ps.slice(0,2).join(", ")}${js>2?"...":""}`:Xt>0?En=`${Xt} email address(es) were excluded (SMS requires phone numbers): ${ps.slice(0,2).join(", ")}${js>2?"...":""}`:En=`${Nn} invalid entrie(s) were excluded: ${ps.slice(0,2).join(", ")}${js>2?"...":""}`,setTimeout(()=>{O({title:wn,description:En,variant:"destructive"})},1e3)}D.reset(),H([]),U([]),b(""),E([]),M(""),B(""),me.invalidateQueries({queryKey:["/api/messages"]}),me.invalidateQueries({queryKey:["/api/dashboard/stats"]})},onError:q=>{String(q.message).includes("RECIPIENT_REVIEW_REQUIRED")&&me.invalidateQueries({predicate:Xe=>String(Xe.queryKey[0]).startsWith("/api/messages/recipients/multi?")}),O({title:"Error",description:q.message||"Failed to send message",variant:"destructive"})}}),ur=bt({mutationFn:async q=>(await st("DELETE",`/api/messages/${q}`)).json(),onSuccess:()=>{me.invalidateQueries({queryKey:["/api/messages"]}),O({title:"Success",description:"Message deleted successfully!"})},onError:q=>{O({title:"Error",description:q.message||"Failed to delete message",variant:"destructive"})}}),ni=bt({mutationFn:async q=>(await st("PATCH",`/api/messages/${q}/archive`)).json(),onSuccess:()=>{me.invalidateQueries({queryKey:["/api/messages"]}),O({title:"Success",description:"Message archived successfully!"})},onError:q=>{O({title:"Error",description:q.message||"Failed to archive message",variant:"destructive"})}}),Fi=q=>{confirm("Are you sure you want to delete this message? This action cannot be undone.")&&ur.mutate(q)},Ri=q=>{ni.mutate(q)},ri=q=>{if($e.length===0){O({title:"Select an audience",variant:"destructive"});return}const Xe={...q};if(Array.isArray(q.recipients)?q.recipients.includes("custom"):q.recipients==="custom"){if(!y.trim()){O({title:"Enter custom recipients",variant:"destructive"});return}Xe.customRecipients=y.trim()}else{if(!Ls||!Yt){O({title:"Recipient preview unavailable",description:"Wait for the current audience preview before sending.",variant:"destructive"});return}if(Rt.length===0&&!cs){O({title:"No recipients selected",variant:"destructive"});return}Xe.selectedFamilyIds=Rt,Xe.reviewToken=Yt.reviewToken,cs&&(Xe.additionalRecipients=cs)}ya.mutate(Xe)},gl=[{value:"all",label:"All Families"},{value:"weekly-password",label:"Weekly Password Recipients",hasTooltip:!0},{value:"ahern-academy",label:"Ahern Academy Families",hasTooltip:!0},{value:"open-enrollment",label:"Open Enrollment (Currently Enrolled)",hasTooltip:!0},{value:"open-enrollment-all",label:"Open Enrollment (All in Category)",hasTooltip:!0},{value:"one-on-one",label:"1:1 Session Families",hasTooltip:!0},{value:"yac",label:"Young Adult Chat Families",hasTooltip:!0},{value:"bookclub",label:"Book Club (Chit Chat Club)",hasTooltip:!0},{value:"recent-registrants",label:"Recent Registrants (No Enrollment)",hasTooltip:!0},{value:"overdue",label:"Families with Overdue Payments"},{value:"pending",label:"Families with Pending Payments"},{value:"custom",label:"Custom Phone/Email"}],ai=[{value:"email",label:"Email",icon:ir},{value:"sms",label:"SMS Text",icon:mh},{value:"push",label:"Push Notification",icon:Ir}],ii=(De==null?void 0:De.filter(q=>{const Xe=q.content.toLowerCase().includes(s.toLowerCase())||q.subject&&q.subject.toLowerCase().includes(s.toLowerCase())||q.sentBy&&q.sentBy.toLowerCase().includes(s.toLowerCase()),Lt=n==="all"||q.type===n,js=a==="all"||a==="admin"&&q.sentBy!=="system-reminder"&&q.sentBy!=="system-newsletter"&&q.sentBy!=="system-confirmation"||a==="system"&&(q.sentBy==="system-reminder"||q.sentBy==="system-newsletter"||q.sentBy==="system-confirmation"),ps=c==="all"||q.audie
590nceSelection===c||c==="ahern-academy"&&q.audienceSelection==="ahern_academy"||c==="open-enrollment"&&q.audienceSelection==="open_enrollment"||c==="yac"&&q.audienceSelection==="yac"||c==="bookclub"&&q.audienceSelection==="bookclub"||c==="one-on-one"&&q.audienceSelection==="1on1",Xt=h==="all"||q.deliveryStatus===h;let Nn=!0;if(m!=="all"&&q.sentDate){const wn=new Date(q.sentDate),En=new Date;switch(m){case"today":Nn=wn.toDateString()===En.toDateString();break;case"week":const yl=new Date(En.getTime()-10080*60*1e3);Nn=wn>=yl;break;case"month":const rt=new Date(En.getTime()-720*60*60*1e3);Nn=wn>=rt;break;case"quarter":const uc=new Date(En.getTime()-2160*60*60*1e3);Nn=wn>=uc;break}}return Xe&&Lt&&js&&ps&&Xt&&Nn}))||[],li=D.watch("content"),Ss=ke==="sms"?160-((li==null?void 0:li.length)||0):null,na=q=>{switch(q){case"email":return e.jsx(ir,{className:"w-4 h-4"});case"sms":return e.jsx(mh,{className:"w-4 h-4"});case"push":return e.jsx(Ir,{className:"w-4 h-4"});default:return e.jsx(Ir,{className:"w-4 h-4"})}},Mi=q=>{switch(q){case"sent":return"bg-blue-100 text-blue-800";case"delivered":return"bg-green-100 text-green-800";case"failed":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},en=q=>{switch(q){case"sent":return e.jsx(ys,{className:"w-4 h-4"});case"delivered":return e.jsx(As,{className:"w-4 h-4"});case"failed":return e.jsx(P0,{className:"w-4 h-4"});default:return e.jsx(ys,{className:"w-4 h-4"})}},hs=q=>q?new Date(q).toLocaleString():"Unknown Date",he=q=>{if(typeof q.recipients=="string"&&q.recipients==="all"||Array.isArray(q.recipients)&&q.recipients.includes("all"))return"All Families";if(Array.isArray(q.recipients))return q.recipients.length<=3?q.recipients.join(", "):`${q.recipients.slice(0,3).join(", ")} and ${q.recipients.length-3} more`;if(q.targetPrograms&&Array.isArray(q.targetPrograms)){const Xe=q.targetPrograms;return Xe.includes("ahern_academy")?"Ahern Academy Families":Xe.includes("open_enrollment")?"Open Enrollment Families":Xe.includes("yac")?"Young Adult Chat Families":Xe.includes("1on1")?"1:1 Session Families":Xe.join(", ")+" Families"}if(typeof q.recipients=="string")switch(q.recipients){case"ahern_academy":return"Ahern Academy Families";case"open_enrollment":return"Open Enrollment Families";case"yac":return"Young Adult Chat Families";case"1on1":return"1:1 Session Families";default:return"Selected Groups"}return"Selected Groups"};return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"max-w-7xl mx-auto",children:[e.jsx("div",{className:"bg-gradient-to-r from-[#77dbf6] to-[#93e3f8] rounded-xl p-4 sm:p-8 mb-6 sm:mb-8 shadow-lg",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-6",children:[e.jsx("div",{className:"p-3 sm:p-4 bg-white/20 backdrop-blur rounded-xl shadow-lg flex-shrink-0",children:e.jsx("img",{src:"/images/micbee.png",alt:"Message Bee",className:"w-8 h-8 sm:w-12 sm:h-12"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl lg:text-4xl font-bold text-white mb-1 sm:mb-2",children:"Message Center"}),e.jsx("p",{className:"text-white/90 text-sm sm:text-base lg:text-lg",children:"Send messages and newsletters to families"})]})]})})}),e.jsxs(Ql,{defaultValue:"compose",className:"space-y-4 sm:space-y-6",children:[e.jsxs(pl,{className:"grid w-full grid-cols-3 bg-[#77dbf6]/10 border-[#77dbf6]/20",children:[e.jsx(qs,{value:"compose",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Compose Message"}),e.jsx(qs,{value:"group-chat",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Group Text Chat"}),e.jsx(qs,{value:"history",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Message History"})]}),e.jsx(Hs,{value:"compose",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs(Ce,{className:"shadow-lg border-[#77dbf6]/20",children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2 text-[#4A4A4A]",children:[e.jsx(ad,{
590className:"w-5 h-5 text-[#77dbf6]"}),e.jsx("span",{children:"Compose New Message"})]})}),e.jsx(Se,{children:e.jsx(Fa,{...D,children:e.jsxs("form",{onSubmit:D.handleSubmit(ri),className:"space-y-6",children:[e.jsx(Ke,{control:D.control,name:"type",render:({field:q})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-[#4A4A4A]",children:"Message Type"}),e.jsxs(St,{onValueChange:Xe=>{q.onChange(Xe),Xe!=="email"&&D.setValue("messagePurpose",void 0)},value:q.value,children:[e.jsx(He,{children:e.jsx(At,{className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 h-11",children:e.jsx(kt,{})})}),e.jsx(Ct,{children:ai.map(Xe=>{const Lt=Xe.icon;return e.jsx(ce,{value:Xe.value,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Lt,{className:"w-4 h-4"}),e.jsx("span",{children:Xe.label})]})},Xe.value)})})]}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:D.control,name:"recipients",render:({field:q})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Audience Categories (Select one or more)"}),e.jsx("div",{className:"border rounded-lg p-3 space-y-2 bg-gray-50 max-h-64 overflow-y-auto",children:gl.map(Xe=>{const Lt=Array.isArray(q.value)?q.value:[q.value],js=Lt.includes(Xe.value);return e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(Gs,{id:`audience-${Xe.value}`,checked:js,onCheckedChange:ps=>{let Xt;ps?Xe.value==="custom"?Xt=["custom"]:Xt=[...Lt.filter(Nn=>Nn!=="custom"),Xe.value]:Xt=Lt.filter(Nn=>Nn!==Xe.value),q.onChange(Xt)}}),e.jsxs("label",{htmlFor:`audience-${Xe.value}`,className:"flex items-center space-x-2 text-sm cursor-pointer flex-1",children:[e.jsx(Ms,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:Xe.label})]})]},Xe.value)})}),It&&e.jsx("div",{className:"text-xs text-gray-600 mt-1",role:"status",children:ke==="email"&&!S?e.jsx("span",{children:"Select email purpose to calculate eligible recipients."}):xl?e.jsx("span",{className:"text-red-700",children:"Recipient preview failed. Sending is unavailable until it loads successfully."}):Ls?Yt&&e.jsxs("span",{children:[Yt.count," selected caregiver accounts · ",ke==="email"?Yt.emailCount:Yt.phoneCount," ",ke==="email"?"eligible email addresses":"phone numbers",ke==="email"&&S==="promotional"&&Yt.suppressedCount!==void 0&&` · ${Yt.suppressedCount} addresses excluded by marketing checks`,ke==="email"&&S==="transactional"&&" · essential message: marketing unsubscribes do not exclude eligible recipients",ke==="email"&&Yt.adminEmailCount!==void 0&&` · ${Yt.adminEmailCount} admin copies`,ke==="email"&&Yt.deliveryEmailCount!==void 0&&` · ${Yt.deliveryEmailCount} delivery addresses`,ke!=="email"&&Yt.adminPhoneCount!==void 0&&` · ${Yt.adminPhoneCount} admin copies`,ke!=="email"&&Yt.deliveryPhoneCount!==void 0&&` · ${Yt.deliveryPhoneCount} delivery phone numbers`,Yt.targetWeek!=null&&` · target week ${typeof Yt.targetWeek=="object"?`${Yt.targetWeek.weekStart} to ${Yt.targetWeek.weekEnd}`:Yt.targetWeek}`,Yt.deliveryDisabled&&" · promotional delivery currently disabled"]}):e.jsxs("span",{children:["Calculating recipients for ",$e.length," selected audience",$e.length===1?"":"s","â¦"]})}),e.jsx(Ye,{})]})}),It&&P===ct&&(Zt==null?void 0:Zt.families)&&Zt.families.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(ze,{className:"text-sm font-medium text-aac-neutral-800",children:["Select Recipients (",k.length," of ",Zt.families.length," selected)"]}),e.jsxs("div",{className:"space-x-2",children:[e.jsx(F,{type:"button",variant:"outline",size:"sm",onClick:()=>E(Zt.families.map(q=>q.id)),children:"Select All"}),e.jsx(F,{type:"button",variant:"outline",size:"sm",onClick:()=>E([]),children:"Deselect All"})]})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto border rounded-lg p-3 space-y-3 bg-gray-50",children:Zt.families.map(q=>e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(Gs,{checked:k.includes(q.id),onCheckedChange:Xe=>{E(Xe?Lt=>Lt.includes(q.id)?Lt:[...Lt,q.id]:Lt=>Lt.filter(js=>js!==q.id))}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:q.caregiverOneName}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:q.email})]})]},q.id))}),e.jsxs("div",{children:[e.jsxs(ze,{className:"text-sm font-medium text-aac-neutral-800 block mb-2",children:["Add Additional ",ke==="sms"?"Phone Numbers":"Email Addresses"," (Optional)"]}),e.jsx(je,{placeholder:ke==="sms"?"Enter additional phone numbers separated by commas":"Enter additional email addresses separated by commas",value:L,onChange:q=>B(q.target.value),className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary"}),e.jsx("p",{className:"text-xs text-aac-neutral-600 mt-1",children:"Add people not in the main audie
590nce category"})]})]}),$e.includes("custom")&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-aac-neutral-800 block mb-2",children:ke==="sms"?"Phone Numbers":"Email Addresses"}),e.jsx(je,{placeholder:ke==="sms"?"Enter phone numbers separated by commas (e.g., +1234567890, +0987654321)":"Enter email addresses separated by commas",value:y,onChange:q=>b(q.target.value),className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary"}),e.jsxs("p",{className:"text-xs text-aac-neutral-600 mt-1",children:["Separate multiple ",ke==="sms"?"phone numbers":"email addresses"," with commas"]})]}),ke==="email"&&e.jsx(Ke,{control:D.control,name:"subject",render:({field:q})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Subject Line"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Enter email subject...",className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary",value:q.value||"",onChange:q.onChange,onBlur:q.onBlur,name:q.name})}),e.jsx(Ye,{})]})}),ke==="email"&&e.jsx(Ke,{control:D.control,name:"messagePurpose",render:({field:q})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Email Purpose"}),e.jsxs(St,{value:q.value??"",onValueChange:q.onChange,children:[e.jsx(He,{children:e.jsx(At,{className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary",children:e.jsx(kt,{placeholder:"Choose a purpose..."})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"promotional",children:"Promotional"}),e.jsx(ce,{value:"transactional",children:"Class or account"})]})]}),e.jsx(Ak,{purpose:q.value}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:D.control,name:"content",render:({field:q})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Message Content"}),e.jsx(He,{children:ke==="email"?e.jsx(Bz,{value:q.value,onChange:q.onChange,placeholder:"Write your email message here...",height:"240px",className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary"}):e.jsx(Pt,{rows:6,placeholder:ke==="sms"?"Write your SMS message here (160 characters max)...":"Write your notification message here...",className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary",...q})}),Ss!==null&&e.jsxs("p",{className:`text-xs mt-1 ${Ss<0?"text-red-500":"text-aac-neutral-500"}`,children:[Ss," characters remaining for SMS"]}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-sm font-medium text-aac-neutral-800",children:["Attachments ",ke==="sms"?"(MMS)":""]}),ke==="sms"&&e.jsx("span",{className:"text-xs text-orange-600 font-medium",children:"Twilio: $0.02 per MMS"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-sm font-medium text-aac-neutral-700 flex items-center",children:[e.jsx(Bo,{className:"w-4 h-4 mr-2"}),"Images"]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("input",{type:"file",accept:"image/*",onChange:q=>{var Lt;const Xe=(Lt=q.target.files)==null?void 0:Lt[0];Xe&&(Le(Xe),q.target.value="")},className:"hidden",id:"image-upload-input"}),e.jsx(F,{type:"button",variant:"outline",className:"w-full border-dashed border-2 border-[#77dbf6]/40 hover:border-[#77dbf6] h-11 touch-manipulation",disabled:ae,onClick:()=>{var q;return(q=document.getElementById("image-upload-input"))==null?void 0:q.click()},children:ae?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-aac-primary border-t-transparent rounded-full animate-spin"}),"Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload New Image"]})})]}),e.jsxs(es,{open:_,onOpenChange:se,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{type:"button",variant:"outline",className:"flex-1 border-[#feea6a]/60 hover:border-[#feea6a] hover:bg-[#feea6a]/10 h-11 touch-manipulation",children:[e.jsx(Bo,{className:"w-4 h-4 mr-2"}),"Select from Gallery"]})}),e.jsxs(ts,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Select Images from Gallery"}),e.jsx("p",{className:"text-sm text-aac-neutral-600",children:"Choose images from the AAC Voices collection"})]}),e.jsx("div",{className:"grid grid-cols-4 md:grid-cols-6 gap-3 mt-4",children:_e==null?void 0:_e.map(q=>e.jsxs("div",{className:`relative border-2 rounded-lg overflow-hidden cursor-pointer transition-all ${z.includes(q)?"border-aac-primary bg-aac-primary/10":"border-aac-neutral-200 hover:border-aac-primary/50"}`,onClick:()=>{H(Xe=>Xe.includes(q)?Xe.filter(Lt=>Lt!==q):[...Xe,q])},children:[e.jsx("img",{src:`/images/${q}`,alt:q,className:"w-full h-16 object-cover"}),z.includes(q)&&e.jsx("div",{className:"absolute inset-0 bg-aac-primary/20 flex items-center justify-center",children:e.jsx("div",{className:"w-6 h-6 bg-aac-primary text-white rounded-full flex items-center justify-center text-xs font-bold",children:"â"})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 truncate",children:q.replace(".png","").replace(".jpg","").replace(".jpeg","")})]},q))}),e.jsxs("div",{className:"flex justify-between items-center mt-6 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-aac-neutral-600",children:[z.length," image",z.length!==1?"s":""," selected"]}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(F,{variant:"outline",onClick:()=>H([]),disabled:z.length===0,children:"Clear All"}),e.jsx(F,{onClick:()=>se(!1),className:"bg-[#77dbf6] text-white hover:bg-[#5DCFF2] h-11 touch-manipulation",children:"Add Selected Images"})]})]})]})]})]}),e.jsx("div",{className:"min-h-[80px] border-2 border-dashed border-aac-neutral-200 rounded-lg bg-aac-neutral-50",children:z.length>0?e.jsx("div",{className:"p-3",children:e.jsx("div",{className:"grid grid-cols-4 gap-2",children:z.map(q=>{const Xe=q.startsWith("/")?q:`/images/${q}`,Lt=q.split("/").pop()||q;return e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:Xe,alt:Lt,className:"w-full h-16 object-cover rounded border"}),e.jsx("button",{onClick:()=>H(js=>js.filter(ps=>ps!==q)),className:"absolute -top-2 -right-2 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Gr,{className:"w-3 h-3"})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 truncate",children:Lt.replace(".png","").replace(".jpg","").replace(".jpeg","")})]},q)})})}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center text-aac-neutral-500",children:[e.jsx(Bo,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No images selected"}),e.jsx("p",{className:"text-xs",children:"Images will appear here for preview"})]})})})]}),ke==="email"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-sm font-medium text-aac-neutral-700 flex items-center",children:[e.jsx(Js,{className:"w-4 h-4 mr-2"}),"Documents"]}),e.jsxs("div",{children:[e.jsx("input",{type:"file",accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip",onChange:q=>{var Lt;const Xe=(Lt=q.target.files)==null?void 0:Lt[0];Xe&&(A(Xe),q.target.value="")},className:"hidden",id:"document-upload-input"}),e.jsx(F,{type:"button",variant:"outline",className:"w-full border-dashed border-2 border-green-200 hover:border-green-400 h-11 touch-manipulation",disabled:J,onClick:()=>{var q;return(q=document.getElementById("document-upload-input"))==null?void 0:q.click()},children:J?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-green-500 border-t-transparent roun
590ded-full animate-spin"}),"Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(gr,{className:"w-4 h-4 mr-2"}),"Upload Document (PDF, Word, Excel, etc.)"]})})]}),e.jsx("div",{className:"min-h-[60px] border-2 border-dashed border-aac-neutral-200 rounded-lg bg-aac-neutral-50",children:T.length>0?e.jsx("div",{className:"p-3",children:e.jsx("div",{className:"space-y-2",children:T.map((q,Xe)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-white rounded border",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(EF,{className:"w-4 h-4 text-aac-neutral-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-aac-neutral-800 truncate max-w-[200px]",children:q.name}),e.jsxs("div",{className:"text-xs text-aac-neutral-500",children:[(q.size/1024/1024).toFixed(2)," MB"]})]})]}),e.jsx("button",{onClick:()=>U(Lt=>Lt.filter((js,ps)=>ps!==Xe)),className:"w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center text-xs hover:bg-red-600 transition-colors",children:e.jsx(Gr,{className:"w-3 h-3"})})]},Xe))})}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center text-aac-neutral-500",children:[e.jsx(Js,{className:"w-6 h-6 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No documents selected"}),e.jsx("p",{className:"text-xs",children:"Documents for email attachments only"})]})})})]})]}),e.jsxs(F,{type:"submit",disabled:ya.isPending||Ss!==null&&Ss<0||$e.length===0||It&&(!Ls||Rt.length===0&&!cs),className:"w-full bg-[#77dbf6] text-white hover:bg-[#5DCFF2] h-11 text-base font-medium touch-manipulation",children:[ya.isPending?e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}):e.jsx(ad,{className:"w-4 h-4 mr-2"}),"Send Message"]})]})})})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsx(Ue,{className:"text-lg",children:"Quick Test"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Test messaging with your own phone/email"})]}),e.jsxs(Se,{className:"space-y-3",children:[e.jsxs(F,{variant:"outline",className:"w-full justify-start border-[#feea6a]/60 hover:border-[#feea6a] hover:bg-[#feea6a]/10 h-11 touch-manipulation",onClick:()=>{D.setValue("type","sms"),D.setValue("recipients","custom"),D.setValue("content","Test SMS from AAC Voices system - working correctly!"),b("")},children:[e.jsx(mh,{className:"w-4 h-4 mr-2"}),"Test SMS to My Phone"]}),e.jsxs(F,{variant:"outline",className:"w-full justify-start border-[#77dbf6]/40 hover:border-[#77dbf6] hover:bg-[#77dbf6]/10 h-11 touch-manipulation",onClick:()=>{D.setValue("type","email"),D.setValue("recipients","custom"),D.setValue("subject","Test Email from AAC Voices"),D.setValue("content","This is a test email from the AAC Voices messaging system. If you're receiving this, email delivery is working correctly!"),b("")},children:[e.jsx(ir,{className:"w-4 h-4 mr-2"}),"Test Email to My Address"]})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{className:"text-lg",children:"Quick Templates"})}),e.jsxs(Se,{className:"space-y-3",children:[e.jsx(F,{variant:"outline",className:"w-full justify-start",onClick:()=>{D.setValue("subject","Weekly Class Reminder"),D.setValue("content","Don't forget about your AAC Voices classes this week! Please check your schedule and prepare any materials needed. If you have questions, feel free to reach out.")},children:"Weekly Class Reminder"}),e.jsx(F,{variant:"outline",className:"w-full justify-start",onClick:()=>{D.setValue("subject","Payment Due Reminder"),D.setValue("content","This is a friendly reminder that your payment is due soon. Please visit the family portal to complete your payment. Contact us if you need assistance.")},children:"Payment Reminder"}),e.jsx(F,{variant:"outline",className:"w-full justify-start",onClick:()=>{D.setValue("subject","Important AAC Voices Update"),D.setValue("content","We have an important update regarding our programs. Please check this message carefully and contact us if you have any questions.")},children:"Important Update"}),e.jsx(F,{variant:"outline",className:"w-full justify-start",onClick:()=>{D.setValue("subject","Welcome to AAC Voices!"),D.setValue("content","Welcome to the AAC Voices community! We're excited to work with your family. Please log into the family portal to complete your registration and access resources.")},children:"Welcome Message"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"text-lg flex items-center justify-between",children:["Service Status",bn&&e.jsxs("span",{className:"text-xs text-aac-neutral-500 font-normal",children:["Updated: ",new Date(bn.lastChecked).toLocaleTimeString()]})]})}),e.jsx(Se,{className:"space-y-4",children:bn?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ir,{className:"w-4 h-4 text-aac-neutral-600"}),e.jsx("span",{className:"text-sm font-medium",children:"Email Services"})]}),e.jsx(we,{variant:bn.email.operational?"default":"secondary",children:bn.email.operational?"Operational":"Offline"})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 ml-6",children:bn.email.providers.filter(q=>q.configured).map(q=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"font-medium",children:q.name}),q.primary&&e.jsx(we,{variant:"outline",className:"text-xs",children:"Primary"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs text-aac-neutral-600",children:q.cost}),e.jsx(we,{variant:q.status==="live"?"default":"secondary",className:"text-xs",children:q.status==="live"?"Live":"Configured"})]})]},q.key))}),bn.email.fallbackChain.length>0&&e.jsxs("p",{className:"text-xs text-aac-neutral-500 ml-6",children:["Fallback: ",bn.email.fallbackChain.join(" â ")]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(mh,{className:"w-4 h-4 text-aac-neutral-600"}),e.jsx("span",{className:"text-sm font-medium",children:"SMS Services"})]}),e.jsx(we,{variant:bn.sms.operational?"default":"secondary",children:bn.sms.operational?"Operational":"Offline"})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 ml-6",children:bn.sms.providers.filter(q=>q.configured).map(q=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"font-medium",children:q.name}),q.primary&&e.jsx(we,{variant:"outline",className:"text-xs",children:"Primary"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs text-aac-neutral-600",children:q.cost}),e.jsx(we,{variant:q.status==="live"?"default":"secondary",className:"text-xs",children:q.status==="live"?"Active":"Configured"})]})]},q.key))}),bn.sms.fallbackChain.length>0&&e.jsxs("p",{className:"text-xs text-aac-neutral-500 ml-6",children:["Fallback: ",bn.sms.fallbackChain.join(" â ")]})]})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-aac-neutral-300 border-t-aac-blue rounded-full mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-aac-neutral-500",children:"Loading status..."})]})})]})]})]})}),e.jsx(Hs,{value:"group-chat",children:e.jsx(NW,{})}),e.jsx(Hs,{value:"history",children:e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex flex-col space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ue,{children:"Message History"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("span",{className:"text-sm text-aac-neutral-600",children:[ii.length," message",ii.length!==1?"s":"",De&&ii.length!==De.length&&e.jsxs("span",{className:"text-aac-neutral-500",children:[" of ",De.length]})]}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{t(""),r("all"),o("all"),u("all"),x("all"),g("all")},className:"text-xs",children:"Clear Filters"})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Bl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-aac-neutral-400 w-4 h-4"}),e.jsx(je,{placeholder:"Search messages, subjects, content, or sender...",value:s,onChange:q=>t(q.target.value),className:"pl-10"})]}
590),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[e.jsxs(St,{value:n,onValueChange:r,children:[e.jsxs(At,{className:"w-full",children:[e.jsx(Wx,{className:"w-4 h-4 mr-2"}),e.jsx(kt,{placeholder:"Type"})]}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Types"}),e.jsx(ce,{value:"email",children:"ð§ Email"}),e.jsx(ce,{value:"sms",children:"ð± SMS"}),e.jsx(ce,{value:"push",children:"ð Push"})]})]}),e.jsxs(St,{value:a,onValueChange:o,children:[e.jsxs(At,{className:"w-full",children:[e.jsx(Ms,{className:"w-4 h-4 mr-2"}),e.jsx(kt,{placeholder:"Sender"})]}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Senders"}),e.jsx(ce,{value:"admin",children:"ð¨âð¼ Admin Sent"}),e.jsx(ce,{value:"system",children:"ð¤ System Generated"})]})]}),e.jsxs(St,{value:c,onValueChange:u,children:[e.jsxs(At,{className:"w-full",children:[e.jsx(Ms,{className:"w-4 h-4 mr-2"}),e.jsx(kt,{placeholder:"Audience"})]}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Audiences"}),e.jsx(ce,{value:"ahern-academy",children:"ð Ahern Academy"}),e.jsx(ce,{value:"open-enrollment",children:"ð Open Enrollment"}),e.jsx(ce,{value:"yac",children:"ð¬ Young Adult Chat"}),e.jsx(ce,{value:"one-on-one",children:"ð¥ 1:1 Sessions"}),e.jsx(ce,{value:"newsletter",children:"ð Newsletter"}),e.jsx(ce,{value:"payment-reminder",children:"ð° Payment Reminders"}),e.jsx(ce,{value:"enrollment-confirmation",children:"â
Enrollment Confirmations"})]})]}),e.jsxs(St,{value:h,onValueChange:x,children:[e.jsxs(At,{className:"w-full",children:[e.jsx(As,{className:"w-4 h-4 mr-2"}),e.jsx(kt,{placeholder:"Status"})]}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Status"}),e.jsx(ce,{value:"sent",children:"ð¤ Sent"}),e.jsx(ce,{value:"delivered",children:"â
Delivered"}),e.jsx(ce,{value:"failed",children:"â Failed"})]})]}),e.jsxs(St,{value:m,onValueChange:g,children:[e.jsxs(At,{className:"w-full",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),e.jsx(kt,{placeholder:"Date"})]}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Time"}),e.jsx(ce,{value:"today",children:"ð
Today"}),e.jsx(ce,{value:"week",children:"ð
Past Week"}),e.jsx(ce,{value:"month",children:"ð
Past Month"}),e.jsx(ce,{value:"quarter",children:"ð
Past 3 Months"})]})]})]}),(s||n!=="all"||a!=="all"||c!=="all"||h!=="all"||m!=="all")&&e.jsxs("div",{className:"flex flex-wrap gap-2 p-3 bg-aac-neutral-50 rounded-lg",children:[e.jsx("span",{className:"text-sm font-medium text-aac-neutral-700",children:"Active filters:"}),s&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>t(""),children:['Search: "',s,'" â']}),n!=="all"&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>r("all"),children:["Type: ",n.toUpperCase()," â"]}),a!=="all"&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>o("all"),children:["Sender: ",a==="admin"?"Admin":"System"," â"]}),c!=="all"&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>u("all"),children:["Audience: ",c.replace("-"," ")," â"]}),h!=="all"&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>x("all"),children:["Status: ",h," â"]}),m!=="all"&&e.jsxs(we,{variant:"secondary",className:"cursor-pointer",onClick:()=>g("all"),children:["Date: ",m==="week"?"Past Week":m==="month"?"Past Month":m==="quarter"?"Past 3 Months":m," â"]})]})]})}),e.jsx(Se,{children:X?e.jsx("div",{className:"space-y-4",children:[1,2,3,4].map(q=>e.jsx("div",{className:"animate-pulse border border-aac-neutral-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/3 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/2"})]})]})},q))}):ii.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ir,{className:"w-16 h-16 mx-auto mb-4 text-aac-neutral-400"}),e.jsx("h3",{className:"text-lg font-semibold text-aac-neutral-800 mb-2",children:s||n!=="all"?"No messages found":"No messages sent yet"}),e.jsx("p",{className:"text-aac-neutral-600",children:s||n!=="all"?"Try adjusting your search or filter criteria":"Start by composing your first message to families"})]}):e.jsx("div",{className:"space-y-4",children:ii.map(q=>{var Xe,Lt,js;return e.jsx("div",{className:"border border-aac-neutral-200 rounded-lg p-4 hover:bg-aac-neutral-50 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-aac-neutral-100",children:na(q.type)}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-aac-neutral-800",children:q.subject||`${(q.type||"MESSAGE").toUpperCase()} Message`}),e.jsx(we,{className:Mi(q.deliveryStatus),children:e.jsxs("div",{className:"flex items-center space-x-1",children:[en(q.deliveryStatus),e.jsx("span",{className:"capitalize",children:q.deliveryStatus})]})}),e.jsx(we,{variant:"outline",className:"text-xs",children:(q.type||"MESSAGE").toUpperCase()})]}),e.jsx("div",{className:"text-aac-neutral-600 mb-2",children:AW(q.content,!0)}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-aac-neutral-500",children:[e.jsxs("span",{children:["Sent by ",q.sentBy]}),e.jsx("span",{children:"â¢"}),e.jsx("span",{children:hs(q.sentDate)}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:["Audience: ",q.audienceDisplayName||"Not specified"]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:["Recipients: ",he(q)]})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(es,{children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",children:"View Details"})}),e.jsxs(ts,{className:"max-w-[95vw] md:max-w-3xl lg:max-w-4xl xl:max-w-5xl max-h-[90vh] flex flex-col",onKeyDown:ps=>
590xe(ps,q),tabIndex:-1,children:[e.jsx(ss,{className:"pb-4 border-b border-aac-neutral-200",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(ns,{className:"text-lg font-semibold",children:"Message Details"}),e.jsx("div",{className:"text-xs text-aac-neutral-500 hidden md:block",children:"Press Ctrl+C to copy ⢠Ctrl+P to print ⢠Ctrl+E to export"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>$(q),className:"h-8 px-2",children:e.jsx(Xr,{className:"w-4 h-4"})})}),e.jsx(Qa,{children:"Print message (Ctrl+P)"})]})}),e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>K(q),className:"h-8 px-2",children:e.jsx(Js,{className:"w-4 h-4"})})}),e.jsx(Qa,{children:"Export as text (Ctrl+E)"})]})})]}),e.jsx("div",{className:"h-6 border-l border-aac-neutral-200"}),e.jsx(we,{className:Mi(q.deliveryStatus),children:e.jsxs("div",{className:"flex items-center space-x-1",children:[en(q.deliveryStatus),e.jsx("span",{className:"capitalize",children:q.deliveryStatus})]})}),e.jsx(we,{variant:"outline",className:"bg-aac-teal-50 text-aac-teal-700 border-aac-teal-200",children:(q.type||"MESSAGE").toUpperCase()})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto space-y-6 py-4 pr-2",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 p-4 bg-aac-neutral-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700 mb-1",children:"Subject"}),e.jsx("p",{className:"text-sm font-medium text-aac-neutral-900",children:q.subject||"No subject"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700 mb-1",children:"Sent By"}),e.jsx("p",{className:"text-sm text-aac-neutral-900",children:q.sentBy})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700 mb-1",children:"Sent Date"}),e.jsx("p",{className:"text-sm text-aac-neutral-900",children:hs(q.sentDate)})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700",children:"Audience Selection"}),e.jsxs("div",{className:"p-3 bg-aac-blue-50 rounded-md border border-aac-blue-200",children:[e.jsx("p",{className:"text-sm text-aac-blue-900",children:q.audienceDisplayName||"Not specified"}),q.recipientCount&&e.jsxs("p",{className:"text-xs text-aac-blue-700 mt-1",children:["Total recipients: ",q.recipientCount]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700",children:"Message Channel"}),e.jsx("div",{className:"p-3 bg-aac-neutral-100 rounded-md border border-aac-neutral-200",children:e.jsx("p",{className:"text-sm text-aac-neutral-900 capitalize",children:q.channel||q.type||"Not specified"})})]})]}),((Xe=q.failedRecipients)==null?void 0:Xe.length)>0&&e.jsxs("div",{className:"p-3 bg-red-50 rounded-md border border-red-200 space-y-1",children:[e.jsxs("h4",{className:"font-semibold text-sm text-red-700",children:["Failed Deliveries (",q.failedRecipients.length,")"]}),e.jsx("p",{className:"text-xs text-red-600",children:"The following addresses could not be delivered:"}),e.jsx("ul",{className:"text-xs text-red-800 space-y-0.5",children:q.failedRecipients.map((ps,Xt)=>e.jsx("li",{className:"font-mono",children:ps},Xt))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700",children:"Message Content"}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"text-xs text-aac-neutral-500",children:q.content?`${q.content.length} characters`:"No content"}),e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>Y(q.content||""),disabled:!q.content,children:e.jsx(u7,{className:"w-4 h-4"})})}),e.jsx(Qa,{children:"Copy content"})]})})]})]}),e.jsxs("div",{className:"flex items-center justify-between p-2 bg-aac-neutral-50 rounded-lg border border-aac-neutral-200",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs text-aac-neutral-600",children:"View:"}),e.jsxs("div",{className:"flex bg-white rounded border border-aac-neutral-200",children:[e.jsxs(F,{variant:ge==="formatted"?"default":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>G("formatted"),children:[e.jsx(Ea,{className:"w-3 h-3 mr-1"}),"Formatted"]}),e.jsxs(F,{variant:ge==="raw"?"default":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>G("raw"),children:[e.jsx(Js,{className:"w-3 h-3 mr-1"}),"Raw"]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs text-aac-neutral-600",children:"Size:"}),e.jsxs("div",{className:"flex bg-white rounded border border-aac-neutral-200",children:[e.jsx(F,{variant:Ae==="small"?"default":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>Fe("small"),children:"Small"}),e.jsx(F,{variant:Ae==="medium"?"default":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>Fe("medium"),children:"Medium"}),e.jsx(F,{variant:Ae==="large"?"default":"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>Fe("large"),children:"Large"})]})]}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:be?"default":"ghost",size:"sm",className:"h-6 px-2",onClick:()=>Me(!be),children:e.jsx(OF,{className:"w-3 h-3"})})}),e.jsx(Qa,{children:be?"Disable text wrap":"Enable text wrap"})]})})})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>
590Te(`content-${q.id}`),children:e.jsx(pf,{className:"w-3 h-3"})})}),e.jsx(Qa,{children:"Scroll to top"})]})}),e.jsx(Ml,{children:e.jsxs(wi,{children:[e.jsx(Ai,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>Be(`content-${q.id}`),children:e.jsx(ac,{className:"w-3 h-3"})})}),e.jsx(Qa,{children:"Scroll to bottom"})]})})]})]}),e.jsx("div",{id:`content-${q.id}`,className:"bg-white border border-aac-neutral-200 rounded-lg max-h-96 overflow-y-auto transition-all duration-200",onScroll:ps=>{const Xt=ps.currentTarget,Nn=Xt.scrollHeight>Xt.clientHeight;re(Nn)},children:e.jsx("div",{className:"p-4 leading-relaxed select-text",children:Mt(q.content,q.id)})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-semibold text-sm text-aac-neutral-700",children:"Recipients"}),e.jsxs("div",{className:"text-xs text-aac-neutral-500",children:[((Lt=q.recipients)==null?void 0:Lt.length)||0," recipient",(((js=q.recipients)==null?void 0:js.length)||0)!==1?"s":""]})]}),e.jsx("div",{className:"bg-aac-neutral-50 border border-aac-neutral-200 rounded-lg max-h-60 overflow-y-auto",children:e.jsx("div",{className:"p-3",children:q.recipients&&q.recipients.length>0?e.jsx("div",{className:"grid gap-2",children:q.recipients.map((ps,Xt)=>e.jsxs("div",{className:"flex items-center space-x-2 text-xs bg-white p-2 rounded border border-aac-neutral-100",children:[e.jsx("div",{className:"w-2 h-2 bg-aac-green-400 rounded-full"}),e.jsx("span",{className:"text-aac-neutral-700 font-medium",children:ps})]},Xt))}):e.jsx("div",{className:"text-center py-8 text-aac-neutral-500",children:e.jsx("p",{className:"text-sm",children:"No recipients specified"})})})})]})]})]})]}),e.jsxs(fW,{children:[e.jsx(pW,{asChild:!0,children:e.jsx(F,{variant:"ghost",size:"sm",children:e.jsx(AF,{className:"w-4 h-4"})})}),e.jsxs(V$,{align:"end",children:[e.jsxs(b1,{className:"text-bee-yellow-600 hover:text-bee-yellow-700",onClick:()=>Ri(q.id),children:[e.jsx(Wo,{className:"w-4 h-4 mr-2"}),"Archive"]}),e.jsxs(b1,{className:"text-red-600 hover:text-red-700",onClick:()=>Fi(q.id),children:[e.jsx(pa,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})]})},q.id)})})})]})})]})]})})}const CW=te.union([te.string(),te.array(te.string())]).nullish();function U$(s){const t=CW.parse(s),n=Array.isArray(t)?t:t?[t]:[];return Array.from(new Set(n.flatMap(r=>r.split(",")).map(r=>r.trim()).filter(Boolean)))}function tw(s){return U$(s).join(",")}const SW=["draft","sent","archived"],ux="This newsletter is sending or its outcome needs review. Preview remains available; other actions are blocked to prevent duplicate emails or loss of sending history.";function Rc(s){return!SW.includes(s)}function kW(s,t=Date.now()){const n=s.sentCount??0,r=s.totalRecipients??0;switch(s.status){case"draft":return"Draft";case"sent":return"Sent";case"archived":return"Archived";case"completed_with_errors":return"Completed with errors";case"sending":{const a=s.lastProgressAt?new Date(s.lastProgressAt).getTime():NaN;return!Number.isFinite(a)||t-a>10*6e4?"Sending status needs checking":`Sending â ${n} of ${r} sent`}default:return"Sending status needs checking"}}function $W(s,t=0){return t?Math.min(3e4,5e3*2**Math.min(t-1,3)):s!=null&&s.some(n=>n.status==="sending")?5e3:6e4}const PW=({onLinkInsert:s})=>{const[t,n]=p.useState(!1),[r,a]=p.useState(""),[o,c]=p.useState(""),u=p.useRef(null),h=()=>{const g=window.getSelection();g&&!g.isCollapsed&&g.rangeCount>0?(u.current=g.getRangeAt(0).cloneRange(),c(g.toString().trim())):(u.current=null,c("")),n(!0)},x=()=>{if(r.trim()){const g=r.startsWith("http://")||r.startsWith("https://")?r:`https://${r}`;s(g,u.current,o),a(""),c(""),u.current=null,n(!1)}},m=()=>{a(""),u.current=null,n(!1)};return e.jsxs(es,{open:t,onOpenChange:n,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:g=>g.preventDefault(),onClick:h,className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Link","data-toolbar":"true",children:e.jsx(b2,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"sm:max-w-md","data-toolbar":"true",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Link"})}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"url",className:"text-sm font-medium",children:"URL"}),e.jsx(je,{id:"url",placeholder:"Enter URL (e.g., https://example.com)",value:r,onChange:g=>a(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),x()),g.key==="Escape"&&m()},autoFocus:!0})]})}),e.jsxs(sl,{className:"flex gap-2",children:[e.jsx(F,{variant:"outline",onClick:m,"data-toolbar":"true",children:"Cancel"}),e.jsx(F,{onClick:x,disabled:!r.trim(),className:"bg-aac-primary hover:bg-aac-primary/90","data-toolbar":"true",children:"Insert Link"})]})]})]})},EW=te.object({subject:te.string().min(1,"Subject is required"),
590content:te.string().min(1,"Content is required"),template:te.string().optional(),audience:te.array(te.string()).optional(),senderEmail:te.string().optional()}),sw=[{id:"weekly-password",name:"Weekly Password",subject:"Weekly Password - [Date]",content:`Dear AAC Voices Families, 591 592Welcome to this week's Weekly Password! 593 594 595ð **This Week's Theme:** 596[Add theme for the week] 597 598 599ð» **Zoom Information:** 600- Meeting ID: [Add Zoom meeting ID] 601- Passcode: [Add Zoom password] 602- Link: [Add Zoom link] 603 604 605ð **Resources:** 606- [Add weekly resources and materials] 607- [Add additional learning resources] 608 609 610â° **Reminders:** 611- [Add important reminders for families] 612- [Add upcoming deadlines or events] 613 614 615As always, please reach out if you have any questions! 616 617Best regards, 618The AAC Voices Team`},{id:"announcement",name:"Special Announcement",subject:"Important Update from AAC Voices",content:`Dear AAC Voices Families, 619 620We have an important announcement to share: 621 622[Your announcement here] 623 624 625ð **Key Details:** 626- When: [Date/Time] 627- What: [Event/Change] 628- Action needed: [What families should do] 629 630 631If you have questions, please don't hesitate to reach out. 632 633Best regards, 634The AAC Voices Team`},{id:"monthly-newsletter",name:"Newsletter",subject:"AAC Voices Monthly - [Month Year]",content:`Dear AAC Voices Community, 635 636Welcome to our newsletter! 637 638 639ð **This Month's Highlights:** 640- [Add major events or achievements] 641 642 643ð **Academic Updates:** 644- [Add curriculum or program updates] 645 646 647ð¥ **Community Corner:** 648- [Add family spotlights or community news] 649 650 651ð **Upcoming Events:** 652- [Add calendar items] 653 654 655ð **New Resources:** 656- [Add educational resources] 657 658 659Thank you for being part of our amazing community! 660 661Best regards, 662The AAC Voices Team`}],dv=[{id:"weekly-password",label:"Weekly Password Recipients",description:"Ahern Academy families + families with active enrollments for current week (DYNAMIC - changes weekly)"},{id:"all-current-families",label:"All Current Families (All Programs)",description:"Send to current enrolled families across Ahern Academy, 1:1 Sessions, Open Enrollment, and YAC (excludes newsletter-only subscribers)"},{id:"all-families",label:"All Active Families",description:"Send to all families with active status in the family portal"},{id:"all-newsletter-subscribers",label:"All Newsletter Subscribers",description:"Send to all newsletter subscribers (families + individual signups)"},{id:"ahern-academy",label:"Ahern Academy Families",description:"Families with students in Ahern Academy"},{id:"open-enrollment",label:"Open Enrollment Families",description:"Families with students in Open Enrollment classes"},{id:"yac",label:"Young Adult Chat Families",description:"Families with students in YAC programs"},{id:"one-on-one",label:"1:1 Session Families",description:"Families receiving individual sessions"},{id:"bookclub",label:"Bookclub Families",description:"Families with students registered for Chit Chat Club (bookclub)"},{id:"overdue-payments",label:"Overdue Payment Families",description:"Families with overdue payments"},{id:"pending-payments",label:"Pending Payment Families",description:"Families with pending payments"}];function TW({onEmojiSelect:s}){const[t,n]=p.useState(!1),r=["ð","ð","ð","ð","â¤ï¸","ð¥","â¨","ð","ð","ð","ð¯","ð¡","ð","ð","ð","ð","ð","ð¤","ðª","ð","ð ","â","â ","ð","ð¢","ðµ","ð¨","ð¸","ð","âï¸","ð","â¡"];return e.jsxs(es,{open:t,onOpenChange:n,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Emoji",children:e.jsx(g7,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Emoji"})}),e.jsx("div",{className:"grid grid-cols-8 gap-2 p-4",children:r.map((a,o)=>e.jsx(F,{variant:"ghost",size:"sm",className:"h-10 w-10 text-lg hover:bg-blue-50",onClick:()=>{s(a),n(!1)},children:a},o))})]})]})}function _W({onImageSelect:s,onBeforeOpen:t}
662){const[n,r]=p.useState(!1),[a,o]=p.useState([]),[c,u]=p.useState(!1),[h,x]=p.useState(!1),m=p.useRef(null),g=async()=>{u(!0);try{const N=await fetch("/api/images");if(N.ok){const k=await N.json();console.log("Loaded images from API:",k),o(k)}else console.error("Failed to fetch images, status:",N.status)}catch(N){console.error("Failed to load images:",N)}finally{u(!1)}},y=async N=>{x(!0);try{const k=new FormData;k.append("file",N);const E=await fetch("/api/upload-image",{method:"POST",body:k});if(!E.ok)throw new Error("Upload failed");const P=await E.json();s(P.url),r(!1),g()}catch(k){console.error("Failed to upload image:",k),alert("Failed to upload image. Please try again.")}finally{x(!1)}},b=N=>{var E;const k=(E=N.target.files)==null?void 0:E[0];k&&y(k),m.current&&(m.current.value="")},w=N=>{r(N),N&&g()};return e.jsxs(es,{open:n,onOpenChange:w,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:N=>{N.preventDefault(),t&&t()},className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Insert Image",children:e.jsx(Bo,{className:"h-4 w-4"})})}),e.jsxs(ts,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Insert Image"})}),e.jsxs("div",{className:"border-b pb-4 mb-4",children:[e.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:b,className:"hidden"}),e.jsx(F,{type:"button",onClick:()=>{var N;return(N=m.current)==null?void 0:N.click()},disabled:h,className:"w-full bg-aac-primary hover:bg-aac-primary/90",children:h?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin mr-2 h-4 w-4 border-2 border-white rounded-full border-t-transparent"}),"Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Bo,{className:"mr-2 h-4 w-4"}),"Upload Image from Computer"]})})]}),e.jsxs("div",{className:"overflow-y-auto max-h-96",children:[e.jsx("h3",{className:"text-sm font-medium mb-2 px-4",children:"Or select from gallery:"}),c?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx("div",{className:"text-gray-500",children:"Loading images..."})}):a.length===0?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx("div",{className:"text-gray-500",children:"No images found in gallery"})}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-4",children:a.map((N,k)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden cursor-pointer hover:border-blue-400 hover:shadow-md transition-all",onClick:()=>{s(`/images/${N}`),r(!1)},children:[e.jsx("div",{className:"h-24 w-full flex items-center justify-center bg-gray-50 p-2",children:e.jsx("img",{src:`/images/${N}`,alt:N,className:"max-h-full max-w-full object-contain"})}),e.jsx("div",{className:"p-2 text-xs text-gray-600 truncate",children:N})]},k))})]})]})]})}function IW({value:s,onChange:t,placeholder:n,rows:r=16}){const[a,o]=p.useState(!1),[c,u]=p.useState(!1),[h,x]=p.useState(!1),m=p.useRef(null),g=p.useRef(!1),y=p.useRef(null),b=()=>{const B=window.getSelection();B&&B.rangeCount>0?y.current=B.getRangeAt(0).cloneRange():y.current=null},w=B=>{if(!B||!m.current)return!1;try{const z=window.getSelection();if(z)return z.removeAllRanges(),z.addRange(B),!0}catch{}return!1},N=B=>{if(!m.current)return;const z=`<img src="${B}" alt="Newsletter Image" style="max-width: 300px; height: auto; display: block; margin: 8px 0; border: none;" />`;if(m.current.focus(),!w(y.current)){const T=window.getSelection();if(T&&T.rangeCount>0){const U=T.getRangeAt(0);if(!m.current.contains(U.commonAncestorContainer)){const _=document.createRange();_.selectNodeContents(m.current),_.collapse(!1),T.removeAllRanges(),T.addRange(_)}}}document.execCommand("insertHTML",!1,z),t(m.current.innerHTML),o(!0),y.current=null};p.useEffect(()=>{m.current&&s!==m.current.innerHTML&&(m.current.innerHTML=s)},[s]);const k=(B,z,H,T)=>{if(m.current){if(m.current.focus(),B==="createLink"&&z){const U=T!==void 0?T:y.current;if(U){const _=window.getSelection();_&&(_.removeAllRanges(),_.addRange(U)),document.execCommand("createLink",!1,z);const se=window.getSelection();if(se&&se.rangeCount>0){let ae=se.getRangeAt(0).commonAncestorContainer;for(;ae&&ae.nodeName!=="A";)ae=ae.parentNode;ae&&ae.nodeName==="A"&&(ae.setAttribute("target","_blank"),ae.setAttribute("rel","noopener"))}}else{const _=`<a href="${z}" target="_blank" rel="noopener">${z}</a>`;document.execCommand("insertHTML",!1," "+_)}t(m.current.innerHTML);return}document.execCommand(B,!1,z),t(m.current.innerHTML)}},E=()=>{m.current&&(o(!0),t(m.current.innerHTML))},P=()=>{x(!0),u(!0)},M=B=>{const z=B.relatedTarget;if(z&&z.closest('[data-toolbar="true"]')){g.current=!0;return}setTimeout(()=>{g.current||(x(!1),u(!1)),g.current=!1},100)},L=B=>{B.preventDefault();const z=B.clipboardData.getData("text/plain");document.execCommand("insertText",!1,z)};return e.jsxs("div",{className:`relative border border-aac-neutral-200 rounded-md transition-colors ${h?"ring-2 ring-aac-primary border-aac-primary":""}`,children:[e.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-aac-neutral-200 bg-gray-50 rounded-t-md","data-toolbar":"true",children:[e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:B=>B.preventDefault(),onClick:()=>k("bold"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Bold","data-toolbar":"true",children:e.jsx(d7,{className:"h-4 w-4"})}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:B=>B.preventDefault(),onClick:()=>k("italic"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Italic",children:e.jsx(h7,{className:"h-4 w-4"})}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:B=>B.preventDefault(),onClick:()=>k("underline"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Underline",children:e.jsx(y7,{className:"h-4 w-4"})}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onMouseDown:B=>B.preventDefault(),onClick:()=>k("insertUnorderedList"),className:"h-8 w-8 p-0 hover:bg-gray-200",title:"Bullet List",children:e.jsx(f7,{className:"h-4 w-4"})}),e.jsx(PW,{onLinkInsert:(B,z,H)=>{k("createLink",B,H,z)}}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsx(TW,{onEmojiSelect:B=>{var z;
662(z=m.current)==null||z.focus(),document.execCommand("insertText",!1,B),m.current&&t(m.current.innerHTML)}}),e.jsx(_W,{onImageSelect:N,onBeforeOpen:b}),e.jsx("div",{className:"w-px h-6 bg-gray-300 mx-1"}),e.jsxs("select",{onChange:B=>k("formatBlock",B.target.value),className:"text-sm border-0 bg-transparent px-2 py-1 rounded hover:bg-gray-200",title:"Text Style",children:[e.jsx("option",{value:"div",children:"Normal"}),e.jsx("option",{value:"h1",children:"Heading 1"}),e.jsx("option",{value:"h2",children:"Heading 2"}),e.jsx("option",{value:"h3",children:"Heading 3"})]})]}),e.jsx("div",{ref:m,className:`min-h-[200px] p-4 prose max-w-none bg-white rounded-b-md overflow-y-auto ${h?"ring-2 ring-aac-primary border-aac-primary":""}`,contentEditable:!0,suppressContentEditableWarning:!0,onFocus:P,onBlur:M,onInput:E,onPaste:L,style:{outline:"none"}}),!s&&!c&&e.jsx("div",{className:"absolute top-12 left-3 text-gray-400 pointer-events-none",children:n})]})}function DW({newsletterId:s}){const{data:t,isLoading:n}=nt({queryKey:[`/api/newsletters/${s}/analytics`],enabled:!!s});return n?e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"Loading analytics..."}):t?e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs",children:[e.jsxs("span",{className:"px-2 py-1 bg-green-100 text-green-700 rounded-full",children:[t.openRate||0,"% opened"]}),e.jsxs("span",{className:"px-2 py-1 bg-blue-100 text-blue-700 rounded-full",children:[t.deliveryRate||0,"% sent"]}),(t.clicked||0)>0&&e.jsxs("span",{className:"px-2 py-1 bg-purple-100 text-purple-700 rounded-full",children:[t.clickRate||0,"% clicked"]}),(t.trackingNeedsReview||0)>0&&e.jsxs("span",{className:"text-amber-800",children:["Provider tracking information needs review for ",t.trackingNeedsReview," records."]})]}):e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"Analytics data unavailable"})}function OW(){const[s,t]=p.useState(!1),[n,r]=p.useState(""),[a,o]=p.useState([]),[c,u]=p.useState(!1),h=a.filter(A=>!dv.some(D=>D.id===A)),x=c||h.length>0,[m,g]=p.useState(!1),[y,b]=p.useState(null),[w,N]=p.useState(!1),[k,E]=p.useState(!1),[P,M]=p.useState(null),[L,B]=p.useState(""),[z,H]=p.useState(!1),[T,U]=p.useState(null),{toast:_}=Is(),se=dn(),{data:ae,isLoading:W,isError:J}=nt({queryKey:["/api/newsletters"],queryFn:async({signal:A})=>{const D=await fetch("/api/newsletters",{signal:A,credentials:"include",cache:"no-store"});if(!D.ok)throw new Error("Unable to refresh sending status");const ie=await D.json();if(!Array.isArray(ie))throw new Error("Invalid newsletter status response");return ie},staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchIntervalInBackground:!0,refetchInterval:A=>$W(A.state.data,A.state.status==="error"?A.state.errorUpdateCount:0),retry:2,retryDelay:A=>Math.min(8e3,2e3*2**A)}),{data:ne}=nt({queryKey:["/api/google-workspace/senders"]}),le=(ae==null?void 0:ae.filter(A=>m?A.status==="archived":A.status!=="archived"))||[],V=Da({resolver:Oa(EW),defaultValues:{subject:"",content:"",template:"",audience:[],senderEmail:""}}),Z=A=>{try{const D=U$(A);o(D),V.setValue("audience",D),u(!1)}catch{o([]),V.setValue("audience",[]),u(!0)}};p.useEffect(()=>{y&&(V.setValue("subject",y.subject),V.setValue("content",y.content),y.template&&(V.setValue("template",y.template),r(y.template)),Z(y.audience))},[y,V]);const ue=a.join(","),ge=`/api/newsletters/recipients?${new URLSearchParams({audiences:ue})}`,{data:G,isSuccess:Ae,isFetching:Fe,isError:be}=nt({queryKey:[ge],staleTime:0,refetchOnMount:"always",queryFn:async()=>{const A=await fetch(ge);if(!A.ok)throw new Error(`Failed to fetch newsletter recipients (${A.status})`);return A.json()},enabled:a.length>0&&!x}),Me=a.length>0&&Ae&&!Fe&&!!G,R=A=>{const D=sw.find(ie=>ie.id===A);if(D){const ie=new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),$e=D.content.replace(/,(\s)/g,",<br>$1").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>").replace(/^/,"<p>").replace(/$/,"</p>");V.setValue("subject",D.subject.replace("[Date]",ie).replace("[Month Year]",ie)),V.setValue("content",$e,{shouldValidate:!0,shouldDirty:!0}),r(A)}},re=bt({mutationFn:async A=>{const D={...A,audience:tw(A.audience),...T!==null?{sourceNewsletterId:T}:{}};return(await st("POST","/api/newsletters",D)).json()},onSuccess:()=>{z||_({title:"Newsletter Created!",description:"Newsletter has been saved as draft."}),V.reset(),U(null),Z(null),t(!1),se.invalidateQueries({queryKey:["/api/newsletters"]})},onError:A=>{_({title:"Error",description:A.message||"Failed to create newsletter",variant:"destructive"}),H(!1)}}),O=bt({mutationFn:async({newsletterId:A,audience:D,senderEmail:ie})=>(await st("POST",`/api/newsletters/${A}/send`,{audience:D,senderEmail:ie})).json(),onSuccess:async(A,D)=>{A.status==="sending"?(_({title:"Sending Newsletter...",description:`Sending to ${A.totalRecipients||A.recipientCount} recipients. This may take a few minutes.`}),await se.invalidateQueries({queryKey:["/api/newsletters"]})):A.deliveryDisabled?_({title:"Delivery disabled",description:"Nothing was sent.",variant:"destructive"}):(_({title:"Newsletter Sent!",description:`Newsletter sent to ${A.recipientCount} subscribers!`}),se.invalidateQueries({queryKey:["/api/newsletters"]}),se.invalidateQueries({queryKey:["/api/dashboard/stats"]}))},onError:A=>{_({title:"Error",description:A.message||"Failed to send newsletter",variant:"destructive"})}}),me=bt({mutationFn:async({subject:A,content:D,senderEmail:ie})=>(await st("POST","/api/newsletters/test-send",{subject:A,content:D,testEmail:"[email protected]",senderEmail:ie})).json(),onSuccess:()=>{_({title:"Test Email Sent!",description:"Test newsletter sent to [email protected]"})},onError:A=>{_({title:"Test Send Failed",description:A.message||"Failed to send test newsletter",variant:"destructive"})}}),Y=bt({mutationFn:async({id:A,data:D})=>{const ie={...D,audience:tw(D.audience)};return(await st("PATCH",`/api/newsletters/${A}`,ie)).json()},onSuccess:()=>{_({title:"Newsletter Updated!",description:"Newsletter has been updated successfully."}),V.reset(),Z(null),b(null),t(!1),se.invalidateQueries({queryKey:["/api/newsletters"]})},onError:A=>{_({title:"Error",description:A.message||"Failed to update newsletter",variant:"destructive"})}}),Te=bt({mutationFn:async A=>(await st("PATCH",`/api/newsletters/${A}/archive`)).json(),onSuccess:()=>{_({title:"Newsletter Archived",description:"Newsletter has been archived successfully."}),se.invalidateQueries({queryKey:["/api/newsletters"]})},onError:A=>{_({title:"Error",description:A.message||"Failed to archive newsletter",variant:"destructive"})}}),Be=bt({mutationFn:async A=>(await st("DELETE",`/api/newsletters/${A}`)).json(),onSuccess:()=>{_({title:"Newsletter Deleted",description:"Newsletter has been permanently deleted."}),se.invalidateQueries({queryKey:["/api/newsletters"]})},onError:A=>{_({title:"Error",description:A.message||"Failed to delete newsletter",variant:"destructive"})}}),ht=A=>{x||(A={...A,audience:[...a]},y?Y.mutate({id:y.id,data:A}):re.mutate(A))},Mt=A=>{M(A.id),B(A.subject),N(!0)},$=A=>{M(A.id),B(A.subject),E(!0)},K=async A=>
662{try{A=await(await st("GET",`/api/newsletters/${A.id}/copy-source`)).json()}catch(D){_({title:"Copy unavailable",description:D.message,variant:"destructive"}),se.invalidateQueries({queryKey:["/api/newsletters"]});return}U(A.id),V.setValue("subject",`Copy of ${A.subject}`),V.setValue("content",A.content),A.template&&(V.setValue("template",A.template),r(A.template)),Z(A.audience),b(null),t(!0)},xe=()=>{P&&Be.mutate(P),N(!1),M(null),B("")},De=()=>{P&&Te.mutate(P),E(!1),M(null),B("")},X=async A=>{if(x)return;if(A={...A,audience:[...a]},a.length===0){_({title:"Target Audience Required",description:"Please select at least one target audience before sending the newsletter.",variant:"destructive"});return}if(!Me){_({title:"Recipient preview unavailable",description:"Wait for the selected audiences to finish loading before sending.",variant:"destructive"});return}const D=[...a];y?Y.mutate({id:y.id,data:A},{onSuccess:()=>{O.mutate({newsletterId:y.id,audience:D,senderEmail:A.senderEmail}),t(!1)}}):(H(!0),re.mutate(A,{onSuccess:ie=>{H(!1),O.mutate({newsletterId:ie.id,audience:D,senderEmail:A.senderEmail}),t(!1)}}))},_e=A=>{if(!A.subject||!A.content){_({title:"Missing Information",description:"Please fill in both subject and content to send test.",variant:"destructive"});return}me.mutate({subject:A.subject,content:A.content,senderEmail:A.senderEmail})},Le=A=>{const D=A?A.subject:V.getValues("subject"),ie=A?A.content:V.getValues("content");if(!D||!ie){_({title:"Missing Information",description:"Please fill in both subject and content to preview.",variant:"destructive"});return}const $e=ie.replace(/src="\/images\//g,`src="${window.location.origin}/images/`),ke=` 663 <html> 664 <head> 665 <title>Newsletter Preview</title> 666 <style> 667 body { font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; line-height: 1.6; background-color: #f9f9f9; } 668 .newsletter-container { background-color: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } 669 .logo { text-align: center; margin-bottom: 20px; } 670 .logo img { max-width: 150px; height: auto; } 671 h1 { color: #77dbf6; font-size: 28px; margin-bottom: 5px; text-align: center; } 672 h2 { color: #4A4A4A; font-size: 22px; margin-top: 0; text-align: center; } 673 h3 { color: #4A4A4A; font-size: 18px; margin-top: 20px; margin-bottom: 10px; } 674 .header { border-bottom: 2px solid #77dbf6; padding-bottom: 15px; margin-bottom: 25px; } 675 .content { color: #4A4A4A; } 676 .content h1, .content h2, .content h3 { color: #4A4A4A; } 677 .content strong { color: #333; } 678 .content ul { padding-left: 20px; } 679 .content li { margin-bottom: 5px; } 680 .content a { color: #77dbf6; text-decoration: underline; } 681 .content img { max-width: 100px; height: auto; margin: 0 4px; display: inline-block; vertical-align: middle; border: none; } 682 .footer { 683 margin-top: 30px; 684 padding-top: 20px; 685 border-top: 2px solid #77dbf6; 686 text-align: center; 687 font-size: 14px; 688 color: #4A4A4A; 689 } 690 .footer a { color: #77dbf6; text-decoration: none; } 691 .footer a:hover { text-decoration: underline; } 692 .footer-links { margin: 10px 0; } 693 .footer-links a { margin: 0 15px; } 694 </style> 695 </head> 696 <body> 697 <div class="newsletter-container"> 698 <div class="logo"> 699 <img src="${window.location.origin}/images/largelogo.png" alt="AAC Voices Logo" /> 700 </div> 701 <div class="header"> 702 <h1>AAC Voices Newsletter</h1> 703 <h2>${D}</h2> 704 </div> 705 <div class="content"> 706 ${$e} 707 </div> 708 <div class="footer"> 709 <div class="footer-links"> 710 <a href="https://www.aacvoices.org" target="_blank">www.aacvoices.org</a> 711 <a href="${window.location.origin}" target="_blank">Portal Login</a> 712 </div> 713 <div> 714 Questions? Contact us: 715 <a href="mailto:[email protected]">
715[email protected]</a> | 716 <a href="mailto:[email protected]">[email protected]</a> 717 </div> 718 </div> 719 </div> 720 </body> 721 </html> 722 `,S=new Blob([ke],{type:"text/html"}),ve=URL.createObjectURL(S);window.open(ve,"_blank"),setTimeout(()=>URL.revokeObjectURL(ve),1e4)};return e.jsxs("div",{className:"space-y-4 px-2 sm:px-0",children:[J&&e.jsx("p",{role:"alert",className:"rounded border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"Unable to refresh sending status. The last known information is shown; updates will retry automatically."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 justify-center sm:justify-start",children:[e.jsx(Gy,{className:"h-5 w-5 text-[#77dbf6]"}),e.jsx("h1",{className:"text-lg sm:text-2xl font-bold text-[#4A4A4A]",children:"Newsletter Management"})]}),e.jsx("p",{className:"text-sm text-gray-600 text-center sm:text-left",children:"Create and send newsletters to all families"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(es,{open:s,onOpenChange:A=>{t(A),A||(V.reset(),U(null),b(null),r(""),Z(null))},children:e.jsx(jr,{asChild:!0,children:e.jsxs(F,{className:"bg-[#77dbf6] text-white hover:bg-[#5DCFF2] h-12 text-base font-medium touch-manipulation",children:[e.jsx(Gy,{className:"w-5 h-5 mr-2"}),"Create Newsletter"]})})}),e.jsxs(F,{variant:"outline",onClick:()=>g(!m),className:"border-[#77dbf6] text-[#77dbf6] hover:bg-[#77dbf6] hover:text-black h-12 text-base font-medium touch-manipulation",children:[e.jsx(Wo,{className:"h-5 w-5 mr-2"}),m?"Hide Archived":"Show Archived"]})]})]}),e.jsx("div",{className:"space-y-3",children:W?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#77dbf6] mx-auto"}),e.jsx("p",{className:"text-gray-600 mt-2",children:"Loading newsletters..."})]}):le.length===0?e.jsxs(Ce,{className:"p-6 sm:p-8 text-center border-dashed border-2 border-gray-300",children:[e.jsx(Gy,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:m?"No Archived Newsletters":"No Newsletters Yet"}),e.jsx("p",{className:"text-gray-600 mb-4",children:m?"You don't have any archived newsletters.":"Create your first newsletter to start communicating with families."})]}):le.map(A=>e.jsx(Ce,{className:"p-3 sm:p-4 border-gray-200 hover:border-[#77dbf6] transition-colors",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-[#4A4A4A] break-words",children:A.subject}),e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium w-fit ${A.status==="sent"?"bg-green-100 text-green-800":A.status==="archived"?"bg-gray-100 text-gray-800":"bg-blue-100 text-blue-800"}`,children:kW(A)})]}),e.jsxs("p",{className:"text-sm text-gray-600 mb-2",children:[A.status==="sent"&&A.sentDate?`Sent on ${new Date(A.sentDate).toLocaleDateString()}`:`Created on ${new Date(A.createdDate).toLocaleDateString()}`,A.recipientCount&&A.recipientCount>0&&e.jsxs("span",{className:"block sm:inline sm:ml-2",children:["⢠",A.recipientCount," recipients"]})]}),A.status!=="draft"&&A.status!=="archived"&&e.jsxs("div",{className:"my-2 text-sm text-gray-700",role:"status","aria-live":"polite",children:[e.jsxs("p",{children:[A.sentCount??0," of ",A.totalRecipients??A.recipientCount??0," sent · ",A.errorsCount??0," reported errors"]}),e.jsxs("p",{children:["Last progress: ",A.lastProgressAt?new Date(A.lastProgressAt).toLocaleString("en-US",{timeZone:"America/New_York"})+" ET":"Not recorded"]}),Rc(A.status)&&e.jsxs("p",{className:"mt-1 text-amber-800",children:[ux," Reported errors do not prove that an email was not received."]})]}),A.status==="sent"&&e.jsx(DW,{newsletterId:A.id}),e.jsxs("p",{className:"text-sm text-gray-500 line-clamp-2",children:[(new DOMParser().parseFromString(A.content,"text/html").body.textContent||"").substring(0,100),"..."]})]}),e.jsxs("div",{className:"flex flex-row sm:flex-col gap-2 sm:gap-1 flex-wrap",children:[e.jsxs(F,{variant:"outline",size:"sm",onClick:D=>{D.preventDefault(),Le(A)},className:"flex-1 sm:flex-initial text-xs sm:text-sm h-8 sm:h-9 touch-manipulation border-[#77dbf6] text-[#77dbf6] hover:bg-[#77dbf6] hover:text-white",children:[e.jsx(Ea,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Preview"]}),e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>K(A),disabled:Rc(A.status),title:Rc(A.status)?ux:void 0,className:"flex-1 sm:flex-initial text-xs sm:text-sm h-8 sm:h-9 touch-manipulation border-[#77dbf6] text-[#77dbf6] hover:bg-[#77dbf6] hover:text-white",children:[e.jsx(u7,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Copy"]}),e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Mt(A),disabled:Rc(A.status),title:Rc(A.status)?ux:void 0,className:"flex-1 sm:flex-initial text-xs sm:text-sm h-8 sm:h-9 touch-manipulation border-[#4A4A4A] text-[#4A4A4A] hover:bg-[#4A4A4A] hover:text-white",children:[e.jsx(pa,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Delete"]}),A.status==="draft"&&e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>{b(A),t(!0)},className:"flex-1 sm:flex-initial text-xs sm:text-sm h-8 sm:h-9 touch-manipulation border-[#feea6a] text-[#4A4A4A] hover:bg-[#feea6a] hover:text-[#4A4A4A]",children:[e.jsx(Zr,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Edit"]}),A.status==="draft"&&e.jsxs(F,{size:"sm",onClick:()=>{b(A),t(!0)},className:"flex-1 sm:flex-initial bg-[#77dbf6] hover:bg-[#5bc4e8] text-black text-xs sm:text-sm h-8 sm:h-9 touch-manipulation",children:[e.jsx(ad,{
722className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Send"]}),A.status!=="archived"&&e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>$(A),disabled:Rc(A.status),title:Rc(A.status)?ux:void 0,className:"flex-1 sm:flex-initial text-xs sm:text-sm h-8 sm:h-9 touch-manipulation border-amber-500 text-amber-600 hover:bg-amber-50",children:[e.jsx(Wo,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1"}),"Archive"]})]})]})},A.id))}),e.jsx(es,{open:s,onOpenChange:A=>{t(A),A||(U(null),V.reset(),b(null),r(""),Z(null))},children:e.jsxs(ts,{className:"w-[95vw] max-w-4xl h-[95vh] max-h-[95vh] overflow-y-auto p-0 m-2",children:[e.jsx(ss,{className:"bg-gradient-to-r from-[#d0deff] to-[#dee0ff] p-4 sm:p-6 rounded-t-lg",children:e.jsx(ns,{className:"text-lg sm:text-xl font-bold text-[#4A4A4A]",children:y?"Edit Newsletter":"Create Newsletter"})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"lg:col-span-1",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold text-[#4A4A4A] mb-3 flex items-center",children:[e.jsx(Js,{className:"w-4 h-4 sm:w-5 sm:h-5 mr-2 text-[#4A4A4A]"}),"Choose Template"]}),e.jsx("div",{className:"space-y-3",children:sw.map(A=>e.jsx(Ce,{className:`cursor-pointer transition-all duration-200 hover:shadow-md border ${n===A.id?"ring-2 ring-[#77dbf6] bg-[#adcfff]/20 border-[#77dbf6]":"hover:bg-[#adcfff]/10 border-gray-200"}`,onClick:()=>R(A.id),children:e.jsxs(Se,{className:"p-4",children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:A.name}),e.jsxs("p",{className:"text-sm text-aac-neutral-600",children:[A.content.substring(0,100),"..."]})]})},A.id))}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-aac-neutral-800 mb-4",children:[e.jsx(Ms,{className:"w-5 h-5 inline mr-2"}),"Target Audience"]}),e.jsxs("div",{className:"space-y-3",children:[x&&e.jsxs("div",{role:"alert",className:"rounded border border-amber-300 bg-amber-50 p-3 text-sm",children:[e.jsx("p",{children:c?"The saved audience format could not be read. Clear it, then choose the groups you want.":`Unrecognized saved groups: ${h.join(", ")}. Remove them before saving or sending; recognized groups will be kept.`}),e.jsx(F,{type:"button",variant:"outline",className:"mt-2",onClick:()=>{Z(a.filter(A=>dv.some(D=>D.id===A)))},children:c?"Clear invalid saved selection":"Remove unrecognized groups"})]}),dv.map(A=>e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(Gs,{checked:a.includes(A.id),onCheckedChange:D=>{o(D?ie=>ie.includes(A.id)?ie:[...ie,A.id]:ie=>ie.filter($e=>$e!==A.id))},className:"mt-1"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-aac-neutral-800",children:A.label}),e.jsx("p",{className:"text-xs text-aac-neutral-600",children:A.description})]})]},A.id))]}),e.jsx("div",{className:"mt-4",children:e.jsx(Ak,{newsletter:!0})}),e.jsxs("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",role:"status",children:a.length===0?"Select an audience to preview recipients.":be?"Recipient preview failed. Sending is unavailable.":Me?`${G.count} selected caregiver accounts · ${G.emailCount} eligible recipient email addresses`:"Calculating recipients for selected audiencesâ¦"}),Me&&e.jsxs("p",{className:"text-xs text-blue-800 mt-1",children:[G.suppressedCount!==void 0&&`${G.suppressedCount} addresses excluded by marketing checks · `,G.adminEmailCount!==void 0&&`${G.adminEmailCount} admin copies · `,G.deliveryEmailCount!==void 0&&`${G.deliveryEmailCount} delivery addresses · `,G.targetWeek!=null&&`Target week ${typeof G.targetWeek=="object"?`${G.targetWeek.weekStart} to ${G.targetWeek.weekEnd}`:G.targetWeek} · `,G.deliveryDisabled&&"Promotional delivery currently disabled"]})]})]})]}),e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("h3",{className:"text-lg font-semibold text-[#4A4A4A] mb-4 flex items-center",children:[e.jsx(Zr,{className:"w-5 h-5 mr-2 text-[#4A4A4A]"}),"Newsletter Content"]}),e.jsx(Fa,{...V,children:e.jsxs("form",{onSubmit:V.handleSubmit(ht),className:"space-y-4",children:[e.jsx(Ke,{control:V.control,name:"subject",render:({field:A})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Subject Line"}),e.jsx(He,{children:e.jsx(je,{placeholder:"This Week in AAC Voices...",className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary",...A})}),e.jsx(Ye,{})]})}),ne&&ne.length>0&&e.jsx(Ke,{control:V.control,name:"senderEmail",render:({field:A})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Send From"}),e.jsx(He,{children:e.jsxs(St,{value:A.value,onValueChange:A.onChange,children:[e.jsx(At,{className:"border-aac-neutral-200 focus:ring-aac-primary focus:border-aac-primary",children:e.jsx(kt,{placeholder:"Select sender..."})}),e.jsx(Ct,{children:ne.map(D=>e.jsx(ce,{value:D.email,children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:D.name}),e.jsx("span",{className:"text-xs text-gray-500",children:D.description})]})},D.email))})]})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:V.control,name:"content",render:({field:A})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-sm font-medium text-aac-neutral-800",children:"Content"}),e.jsx(He,{children:e.jsx(IW,{value:A.value,onChange:D=>
722{console.log("RichTextEditor onChange called with:",D),console.log("Form field onChange being called"),A.onChange(D),console.log("Form field onChange completed")},placeholder:"Write your newsletter content here...",rows:16})}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsxs(F,{type:"button",variant:"outline",onClick:()=>Le(),className:"flex-1 border-[#77dbf6] text-[#4A4A4A] hover:bg-[#adcfff]/20",children:[e.jsx(Ea,{className:"w-4 h-4 mr-2"}),"Preview"]}),e.jsxs(F,{type:"button",onClick:()=>{const A=V.getValues();_e(A)},disabled:me.isPending,className:"flex-1 bg-[#feea6a] text-[#4A4A4A] hover:bg-yellow-300 shadow-md",children:[me.isPending?e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}):e.jsx(ad,{className:"w-4 h-4 mr-2"}),"Test Send"]}),e.jsxs(F,{type:"submit",disabled:re.isPending||Y.isPending||x,className:"flex-1 bg-[#77dbf6] text-white hover:bg-[#5DCFF2] shadow-md",children:[re.isPending||Y.isPending?e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}):e.jsx(Cx,{className:"w-4 h-4 mr-2"}),y?"Update Draft":"Save Draft"]}),e.jsxs(F,{type:"button",onClick:()=>{const A=V.getValues();X(A)},disabled:re.isPending||Y.isPending||O.isPending||!Me||x,className:"flex-1 bg-green-600 text-white hover:bg-green-700 shadow-md",children:[O.isPending?e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}):e.jsx(ad,{className:"w-4 h-4 mr-2"}),y?"Update & Send":"Save & Send"]})]})]})})]})]})]})}),e.jsx(es,{open:w,onOpenChange:N,children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsxs(ns,{className:"text-red-600 flex items-center gap-2",children:[e.jsx(pa,{className:"w-5 h-5"}),"Delete Newsletter"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Are you sure you want to permanently delete this newsletter?"}),e.jsx("div",{className:"bg-gray-50 p-3 rounded-lg",children:e.jsxs("p",{className:"font-medium text-sm",children:['"',L,'"']})}),e.jsx("p",{className:"text-xs text-red-600",children:"This action cannot be undone. The newsletter will be permanently removed."}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(F,{variant:"outline",onClick:()=>N(!1),disabled:Be.isPending,children:"Cancel"}),e.jsx(F,{onClick:xe,disabled:Be.isPending,className:"bg-[#4A4A4A] text-white hover:bg-gray-600",children:Be.isPending?"Deleting...":"Delete Newsletter"})]})]})]})}),e.jsx(es,{open:k,onOpenChange:E,children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsxs(ns,{className:"text-amber-600 flex items-center gap-2",children:[e.jsx(Wo,{className:"w-5 h-5"}),"Archive Newsletter"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Are you sure you want to archive this newsletter?"}),e.jsx("div",{className:"bg-gray-50 p-3 rounded-lg",children:e.jsxs("p",{className:"font-medium text-sm",children:['"',L,'"']})}),e.jsx("p",{className:"text-xs text-amber-600",children:`Archived newsletters can be viewed by checking "Show Archived" but won't appear in the main list.`}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(F,{variant:"outline",onClick:()=>E(!1),disabled:Te.isPending,children:"Cancel"}),e.jsx(F,{onClick:De,disabled:Te.isPending,className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-white",children:Te.isPending?"Archiving...":"Archive Newsletter"})]})]})]})})]})}function A1(){return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"container mx-auto",children:[e.jsx("div",{className:"bg-gradient-to-r from-[#77dbf6] to-[#93e3f8] rounded-xl p-4 sm:p-8 mb-6 sm:mb-8 shadow-lg",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-6",children:[e.jsx("div",{className:"p-3 sm:p-4 bg-white/20 backdrop-blur rounded-xl shadow-lg flex-shrink-0",children:e.jsx("img",{src:"/images/micbee.png",alt:"Newsletter Bee",className:"w-8 h-8 sm:w-12 sm:h-12"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl lg:text-4xl font-bold text-white mb-1 sm:mb-2",children:"Newsletter Management"}),e.jsx("p",{className:"text-white/90 text-sm sm:text-base lg:text-lg",children:"Create and send newsletters to AAC Voices families"})]})]})})}),e.jsx(OW,{})]})})}const ol=p.forwardRef(({className:s,...t},n)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:n,className:pt("w-full caption-bottom text-sm",s),...t})}));ol.displayName="Table";const cl=p.forwardRef(({className:s,...t},n)=>e.jsx("thead",{ref:n,className:pt("[&_tr]:border-b",s),...t}));cl.displayName="TableHeader";const dl=p.forwardRef(({className:s,...t},n)=>e.jsx("tbody",{ref:n,className:pt("[&_tr:last-child]:border-0",s),...t}));dl.displayName="TableBody";const FW=p.forwardRef(({className:s,...t},n)=>e.jsx("tfoot",{ref:n,className:pt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...t}));FW.displayName="TableFooter";const Un=p.forwardRef(({className:s,...t},n)=>e.jsx("tr",{ref:n,className:pt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...t}));Un.displayName="TableRow";
722const zt=p.forwardRef(({className:s,...t},n)=>e.jsx("th",{ref:n,className:pt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...t}));zt.displayName="TableHead";const Vt=p.forwardRef(({className:s,...t},n)=>e.jsx("td",{ref:n,className:pt("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));Vt.displayName="TableCell";const RW=p.forwardRef(({className:s,...t},n)=>e.jsx("caption",{ref:n,className:pt("mt-4 text-sm text-muted-foreground",s),...t}));RW.displayName="TableCaption";const C1={subscribed:"Subscribed",unsubscribed:"Unsubscribed",needs_review:"Needs review",inactive:"Inactive"},MW={subscribed:"bg-[#77dbf6] text-white",unsubscribed:"bg-[#4A4A4A]/20 text-[#4A4A4A]",needs_review:"bg-amber-100 text-amber-800",inactive:"bg-slate-200 text-slate-700"},LW=s=>s?C1[s]:"Unavailable",VW=s=>s?MW[s]:"bg-slate-100 text-slate-600";function S1(){const[s,t]=p.useState(!1),[n,r]=p.useState(""),[a,o]=p.useState(null),[c,u]=p.useState([]),[h,x]=p.useState(""),[m,g]=p.useState("all"),{toast:y}=Is(),b=dn(),{data:w=[],isLoading:N}=nt({queryKey:["/api/newsletter-subscribers"],queryFn:async()=>{const _=await fetch("/api/newsletter-subscribers");if(!_.ok)throw new Error("Failed to fetch subscribers");return _.json()}}),k=bt({mutationFn:async _=>{const se=await fetch("/api/newsletter-subscribers/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscribers:_})});if(!se.ok)throw new Error("Failed to import subscribers");return se.json()},onSuccess:_=>{b.invalidateQueries({queryKey:["/api/newsletter-subscribers"]}
722),y({title:"Import Successful",description:`Successfully imported ${_.subscribers.length} newsletter subscribers`}),t(!1),r(""),u([]),o(null)},onError:_=>{y({title:"Import Failed",description:_.message,variant:"destructive"})}}),E=bt({mutationFn:async _=>{const se=await fetch(`/api/newsletter-subscribers/${_}`,{method:"DELETE"});if(!se.ok)throw new Error("Failed to delete subscriber");return se.json()},onSuccess:()=>{b.invalidateQueries({queryKey:["/api/newsletter-subscribers"]}),y({title:"Subscriber Deleted",description:"Newsletter subscriber has been removed"})},onError:_=>{y({title:"Delete Failed",description:_.message,variant:"destructive"})}}),P=bt({mutationFn:async()=>{const _=await fetch("/api/newsletter-subscribers/auto-enroll-caregivers",{method:"POST",headers:{"Content-Type":"application/json"}});if(!_.ok)throw new Error("Failed to auto-enroll caregivers");return _.json()},onSuccess:_=>{b.invalidateQueries({queryKey:["/api/newsletter-subscribers"]}),y({title:"Auto-enrollment Complete",description:`Successfully enrolled ${_.enrolledCount} caregivers as newsletter subscribers`})},onError:_=>{y({title:"Auto-enrollment Failed",description:_.message,variant:"destructive"})}}),M=_=>{const se=_.trim().split(` 723`);if(se.length<2)return[];const ae=se[0].split(",").map(J=>J.trim().replace(/"/g,"")),W=[];for(let J=1;J<se.length;J++){const ne=se[J].split(",").map(V=>V.trim().replace(/"/g,"")),le={email:"",status:"active",source:"mailchimp_import",isActive:!0};ae.forEach((V,Z)=>{const ue=ne[Z]||"",ge=V.toLowerCase();ge.includes("email")?le.email=ue:ge.includes("first")&&ge.includes("name")?le.firstName=ue:ge.includes("last")&&ge.includes("name")?le.lastName=ue:ge.includes("location")||ge.includes("city")?le.location=ue:ge.includes("interest")||ge.includes("tag")?ue&&(le.interests=ue.split(";").map(G=>G.trim())):ge.includes("status")?le.status=ue.toLowerCase()==="subscribed"?"active":"unsubscribed":ge.includes("note")&&(le.notes=ue)}),le.email&&W.push(le)}return W},L=_=>{var W;const se=(W=_.target.files)==null?void 0:W[0];if(!se)return;o(se);const ae=new FileReader;ae.onload=J=>{var V;const ne=(V=J.target)==null?void 0:V.result;r(ne);const le=M(ne);u(le.slice(0,5))},ae.readAsText(se)},B=()=>{if(!n.trim())return;const _=M(n);u(_.slice(0,5))},z=()=>{const _=M(n);if(_.length===0){y({title:"No Data",description:"No valid subscriber data found to import",variant:"destructive"});return}k.mutate(_)},H=w.filter(_=>{if(m!=="all"&&_.marketingEligibility!==m)return!1;if(!h.trim())return!0;const se=h.toLowerCase(),ae=`${_.firstName||""} ${_.lastName||""}`.trim().toLowerCase(),W=_.email.toLowerCase(),J=(_.location||"").toLowerCase();return W.includes(se)||ae.includes(se)||J.includes(se)}),T=w.reduce((_,se)=>{const ae=se.marketingEligibility;return ae&&ae in _&&(_[ae]+=1),_},{subscribed:0,unsubscribed:0,needs_review:0,inactive:0}),U=new Set(w.filter(_=>_.marketingEligibility==="subscribed").map(_=>_.email.trim().toLowerCase()).filter(Boolean)).size;return N?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-aac-primary mx-auto mb-4"}),e.jsx("p",{className:"text-aac-neutral-500",children:"Loading subscribers..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(Ce,{className:"bg-gradient-to-r from-[#adcfff] to-[#bfddff] border-none shadow-lg",children:e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices",className:"h-12 w-auto"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-[#4A4A4A]",children:"Newsletter Subscribers"}),e.jsx("p",{className:"text-[#4A4A4A]/80 mt-1",children:"Manage newsletter subscribers from public signups, caregiver enrollment, and historical imports"})]})]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsxs(F,{onClick:()=>P.mutate(),disabled:P.isPending,className:"bg-[#feea6a] hover:bg-[#feea6a]/90 text-[#4A4A4A] shadow-md font-medium",children:[e.jsx(Ms,{className:"w-4 h-4 mr-2"}),P.isPending?"Enrolling...":"Auto-Enroll Caregivers"]}),e.jsxs(F,{onClick:()=>t(!0),className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-white shadow-md",children:[e.jsx(gr,{className:"w-4 h-4 mr-2"}),"Import historical list"]})]})]})}),e.jsx(es,{open:s,onOpenChange:t,children:e.jsxs(ts,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Import Newsletter Subscribers"}),e.jsx(Pa,{children:"Import your subscriber list from Mailchimp using CSV export or by pasting the data directly."})]}),e.jsxs(Ql,{defaultValue:"file",className:"w-full",children:[e.jsxs(pl,{className:"grid w-full grid-cols-2",children:[e.jsx(qs,{value:"file",children:"Upload CSV File"}),e.jsx(qs,{value:"paste",children:"Paste Data"})]}),e.jsx(Hs,{value:"file",className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"csv-file",children:"Select Mailchimp CSV Export"}),e.jsx(je,{id:"csv-file",type:"file",accept:".csv",onChange:L,className:"mt-1"}),e.jsx("p",{className:"text-sm text-aac-neutral-500 mt-1",children:"Export your subscribers from Mailchimp as CSV and select the file here"})]})}),e.jsx(Hs,{value:"paste",className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"csv-text",children:"Paste CSV Data"}),e.jsx(Pt,{id:"csv-text",placeholder:`Email,First Name,Last Name,Status,Location... 724[email protected],John,Doe,subscribed,New York`,value:n,onChange:_=>r(_.target.value),className:"h-32 mt-1"}),e.jsxs(F,{onClick:B,variant:"outline",size:"sm",className:"mt-2",children:[e.jsx(Ea,{className:"w-4 h-4 mr-1"}),"Preview"]})]})})]}),c.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-t pt-4",children:[e.jsxs("h4",{className:"font-medium mb-2",children:["Import Preview (",c.length," of ",M(n).length," total)"]}),e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"Email"}),e.jsx(zt,{children:"Name"}),e.jsx(zt,{children:"Status"}),e.jsx(zt,{children:"Location"})]})}),e.jsx(dl,{children:c.map((_,se)=>e.jsxs(Un,{children:[e.jsx(Vt,{className:"font-mono text-sm",children:_.email}),e.jsx(Vt,{children:_.firstName||_.lastName?`${_.firstName||""} ${_.lastName||""}`.trim():"-"}),e.jsx(Vt,{children:e.jsx(we,{variant:_.status==="active"?"default":"secondary",children:_.status})}),e.jsx(Vt,{children:_.location||"-"})]},se))})]})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[e.jsx(F,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(F,{onClick:z,disabled:k.isPending,className:"bg-blue-600 hover:bg-blue-700 text-white",children:k.isPending?"Importing...":`Import ${M(n).length} Subscribers`})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-6 gap-4",children:[e.jsxs(Ce,{className:"bg-gradient-to-br from-[#d0deff] to-[#dee0ff] border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-[#4A4A4A]",children:"Subscribed records"}),e.jsx(Ms,{className:"h-4 w-4 text-[#4A4A4A]"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-[#4A4A4A]",children:T.subscribed}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70",children:"Source records/history"})]})]}),e.jsxs(Ce,{className:"bg-gradient-to-br from-[#e9e3ff] to-[#dee0ff] border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-[#4A4A4A]",children:"Unsubscribed records"}),e.jsx(ir,{className:"h-4 w-4 text-[#4A4A4A]/60"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-[#4A4A4A]/80",children:T.unsubscribed}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70",children:"Marketing opted out"})]})]}),e.jsxs(Ce,{className:"bg-gradient-to-br from-amber-50 to-amber-100 border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-amber-900",children:"Needs review records"}),e.jsx(ir,{className:"h-4 w-4 text-amber-700"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-amber-900",children:T.needs_review}),e.jsx("p",{className:"text-xs text-amber-800/80",children:"Original status preserved"})]})]}),e.jsxs(Ce,{className:"bg-gradient-to-br from-slate-100 to-slate-200 border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-slate-700",children:"Inactive records"}),e.jsx(ir,{className:"h-4 w-4 text-slate-500"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-slate-700",children:T.inactive}),e.jsx("p",{className:"text-xs text-slate-600/80",children:"Not eligible to re
724ceive"})]})]}),e.jsxs(Ce,{className:"bg-gradient-to-br from-[#bfddff] to-[#d0deff] border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-[#4A4A4A]",children:"Total records"}),e.jsx(Xr,{className:"h-4 w-4 text-[#4A4A4A]"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-[#4A4A4A]",children:w.length}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70",children:"Source records/history"})]})]}),e.jsxs(Ce,{className:"bg-gradient-to-br from-[#d0deff] to-[#bfddff] border-none shadow-md",children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium text-[#4A4A4A]",children:"Eligible emails"}),e.jsx(ir,{className:"h-4 w-4 text-[#4A4A4A]"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-[#4A4A4A]",children:U}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70",children:"Unique subscribed recipients"})]})]})]}),e.jsxs(Ce,{className:"shadow-lg",children:[e.jsxs(Ve,{className:"bg-gradient-to-r from-[#adcfff] to-[#bfddff] rounded-t-lg",children:[e.jsxs(Ue,{className:"text-[#4A4A4A] flex items-center",children:[e.jsx(ir,{className:"w-5 h-5 mr-2 text-[#4A4A4A]"}),"Newsletter Subscribers"]}
724),e.jsx(rn,{className:"text-[#4A4A4A]/80",children:"Newsletter subscribers from public signups, caregiver enrollment, and historical imports"})]}),e.jsx(Se,{className:"p-6 pb-0",children:e.jsxs("div",{className:"flex flex-col gap-3 mb-6 sm:flex-row",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Bl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-[#4A4A4A]/50 w-4 h-4"}),e.jsx(je,{"data-testid":"input-search-subscribers",placeholder:"Search subscribers by email, name, or location...",value:h,onChange:_=>x(_.target.value),className:"pl-10 border-[#77dbf6]/30 focus:border-[#77dbf6] focus:ring-[#77dbf6]/20"})]}),e.jsxs(St,{value:m,onValueChange:_=>g(_),children:[e.jsx(At,{className:"sm:w-52 border-[#77dbf6]/30 focus:border-[#77dbf6]",children:e.jsx(kt,{placeholder:"Filter by eligibility"})}),e.jsxs(Ct,{children:[e.jsxs(ce,{value:"all",children:["All eligibility statuses (",w.length," records)"]}),Object.keys(C1).map(_=>e.jsxs(ce,{value:_,children:[C1[_]," records (",T[_],")"]},_))]})]}),(h||m!=="all")&&e.jsxs("div",{className:"flex items-center text-sm text-[#4A4A4A]/70 sm:whitespace-nowrap",children:["Showing ",H.length," of ",w.length," subscribers"]}
724)]})}),e.jsx(Se,{className:"p-0",children:e.jsx("div",{className:"px-6 pb-6",children:w.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ms,{className:"h-12 w-12 text-[#4A4A4A]/30 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-[#4A4A4A] mb-2",children:"No Subscribers Yet"}),e.jsx("p",{className:"text-[#4A4A4A]/70 mb-4",children:"Newsletter subscribers can come from public signups, caregiver enrollment, or historical imports"}),e.jsxs(F,{onClick:()=>t(!0),className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-white shadow-md",children:[e.jsx(gr,{className:"w-4 h-4 mr-2"}),"Import Subscribers"]})]}):H.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Bl,{className:"h-12 w-12 text-[#4A4A4A]/30 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-[#4A4A4A] mb-2",children:"No Subscribers Found"}),e.jsxs("p",{className:"text-[#4A4A4A]/70 mb-4",children:['No subscribers match your search for "',h,'"']}),e.jsx(F,{"data-testid":"button-clear-search",onClick:()=>{x(""),g("all")},variant:"outline",className:"border-[#77dbf6] text-[#4A4A4A]",children:"Clear Search"})]}):e.jsx("div",{className:"border rounded-lg overflow-hidden border-[#77dbf6]/20",children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{className:"bg-gradient-to-r from-[#d0deff]/50 to-[#dee0ff]/50 border-b border-[#77dbf6]/20",children:[e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Email"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Name"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Marketing Eligibility"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Original Status"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Location"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Source"}),e.jsx(zt,{className:"text-[#4A4A4A] font-medium",children:"Subscribed"}),e.jsx(zt,{className:"w-16"})]})}),e.jsx(dl,{children:H.map(_=>e.jsxs(Un,{className:"hover:bg-[#adcfff]/10 border-b border-[#77dbf6]/10",children:[e.jsx(Vt,{className:"font-mono text-sm text-[#4A4A4A]",children:_.email}),e.jsx(Vt,{className:"text-[#4A4A4A]",children:_.firstName||_.lastName?`${_.firstName||""} ${_.lastName||""}`.trim():"-"}),e.jsx(Vt,{children:e.jsx(we,{variant:"secondary",className:VW(_.marketingEligibility),children:LW(_.marketingEligibility)})}),e.jsx(Vt,{children:e.jsx(we,{variant:"outline",className:"border-[#77dbf6]/50 text-[#4A4A4A]",children:_.status})}),e.jsx(Vt,{className:"text-[#4A4A4A]",children:_.location||"-"}),e.jsx(Vt,{children:e.jsx(we,{variant:"outline",className:"border-[#77dbf6] text-[#4A4A4A]",children:_.source||"manual"})}),e.jsx(Vt,{className:"text-[#4A4A4A]",children:new Date(_.subscribeDate).toLocaleDateString()}),e.jsx(Vt,{children:e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>E.mutate(_.id),disabled:E.isPending,className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:e.jsx(pa,{className:"w-4 h-4"})})})]},_.id))})]})})})})]})]})}const nw=te.object({name:te.string().min(1,"File name is required"),type:te.enum(["file","link"]),url:te.string().optional(),description:te.string().optional(),uploadedBy:te.string().default("Admin User"),accessLevel:te.string().default("all"),tags:te.array(te.string()).default([])}).refine(s=>!(s.type==="link"&&(!s.url||!s.url.startsWith("http"))),{message:"Valid URL is required for external links",path:["url"]});function rw(){var re;const[s,t]=p.useState(!1),[n,r]=p.useState(!1),[a,o]=p.useState(null),[c,u]=p.useState(""),[h,x]=p.useState([]),[m,g]=p.useState(""),[y,b]=p.useState(null),[w,N]=p.useState(!1),[k,E]=p.useState(null),[P,M]=p.useState(!1),{toast:L}=Is(),B=dn(),z=p.useRef(null),{data:H}=nt({queryKey:["/api/files"]}),T=Da({resolver:Oa(nw),defaultValues:{type:"file",name:"",url:"",description:"",uploadedBy:"Admin User",accessLevel:"all",tags:[]}}),U=Da({resolver:Oa(nw),defaultValues:{type:"file",name:"",url:"",description:"",uploadedBy:"Admin User",accessLevel:"all",tags:[]}}),_=bt({mutationFn:async O=>(await st("POST","/api/files",O)).json(),onSuccess:()=>{L({title:"Success!",description:"File uploaded successfully!"}),T.reset(),t(!1),B.invalidateQueries({queryKey:["/api/files"]})},onError:O=>{L({title:"Error",description:O.message||"Failed to upload file",variant:"destructive"})}}),se=bt({mutationFn:async O=>{const{id:me,...Y}=O;return(await st("PUT",`/api/files/${me}`,Y)).json()},onSuccess:O=>{L({title:"Success!",description:"Resource updated successfully!"}),U.reset(),r(!1),o(null),B.invalidateQueries({queryKey:["/api/files"]}),B.refetchQueries({queryKey:["/api/files"]})},onError:O=>{L({title:"Error",description:O.message||"Failed to update resource",variant:"destructive"})}}),ae=bt({mutationFn:async O=>(await st("DELETE",`/api/files/${O}`)).json(),onSuccess:()=>{L({title:"Success!",description:"File deleted successfully!"}),B.invalidateQueries({queryKey:["/api/files"]})},onError:O=>{L({title:"Error",description:O.message||"Failed to delete file",variant:"destructive"})}}),W=async O=>{if(O.type==="link")_.mutate(O);else{if(!k){L({title:"No file selected",description:"Please select a file to upload.",variant:"destructive"});return}M(!0),L({title:"Uploading...",description:`Uploading ${k.name}. This may take a moment for large files.`});const me=new FormData;me.append("file",k),me.append("uploadedBy","Admin"),me.append("accessLevel",JSON.stringify([O.accessLevel])),me.append("description",O.description||""),me.append("tags",JSON.stringify(O.tags||[])),me.append("name",O.name);try{const Y=await fetch("/api/files/upload",{method:"POST",body:me});if(Y.ok)L({title:"Success!",description:"File uploaded successfully!"}),B.invalidateQueries({queryKey:["/api/files"]}),T.reset(),E(null),t(!1),z.current&&(z.current.value="");else{const Te=await Y.json();throw new Error(Te.message||"Upload failed")}}catch(Y){L({title:"Upload Error",description:Y instanceof Error?Y.message:"Failed to upload file. Please try again.",variant:"destructive"})}finally{M(!1)}}},J=O=>{a&&se.mutate({...O,id:a.id})},ne=O=>{confirm("Are you sure you want to delete this file?")&&ae.mutate(O)},le=O=>{o(O);const me=Array.isArray(O.accessLevels)&&O.accessLevels.length>0?O.accessLevels[0]:"all";U.reset({type:O.type,name:O.name,url:O.type==="link"?O.url:"",description:O.description||"",uploadedBy:O.uploadedBy,accessLevel:me,tags:O.tags||[]}),r(!0)},V=O=>{var Y;const me=(Y=O.target.files)==null?void 0:Y[0];if(me){if(me.size>250*1024*1024){L({title:"File too large",description:"Please select a file smaller than 250M
724B.",variant:"destructive"});return}E(me),T.setValue("name",me.name),L({title:"File selected",description:`${me.name} is ready to upload. Configure access levels and click "Add Resource".`})}},Z=O=>{var Te,Be;if(O.type==="link")return e.jsx(b2,{className:"text-aac-blue w-6 h-6"});const me=((Te=O.name)==null?void 0:Te.toLowerCase())||"",Y=((Be=O.mime_type)==null?void 0:Be.toLowerCase())||"";return Y.includes("image")||me.match(/\.(jpg|jpeg|png|gif|bmp|svg|webp)$/)?e.jsx(Bo,{className:"text-green-500 w-6 h-6"}):Y.includes("pdf")||me.includes("pdf")?e.jsx(Js,{className:"text-red-500 w-6 h-6"}):Y.includes("word")||me.match(/\.(doc|docx)$/)?e.jsx(Js,{className:"text-blue-500 w-6 h-6"}):Y.includes("excel")||Y.includes("spreadsheet")||me.match(/\.(xls|xlsx)$/)?e.jsx(CF,{className:"text-green-600 w-6 h-6"}):Y.includes("presentation")||me.match(/\.(ppt|pptx)$/)?e.jsx(Js,{className:"text-orange-500 w-6 h-6"}):Y.includes("video")||me.match(/\.(mp4|avi|mov|wmv|flv|webm)$/)?e.jsx(NF,{className:"text-purple-500 w-6 h-6"}):Y.includes("audio")||me.match(/\.(mp3|wav|flac|aac|ogg)$/)?e.jsx(FF,{className:"text-pink-500 w-6 h-6"}):me.match(/\.(zip|rar|7z|tar|gz)$/)?e.jsx(Wo,{className:"text-gray-500 w-6 h-6"}):e.jsx(Js,{className:"text-aac-neutral-600 w-6 h-6"})},ue=O=>{const Y=Math.abs(new Date().getTime()-new Date(O).getTime()),Te=Math.floor(Y/(1e3*60*60*24));return Te===0?"Today":Te===1?"Yesterday":Te<7?`${Te} days ago`:new Date(O).toLocaleDateString()},ge=O=>{const me=O.accessLevels;if(!me||Array.isArray(me)&&me.length===0)return"All Families";const Y={all:"All Families","ahern-academy":"Ahern Academy","open-enrollment":"Open Enrollment",yac:"Young Adult Chat","1:1":"1:1 Sessions",admin:"Admin Only"};if(Array.isArray(me))return me.map(Te=>Y[Te]||Te).join(", ");try{const Te=JSON.parse(me);if(Array.isArray(Te))return Te.map(Be=>Y[Be]||Be).join(", ")}catch{}return Y[me]||me},G=Array.from(new Set((H||[]).flatMap(O=>O.tags||[]))).sort(),Ae=(H||[]).filter(O=>{var Te;const me=O.name.toLowerCase().includes(c.toLowerCase())||((Te=O.description)==null?void 0:Te.toLowerCase().includes(c.toLowerCase())),Y=h.length===0||h.some(Be=>{var ht;return(ht=O.tags)==null?void 0:ht.includes(Be)});return me&&Y}).sort((O,me)=>(O.name||O.filename||"").localeCompare(me.name||me.filename||"")),Fe=O=>{const me=T.getValues("tags");O&&!me.includes(O)&&(T.setValue("tags",[...me,O]),g(""))},be=O=>{const me=T.getValues("tags");T.setValue("tags",me.filter(Y=>Y!==O))},Me=O=>{x(me=>me.includes(O)?me.filter(Y=>Y!==O):[...me,O])},R=T.watch("tags");return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-[#77dbf6]/10 via-white to-[#feea6a]/10 pt-16",children:e.jsxs("div",{className:"container mx-auto px-4 sm:px-6 py-4 sm:py-8",children:[e.jsx("div",{className:"bg-gradient-to-r from-[#77dbf6] to-[#93e3f8] rounded-xl p-4 sm:p-8 mb-6 sm:mb-8 shadow-lg",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-6",children:[e.jsx("div",{className:"p-3 sm:p-4 bg-white/20 backdrop-blur rounded-xl shadow-lg flex-shrink-0",children:e.jsx("img",{src:"/images/resourcebee.png",alt:"Resources Bee",className:"h-12 w-12 sm:h-16 sm:w-16 object-contain"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-2xl sm:text-4xl font-bold text-[#4A4A4A] leading-tight",children:"Resource Center"}),e.jsx("p",{className:"text-[#4A4A4A]/80 mt-1 sm:mt-2 text-sm sm:text-lg",children:"Educational materials and helpful links for families and students"})]})]})})}),e.jsxs("div",{className:"flex justify-center sm:justify-end mb-4 sm:mb-6",children:[e.jsxs(es,{open:s,onOpenChange:t,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{className:"bg-[#feea6a] hover:bg-[#eab308] text-[#4A4A4A] font-semibold px-4 sm:px-6 py-3 sm:py-3 text-sm sm:text-base shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-105 border-2 border-white/30 w-full sm:w-auto",children:[e.jsx(gr,{className:"w-4 h-4 sm:w-5 sm:h-5 mr-2"}),"Add Resource"]})}),e.jsxs(ts,{className:"sm:max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsx(ss,{className:"pb-2",children:e.jsx(ns,{children:"Add Resource"})}),e.jsx(Fa,{...T,children:e.jsxs("form",{onSubmit:T.handleSubmit(W),className:"space-y-3",children:[e.jsx(Ke,{control:T.control,name:"type",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Type"}),e.jsxs(St,{onValueChange:O.onChange,defaultValue:O.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"file",children:"File Upload"}
724),e.jsx(ce,{value:"link",children:"External Link"})]})]}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"name",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Resource name",...O})}),e.jsx(Ye,{})]})}),T.watch("type")==="link"&&e.jsx(Ke,{control:T.control,name:"url",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"URL"}),e.jsx(He,{children:e.jsx(je,{placeholder:"https://...",...O})}),e.jsx(Ye,{})]})}),T.watch("type")==="file"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ze,{children:"Upload File"}),e.jsxs("div",{className:"border-2 border-dashed border-aac-neutral-200 rounded-lg p-4 text-center",children:[e.jsx("input",{type:"file",ref:z,onChange:V,className:"hidden",accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.mp4,.mp3,.zip"}),e.jsx(gr,{className:"mx-auto h-8 w-8 text-aac-neutral-400 mb-2"}),e.jsx("p",{className:"text-sm text-aac-neutral-600 mb-1",children:"Click to upload or drag and drop"}),e.jsx("p",{className:"text-xs text-aac-neutral-500 mb-2",children:"PDF, Word, Excel, PowerPoint, Images, Videos, Audio, ZIP (max 250MB)"}),e.jsx(F,{type:"button",variant:"outline",onClick:()=>{var O;return(O=z.current)==null?void 0:O.click()},size:"sm",children:k?`Selected: ${k.name}`:"Choose File"}),k&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-sm text-green-600",children:[e.jsx(gr,{className:"w-4 h-4"}),e.jsx("span",{children:"File ready to upload"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:()=>{E(null),z.current&&(z.current.value="")},className:"h-6 w-6 p-0 text-red-500 hover:text-red-700",children:e.jsx(Gr,{className:"w-4 h-4"})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsx(Ke,{control:T.control,name:"description",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Description (Optional)"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Brief description...",className:"min-h-[60
724px] resize-none text-sm",...O})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"accessLevel",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Access Level"}),e.jsxs(St,{onValueChange:O.onChange,defaultValue:O.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Families"}),e.jsx(ce,{value:"ahern-academy",children:"Ahern Academy"}),e.jsx(ce,{value:"open-enrollment",children:"Open Enrollment"}),e.jsx(ce,{value:"yac",children:"Young Adult Chat"}),e.jsx(ce,{value:"1:1",children:"1:1 Sessions"}),e.jsx(ce,{value:"admin",children:"Admin Only"})]})]}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ze,{children:"Tags"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(je,{placeholder:"Add a tag...",value:m,onChange:O=>g(O.target.value),onKeyPress:O=>{O.key==="Enter"&&(O.preventDefault(),Fe(m))},className:"text-sm"}),e.jsx(F,{type:"button",variant:"outline",onClick:()=>Fe(m),disabled:!m.trim(),size:"sm",children:e.jsx(Zy,{className:"w-3 h-3"})})]}),R&&R.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:R.map((O,me)=>e.jsxs(we,{variant:"secondary",className:"flex items-center gap-1 text-xs",children:[O,e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"h-3 w-3 p-0",onClick:()=>be(O),children:e.jsx(Gr,{className:"w-2 h-2"})})]},me))}),G.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-aac-neutral-600",children:"Suggested:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:G.slice(0,6).map(O=>e.jsx(F,{type:"button",variant:"outline",size:"sm",className:"text-xs h-6",onClick:()=>Fe(O),disabled:R==null?void 0:R.includes(O),children:O},O))})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{type:"button",variant:"outline",disabled:P,onClick:()=>{t(!1),E(null),T.reset(),z.current&&(z.current.value="")},children:"Cancel"}),e.jsx(F,{type:"submit",disabled:_.isPending||P,children:_.isPending||P?e.jsxs(e.Fragment,{children:[e.jsx(kF,{className:"mr-2 h-4 w-4 animate-spin"}),P?"Uploading...":"Adding..."]}):"Add Resource"})]})]})})]})]}),e.jsx(es,{open:n,onOpenChange:r,children:e.jsxs(ts,{className:"sm:max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Edit Resource"})}),e.jsx(Fa,{...U,children:e.jsxs("form",{onSubmit:U.handleSubmit(J),className:"space-y-4",children:[e.jsx(Ke,{control:U.control,name:"type",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Type"}),e.jsxs(St,{onValueChange:O.onChange,value:O.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"file",children:"File Upload"}),e.jsx(ce,{value:"link",children:"External Link"})]})]}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:U.control,name:"name",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Resource name",...O})}),e.jsx(Ye,{})]})}),U.watch("type")==="link"&&e.jsx(Ke,{control:U.control,name:"url",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"URL"}),e.jsx(He,{children:e.jsx(je,{placeholder:"https://...",...O})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:U.control,name:"description",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Description (Optional)"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Brief description",...O})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:U.control,name:"accessLevel",render:({field:O})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Access Level"}),e.jsxs(St,{onValueChange:O.onChange,value:O.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Families"}),e.jsx(ce,{value:"ahern-academy",children:"Ahern Academy"}),e.jsx(ce,{value:"open-enrollment",children:"Open Enrollment"}),e.jsx(ce,{value:"yac",children:"Young Adult Chat"}),e.jsx(ce,{value:"1:1",children:"1:1 Sessions"}),e.jsx(ce,{value:"admin",children:"Admin Only"})]})]}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ze,{children:"Tags"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(je,{placeholder:"Add a tag...",value:m,onChange:O=>g(O.target.value),onKeyPress:O=>{if(O.key==="Enter"){O.preventDefault();const me=U.getValues("tags");m&&!me.includes(m)&&(U.setValue("tags",[...me,m]),g(""))}}}),e.jsx(F,{type:"button",variant:"outline",onClick:()=>{const O=U.getValues("tags");m&&!O.includes(m)&&(U.setValue("tags",[...O,m]),g(""))},disabled:!m.trim(),children:e.jsx(Zy,{className:"w-4 h-4"})})]}),((re=U.watch("tags"))==null?void 0:re.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:U.watch("tags").map((O,me)=>e.jsxs(we,{variant:"secondary",className:"flex items-center gap-1",children:[O,e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>{const Y=U.getValues("tags");U.setValue("tags",Y.filter(Te=>Te!==O))},children:e.jsx(Gr,{className:"w-3 h-3"})})]},me))})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>{r(!1),o(null),U.reset()},children:"Cancel"}),e.jsx(F,{type:"submit",disabled:se.isPending,children:se.isPending?"Upd
724ating...":"Update Resource"})]})]})})]})})]}),e.jsxs(Ce,{className:"mb-4 sm:mb-6 bg-white shadow-lg border-0 rounded-xl overflow-hidden",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-[#77dbf6]/20 to-[#feea6a]/20 border-b border-[#77dbf6]/30 p-4 sm:p-6",children:e.jsxs(Ue,{className:"text-base sm:text-lg text-[#4A4A4A] flex items-center gap-2 sm:gap-3",children:[e.jsx("div",{className:"p-1.5 sm:p-2 bg-[#feea6a] rounded-lg flex-shrink-0",children:e.jsx(Wx,{className:"h-4 w-4 sm:h-5 sm:w-5 text-[#4A4A4A]"})}),e.jsx("span",{className:"truncate",children:"Filters & Search"})]})}),e.jsxs(Se,{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Bl,{className:"absolute left-3 sm:left-4 top-3 sm:top-3.5 h-4 w-4 sm:h-5 sm:w-5 text-[#77dbf6]"}),e.jsx(je,{placeholder:"Search resources...",value:c,onChange:O=>u(O.target.value),className:"pl-10 sm:pl-12 border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all duration-200 h-10 sm:h-12 text-sm sm:text-base text-[#4A4A4A] placeholder-[#4A4A4A]/60"})]}),G.length>0&&e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zy,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:"Available tags:"})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2 max-h-20 sm:max-h-none overflow-y-auto",children:[G.slice(0,8).map(O=>e.jsx(we,{variant:"outline",className:"cursor-pointer hover:bg-[#77dbf6]/10 transition-colors text-xs border-[#77dbf6]/30 text-[#4A4A4A] touch-manipulation",onClick:()=>{h.includes(O)||x([...h,O])},children:O},O)),G.length>8&&e.jsxs(we,{variant:"outline",className:"text-xs border-[#77dbf6]/30 text-[#4A4A4A]/60",children:["+",G.length-8," more"]})]})]}),h.length>0&&e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wx,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:"Active filters:"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:h.map(O=>e.jsxs(we,{variant:"default",className:"cursor-pointer bg-[#77dbf6] hover:bg-[#5bd3f4] text-[#4A4A4A] text-xs touch-manipulation",onClick:()=>Me(O),children:[O," ",e.jsx(Gr,{className:"w-3 h-3 ml-1"})]},O))}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>x([]),className:"text-xs h-8 px-3 touch-manipulation",children:"Clear all filters"})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:Ae.map(O=>e.jsxs(Ce,{className:"bg-white hover:shadow-xl transition-all duration-300 transform hover:scale-[1.02] border-2 border-[#77dbf6]/20 hover:border-[#77dbf6]/40 shadow-lg rounded-xl overflow-hidden",children:[e.jsx(Ve,{className:"pb-2 sm:pb-3 bg-gradient-to-r from-[#77dbf6]/10 to-[#feea6a]/10 border-b border-[#77dbf6]/20 p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-3 min-w-0 flex-1",children:[e.jsx("div",{className:"p-1.5 sm:p-2 bg-white rounded-lg shadow-sm border border-[#77dbf6]/30 flex-shrink-0",children:Z(O)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-semibold text-[#4A4A4A] truncate text-sm sm:text-base leading-tight",children:O.name||O.filename}),e.jsxs("p",{className:"text-xs sm:text-sm text-[#4A4A4A]/70 truncate mt-0.5",children:[O.type==="link"?"External Link":"File"," ⢠",O.uploaded_by||"Unknown"]})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1 flex-shrink-0",children:[e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{b(O),N(!0)},className:"text-[#4A4A4A] hover:text-[#77dbf6] hover:bg-[#77dbf6]/10 transition-all duration-200 h-8 w-8 p-0 touch-manipulation",children:e.jsx(Ea,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>le(O),className:"text-[#4A4A4A] hover:text-[#feea6a] hover:bg-[#feea6a]/20 transition-all duration-200 h-8 w-8 p-0 touch-manipulation",children:e.jsx(Zr,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>ne(O.id),className:"text-[#4A4A4A] hover:text-red-600 hover:bg-red-50 transition-all duration-200 h-8 w-8 p-0 touch-manipulation",children:e.jsx(pa,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}),e.jsxs(Se,{className:"space-y-3 sm:space-y-4 p-3 sm:p-6",children:[O.description&&e.jsx("p",{className:"text-xs sm:text-sm text-[#4A4A4A]/80 leading-relaxed line-clamp-2",children:O.description}),O.tags&&O.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 sm:gap-2",children:[O.tags.slice(0,3).map((me,Y)=>e.jsx(we,{variant:"secondary",className:"text-xs bg-[#feea6a]/20 text-[#4A4A4A] border border-[#feea6a]/40 hover:bg-[#feea6a]/30 transition-colors px-2 py-0.5",children:me},Y)),O.tags.length>3&&e.jsxs(we,{variant:"secondary",className:"text-xs bg-[#77dbf6]/20 text-[#4A4A4A] border border-[#77dbf6]/40 px-2 py-0.5",children:["+",O.tags.length-3]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-2",children:[e.jsx("div",{className:"px-2 sm:px-3 py-1 sm:py-1.5 bg-[#77dbf6]/20 text-[#4A4A4A] rounded-lg border border-[#77dbf6]/30 text-center sm:text-left",children:e.jsx("span",{className:"text-xs font-medium",children:ge(O)})}),e.jsx("div",{className:"flex space-x-2",children:O.type==="link"?e.jsxs(F,{size:"sm",className:"bg-[#77dbf6] hover:bg-[#5bd3f4] text-[#4A4A4A] font-semibold transition-all duration-200 transform hover:scale-105 shadow-lg flex-1 sm:flex-none touch-manipulation",onClick:()=>window.open(O.url||O.file_path,"_blank"),children:[e.jsx(Ya,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"text-xs sm:text-sm",children:"Open"})]}):e.jsxs(F,{size:"sm",className:"bg-[#feea6a] hover:bg-[#eab308] text-[#4A4A4A] font-semibold transition-all duration-200 transform hover:scale-105 shadow-lg flex-1 sm:flex-none touch-manipulation",onClick:()=>{const me=O.url||O.file_path,Y=document.createElement("a");Y.href=me,Y.download=O.original_name||O.name,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y)},children:[e.jsx(Xr,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"text-xs sm:text-sm",children:"Download"})]})})]})]})]},O.id))}),Ae.length===0&&e.jsx(Ce,{className:"bg-gradient-to-br from-[#77dbf6]/10 to-[#feea6a]/10 border-dashed border-2 border-[#77dbf6]/40",children:e.jsxs(Se,{className:"text-center py-16",children:[e.jsx("div",{className:"bg-[#77dbf6]/20 rounded-full w-24 h-24 flex items-center justify-center mx-auto mb-8 border-2 border-[#77dbf6]/30",children:e.jsx(Js,{className:"w-12 h-12 text-[#77dbf6]"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#4A4A4A] mb-4",children:(H==null?void 0:H.length)===0?"Welcome to Your Resource Center!":"No resources match your filters"}
724),e.jsx("p",{className:"text-[#4A4A4A]/70 mb-8 max-w-lg mx-auto text-lg leading-relaxed",children:(H==null?void 0:H.length)===0?"Create a comprehensive library of educational materials, helpful links, and important documents that families can easily access and benefit from.":"Try adjusting your search terms or removing some filters to discover the resources you're looking for."}),(H==null?void 0:H.length)===0&&e.jsxs(F,{onClick:()=>t(!0),className:"bg-[#feea6a] hover:bg-[#eab308] text-[#4A4A4A] font-semibold px-8 py-4 text-lg shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-105 border-2 border-white/30",children:[e.jsx(gr,{className:"w-6 h-6 mr-3"}),"Add Your First Resource"]})]})}),e.jsx(es,{open:w,onOpenChange:N,children:e.jsxs(ts,{className:"sm:max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsxs(ns,{className:"flex items-center gap-2",children:[y&&Z(y),(y==null?void 0:y.name)||"File Preview"]})}),y&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-gray-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-gray-700",children:"File Details"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Size: ",y.size?`${Math.round(y.size/1024)} KB`:"Unknown"]}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Type: ",y.mime_type||"Unknown"]}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Uploaded: ",ue(y.uploadDate)]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-gray-700",children:"Access"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Level: ",ge(y)]}),e.jsxs("p",{className:"text-sm text-gray-600",children:["By: ",y.uploadedBy]})]})]}),y.description&&e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Description"}),e.jsx("p",{className:"text-blue-800",children:y.description})]}),y.tags&&y.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Tags:"}),y.tags.map((O,me)=>e.jsx(we,{variant:"secondary",className:"text-xs",children:O},me))]}),e.jsx("div",{className:"border rounded-lg p-4",children:(()=>{var Y,Te;const O=((Y=y.mime_type)==null?void 0:Y.toLowerCase())||"",me=((Te=y.name)==null?void 0:Te.toLowerCase())||"";return O.includes("image")||me.match(/\.(jpg|jpeg|png|gif|bmp|webp)$/)?e.jsxs("div",{className:"text-center",children:[e.jsx("img",{src:y.url||y.file_path,alt:y.name,className:"max-w-full max-h-96 mx-auto rounded-lg shadow-md",onError:Be=>{Be.currentTarget.style.display="none",Be.currentTarget.nextElementSibling.style.display="block"}}),e.jsxs("div",{className:"hidden text-gray-500 py-8",children:[e.jsx(Bo,{className:"w-12 h-12 mx-auto mb-2 text-gray-400"}),e.jsx("p",{children:"Image preview not available"})]})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-4 flex items-center justify-center bg-gray-100 rounded-lg",children:Z(y)}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Preview not available for this file type"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Use the download button to view the full file"})]})})()}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[e.jsxs("div",{className:"flex gap-2",children:[y.type==="link"?e.jsxs(F,{variant:"outline",onClick:()=>window.open(y.url,"_blank"),children:[e.jsx(Ya,{className:"w-4 h-4 mr-2"}),"Open Link"]}):e.jsxs(F,{variant:"outline",onClick:()=>{const O=y.url||y.file_path,me=document.createElement("a");me.href=O,me.download=y.original_name||y.name,document.body.appendChild(me),me.click(),document.body.removeChild(me)},children:[e.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Download"]}),e.jsxs(F,{variant:"outline",onClick:()=>{le(y),N(!1)},children:[e.jsx(Zr,{className:"w-4 h-4 mr-2"}),"Edit"]})]}),e.jsx(F,{variant:"ghost",onClick:()=>N(!1),children:"Close"})]})]})]})})]})})}const UW=async s=>{try{const t=await fetch("/api/class-sessions");let n=[];t.ok&&(n=(await t.json()).map(a=>({id:a.id,name:a.name}))),n.length===0&&(n=[{id:7,name:"Winter/Spring 2026"},{id:5,name:"Summer Trimester 2025"},{id:2,name:"Fall 2025"},{id:1,name:"Summer Camp"}]);for(const r of n){const a=await fetch(`/api/week-calendar/${r.id}`);if(a.ok){const c=(await a.json()).find(u=>u.startDate===s);if(c)return{sessionName:r.name,weekNumber:c.weekNumber,weekDisplay:t1(c.weekNumber,{startDate:c.startDate,endD
724ate:c.endDate,isBreakWeek:c.isBreakWeek})}}}return null}catch(t){return console.error("Error fetching week info from calendar:",t),null}};function aw(){const[s,t]=p.useState(!1),[n,r]=p.useState(!1),[a,o]=p.useState(null),[c,u]=p.useState({weekStartDate:"",password:"",theme:""}),[h,x]=p.useState({}),{toast:m}=Is(),g=dn(),{data:y=[],isLoading:b}=nt({queryKey:["/api/admin/weekly-passwords"]});p.useEffect(()=>{const z=async()=>{for(const H of y)h[H.weekStartDate]||await B(H.weekStartDate)};y.length>0&&z()},[y]);const w=bt({mutationFn:async z=>st("POST","/api/admin/weekly-passwords",{weekStartDate:z.weekStartDate,password:z.password,theme:z.theme||null}),onSuccess:()=>{g.invalidateQueries({queryKey:["/api/admin/weekly-passwords"]}),t(!1),u({weekStartDate:"",password:"",theme:""}),m({title:"Success",description:"Weekly password created successfully"})},onError:z=>{m({title:"Error",description:z.message||"Failed to create password",variant:"destructive"})}}),N=bt({mutationFn:async({id:z,data:H})=>st("PUT",`/api/admin/weekly-passwords/${z}`,{password:H.password,theme:H.theme||null}),onSuccess:()=>{g.invalidateQueries({queryKey:["/api/admin/weekly-passwords"]}),r(!1),o(null),u({weekStartDate:"",password:"",theme:""}),m({title:"Success",description:"Weekly password updated successfully"})},onError:z=>{m({title:"Error",description:z.message||"Failed to update password",variant:"destructive"})}}),k=bt({mutationFn:async z=>st("DELETE",`/api/admin/weekly-passwords/${z}`),onSuccess:()=>{g.invalidateQueries({queryKey:["/api/admin/weekly-passwords"]}),m({title:"Success",description:"Weekly password deleted successfully"})},onError:z=>{m({title:"Error",description:z.message||"Failed to delete password",variant:"destructive"})}}),E=z=>{if(z.preventDefault(),!c.weekStartDate||!c.password){m({title:"Error",description:"Week start date and password are required",variant:"destructive"});return}w.mutate(c)},P=z=>{o(z),u({weekStartDate:z.weekStartDate,password:z.password,theme:z.theme||""}),r(!0)},M=z=>{if(z.preventDefault(),!a||!c.password){m({title:"Error",description:"Password is required",variant:"destructive"});return}N.mutate({id:a.id,data:{password:c.password,theme:c.theme}})},L=z=>new Date(z+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),B=async z=>{if(h[z])return h[z];const H=await UW(z);if(H)return x(U=>({...U,[z]:H})),H;const T={sessionName:"Unknown Session",weekNumber:"?",weekDisplay:"Dates not available"};return x(U=>({...U,[z]:T})),T};return b?e.jsx("div",{className:"p-6",children:"Loading weekly passwords..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Weekly Zoom Passwords"}),e.jsx("p",{className:"text-gray-600",children:"Manage weekly Zoom passwords for enrolled families"})]}),e.jsxs(es,{open:s,onOpenChange:t,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{children:[e.jsx(fa,{className:"w-4 h-4 mr-2"}),"Add Password"]})}),e.jsxs(ts,{children:[e.jsx(ss,{children:e.jsx(ns,{children:"Add Weekly Password"})}),e.jsxs("form",{onSubmit:E,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"weekStartDate",children:"Week Start Date"}),e.jsx(je,{id:"weekStartDate",type:"date",value:c.weekStartDate,onChange:z=>u({...c,weekStartDate:z.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"password",children:"Password"}),e.jsx(je,{id:"password",value:c.password,onChange:z=>u({...c,password:z.target.value}),placeholder:"Enter password",required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"theme",children:"Theme (Optional)"}),e.jsx(je,{id:"theme",value:c.theme,onChange:z=>u({...c,theme:z.target.value}),placeholder:"e.g., The Thirteen Colonies"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Leave empty for camp weeks"})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(F,{type:"submit",disabled:w.isPending,children:w.isPending?"Creating...":"Create Password"})]})]})]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center",children:[e.jsx(an,{className:"w-5 h-5 mr-2"}),"Password Schedule"]}),e.jsx(rn,{children:"Weekly passwords are automatically available to enrolled families (Ahern Academy, Open Enrollment, 1:1 Sessions)"})]}),e.jsx(Se,{children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"Week"}),e.jsx(zt,{children:"Start Date"}),e.jsx(zt,{children:"Theme"}),e.jsx(zt,{children:"Password"}),e.jsx(zt,{children:"Actions"})]})}),e.jsxs(dl,{children:[y.map(z=>e.jsxs(Un,{children:[e.jsx(Vt,{className:"font-medium",children:h[z.weekStartDate]?`${h[z.weekStartDate].sessionName} Week ${h[z.weekStartDate].weekNumber}`:"Loading..."}),e.jsx(Vt,{children:L(z.weekStartDate)}),e.jsx(Vt,{children:z.theme||e.jsx("span",{className:"text-gray-400 italic",children:"No theme"})}),e.jsx(Vt,{className:"font-mono font-semibold",children:z.password}),e.jsx(Vt,{children:e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:()=>P(z),children:e.jsx(Zr,{className:"w-4 h-4"})}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>k.mutate(z.id),disabled:k.isPending,children:e.jsx(pa,{className:"w-4 h-4"})})]})})]},z.id)),y.length===0&&e.jsx(Un,{children:e.jsx(Vt,{colSpan:5,className:"text-center text-gray-500 py-8",children:"No weekly passwords foun
724d. Add your first password to get started."})})]})]})})]}),e.jsx(es,{open:n,onOpenChange:r,children:e.jsxs(ts,{children:[e.jsx(ss,{children:e.jsx(ns,{children:"Edit Weekly Password"})}),e.jsxs("form",{onSubmit:M,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"editWeekStartDate",children:"Week Start Date"}),e.jsx(je,{id:"editWeekStartDate",type:"date",value:c.weekStartDate,disabled:!0,className:"bg-gray-50"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Week start date cannot be changed"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"editPassword",children:"Password"}),e.jsx(je,{id:"editPassword",value:c.password,onChange:z=>u({...c,password:z.target.value}),placeholder:"Enter password",required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"editTheme",children:"Theme (Optional)"}),e.jsx(je,{id:"editTheme",value:c.theme,onChange:z=>u({...c,theme:z.target.value}),placeholder:"e.g., The Thirteen Colonies"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Leave empty for camp weeks"})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(F,{type:"submit",disabled:N.isPending,children:N.isPending?"Updating...":"Update Password"})]})]})]})})]})}function iw(){const[s,t]=p.useState(""),[n,r]=p.useState("all"),{data:a,isLoading:o,error:c}=nt({queryKey:["/api/admin/all-enrollments"]}),u=Array.isArray(a)?a:[];console.log("Enrollments query result:",{enrollmentsData:a,enrollmentsLoading:o,enrollmentsError:c});const{data:h=[],isLoading:x}=nt({queryKey:["/api/class-sessions"]}),m=p.useMemo(()=>{let b=u;return s&&(b=b.filter(w=>w.studentName.toLowerCase().includes(s.toLowerCase()))),n!=="all"&&(b=b.filter(w=>w.sessionName===n)),b},[u,s,n]),g=()=>{const b=["Student Name","Session Name","Class Name","Days","Time Slot","Enrollment Status","Start Date","End Date","Ended"],w=m.map(M=>[M.studentName,M.sessionName,M.className,M.days,M.timeSlot,M.status,M.startDate,M.endDate,M.ended?"Yes":"No"]),N=[b,...w].map(M=>M.map(L=>`"${L}"`).join(",")).join(` 725`),k=new Blob([N],{type:"text/csv;charset=utf-8;"}),E=document.createElement("a"),P=URL.createObjectURL(k);E.setAttribute("href",P),E.setAttribute("download",`enrollment-summary-${new Date().toISOString().split("T")[0]}.csv`),E.style.visibility="hidden",document.body.appendChild(E),E.click(),document.body.removeChild(E)},y=(b,w)=>{if(w)return e.jsx(we,{variant:"secondary",children:"Ended"});switch(b.toLowerCase()){case"active":case"enrolled":return e.jsx(we,{variant:"default",children:"Active"});case"pending":return e.jsx(we,{variant:"outline",children:"Pending"});case"cancelled":return e.jsx(we,{variant:"destructive",children:"Cancelled"});default:return e.jsx(we,{variant:"secondary",children:b})}};return o||x?e.jsx("div",{className:"container mx-auto py-6",children:e.jsx(Ce,{children:e.jsx(Se,{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading enrollments..."})]})})})}):c?e.jsx("div",{className:"container mx-auto py-6",children:e.jsx(Ce,{children:e.jsx(Se,{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-destructive",children:"Failed to load enrollments"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c instanceof Error?c.message:"Unknown error"})]})})})}):e.jsx("div",{className:"container mx-auto py-6 space-y-6",children:e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Enrollment Summary"}),e.jsxs(F,{onClick:g,variant:"outline",size:"sm",children:[e.jsx(Xr,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Bl,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(je,{placeholder:"Search by student name...",value:s,onChange:b=>t(b.target.value),className:"pl-9"})]}),e.jsxs(St,{value:n,onValueChange:r,children:[e.jsx(At,{className:"w-64",children:e.jsx(kt,{placeholder:"Filter by session"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Sessions"}),h.map(b=>e.jsx(ce,{value:b.name,children:b.name},b.id))]})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",m.length," of ",u.length," enrollments"]}),e.jsx("div",{className:"border rounded-lg",children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"Student Name"}),e.jsx(zt,{children:"Session Name"}),e.jsx(zt,{children:"Class Name"}),e.jsx(zt,{children:"Days"}),e.jsx(zt,{children:"Time Slot"}),e.jsx(zt,{children:"Status"}),e.jsx(zt,{children:"Start Date"}),e.jsx(zt,{children:"End Date"}),e.jsx(zt,{children:"Ended"})]})}),e.jsx(dl,{children:m.length===0?e.jsx(Un,{children:e.jsx(Vt,{colSpan:9,className:"text-center py-8 text-muted-foreground",children:"No enrollments found matching your criteria"})}):m.map(b=>e.jsxs(Un,{children:[e.jsx(Vt,{className:"font-medium",children:b.studentName}),e.jsx(Vt,{children:b.sessionName}),e.jsx(Vt,{children:b.className}),e.jsx(Vt,{children:b.days}),e.jsx(Vt,{children:b.timeSlot}),e.jsx(Vt,{children:y(b.status,b.ended)}),e.jsx(Vt,{children:new Date(b.startDate).toLocaleDateString()}
725),e.jsx(Vt,{children:new Date(b.endDate).toLocaleDateString()}),e.jsx(Vt,{children:b.ended?e.jsx(we,{variant:"secondary",children:"Yes"}):e.jsx(we,{variant:"default",children:"No"})})]},b.id))})]})})]})]})})}const zW="modulepreload",qW=function(s){return"/"+s},lw={},ru=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let c=function(x){return Promise.all(x.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=c(n.map(x=>{if(x=qW(x),x in lw)return;lw[x]=!0;const m=x.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${g}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":zW,m||(y.as="script"),y.crossOrigin="",y.href=x,h&&y.setAttribute("nonce",h),document.head.appendChild(y),m)return new Promise((b,w)=>{y.addEventListener("load",b),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${x}`)))})}))}function o(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return a.then(c=>{for(const u of c||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})},k1={"September 2024":{effectiveDate:"2024-09-01",ahernAcademy:{trimester:1900,monthly:475},openEnrollment:{oneClass:40,twoClasses:70,threeClasses:100,fourClasses:130,fiveClasses:160},oneOnOne:{newStudent:150,establishedStudent:125},consultation:{session:125},aacDeviceProgramming:{hourly:50},youngAdultChat:130,saturdayClasses:{general:{fiveWeeks:100,sixWeeks:120},ahernStudents:{fiveWeeks:55,sixWeeks:75}},fees:{registration:100,late:10}},"September 2025":{effectiveDate:"2025-09-01",ahernAcademy:{trimester:1948,monthly:487},openEnrollment:{oneClass:42,twoClasses:74,threeClasses:105,fourClasses:137,fiveClasses:168},oneOnOne:{newStudent:150,establishedStudent:125},consultation:{session:125},aacDeviceProgramming:{hourly:50},youngAdultChat:137,saturdayClasses:{general:{fiveWeeks:105,sixWeeks:126},ahernStudents:{fiveWeeks:58,sixWeeks:79}},fees:{registration:100,late:10}}};function Hi(s){return(s||new Date)>=new Date("2025-09-01")?k1["September 2025"]:k1["September 2024"]}function gi(s){return(s||new Date)>=new Date("2025-09-01")?"September 2025":"September 2024"}class sh{static getRateVersionInfo(t){const n=gi(t),r=k1[n];return{version:n,effectiveDate:r.effectiveDate}}static getAhernAcademyTuition(t,n){const r=Hi(n),a=gi(n);let o;return t==="yearly"?o=r.ahernAcademy.trimester*3:t==="trimester"?o=r.ahernAcademy.trimester:o=r.ahernAcademy.monthly,{serviceType:"ahern_academy_"+t,rate:o,description:`Ahern Academy Tuition - includes all weekday classes and groups (${t})`,billingPeriod:t,rateVersion:a}}static getOpenEnrollmentRate(t,n){const r=Hi(n),a=gi(n),c={1:{rate:r.openEnrollment.oneClass,description:"One class per week"},2:{rate:r.openEnrollment.twoClasses,description:"Two classes per week"},3:{rate:r.openEnrollment.threeClasses,description:"Three classes per week"},4:{rate:r.openEnrollment.fourClasses||r.openEnrollment.threeClasses,description:"Four classes per week"},5:{rate:r.openEnrollment.fiveClasses||r.openEnrollment.fourClasses||r.openEnrollment.threeClasses,description:"Five classes per week"}}[t];if(!c)throw new Error(`Invalid number of classes per week for Open Enrollment: ${t}`);return{serviceType:"open_enrollment",rate:c.rate,description:`Open Enrollment - ${c.description} (weekday classes: Mon, Tue, Thu, Fri)`,billingPeriod:"weekly",rateVersion:a}}static async isEstablishedStudent(t){var n;try{const{db:r}=await ru(async()=>{const{db:m}=await import("./db-CZt8W1uq.js");return{db:m}},__vite__mapDeps([0,1])),{sessionAppointments:a}=await ru(async()=>{const{sessionAppointments:m}=await Promise.resolve().then(()=>z3);return{sessionAppointments:m}},void 0),{eq:o,lt:c,count:u,and:h}=await ru(async()=>{const{eq:m,lt:g,count:y,and:b}=await import("./index-CiQvndaL.js");return{eq:m,lt:g,count:y,and:b}}
725,__vite__mapDeps([2,1]));return((n=(await r.select({count:u()}).from(a).where(h(o(a.studentId,t),c(a.scheduledDate,new Date))))[0])==null?void 0:n.count)>=3}catch{return!1}}static getOneOnOneSessionRate(t){let n,r;t instanceof Date?(n=t,r=void 0):typeof t=="string"?(n=void 0,r=t):(n=void 0,r=void 0);const a=Hi(n),o=gi(n);let c,u;return r==="established"?(c=a.oneOnOne.establishedStudent||125,u="1:1 Private Session (50 minutes) - Established Student"):r==="new"?(c=a.oneOnOne.newStudent||150,u="1:1 Private Session (50 minutes) - New Student"):(c=a.oneOnOne.newStudent||a.oneOnOne.establishedStudent||150,u="1:1 Private Session (50 minutes)"),{serviceType:"one_on_one_session",rate:c,description:u,billingPeriod:"session",rateVersion:o}}static async getOneOnOneSessionRateForStudent(t,n){try{const{db:r}=await ru(async()=>{const{db:u}=await import("./db-CZt8W1uq.js");return{db:u}},__vite__mapDeps([0,1])),{students:a}=await ru(async()=>{const{students:u}=await Promise.resolve().then(()=>z3);return{students:u}},void 0),{eq:o}=await ru(async()=>{const{eq:u}=await import("./index-CiQvndaL.js");return{eq:u}},__vite__mapDeps([2,1])),[c]=await r.select({oneOnOneRate:a.oneOnOneRate,name:a.name}).from(a).where(o(a.id,t));if(c!=null&&c.oneOnOneRate){const u=gi(n);return{serviceType:"one_on_one_session",rate:c.oneOnOneRate,description:"1:1 Private Session (50 minutes)",billingPeriod:"session",rateVersion:u}}}catch{}return this.getOneOnOneSessionRate("new")}static getConsultationRate(t){var o;const n=Hi(t),r=gi(t);return{serviceType:"consultation",rate:((o=n.consultation)==null?void 0:o.session)||150,description:"Consultation Session (50 minutes)",billingPeriod:"session",rateVersion:r}}static getAACDeviceProgrammingRate(t){var o;const n=Hi(t),r=gi(t);return{serviceType:"aac_device_programming",rate:((o=n.aacDeviceProgramming)==null?void 0:o.hourly)||50,description:"AAC Device Programming",billingPeriod:"session",rateVersion:r}}static getYACRate(t){const n=Hi(t),r=gi(t);return{serviceType:"young_adult_chat",rate:n.openEnrollment.oneClass||40,description:"Young Adult Chat - One session per week",billingPeriod:"weekly",rateVersion:r}}static getRegistrationFee(t){const n=Hi(t),r=gi(t);return{serviceType:"registration_fee",rate:n.fees.registration,description:"Registration fee (required for families needing itemized receipts for third-party reimbursement)",billingPeriod:"trimester",rateVersion:r}}static getLateFee(t){const n=Hi(t),r=gi(t);return{serviceType:"late_fee",rate:n.fees.late,description:"Late fee per week",billingPeriod:"weekly",rateVersion:r}}static getUnspecifiedPayment(t,n){return{serviceType:"unspecified_payment",rate:t,description:n||"Custom payment arrangement",billingPeriod:"session"}}static getTip(t){return{serviceType:"tip",rate:t,description:"Tip (optional gratuity)",billingPeriod:"session"}}static getSaturdayClassRate(t,n=!1,r){const a=Hi(r),o=gi(r),c=n?a.saturdayClasses.ahernStudents:a.saturdayClasses.general,u=t===5?c.fiveWeeks:c.sixWeeks;return{serviceType:n?"saturday_class_ahern":"saturday_class",rate:u,description:`Saturday Classes - ${n?"Ahern Academy Students":"General"} (${t} week class)`,billingPeriod:"session",rateVersion:o}}static getOpenEnrollmentWeeklyRate(t){const n=Hi();switch(t){case 1:return n.openEnrollment.oneClass;case 2:return n.openEnrollment.twoClasses;case 3:return n.openEnrollment.threeClasses;case 4:return n.openEnrollment.fourClasses;case 5:default:return n.openEnrollment.fiveClasses}}static getPrivateSessionRate(t){return this.getOneOnOneSessionRate(t)}static getWeeklyClassRate(t,n){return this.getOpenEnrollmentRate(t,n)}static getSaturdayClassRateAhern(t,n){return this.getSaturdayClassRate(t,!0,n)}static getAllServiceTypes(){return["ahern_academy_trimester","ahern_academy_monthly","open_enrollment","one_on_one_session","consultation","aac_device_programming","young_adult_chat","registration_fee","late_fee","saturday_class","saturday_class_ahern","unspecified_payment","tip"]}static calculateTotal(t,n=0){const r=t.reduce((o,c)=>o+c.rate,0),a=r*(n/100);return Math.max(0,r-a)}static calculateDiscount(t,n){return t*(n/100)}static applyScholarshipDiscount(t,n){const r=this.calculateDiscount(t,n);return Math.max(0,t-r)}static formatCurrency(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t)}static isAACAAwarenessPromoPeriod(t){const n=t||new Date,r=new Date("2025-10-01"),a=new Date("2025-11-15");return n>=r&&n<=a}static applyAACAAwarenessDiscount(t,n=!1,r){if(!n||!this.isAACAAwarenessPromoPeriod(r))return{discountedAmount:t,discountApplied:0,description:""};const o=Math.min(42,t);return{discountedAmount:Math.max(0,t-o),discountApplied:o,description:"AAC Awareness Month - One Free Class ($42 discount)"}}static getSessionRate(t,n,r){switch(t.toLowerCase()){case"1:1":case"one_on_one_session":return this.getOneOnOneSessionRate("new");case"consultation":return this.getConsultationRate(n);case"aac_device_programming":const a=this.getAACDeviceProgrammingRate(n);return r&&r!==1?{...a,rate:a.rate*r,description:`AAC Device Programming (${r} hour${r!==1?"s":""})`}:a;default:return this.getOneOnOneSessionRate(n)}}}const WW=te.object({familyId:te.string().min(1,"Family is required"),studentId:te.string().optional(),serviceType:te.string().min(1,"Service type is required"),serviceTypes:te.array(te.string()).optional(),amount:te.string().min(1,"Amount is required"),billingFrequency:te.enum(["weekly","monthly","trimester","session","one-time"]),description:te.string().min(1,"Description is required"),dueDate:te.string().min(1,"Due date is required"),paidDate:te.string().optional(),isThirdPartyPayment:te.boolean().default(!1),thirdPartyPayer:te.string().optional(),thirdPartyReference:te.string().optional(),autoGenerated:te.boolean().default(!1),expectedAmount:te.string().optional()});function BW(){var Mt;const[s,t]=p.useState("overview"),[n,r]=p.useState(!1),[a,o]=p.useState(""),[c,u]=p.useState("all"),[h,x]=p.useState({}),[m,g]=p.useState([]),{toast:y}=Is(),{data:b,isLoading:w}=nt({queryKey:["/api/payments"]}),{data:N}=nt({queryKey:["/api/payments/overdue"]}),{data:k}=nt({queryKey:["/api/payments/pending"]}),{data:E}=nt({queryKey:["/api/families"]}),{data:P}=nt({queryKey:["/api/admin/state-funding"]}),{data:M,isLoading:L}=nt({queryKey:["/api/admin/billing/ahern-preview"],enabled:s==="ahern-billing"}),B=bt({mutationFn:async $=>st("POST","/api/admin/billing/ahern-generate",{studentIds:$}),onSuccess:$=>{g([]),Xi.invalidateQueries({queryKey:["/api/admin/billing/ahern-preview"]}),Xi.invalidateQueries({queryKey:["/api/payments"]}),Xi.invalidateQueries({queryKey:["/api/payments/pending"]}),y({title:"Ahern billing complete",description:$.message})},onError:$=>{y({title:"Unable to generate Ahern bills",description:$.message||"Please try again.",variant:"destructive"})}}),z=bt({mutationFn:async $=>st("POST",`/api/admin/state-funding/${$.id}/decide`,{approve:$.approve,serviceCodes:$.serviceCodes||[]}),onSuccess:$=>{Xi.invalidateQueries({queryKey:["/api/admin/state-funding"]}),y({title:"State funding updated",description:($==null?void 0:$.message)||"Decision saved."})},onError:$=>{y({title:"Unable to save decision",description:$.message||"Please try again.",variant:"destructive"})}}),{data:H}=nt({queryKey:["/api/dashboard/stats"]}),T=Da({resolver:Oa(WW),defaultValues:{familyId:"",studentId:"",serviceType:"",serviceTypes:[],amount:"",billingFrequency:"monthly",description:"",dueDate:"",paidDate:"",isThirdPartyPayment:!1,thirdPartyPayer:"",thirdPartyReference:"",autoGenerated:!1,expectedAmount:""}}),U=($,K)=>{try{switch($){case"Ahern Academy":if(K==="monthly")return sh.getAhernAcademyTuition("monthly").rate;if(K==="trimester")return sh.getAhernAcademyTuition("trimester").rate;break;case"1:1 Sessions":if(K==="session")return sh.getOneOnOneSessionRate("established").rate;break;case"Open Enrollment":if(K==="weekly")return sh.getOpenEnrollmentRate(1).rate;break;case"Young Adult Chat":if(K==="weekly"||K==="session")return sh.getOpenEnrollmentRate(1).rate;break}return 0}catch(xe){return console.error("Error getting service rate:",xe),0}},_=$=>{var A;const K=T.getValues("billingFrequency"),xe=U($,K);xe>0&&T.setValue("amount",xe.toString());const De=T.getValues("familyId"),X=E==null?void 0:E.find(D=>D.id.toString()===De),_e=T.getValues("studentId"),Le=_e&&_e!=="none"?(A=X==null?void 0:X.students)==null?void 0:A.find(D=>D.id.toString()===_e):null;X&&Le?T.setValue("description",`${$} - ${Le.name} (${K})`):X&&T.setValue("description",`${$} - ${X.caregiverOneName} Family (${K})`)},se=$=>{var xe;const K=T.getValues("serviceType");if(K){const De=U(K,$);De>0&&T.setValue("amount",De.toString());const X=T.getValues("familyId"),_e=E==null?void 0:E.find(D=>D.id.toString()===X),Le=T.getValues("studentId"),A=Le&&Le!=="none"?(xe=_e==null?void 0:_e.
725students)==null?void 0:xe.find(D=>D.id.toString()===Le):null;_e&&A?T.setValue("description",`${K} - ${A.name} (${$})`):_e&&T.setValue("description",`${K} - ${_e.caregiverOneName} Family (${$})`)}},ae=bt({mutationFn:async $=>{const K={...$,familyId:parseInt($.familyId),studentId:$.studentId&&$.studentId!=="none"?parseInt($.studentId):null,billingPeriod:$.billingFrequency,expectedAmount:$.expectedAmount?parseFloat($.expectedAmount):void 0,paidDate:$.paidDate||new Date().toISOString().split("T")[0],status:"paid"};return st("POST","/api/payments",K)},onSuccess:()=>{y({title:"Payment Created",description:"Payment has been successfully created with automatic rate calculation"}),T.reset(),r(!1),Xi.invalidateQueries({queryKey:["/api/payments"]}),Xi.invalidateQueries({queryKey:["/api/dashboard/stats"]})},onError:$=>{y({title:"Error",description:$.message||"Failed to create payment",variant:"destructive"})}}),W=$=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(typeof $=="string"?parseFloat($):$),J=$=>{if(!$)return"Date not available";try{return new Date($).toLocaleDateString()}catch{return"Invalid date"}},ne=(b||[]).filter($=>{var _e,Le,A,D;const K=a.toLowerCase(),xe=E==null?void 0:E.find(ie=>ie.id===$.familyId),De=!a||((_e=$.description)==null?void 0:_e.toLowerCase().includes(K))||((Le=$.serviceType)==null?void 0:Le.toLowerCase().includes(K))||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(K))||((D=xe==null?void 0:xe.email)==null?void 0:D.toLowerCase().includes(K))||((xe==null?void 0:xe.caregiverOneEmail)??"").toLowerCase().includes(K)||((xe==null?void 0:xe.caregiverTwoEmail)??"").toLowerCase().includes(K)||((xe==null?void 0:xe.caregiverThreeEmail)??"").toLowerCase().includes(K),X=c==="all"||$.status===c;return De&&X}),le=new Date,V=le.getMonth()>=8?le.getFullYear():le.getFullYear()-1,Z=new Date(V,8,1),ge=Math.floor((le.getMonth()+4)/3)%4*3+8,G=new Date(ge>=12?V+1:V,ge%12,1),Ae=new Date(le.getFullYear(),le.getMonth(),1),Fe=($,K)=>{if(!$)return!1;const xe=new Date($);return xe>=K&&xe<=le},be=(b||[]).filter($=>$.status==="paid"||$.status==="completed"),Me=(b||[]).filter($=>$.status==="refunded"),R=be.reduce(($,K)=>$+parseFloat(K.amount),0),re=Me.reduce(($,K)=>$+parseFloat(K.amount),0),O=R-re;be.filter($=>{const K=$.paidDate||$.createdAt;return K&&Fe(K,Z)}).reduce(($,K)=>$+parseFloat(K.amount),0),be.filter($=>{const K=$.paidDate||$.createdAt;return K&&Fe(K,G)}).reduce(($,K)=>$+parseFloat(K.amount),0),be.filter($=>{const K=$.paidDate||$.createdAt;return K&&Fe(K,Ae)}).reduce(($,K)=>$+parseFloat(K.amount),0);const me=(k||[]).reduce(($,K)=>$+parseFloat(K.amount),0),Y=(N||[]).reduce(($,K)=>$+parseFloat(K.amount),0),Te=(b||[]).filter($=>{var K,xe;return((K=$.description)==null?void 0:K.includes("appreciation"))||((xe=$.description)==null?void 0:xe.includes("credited"))}),Be=(b||[]).filter($=>$.serviceType==="Account Credit"),ht=Be.reduce(($,K)=>$+parseFloat(K.amount),0);return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold text-[#4A4A4A]",children:"Unified Billing Dashboard"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(we,{variant:"outline",className:"border-[#77dbf6] text-[#4A4A4A] bg-[#77dbf6]/5",children:[(b||[]).length," Total Payments"]}),e.jsxs(we,{variant:"outline",className:"border-red-300 text-red-700 bg-red-50",children:[Me.length," Refunds"]}),e.jsxs(we,{variant:"outline",className:"border-[#feea6a] text-[#4A4A4A] bg-[#feea6a]/5",children:[Te.length," Overpayments"]}),e.jsxs(we,{variant:"outline",className:"border-[#4A4A4A] text-[#4A4A4A] bg-[#4A4A4A]/5",children:[Be.length," Credits"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6",children:[e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Net Collected"}),e.jsx(xr,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-green-600",children:W(O)}),e.jsxs("div",{className:"space-y-1 mt-2",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Gross:"})," ",W(R)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Refunds:"})," -",W(re)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Net:"})," ",W(O)]})]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Pending Payments"}),e.jsx(ys,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:W(me)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[(k||[]).length," pending payments"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Overdue Payments"}),e.jsx(rl,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-red-600",children:W(Y)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[(N||[]).length," overdue payments"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Total Refunds"}),e.jsx(IF,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-red-600",children:W(re)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Me.length," refund transactions"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Account Credits"}),e.jsx(Or,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:W(ht)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Be.length," credit records"]})]})]})]}),e.jsxs(Ql,{value:s,onValueChange:t,className:"space-y-6",children:[e.jsxs(pl,{className:"grid grid-cols-2 md:grid-cols-5 w-full gap-1",children:[e.jsx(qs,{value:"overview",className:"text-xs sm:text-sm",children:"Overview"}),e.jsx(qs,{value:"create",className:"text-xs sm:text-sm",children:"Create Payment"}),e.jsx(qs,{value:"ahern-billing",className:"text-xs sm:text-sm",children:"Ahern Billing"}),e.jsx(qs,{value:"state-funding",className:"text-xs sm:text-sm",children:"State Funding"}),e.jsx(qs,{value:"credits",className:"text-xs sm:text-sm",children:"Overpayments"})]}),e.jsxs(Hs,{value:"overview",className:"space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row gap-4 items-center justify-between",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Bl,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(je,{placeholder:"Search payments...",value:a,onChange:$=>o($.target.value),className:"pl-8 w-[250px]"})]}),e.jsxs(St,{value:c,onValueChange:u,children:[e.jsx(At,{className:"w-[150px]",children:e.jsx(kt,{placeholder:"Filter status"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Status"}),e.jsx(ce,{value:"paid",children:"Paid"}),e.jsx(ce,{value:"pending",children:"Pending"}),e.jsx(ce,{value:"overdue",children:"Overdue"})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2 text-red-600",children:[e.jsx(rl,{className:"w-5 h-5"}),e.jsx("span",{children:"Overdue Payments"})]})}),e.jsxs(Se,{className:"space-y-3",children:[(N||[]).map($=>{var K;return e.jsx("div",{className:"border border-red-200 rounded-lg p-3 bg-red-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-red-800",children:(K=$.family)==null?void 0:K.caregiverOneName}),e.jsx("p",{className:"text-sm text-red-600",children:$.description}),e.jsxs("p",{className:"text-sm text-red-600",children:["Due: ",J($.dueDate)]})]}),e.jsx("div",{className:"text-right",children:e.jsx("p",{className:"font-semibold text-red-800",children:W($.amount)})})]})},$.id)}),(!N||N.length===0)&&e.jsx("p",{className:"text-gray-600 italic",children:"No overdue payments"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2 text-yellow-600",children:[e.jsx(ys,{className:"w-5 h-5"}),e.jsx("span",{children:"Pending Payments"})]})}),e.jsxs(Se,{className:"space-y-3",children:[(k||[]).map($=>{var K;return e.jsx("div",{className:"border border-yellow-200 rounded-lg p-3 bg-yellow-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-yellow-800",children:(K=$.family)==null?void 0:K.caregiverOneName}),e.jsx("p",{className:"text-sm text-yellow-600",children:$.description}),e.jsxs("p",{className:"text-sm text-yellow-600",children:["Due: ",J($.dueDate)]})]}),e.jsx("div",{className:"text-right",children:e.jsx("p",{className:"font-semibold text-yellow-800",children:W($.amount)})})]})},$.id)}),(!k||k.length===0)&&e.jsx("p",{className:"text-gray-600 italic",children:"No pending payments"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2 text-green-600",children:[e.jsx(As,{className:"w-5 h-5"}),e.jsx("span",{children:"Recent Paid"})]})}),e.jsx(Se,{className:"space-y-3",children:(b||[]).filter($=>$.status==="paid").sort(($,K)=>new Date(K.paidDate||K.createdAt).getTime()-new Date($.paidDate||$.createdAt).getTime()).slice(0,5).map($=>{var K,xe;return e.jsx("div",{className:"border border-green-200 rounded-lg p-3 bg-green-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-green-800",children:(K=E==null?void 0:E.find(De=>De.id===$.familyId))==null?void 0:K.caregiverOneName}),e.jsx("p",{className:"text-sm text-green-600",children:$.description}),e.jsxs("p",{className:"text-sm text-green-600",children:["Paid: ",J($.paidDate)]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"font-semibold text-green-800",children:W($.amount)}),((xe=$.description)==null?void 0:xe.includes("appreciation"))&&e.jsx(we,{variant:"outline",className:"text-xs mt-1",children:"Appreciation"})]})]})},$.id)})})]})]})]}),e.jsx(Hs,{value:"ahern-billing",className:"space-y-6",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(an,{className:"h-5 w-5"}),"Missing Ahern Academy Bills"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Preview missing tuition bills before creating them. Scholarship, third-party, state-funded, inactive, archived, protected, and duplicate records are excluded automatically."})]}),e.jsxs(Se,{className:"space-y-4",children:[L&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking billing recordsâ¦"}),M&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(we,{children:[M.eligibleCount," ready"]}),e.jsxs(we,{variant:"outline",children:[M.excludedCount," excluded"]}),e.jsx(F,{type:"button",size:"sm",variant:"outline",onClick:()=>g(M.items.filter($=>$.eligible).map($=>$.studentId)),children:"Select all ready"}),m.length>0&&e.jsx(F,{type:"button",size:"sm",variant:"ghost",onClick:()=>g([]),children:"Clear selection"})]}),M.items.map($=>e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Gs,{checked:m.includes($.studentId),disabled:!$.eligible,onCheckedChange:K=>g(xe=>K===!0?Array.from(new Set([...xe,$.studentId])):xe.filter(De=>De!==$.studentId))}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:$.studentName}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[$.caregiverName," · ",$.caregiverEmail]})]}),e.jsx(we,{variant:$.eligible?"default":"secondary",children:$.eligible?"Ready":"Excluded"})]}),e.jsxs("p",{className:"mt-2 text-sm",children:[W($.amount)," · ",$.billingPeriod," · due ",J($.dueDate)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[$.schoolYear," school year",$.sessionName?` · ${$.sessionName}`:""]}),$.exclusionReason&&e.jsx("p",{className:"mt-2 text-sm font-medium text-amber-700",children:$.exclusionReason})]})]})},$.studentId)),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t pt-4",children:[e.jsx(F,{disabled:m.length===0||B.isPending,onClick:()=>{window.confirm(`Create ${m.length} selected Ahern Academy bill${m.length===1?"":"s"}?`)&&B.mutate(m)},children:B.isPending?"Creatingâ¦":`Generate ${m.length} selected bill${m.length===1?"":"s"}`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only checked, eligible bills will be created."})]})]})]})]})}),e.jsx(Hs,{value:"state-funding",className:"space-y-6",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(bF,{className:"h-5 w-5"}),"State Funding Requests"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Caregiver interest and approved student-level billing instructions. Existing bills are never changed here."})]}),e.jsxs(Se,{className:"space-y-4",children:[(P||[]).map($=>{const K=$.selection,xe=h[K.id]||[],De=K.selected&&K.programStatus==="approved"&&K.status!=="approved"&&K.status!=="declined";return e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:$.studentName}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[$.familyName," · ",$.familyEmail]}),e.jsxs("p",{className:"mt-1 text-sm",children:[K.programName," (",K.stateCode,")"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(we,{variant:K.programStatus==="approved"?"default":"secondary",children:K.programStatus}),e.jsx(we,{variant:"outline",children:K.status})]})]}),K.caregiverNotes&&e.jsxs("div",{className:"mt-3 rounded bg-muted p-3 text-sm",children:[e.jsx("strong",{children:"Caregiver information:"})," ",K.caregiverNotes]}),De&&e.jsxs("div",{className:"mt-4",children:[e.jsx(Ne,{className:"text-sm font-medium",children:"Services to bill through the state portal"}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Gs,{checked:xe.includes("ALL"),onCheckedChange:X=>x(_e=>({..._e,[K.id]:X===!0?["ALL"]:[]}))}),"All applicable services"]}),$.services.map(X=>e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Gs,{disabled:xe.includes("ALL"),
725checked:xe.includes(X.code),onCheckedChange:_e=>x(Le=>{const A=(Le[K.id]||[]).filter(D=>D!=="ALL");return{...Le,[K.id]:_e===!0?Array.from(new Set([...A,X.code])):A.filter(D=>D!==X.code)}})}),X.label]},X.code))]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx(F,{size:"sm",disabled:xe.length===0||z.isPending,onClick:()=>z.mutate({id:K.id,approve:!0,serviceCodes:xe}),children:"Approve selected services"}),e.jsx(F,{size:"sm",variant:"outline",disabled:z.isPending,onClick:()=>z.mutate({id:K.id,approve:!1}),children:"Decline"})]})]}),K.status==="approved"&&e.jsxs("p",{className:"mt-3 text-sm font-medium text-green-700",children:["Future billing through state portal: ",(K.approvedServiceTypes||[]).join(", ")]}),K.programStatus!=="approved"&&K.selected&&e.jsx("p",{className:"mt-3 text-sm text-amber-700",children:"Interest recorded. Billing cannot be activated until AAC Voices is approved."})]},K.id)}),(!P||P.length===0)&&e.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No state funding responses yet."})]})]})}),e.jsx(Hs,{value:"history",className:"space-y-6",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsx(Ue,{children:"Payment History"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"View all payment records filtered by family or program type"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Bl,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(je,{placeholder:"Search by family name, any caregiver email, or payment...",value:a,onChange:$=>o($.target.value),className:"pl-8 w-[250px]"})]}),e.jsxs(St,{value:c,onValueChange:u,children:[e.jsx(At,{className:"w-[150px]",children:e.jsx(kt,{placeholder:"Filter by program"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Programs"}),e.jsx(ce,{value:"Ahern Academy Tuition",children:"Ahern Academy"}),e.jsx(ce,{value:"Open Enrollment Classes",children:"Open Enrollment"}),e.jsx(ce,{value:"1:1 Sessions",children:"1:1 Sessions"}),e.jsx(ce,{value:"Young Adult Chat",children:"Young Adult Chat"}),e.jsx(ce,{value:"Account Credit",children:"Account Credits"}),e.jsx(ce,{value:"Other Payment",children:"Other Payments"})]})]}),e.jsx(F,{variant:"outline",onClick:()=>{o(""),u("all")},children:"Clear Filters"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs(F,{variant:"outline",size:"sm",children:[e.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Export CSV"]})})]}),e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs("div",{className:"max-h-[600px] overflow-y-auto",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50 border-b",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-3 font-medium",children:"Date"}),e.jsx("th",{className:"text-left p-3 font-medium",children:"Family"}),e.jsx("th",{className:"text-left p-3 font-medium",children:"Program"}),e.jsx("th",{className:"text-left p-3 font-medium",children:"Description"}),e.jsx("th",{className:"text-right p-3 font-medium",children:"Amount"}),e.jsx("th",{className:"text-center p-3 font-medium",children:"Status"})]})}),e.jsx("tbody",{children:ne.filter($=>{var X,_e,Le,A,D;const K=c==="all"||((X=$.serviceType)==null?void 0:X.includes(c))||c==="Ahern Academy Tuition"&&((_e=$.serviceType)==null?void 0:_e.includes("Ahern Academy"))||c==="Open Enrollment Classes"&&((Le=$.serviceType)==null?void 0:Le.includes("Open Enrollment")),xe=E==null?void 0:E.find(ie=>ie.id===$.familyId),De=!a||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(a.toLowerCase()))||((D=xe==null?void 0:xe.primaryEmail)==null?void 0:D.toLowerCase().includes(a.toLowerCase()));return K&&De}).sort(($,K)=>new Date(K.paidDate||K.dueDate).getTime()-new Date($.paidDate||$.dueDate).getTime()).map($=>{var xe,De,X,_e,Le,A,D;const K=E==null?void 0:E.find(ie=>ie.id===$.familyId);return e.jsxs("tr",{className:"border-b hover:bg-gray-50",children:[e.jsx("td",{className:"p-3 text-sm",children:J($.paidDate||$.dueDate)}),e.jsx("td",{className:"p-3",children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:K==null?void 0:K.caregiverOneName}),e.jsx("div",{className:"text-xs text-gray-500",children:K==null?void 0:K.primaryEmail})]})}),e.jsx("td",{className:"p-3",children:e.jsx("div",{className:"space-y-1",children:$.serviceTypes&&$.serviceTypes.length>1?$.serviceTypes.map((ie,$e)=>e.jsx(we,{variant:"outline",className:"text-xs mr-1",children:ie.includes("Ahern Academy")?"Ahern Academy":ie.includes("Open Enrollment")?"Open Enrollment":ie.includes("1:1 Sessions")?"1:1 Sessions":ie.includes("Young Adult Chat")?"Young Adult Chat":ie.includes("Account Credit")?"Account Credit":ie||"Other"},$e)):e.jsx(we,{variant:"outline",className:"text-xs",children:(xe=$.serviceType)!=null&&xe.includes("Ahern Academy")?"Ahern Academy":(De=$.serviceType)!=null&&De.includes("Open Enrollment")?"Open Enrollment":(X=$.serviceType)!=null&&X.includes("1:1 Sessions")?"1:1 Sessions":(_e=$.serviceType)!=null&&_e.includes("Young Adult Chat")?"Young Adult Chat":(Le=$.serviceType)!=null&&Le.includes("Account Credit")?"Account Credit":$.serviceType||"Other"})})}),e.jsxs("td",{className:"p-3 text-sm max-w-xs",children:[e.jsx("div",{className:"truncate",title:$.description,children:$.description}),((A=$.description)==null?void 0:A.includes("appreciation"))&&e.jsx(we,{variant:"outline",className:"text-xs mt-1 bg-blue-50",children:"Appreciation"}),((D=$.description)==null?void 0:D.includes("credited"))&&e.jsx(we,{variant:"outline",className:"text-xs mt-1 bg-green-50",children:"Credit Applied"})]}),e.jsx("td",{className:"p-3 text-right font-medium",children:W($.amount)}),e.jsx("td",{className:"p-3 text-center",children:e.jsx(we,{variant:$.status==="paid"?"default":$.status==="pending"?"secondary":"destructive",className:$.status==="paid"?"bg-green-100 text-green-800":$.status==="pending"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800",children:$.status})})]},$.id)})})]}),ne.length===0&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No payments found matching your filters"})]})}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-green-600",children:ne.filter($=>{var X,_e,Le,A,D;const K=c==="all"||((X=$.serviceType)==null?void 0:X.includes(c))||c==="Ahern Academy Tuition"&&((_e=$.serviceType)==null?void 0:_e.includes("Ahern Academy"))||c==="Open Enrollment Classes"&&((Le=$.serviceType)==null?void 0:Le.includes("Open Enrollment")),xe=E==null?void 0:E.find(ie=>ie.id===$.familyId),De=!a||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(a.toLowerCase()))||((D=xe==null?void 0:xe.primaryEmail)==null?void 0:D.toLowerCase().includes(a.toLowerCase()));return K&&De&&$.status==="paid"}).length}),e.jsx("p",{className:"text-sm text-gray-600",children:"Paid Payments"})]}),e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-blue-600",children:W(ne.f
725ilter($=>{var X,_e,Le,A,D;const K=c==="all"||((X=$.serviceType)==null?void 0:X.includes(c))||c==="Ahern Academy Tuition"&&((_e=$.serviceType)==null?void 0:_e.includes("Ahern Academy"))||c==="Open Enrollment Classes"&&((Le=$.serviceType)==null?void 0:Le.includes("Open Enrollment")),xe=E==null?void 0:E.find(ie=>ie.id===$.familyId),De=!a||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(a.toLowerCase()))||((D=xe==null?void 0:xe.primaryEmail)==null?void 0:D.toLowerCase().includes(a.toLowerCase()));return K&&De&&$.status==="paid"}).reduce(($,K)=>$+parseFloat(K.amount),0))}),e.jsx("p",{className:"text-sm text-gray-600",children:"Total Collected"})]}),e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-orange-600",children:ne.filter($=>{var X,_e,Le,A,D,ie;const K=c==="all"||((X=$.serviceType)==null?void 0:X.includes(c))||c==="Ahern Academy Tuition"&&((_e=$.serviceType)==null?void 0:_e.includes("Ahern Academy"))||c==="Open Enrollment Classes"&&((Le=$.serviceType)==null?void 0:Le.includes("Open Enrollment")),xe=E==null?void 0:E.find($e=>$e.id===$.familyId),De=!a||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(a.toLowerCase()))||((D=xe==null?void 0:xe.primaryEmail)==null?void 0:D.toLowerCase().includes(a.toLowerCase()));return K&&De&&((ie=$.description)==null?void 0:ie.includes("appreciation"))}).length}),e.jsx("p",{className:"text-sm text-gray-600",children:"Appreciation Payments"})]}),e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-purple-600",children:new Set(ne.filter($=>{var X,_e,Le,A,D;const K=c==="all"||((X=$.serviceType)==null?void 0:X.includes(c))||c==="Ahern Academy Tuition"&&((_e=$.serviceType)==null?void 0:_e.includes("Ahern Academy"))||c==="Open Enrollment Classes"&&((Le=$.serviceType)==null?void 0:Le.includes("Open Enrollment")),xe=E==null?void 0:E.find(ie=>ie.id===$.familyId),De=!a||((A=xe==null?void 0:xe.caregiverOneName)==null?void 0:A.toLowerCase().includes(a.toLowerCase()))||((D=xe==null?void 0:xe.primaryEmail)==null?void 0:D.toLowerCase().includes(a.toLowerCase()));return K&&De}).map($=>$.familyId)).size}),e.jsx("p",{className:"text-sm text-gray-600",children:"Unique Families"})]})]})]})]})}),e.jsx(Hs,{value:"create",className:"space-y-6",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsx(Ue,{children:"Create New Payment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create payments with smart overpayment handling and account credit support"})]}),e.jsx(Se,{children:e.jsx(Fa,{...T,children:e.jsxs("form",{onSubmit:T.handleSubmit($=>ae.mutate($)),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:T.control,name:"familyId",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Family"}),e.jsxs(St,{onValueChange:$.onChange,defaultValue:$.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select family"})})}),e.jsx(Ct,{children:(E||[]).map(K=>e.jsxs(ce,{value:K.id.toString(),children:[K.caregiverOneName," - ",K.primaryEmail]},K.id))})]}),e.jsx(Ye,{})]})}),e.jsxs("div",{children:[e.jsx(ze,{children:"Service Types"}),e.jsx("div",{className:"text-sm text-gray-600 mb-3",children:"Select one or more services covered by this payment:"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:["Ahern Academy Tuition","Open Enrollment Classes","1:1 Sessions","Young Adult Chat","Late Fee","Other Payment","Account Credit"].map($=>e.jsx(Ke,{control:T.control,name:"serviceTypes",render:({field:K})=>{var xe;return e.jsxs(We,{className:"flex items-center space-x-2",children:[e.jsx(He,{children:e.jsx(Gs,{checked:((xe=K.value)==null?void 0:xe.includes($))||!1,onCheckedChange:De=>{const X=K.value||[];if(De){const _e=[...X,$];if(K.onChange(_e),!T.getValues("serviceType")){const Le=$.includes("Ahern Academy")?"Ahern Academy":$.includes("Open Enrollment")?"Open Enrollment":$.includes("1:1 Sessions")?"1:1 Sessions":$.includes("Young Adult Chat")?"Young Adult Chat":$;T.setValue("serviceType",Le),_(Le)}}else{const _e=X.filter(Le=>Le!==$);if(K.onChange(_e),T.getValues("serviceType")===$&&_e.length>0){const Le=_e[0],A=Le.includes("Ahern Academy")?"Ahern Academy":Le.includes("Open Enrollment")?"Open Enrollment":Le.includes("1:1 Sessions")?"1:1 Sessions":Le.includes("Young Adult Chat")?"Young Adult Chat":Le;T.setValue("serviceType",A),_(A)}else _e.length===0&&(T.setValue("serviceType",""),T.setValue("amount",""))}}})}),e.jsx(ze,{className:"text-sm font-normal cursor-pointer",children:$})]})}},$))}),((Mt=T.watch("serviceTypes"))==null?void 0:Mt.length)>0&&e.jsxs("div",{className:"mt-3 p-3 bg-blue-50 rounded-lg",children:[e.jsx("div",{className:"text-sm font-medium text-blue-800",children:"Selected Services:"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:T.watch("serviceTypes").map(($,K)=>e.jsx(we,{variant:"secondary",className:"text-xs",children:$}
725,K))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(Ke,{control:T.control,name:"amount",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Amount (auto-calculated based on service type)"}),e.jsx(He,{children:e.jsx(je,{placeholder:"0.00",...$})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"expectedAmount",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Expected Amount (for overpayment handling)"}),e.jsx(He,{children:e.jsx(je,{placeholder:"0.00",...$})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"dueDate",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Due Date"}),e.jsx(He,{children:e.jsx(je,{type:"date",...$})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"paidDate",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Paid Date (leave empty if not paid yet)"}),e.jsx(He,{children:e.jsx(je,{type:"date",...$})}),e.jsx(Ye,{})]})})]}),e.jsx(Ke,{control:T.control,name:"description",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Description"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Payment description...",...$})}),e.jsx(Ye,{})]})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsx(Ke,{control:T.control,name:"billingFrequency",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Billing Frequency"}),e.jsxs(St,{onValueChange:K=>{$.onChange(K),se(K)},defaultValue:$.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"weekly",children:"Weekly"}),e.jsx(ce,{value:"monthly",children:"Monthly"}),e.jsx(ce,{value:"trimester",children:"Trimester"}),e.jsx(ce,{value:"session",children:"Session"}),e.jsx(ce,{value:"one-time",children:"One-time"})]})]}),e.jsx(Ye,{})]})})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ke,{control:T.control,name:"isThirdPartyPayment",render:({field:$})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:$.value,onCheckedChange:$.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{children:"Third-party payment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Check if this payment comes from an external payer"})]})]})}),T.watch("isThirdPartyPayment")&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:T.control,name:"thirdPartyPayer",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Third-party Payer Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Payer organization name",...$})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:T.control,name:"thirdPartyReference",render:({field:$})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Reference Number"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Payment reference",...$})}),e.jsx(Ye,{})]})})]})]}),e.jsx(F,{type:"submit",disabled:ae.isPending,children:ae.isPending?"Creating...":"Create Payment"})]})})})]})}),e.jsxs(Hs,{value:"credits",className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2",children:[e.jsx(xf,{className:"w-5 h-5 text-blue-600"}),e.jsx("span",{children:"Overpayment Records"})]})}),e.jsxs(Se,{className:"space-y-3",children:[Te.map($=>{var K,xe,De;return e.jsx("div",{className:"border border-blue-200 rounded-lg p-3 bg-blue-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-blue-800",children:(K=E==null?void 0:E.find(X=>X.id===$.familyId))==null?void 0:K.caregiverOneName}),e.jsx("p",{className:"text-sm text-blue-600",children:$.description}),e.jsx("p",{className:"text-sm text-blue-600",children:J($.paidDate)})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"font-semibold text-blue-800",children:W($.amount)}),((xe=$.description)==null?void 0:xe.includes("appreciation"))&&e.jsxs(we,{variant:"outline",className:"text-xs mt-1",children:[(De=$.de
725scription.match(/(\d+\.?\d*)% appreciation/))==null?void 0:De[1],"% Appreciation"]})]})]})},$.id)}),Te.length===0&&e.jsx("p",{className:"text-gray-600 italic",children:"No overpayment records"})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center space-x-2",children:[e.jsx(Or,{className:"w-5 h-5 text-green-600"}),e.jsx("span",{children:"Account Credits"})]})}),e.jsxs(Se,{className:"space-y-3",children:[Be.map($=>{var K;return e.jsx("div",{className:"border border-green-200 rounded-lg p-3 bg-green-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-green-800",children:(K=E==null?void 0:E.find(xe=>xe.id===$.familyId))==null?void 0:K.caregiverOneName}),e.jsx("p",{className:"text-sm text-green-600",children:$.description}),e.jsxs("p",{className:"text-sm text-green-600",children:["Created: ",J($.paidDate)]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"font-semibold text-green-800",children:W($.amount)}),e.jsx(we,{variant:"outline",className:"text-xs mt-1 bg-green-100",children:"Available Credit"})]})]})},$.id)}),Be.length===0&&e.jsx("p",{className:"text-gray-600 italic",children:"No account credits"})]})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{children:"Overpayment & Credit Summary"})}),e.jsx(Se,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-blue-600",children:Te.length}),e.jsx("p",{className:"text-sm text-gray-600",children:"Total Overpayments"})]}),e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-green-600",children:W(ht)}),e.jsx("p",{className:"text-sm text-gray-600",children:"Available Credits"})]}),e.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-orange-600",children:Be.length}),e.jsx("p",{className:"text-sm text-gray-600",children:"Families with Credits"})]})]})})]})]})]})]})})}function Ra(s){const t=Object.prototype.toString.call(s);return s instanceof Date||typeof s=="object"&&t==="[object Date]"?new s.constructor(+s):typeof s=="number"||t==="[object Number]"||typeof s=="string"||t==="[object String]"?new Date(s):new Date(NaN)}function ul(s,t){return s instanceof Date?new s.constructor(t):new Date(t)}function ow(s,t){const n=Ra(s);return isNaN(t)?ul(s,NaN):(n.setDate(n.getDate()+t),n)}function cw(s,t){const n=Ra(s);if(isNaN(t))return ul(s,NaN);if(!t)return n;const r=n.getDate(),a=ul(s,n.getTime());a.setMonth(n.getMonth()+t+1,0);const o=a.getDate();return r>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}const z$=6048e5,KW=864e5;let HW={};function rg(){return HW}function Hh(s,t){var u,h,x,m;const n=rg(),r=(t==null?void 0:t.weekStartsOn)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??n.weekStartsOn??((m=(x=n.locale)==null?void 0:x.options)==null?void 0:m.weekStartsOn)??0,a=Ra(s),o=a.getDay(),c=(o<r?7:0)+o-r;return a.setDate(a.getDate()-c),a.setHours(0,0,0,0),a}function u0(s){return Hh(s,{weekStartsOn:1})}function q$(s){const t=Ra(s),n=t.getFullYear(),r=ul(s,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=u0(r),o=ul(s,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const c=u0(o);return t.getTime()>=a.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function dw(s){const t=Ra(s);return t.setHours(0,0,0,0),t}function uw(s){const t=Ra(s),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+s-+n}function GW(s,t){const n=dw(s),r=dw(t),a=+n-uw(n),o=+r-uw(r);return Math.round((a-o)/KW)}function ZW(s){const t=q$(s),n=ul(s,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),u0(n)}function YW(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function QW(s){if(!YW(s)&&typeof s!="number")return!1;const t=Ra(s);return!isNaN(Number(t))}function XW(s){const t=Ra(s),n=ul(s,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const JW={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},eB=(s,t,n)=>{let r;const a=JW[s];
vendor: 17,159 bytes, line 725
725return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function uv(s){return(t={})=>{const n=t.width?String(t.width):s.defaultWidth;return s.formats[n]||s.formats[s.defaultWidth]}}const tB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rB={date:uv({formats:tB,defaultWidth:"full"}),time:uv({formats:sB,defaultWidth:"full"}),dateTime:uv({formats:nB,defaultWidth:"full"})},aB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},iB=(s,t,n,r)=>aB[s];function nh(s){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&s.formattingValues){const c=s.defaultFormattingWidth||s.defaultWidth,u=n!=null&&n.width?String(n.width):c;a=s.formattingValues[u]||s.formattingValues[c]}else{const c=s.defaultWidth,u=n!=null&&n.width?String(n.width):s.defaultWidth;a=s.values[u]||s.values[c]}const o=s.argumentCallback?s.argumentCallback(t):t;return a[o]}}const lB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},uB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},mB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hB=(s,t)=>{const n=Number(s),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},fB={ordinalNumber:hB,era:nh({values:lB,defaultWidth:"wide"}),quarter:nh({values:oB,defaultWidth:"wide",argumentCallback:s=>s-1}),month:nh({values:cB,defaultWidth:"wide"}),day:nh({values:dB,defaultWidth:"wide"}),dayPeriod:nh({values:uB,defaultWidth:"wide",formattingValues:mB,defaultFormattingWidth:"wide"})};function rh(s){return(t,n={})=>{const r=n.width,a=r&&s.matchPatterns[r]||s.matchPatterns[s.defaultMatchWidth],o=t.match(a);if(!o)return null;const c=o[0],u=r&&s.parsePatterns[r]||s.parsePatterns[s.defaultParseWidth],h=Array.isArray(u)?xB(u,g=>g.test(c)):pB(u,g=>g.test(c));let x;x=s.valueCallback?s.valueCallback(h):h,x=n.valueCallback?n.valueCallback(x):x;const m=t.slice(c.length);return{value:x,rest:m}}}function pB(s,t){for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)&&t(s[n]))return n}function xB(s,t){for(let n=0;n<s.length;n++)if(t(s[n]))return n}function gB(s){return(t,n={})=>{const r=t.match(s.matchPattern);if(!r)return null;const a=r[0],o=t.match(s.parsePattern);if(!o)return null;let c=s.valueCallback?s.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}const yB=/^(\d+)(th|st|nd|rd)?/i,vB=/\d+/i,jB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bB={any:[/^b/i,/^(a|c)/i]},NB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wB={any:[/1/i,/2/i,/3/i,/4/i]},AB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},CB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},SB={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$B={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},PB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},EB={ordinalNumber:gB({matchPattern:yB,parsePattern:vB,valueCallback:s=>parseInt(s,10)}),era:rh({matchPatterns:jB,defaultMatchWidth:"wide",parsePatterns:bB,defaultParseWidth:"any"}),quarter:rh({matchPatterns:NB,defaultMatchWidth:"wide",parsePatterns:wB,defaultParseWidth:"any",valueCallback:s=>s+1}),month:rh({matchPatterns:AB,defaultMatchWidth:"wide",parsePatterns:CB,defaultParseWidth:"any"}),day:rh({matchPatterns:SB,defaultMatchWidth:"wide",parsePatterns:kB,defaultParseWidth:"any"}),dayPeriod:rh({matchPatterns:$B,defaultMatchWidth:"any",parsePatterns:PB,defaultParseWidth:"any"})},TB={code:"en-US",formatDistance:eB,formatLong:rB,formatRelative:iB,localize:fB,match:EB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _B(s){const t=Ra(s);return GW(t,XW(t))+1}function IB(s){const t=Ra(s),n=+u0(t)-+ZW(t);return Math.round(n/z$)+1}function W$(s,t){var m,g,y,b;const n=Ra(s),r=n.getFullYear(),a=rg(),o=(t==null?void 0:t.firstWeekContainsDate)??((g=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(y=a.locale)==null?void 0:y.options)==null?void 0:b.firstWeekContainsDate)??1,c=ul(s,0);c.setFullYear(r+1,0,o),c.setHours(0,0,0,0);const u=Hh(c,t),h=ul(s,0);h.setFullYear(r,0,o),h.setHours(0,0,0,0);const x=Hh(h,t);return n.getTime()>=u.getTime()?r+1:n.getTime()>=x.getTime()?r:r-1}function DB(s,t){var u,h,x,m;const n=rg(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(x=n.locale)==null?void 0:x.options)==null?void 0:m.firstWeekContainsDate)??1,a=W$(s,t),o=ul(s,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),Hh(o,t)}function OB(s,t){const n=Ra(s),r=+Hh(n,t)-+DB(n,t);return Math.round(r/z$)+1}function on(s,t){const n=s<0?"-":"",r=Math.abs(s).toString().padStart(t,"0");return n+r}const So={y(s,t){const n=s.getFullYear(),r=n>0?n:1-n;return on(t==="yy"?r%100:r,t.length)},M(s,t){const n=s.getMonth();return t==="M"?String(n+1):on(n+1,2)},d(s,t){return on(s.getDate(),t.length)},a(s,t){const n=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(s,t){return on(s.getHours()%12||12,t.length)},H(s,t){return on(s.getHours(),t.length)},m(s,t){return on(s.getMinutes(),t.length)},s(s,t){return on(s.getSeconds(),t.length)},S(s,t){const n=t.length,r=s.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return on(a,t.length)}},au={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mw={G:function(s,t,n){const r=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(s,t,n){if(t==="yo"){const r=s.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return So.y(s,t)},Y:function(s,t,n,r){const a=W$(s,r),o=a>0?a:1-a;if(t==="YY"){const c=o%100;return on(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):on(o,t.length)},R:function(s,t){const n=q$(s);return on(n,t.length)},u:function(s,t){const n=s.getFullYear();return on(n,t.length)},Q:function(s,t,n){const r=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return on(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(s,t,n){const r=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return on(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(s,t,n){const r=s.getMonth();switch(t){case"M":case"MM":return So.M(s,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(s,t,n){const r=s.getMonth();switch(t){case"L":return String(r+1);case"LL":return on(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(s,t,n,r){const a=OB(s,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):on(a,t.length)},I:function(s,t,n){const r=IB(s);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):on(r,t.length)},d:function(s,t,n){return t==="do"?n.ordinalNumber(s.getDate(),{unit:"date"}):So.d(s,t)},D:function(s,t,n){const r=_B(s);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):on(r,t.length)},E:function(s,t,n){const r=s.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(s,t,n,r){const a=s.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return on(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,n,r){const a=s.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return on(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,n){const r=s.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return on(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(s,t,n){const a=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(s,t,n){const r=s.getHours();let a;switch(r===12?a=au.noon:r===0?a=au.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,n){const r=s.getHours();let a;switch(r>=17?a=au.evening:r>=12?a=au.afternoon:r>=4?a=au.morning:a=au.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(s,t,n){if(t==="ho"){let r=s.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return So.h(s,t)},H:function(s,t,n){return t==="Ho"?n.ordinalNumber(s.getHours(),{unit:"hour"}):So.H(s,t)},K:function(s,t,n){const r=s.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):on(r,t.length)},k:function(s,t,n){let r=s.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):on(r,t.length)},m:function(s,t,n){return t==="mo"?n.ordinalNumber(s.getMinutes(),{unit:"minute"}):So.m(s,t)},s:function(s,t,n){return t==="so"?n.ordinalNumber(s.getSeconds(),{unit:"second"}):So.s(s,t)},S:function(s,t){return So.S(s,t)},X:function(s,t,n){const r=s.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return fw(r);case"XXXX":case"XX":return Uc(r);case"XXXXX":case"XXX":default:return Uc(r,":")}},x:function(s,t,n){const r=s.getTimezoneOffset();switch(t){case"x":return fw(r);case"xxxx":case"xx":return Uc(r);case"xxxxx":case"xxx":default:return Uc(r,":")}},O:function(s,t,n){const r=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+hw(r,":");case"OOOO":default:return"GMT"+Uc(r,":")}},z:function(s,t,n){const r=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+hw(r,":");case"zzzz":default:return"GMT"+Uc(r,":")}},t:function(s,t,n){const r=Math.trunc(s.getTime()/1e3);return on(r,t.length)},T:function(s,t,n){const r=s.getTime();return on(r,t.length)}};function hw(s,t=""){const n=s>0?"-":"+",r=Math.abs(s),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+t+on(o,2)}function fw(s,t){return s%60===0?(s>0?"-":"+")+on(Math.abs(s)/60,2):Uc(s,t)}function Uc(s,t=""){const n=s>0?"-":"+",r=Math.abs(s),a=on(Math.trunc(r/60),2),o=on(r%60,2);return n+a+t+o}const pw=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},B$=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},FB=(s,t)=>{const n=s.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return pw(s,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",pw(r,t)).replace("{{time}}",B$(a,t))},RB={p:B$,P:FB},MB=/^D+$/,LB=/^Y+$/,VB=["D","DD","YY","YYYY"];function UB(s){return MB.test(s)}function zB(s){return LB.test(s)}function qB(s,t,n){const r=WB(s,t,n);if(console.warn(r),VB.includes(s))throw new RangeError(r)}function WB(s,t,n){const r=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const BB=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KB=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HB=/^'([^]*?)'?$/,GB=/''/g,ZB=/[a-zA-Z]/;function zl(s,t,n){var m,g,y,b;const r=rg(),a=r.locale??TB,o=r.firstWeekContainsDate??((g=(m=r.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,c=r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,u=Ra(s);if(!QW(u))throw new RangeError("Invalid time value");let h=t.match(KB).map(w=>{const N=w[0];if(N==="p"||N==="P"){const k=RB[N];return k(w,a.formatLong)}return w}).join("").match(BB).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const N=w[0];if(N==="'")return{isToken:!1,value:YB(w)};if(mw[N])return{isToken:!0,value:w};
725if(N.match(ZB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(h=a.localize.preprocessor(u,h));const x={firstWeekContainsDate:o,weekStartsOn:c,locale:a};return h.map(w=>{if(!w.isToken)return w.value;const N=w.value;(zB(N)||UB(N))&&qB(N,t,String(s));const k=mw[N[0]];return k(u,N,a.localize,x)}).join("")}function YB(s){const t=s.match(HB);return t?t[1].replace(GB,"'"):s}function xw(){const{data:s,isLoading:t}=nt({queryKey:["/api/admin/contracts"]});if(t)return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"h-8 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[...Array(4)].map((c,u)=>e.jsx("div",{className:"h-24 bg-gray-200 rounded animate-pulse"},u))}),e.jsx("div",{className:"h-96 bg-gray-200 rounded animate-pulse"})]});const n=s==null?void 0:s.stats,r=(s==null?void 0:s.contracts)||[],o=(c=>{switch(c){case"phase1":return{label:"Phase 1: Banner Display",color:"bg-blue-100 text-blue-800"};case"phase2":return{label:"Phase 2: Bypassable Modal",color:"bg-yellow-100 text-yellow-800"};case"phase3":return{label:"Phase 3: Portal Lockout",color:"bg-red-100 text-red-800"};default:return{label:"Pre-Phase 1",color:"bg-gray-100 text-gray-800"}}})((n==null?void 0:n.currentPhase)||"");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Contract Tracking"}),e.jsx("p",{className:"text-gray-600 mt-1",children:"Ahern Academy 2025 Contract Renewal Status"})]}),e.jsx(we,{className:`${o.color} font-medium px-3 py-1`,children:o.label})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Families"}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:(n==null?void 0:n.totalFamilies)||0})]}),e.jsx(Ms,{className:"h-8 w-8 text-blue-600"})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Signed Contracts"}),e.jsx("p",{className:"text-3xl font-bold text-green-600",children:(n==null?void 0:n.signedContracts)||0})]}),e.jsx(As,{className:"h-8 w-8 text-green-600"})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Pending Contracts"}),e.jsx("p",{className:"text-3xl font-bold text-orange-600",children:(n==null?void 0:n.pendingContracts)||0})]}),e.jsx(ys,{className:"h-8 w-8 text-orange-600"})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Completion Rate"}),e.jsxs("p",{className:"text-3xl font-bold text-purple-600",children:[n!=null&&n.totalFamilies?Math.round(n.signedContracts/n.totalFamilies*100):0,"%"]})]}),e.jsx(Js,{className:"h-8 w-8 text-purple-600"})]})})})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-5 w-5"}),"Contract Status by Family"]})}),e.jsx(Se,{children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"Family"}),e.jsx(zt,{children:"Email"}),e.jsx(zt,{children:"Ahern Students"}),e.jsx(zt,{children:"Status"}),e.jsx(zt,{children:"Signed Date"}),e.jsx(zt,{children:"Signed By"}),e.jsx(zt,{children:"Photo Release"})]})}),e.jsx(dl,{children:r.map(c=>{var u;return e.jsxs(Un,{children:[e.jsxs(Vt,{className:"font-medium",children:[c.familyName,((u=c.renewalRecord)==null?void 0:u.contractVersion)==="2025.1"&&e.jsx("span",{className:"ml-2 text-sm text-blue-600 font-medium",children:"(Updated)"})]}),e.jsx(Vt,{children:c.email}),e.jsx(Vt,{children:e.jsx("div",{className:"space-y-1",children:c.ahernStudents.map(h=>e.jsx("div",{className:"text-sm text-gray-600",children:h.name},h.id))})}),e.jsx(Vt,{children:e.jsx(we,{className:c.contractStatus==="signed"?"bg-green-100 text-green-800 hover:bg-green-100":"bg-orange-100 text-orange-800 hover:bg-orange-100",children:c.contractStatus==="signed"?"Signed":"Pending"})}),e.jsx(Vt,{children:c.signedDate?zl(new Date(c.signedDate),"MMM d, yyyy"):"-"}),e.jsx(Vt,{children:c.signedBy||"-"}),e.jsx(Vt,{children:c.contractStatus==="signed"?c.photoReleaseConsent?e.jsx(we,{className:"bg-green-100 text-green-800 hover:bg-green-100",children:"Granted"}):e.jsx(we,{className:"bg-gray-100 text-gray-800 hover:bg-gray-100",children:"Declined"}):"-"})]},c.familyId)})})]})})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Qr,{className:"h-5 w-5"}),"Phase Information"]})}),e.jsx(Se,{children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-blue-600",children:"Phase 1: Dashboard Banner"}),e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Through August 15, 2025"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Friendly reminder banner for families"})]}),e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-yellow-600",children:"Phase 2: Bypassable Modal"}),e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"August 16 - September 1, 2025"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Modal at login
725with skip option"})]}),e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-red-600",children:"Phase 3: Portal Lockout"}),e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"September 2 - December 15, 2025"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Contract signing required for portal access"})]})]})})})]})]})}function gw(){const[,s]=hl(),{toast:t}=Is(),[n,r]=p.useState(!1),[a,o]=p.useState("150.00"),[c,u]=p.useState(null),[h,x]=p.useState(null),[m,g]=p.useState(null),[y,b]=p.useState(!1),[w,N]=p.useState(null);p.useEffect(()=>{k()},[]);const k=async()=>{try{const M=await(await st("GET","/api/square-config")).json();if(g(M),!window.Square){t({title:"Payment System Loading",description:"Please wait while we load the payment system..."});return}const L=window.Square.payments(M.applicationId);u(L);const B=await L.card();await B.attach("#card-container"),x(B)}catch(P){console.error("Square initialization error:",P),t({title:"Payment System Error",description:"Unable to load payment system. Please refresh the page.",variant:"destructive"})}},E=async P=>{var M;if(P.preventDefault(),!h||!c){t({title:"Payment Error",description:"Payment system not ready. Please refresh the page.",variant:"destructive"});return}r(!0);try{const L=await h.tokenize();if(L.status==="OK"){const B=await st("POST","/api/create-payment-intent",{amount:parseFloat(a),sourceId:L.token}),z=await B.json();if(B.ok)N(z),b(!0),t({title:"Payment Successful",description:`Payment of $${a} has been processed successfully.`});else throw new Error(z.message||"Payment failed")}else throw new Error("Card tokenization failed: "+((M=L.errors)==null?void 0:M.map(B=>B.message).join(", ")))}catch(L){console.error("Payment error:",L),t({title:"Payment Failed",description:L.message||"An error occurred while processing your payment.",variant:"destructive"})}finally{r(!1)}};return y&&w?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 p-4",children:e.jsx("div",{className:"max-w-md mx-auto pt-20",children:e.jsxs(Ce,{className:"shadow-lg",children:[e.jsxs(Ve,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:e.jsx(As,{className:"w-8 h-8 text-green-600"})}),e.jsx(Ue,{className:"text-2xl text-green-800",children:"Payment Successful!"})]}),e.jsxs(Se,{className:"space-y-4 text-center",children:[e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Amount Paid"}),e.jsxs("p",{className:"text-2xl font-bold text-gray-900",children:["$",a]})]}),e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Payment ID"}),e.jsx("p",{className:"text-xs font-mono text-gray-800 break-all",children:w.paymentId})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{onClick:()=>s("/dashboard"),className:"w-full",children:"Return to Dashboard"}),e.jsx(F,{variant:"outline",onClick:()=>window.print(),className:"w-full",children:"Print Receipt"})]})]})]})})}):e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 p-4",children:e.jsxs("div",{className:"max-w-md mx-auto pt-10",children:[e.jsxs(F,{variant:"ghost",onClick:()=>s("/payments"),className:"mb-6",children:[e.jsx(Mu,{className:"w-4 h-4 mr-2"}),"Back to Payments"]}),e.jsxs(Ce,{className:"shadow-lg",children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Or,{className:"w-5 h-5"}),"Secure Payment"]}),e.jsx("p",{className:"text-sm text-gray-600",children:"Pay your AACvoices tuition securely with Square"})]}),e.jsx(Se,{children:e.jsxs("form",{onSubmit:E,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"amount",children:"Payment Amount"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),e.jsx(je,{id:"amount",type:"number",step:"0.01",min:"1",value:a,onChange:P=>o(P.target.value),className:"pl-8",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{children:"Card Information"}),e.jsxs("div",{id:"card-container",className:"p-4 border rounded-lg bg-white min-h-[60
725px] flex items-center justify-center",style:{minHeight:"60px"},children:[!m&&e.jsx("div",{className:"text-gray-500 text-sm",children:"Loading payment form..."}),m&&!h&&e.jsx("div",{className:"text-gray-500 text-sm",children:"Initializing secure payment..."})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[e.jsx(N2,{className:"w-4 h-4"}),e.jsx("span",{children:"Your payment information is encrypted and secure"})]}),e.jsx(F,{type:"submit",disabled:n||!h,className:"w-full",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full mr-2"}),"Processing Payment..."]}):`Pay $${a}`}),e.jsx("p",{className:"text-xs text-gray-500 text-center",children:"By completing this payment, you agree to AAC Voices terms of service. Powered by Square."})]})})]})]})})}function yw(){var k,E,P,M,L,B,z;const[s,t]=p.useState(""),[n,r]=p.useState(!1),[a,o]=p.useState(!1),[c,u]=p.useState(null),[h,x]=p.useState(null),{toast:m}=Is(),g=H=>{var U;const T=(U=H.target.files)==null?void 0:U[0];if(T&&T.type==="text/csv"){const _=new FileReader;_.onload=se=>{var W;const ae=(W=se.target)==null?void 0:W.result;t(ae),m({title:"File uploaded",description:`Loaded ${T.name} successfully`})},_.readAsText(T)}else m({title:"Invalid file",description:"Please select a CSV file",variant:"destructive"})},y=H=>{var _,se,ae,W;const T=H.trim().split(` 726`),U=[];if(T[0]&&T[0].includes("Order,Order Date,Currency")){const J=T[0].split(","),ne=J.indexOf("Order Date"),le=J.indexOf("Order Total"),V=J.indexOf("Recipient Email"),Z=J.indexOf("Order");for(let ue=1;ue<T.length;ue++){const ge=T[ue];if(ge.trim())try{const G=ge.split(",");if(G.length<J.length)continue;const Ae=(_=G[ne])==null?void 0:_.trim(),Fe=parseFloat(((se=G[le])==null?void 0:se.trim())||"0"),be=(ae=G[V])==null?void 0:ae.trim(),Me=(W=G[Z])==null?void 0:W.trim();Ae&&Fe>0&&be&&U.push({id:Me||`square-${Date.now()}-${Math.random()}`,date:Ae.replace(/\//g,"-"),amount:Fe,email:be,description:`Square Payment - $${Fe}`,status:"completed"})}catch{console.warn("Failed to parse Square CSV line:",ge)}}}
726else for(const J of T)if(J.trim())try{if(J.includes(",")){const ne=J.split(",").map(le=>le.trim().replace(/"/g,""));ne.length>=3&&U.push({id:ne[4]||`manual-${Date.now()}-${Math.random()}`,date:ne[0],amount:parseFloat(ne[1].replace("$","")),email:ne[2],description:ne[3]||"",status:ne[5]||"completed"})}else if(J.toLowerCase().includes("amount:")||J.includes("$")){const ne=J.match(/\$?(\d+(?:\.\d{2})?)/),le=J.match(/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/),V=J.match(/(\d{4}-\d{2}-\d{2})/);ne&&U.push({id:`manual-${Date.now()}-${Math.random()}`,amount:parseFloat(ne[1]),email:(le==null?void 0:le[1])||"",date:(V==null?void 0:V[1])||new Date().toISOString().split("T")[0],description:J,status:"completed"})}}catch{console.warn("Failed to parse line:",J)}return U},b=async()=>{var H,T;if(!s.trim()){m({title:"No Data",description:"Please enter Square payment data to reconcile.",variant:"destructive"});return}r(!0);try{const U=y(s);if(U.length===0)throw new Error("No valid payment data found in the input");const _=await st("POST","/api/payments/reconcile",{squarePayments:U});u(_),m({title:"Reconciliation Complete",description:`Found ${((H=_.missing)==null?void 0:H.length)||0} missing payments, created ${((T=_.created)==null?void 0:T.length)||0} records.`,className:"border-l-4 border-l-aac-blue bg-aac-blue/10"})}catch(U){console.error("Reconciliation error:",U),m({title:"Reconciliation Failed",description:U.message||"Failed to process payment data",variant:"destructive"})}finally{r(!1)}},w=H=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(H),N=H=>new Date(H).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return e.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(xr,{className:"h-6 w-6 text-aac-blue"}),e.jsx("h1",{className:"text-2xl font-bold text-charcoal-gray",children:"Payment Reconciliation"})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center space-x-2",children:[e.jsx(gr,{className:"h-5 w-5"}),e.jsx("span",{children:"Square Payment Data"})]}),e.jsx(rn,{children:"Enter Square payment data to identify missing payment records. Supports multiple formats:"}),e.jsxs("div",{className:"text-sm text-gray-600 space-y-1",children:[e.jsxs("div",{children:["⢠",e.jsx("strong",{children:"CSV:"})," date,amount,email,description,id,status"]}),e.jsxs("div",{children:["⢠",e.jsx("strong",{children:"Manual:"})," Amount: $475, Email: [email protected], Date: 2025-06-28"]}),e.jsxs("div",{children:["⢠",e.jsx("strong",{children:"Simple:"})," $475 [email protected] 2025-06-28"]})]})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Upload CSV File or Paste Data:"}),e.jsx("input",{type:"file",accept:".csv",onChange:g,className:"mb-2 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Or paste CSV data below:"})]}),e.jsx(Pt,{placeholder:`Paste your Square CSV export data here... 727 728The tool automatically detects Square's CSV format with headers like: 729Order,Order Date,Currency,Order Subtotal,Order Total,Recipient Email... 730 731Just copy and paste the entire CSV content from your Square export!`,value:s,onChange:H=>t(H.target.value),className:"min-h-[200px] font-mono text-sm"}),e.jsx(F,{onClick:b,disabled:n||!s.trim(),className:"w-full",children:n?"Processing...":"Reconcile Payments"})]})]}),c&&e.jsx("div",{className:"space-y-4",children:e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{children:"Reconciliation Results"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"text-center p-4 bg-green-50 rounded-lg",children:[e.jsx(As,{className:"h-8 w-8 text-green-600 mx-auto mb-2"}),e.jsx("div",{className:"text-2xl font-bold text-green-700",children:((k=c.matched)==null?void 0:k.length)||0}),e.jsx("div",{className:"text-sm text-green-600",children:"Already Recorded"})]}),e.jsxs("div",{className:"text-center p-4 bg-orange-50 rounded-lg",children:[e.jsx(rl,{className:"h-8 w-8 text-orange-600 mx-auto mb-2"}),e.jsx("div",{className:"text-2xl font-bold text-orange-700",children:((E=c.missing)==null?void 0:E.length)||0}),e.jsx("div",{className:"text-sm text-orange-600",children:"Missing Payments"})]}),e.jsxs("div",{className:"text-center p-4 bg-blue-50 rounded-lg",children:[e.jsx(gr,{className:"h-8 w-8 text-blue-600 mx-auto mb-2"}),e.jsx("div",{className:"text-2xl font-bold text-blue-700",children:((P=c.created)==null?void 0:P.length)||0}),e.jsx("div",{className:"text-sm text-blue-600",children:"Records Created"})]})]}),c.errors&&c.errors.length>0&&e.jsxs(B0,{children:[e.jsx(rl,{className:"h-4 w-4"}),e.jsxs(K0,{children:[e.jsx("strong",{children:"Errors encountered:"}),e.jsx("ul",{className:"mt-2 space-y-1",children:c.errors.map((H,T)=>e.jsxs("li",{className:"text-sm",children:["⢠",H]},T))})]})]}),c.created&&c.created.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(gu,{}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold mb-3 text-charcoal-gray",children:["Created Payment Records (",((M=c.created)==null?void 0:M.length)||0,")"]}),e.jsx("div",{className:"space-y-2",children:(L=c.created)==null?void 0:L.map((H,T)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:H.familyName}),e.jsx("div",{className:"text-sm text-gray-600",children:H.description}),e.jsxs("div",{className:"text-sm text-gray-500",children:[N(H.dueDate)," ⢠Payment ID: ",H.id]})]}),e.jsx(we,{variant:"outline",className:"bg-green-100 text-green-700",children:w(parseFloat(H.amount))})]},T))})]})]}),c.missing&&c.missing.length>0&&(!c.created||c.created.length===0)&&e.jsxs(e.Fragment,{children:[e.jsx(gu,{}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold mb-3 text-charcoal-gray",children:["Missing Payments (Could Not Match) (",((B=c.missing)==null?void 0:B.length)||0,")"]}),e.jsx("div",{className:"space-y-2",children:(z=c.missing)==null?void 0:z.map((H,T)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-orange-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:H.email||"Unknown Email"}),e.jsx("div",{className:"text-sm text-gray-600",children:H.description}),e.jsxs("div",{className:"text-sm text-gray-500",children:[N(H.date)," ⢠Square ID: ",H.id]})]}),e.jsx(we,{variant:"outline",className:"bg-orange-100 text-orange-700",children:w(H.amount)})]},T))})]})]})]})]})})]})}function QB(){const[s,t]=p.useState(!1),{data:n,isLoading:r}=nt({queryKey:["/api/admin/enrollment-payment-dashboard"],enabled:!s}
731),{data:a,isLoading:o}=nt({queryKey:["/api/admin/enrollment-payment-dashboard-v2"],enabled:s}),c=s?a:n,u=s?o:r,h=x=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(x);return e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-3xl font-bold text-aac-neutral-800 mb-2",children:["Payment Reconciliation Test - ",s?"V2 (Family/Session)":"V1 (Per Enrollment)"]}),e.jsx("p",{className:"text-aac-neutral-600 text-lg mb-4",children:"Compare the old per-enrollment view with the new family/session grouping"}),e.jsxs("div",{className:"flex gap-4 mb-6",children:[e.jsx(F,{onClick:()=>t(!1),variant:s?"outline":"default",children:"V1: Per Enrollment (Current)"}),e.jsx(F,{onClick:()=>t(!0),variant:s?"default":"outline",children:"V2: Family/Session Groups (New)"})]}),e.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg mb-6",children:[e.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"Data Summary:"}),e.jsx("p",{className:"text-blue-800",children:s?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"V2 Logic:"})," Groups by family + session + program type. No artificial payment division. Shows ",(a==null?void 0:a.length)||0," family/session groups."]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"V1 Logic:"})," One row per enrollment. Divides family payments evenly across enrollments. Shows ",(n==null?void 0:n.length)||0," enrollment records."]})})]})]}),u?e.jsx("div",{className:"flex justify-center p-8",children:"Loading reconciliation data..."}):!c||c.length===0?e.jsx("div",{className:"text-center p-8 text-gray-500",children:"No data available"}):e.jsx("div",{className:"space-y-4",children:c.map((x,m)=>e.jsxs(Ce,{className:"border border-gray-200",children:[e.jsx(Ve,{className:"pb-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx(Ue,{className:"text-lg text-aac-neutral-800",children:x.familyName}),e.jsx("div",{className:"text-sm text-aac-neutral-600 space-y-1",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Session:"})," ",x.sessionName]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Program:"})," ",x.programType]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Students:"})," ",x.studentNames]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Enrollments:"})," ",x.enrollmentCount]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Student:"})," ",x.studentName]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Session:"})," ",x.sessionName]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Class:"})," ",x.className]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Ahern Academy:"})," ",x.isAhernAcademy?"Yes":"No"]})]})})]}),e.jsx("div",{className:"text-right",children:e.jsx(we,{variant:"outline",className:"mb-2",children:x.reconciliationStatus||x.enrollmentStatus})})]})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4 bg-gray-50 rounded-lg",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-semibold text-aac-neutral-800",children:h(s?x.totalExpectedCost:x.expectedCost)}),e.jsx("div",{className:"text-xs text-aac-neutral-600",children:"Expected"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-semibold text-green-600",children:h(s?x.totalPaidAmount:x.totalPaymentsReceived)}),e.jsx("div",{className:"text-xs text-aac-neutral-600",children:"Paid"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-lg font-semibold ${x.balanceDue>0?"text-red-600":"text-aac-neutral-400"}`,children:h(x.balanceDue)}),e.jsx("div",{className:"text-xs text-aac-neutral-600",children:"Balance Due"})]})]}),s&&x.enrollments&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-aac-neutral-800 mb-2",children:"Enrollment Details:"}),e.jsx("div",{className:"space-y-2",children:x.enrollments.map((g,y)=>e.jsxs("div",{className:"p-3 border border-gray-200 rounded-lg text-sm",children:[e.jsxs("div",{className:"font-medium text-aac-neutral-800",children:[g.studentName," - ",g.className]}),e.jsxs("div",{className:"text-aac-neutral-600",children:[g.timeSlot," ⢠Status: ",g.status]})]},y))})]}),x.payments&&x.payments.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-aac-neutral-800 mb-2",children:["Payments (",x.payments.length,"):"]}),e.jsxs("div",{className:"text-sm text-aac-neutral-600",children:["Total: ",h(x.payments.reduce((g,y)=>
731g+y.amount,0))]})]})]})]},s?x.groupKey:x.enrollmentId||m))})]})}const XB=te.object({studentId:te.string().min(1,"Student is required"),classId:te.string().min(1,"Class is required"),notes:te.string().optional()});function vw(){const[s,t]=p.useState(null),{toast:n}=Is(),{data:r,isLoading:a}=nt({queryKey:["/api/families"]}),{data:o,isLoading:c}=nt({queryKey:["/api/classes"]}),u=Da({resolver:Oa(XB),defaultValues:{studentId:"",classId:"",notes:""}}),h=bt({mutationFn:async b=>{var N;return(await st("POST","/api/registrations",{studentId:parseInt(b.studentId),classId:parseInt(b.classId),familyId:(N=r==null?void 0:r[0])==null?void 0:N.id,notes:b.notes})).json()},onSuccess:b=>{Xi.invalidateQueries({queryKey:["/api/registrations"]}),Xi.invalidateQueries({queryKey:["/api/classes"]}),b.waitlisted?n({title:"Added to Waitlist",description:"Class is full. You've been added to the waitlist.",variant:"destructive"}):n({title:"Registration Successful!",description:b.payment?`Payment of $${b.payment.amount} has been automatically created.`:"Registration confirmed."}),u.reset(),t(null)},onError:b=>{n({title:"Registration Failed",description:b.message||"Failed to register for class",variant:"destructive"})}}),x=b=>{h.mutate(b)},m=b=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(b),g=b=>{switch(b.serviceType){case"open_enrollment":return 40;case"ahern_academy":return 475;case"young_adult_chat":return 130;case"saturday_class":return b.weekCount===6?120:100;case"one_on_one":return 125;default:return 0}},y=b=>{const w=b.capacity-b.enrolled;return w<=0?e.jsx(we,{variant:"destructive",children:"Full - Waitlist Available"}):w<=2?e.jsxs(we,{variant:"outline",className:"border-orange-400 text-orange-700",children:[w," spots left"]}):e.jsxs(we,{variant:"outline",className:"border-green-400 text-green-700",children:[w," spots available"]})};return a||c?e.jsx("div",{className:"h-screen flex items-center justify-center",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-primary border-t-transparent rounded-full"})}):e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Pn,{className:"w-8 h-8 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Class Registration"}),e.jsx("p",{className:"text-muted-foreground",children:"Register your student for AAC Voices classes"})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"w-5 h-5"}),"Available Classes"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a class to see details and register"})]}),e.jsxs(Se,{className:"space-y-4",children:[o==null?void 0:o.map(b=>e.jsxs("div",{className:`p-4 border rounded-lg cursor-pointer transition-colors hover:bg-gray-50 ${(s==null?void 0:s.id)===b.id?"border-primary bg-primary/5":""}`,onClick:()=>t(b),children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:b.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["with ",b.instructor]})]}),y(b)]}),b.description&&e.jsx("p",{className:"text-sm mb-3",children:b.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{children:b.schedule})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xr,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{children:m(g(b))})]}),b.ageRange&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ti,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("span",{children:["Ages ",b.ageRange]})]}),b.startDate&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(an,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("span",{children:["Starts ",new Date(b.startDate).toLocaleDateString()]})]})]}),b.prerequisites&&e.jsx("div",{className:"mt-3 p-2 bg-yellow-50 rounded border-l-4 border-yellow-400",children:e.jsxs("p",{className:"text-sm text-yellow-800",children:[e.jsx("strong",{children:"Prerequisites:"})," ",b.prerequisites]})})]},b.id)),!(o!=null&&o.length)&&e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Pn,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No classes available for registration at this time."})]})]})]})}),e.jsx("div",{children:e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-5 h-5"}),"Register Student"]})}),e.jsx(Se,{children:s?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.schedule}),e.jsx("p",{className:"text-sm font-medium text-green-600",children:m(g(s))})]}),e.jsx(Fa,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(x),className:"space-y-4",children:[e.jsx(Ke,{control:u.control,name:"studentId",render:({field:b})=>{var w,N;return e.jsxs(We,{children:[e.jsx(ze,{children:"Select Student"}),e.jsxs(St,{onValueChange:b.onChange,defaultValue:b.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Choose student"})})}),e.jsx(Ct,{children:(N=(w=r==null?void 0:r[0])==null?void 0:w.students)==null?void 0:N.map(k=>
731e.jsxs(ce,{value:k.id.toString(),children:[k.name," (Age ",k.age,")"]},k.id))})]}),e.jsx(Ye,{})]})}}),e.jsx(Ke,{control:u.control,name:"notes",render:({field:b})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Notes (Optional)"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Any special considerations...",...b})}),e.jsx(Ye,{})]})}),e.jsx("input",{type:"hidden",...u.register("classId"),value:s.id}),e.jsxs("div",{className:"pt-4 border-t",children:[e.jsxs("div",{className:"flex items-start gap-2 mb-4 p-3 bg-blue-50 rounded-lg",children:[e.jsx(Qr,{className:"w-4 h-4 text-blue-600 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-800",children:[e.jsx("p",{className:"font-medium",children:"Automatic Payment"}),e.jsxs("p",{children:["A payment of ",m(g(s))," will be automatically created upon registration. You can pay online to avoid the $100 invoicing fee."]})]})]}),e.jsx(F,{type:"submit",disabled:h.isPending,className:"w-full",children:h.isPending?"Registering...":"Register Student"})]})]})})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Pn,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a class from the list to register your student."})]})})]})})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsx(Ue,{children:"AAC Voices Class Information"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Understanding our class structure and pricing"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-green-800 mb-2",children:"Open Enrollment Classes"}),e.jsxs("div",{className:"text-sm text-green-700 space-y-1",children:[e.jsx("p",{children:e.jsx("strong",{children:"Core Classes:"})}),e.jsx("p",{children:"⢠Shared Reading - Interactive reading sessions"}),e.jsx("p",{children:"⢠Writing Workshop - AAC-supported writing development"}),e.jsx("p",{children:"⢠Elective (rotates by trimester):"}),e.jsxs("div",{className:"ml-4 space-y-1",children:[e.jsx("p",{children:"⦠Fall: Science"}),e.jsx("p",{children:"⦠Spring: Social Studies"}),e.jsx("p",{children:"⦠Summer: Talker Power (AAC Competencies)"})]})]}),e.jsx("p",{className:"text-sm font-medium mt-2",children:"Pricing: $40-100/week depending on number of classes"})]}),e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-blue-800",children:"Ahern Academy Students"}),e.jsx("p",{className:"text-sm text-blue-700",children:"All weekday classes included in tuition"}),e.jsx("p",{className:"text-sm font-medium",children:"$475/month or $1,900/trimester"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-purple-800",children:"1:1 Private Sessions"}),e.jsx("p",{className:"text-sm text-purple-700",children:"Individualized instruction"}),e.jsx("p",{className:"text-sm font-medium",children:"$125-150/session"})]}),e.jsxs("div",{className:"p-4 bg-orange-50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-orange-800",children:"Young Adult Chat Groups"}),e.jsx("p",{className:"text-sm text-orange-700",children:"Social communication groups for ages 18-25"}),e.jsx("p",{className:"text-sm font-medium",children:"$130/week"})]}),e.jsxs("div",{className:"p-4 bg-yellow-50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-yellow-800",children:"Saturday Workshops"}),e.jsx("p",{className:"text-sm text-yellow-700",children:"Intensive skills building sessions"}),e.jsx("p",{className:"text-sm font-medium",children:"$100-120 for 5-6 week series"})]})]})]}),e.jsx("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border-l-4 border-blue-400",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Qr,{className:"w-5 h-5 text-blue-600 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Self-Service Payment Advantage"}),e.jsx("p",{children:"Register and pay online to avoid the $100 invoicing fee. Payments are automatically generated
731when you register for classes, and you can pay immediately through the secure payment portal."})]})]})})]})]})]})}function $1(){var Fe;const[s,t]=p.useState(null),[n,r]=p.useState(null),[a,o]=p.useState("sessions"),[c,u]=p.useState(!1),[h,x]=p.useState(""),{toast:m}=Is(),g=dn();p.useEffect(()=>{g.invalidateQueries({queryKey:["/api/class-rosters"]}),g.removeQueries({queryKey:["/api/class-rosters"]})},[g]);const y=be=>{var K,xe;const Me=new Date,R=new Date(be.startDate),re=new Date(be.endDate),O=new Date(Me.getTime()-300*60*1e3),me=new Date(R),Y=me.getUTCDay(),Te=Y===6?1:(Y+2)%7;me.setUTCDate(me.getUTCDate()-Te),me.setUTCHours(23,0,0,0);const Be=new Date(re),ht=Be.getUTCDay(),Mt=ht===6?0:(5-ht+7)%7;return ht!==6&&Be.setUTCDate(Be.getUTCDate()+Mt),Be.setUTCHours(23,0,0,0),((K=be.schedule)==null?void 0:K.toLowerCase().includes("saturday"))||((xe=be.description)==null?void 0:xe.toLowerCase().includes("saturday"))?Me>=re?"archived":Me>=R?"active":"enrolling":O>=Be?"archived":O>=me?"active":"enrolling"},{data:b=[]}=nt({queryKey:["/api/week-calendar",s],queryFn:()=>fetch(`/api/week-calendar/${s}`,{credentials:"include"}).then(be=>be.json()),enabled:!!s}),{data:w,isLoading:N}=nt({queryKey:["/api/auth/user"]}),{data:k=[],isLoading:E,error:P}=nt({queryKey:["/api/class-sessions"],enabled:!!w&&!N}),{data:M=[],isLoading:L}=nt({queryKey:["/api/class-slots"],enabled:!!w&&!N&&!!s}),{data:B=[],isLoading:z}=nt({queryKey:["/api/class-rosters",n],queryFn:async()=>{if(!n)return[];const be=await fetch(`/api/class-rosters?slotId=${n}`,{credentials:"include"});if(!be.ok)throw new Error("Failed to fetch roster");return be.json()},enabled:!!n,staleTime:0}),{data:H=[],isLoading:T}=nt({queryKey:["/api/ahern-classes"],enabled:!!w&&!N}),{data:U=[],isLoading:_,error:se}=nt({queryKey:["/api/portal/students"],enabled:!!w&&!N}),ae=(w==null?void 0:w.role)==="admin"||(w==null?void 0:w.role)==="both",{data:W=[],isLoading:J}=nt({queryKey:["/api/students-with-families"],enabled:!!w&&!N&&ae}),ne=Array.isArray(U)&&U.length>0&&U.some(be=>(Array.isArray(be.studentCategories)?be.studentCategories:typeof be.studentCategories=="string"?JSON.parse(be.studentCategories||"[]"):[]).includes("Ahern Academy")),le=bt({mutationFn:async be=>{const Me=await fetch(`/api/enrollments/${be}`,{method:"DELETE",credentials:"include"});if(!Me.ok){const R=await Me.json();throw new Error(R.message||"Failed to delete enrollment")}return Me.json()},onSuccess:be=>{console.log("Delete success, data:",be),m({title:"Enrollment Removed",description:"Student successfully removed from class"}),g.invalidateQueries({queryKey:["/api/class-rosters"]}),g.removeQueries({queryKey:["/api/class-rosters",n]}),setTimeout(()=>{g.refetchQueries({queryKey:["/api/class-rosters",n]})},100)},onError:be=>{m({title:"Error",description:be.message,variant:"destructive"})}}),V=bt({mutationFn:async be=>{const Me=await fetch("/api/class-enrollments",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(be)});if(!Me.ok){const R=await Me.json();throw new Error(R.message||"Failed to create enrollment")}return Me.json()},onSuccess:be=>{m({title:"Student Enrolled",description:"Student successfully enrolled in class"}),u(!1),x(""),g.invalidateQueries({queryKey:["/api/class-rosters"]}),g.removeQueries({queryKey:["/api/class-rosters"]})},onError:be=>{m({title:"Enrollment Failed",description:be.message||"Failed to enroll student",variant:"destructive"})}}),Z=()=>{if(!h||!n){m({title:"Error",description:"Please select a student",variant:"destructive"});return}const be=W.find(Me=>Me.id.toString()===h);if(!be){m({title:"Error",description:"Selected student not found",variant:"destructive"});return}V.mutate({studentId:be.id,familyId:be.familyId,slotId:n,enrollmentPeriod:"current"})},ue=M.filter(be=>be.sessionId===s),ge=be=>{switch(be){case"9am":return"bg-yellow-100 text-yellow-800";case"10am":return"bg-blue-100 text-blue-800";case"11am":return"bg-green-100 text-green-800";case"12pm":return"bg-purple-100 text-purple-800";case"1pm":return"bg-red-100 text-red-800";case"2pm":return"bg-orange-100 text-orange-800";case"3pm":return"bg-pink-100 text-pink-800";case"4pm":return"bg-indigo-100 text-indigo-800";case"yac":return"bg-teal-100 text-teal-800";default:return"bg-gray-100 text-gray-800"}},G=be=>be==="yac"?e.jsx(rd,{className:"h-4 w-4"}):e.jsx(ys,{className:"h-4 w-4"}),Ae=()=>{if(!n||!B.length)return;M.find(Y=>Y.id===n);const be=["Student Name","Age","Grade","Family Contact","Email","Payment Status","Enrolled Weeks","Special Accommodations"],Me=B.map(Y=>[Y.student.name,Y.student.age,Y.student.gradeEquivalent||"N/A",Y.family.caregiverOneName,Y.family.caregiverOneEmail,Y.enrollment.paymentStatus,Y.enrollment.enrolledWeeks?Y.enrollment.enrolledWeeks.map(Te=>{const Be=b.find(ht=>ht.weekNumber===Te);return Be?t1(Te,Be):`Week ${Te}`}).join(", "):"All weeks",Y.enrollment.specialAccommodations||"None"]),R=[be,...Me].map(Y=>Y.map(Te=>`"${Te}"`).join(",")).join(`
732`),re=new Blob([R],{type:"text/csv"}),O=window.URL.createObjectURL(re),me=document.createElement("a");me.href=O,me.download=`class-roster-${n}-${zl(new Date,"yyyy-MM-dd")}.csv`,document.body.appendChild(me),me.click(),document.body.removeChild(me),window.URL.revokeObjectURL(O)};return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:"/images/enrolllogo.png",alt:"AAC Voices Enrollment",className:"h-16 w-auto"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold tracking-tight text-[#4A4A4A]",children:"Class Enrollment"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Manage class sessions and view enrollment rosters"})]})]})}),e.jsxs(Ql,{value:a,onValueChange:o,className:"w-full",children:[e.jsxs(pl,{className:"grid w-full grid-cols-3 bg-[#77dbf6]/10 border-[#77dbf6]/20",children:[e.jsx(qs,{value:"sessions",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Class Sessions"}),e.jsx(qs,{value:"schedule",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Rosters"}),e.jsx(qs,{value:"ahern",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Ahern Academy"})]}),e.jsxs(Hs,{value:"sessions",className:"space-y-4",children:[ne&&e.jsx(Ce,{className:"bg-blue-50 border-blue-200",children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(As,{className:"h-5 w-5 text-blue-600 mt-0.5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-blue-900 mb-2",children:"Ahern Academy Students - Important Notice"}),e.jsxs("div",{className:"text-blue-800 space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Your Ahern Academy students are automatically enrolled in their literacy and math classes."}),"No further action is needed for these core classes."]}),e.jsxs("p",{children:["However, please enroll in any afternoon classes you plan to attend.",e.jsx("strong",{children:"These afternoon classes are included in your Ahern Academy tuition at no additional cost."})]})]})]})]})})}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:k==null?void 0:k.map(be=>e.jsxs(Ce,{className:`cursor-pointer transition-all duration-200 ${s===be.id?"ring-2 ring-primary bg-primary/5 border-primary shadow-md":"hover:shadow-sm hover:bg-gray-50/50"}`,onClick:()=>t(be.id),children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:e.jsx(an,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ue,{className:"text-lg",children:be.name}),e.jsx(rn,{children:be.sessionType})]})]})}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:be.description}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-medium",children:"Duration:"}),e.jsxs("span",{children:[zl(new Date(be.startDate),"MMM d")," - ",zl(new Date(be.endDate),"MMM d, yyyy")]})]}),(()=>{switch(y(be)){case"active":return e.jsx(we,{variant:"default",className:"w-full justify-center bg-green-100 text-green-800 border-green-300",children:"Currently Active"});case"enrolling":return e.jsx(we,{variant:"outline",className:"w-full justify-center bg-blue-100 text-blue-800 border-blue-300",children:"Enrolling"});case"archived":return e.jsx(we,{variant:"outline",className:"w-full justify-center bg-gray-100 text-gray-800 border-gray-300",children:"Archived"});default:return null}})(),s===be.id&&e.jsxs(F,{variant:"ghost",size:"sm",onClick:Me=>{Me.stopPropagation(),o("schedule")},className:"flex items-center text-sm text-primary font-medium p-0 h-auto hover:bg-transparent",children:[e.jsx(Rl,{className:"h-4 w-4 mr-1"}),"Go to Rosters to view classes"]}
732)]})})]},be.id))})]}),e.jsx(Hs,{value:"schedule",className:"space-y-4",children:s?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("h2",{className:"text-xl font-semibold",children:[(Fe=k.find(be=>be.id===s))==null?void 0:Fe.name," - Class Rosters"]})}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:ue==null?void 0:ue.map(be=>{var Me;return e.jsxs(Ce,{className:`cursor-pointer transition-all duration-200 ${n===be.id?"ring-2 ring-primary bg-primary/5 border-primary shadow-md":"hover:shadow-sm hover:bg-gray-50/50"}`,onClick:()=>r(be.id),children:[e.jsx(Ve,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:`p-1.5 rounded ${ge(be.timeSlot)}`,children:G(be.timeSlot)}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ue,{className:"text-sm",children:be.className}),e.jsx(rn,{className:"text-xs",children:be.timeSlot==="yac"?"Young Adult Chat":`${be.timeSlot.toUpperCase()} EST`})]})]})}),e.jsx(Se,{className:"pt-0",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:be.description}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("span",{children:["Days: ",be.days]}),e.jsxs("span",{children:["Age: ",be.ageRequirement,"+"]})]}),be.specialNotes&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Notes:"})," ",be.specialNotes]})]})}),n===be.id&&e.jsx(Se,{className:"border-t bg-slate-50/50",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold text-lg",children:"Class Roster"}),e.jsxs("div",{className:"flex gap-2",children:[ae&&e.jsxs(es,{open:c,onOpenChange:u,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{variant:"default",size:"sm",className:"bg-[#77dbf6] hover:bg-[#5DCFF2] text-white",children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Enroll Student"]})}),e.jsxs(ts,{className:"sm:max-w-[425px]",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Enroll Student in Class"}),e.jsxs(Pa,{children:["Add a student to ",((Me=M.find(R=>R.id===n))==null?void 0:Me.className)||"this class"]})]}),e.jsx("div",{className:"grid gap-4 py-4",children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(Ne,{htmlFor:"student-select",children:"Select Student"}),e.jsxs(St,{value:h,onValueChange:x,children:[e.jsx(At,{"data-testid":"select-student-enrollment",children:e.jsx(kt,{placeholder:"Choose a student..."})}),e.jsx(Ct,{children:W.map(R=>{var re;return e.jsxs(ce,{value:R.id.toString(),children:[R.name," (Family: ",((re=R.family)==null?void 0:re.caregiverOneName)||"Unknown",")"]},R.id)})})]})]})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),e.jsx(F,{onClick:Z,disabled:V.isPending||!h,"data-testid":"button-confirm-enrollment",children:V.isPending?"Enrolling...":"Enroll Student"})]})]})]}),B.length>0&&e.jsxs(F,{onClick:Ae,variant:"outline",size:"sm",children:[e.jsx(Xr,{className:"h-4 w-4 mr-2"}),"Export Roster"]})]})]}),z?e.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading roster..."}):B.length>0?e.jsx("div",{className:"space-y-2",children:B.map(R=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-3 flex-1",children:[e.jsx("div",{className:"w-8 h-8 bg-primary/10 rounded-full flex items-center justify-center text-sm font-medium",children:R.student.name.charAt(0)}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium",children:R.student.name}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Age ",R.student.age," ⢠Family: ",R.family.caregiverOneName]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const re=zu(R.enrollment.paymentStatus||"payment due");return e.jsxs(we,{variant:re.variant,className:`text-xs ${re.className}`,children:[re.text==="paid"||re.text.includes("scholarship")?e.jsx(As,{className:"w-3 h-3 mr-1 text-green-600"}):re.text==="third party"?e.jsx(xr,{className:"w-3 h-3 mr-1 text-blue-600"}):e.jsx(P0,{className:"w-3 h-3 mr-1 text-orange-600"}),re.text]})})(),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{confirm(`Remove ${R.student.name} from this class? This action cannot be undone.`)&&le.mutate(R.enrollment.id)},disabled:le.isPending,className:"h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50",title:"Remove student from class",children:e.jsx(pa,{className:"h-4 w-4"})})]})]}),R.enrollment.enrolledWeeks&&R.enrollment.enrolledWeeks.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:R.enrollment.enrolledWeeks.map(re=>{const O=b.find(me=>me.weekNumber===re);return e.jsx(we,{variant:"secondary",className:"text-xs bg-blue-100 text-blue-800",children:O?t1(re,O):`Week ${re}`},re)})})]},R.student.id))}):e.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"No students enrolled in this class yet."})]})})]},be.id)})})]}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Select a session first to view class schedules"})}),e.jsx(Hs,{value:"ahern",className:"space-y-4",children:T?e.jsx("div",{className:"text-center py-8",children:"Loading Ahern Academy classes..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Ahern Academy Morning Classes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Spring 2026 Schedule ⢠Morning classes: 9:15 AM - 12:45 PM"})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:Array.isArray(H)&&H.map(be=>{var Me;return e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ue,{className:"text-lg",children:be.name}),e.jsx(we,{variant:"outline",children:be.duration})]}),e.jsxs(rn,{children:[be.startTime," - ",be.endTime," ⢠",be.instructor]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:be.description})]}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Students:"}),e.jsxs(we,{variant:"secondary",children:[((Me=be.students)==null?void 0:Me.length)||0," enrolled"]})]}),e.jsx("div",{className:"grid gap-2",children:Array.isArray(be.students)&&be.students.map(R=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[e.jsx("div",{className:"flex flex-col",children:e.jsx("span",{className:"text-sm font-medium",children:R.name||R})}),e.jsx("div",{className:"flex items-center gap-2",children:(()=>{const re=zu(R.paymentStatus||"balance_due");return e.jsx(we,{variant:re.variant,className:`text-xs ${re.className}`,children:re.text})})()})]},R.id||R.name))})]})})]},be.id)})})]})})]})]})})}var jj="Switch",[JB]=or(jj),[eK,tK]=JB(jj),K$=p.forwardRef((s,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:c,disabled:u,value:h="on",onCheckedChange:x,form:m,...g}=s,[y,b]=p.useState(null),w=Cs(t,M=>
732b(M)),N=p.useRef(!1),k=y?m||!!y.closest("form"):!0,[E=!1,P]=ga({prop:a,defaultProp:o,onChange:x});return e.jsxs(eK,{scope:n,checked:E,disabled:u,children:[e.jsx(_t.button,{type:"button",role:"switch","aria-checked":E,"aria-required":c,"data-state":Z$(E),"data-disabled":u?"":void 0,disabled:u,value:h,...g,ref:w,onClick:ut(s.onClick,M=>{P(L=>!L),k&&(N.current=M.isPropagationStopped(),N.current||M.stopPropagation())})}),k&&e.jsx(sK,{control:y,bubbles:!N.current,name:r,value:h,checked:E,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});K$.displayName=jj;var H$="SwitchThumb",G$=p.forwardRef((s,t)=>{const{__scopeSwitch:n,...r}=s,a=tK(H$,n);return e.jsx(_t.span,{"data-state":Z$(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});G$.displayName=H$;var sK=s=>{const{control:t,checked:n,bubbles:r=!0,...a}=s,o=p.useRef(null),c=G2(n),u=T2(t);return p.useEffect(()=>{const h=o.current,x=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(x,"checked").set;if(c!==n&&g){const y=new Event("click",{bubbles:r});g.call(h,n),h.dispatchEvent(y)}},[c,n,r]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Z$(s){return s?"checked":"unchecked"}var Y$=K$,nK=G$;const m0=p.forwardRef(({className:s,...t},n)=>e.jsx(Y$,{className:pt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...t,ref:n,children:e.jsx(nK,{className:pt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));m0.displayName=Y$.displayName;const rK=te.object({title:te.string().min(1,"Title is required"),dayOfWeek:te.number().min(0).max(6,"Day of week must be 0-6"),startTime:te.string().regex(/^\d{2}:\d{2}:\d{2}$/,"Start time must be in HH:MM:SS format"),endTime:te.string().regex(/^\d{2}:\d{2}:\d{2}$/,"End time must be in HH:MM:SS format"),timeZone:te.string().min(1,"Time zone is required"),sessionDuration:te.number().min(15,"Session duration must be at least 15 minutes"),bufferTime:te.number().min(0,"Buffer time cannot be negative"),maxConcurrentSessions:te.number().min(1,"Must allow at least 1 concurrent session"),isActive:te.boolean(),isRecurring:te.boolean(),effectiveStartDate:te.string().min(1,"Start date is required"),effectiveEndDate:te.string().optional(),sessionType:te.string().min(1,"Session type is required"),notes:te.string().optional()});te.object({studentId:te.number().min(1,"Student is required"),dayOfWeek:te.number().min(0).max(6,"Day of week must be 0-6"),startTime:te.string().regex(/^\d{2}:\d{2}:\d{2}$/,"Start time must be in HH:MM:SS format"),endTime:te.string().regex(/^\d{2}:\d{2}:\d{2}$/,"End time must be in HH:MM:SS format"),timeZone:te.string().min(1,"Time zone is required"),isRecurring:te.boolean(),effectiveStartDate:te.string().min(1,"Start date is required"),effectiveEndDate:te.string().optional(),notes:te.string().optional()}).refine(s=>{const t=new Date(`2000-01-01T${s.startTime}`);return new Date(`2000-01-01T${s.endTime}`)>t},{message:"End time must be after start time",path:["endTime"]});const jw=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],aK=[{value:"1:1",label:"1:1 Sessions"},{value:"assessment",label:"Assessment"},{value:"consultation",label:"Consultation"},{value:"aac_device_programming",label:"AAC Device Programming"},{value:"group",label:"Group Session"}],iK=[{value:"America/New_York",label:"Eastern Time (ET)"},{value:"America/Chicago",label:"Central Time (CT)"},{value:"America/Denver",label:"Mountain Time (MT)"},{value:"America/Los_Angeles",label:"Pacific Time (PT)"}];
732function bw(s){if(!s||typeof s!="string")return"Invalid Time";try{const[t,n]=s.split(":").map(Number),r=new Date;return r.setHours(t,n,0,0),r.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch(t){return console.error("Error formatting time:",s,t),"Invalid Time"}}function lK(){const[s,t]=p.useState(!1),[n,r]=p.useState(null),[a,o]=p.useState(!1),[c,u]=p.useState(""),{toast:h}=Is(),x=dn(),{data:m=[],isLoading:g,error:y}=nt({queryKey:["/api/admin-availability"],retry:3}),{data:b=[],error:w}=nt({queryKey:["/api/session-appointments"],retry:3}),N=bt({mutationFn:T=>{try{return st("POST","/api/admin-availability",T)}catch(U){throw console.error("Create mutation error:",U),U}},onSuccess:()=>{try{x.invalidateQueries({queryKey:["/api/admin-availability"]}),t(!1),o(!1),h({title:"Success",description:"Availability slot created successfully"})}catch(T){console.error("Success handler error:",T)}},onError:T=>{console.error("Create availability error:",T),h({title:"Error",description:T.message||"Failed to create availability slot. Please try again.",variant:"destructive"})}}),k=bt({mutationFn:({id:T,data:U})=>{if(!T||typeof T!="number"||T<=0)throw new Error("Invalid ID for update operation");if(!U||typeof U!="object")throw new Error("Invalid data for update operation");try{return st("PUT",`/api/admin-availability/${T}`,U)}catch(_){throw console.error("Update mutation error:",_),_}},onSuccess:()=>{try{x.invalidateQueries({queryKey:["/api/admin-availability"]}),r(null),o(!1),h({title:"Success",description:"Availability slot updated successfully"})}catch(T){console.error("Update success handler error:",T)}},onError:T=>{console.error("Update availability error:",T),h({title:"Error",description:T.message||"Failed to update availability slot. Please try again.",variant:"destructive"})}}),E=bt({mutationFn:T=>{if(!T||typeof T!="number"||T<=0)throw new Error("Invalid ID for delete operation");try{return st("DELETE",`/api/admin-availability/${T}`)}catch(U){throw console.error("Delete mutation error:",U),U}},onSuccess:()=>{try{x.invalidateQueries({queryKey:["/api/admin-availability"]}),o(!1),h({title:"Success",description:"Availability slot deleted successfully"})}catch(T){console.error("Delete success handler error:",T)}},onError:T=>{console.error("Delete availability error:",T),h({title:"Error",description:T.message||"Failed to delete availability slot. Please try again.",variant:"destructive"})}}),P=Da({resolver:Oa(rK),defaultValues:{title:"",dayOfWeek:2,startTime:"18:00:00",endTime:"19:00:00",timeZone:"America/New_York",sessionDuration:60,bufferTime:0,maxConcurrentSessions:1,isActive:!0,isRecurring:!0,effectiveStartDate:new Date().toISOString().split("T")[0],sessionType:"1:1",notes:""}});Ut.useEffect(()=>{if(n)try{if(!n||typeof n!="object"){console.error("Invalid editingAvailability object:",n);return}const T={title:n.title||"",dayOfWeek:typeof n.dayOfWeek=="number"?n.dayOfWeek:2,startTime:n.startTime||"18:00:00",endTime:n.endTime||"19:00:00",timeZone:n.timeZone||"America/New_York",sessionDuration:typeof n.sessionDuration=="number"?n.sessionDuration:60,bufferTime:typeof n.bufferTime=="number"?n.bufferTime:0,maxConcurrentSessions:typeof n.maxConcurrentSessions=="number"?n.maxConcurrentSessions:1,isActive:typeof n.isActive=="boolean"?n.isActive:!0,isRecurring:typeof n.isRecurring=="boolean"?n.isRecurring:!0,effectiveStartDate:n.effectiveStartDate||new Date().toISOString().split("T")[0],effectiveEndDate:n.effectiveEndDate||"",sessionType:n.sessionType||"1:1",notes:n.notes||""};P.reset(T)}catch(T){console.error("Error resetting form for editing:",T),h({title:"Error",description:"Failed to load availability data for editing",variant:"destructive"})}},[n,P,h]);const M=T=>{if(!T||typeof T!="object"){console.error("Invalid form data:",T),h({title:"Error",description:"Invalid form data",variant:"destructive"});return}if(!T.title||T.title.trim()===""){h({title:"Error",description:"Title is required",variant:"destructive"});return}if(!T.startTime||!T.endTime){h({title:"Error",description:"Start and end times are required",variant:"destructive"});return}try{if(n){if(!n.id||typeof n.id!="number"){console.error("Invalid editing availability ID:",n.id),h({title:"Error",description:"Invalid availability slot for editing",variant:"destructive"});return}k.mutate({id:n.id,data:T})}else N.mutate(T)}catch(U){console.error("Error submitting form:",U),h({title:"Error",description:"Failed to submit form",variant:"destructive"})}},L=T=>{if(!T||typeof T!="number"||T<=0){console.error("Invalid ID for deleti
732on:",T),h({title:"Error",description:"Invalid availability slot ID",variant:"destructive"});return}if(confirm("Are you sure you want to delete this availability slot?"))try{E.mutate(T)}catch(U){console.error("Error initiating delete:",U),h({title:"Error",description:"Failed to delete availability slot",variant:"destructive"})}},B=()=>{try{r(null),o(!1);const T={title:"",dayOfWeek:2,startTime:"18:00:00",endTime:"19:00:00",timeZone:"America/New_York",sessionDuration:60,bufferTime:0,maxConcurrentSessions:1,isActive:!0,isRecurring:!0,effectiveStartDate:new Date().toISOString().split("T")[0],sessionType:"1:1",notes:""};P.reset(T),t(!0)}catch(T){console.error("Error creating new availability slot:",T),h({title:"Error",description:"Failed to open create dialog",variant:"destructive"})}},z=T=>{if(!T||typeof T!="object"){console.error("Invalid availability object for editing:",T),h({title:"Error",description:"Invalid availability data",variant:"destructive"});return}if(!T.id||typeof T.id!="number"){console.error("Invalid availability ID for editing:",T.id),h({title:"Error",description:"Cannot edit availability without valid ID",variant:"destructive"});return}try{r(T),t(!0)}catch(U){console.error("Error setting up edit:",U),h({title:"Error",description:"Failed to open edit dialog",variant:"destructive"})}},H=Ut.useMemo(()=>{const T={};
732return m?((Array.isArray(m)?m:[]).forEach((_,se)=>{if(!_||typeof _!="object"){console.warn(`Invalid slot at index ${se}:`,_);return}if(typeof _.dayOfWeek!="number"||_.dayOfWeek<0||_.dayOfWeek>6){console.warn(`Invalid dayOfWeek for slot ${_.id}:`,_.dayOfWeek);return}if(!_.startTime||typeof _.startTime!="string"){console.warn(`Invalid startTime for slot ${_.id}:`,_.startTime);return}if(!_.endTime||typeof _.endTime!="string"){console.warn(`Invalid endTime for slot ${_.id}:`,_.endTime);return}T[_.dayOfWeek]||(T[_.dayOfWeek]=[]),T[_.dayOfWeek].push(_)}),Object.keys(T).forEach(_=>{const se=parseInt(_);if(T[se]&&Array.isArray(T[se]))try{T[se]=T[se].filter(ae=>ae&&ae.startTime&&typeof ae.startTime=="string"&&ae.startTime.includes(":")).sort((ae,W)=>{try{return ae.startTime.localeCompare(W.startTime)}catch(J){return console.error("Error comparing times:",ae.startTime,W.startTime,J),0}})}catch(ae){console.error(`Error processing slots for day ${se}:`,ae),T[se]=[]}}),T):(console.warn("availabilitySlots is null or undefined"),T)},[m]);return a||y?e.jsx("div",{className:"p-6",children:e.jsx(Ce,{children:e.jsxs(Se,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"text-red-500 mb-4",children:e.jsx(an,{className:"h-12 w-12"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2 text-red-700",children:"Error Loading Calendar"}),e.jsx("p",{className:"text-gray-600 text-center mb-4",children:c||"There was a problem loading the availability calendar."}),e.jsx(F,{onClick:()=>{o(!1),u(""),x.invalidateQueries({queryKey:["/api/admin-availability"]})},className:"flex items-center gap-2",children:"Try Again"})]})})}):g?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/3"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(T=>e.jsx("div",{className:"h-48 bg-gray-200 rounded"},T))})]})}):e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Admin Availability Calendar"}),e.jsx("p",{className:"text-gray-600",children:"Manage your available time slots for 1:1 sessions and appointments"})]}),e.jsxs(F,{onClick:B,className:"flex items-center gap-2",children:[e.jsx(fa,{className:"h-4 w-4"}),"Add Availability"]})]}),!m||m.length===0?e.jsx(Ce,{children:e.jsxs(Se,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(an,{className:"h-12 w-12 text-gray-400 mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No availability slots configured"}),e.jsx("p",{className:"text-gray-600 text-center mb-4",children:"Set up your available time slots to allow families to schedule 1:1 sessions."}),e.jsxs(F,{onClick:B,className:"flex items-center gap-2",children:[e.jsx(fa,{className:"h-4 w-4"}),"Add Your First Availability"]})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:jw.map(T=>{var W,J,ne,le;const U=((W=H[T.value])==null?void 0:W.length)>0;let _=[],se=!1;try{Array.isArray(b)&&(_=b.filter(V=>!V||typeof V!="object"?!1:V.scheduledDate&&typeof V.scheduledDate=="string"),se=((J=H[T.value])==null?void 0:J.some(V=>_.some(Z=>{try{const ue=new Date(Z.scheduledDate);if(isNaN(ue.getTime())||ue.getDay()!==T.value)return!1;const ge=ue.toTimeString().substr(0,8),G=new Date(ue.getTime()+(Z.duration_minutes||60)*6e4).toTimeString().substr(0,8),Ae=V.startTime,Fe=V.endTime;return ge<Fe&&G>Ae}catch(ue){return console.warn("Error processing appointment time conflict:",Z.scheduledDate,ue),!1}})))||!1)}catch(V){console.error("Error processing appointments for day",T.value,V),se=!1}const ae=U&&!se;return e.jsxs(Ce,{className:`h-fit transition-colors ${ae?"bg-green-50 border-green-200 hover:bg-green-100":"bg-gray-50 border-gray-200 opacity-60"}`,children:[e.jsxs(Ve,{className:"pb-3",children:[e.jsx(Ue,{className:`text-lg ${ae?"text-green-800":"text-gray-500"}`,children:T.label}),e.jsxs(rn,{className:ae?"text-green-600":"text-gray-400",children:[((ne=H[T.value])==null?void 0:ne.length)||0," time slot(s)",se&&U&&" (Scheduled)"]})]}),e.jsxs(Se,{className:"space-y-3",children:[(le=H[T.value])==null?void 0:le.map(V=>{var Z;return!V||typeof V!="object"||!V.id?(console.warn("Invalid slot data:",V),null):e.jsxs("div",{className:"border border-green-300 rounded-lg p-3 space-y-2 bg-white shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium text-sm text-green-900",children:V.title||"Untitled Slot"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>z(V),className:"h-6 w-6 p-0",children:e.jsx(Zr,{className:"h-3 w-3"})}),e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>L(V.id),className:"h-6 w-6 p-0 text-red-600 hover:text-red-700",children:e.jsx(pa,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-600",children:[e.jsx(ys,{className:"h-3 w-3"}),bw(V.startTime)," - ",bw(V.endTime)]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-600",children:[e.jsx(uh,{className:"h-3 w-3"}),V.timeZone?((Z=V.timeZone.split("/")[1])==null?void 0:Z.replace("_"," "))||V.timeZone:"Unknown Timezone"]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-blue-600",children:[e.jsx(an,{className:"h-3 w-3"}),e.jsx("span",{className:"font-medium",children:"Next available:"})]}),e.jsxs("div",{className:"text-xs text-blue-700 space-y-1",children:[(()=>{const ue=[],ge=new Date,G=new Date(V.effectiveStartDate||ge),Ae=V.effectiveEndDate?new Date(V.effectiveEndDate):new Date(ge.getTime()+1440*60*60*1e3);for(let Fe=new Date(Math.max(ge.getTime(),G.getTime()));Fe<=Ae&&ue.length<3;Fe.setDate(Fe.getDate()+1))if(Fe.getDay()===V.dayOfWeek){const be=Fe.toISOString().split("T")[0];(!V.excludedDates||!V.excludedDates.includes(be))&&ue.push(new Date(Fe))}return ue.map((Fe,be)=>e.jsx("div",{className:"text-blue-800 font-medium",children:Fe.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:Fe.getFullYear()!==ge.getFullYear()?"numeric":void 0})},be))})(),(()=>{const ue=new Date,ge=new Date(V.effectiveStartDate||ue),G=V.effectiveEndDate?new Date(V.effectiveEndDate):new Date(ue.getTime()+1440*60*60*1e3);let Ae=!1;for(let Fe=new Date(Math.max(ue.getTime(),ge.getTime()));Fe<=G&&!Ae;Fe.setDate(Fe.getDate()+1))if(Fe.getDay()===V.dayOfWeek){const be=Fe.toISOString().split("T")[0];(!V.excludedDates||!V.excludedDates.includes(be))&&(Ae=!0)}return Ae?null:e.jsx("div",{className:"text-red-600 font-medium",children:"No upcoming dates available"})})()]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx(we,{variant:V.isActive?"default":"secondary",className:"text-xs",children:V.isActive?"Active":"Inactive"}),e.jsxs(we,{variant:"outline",className:"text-xs",children:[V.sessionDuration||60,"min"]}),e.jsx(we,{variant:"outline",className:"text-xs",children:V.sessionType||"1:1"})]}),V.notes&&typeof V.notes=="string"&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:V.notes})]},V.id)}),!H[T.value]&&e.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"No availability set"})]})]},T.value)})}),e.jsx(es,{open:s,onOpenChange:t,children:e.jsxs(ts,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:n?"Edit Availability Slot":"Create Availability Slot"}),e.jsx(Pa,{children:"Configure when you're available for appointments and sessions."})]}),e.jsx(Fa,{...P,children:e.jsxs("form",{onSubmit:P.handleSubmit(M),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:P.control,name:"title",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Title"}),e.jsx(He,{children:e.jsx(je,{placeholder:"e.g., Tuesday 1:1 Sessions",...T})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:P.control,name:"dayOfWeek",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Day of Week"}),e.jsxs(St,{onValueChange:U=>T.onChange(parseInt(U)),value:T.value.toString(),children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select day"})})}),e.jsx(Ct,{children:jw.map(U=>e.jsx(ce,{value:U.value.toString(),children:U.label},U.value))})]}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:P.control,name:"startTime",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Start Time"}),e.jsx(He,{children:e.jsx(je,{type:"time",step:"1",...T})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:P.control,name:"endTime",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"End Time"}),e.jsx(He,{children:e.jsx(je,{type:"time",step:"1",...T})}),e.jsx(Ye,{})]})})]}),e.jsx(Ke,{control:P.control,name:"timeZone",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Time Zone"}),e.jsxs(St,{onValueChange:T.onChange,value:T.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select time zone"})})}),e.jsx(Ct,{children:iK.map(U=>e.jsx(ce,{value:U.value,children:U.label},U.value))})]}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(Ke,{control:P.control,name:"sessionDuration",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Session Duration (minutes)"}),e.jsx(He,{children:e.jsx(je,{type:"number",min:"15",step:"15",...T,onChange:U=>T.onChange(parseInt(U.target.value))})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:P.control,name:"bufferTime",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Buffer Time (minutes)"}),e.jsx(He,{children:e.jsx(je,{type:"number",min:"0",step:"5",...T,onChange:U=>T.onChange(parseInt(U.target.value))})}),e.jsx(Mn,{children:"Time between sessions"}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:P.control,name:"maxConcurrentSessions",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Max Concurrent"}),e.jsx(He,{children:e.jsx(je,{type:"number",min:"1",...T,onChange:U=>T.onChange(parseInt(U.target.value))})}),e.jsx(Mn,{children:"Usually 1 for 1:1"}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:P.control,name:"sessionType",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Session Type"}),e.jsxs(St,{onValueChange:T.onChange,value:T.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select session type"})})}),e.jsx(Ct,{children:aK.map(U=>e.jsx(ce,{value:U.value,children:U.label},U.value))})]}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:P.control,name:"effectiveStartDate",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Effective Start Date"}),e.jsx(He,{children:e.jsx(je,{type:"date",...T})}),e.jsx(Ye,{})]})})]}),e.jsx(Ke,{control:P.control,name:"effectiveEndDate",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Effective End Date (Optional)"}),e.jsx(He,{children:e.jsx(je,{type:"date",...T})}),e.jsx(Mn,{children:"Leave empty for indefinite availability"}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:P.control,name:"isActive",render:({field:T})=>e.jsxs(We,{className:"flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(ze,{children:"Active"}),e.jsx(Mn,{children:"Allow new appointments to be booked"})]}),e.jsx(He,{children:e.jsx(m0,{checked:T.value,onCheckedChange:T.onChange})})]})}),e.jsx(Ke,{control:P.control,name:"isRecurring",render:({field:T})=>e.jsxs(We,{className:"flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(ze,{children:"Recurring Weekly"}),e.jsx(Mn,{children:"Repeat this availability every week"})]}),e.jsx(He,{children:e.jsx(m0,{checked:T.value,onCheckedChange:T.onChange})})]})})]}),e.jsx(Ke,{control:P.control,name:"notes",render:({field:T})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Notes (Optional)"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Additional notes about this availability...",rows:3,...T})}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(F,{type:"submit",disabled:N.isPending||k.isPending,children:N.isPending||k.isPending?"Saving...":n?"Update Availability":"Create Availability"})]})]})})]})})]})}
vendor: 50,964 bytes, line 732
732class jd extends Error{}class oK extends jd{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class cK extends jd{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class dK extends jd{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class mu extends jd{}class Q$ extends jd{constructor(t){super(`Invalid unit ${t}`)}}class _r extends jd{}class ko extends jd{constructor(){super("Zone is an abstract class")}}const jt="numeric",Ii="short",Ia="long",h0={year:jt,month:jt,day:jt},X$={year:jt,month:Ii,day:jt},uK={year:jt,month:Ii,day:jt,weekday:Ii},J$={year:jt,month:Ia,day:jt},eP={year:jt,month:Ia,day:jt,weekday:Ia},tP={hour:jt,minute:jt},sP={hour:jt,minute:jt,second:jt},nP={hour:jt,minute:jt,second:jt,timeZoneName:Ii},rP={hour:jt,minute:jt,second:jt,timeZoneName:Ia},aP={hour:jt,minute:jt,hourCycle:"h23"},iP={hour:jt,minute:jt,second:jt,hourCycle:"h23"},lP={hour:jt,minute:jt,second:jt,hourCycle:"h23",timeZoneName:Ii},oP={hour:jt,minute:jt,second:jt,hourCycle:"h23",timeZoneName:Ia},cP={year:jt,month:jt,day:jt,hour:jt,minute:jt},dP={year:jt,month:jt,day:jt,hour:jt,minute:jt,second:jt},uP={year:jt,month:Ii,day:jt,hour:jt,minute:jt},mP={year:jt,month:Ii,day:jt,hour:jt,minute:jt,second:jt},mK={year:jt,month:Ii,day:jt,weekday:Ii,hour:jt,minute:jt},hP={year:jt,month:Ia,day:jt,hour:jt,minute:jt,timeZoneName:Ii},fP={year:jt,month:Ia,day:jt,hour:jt,minute:jt,second:jt,timeZoneName:Ii},pP={year:jt,month:Ia,day:jt,weekday:Ia,hour:jt,minute:jt,timeZoneName:Ia},xP={year:jt,month:Ia,day:jt,weekday:Ia,hour:jt,minute:jt,second:jt,timeZoneName:Ia};class $f{get type(){throw new ko}get name(){throw new ko}get ianaName(){return this.name}get isUniversal(){throw new ko}offsetName(t,n){throw new ko}formatOffset(t,n){throw new ko}offset(t){throw new ko}equals(t){throw new ko}get isValid(){throw new ko}}let mv=null;class ag extends $f{static get instance(){return mv===null&&(mv=new ag),mv}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return kP(t,n,r)}formatOffset(t,n){return wh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const P1=new Map;function hK(s){let t=P1.get(s);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),P1.set(s,t)),t}const fK={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function pK(s,t){const n=s.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,c,u,h,x,m]=r;return[c,a,o,u,h,x,m]}function xK(s,t){const n=s.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:o,value:c}=n[a],u=fK[o];o==="era"?r[u]=c:os(u)||(r[u]=parseInt(c,10))}return r}const hv=new Map;class Zl extends $f{static create(t){let n=hv.get(t);return n===void 0&&hv.set(t,n=new Zl(t)),n}static resetCache(){hv.clear(),P1.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Zl.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return kP(t,n,r,this.name)}formatOffset(t,n){return wh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=hK(this.name);let[a,o,c,u,h,x,m]=r.formatToParts?xK(r,n):pK(r,n);u==="BC"&&(a=-Math.abs(a)+1);const y=lg({year:a,month:o,day:c,hour:h===24?0:h,minute:x,second:m,millisecond:0});let b=+n;const w=b%1e3;return b-=w>=0?w:1e3+w,(y-b)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Nw={};function gK(s,t={}){const n=JSON.stringify([s,t]);let r=Nw[n];return r||(r=new Intl.ListFormat(s,t),Nw[n]=r),r}const E1=new Map;function T1(s,t={}){const n=JSON.stringify([s,t]);let r=E1.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(s,t),E1.set(n,r)),r}const _1=new Map;function yK(s,t={}){const n=JSON.stringify([s,t]);let r=_1.get(n);return r===void 0&&(r=new Intl.NumberFormat(s,t),_1.set(n,r)),r}const I1=new Map;function vK(s,t={}){const{base:n,...r}=t,a=JSON.stringify([s,r]);let o=I1.get(a);return o===void 0&&(o=new Intl.RelativeTimeFormat(s,t),I1.set(a,o)),o}let gh=null;function jK(){return gh||(gh=new Intl.DateTimeFormat().resolvedOptions().locale,gh)}const D1=new Map;function gP(s){let t=D1.get(s);return t===void 0&&(t=new Intl.DateTimeFormat(s).resolvedOptions(),D1.set(s,t)),t}const O1=new Map;function bK(s){let t=O1.get(s);if(!t){const n=new Intl.Locale(s);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...yP,...t}),O1.set(s,t)}return t}function NK(s){const t=s.indexOf("-x-");t!==-1&&(s=s.substring(0,t));const n=s.indexOf("-u-");if(n===-1)return[s];{let r,a;try{r=T1(s).resolvedOptions(),a=s}catch{const h=s.substring(0,n);r=T1(h).resolvedOptions(),a=h}const{numberingSystem:o,calendar:c}=r;return[a,o,c]}}function wK(s,t,n){return(n||t)&&(s.includes("-u-")||(s+="-u"),n&&(s+=`-ca-${n}`),t&&(s+=`-nu-${t}`)),s}function AK(s){const t=[];for(let n=1;n<=12;n++){const r=vt.utc(2009,n,1);t.push(s(r))}return t}function CK(s){const t=[];for(let n=1;n<=7;n++){const r=vt.utc(2016,11,13+n);t.push(s(r))}return t}function mx(s,t,n,r){const a=s.listingMode();return a==="error"?null:a==="en"?n(t):r(t)}function SK(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||gP(s.locale).numberingSystem==="latn"}class kK{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...c}=r;if(!n||Object.keys(c).length>0){const u={useGrouping:!1,...r};r.padTo>0&&(u.minimumIntegerDigits=r.padTo),this.inf=yK(t,u)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Cj(t,3);return Kn(n,this.padTo)}}}class $K{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const c=-1*(t.offset/60),u=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;t.offset!==0&&Zl.create(u).valid?(a=u,this.dt=t):(a="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,a=t.zone.name):(a="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=T1(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class PK{constructor(t,n,r){this.opts={style:"long",...r},!n&&CP()&&(this.rtf=vK(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):QK(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const yP={firstDay:1,minimalDays:4,weekend:[6,7]};class nn{static fromOpts(t){return nn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,a,o=!1){const c=t||On.defaultLocale,u=c||(o?"en-US":jK()),h=n||On.defaultNumberingSystem,x=r||On.defaultOutputCalendar,m=R1(a)||On.defaultWeekSettings;return new nn(u,h,x,m,c)}static resetCache(){gh=null,E1.clear(),_1.clear(),I1.clear(),D1.clear(),O1.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:a}={}){return nn.create(t,n,r,a)}constructor(t,n,r,a,o){const[c,u,h]=NK(t);this.locale=c,this.numberingSystem=n||u||null,this.outputCalendar=r||h||null,this.weekSettings=a,this.intl=wK(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=SK(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:nn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,R1(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return mx(this,t,EP,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";if(!this.monthsCache[o][t]){const c=r?u=>this.dtFormatter(u,a).format():u=>this.extract(u,a,"month");this.monthsCache[o][t]=AK(c)}return this.monthsCache[o][t]})}weekdays(t,n=!1){return mx(this,t,IP,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},a=n?"format":"standalone";return this.weekdaysCache[a][t]||(this.weekdaysCache[a][t]=CK(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[a][t]})}meridiems(){return mx(this,void 0,()=>DP,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[vt.utc(2016,11,13,9),vt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return mx(this,t,OP,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[vt.utc(-40,1,1),vt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),c=o.find(u=>u.type.toLowerCase()===r);return c?c.value:null}numberFormatter(t={}){return new kK(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new $K(t,this.intl,n)}relFormatter(t={}){return new PK(this.intl,this.isEnglish(),t)}listFormatter(t={}){return gK(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||gP(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:SP()?bK(this.locale):yP}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let fv=null;class Yr extends $f{static get utcInstance(){return fv===null&&(fv=new Yr(0)),fv}static instance(t){return t===0?Yr.utcInstance:new Yr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Yr(og(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${wh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${wh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return wh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class EK extends $f{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Io(s,t){if(os(s)||s===null)return t;if(s instanceof $f)return s;if(FK(s)){const n=s.toLowerCase();return n==="default"?t:n==="local"||n==="system"?ag.instance:n==="utc"||n==="gmt"?Yr.utcInstance:Yr.parseSpecifier(n)||Zl.create(s)}else return Go(s)?Yr.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new EK(s)}const bj={arab:"[Ù -Ù©]",arabext:"[Û°-Û¹]",bali:"[á-á]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[ï¼-ï¼]",gujr:"[૦-૯]",hanidec:"[ã|ä¸|äº|ä¸|å|äº|å
|ä¸|å
«|ä¹]",khmr:"[á -á©]",knda:"[೦-೯]",laoo:"[à»-à»]",limb:"[á¥-á¥]",mlym:"[൦-൯]",mong:"[á -á ]",mymr:"[á-á]",orya:"[à¦-à¯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[à¹-à¹]",tibt:"[༠-༩]",latn:"\\d"},ww={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},TK=bj.hanidec.replace(/[\[|\]]/g,"").split("");function _K(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let n=0;n<s.length;n++){const r=s.charCodeAt(n);if(s[n].search(bj.hanidec)!==-1)t+=TK.indexOf(s[n]);else for(const a in ww){const[o,c]=ww[a];r>=o&&r<=c&&(t+=r-o)}}return parseInt(t,10)}else return t}const F1=new Map;function IK(){F1.clear()}function yi({numberingSystem:s},t=""){const n=s||"latn";let r=F1.get(n);r===void 0&&(r=new Map,F1.set(n,r));let a=r.get(t);return a===void 0&&(a=new RegExp(`${bj[n]}${t}`),r.set(t,a)),a}let Aw=()=>Date.now(),Cw="system",Sw=null,kw=null,$w=null,Pw=60,Ew,Tw=null;class On{static get now(){return Aw}static set now(t){Aw=t}static set defaultZone(t){Cw=t}static get defaultZone(){return Io(Cw,ag.instance)}static get defaultLocale(){return Sw}static set defaultLocale(t){Sw=t}static get defaultNumberingSystem(){return kw}static set defaultNumberingSystem(t){kw=t}static get defaultOutputCalendar(){return $w}static set defaultOutputCalendar(t){$w=t}static get defaultWeekSettings(){return Tw}static set defaultWeekSettings(t){Tw=R1(t)}static get twoDigitCutoffYear(){return Pw}static set twoDigitCutoffYear(t){Pw=t%100}static get throwOnInvalid(){return Ew}static set throwOnInvalid(t){Ew=t}static resetCaches(){nn.resetCache(),Zl.resetCache(),vt.resetCache(),IK()}}class $i{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const vP=[0,31,59,90,120,151,181,212,243,273,304,334],jP=[0,31,60,91,121,152,182,213,244,274,305,335];function Xa(s,t){return new $i("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function Nj(s,t,n){const r=new Date(Date.UTC(s,t-1,n));s<100&&s>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function bP(s,t,n){return n+(Pf(s)?jP:vP)[t-1]}function NP(s,t){const n=Pf(s)?jP:vP,r=n.findIndex(o=>o<t),a=t-n[r];return{month:r+1,day:a}}function wj(s,t){return(s-t+7)%7+1}function f0(s,t=4,n=1){const{year:r,month:a,day:o}=s,c=bP(r,a,o),u=wj(Nj(r,a,o),n);let h=Math.floor((c-u+14-t)/7),x;return h<1?(x=r-1,h=Gh(x,t,n)):h>Gh(r,t,n)?(x=r+1,h=1):x=r,{weekYear:x,weekNumber:h,weekday:u,...cg(s)}}function _w(s,t=4,n=1){const{weekYear:r,weekNumber:a,weekday:o}=s,c=wj(Nj(r,1,t),n),u=vu(r);let h=a*7+o-c-7+t,x;h<1?(x=r-1,h+=vu(x)):h>u?(x=r+1,h-=vu(r)):x=r;const{month:m,day:g}=NP(x,h);return{year:x,month:m,day:g,...cg(s)}}function pv(s){const{year:t,month:n,day:r}=s,a=bP(t,n,r);return{year:t,ordinal:a,...cg(s)}}function Iw(s){const{year:t,ordinal:n}=s,{month:r,day:a}=NP(t,n);return{year:t,month:r,day:a,...cg(s)}}function Dw(s,t){if(!os(s.localWeekday)||!os(s.localWeekNumber)||!os(s.localWeekYear)){if(!os(s.weekday)||!os(s.weekNumber)||!os(s.weekYear))throw new mu("Cannot mix locale-based week fields with ISO-based week fields");return os(s.localWeekday)||(s.weekday=s.localWeekday),os(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),os(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function DK(s,t=4,n=1){const r=ig(s.weekYear),a=Ja(s.weekNumber,1,Gh(s.weekYear,t,n)),o=Ja(s.weekday,1,7);return r?a?o?!1:Xa("weekday",s.weekday):Xa("week",s.weekNumber):Xa("weekYear",s.weekYear)}function OK(s){const t=ig(s.year),n=Ja(s.ordinal,1,vu(s.year));return t?n?!1:Xa("ordinal",s.ordinal):Xa("year",s.year)}function wP(s){const t=ig(s.year),n=Ja(s.month,1,12),r=Ja(s.day,1,p0(s.year,s.month));return t?n?r?!1:Xa("day",s.day):Xa("month",s.month):Xa("year",s.year)}function AP(s){const{hour:t,minute:n,second:r,millisecond:a}=s,o=Ja(t,0,23)||t===24&&n===0&&r===0&&a===0,c=Ja(n,0,59),u=Ja(r,0,59),h=Ja(a,0,999);return o?c?u?h?!1:Xa("millisecond",a):Xa("second",r):Xa("minute",n):Xa("hour",t)}function os(s){return typeof s>"u"}function Go(s){return typeof s=="number"}function ig(s){return typeof s=="number"&&s%1===0}function FK(s){return typeof s=="string"}function RK(s){return Object.prototype.toString.call(s)==="[object Date]"}function CP(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function SP(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function MK(s){return Array.isArray(s)?s:[s]}function Ow(s,t,n){if(s.length!==0)return s.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function LK(s,t){return t.reduce((n,r)=>(n[r]=s[r],n),{})}function Ku(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function R1(s){if(s==null)return null;if(typeof s!="object")throw new _r("Week settings must be an object");if(!Ja(s.firstDay,1,7)||!Ja(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(t=>!Ja(t,1,7)))throw new _r("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function Ja(s,t,n){return ig(s)&&s>=t&&s<=n}function VK(s,t){return s-t*Math.floor(s/t)}function Kn(s,t=2){const n=s<0;let r;return n?r="-"+(""+-s).padStart(t,"0"):r=(""+s).padStart(t,"0"),r}function Eo(s){if(!(os(s)||s===null||s===""))return parseInt(s,10)}function Mc(s){if(!(os(s)||s===null||s===""))return parseFloat(s)}function Aj(s){if(!(os(s)||s===null||s==="")){const t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function Cj(s,t,n="round"){const r=10**t;switch(n){case"expand":return s>0?Math.ceil(s*r)/r:Math.floor(s*r)/r;case"trunc":return Math.trunc(s*r)/r;case"round":return Math.round(s*r)/r;case"floor":return Math.floor(s*r)/r;case"ceil":return Math.ceil(s*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Pf(s){return s%4===0&&(s%100!==0||s%400===0)}function vu(s){return Pf(s)?366:365}function p0(s,t){const n=VK(t-1,12)+1,r=s+(t-n)/12;return n===2?Pf(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function lg(s){let t=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(t=new Date(t),t.setUTCFullYear(s.year,s.month-1,s.day)),+t}function Fw(s,t,n){return-wj(Nj(s,1,t),n)+t-1}function Gh(s,t=4,n=1){const r=Fw(s,t,n),a=Fw(s+1,t,n);return(vu(s)-r+a)/7}function M1(s){return s>99?s:s>On.twoDigitCutoffYear?1900+s:2e3+s}function kP(s,t,n,r=null){const a=new Date(s),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const c={timeZoneName:t,...o},u=new Intl.DateTimeFormat(n,c).formatToParts(a).find(h=>h.type.toLowerCase()==="timezonename");return u?u.value:null}function og(s,t){let n=parseInt(s,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function $P(s){const t=Number(s);if(typeof s=="boolean"||s===""||!Number.isFinite(t))throw new _r(`Invalid unit value ${s}`);return t}function x0(s,t){const n={};for(const r in s)if(Ku(s,r)){const a=s[r];if(a==null)continue;n[t(r)]=$P(a)}return n}function wh(s,t){const n=Math.trunc(Math.abs(s/60)),r=Math.trunc(Math.abs(s%60)),a=s>=0?"+":"-";switch(t){case"short":return`${a}${Kn(n,2)}:${Kn(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Kn(n,2)}${Kn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function cg(s){return LK(s,["hour","minute","second","millisecond"])}const UK=["January","February","March","April","May","June","July","August","September","October","November","December"],PP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zK=["J","F","M","A","M","J","J","A","S","O","N","D"];function EP(s){switch(s){case"narrow":return[...zK];case"short":return[...PP];case"long":return[...UK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const TP=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],_P=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qK=["M","T","W","T","F","S","S"];function IP(s){switch(s){case"narrow":return[...qK];case"short":return[..._P];case"long":return[...TP];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const DP=["AM","PM"],WK=["Before Christ","Anno Domini"],BK=["BC","AD"],KK=["B","A"];function OP(s){switch(s){case"narrow":return[...KK];case"short":return[...BK];case"long":return[...WK];default:return null}}function HK(s){return DP[s.hour<12?0:1]}function GK(s,t){return IP(t)[s.weekday-1]}function ZK(s,t){return EP(t)[s.month-1]}function YK(s,t){return OP(t)[s.year<0?0:1]}function QK(s,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(s)===-1;if(n==="auto"&&o){const g=s==="days";switch(t){case 1:return g?"tomorrow":`next ${a[s][0]}`;case-1:return g?"yesterday":`last ${a[s][0]}`;case 0:return g?"today":`this ${a[s][0]}`}}const c=Object.is(t,-0)||t<0,u=Math.abs(t),h=u===1,x=a[s],m=r?h?x[1]:x[2]||x[1]:h?a[s][0]:s;return c?`${u} ${m} ago`:`in ${u} ${m}`}function Rw(s,t){let n="";for(const r of s)r.literal?n+=r.val:n+=t(r.val);return n}const XK={D:h0,DD:X$,DDD:J$,DDDD:eP,t:tP,tt:sP,ttt:nP,tttt:rP,T:aP,TT:iP,TTT:lP,TTTT:oP,f:cP,ff:uP,fff:hP,ffff:pP,F:dP,FF:mP,FFF:fP,FFFF:xP};class Dr{static create(t,n={}){return new Dr(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let c=0;c<t.length;c++){const u=t.charAt(c);u==="'"?((r.length>0||a)&&o.push({literal:a||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",a=!a):a||u===n?r+=u:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=u,n=u)}return r.length>0&&o.push({literal:a||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(t){return XK[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,r=void 0){if(this.opts.forceSimple)return Kn(t,n);const a={...this.opts};return n>0&&(a.padTo=n),r&&(a.signDisplay=r),this.loc.numberFormatter(a).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(b,w)=>this.loc.extract(t,b,w),c=b=>t.isOffsetFixed&&t.offset===0&&b.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,b.format):"",u=()=>r?HK(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),h=(b,w)=>r?ZK(t,b):o(w?{month:b}:{month:b,day:"numeric"},"month"),x=(b,w)=>r?GK(t,b):o(w?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),m=b=>{const w=Dr.macroTokenToFormatOpts(b);return w?this.formatWithSystemDefault(t,w):b},g=b=>r?YK(t,b):o({era:b},"era"),y=b=>{switch(b){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return u();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return x("short",!0);case"cccc":return x("long",!0);case"ccccc":return x("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return x("short",!1);case"EEEE":return x("long",!1);case"EEEEE":return x("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return h("short",!0);case"LLLL":return h("long",!0);case"LLLLL":return h("narrow",!0);case"M":return a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return h("short",!1);case"MMMM":return h("long",!1);case"MMMMM":return h("narrow",!1);case"y":return a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return m(b)}};return Rw(Dr.parseFormat(n),y)}formatDurationFromString(t,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,a=m=>{switch(m[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},o=(m,g)=>y=>{const b=a(y);if(b){const w=g.isNegativeDuration&&b!==g.largestUnit?r:1;let N;return this.opts.signMode==="negativeLargestOnly"&&b!==g.largestUnit?N="never":this.opts.signMode==="all"?N="always":N="auto",this.num(m.get(b)*w,y.length,N)}else return y},c=Dr.parseFormat(n),u=c.reduce((m,{literal:g,val:y})=>g?m:m.concat(y),[]),h=t.shiftTo(...u.map(a).filter(m=>m)),x={isNegativeDuration:h<0,largestUnit:Object.keys(h.values)[0]};return Rw(c,o(h,x))}}const FP=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function nm(...s){const t=s.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function rm(...s){return t=>s.reduce(([n,r,a],o)=>{const[c,u,h]=o(t,a);return[{...n,...c},u||r,h]},[{},null,1]).slice(0,2)}function am(s,...t){if(s==null)return[null,null];for(const[n,r]of t){const a=n.exec(s);if(a)return r(a)}return[null,null]}function RP(...s){return(t,n)=>{const r={};let a;for(a=0;a<s.length;a++)r[s[a]]=Eo(t[n+a]);return[r,null,n+a]}}const MP=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,JK=`(?:${MP.source}?(?:\\[(${FP.source})\\])?)?`,Sj=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,LP=RegExp(`${Sj.source}${JK}`),kj=RegExp(`(?:[Tt]${LP.source})?`),eH=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tH=/(\d{4})-?W(\d\d)(?:-?(\d))?/,sH=/(\d{4})-?(\d{3})/,nH=RP("weekYear","weekNumber","weekDay"),rH=RP("year","ordinal"),aH=/(\d{4})-(\d\d)-(\d\d)/,VP=RegExp(`${Sj.source} ?(?:${MP.source}|(${FP.source}))?`),iH=RegExp(`(?: ${VP.source})?`);function ju(s,t,n){const r=s[t];return os(r)?n:Eo(r)}function lH(s,t){return[{year:ju(s,t),month:ju(s,t+1,1),day:ju(s,t+2,1)},null,t+3]}function im(s,t){return[{hours:ju(s,t,0),minutes:ju(s,t+1,0),seconds:ju(s,t+2,0),milliseconds:Aj(s[t+3])},null,t+4]}function Ef(s,t){const n=!s[t]&&!s[t+1],r=og(s[t+1],s[t+2]),a=n?null:Yr.instance(r);return[{},a,t+3]}function Tf(s,t){const n=s[t]?Zl.create(s[t]):null;return[{},n,t+1]}const oH=RegExp(`^T?${Sj.source}$`),cH=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function dH(s){const[t,n,r,a,o,c,u,h,x]=s,m=t[0]==="-",g=h&&h[0]==="-",y=(b,w=!1)=>b!==void 0&&(w||b&&m)?-b:b;return[{years:y(Mc(n)),months:y(Mc(r)),weeks:y(Mc(a)),days:y(Mc(o)),hours:y(Mc(c)),minutes:y(Mc(u)),seconds:y(Mc(h),h==="-0"),milliseconds:y(Aj(x),g)}]}const uH={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function $j(s,t,n,r,a,o,c){const u={year:t.length===2?M1(Eo(t)):Eo(t),month:PP.indexOf(n)+1,day:Eo(r),hour:Eo(a),minute:Eo(o)};return c&&(u.second=Eo(c)),s&&(u.weekday=s.length>3?TP.indexOf(s)+1:_P.indexOf(s)+1),u}const mH=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hH(s){const[,t,n,r,a,o,c,u,h,x,m,g]=s,y=$j(t,a,r,n,o,c,u);let b;return h?b=uH[h]:x?b=0:b=og(m,g),[y,new Yr(b)]}function fH(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const pH=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xH=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gH=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mw(s){const[,t,n,r,a,o,c,u]=s;return[$j(t,a,r,n,o,c,u),Yr.utcInstance]}function yH(s){const[,t,n,r,a,o,c,u]=s;return[$j(t,u,n,r,a,o,c),Yr.utcInstance]}const vH=nm(eH,kj),jH=nm(tH,kj),bH=nm(sH,kj),NH=nm(LP),UP=rm(lH,im,Ef,Tf),wH=rm(nH,im,Ef,Tf),AH=rm(rH,im,Ef,Tf),CH=rm(im,Ef,Tf);function SH(s){return am(s,[vH,UP],[jH,wH],[bH,AH],[NH,CH])}function kH(s){return am(fH(s),[mH,hH])}function $H(s){return am(s,[pH,Mw],[xH,Mw],[gH,yH])}function PH(s){return am(s,[cH,dH])}const EH=rm(im);function TH(s){return am(s,[oH,EH])}const _H=nm(aH,iH),IH=nm(VP),DH=rm(im,Ef,Tf);function OH(s){return am(s,[_H,UP],[IH,DH])}const Lw="Invalid Duration",zP={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},FH={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...zP},Ba=146097/400,iu=146097/4800,RH={years:{quarters:4,months:12,weeks:Ba/7,days:Ba,hours:Ba*24,minutes:Ba*24*60,seconds:Ba*24*60*60,milliseconds:Ba*24*60*60*1e3},quarters:{months:3,weeks:Ba/28,days:Ba/4,hours:Ba*24/4,minutes:Ba*24*60/4,seconds:Ba*24*60*60/4,milliseconds:Ba*24*60*60*1e3/4},months:{weeks:iu/7,days:iu,hours:iu*24,minutes:iu*24*60,seconds:iu*24*60*60,milliseconds:iu*24*60*60*1e3},...zP},Gc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],MH=Gc.slice(0).reverse();function Dl(s,t,n=!1){const r={values:n?t.values:{...s.values,...t.values||{}},loc:s.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||s.conversionAccuracy,matrix:t.matrix||s.matrix};return new Ks(r)}function qP(s,t){let n=t.milliseconds??0;for(const r of MH.slice(1))t[r]&&(n+=t[r]*s[r].milliseconds);return n}function Vw(s,t){const n=qP(s,t)<0?-1:1;Gc.reduceRight((r,a)=>{if(os(t[a]))return r;if(r){const o=t[r]*n,c=s[a][r],u=Math.floor(o/c);t[a]+=u*n,t[r]-=u*c*n}return a},null),Gc.reduce((r,a)=>{if(os(t[a]))return r;if(r){const o=t[r]%1;t[r]-=o,t[a]+=o*s[r][a]}return a},null)}function Uw(s){const t={};for(const[n,r]of Object.entries(s))r!==0&&(t[n]=r);return t}class Ks{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?RH:FH;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||nn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Ks.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new _r(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ks({values:x0(t,Ks.normalizeUnit),loc:nn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Go(t))return Ks.fromMillis(t);if(Ks.isDuration(t))return t;if(typeof t=="object")return Ks.fromObject(t);throw new _r(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=PH(t);return r?Ks.fromObject(r,n):Ks.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=TH(t);return r?Ks.fromObject(r,n):Ks.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the Duration is invalid");const r=t instanceof $i?t:new $i(t,n);if(On.throwOnInvalid)throw new dK(r);return new Ks({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new Q$(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Dr.create(this.loc,r).formatDurationFromString(this,t):Lw}toHuman(t={}){if(!this.isValid)return Lw;const n=t.showZeros!==!1,r=Gc.map(a=>{const o=this.values[a];return os(o)||o===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:a.slice(0,-1)}).format(o)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Cj(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},vt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?qP(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ks.fromDurationLike(t),r={};for(const a of Gc)(Ku(n.values,a)||Ku(this.values,a))&&(r[a]=n.get(a)+this.get(a));return Dl(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ks.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=$P(t(this.values[r],r));return Dl(this,{values:n},!0)}get(t){return this[Ks.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...x0(t,Ks.normalizeUnit)};return Dl(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const c={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return Dl(this,c)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Vw(this.matrix,t),Dl(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Uw(this.normalize().shiftToAll().toObject());return Dl(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(c=>Ks.normalizeUnit(c));const n={},r={},a=this.toObject();let o;for(const c of Gc)if(t.indexOf(c)>=0){o=c;let u=0;for(const x in r)u+=this.matrix[x][c]*r[x],r[x]=0;Go(a[c])&&(u+=a[c]);const h=Math.trunc(u);n[c]=h,r[c]=(u*1e3-h*1e3)/1e3}else Go(a[c])&&(r[c]=a[c]);for(const c in r)r[c]!==0&&(n[o]+=c===o?r[c]:r[c]/this.matrix[o][c]);return Vw(this.matrix,n),Dl(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Dl(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=Uw(this.values);return Dl(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of Gc)if(!n(this.values[r],t.values[r]))return!1;return!0}}const lu="Invalid Interval";function LH(s,t){return!s||!s.isValid?Dn.invalid("missing or invalid start"):!t||!t.isValid?Dn.invalid("missing or invalid end"):t<s?Dn.invalid("end before start",`The end of an interval must be after its start, but you had start=${s.toISO()} and end=${t.toISO()}`):null}class Dn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the Interval is invalid");const r=t instanceof $i?t:new $i(t,n);if(On.throwOnInvalid)throw new cK(r);return new Dn({invalid:r})}static fromDateTimes(t,n){const r=ah(t),a=ah(n),o=LH(r,a);return o??new Dn({start:r,end:a})}static after(t,n){const r=Ks.fromDurationLike(n),a=ah(t);return Dn.fromDateTimes(a,a.plus(r))}static before(t,n){const r=Ks.fromDurationLike(n),a=ah(t);return Dn.fromDateTimes(a.minus(r),a)}static fromISO(t,n){const[r,a]=(t||"").split("/",2);if(r&&a){let o,c;try{o=vt.fromISO(r,n),c=o.isValid}catch{c=!1}let u,h;try{u=vt.fromISO(a,n),h=u.isValid}catch{h=!1}if(c&&h)return Dn.fromDateTimes(o,u);if(c){const x=Ks.fromISO(a,n);if(x.isValid)return Dn.after(o,x)}else if(h){const x=Ks.fromISO(r,n);if(x.isValid)return Dn.before(u,x)}}return Dn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let a;return n!=null&&n.useLocaleWeeks?a=this.end.reconfigure({locale:r.locale}):a=this.end,a=a.startOf(t,n),Math.floor(a.diff(r,t).get(t))+(a.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Dn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(ah).filter(c=>this.contains(c)).sort((c,u)=>c.toMillis()-u.toMillis()),r=[];let{s:a}=this,o=0;for(;a<this.e;){const c=n[o]||this.e,u=+c>+this.e?this.e:c;r.push(Dn.fromDateTimes(a,u)),a=u,o+=1}return r}splitBy(t){const n=Ks.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const c=[];for(;r<this.e;){const u=this.start.plus(n.mapUnits(h=>h*a));o=+u>+this.e?this.e:u,c.push(Dn.fromDateTimes(r,o)),r=o,a+=1}return c}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Dn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Dn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],c)=>o?o.overlaps(c)||o.abutsStart(c)?[a,o.union(c)]:[a.concat([o]),c]:[a,c],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(h=>[{time:h.s,type:"s"},{time:h.e,type:"e"}]),c=Array.prototype.concat(...o),u=c.sort((h,x)=>h.time-x.time);for(const h of u)r+=h.type==="s"?1:-1,r===1?n=h.time:(n&&+n!=+h.time&&a.push(Dn.fromDateTimes(n,h.time)),n=null);return Dn.merge(a)}difference(...t){return Dn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} â ${this.e.toISO()})`:lu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=h0,n={}){return this.isValid?Dr.create(this.s.loc.clone(n),t).formatInterval(this):lu}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:lu}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:lu}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:lu}toFormat(t,{separator:n=" â "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:lu}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ks.invalid(this.invalidReason)}mapEndpoints(t){return Dn.fromDateTimes(t(this.s),t(this.e))}}class hx{static hasDST(t=On.defaultZone){const n=vt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Zl.isValidZone(t)}static normalizeZone(t){return Io(t,On.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||nn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||nn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||nn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||nn.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||nn.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||nn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||nn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return nn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return nn.create(n,null,"gregory").eras(t)}static features(){return{relative:CP(),localeWeek:SP()}}}function zw(s,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(s);return Math.floor(Ks.fromMillis(r).as("days"))}function VH(s,t,n){const r=[["years",(h,x)=>x.year-h.year],["quarters",(h,x)=>x.quarter-h.quarter+(x.year-h.year)*4],["months",(h,x)=>x.month-h.month+(x.year-h.year)*12],["weeks",(h,x)=>{const m=zw(h,x);return(m-m%7)/7}],["days",zw]],a={},o=s;let c,u;for(const[h,x]of r)n.indexOf(h)>=0&&(c=h,a[h]=x(s,t),u=o.plus(a),u>t?(a[h]--,s=o.plus(a),s>t&&(u=s,a[h]--,s=o.plus(a))):s=u);return[s,a,u,c]}function UH(s,t,n,r){let[a,o,c,u]=VH(s,t,n);const h=t-a,x=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);x.length===0&&(c<t&&(c=a.plus({[u]:1})),c!==a&&(o[u]=(o[u]||0)+h/(c-a)));const m=Ks.fromObject(o,r);return x.length>0?Ks.fromMillis(h,r).shiftTo(...x).plus(m):m}const zH="missing Intl.DateTimeFormat.formatToParts support";function Xs(s,t=n=>n){return{regex:s,deser:([n])=>t(_K(n))}}const qH=" ",WP=`[ ${qH}]`,BP=new RegExp(WP,"g");function WH(s){return s.replace(/\./g,"\\.?").replace(BP,WP)}function qw(s){return s.replace(/\./g,"").replace(BP," ").toLowerCase()}function vi(s,t){return s===null?null:{regex:RegExp(s.map(WH).join("|")),deser:([n])=>s.findIndex(r=>qw(n)===qw(r))+t}}function Ww(s,t){return{regex:s,deser:([,n,r])=>og(n,r),groups:t}}function fx(s){return{regex:s,deser:([t])=>t}}function BH(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function KH(s,t){const n=yi(t),r=yi(t,"{2}"),a=yi(t,"{3}"),o=yi(t,"{4}"),c=yi(t,"{6}"),u=yi(t,"{1,2}"),h=yi(t,"{1,3}"),x=yi(t,"{1,6}"),m=yi(t,"{1,9}"),g=yi(t,"{2,4}"),y=yi(t,"{4,6}"),b=k=>({regex:RegExp(BH(k.val)),deser:([E])=>E,literal:!0}),N=(k=>{if(s.literal)return b(k);switch(k.val){case"G":return vi(t.eras("short"),0);case"GG":return vi(t.eras("long"),0);case"y":return Xs(x);case"yy":return Xs(g,M1);case"yyyy":return Xs(o);case"yyyyy":return Xs(y);case"yyyyyy":return Xs(c);case"M":return Xs(u);case"MM":return Xs(r);case"MMM":return vi(t.months("short",!0),1);case"MMMM":return vi(t.months("long",!0),1);case"L":return Xs(u);case"LL":return Xs(r);case"LLL":return vi(t.months("short",!1),1);case"LLLL":return vi(t.months("long",!1),1);case"d":return Xs(u);case"dd":return Xs(r);case"o":return Xs(h);case"ooo":return Xs(a);case"HH":return Xs(r);case"H":return Xs(u);case"hh":return Xs(r);case"h":return Xs(u);case"mm":return Xs(r);case"m":return Xs(u);case"q":return Xs(u);case"qq":return Xs(r);case"s":return Xs(u);case"ss":return Xs(r);case"S":return Xs(h);case"SSS":return Xs(a);case"u":return fx(m);case"uu":return fx(u);case"uuu":return Xs(n);case"a":return vi(t.meridiems(),0);case"kkkk":return Xs(o);case"kk":return Xs(g,M1);case"W":return Xs(u);case"WW":return Xs(r);case"E":case"c":return Xs(n);case"EEE":return vi(t.weekdays("short",!1),1);case"EEEE":return vi(t.weekdays("long",!1),1);case"ccc":return vi(t.weekdays("short",!0),1);case"cccc":return vi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Ww(new RegExp(`([+-]${u.source})(?::(${r.source}))?`),2);case"ZZZ":return Ww(new RegExp(`([+-]${u.source})(${r.source})?`),2);case"z":return fx(/[a-z_+-/]{1,256}?/i);case" ":return fx(/[^\S\n\r]/);default:return b(k)}})(s)||{invalidReason:zH};return N.token=s,N}const HH={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function GH(s,t,n){const{type:r,value:a}=s;if(r==="literal"){const h=/^\s+$/.test(a);return{literal:!h,val:h?" ":a}}const o=t[r];let c=r;r==="hour"&&(t.hour12!=null?c=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?c="hour12":c="hour24":c=n.hour12?"hour12":"hour24");let u=HH[c];if(typeof u=="object"&&(u=u[o]),u)return{literal:!1,val:u}}function ZH(s){return[`^${s.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,s]}function YH(s,t,n){const r=s.match(t);if(r){const a={};let o=1;for(const c in n)if(Ku(n,c)){const u=n[c],h=u.groups?u.groups+1:1;!u.literal&&u.token&&(a[u.token.val[0]]=u.deser(r.slice(o,o+h))),o+=h}return[r,a]}else return[r,{}]}function QH(s){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return os(s.z)||(n=Zl.create(s.z)),os(s.Z)||(n||(n=new Yr(s.Z)),r=s.Z),os(s.q)||(s.M=(s.q-1)*3+1),os(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),os(s.u)||(s.S=A
732j(s.u)),[Object.keys(s).reduce((o,c)=>{const u=t(c);return u&&(o[u]=s[c]),o},{}),n,r]}let xv=null;function XH(){return xv||(xv=vt.fromMillis(1555555555555)),xv}function JH(s,t){if(s.literal)return s;const n=Dr.macroTokenToFormatOpts(s.val),r=ZP(n,t);return r==null||r.includes(void 0)?s:r}function KP(s,t){return Array.prototype.concat(...s.map(n=>JH(n,t)))}class HP{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=KP(Dr.parseFormat(n),t),this.units=this.tokens.map(r=>KH(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,a]=ZH(this.units);this.regex=RegExp(r,"i"),this.handlers=a}}explainFromTokens(t){if(this.isValid){const[n,r]=YH(t,this.regex,this.handlers),[a,o,c]=r?QH(r):[null,null,void 0];if(Ku(r,"a")&&Ku(r,"H"))throw new mu("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:a,zone:o,specificOffset:c}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invali
vendor: 19,602 bytes, line 732
732dReason:null}}function GP(s,t,n){return new HP(s,n).explainFromTokens(t)}function eG(s,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:c}=GP(s,t,n);return[r,a,o,c]}function ZP(s,t){if(!s)return null;const r=Dr.create(t,s).dtFormatter(XH()),a=r.formatToParts(),o=r.resolvedOptions();return a.map(c=>GH(c,s,o))}const gv="Invalid DateTime",Bw=864e13;function yh(s){return new $i("unsupported zone",`the zone "${s.name}" is not supported`)}function yv(s){return s.weekData===null&&(s.weekData=f0(s.c)),s.weekData}function vv(s){return s.localWeekData===null&&(s.localWeekData=f0(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function Lc(s,t){const n={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new vt({...n,...t,old:n})}function YP(s,t,n){let r=s-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[s-Math.min(a,o)*60*1e3,Math.max(a,o)]}function px(s,t){s+=t*60*1e3;const n=new Date(s);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ex(s,t,n){return YP(lg(s),t,n)}function Kw(s,t){const n=s.o,r=s.c.year+Math.trunc(t.years),a=s.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...s.c,year:r,month:a,day:Math.min(s.c.day,p0(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},c=Ks.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),u=lg(o);let[h,x]=YP(u,n,s.zone);return c!==0&&(h+=c,x=s.zone.offset(h)),{ts:h,o:x}}function ou(s,t,n,r,a,o){const{setZone:c,zone:u}=n;if(s&&Object.keys(s).length!==0||t){const h=t||u,x=vt.fromObject(s,{...n,zone:h,specificOffset:o});return c?x:x.setZone(u)}else return vt.invalid(new $i("unparsable",`the input "${a}" can't be parsed as ${r}`))}function xx(s,t,n=!0){return s.isValid?Dr.create(nn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(s,t):null}function jv(s,t,n){const r=s.c.year>9999||s.c.year<0;let a="";if(r&&s.c.year>=0&&(a+="+"),a+=Kn(s.c.year,r?6:4),n==="year")return a;if(t){if(a+="-",a+=Kn(s.c.month),n==="month")return a;a+="-"}else if(a+=Kn(s.c.month),n==="month")return a;return a+=Kn(s.c.day),a}function Hw(s,t,n,r,a,o,c){let u=!n||s.c.millisecond!==0||s.c.second!==0,h="";switch(c){case"day":case"month":case"year":break;default:if(h+=Kn(s.c.hour),c==="hour")break;if(t){if(h+=":",h+=Kn(s.c.minute),c==="minute")break;u&&(h+=":",h+=Kn(s.c.second))}else{if(h+=Kn(s.c.minute),c==="minute")break;u&&(h+=Kn(s.c.second))}if(c==="second")break;u&&(!r||s.c.millisecond!==0)&&(h+=".",h+=Kn(s.c.millisecond,3))}return a&&(s.isOffsetFixed&&s.offset===0&&!o?h+="Z":s.o<0?(h+="-",h+=Kn(Math.trunc(-s.o/60)),h+=":",h+=Kn(Math.trunc(-s.o%60))):(h+="+",h+=Kn(Math.trunc(s.o/60)),h+=":",h+=Kn(Math.trunc(s.o%60)))),o&&(h+="["+s.zone.ianaName+"]"),h}const QP={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},tG={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},sG={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Tx=["year","month","day","hour","minute","second","millisecond"],nG=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],rG=["year","ordinal","hour","minute","second","millisecond"];function _x(s){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!t)throw new Q$(s);return t}function Gw(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return _x(s)}}function aG(s){if(vh===void 0&&(vh=On.now()),s.type!=="iana")return s.offset(vh);const t=s.name;let n=L1.get(t);return n===void 0&&(n=s.offset(vh),L1.set(t,n)),n}function Zw(s,t){const n=Io(t.zone,On.defaultZone);if(!n.isValid)return vt.invalid(yh(n));const r=nn.fromObject(t);let a,o;if(os(s.year))a=On.now();else{for(const h of Tx)os(s[h])&&(s[h]=QP[h]);const c=wP(s)||AP(s);if(c)return vt.invalid(c);const u=aG(n);[a,o]=Ex(s,u,n)}return new vt({ts:a,zone:n,loc:r,o})}function Yw(s,t,n){const r=os(n.round)?!0:n.round,a=os(n.rounding)?"trunc":n.rounding,o=(u,h)=>(u=Cj(u,r||n.calendary?0:2,n.calendary?"round":a),t.loc.clone(n).relFormatter(n).format(u,h)),c=u=>n.calendary?t.hasSame(s,u)?0:t.startOf(u).diff(s.startOf(u),u).get(u):t.diff(s,u).get(u);if(n.unit)return o(c(n.unit),n.unit);for(const u of n.units){const h=c(u);if(Math.abs(h)>=1)return o(h,u)}return o(s>t?-0:0,n.units[n.units.length-1])}function Qw(s){let t={},n;return s.length>0&&typeof s[s.length-1]=="object"?(t=s[s.length-1],n=Array.from(s).slice(0,s.length-1)):n=Array.from(s),[t,n]}let vh;const L1=new Map;class vt{constructor(t){const n=t.zone||On.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new $i("invalid input"):null)||(n.isValid?null:yh(n));this.ts=os(t.ts)?On.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const u=Go(t.o)&&!t.old?t.o:n.offset(this.ts);a=px(this.ts,u),r=Number.isNaN(a.year)?new $i("invalid input"):null,a=r?null:a,o=r?null:u}this._zone=n,this.loc=t.loc||nn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new vt({})}static local(){const[t,n]=Qw(arguments),[r,a,o,c,u,h,x]=n;return Zw({year:r,month:a,day:o,hour:c,minute:u,second:h,millisecond:x},t)}static utc(){const[t,n]=Qw(arguments),[r,a,o,c,u,h,x]=n;return t.zone=Yr.utcInstance,Zw({year:r,month:a,day:o,hour:c,minute:u,second:h,millisecond:x},t)}static fromJSDate(t,n={}){const r=RK(t)?t.valueOf():NaN;if(Number.isNaN(r))return vt.invalid("invalid input");const a=Io(n.zone,On.defaultZone);return a.isValid?new vt({ts:r,zone:a,loc:nn.fromObject(n)}):vt.invalid(yh(a))}static fromMillis(t,n={}){if(Go(t))return t<-Bw||t>Bw?vt.invalid("Timestamp out of range"):new vt({ts:t,zone:Io(n.zone,On.defaultZone),loc:nn.fromObject(n)});throw new _r(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Go(t))return new vt({ts:t*1e3,zone:Io(n.zone,On.defaultZone),loc:nn.fromObject(n)});throw new _r("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Io(n.zone,On.defaultZone);if(!r.isValid)return vt.invalid(yh(r));const a=nn.fromObject(n),o=x0(t,Gw),{minDaysInFirstWeek:c,startOfWeek:u}=Dw(o,a),h=On.now(),x=os(n.specificOffset)?r.offset(h):n.specificOffset,m=!os(o.ordinal),g=!os(o.year),y=!os(o.month)||!os(o.day),b=g||y,w=o.weekYear||o.weekNumber;if((b||m)&&w)throw new mu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(y&&m)throw new mu("Can't mix ordinal dates with month/day");const N=w||o.weekday&&!b;let k,E,P=px(h,x);N?(k=nG,E=tG,P=f0(P,c,u)):m?(k=rG,E=sG,P=pv(P)):(k=Tx,E=QP);let M=!1;for(const _ of k){const se=o[_];os(se)?M?o[_]=E[_]:o[_]=P[_]:M=!0}const L=N?DK(o,c,u):m?OK(o):wP(o),B=L||AP(o);if(B)return vt.invalid(B);const z=N?_w(o,c,u):m?Iw(o):o,[H,T]=Ex(z,x,r),U=new vt({ts:H,zone:r,o:T,loc:a});return o.weekday&&b&&t.weekday!==U.weekday?vt.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${U.toISO()}`):U.isValid?U:vt.invalid(U.invalid)}static fromISO(t,n={}){const[r,a]=SH(t);return ou(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=kH(t);return ou(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=$H(t);return ou(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(os(t)||os(n))throw new _r("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,c=nn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[u,h,x,m]=eG(c,t,n);return m?vt.invalid(m):ou(u,h,r,`format ${n}`,t,x)}static fromString(t,n,r={}){return vt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=OH(t);return ou(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the DateTime is invalid");const r=t instanceof $i?t:new $i(t,n);if(On.throwOnInvalid)throw new oK(r);return new vt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=ZP(t,nn.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return KP(Dr.parseFormat(t),nn.fromObject(n)).map(a=>a.val).join("")}static resetCache(){vh=void 0,L1.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?yv(this).weekYear:NaN}get weekNumber(){return this.isValid?yv(this).weekNumber:NaN}get weekday(){return this.isValid?yv(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?vv(this).weekday:NaN}get localWeekNumber(){return this.isValid?vv(this).weekNumber:NaN}get localWeekYear(){return this.isValid?vv(this).weekYear:NaN}get ordinal(){return this.isValid?pv(this.c).ordinal:NaN}get monthShort(){return this.isValid?hx.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?hx.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?hx.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?hx.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=lg(this.c),a=this.zone.offset(r-t),o=this.zone.offset(r+t),c=this.zone.offset(r-a*n),u=this.zone.offset(r-o*n);if(c===u)return[this];const h=r-c*n,x=r-u*n,m=px(h,c),g=px(x,u);return m.hour===g.hour&&m.minute===g.minute&&m.second===g.second&&m.millisecond===g.millisecond?[Lc(this,{ts:h}),Lc(this,{ts:x})]:[this]}get isInLeapYear(){return Pf(this.year)}get daysInMonth(){return p0(this.year,this.month)}get daysInYear(){return this.isValid?vu(this.year):NaN}get weeksInWeekYear(){return this.isValid?Gh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Gh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Dr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(Yr.instance(t),n)}toLocal(){return this.setZone(On.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Io(t,On.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),c=this.toObject();[a]=Ex(c,o,t)}return Lc(this,{ts:a,zone:t})}else return vt.invalid(yh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Lc(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=x0(t,Gw),{minDaysInFirstWeek:r,startOfWeek:a}=Dw(n,this.loc),o=!os(n.weekYear)||!os(n.weekNumber)||!os(n.weekday),c=!os(n.ordinal),u=!os(n.year),h=!os(n.month)||!os(n.day),x=u||h,m=n.weekYear||n.weekNumber;if((x||c)&&m)throw new mu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new mu("Can't mix ordinal dates with month/day");let g;o?g=_w({...f0(this.c,r,a),...n},r,a):os(n.ordinal)?(g={...this.toObject(),...n},os(n.day)&&(g.day=Math.min(p0(g.year,g.month),g.day))):g=Iw({...pv(this.c),...n});const[y,b]=Ex(g,this.o,this.zone);return Lc(this,{ts:y,o:b})}plus(t){if(!this.isValid)return this;const n=Ks.fromDurationLike(t);return Lc(this,Kw(this,n))}minus(t){if(!this.isValid)return this;const n=Ks.fromDurationLike(t).negate();return Lc(this,Kw(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},a=Ks.normalizeUnit(t);switch(a){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(a==="weeks")if(n){const o=this.loc.getStartOfWeek(),{weekday:c}=this;c<o&&(r.weekNumber=this.weekNumber-1),r.weekday=o}else r.weekday=1;if(a==="quarters"){const o=Math.ceil(this.month/3);r.month=(o-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Dr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):gv}toLocaleString(t=h0,n={}){return this.isValid?Dr.create(this.loc.clone(n),t).formatDateTime(this):gv}toLocaleParts(t={}){return this.isValid?Dr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1,precision:c="milliseconds"}={}){if(!this.isValid)return null;c=_x(c);const u=t==="extended";let h=jv(this,u,c);return Tx.indexOf(c)>=3&&(h+="T"),h+=Hw(this,u,n,r,a,o,c),h}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?jv(this,t==="extended",_x(n)):null}toISOWeekDate(){return xx(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:c="extended",precision:u="milliseconds"}={}){return this.isValid?(u=_x(u),(a&&Tx.indexOf(u)>=3?"T":"")+Hw(this,c==="extended",n,t,r,o,u)):null}toRFC2822(){return xx(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return xx(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?jv(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),xx(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():gv}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ks.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=MK(n).map(Ks.normalizeUnit),c=t.valueOf()>this.valueOf(),u=c?this:t,h=c?t:this,x=UH(u,h,o,a);return c?x.negate():x}diffNow(t="milliseconds",n={}){return this.diff(vt.now(),t,n)}until(t){return this.isValid?Dn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const a=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(n,r)<=a&&a<=o.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||vt.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let a=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(a=t.unit,o=void 0),Yw(n,this.plus(r),{...t,numeric:"always",units:a,unit:o})}toRelativeCalendar(t={}){return this.isValid?Yw(t.base||vt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(vt.isDateTime))throw new _r("min requires all arguments be DateTimes");return Ow(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(vt.isDateTime))throw new _r("max requires all arguments be DateTimes");return Ow(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,c=nn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return GP(c,t,n)}static fromStringExplain(t,n,r={}){return vt.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:a=null}=n,o=nn.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0});return new HP(o,t)}static fromFormatParser(t,n,r={}){if(os(t)||os(n))throw new _r("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:o=null}=r,c=nn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});if(!c.equals(n.locale))throw new _r(`fromFormatParser called with a locale of ${c}, but the format parser was created for ${n.locale}`);const{result:u,zone:h,specificOffset:x,invalidReason:m}=n.explainFromTokens(t);return m?vt.invalid(m):ou(u,h,r,`format ${n.format}`,t,x)}static get DATE_SHORT(){return h0}static get DATE_MED(){return X$}static get DATE_MED_WITH_WEEKDAY(){return uK}static get DATE_FULL(){return J$}static get DATE_HUGE(){return eP}static get TIME_SIMPLE(){return tP}static get TIME_WITH_SECONDS(){return sP}static get TIME_WITH_SHORT_OFFSET(){return nP}static get TIME_WITH_LONG_OFFSET(){return rP}static get TIME_24_SIMPLE(){return aP}static get TIME_24_WITH_SECONDS(){return iP}static get TIME_24_WITH_SHORT_OFFSET(){return lP}static get TIME_24_WITH_LONG_OFFSET(){return oP}static get DATETIME_SHORT(){return cP}static get DATETIME_SHORT_WITH_SECONDS(){return dP}static get DATETIME_MED(){return uP}static get DATETIME_MED_WITH_SECONDS(){return mP}static get DATETIME_MED_WITH_WEEKDAY(){return mK}static get DATETIME_FULL(){return hP}static get DATETIME_FULL_WITH_SECONDS(){return fP}static get DATETIME_HUGE(){return pP}static get DATETIME_HUGE_WITH_SECONDS(){return xP}}
732function ah(s){if(vt.isDateTime(s))return s;if(s&&s.valueOf&&Go(s.valueOf()))return vt.fromJSDate(s);if(s&&typeof s=="object")return vt.fromObject(s);throw new _r(`Unknown datetime argument: ${s}, of type ${typeof s}`)}function iG({billing:s,appointment:t,onSave:n}){const[r,a]=p.useState(!1),[o,c]=p.useState(""),[u,h]=p.useState(""),{toast:x}=Is(),m=dn(),{data:g}=nt({queryKey:["/api/session-appointments",s.appointmentId],queryFn:()=>st("GET",`/api/session-appointments/${s.appointmentId}`,null),enabled:r&&!!s.appointmentId,staleTime:0}),y=g||t;p.useEffect(()=>{if(r){if(y!=null&&y.scheduledDateEtIso){const w=vt.fromISO(y.scheduledDateEtIso,{setZone:!0});c(w.toFormat("HH:mm"))}else if(t!=null&&t.scheduledDateEtIso){const w=vt.fromISO(t.scheduledDateEtIso,{setZone:!0});c(w.toFormat("HH:mm"))}else c("14:00");h((y==null?void 0:y.notes)||(t==null?void 0:t.notes)||"")}},[r,s,y,t]);const b=async w=>{w.preventDefault();const N=new FormData(w.currentTarget),k=N.get("session-date"),E=N.get("session-time"),P=N.get("admin-note");if(!s.appointmentId){x({title:"Error",description:"No appointment ID found for this billing record",variant:"destructive"});return}try{await st("PUT",`/api/session-appointments/${s.appointmentId}`,{sessionDate:k,sessionTime:E+":00",duration:(y==null?void 0:y.durationMinutes)||(y==null?void 0:y.duration)||60,sessionNotes:P}),x({title:"Success",description:"Session details updated successfully"}),m.invalidateQueries({queryKey:["/api/session-appointments"]}),m.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),n(),a(!1)}catch(M){x({title:"Error",description:M.message,variant:"destructive"})}};return e.jsxs(es,{open:r,onOpenChange:a,children:[e.jsx(jr,{asChild:!0,children:e.jsx(F,{size:"sm",variant:"outline",children:"Edit Session Details"})}),e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Edit Session Details"})}),e.jsx("form",{onSubmit:b,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`session-date-${s.id}`,children:"Session Date (ET)"}),e.jsx(je,{id:`session-date-${s.id}`,name:"session-date",type:"date",defaultValue:y!=null&&y.scheduledDateEtIso?vt.fromISO(y.scheduledDateEtIso,{setZone:!0}).toFormat("yyyy-MM-dd"):s.scheduledDateEtIso?vt.fromISO(s.scheduledDateEtIso,{setZone:!0}).toFormat("yyyy-MM-dd"):"",required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`session-time-${s.id}`,children:"Session Time (ET)"}),e.jsx(je,{id:`session-time-${s.id}`,name:"session-time",type:"time",value:o,onChange:w=>c(w.target.value),required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`admin-note-${s.id}`,children:"Administrative Note"}),e.jsx(Pt,{id:`admin-note-${s.id}`,name:"admin-note",placeholder:"Add notes like: 'I canceled', 'mutual reschedule', 'joined group with student X', etc.",value:u,onChange:w=>h(w.target.value),rows:3}),e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"Use this for scheduling notes, cancellation reasons, grouping information, etc."})]}),e.jsx("div",{className:"text-sm text-gray-600",children:e.jsx("p",{children:"Changes will update both the appointment schedule and billing record."})}),e.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(F,{type:"submit",children:"Save Changes"})]})]})})]})]})}function lG(){const[s,t]=p.useState(""),[n,r]=p.useState(""),[a,o]=p.useState("");Is();const{data:c}=nt({queryKey:["/api/students/one-on-one"]}),{data:u=[],isLoading:h,refetch:x}=nt({queryKey:["session-archive-isolated",s,n,a],queryFn:()=>{const g=new URLSearchParams;return s&&g.append("startDate",s),n&&g.append("endDate",n),a&&a!=="all"&&g.append("studentId",a),console.log("ð FETCHING SESSION HISTORY:",g.toString()),fetch(`/api/session-history?${g}`,{headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}}).then(y=>{if(!y.ok)throw new Error("Failed to fetch session history");return y.json()}).then(y=>y&&y.data&&Array.isArray(y.data)?(console.log("ð SESSION HISTORY RECEIVED:",y.data.length,"sessions"),console.log("ð FIRST SESSION SAMPLE:",y.data[0]),y.data):(console.log("ð SESSION HISTORY (old format):",y),Array.isArray(y)?y:[]))},staleTime:0,gcTime:0,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:!0}),m=u.filter(g=>{var y;return["paid","waived","credited","voided"].includes((y=g.status)==null?void 0:y.toLowerCase())});
732return console.log("ð SESSION ARCHIVE VALIDATION:"),console.log("- Raw sessions from server:",u.length),console.log("- Filtered sessions displayed:",m.length),console.log("- First session sample:",m[0]),console.assert(m.length===u.length,"Session Archive filter should not exclude any server data"),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Historical Session Archive"}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsx("div",{children:e.jsx(je,{type:"date",placeholder:"Start Date",value:s,onChange:g=>t(g.target.value),className:"w-40"})}),e.jsx("div",{children:e.jsx(je,{type:"date",placeholder:"End Date",value:n,onChange:g=>r(g.target.value),className:"w-40"})}),e.jsx("div",{children:e.jsxs(St,{value:a,onValueChange:o,children:[e.jsx(At,{className:"w-48",children:e.jsx(kt,{placeholder:"Filter by student"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Students"}),c==null?void 0:c.map(g=>e.jsx(ce,{value:g.id.toString(),children:g.name},g.id))]})]})}),e.jsx(F,{onClick:()=>x(),variant:"outline",size:"sm",children:"ð Search"})]})]}),e.jsx("div",{className:"space-y-4",children:h?e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx("div",{className:"text-4xl mb-2",children:"â³"}),e.jsx("p",{children:"Loading session history..."})]}):m.length===0?e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx("div",{className:"text-4xl mb-2",children:"ð"}),e.jsx("p",{children:"No historical sessions found"}),e.jsx("p",{className:"text-sm",children:"Completed sessions with attendance records will appear here"})]}):m.map(g=>{var y,b;return e.jsx(Ce,{className:"border",children:e.jsx(Se,{className:"pt-4",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx(ti,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"font-semibold",children:g.studentName}),e.jsx(we,{variant:"outline",children:g.familyName||"Unknown Family"})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600 mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(an,{className:"w-4 h-4"}),e.jsx("span",{children:vt.fromISO(g.scheduledDateEtIso,{setZone:!0}).toLocaleString({weekday:"long",year:"numeric",month:"short",day:"numeric"})})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{children:extractTimeFromIso(g.scheduledDateEtIso)})]})]}),g.attendanceStatus&&e.jsxs("div",{className:"mb-3 p-3 bg-gray-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-medium",children:"Attendance Details"}),e.jsx(we,{variant:g.attendanceStatus==="present"?"default":g.attendanceStatus==="partial"?"secondary":"destructive",children:(y=g.attendanceStatus)==null?void 0:y.toUpperCase()})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[g.joinTime&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Join Time:"})," ",g.joinTime?`${new Date(g.joinTime).toLocaleTimeString("en-US",{timeZone:"America/New_York",hour:"numeric",minute:"2-digit",hour12:!0})} Eastern`:"N/A"]}),g.leaveTime&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Leave Time:"})," ",g.leaveTime?new Date(g.leaveTime).toLocaleTimeString("en-US",{timeZone:"America/New_York",hour:"numeric",minute:"2-digit",hour12:!0})+" Eastern":"N/A"]}),g.durationMinutes&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Duration:"})," ",g.durationMinutes," minutes"]}),g.attendanceStatus&&g.attendanceStatus!=="no-show"&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Attendance:"})," Present"]})]}),g.isZoomTracked&&e.jsxs("div",{className:"mt-2 flex items-center space-x-1 text-xs text-green-600",children:[e.jsx(v7,{className:"w-3 h-3"}),e.jsx("span",{children:"Automatically tracked via Zoom"})]})]}),e.jsxs("div",{className:"mb-3 p-3 bg-green-50 border border-green-200 rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-medium text-green-800",children:"Payment Status"}),e.jsx(we,{variant:g.status==="paid"?"default":g.status==="waived"?"secondary":g.status==="credited"?"outline":"destructive",className:g.status==="paid"?"bg-green-100 text-green-800":g.status==="waived"?"bg-blue-100 text-blue-800":g.status==="credited"?"bg-purple-100 text-purple-800":"bg-gray-100 text-gray-800",children:(b=g.status)==null?void 0:b.toUpperCase()})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm text-green-700",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Amount:"})," $",g.amount]}),g.payerType&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Payer Type:"})," ",g.payerType]}),g.rateVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Rate Version:"})," ",g.rateVersion]}),g.originChannel&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Origin:"})," ",g.originChannel]})]}),g.attendanceVerified&&e.jsxs("div",{className:"mt-2 flex items-center space-x-1 text-xs text-green-600",children:[e.jsx(As,{className:"w-3 h-3"}),e.jsx("span",{children:"Attendance Verified & Payment Complete"})]})]}),g.zoomAiSummary&&e.jsxs("div",{className:"mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx("div",{className:"w-2 h-2 bg-blue-400 rounded-full"}),e.jsx("span",{className:"font-medium text-blue-800",children:"AI Session Summary"})]}),e.jsx("p",{className:"text-sm text-blue-700",children:g.zoomAiSummary}),g.zoomMeetingTitle&&e.jsxs("div",{className:"mt-2 text-xs text-blue-600",children:["Meeting: ",g.zoomMeetingTitle]})]}),(g.sessionNotes||g.notes)&&e.jsxs("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx("div",{className:"w-2 h-2 bg-yellow-400 rounded-full"}),e.jsx("span",{className:"font-medium text-yellow-800",children:"Session Notes"})]}),e.jsx("p",{className:"text-sm text-yellow-700",children:g.sessionNotes||g.notes})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs(we,{variant:"secondary",className:"mb-2",children:["Session #",g.appointmentId]}),g.attendanceCreatedAt&&e.jsxs("div",{className:"text-xs text-gray-500",children:["Recorded: ",new Date(g.attendanceCreatedAt).toLocaleDateString()]})]})]})})},g.appointmentId)})})]})}function V1(){const[s,t]=p.useState("appointments"),[n,r]=p.useState(new Date),[a,o]=p.useState("week"),[c,u]=p.useState(!1),[h,x]=p.useState(null),[m,g]=p.useState(""),[y,b]=p.useState(""),[w,N]=p.useState(""),[k,E]=p.useState(60),[P,M]=p.useState(!1),[L,B]=p.useState("weekly"),[z,H]=p.useState(""),[T,U]=p.useState(""),{toast:_}=Is(),se=dn(),ae=Y=>Y.split("T")[1].substring(0,5),W=Y=>{const[Te,Be]=Y.split(":"),ht=parseInt(Te),Mt=ht>=12?"PM":"AM";return`${ht===0?12:ht>12?ht-12:ht}:${Be} ${Mt}`},{data:J=[]}=nt({queryKey:["/api/students/one-on-one"],enabled:!0}),{data:ne=[]}=nt({queryKey:["/api/session-appointments"],enabled:!0}),{data:le=[]}=nt({queryKey:["/api/session-billing-with-attendance"],queryFn:async()=>{const Y=await fetch("/api/session-billing-with-attendance");if(!Y.ok)throw new Error("Failed to fetch billing with attendance data");return Y.json()},enabled:!0}),{data:V}=nt({queryKey:["/api/zoom/status"],enabled:!0}),{data:Z}=nt({queryKey:["/api/session-stats"],enabled:!0});p.useEffect(()=>{(async()=>{try{console.log("Starting Zoom polling on session-scheduling page load..."),await fetch("/api/zoom/start-polling",{method:"POST"}),console.log("Zoom polling started successfully")}catch(Te){console.log("Zoom polling already running or error:",Te)}})(),se.invalidateQueries({queryKey:["/api/session-appointments"]}),se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),se.invalidateQueries({queryKey:["/api/zoom/status"]}),se.invalidateQueries({queryKey:["/api/session-history"]}),se.invalidateQueries({queryKey:["/api/session-stats"]})},[se]);const ue=bt({mutationFn:async Y=>st("POST","/api/session-appointments",Y),onSuccess:Y=>{var Be;const Te=((Be=Y.recurring)==null?void 0:Be.appointmentsCreated)>0?`Session scheduled successfully! Created ${Y.recurring.appointmentsCreated+1} total appointments (${Y.recurringPattern})`:"1:1 session scheduled successfully with Zoom meeting created.";se.invalidateQueries({queryKey:["/api/session-appointments"]}
732),u(!1),Ae(),_({title:"Appointment Created",description:Te})},onError:Y=>{_({title:"Error",description:Y.message||"Failed to create appointment",variant:"destructive"})}}),ge=bt({mutationFn:async({id:Y,...Te})=>st("PUT",`/api/session-appointments/${Y}`,Te),onSuccess:()=>{se.invalidateQueries({queryKey:["/api/session-appointments"]}),u(!1),x(null),Ae(),_({title:"Appointment Updated",description:"Session details updated successfully."})}}),G=bt({mutationFn:async Y=>st("DELETE",`/api/session-appointments/${Y}`),onSuccess:()=>{se.invalidateQueries({queryKey:["/api/session-appointments"]}),_({title:"Appointment Deleted",description:"Session cancelled and removed from calendar."})}}),Ae=()=>{g(""),b(""),N(""),E(60),M(!1),B("weekly"),H(""),U("")},Fe=()=>{if(!m||!y||!w){_({title:"Missing Information",description:"Please select student, date, and time.",variant:"destructive"});return}const Y=J.find(ht=>ht.id.toString()===m);if(!Y)return;const Te=ne.some(ht=>ht.studentId===Y.id&&ht.status==="completed")?125:150,Be={studentId:parseInt(m),familyId:Y.familyId,sessionDate:y,sessionTime:w,duration:k,isRecurring:P,recurringPattern:P?L:null,recurringEndDate:P?z:null,sessionNotes:T,rate:Te,status:"scheduled",billingStatus:"pending"};ue.mutate(Be)},be=Y=>{x(Y),g(Y.studentId.toString()),b(Y.scheduledDateEtIso?vt.fromISO(Y.scheduledDateEtIso,{setZone:!0}).toFormat("yyyy-MM-dd"):""),N(ae(Y.scheduledDateEtIso)),E(Y.duration),M(Y.isRecurring),B(Y.recurringPattern||"weekly"),H(Y.recurringEndDate||""),U(Y.sessionNotes||""),u(!0)},Me=()=>{if(!h)return;const Y={id:h.id,sessionDate:y,sessionTime:w,duration:k,sessionNotes:T,isRecurring:P,recurringPattern:P?L:null,recurringEndDate:P?z:null};ge.mutate(Y)},R=Y=>{switch(Y){case"completed":return"default";case"scheduled":return"secondary";case"cancelled":return"destructive";case"no-show":return"outline";default:return"secondary"}},re=Y=>{switch(Y){case"completed":return e.jsx(As,{className:"w-4 h-4"});case"cancelled":return e.jsx(P0,{className:"w-4 h-4"});case"no-show":return e.jsx(Qr,{className:"w-4 h-4"});default:return e.jsx(ys,{className:"w-4 h-4"})}},me=(()=>{if(!ne||ne.length===0)return[];const Y=new Date;if(a==="week"){const Te=new Date(Y),Be=Y.getDay();Te.setDate(Y.getDate()-Be),Te.setHours(0,0,0,0);const ht=new Date(Te);return ht.setDate(Te.getDate()+13),ht.setHours(23,59,59,999),ne.filter(Mt=>{const $=vt.fromISO(Mt.scheduledDateEtIso,{setZone:!0}).toJSDate();return $>=Te&&$<=ht})}else return ne.filter(Te=>{const Be=vt.fromISO(Te.scheduledDateEtIso,{setZone:!0}).toJSDate();return Be.getMonth()===Y.getMonth()&&Be.getFullYear()===Y.getFullYear()})})();return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold text-[#4A4A4A]",children:"1:1 Session Scheduling"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Manage individual student sessions with Zoom integration"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-4",children:[e.jsxs(St,{value:a,onValueChange:Y=>o(Y),children:[e.jsx(At,{className:"w-32",children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"week",children:"Week View"}),e.jsx(ce,{value:"month",children:"Month View"})]})]}),e.jsxs(es,{open:c,onOpenChange:u,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{onClick:()=>{x(null),Ae()},children:[e.jsx(fa,{className:"w-4 h-4 mr-2"}),"Schedule Session"]})}),e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{children:h?"Edit Session":"Schedule New 1:1 Session"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"student",children:"Student"}),e.jsxs(St,{value:m,onValueChange:g,disabled:!!h,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select student"})}),e.jsx(Ct,{children:J.map(Y=>e.jsx(ce,{value:Y.id.toString(),children:Y.name},Y.id))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"date",children:"Date"}),e.jsx(je,{type:"date",value:y,onChange:Y=>b(Y.target.value)})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"time",children:"Time"}),e.jsx(je,{type:"time",value:w,onChange:Y=>N(Y.target.value)})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"duration",children:"Duration (minutes)"}),e.jsxs(St,{value:k.toString(),onValueChange:Y=>E(parseInt(Y)),children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"30",children:"30 minutes"}),e.jsx(ce,{value:"45",children:"45 minutes"}),e.jsx(ce,{value:"60",children:"60 minutes"}),e.jsx(ce,{value:"90",children:"90 minutes"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(m0,{checked:P,onCheckedChange:M}),e.jsx(Ne,{children:"Recurring Session"})]}),P&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"pattern",children:"Recurring Pattern"}),e.jsxs(St,{value:L,onValueChange:B,children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"weekly",children:"Weekly"}),e.jsx(ce,{value:"biweekly",children:"Bi-weekly"}),e.jsx(ce,{value:"monthly",children:"Monthly"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"recurring-end-date",children:"End Date (Optional)"}),e.jsx(je,{id:"recurring-end-date",type:"date",value:z,onChange:Y=>H(Y.target.value),placeholder:"Leave empty for indefinite"}),e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"Leave empty to continue indefinitely"})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"notes",children:"Session Notes"}),e.jsx(Pt,{placeholder:"Add any notes about this session...",value:T,onChange:Y=>U(Y.target.value)})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(F,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),e.jsx(F,{onClick:h?Me:Fe,disabled:ue.isPending||ge.isPending,children:h?"Update Session":"Schedule Session"})]})]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(an,{className:"h-4 w-4 text-blue-600"}),e.jsxs("div",{className:"ml-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Sessions"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(Z==null?void 0:Z.totalSessions)||0})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(As,{className:"h-4 w-4 text-green-600"}),e.jsxs("div",{className:"ml-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Completed"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(Z==null?void 0:Z.completed)||0})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(ys,{className:"h-4 w-4 text-yellow-600"}),e.jsxs("div",{className:"ml-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Upcoming"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(Z==null?void 0:Z.upcoming)||0})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(ti,{className:"h-4 w-4 text-purple-600"}),e.jsxs("div",{className:"ml-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"1:1 Students"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(J==null?void 0:J.length)||0})]})]})})})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex border-b",children:[e.jsxs("button",{className:`px-4 py-2 font-medium text-sm transition-colors duration-200 ${s==="appointments"?"border-b-2 border-[#77dbf6] text-[#77dbf6]":"text-[#4A4A4A]/70 hover:text-[#4A4A4A]"}`,onClick:()=>t("appointments"),children:[e.jsx(an,{className:"w-4 h-4 mr-2 inline"}),"Session Schedule"]}),e.jsx("button",{className:`px-4 py-2 font-medium text-sm transition-colors duration-200 ${s==="billing"?"border-b-2 border-[#77dbf6] text-[#77dbf6]":"text-[#4A4A4A]/70 hover:text-[#4A4A4A]"}`,onClick:()=>t("billing"),children:"ð° Billing Management"}),e.jsx("button",{className:`px-4 py-2 font-medium text-sm transition-colors duration-200 ${s==="archive"?"border-b-2 border-[#77dbf6] text-[#77dbf6]":"text-[#4A4A4A]/70 hover:text-[#4A4A4A]"}`,onClick:()=>t("archive"),children:"ð Session Archive"}),e.jsx("button",{className:`px-4 py-2 font-medium text-sm ${s==="availability"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-700"}`,onClick:()=>t("availability"),children:"ð
Availability Calendar"})]})}),e.jsxs(Se,{children:[s==="appointments"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:a==="week"?"Upcoming Sessions":"This Month's Sessions"}),e.jsxs(St,{value:a,onValueChange:Y=>o(Y),children:[e.jsx(At,{className:"w-32",children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"week",children:"Week View"}),e.jsx(ce,{value:"month",children:"Month View"})]})]})]}),me.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(an,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),e.jsxs("p",{className:"text-gray-500",children:["No sessions scheduled for this ",a]}),e.jsx(F,{variant:"outline",className:"mt-4",onClick:()=>u(!0),children:"Schedule Your First Session"})]}):e.jsx("div",{className:"space-y-4",children:me.map(Y=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"font-medium",children:Y.studentName}),e.jsxs("p",{className:"text-sm text-gray-600",children:[vt.fromISO(Y.scheduledDateEtIso,{setZone:!0}
732).toLocaleString({weekday:"long",year:"numeric",month:"short",day:"numeric"})," at ",W(ae(Y.scheduledDateEtIso))]})]}),e.jsxs(we,{variant:R(Y.status),children:[re(Y.status),e.jsx("span",{className:"ml-1 capitalize",children:Y.status})]}),Y.zoomMeetingUrl&&e.jsxs(we,{variant:"outline",children:[e.jsx(v7,{className:"w-3 h-3 mr-1"}),"Zoom Ready"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["$",Y.rate]}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>be(Y),children:e.jsx(Zr,{className:"w-4 h-4"})}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>G.mutate(Y.id),children:e.jsx(pa,{className:"w-4 h-4"})})]})]},Y.id))})]}),s==="billing"&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Session Billing Management"}),e.jsx("div",{className:"flex space-x-2",children:e.jsx(F,{onClick:()=>se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),variant:"outline",size:"sm",children:"Refresh Billing"})})]}),e.jsx("div",{className:"space-y-4",children:le.length===0?e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx("div",{className:"text-4xl mb-2",children:"ð°"}),e.jsx("p",{children:"No billing records found"}),e.jsx("p",{className:"text-sm",children:"Billing records are automatically created after session attendance is processed"}),e.jsx("p",{className:"text-sm mt-2",children:"Billing records are created automatically by the backend Zoom automation system"})]}):le.map(Y=>e.jsx(Ce,{className:"border",children:e.jsxs(Se,{className:"pt-4",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-lg",children:Y.studentName}),e.jsx("p",{className:"text-sm text-gray-600",children:Y.familyName}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Session: ",vt.fromISO(Y.scheduledDateEtIso,{setZone:!0}).toLocaleString({weekday:"long",year:"numeric",month:"short",day:"numeric"})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"font-bold text-xl",children:["$",Y.amount]}),e.jsx(we,{variant:Y.status==="paid"?"default":Y.status==="billed"?"outline":Y.status==="waived"?"secondary":"destructive",className:Y.status==="billed"?"bg-blue-50 text-blue-700 border-blue-200":Y.status==="pending"?"bg-yellow-50 text-yellow-700 border-yellow-200":"",children:Y.status.toUpperCase()})]})]}),e.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[e.jsxs("div",{className:"flex space-x-2",children:[e.jsxs(we,{variant:"outline",children:[Y.chargeReason==="completed"&&Y.attendanceVerified&&"â
Attendance Verified",Y.chargeReason==="completed"&&!Y.attendanceVerified&&"â ï¸ Attendance Not Verified",Y.chargeReason==="no_show"&&"â No Show",Y.chargeReason==="late_cancel"&&"â° Late Cancellation",Y.chargeReason==="admin_charge"&&"ð¤ Admin Charge"]}),Y.cancellationPolicy&&e.jsx(we,{variant:"outline",className:"bg-orange-50 text-orange-700",children:"24-Hour Policy Applied"})]}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(iG,{billing:Y,appointment:ne.find(Te=>Te.id===Y.appointmentId),onSave:()=>{se.invalidateQueries({queryKey:["/api/session-appointments"]}),se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]})}}),Y.status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{size:"sm",variant:"outline",onClick:()=>{st("PUT",`/api/session-billing/${Y.id}`,{billingStatus:"waived",waiveReason:"Admin override - case by case exception"}).then(()=>{_({title:"Success",description:"Billing record waived"}),se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),se.invalidateQueries({queryKey:["/api/session-history"]})}).catch(Te=>{_({title:"Error",description:Te.message,variant:"destructive"})})},children:"Waive Charge"}),e.jsx(F,{size:"sm",onClick:()=>{st("PUT",`/api/session-billing/${Y.id}`,{billingStatus:"paid"}).then(()=>{_({title:"Success",description:"Billing record marked as paid"}),se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),se.invalidateQueries({queryKey:["/api/session-history"]})}).catch(Te=>{_({title:"Error",description:Te.message,variant:"destructive"})})},children:"Mark Paid"})]}),Y.status==="waived"&&e.jsx(F,{size:"sm",variant:"outline",onClick:()=>{st("PUT",`/api/session-billing/${Y.id}`,{billingStatus:"pending",waiveReason:null}).then(()=>{_({title:"Success",description:"Billing record unwaived - status changed back to pending"}),se.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),se.invalidateQueries({queryKey:["/api/session-history"]})}).catch(Te=>{_({title:"Error",description:Te.message,variant:"destructive"})})},children:"Unwaive Charge"})]})]}),Y.waiveReason&&e.jsx("div",{className:"mt-3 p-3 bg-yellow-50 border border-yellow-200 rounded",children:e.jsxs("p",{className:"text-sm text-yellow-800",children:[e.jsx("strong",{children:"Waive Reason:"})," ",Y.waiveReason]})})]})},Y.id))})]}),s==="archive"&&e.jsx(lG,{}),s==="availability"&&e.jsx(lK,{})]})]})]})})}function oG(){const{toast:s}=Is(),t=dn(),[n,r]=p.useState(null),{data:a,isLoading:o}=nt({queryKey:["/api/admin/incomplete-registrations"]}),{data:c}=nt({queryKey:["/api/admin/reminder-scheduler/status"]}),u=bt({mutationFn:async()=>(await fetch("/api/admin/incomplete-registrations/run-check",{method:"POST",headers:{"Content-Type":"application/json"}})).json(),onSuccess:b=>{s({title:"Manual Check Complete",description:`Sent: ${b.sent}, Failed: ${b.failed}, Skipped: ${b.skipped}`}),t.invalidateQueries({queryKey:["/api/admin/incomplete-registrations"]})},onError:b=>{s({title:"Check Failed",description:b.message||"Failed to run manual check",variant:"destructive"})}}),h=bt({mutationFn:b=>st("/api/admin/incomplete-registrations/mark-do-not-email","POST",b),onSuccess:()=>{s({title:"User Updated",description:"User marked as do-not-email successfully"}),t.invalidateQueries({queryKey:["/api/admin/incomplete-registrations"]}),r(null)},onError:b=>{s({title:"Update Failed",description:b.message||"Failed to mark user as do-not-email",variant:"destructive"})}}),x=b=>{confirm(`Mark ${b} as do-not-email? They will stop receiving reminder emails.`)&&h.mutate({email:b,reason:"admin_marked"})},m=b=>b.accountStatus==="do-not-email"?e.jsx(we,{variant:"secondary",children:"Do Not Email"}):b.hasFamily?b.hasStudents?e.jsx(we,{variant:"default",children:"Incomplete"}):e.jsx(we,{variant:"destructive",children:"No Students"}):e.jsx(we,{variant:"destructive",children:"No Family Record"}),g=b=>{const w=new Date(b);return Math.floor((new Date().getTime()-w.getTime())/(1e3*60*60*24))},y=b=>{const w=g(b.createdAt),N=b.remindersSent||0;return N===0&&w>=3?"Due now (3 days)":N===1&&w>=7?"Due now (7 days)":N===2&&w>=14?"Due now (14 days)":N>=3?"Complete":N===0?`Day ${3-w} (3 days)`:N===1?`Day ${7-w} (7 days)`:N===2?`Day ${14-w} (14 days)`:"Pending"};return o?e.jsx("div",{className:"container mx-auto p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading incomplete registrations..."})]})})}):e.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Incomplete Registration Management"}),e.jsx("p",{className:"text-muted-foreground",children:"Monitor and manage automated follow-up emails for incomplete user registrations"})]})}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(p7,{className:"h-5 w-5"}),"Automated Scheduler Status"]}),e.jsx(rn,{children:"Daily reminder emails are sent automatically at 9:00 AM ET"})]}),e.jsx(Se,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{variant:c!=null&&c.isRunning?"default":"secondary",children:c!=null&&c.isRunning?"Running":"Idle"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Next run: ",(c==null?void 0:c.nextRun)||"Unknown"]})]})}),e.jsxs(F,{onClick:()=>u.mutate(),disabled:u.isPending,className:"flex items-center gap-2",children:[e.jsx(TF,{className:"h-4 w-4"}),"Run Manual Check"]})]})})]}),a&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.length}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Incomplete"})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ir,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:(a==null?void 0:a.filter(b=>b.accountStatus!=="do-not-email").length)||0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Eligible for Email"})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qr,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:(a==null?void 0:a.filter(b=>!b.hasFamily).length)||0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No Family Record"})]})]})})}),e.jsx(Ce,{children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qr,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:(a==null?void 0:a.filter(b=>b.hasFamily&&!b.hasStudents).length)||0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No Student Records"})]})]})})})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsx(Ue,{children:"Incomplete Registrations"}),e.jsx(rn,{children:"Users who have started but not completed the registration process"})]}),e.jsx(Se,{children:!a||(a==null?void 0:a.length)===0?e.jsxs(B0,{children:[e.jsx(Qr,{className:"h-4 w-4"}
732),e.jsx(K0,{children:"No incomplete registrations found. All users have completed their registration process."})]}):e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"User"}),e.jsx(zt,{children:"Email"}),e.jsx(zt,{children:"Status"}),e.jsx(zt,{children:"Days Since Created"}),e.jsx(zt,{children:"Reminders Sent"}),e.jsx(zt,{children:"Next Reminder"}),e.jsx(zt,{children:"Actions"})]})}),e.jsx(dl,{children:a==null?void 0:a.map(b=>e.jsxs(Un,{children:[e.jsx(Vt,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium",children:[b.firstName," ",b.lastName]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",b.id]})]})}),e.jsx(Vt,{children:e.jsx("code",{className:"text-xs",children:b.email})}),e.jsx(Vt,{children:m(b)}),e.jsxs(Vt,{children:[g(b.createdAt)," days"]}),e.jsx(Vt,{children:e.jsxs(we,{variant:"outline",children:[b.remindersSent||0,"/3"]})}),e.jsx(Vt,{children:e.jsx("span",{className:"text-xs",children:y(b)})}),e.jsx(Vt,{children:b.accountStatus!=="do-not-email"&&e.jsx(F,{variant:"outline",size:"sm",onClick:()=>x(b.email),disabled:h.isPending,children:"Mark Do Not Email"})})]},b.id))})]})})]})]})}function Xw(){const[s,t]=p.useState("students");return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:"/images/enrolllogo.png",alt:"AAC Voices Enrollment",className:"h-16 w-auto"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold tracking-tight text-[#4A4A4A]",children:"Enrollment Management"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Manage students, class enrollment, 1:1 sessions, and incomplete registrations"})]})]})}),e.jsxs(Ql,{value:s,onValueChange:t,className:"w-full",children:[e.jsxs(pl,{className:"grid w-full grid-cols-4 bg-[#77dbf6]/10 border-[#77dbf6]/20 h-auto",children:[e.jsx(qs,{value:"students",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-2 sm:px-4 py-2 sm:py-3",children:"Students"}),e.jsx(qs,{value:"class-enrollment",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-1 sm:px-2 py-2 sm:py-3",children:"Classes"}),e.jsx(qs,{value:"sessions",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-1 sm:px-2 py-2 sm:py-3",children:"1:1 Sessions"}),e.jsx(qs,{value:"incomplete",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-1 sm:px-2 py-2 sm:py-3",children:"Incomplete"})]}),e.jsx(Hs,{value:"students",className:"space-y-4",children:e.jsx(h1,{})}),e.jsx(Hs,{value:"class-enrollment",className:"space-y-4",children:e.jsx($1,{})}),e.jsx(Hs,{value:"sessions",className:"space-y-4",children:e.jsx(V1,{})}),e.jsx(Hs,{value:"incomplete",className:"space-y-4",children:e.jsx(oG,{})})]})]})})}function Jw(){const[s,t]=p.useState("all"),[n,r]=p.useState(""),[a,o]=p.useState("all"),[c,u]=p.useState("all"),[h,x]=p.useState("all"),[m,g]=p.useState("all"),[y,b]=p.useState("all"),[w,N]=p.useState("all"),[k,E]=p.useState(""),[P,M]=p.useState(""),[L,B]=p.useState(""),[z,H]=p.useState(""),[T,U]=p.useState(""),[_,se]=p.useState(""),[ae,W]=p.useState(!1),[J,ne]=p.useState(!1),{data:le=[],isLoading:V}=nt({queryKey:["/api/admin/enrollment-payment-dashboard",s],queryFn:async()=>{let R="/api/admin/enrollment-payment-dashboard";s==="ahern"?R="/api/admin/enrollment-payment-dashboard/ahern-academy":s==="open"&&(R="/api/admin/enrollment-payment-dashboard/open-enrollment");const re=await fetch(R,{credentials:"include"});if(!re.ok)throw new Error(`Failed to fetch data: ${re.statusText}`);return re.json()},enabled:!0}),Z=p.useMemo(()=>{const R=[{value:"all",label:"All Payment Statuses"},{value:"balance_due",label:"Balance Due"},{value:"paid_in_full",label:"Paid in Full"},{value:"overpaid",label:"Overpaid"},{value:"unconfirmed_enrollment",label:"Unconfirmed Enrollment"}],re=Array.from(new Set(le.map(O=>
732O.paymentStatus).filter(Boolean)));return re.forEach(O=>{R.find(me=>me.value===O)||R.push({value:O,label:O.replace(/_/g," ").replace(/\b\w/g,me=>me.toUpperCase())})}),console.log("ð¯ PAYMENT STATUS OPTIONS:",R,"Data statuses:",re),R},[le]),ue=p.useMemo(()=>{(m!=="all"||w!=="all")&&console.log("ð FILTER DEBUG:",{sessionFilter:m,paymentStatusFilter:w,enrollmentDataLength:(le==null?void 0:le.length)||0,firstFewItems:(le==null?void 0:le.slice(0,3).map(O=>({studentName:O.studentName,sessionName:O.sessionName,paymentStatus:O.paymentStatus,sessionMatch:m==="all"||O.sessionName&&O.sessionName.trim()===m.trim(),paymentMatch:w==="all"||O.paymentStatus===w})))||[]});let R=0,re=le.filter(O=>{var Le,A,D,ie,$e;const me=n===""||((Le=O.studentName)==null?void 0:Le.toLowerCase().includes(n.toLowerCase()))||((A=O.familyName)==null?void 0:A.toLowerCase().includes(n.toLowerCase()))||((D=O.familyEmail)==null?void 0:D.toLowerCase().includes(n.toLowerCase()))||((ie=O.sessionName)==null?void 0:ie.toLowerCase().includes(n.toLowerCase()))||O.enrollments&&Array.isArray(O.enrollments)&&O.enrollments.some(ke=>{var S;return(S=ke.className)==null?void 0:S.toLowerCase().includes(n.toLowerCase())})||(($e=O.className)==null?void 0:$e.toLowerCase().includes(n.toLowerCase())),Y=ke=>(ke||"").toLowerCase().replace(/[\s_-]+/g,"_").replace(/[()]/g,""),Te=w==="all"||Y(O.paymentStatus)===Y(w),Be=y==="all"||O.enrollmentStatus===y,ht=m==="all"||O.sessionName&&O.sessionName.trim()===m.trim(),Mt=h==="all"||O.enrollments&&Array.isArray(O.enrollments)&&O.enrollments.some(ke=>ke.className===h)||O.className&&O.className.trim()===h.trim();let $=!0;if(k||P){const ke=O.enrollmentDate?new Date(O.enrollmentDate):null;if(ke){if(k){const S=new Date(k);$=$&&ke>=S}if(P){const S=new Date(P);S.setHours(23,59,59,999),$=$&&ke<=S}}else $=!1}const K=parseFloat(O.expectedCost)||0,xe=parseFloat(O.balanceDue)||0,De=(!L||K>=parseFloat(L))&&(!z||K<=parseFloat(z)),X=(!T||xe>=parseFloat(T))&&(!_||xe<=parseFloat(_)),_e=me&&Te&&Be&&ht&&Mt&&$&&De&&X;return(le==null?void 0:le.length)>0&&R<3&&(h!=="all"||w!=="all"||y!=="all")&&(console.log("ð FILTER DEBUG:",{studentName:O.studentName,enrollmentStatus:O.enrollmentStatus,enrollmentStatusFilter:y,paymentStatus:O.paymentStatus,paymentStatusFilter:w,className:O.className,classFilter:h,matchesEnrollmentStatus:Be,matchesPaymentStatus:Te,matchesClass:Mt,result:_e}),R++),_e});if(ae){const O=new Map;return re.forEach(me=>{const Y=`${me.familyId}-${me.familyName}`;O.has(Y)||O.set(Y,{familyId:me.familyId,familyName:me.familyName,familyEmail:me.familyEmail,enrollments:[],totalExpected:0,totalReceived:0,totalBalance:0});const Te=O.get(Y);Te.enrollments.push(me),Te.totalExpected+=parseFloat(me.expectedCost)||0,Te.totalReceived+=parseFloat(me.totalPaymentsReceived)||0,Te.totalBalance+=parseFloat(me.balanceDue)||0}),Array.from(O.values())}return console.log("ð FILTER RESULT:",{originalLength:(le==null?void 0:le.length)||0,filteredLength:re.length,groupByFamily:ae,finalResultLength:ae?Array.from(new Set(re.map(O=>O.familyId))).length:re.length}),re},[le,n,w,y,m,h,k,P,L,z,T,_,ae]),ge=p.useMemo(()=>{const R=le,re=R.length,O=R.reduce((De,X)=>De+(parseFloat(X.expectedCost)||0),0),me=R.reduce((De,X)=>De+(parseFloat(X.balanceDue)||0),0),Y=R.reduce((De,X)=>De+(parseFloat(X.totalPaymentsReceived)||0),0),Te=R.filter(De=>De.paymentStatus==="Paid in full").length,Be=R.filter(De=>De.paymentStatus==="Balance due"||De.paymentStatus==="Partial payment").length,ht=R.filter(De=>De.paymentStatus==="Unconfirmed enrollment").length,$=new Set(R.map(De=>De.familyId)).size;let K={};if(s==="ahern"){const De=R.filter(Le=>Le.paymentPreference==="monthly").length,X=R.filter(Le=>Le.paymentPreference==="trimester").length,_e=R.filter(Le=>Le.paymentPreference==="yearly").length;K={monthlyFamilies:De,trimesterFamilies:X,yearlyFamilies:_e,averagePayment:Y>0?Y/Te:0}}else if(s==="open"){const De=new Map;R.forEach(X=>{const _e=X.enrollmentCount||1;De.set(_e,(De.get(_e)||0)+1)}),K={classCountDistribution:Object.fromEntries(De),unconfirmedCount:ht,averagePayment:Y>0?Y/Math.max(Te,1):0}}const xe=R.length>0?R[0].sessionName:null;return{totalEnrollments:re,totalFamilies:$,totalExpected:O,totalReceived:Y,totalBalanceDue:me,paidCount:Te,balanceDueCount:Be,unconfirmedCount:ht,currentSessionName:xe,collectionRate:O>0?Y/O*100:0,...K}},[le,s]),G=p.useMemo(()=>{const R=Array.from(new Set(le.map(re=>
732re.sessionName).filter(Boolean)));return console.log("ð¯ ALL SESSION NAMES:",R),R},[le]),Ae=p.useMemo(()=>{const R=new Set;le.forEach(O=>{O.enrollments&&Array.isArray(O.enrollments)&&O.enrollments.forEach(me=>{me.className&&R.add(me.className)}),O.className&&R.add(O.className)});const re=Array.from(R).filter(Boolean);return console.log("ð¯ FIXED DROPDOWN CLASSES:",re),re},[le]),Fe=p.useMemo(()=>Array.from(new Set(le.map(R=>R.enrollmentStatus).filter(Boolean))),[le]),be=()=>{r(""),g("all"),x("all"),N("all"),b("all"),E(""),M(""),B(""),H(""),U(""),se(""),W(!1)},Me=R=>{t(R),be()};return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:"/images/enrolllogo.png",alt:"AAC Voices Payment Enrollment",className:"h-16 w-auto"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold tracking-tight text-[#4A4A4A]",children:"Payment Enrollment Dashboard"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Monitor enrollment payments by program type"})]})]})}),e.jsxs(Ql,{value:s,onValueChange:Me,className:"w-full",children:[e.jsxs(pl,{className:"grid w-full grid-cols-3",children:[e.jsxs(qs,{value:"all",className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"h-4 w-4"}),"All Programs"]}),e.jsxs(qs,{value:"ahern",className:"flex items-center gap-2",children:[e.jsx(ar,{className:"h-4 w-4"}),"Ahern Academy"]}),e.jsxs(qs,{value:"open",className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"h-4 w-4"}),"Open Enrollment"]})]}),e.jsx(Hs,{value:s,className:"mt-6",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:s==="all"?"Total Enrollments":s==="ahern"?"Ahern Academy Enrollments":"Open Enrollment Enrollments"}),e.jsx(Ms,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"text-2xl font-bold",children:ge.totalEnrollments}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ge.totalFamilies," families",ge.currentSessionName&&e.jsx("span",{className:"block font-medium text-blue-600",children:ge.currentSessionName})]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Payments Received"}),e.jsx(xf,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",ge.totalReceived.toFixed(2)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ge.collectionRate.toFixed(1),"% collection rate"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Expected Revenue"}),e.jsx(xr,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",ge.totalExpected.toFixed(2)]}),s==="ahern"&&ge.averagePayment&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Avg: $",ge.averagePayment.toFixed(0)," per family"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ue,{className:"text-sm font-medium",children:"Outstanding Balance"}),e.jsx(DF,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Se,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",ge.totalBalanceDue.toFixed(2)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ge.balanceDueCount," need payment",s==="open"&&ge.unconfirmedCount>0&&e.jsxs("span",{children:[", ",ge.unconfirmedCount," unconfirmed"]})]})]})]})]}),s==="ahern"&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:e.jsxs(Ce,{children:[e.jsx(Ve,{className:"pb-2",children:e.jsx(Ue,{className:"text-sm font-medium",children:"Payment Preferences"})}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Monthly:"}),e.jsx("span",{className:"font-medium",children:ge.monthlyFamilies||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Trimester:"}),e.jsx("span",{className:"font-medium",children:ge.trimesterFamilies||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Yearly:"}),e.jsx("span",{className:"font-medium",children:ge.yearlyFamilies||0})]})]})})]})}),s==="open"&&ge.classCountDistribution&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:e.jsxs(Ce,{children:[e.jsx(Ve,{className:"pb-2",children:e.jsx(Ue,{className:"text-sm font-medium",children:"Class Enrollment Distribution"})}),e.jsx(Se,{children:e.jsx("div",{className:"space-y-1 text-sm",children:Object.entries(ge.classCountDistribution).map(([R,re])=>e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{children:[R," class",parseInt(R)>1?"es":"",":"]}),e.jsxs("span",{className:"font-medium",children:[re," families"]})]},R))})})]})}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Bl,{className:"h-5 w-5"}),"Search and Filter Enrollments"]}),e.jsxs(rn,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Use the filters below to narrow down enrollment payment data"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:be,className:"text-xs",children:"Clear All Filters"}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>W(!ae),className:`text-xs ${ae?"bg-blue-50 text-blue-700":""}`,children:ae?"Show Individual":"Group by Family"})]})]})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx("div",{children:e.jsx(je,{placeholder:"Search students, families, classes...",value:n,onChange:R=>r(R.target.value),className:"w-full"})}),e.jsxs(St,{value:m,onValueChange:g,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"All Sessions"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Sessions"}),G.map(R=>e.jsx(ce,{value:R,children:R},R))]})]}),e.jsxs(St,{value:h,onValueChange:x,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"All Classes"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Classes"}),Ae.map(R=>e.jsx(ce,{value:R,children:R},R))]})]}),e.jsxs(St,{value:w,onValueChange:N,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Payment Status"})}),e.jsx(Ct,{children:Z.map(R=>e.jsx(ce,{value:R.value,children:R.label},R.value))})]})]}),e.jsxs(sj,{open:J,onOpenChange:ne,children:[e.jsx(BS,{asChild:!0,children:e.jsxs(F,{variant:"ghost",className:"flex items-center gap-2 p-0 h-auto text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(Wx,{className:"h-4 w-4"}),"Advanced Filters",J?e.jsx(pf,{className:"h-4 w-4"}):e.jsx(ac,{className:"h-4 w-4"})]})}),e.jsxs(nj,{className:"space-y-4 pt-4",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.jsxs(St,{value:y,onValueChange:b,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Enrollment Status"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Enrollment Statuses"}),Fe.map(R=>e.jsx(ce,{value:R,children:R.charAt(0).toUpperCase()+R.slice(1)},R))]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(an,{className:"h-4 w-4"}),"Enrollment Date Range"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:"From Date"}),e.jsx(je,{type:"date",value:k,onChange:R=>E(R.target.value),className:"w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:"To Date"}),e.jsx(je,{type:"date",value:P,onChange:R=>M(R.target.value),className:"w-full"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(xr,{className:"h-4 w-4"}),"Amount Ranges"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:"Expected Cost Range"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(je,{type:"number",placeholder:"Min $",value:L,onChange:R=>B(R.target.value),className:"w-full"}),e.jsx(je,{type:"number",placeholder:"Max $",value:z,onChange:R=>H(R.target.value),className:"w-full"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:"Balance Due Range"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(je,{type:"number",placeholder:"Min $",value:T,onChange:R=>U(R.target.value),className:"w-full"}
732),e.jsx(je,{type:"number",placeholder:"Max $",value:_,onChange:R=>se(R.target.value),className:"w-full"})]})]})]})]})]})]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ue,{children:"Payment Reconciliation"}),e.jsxs(rn,{children:[ae?"Family View: ":"Individual View: ","Showing ",ue.length," of ",le.length," ",ae?"families":"enrollments"]})]}),V&&e.jsx(Ko,{className:"h-4 w-4 animate-spin"})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"overflow-x-auto",children:ae?e.jsx("div",{className:"space-y-4",children:ue.map(R=>e.jsxs(Ce,{className:"border-l-4 border-l-blue-500",children:[e.jsx(Ve,{className:"pb-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx(Ue,{className:"text-lg",children:R.familyName}),e.jsx(rn,{className:"text-sm",children:R.familyEmail})]}),e.jsxs("div",{className:"text-right text-sm",children:[e.jsxs("div",{className:"font-semibold",children:["Total Expected: $",R.totalExpected.toFixed(2)]}),e.jsxs("div",{className:"text-green-600",children:["Total Received: $",R.totalReceived.toFixed(2)]}),e.jsxs("div",{className:R.totalBalance>0?"text-red-600 font-medium":"text-green-600",children:["Balance Due: $",R.totalBalance.toFixed(2)]})]})]})}),e.jsxs(Se,{children:[e.jsxs("div",{className:"text-sm text-muted-foreground mb-2",children:[R.enrollments.length," enrollment",R.enrollments.length!==1?"s":"",":"]}),e.jsx("div",{className:"grid gap-2",children:R.enrollments.map(re=>{const O=zu(re.paymentStatus);return e.jsxs("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:re.studentName}),e.jsxs("div",{className:"text-xs text-gray-500",children:[re.sessionName," - ",re.className]})]}),e.jsxs("div",{className:"text-right flex items-center gap-2",children:[e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{children:["Expected: $",re.expectedCost.toFixed(2)]}),e.jsxs("div",{children:["Received: $",re.totalPaymentsReceived.toFixed(2)]})]}),e.jsx(we,{variant:O.variant,className:O.className,children:O.text})]})]},`${re.studentId}-${re.enrollmentId||re.slotId||Math.random()}`)})})]})]},R.familyId))}):e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{children:"Student"}),e.jsx(zt,{children:"Family"}),e.jsx(zt,{children:"Session"}),e.jsx(zt,{children:"Class"}),e.jsx(zt,{className:"bg-white",children:"Enrollment Status"}),e.jsx(zt,{className:"bg-gray-50",children:"Payment Status"}),e.jsx(zt,{className:"text-right bg-white",children:"Expected"}),e.jsx(zt,{className:"text-right bg-gray-50",children:"Received"}),e.jsx(zt,{className:"text-right bg-white",children:"Balance Due"}),e.jsx(zt,{className:"bg-white",children:"Family ID"}),e.jsx(zt,{className:"bg-gray-50",children:"Enrolled Date"})]})}),e.jsx(dl,{children:ue.map(R=>(zu(R.paymentStatus),e.jsxs(Un,{children:[e.jsx(Vt,{className:"font-medium bg-white",children:R.studentName}),e.jsx(Vt,{className:"bg-gray-50",children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:R.familyName}),e.jsx("div",{className:"text-xs text-gray-500",children:R.familyEmail})]})}),e.jsx(Vt,{className:"bg-white",children:R.sessionName}),e.jsx(Vt,{className:"bg-gray-50",children:e.jsx("div",{className:"space-y-1",children:R.enrollments&&R.enrollments.length>0?R.enrollments.map((re,O)=>e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:re.className}),re.timeSlot&&e.jsx("div",{className:"text-xs text-gray-500",children:re.timeSlot})]},O)):e.jsx("div",{className:"text-sm text-gray-400",children:"No classes"})})}),e.jsx(Vt,{className:"bg-white",children:e.jsx(we,{variant:"outline",className:"text-xs",children:R.enrollmentStatus||"No status"})}),e.jsx(Vt,{className:"bg-gray-50",children:e.jsx(we,{variant:"outline",className:"text-xs",children:R.paymentStatus||"No status"})}),e.jsxs(Vt,{className:"font-mono bg-gray-50",children:["$",R.expectedCost.toFixed(2)]}),e.jsx(Vt,{className:"font-mono bg-white",children:e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold",children:["$",R.totalPaymentsReceived.toFixed(2)]}),R.paymentDetails&&R.paymentDetails.length>0&&e.jsx("div",{className:"space-y-1 mt-1",children:R.paymentDetails.map((re,O)=>e.jsxs("div",{className:"text-xs",children:[e.jsxs("div",{className:"font-medium text-gray-700",children:["$",re.amount.toFixed(2)]}),e.jsx("div",{className:"text-gray-500",children:zl(new Date(re.date),"M/d/yyyy")})]},O))})]})}),e.jsx(Vt,{className:"font-mono bg-gray-50",children:R.balanceDue>0?e.jsxs("span",{className:"text-red-600",children:["$",R.balanceDue.toFixed(2)]}):e.jsx("span",{className:"text-green-600",children:"$0.00"})}),e.jsx(Vt,{className:"text-sm bg-gray-50",children:e.jsx("span",{className:"font-mono text-blue-600",children:R.familyId})}),e.jsx(Vt,{className:"text-sm bg-white",children:R.enrollmentDate?e.jsxs(e.Fragment,{children:[zl(new Date(R.enrollmentDate),"MMM d, yyyy"),e.jsx("div",{className:"text-xs text-gray-500",children:zl(new Date(R.enrollmentDate),"h:mm a")})]}):e.jsx("span",{className:"text-gray-400",children:"No date"})})]},`${R.studentId}-${R.enrollmentId||R.slotId||Math.random()}`)))})]})}),ue.length===0&&!V&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:["No ",ae?"families":"enrollments"," match the current filters."]}),V&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(Ko,{className:"h-4 w-4 animate-spin mx-auto mb-2"}),"Loading enrollment data..."]})]})]})]})})]})]})})}function e3(){const[s,t]=p.useState("messages");return e.jsx("div",{className:"p-4 sm:p-6 bg-gradient-to-br from-[#77dbf6]/10 to-white min-h-screen",children:e.jsxs("div",{className:"space-y-4 sm:sp
732ace-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices",className:"h-16 w-auto"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-3xl font-bold tracking-tight text-[#4A4A4A]",children:"Communications"}),e.jsx("p",{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Manage messages, newsletters, and subscriber communications"})]})]})}),e.jsxs(Ql,{value:s,onValueChange:t,className:"w-full",children:[e.jsxs(pl,{className:"grid w-full grid-cols-3 bg-[#77dbf6]/10 border-[#77dbf6]/20 h-auto",children:[e.jsx(qs,{value:"messages",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-2 sm:px-4 py-2 sm:py-3",children:"Messages"}),e.jsx(qs,{value:"newsletters",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-2 sm:px-4 py-2 sm:py-3",children:"Newsletters"}),e.jsx(qs,{value:"subscribers",className:"data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A] text-xs sm:text-sm px-2 sm:px-4 py-2 sm:py-3",children:"Subscribers"})]}),e.jsx(Hs,{value:"messages",className:"space-y-4",children:e.jsx(w1,{})}),e.jsx(Hs,{value:"newsletters",className:"space-y-4",children:e.jsx(A1,{})}),e.jsx(Hs,{value:"subscribers",className:"space-y-4",children:e.jsx(S1,{})})]})]})})}function t3(){var U;const[s,t]=p.useState(""),[n,r]=p.useState(new Date().toISOString().slice(0,7)),[a,o]=p.useState({}),{toast:c}=Is();dn(),p.useEffect(()=>{(async()=>{try{console.log("ð Starting automatic Zoom polling from attendance page...");const ae=await(await fetch("/api/zoom/start-polling",{method:"POST",credentials:"include"})).json();console.log("â
Automatic Zoom polling:",ae.message)}catch(se){console.log("â ï¸ Zoom polling already running or error:",se)}})()},[]);const{data:u=[],isLoading:h,error:x}=nt({queryKey:["/api/individual-classes"],queryFn:async()=>{const _=await fetch("/api/individual-classes",{credentials:"include"});if(!_.ok)throw new Error(`Failed to fetch individual classes: ${_.statusText}`);return _.json()}}),{data:m=[],error:g}=nt({queryKey:["/api/individual-class",s],queryFn:async()=>{const _=await fetch(`/api/individual-class/${s}/students`,{credentials:"include"});if(!_.ok)throw new Error(`Failed to fetch students: ${_.statusText}`);return _.json()},enabled:!!s}),{data:y=[],refetch:b}=nt({queryKey:["/api/attendance",s,n],queryFn:async()=>{if(!s||!n)return[];const _=await fetch(`/api/attendance/${s}/${n}`,{credentials:"include"});if(!_.ok)throw new Error(`Failed to fetch attendance: ${_.statusText}`);return _.json()},enabled:!!(s&&n)});p.useEffect(()=>{if(y.length>0){const _={};y.forEach(se=>{const ae=`${se.studentId}-${se.date}`;_[ae]={studentId:se.studentId,date:se.date,status:se.status,notes:se.notes||""}}),o(_)}},[y]),p.useEffect(()=>{u.length>0&&!s&&t(u[0].id.toString())},[u,s]);const N=(_=>{const se=parseInt(_.split("-")[0]),ae=parseInt(_.split("-")[1]),W=new Date(se,ae,0).getDate(),J=[];for(let ne=1;ne<=W;ne++)J.push({date:`${se}-${ae.toString().padStart(2,"0")}-${ne.toString().padStart(2,"0")}`,dayName:new Date(se,ae-1,ne).toLocaleDateString("en-US",{weekday:"short"}),dayNumber:ne});return J})(n),k=(_,se,ae)=>{const W=`${_}-${se}`,J=ae==="none"?"":ae;o(ne=>{var le;return{...ne,[W]:{studentId:_,date:se,status:J,notes:((le=ne[W])==null?void 0:le.notes)||""}}})},E=bt({mutationFn:async _=>{const se=await fetch("/api/attendance/bulk-save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({classId:s,attendanceRecords:_})});if(!se.ok)throw new Error(`Failed to save attendance: ${se.statusText}`);return se.json()},onSuccess:()=>{c({title:"Attendance Saved",description:"Attendance records have been saved successfully."}),b()},onError:_=>{c({title:"Error",description:_.message||"Failed to save attendance",variant:"destructive"})}}),P=bt({mutationFn:async _=>{const se=await fetch("/api/zoom/sync-class-attendance",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({classId:_,startDate:n+"-01"})});if(!se.ok){const ae=await se.json().catch(()=>({message:se.statusText}));throw new Error(ae.message||"Failed to sync Zoom attendance")}return se.json()},onSuccess:_=>{c({title:"Zoom Sync Complete",description:`Imported ${_.attendanceRecordsCreated} attendance records from ${_.meetingsProcessed} meetings`}),b()},onError:_=>{c({title:"Zoom Sync Failed",description:_.message||"Failed to sync attendance from Zoom",variant:"destructive"})}}),M=_=>{P.mutate(_)},L=()=>{const _=Object.values(a).filter(se=>se.status!=="");E.mutate(_)},B=()=>{const _=z(),se=new Blob([_],{type:"text/csv"}),ae=window.URL.createObjectURL(se),W=document.createElement("a");W.href=ae,W.download=`attendance-${s}-${n}.csv`,document.body.appendChild(W),W.click(),document.body.removeChild(W),window.URL.revokeObjectURL(ae)},z=()=>{var W;const _=((W=u.find(J=>J.id.toString()===s))==null?void 0:W.name)||"Class",se=["Student Name",...N.map(J=>`${J.dayNumber}`)],ae=m.map(J=>{const ne=[J.name];
732return N.forEach(le=>{const V=`${J.id}-${le.date}`,Z=a[V];ne.push((Z==null?void 0:Z.status)||"")}),ne.join(",")});return[`${_} - ${n}`,se.join(","),...ae].join(` 733`)},H=(_,se)=>{var J;const ae=`${_}-${se}`,W=((J=a[ae])==null?void 0:J.status)||"";return W===""?"none":W},T=_=>{switch(_){case"P":return"bg-green-100 text-green-800";case"A":return"bg-red-100 text-red-800";case"T":return"bg-yellow-100 text-yellow-800";case"D":return"bg-blue-100 text-blue-800";default:return"bg-gray-50"}};return h?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-4"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded"}),e.jsx("div",{className:"h-4 bg-gray-200 rounded w-5/6"})]})]})}):e.jsxs("div",{className:"p-6 max-w-full overflow-x-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Class Attendance Tracking"}),e.jsx("p",{className:"text-gray-600",children:"Digital attendance book for all classes"})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("label",{className:"text-sm font-medium mb-1",children:"Month/Year"}),e.jsx(je,{type:"month",value:n,onChange:_=>r(_.target.value),className:"w-40"})]}),e.jsxs("div",{className:"flex gap-2 items-end",children:[e.jsx(F,{onClick:L,disabled:E.isPending,className:"bg-blue-600 hover:bg-blue-700",children:E.isPending?"Saving...":"Save Attendance"}),e.jsxs(F,{variant:"outline",onClick:B,className:"flex items-center gap-2",children:[e.jsx(Xr,{className:"w-4 h-4"}),"Export CSV"]})]})]}),u.length===0?e.jsx(Ce,{children:e.jsxs(Se,{className:"p-6 text-center",children:[e.jsx(Pn,{className:"w-12 h-12 mx-auto text-gray-400 mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Active Classes"}),e.jsx("p",{className:"text-gray-600",children:"No active classes with enrollments found."})]})}):e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"space-y-6 mb-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-3 text-gray-800",children:"Ahern Academy Classes (Morning)"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-3",children:u.filter(_=>_.sessionType==="ahern_academy").map(_=>e.jsx("button",{onClick:()=>t(_.id.toString()),className:`h-auto p-4 border rounded-lg transition-colors ${s===_.id.toString()?"border-green-500 bg-green-50":"border-gray-200 hover:border-green-300"}`,children:e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx(Pn,{className:"w-5 h-5 text-green-600"}),e.jsxs("div",{className:"text-sm font-medium text-center leading-tight",children:[_.name.split(" ").slice(0,2).join(" "),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-gray-500",children:_.name.split(" ").slice(2).join(" ")})]}),e.jsx("div",{className:"text-xs font-medium text-gray-600",children:_.time}),e.jsxs("div",{className:"text-xs bg-green-100 text-green-800 px-3 py-1 rounded-full font-medium",children:[_.enrolledCount," students"]})]})},_.id))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-3 text-gray-800",children:"Open Enrollment Classes (Afternoon)"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3",children:u.filter(_=>_.sessionType==="open_enrollment"&&!_.id.toString().includes("makeup")&&!_.id.toString().includes("cooking")).map(_=>e.jsx("button",{onClick:()=>t(_.id.toString()),className:`h-auto p-4 border rounded-lg transition-colors ${s===_.id.toString()?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-blue-300"}`,children:e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx(Ms,{className:"w-5 h-5 text-blue-600"}),e.jsx("div",{className:"text-sm font-medium text-center",children:_.name}),e.jsx("div",{className:"text-xs font-medium text-gray-600",children:_.time}),e.jsxs("div",{className:"text-xs bg-blue-100 text-blue-800 px-3 py-1 rounded-full font-medium",children:[_.enrolledCount," students"]})]})},_.id))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-3 text-gray-800",children:"Friday Special Classes"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:u.filter(_=>_.id.toString().includes("cooking")||_.id.toString().includes("makeup")).map(_=>e.jsx("button",{onClick:()=>t(_.id.toString()),className:`h-auto p-4 border rounded-lg transition-colors ${s===_.id.toString()?"border-purple-500 bg-purple-50":"border-gray-200 hover:border-purple-300"}`,children:e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx(an,{className:"w-5 h-5 text-purple-600"}),e.jsx("div",{className:"text-sm font-medium text-center",children:_.name}),e.jsx("div",{className:"text-xs font-medium text-gray-600",children:_.time}),e.jsxs("div",{className:"text-xs bg-purple-100 text-purple-800 px-3 py-1 rounded-full font-medium",children:[_.enrolledCount," students"]})]})},_.id))})]})]}),s&&e.jsx("div",{children:e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-5 h-5"}),((U=u.find(_=>_.id.toString()===s))==null?void 0:U.name)||"Selected Class"," - ",new Date(n).toLocaleDateString("en-US",{month:"long",year:"numeric"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ms,{className:"w-4 h-4"}),m.length," enrolled students"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(an,{className:"w-4 h-4"}),N.length," days"]})]})]}),e.jsxs(Se,{children:[e.jsx("div",{className:"mb-4 p-4 bg-blue-50 rounded-lg border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-blue-900",children:"Zoom Attendance Import"}),e.jsx("p",{className:"text-sm text-blue-700",children:"Import attendance data from Zoom meetings for this class"})]}),e.jsx("button",{onClick:()=>M(s),disabled:P.isPending,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 flex items-center gap-2",children:P.isPending?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent roun
733ded-full"}),"Syncing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Xr,{className:"w-4 h-4"}),"Import from Zoom"]})})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ol,{children:[e.jsx(cl,{children:e.jsxs(Un,{children:[e.jsx(zt,{className:"sticky left-0 bg-background min-w-[200px] z-10 border-r",children:"Student Name"}),N.map(_=>e.jsx(zt,{className:"text-center min-w-[40px] p-1",children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:"text-xs",children:_.dayName}),e.jsx("span",{className:"font-bold",children:_.dayNumber})]})},_.date))]})}),e.jsx(dl,{children:m.map(_=>e.jsxs(Un,{children:[e.jsx(Vt,{className:"sticky left-0 bg-background border-r font-medium z-10",children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:_.name}),e.jsx("div",{className:"text-xs text-gray-500",children:_.familyName})]})}),N.map(se=>e.jsx(Vt,{className:"p-1",children:e.jsxs(St,{value:H(_.id,se.date),onValueChange:ae=>k(_.id,se.date,ae),children:[e.jsx(At,{className:`w-full h-8 text-center text-xs border-0 ${T(H(_.id,se.date))}`,children:e.jsx(kt,{placeholder:""})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"none",children:"-"}),e.jsx(ce,{value:"P",children:"P (Present)"}),e.jsx(ce,{value:"A",children:"A (Absent)"}),e.jsx(ce,{value:"T",children:"T (Tardy)"}),e.jsx(ce,{value:"D",children:"D (Dismissed Early)"})]})]})},`${_.id}-${se.date}`))]},_.id))})]})}),m.length===0&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(Ms,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No students enrolled in this class."})]})]})]})})]})]})}function s3(){const[s,t]=p.useState(null),[n,r]=p.useState(null),[a,o]=p.useState(new Date().toISOString().slice(0,7)),[c,u]=p.useState({}),[h,x]=p.useState(!1),[m,g]=p.useState(new Date().toISOString().split("T")[0]),[y,b]=p.useState(new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0]),[w,N]=p.useState(new Date().toISOString().split("T")[0]),[k,E]=p.useState(null),{toast:P}=Is(),M=dn(),{data:L,isLoading:B}=nt({queryKey:["/api/auth/user"]}),{data:z=[],isLoading:H}=nt({queryKey:["/api/class-sessions"],enabled:!!L&&!B}),T=z.find(R=>R.id===s),{data:U=[],isLoading:_,error:se,refetch:ae}=nt({queryKey:["/api/class-slots",s],queryFn:async()=>{if(!s)return[];console.log("Fetching slots for session:",s);const R=await fetch(`/api/class-slots/${s}`,{credentials:"include"});if(!R.ok)throw console.error("Slots fetch failed:",R.status,R.statusText),new Error(`Failed to fetch slots: ${R.statusText}`);const re=await R.json();return console.log("Slots data received:",re),re},enabled:!!L&&!B&&!!s}),{data:W=[],isLoading:J}=nt({queryKey:["/api/class-enrollments",n],queryFn:async()=>{if(!n)return[];const R=await fetch(`/api/class-enrollments/${n}`,{credentials:"include"});if(!R.ok)throw new Error(`Failed to fetch enrolled students: ${R.statusText}`);return R.json()},enabled:!!n&&!!L,staleTime:0}),{data:ne=[],isLoading:le,refetch:V}=nt({queryKey:["/api/attendance-by-slot",n,a],queryFn:async()=>{if(!n||!a)return[];const R=await fetch(`/api/attendance-by-slot/${n}/${a}`,{credentials:"include"});if(!R.ok)throw new Error(`Failed to fetch attendance: ${R.statusText}`);return R.json()},enabled:!!n&&!!a});bt({mutationFn:async R=>{const re=await fetch("/api/zoom/sync-slot-attendance",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({slotId:R,startDate:a+"-01"})});if(!re.ok){const O=await re.text();throw new Error(O||"Failed to sync Zoom attendance")}return re.json()},onSuccess:R=>{P({title:"Zoom sync completed",description:`Processed ${R.meetingsProcessed} meetings and created ${R.attendanceRecordsCreated} attendance records`}),V()},onError:R=>{P({title:"Zoom sync failed",description:R.message,variant:"destructive"})}});const Z=bt({mutationFn:async()=>{const R=await fetch("/api/zoom/sync-class-attendance",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({startDate:y,endDate:w})});if(!R.ok){const re=await R.text();throw new Error(re||"Failed to process class attendance")}return R.json()},onSuccess:R=>{P({title:"Class attendance auto-detection completed",description:`Processed ${R.meetingsProcessed} meetings and created ${R.classAttendanceRecordsCreated} class attendance records (including unenrolled students)`}),V()},onError:R=>{P({title:"Class attendance processing failed",description:R.message,variant:"destructive"})}});p.useEffect(()=>{if(z.length>0&&!s){const R=z.find(re=>re.isActive);R&&t(R.id)}},[z,s]),p.useEffect(()=>{s&&M.invalidateQueries({queryKey:["/api/class-slots",s]})},[s,M]),p.useEffect(()=>{if(!W||W.length===0||!a||!n||!U){u({});return}const R=U.find($=>
733$.id===n);if(!R){u({});return}const re=R.days?R.days.split(",").map($=>$.trim()):[],O=parseInt(a.split("-")[0]),me=parseInt(a.split("-")[1]),Te=vt.fromObject({year:O,month:me,day:1},{zone:"America/New_York"}).daysInMonth,Be=[];for(let $=1;$<=Te;$++){const xe=vt.fromObject({year:O,month:me,day:$},{zone:"America/New_York"}).weekdayShort,De=xe==="Tue"?"T":xe==="Thu"?"Th":xe.charAt(0);(re.includes(De)||re.includes(xe))&&Be.push(`${a}-${$.toString().padStart(2,"0")}`)}const ht=new Set;ne&&ne.length>0&&ne.forEach($=>{ht.add($.date)});const Mt={};W.forEach($=>{Be.forEach(K=>{const xe=`${$.id}-${K}`,De=ht.has(K)?"A":"C";Mt[xe]={studentId:$.id,date:K,status:De,notes:""}})}),ne&&ne.length>0&&ne.forEach($=>{const K=`${$.studentId}-${$.date}`;Mt[K]&&(Mt[K]={studentId:$.studentId,date:$.date,status:$.status||"A",notes:$.notes||""})}),u(Mt)},[ne,W,a,n,U]);const ue=p.useMemo(()=>{if(!a||!n||!U)return[];const R=U.find(ht=>ht.id===n),re=R!=null&&R.days?R.days.split(",").map(ht=>ht.trim()):[],[O,me]=a.split("-").map(Number),Te=vt.fromObject({year:O,month:me,day:1},{zone:"America/New_York"}).daysInMonth,Be=[];for(let ht=1;ht<=Te;ht++){const $=vt.fromObject({year:O,month:me,day:ht},{zone:"America/New_York"}).weekdayShort,K=$==="Tue"?"T":$==="Thu"?"Th":$.charAt(0);(re.includes(K)||re.includes($))&&Be.push(`${a}-${ht.toString().padStart(2,"0")}`)}return Be},[a,n,U]),ge=(R,re)=>{var Y;const O=`${R}-${re}`;return((Y=c[O])==null?void 0:Y.status)||"none"},G=(R,re,O)=>{const me=`${R}-${re}`,Y=O==="none"?"":O;u(Te=>({...Te,[me]:{studentId:R,date:re,status:Y}}))},Ae=bt({mutationFn:async()=>{const R=Object.values(c).filter(O=>O.status!==""),re=await fetch("/api/attendance/bulk-save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({slotId:n,attendanceRecords:R})});if(!re.ok)throw new Error("Failed to save attendance records");return re.json()},onSuccess:()=>{P({title:"Attendance saved",description:"All attendance records have been saved successfully"}),V()},onError:R=>{P({title:"Save failed",description:R.message,variant:"destructive"})}}),Fe=bt({mutationFn:async()=>{const R=await fetch("/api/zoom/health",{credentials:"include"});if(!R.ok)throw new Error("Failed to check Zoom health");return R.json()},onSuccess:R=>{E(R)},onError:R=>{E({success:!1,error:R.message})},retry:!1}),be=bt({mutationFn:async()=>{const R=await fetch("/api/zoom/process-attendance",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({date:m})});if(!R.ok)throw new Error("Failed to process Zoom attendance");return R.json()},onSuccess:R=>{P({title:"Zoom Attendance Processed",description:`Processed ${R.processed} attendance records for ${m}`}),R.errors&&R.errors.length>0&&console.warn("Processing errors:",R.errors),V()},onError:R=>{P({title:"Processing Failed",description:R.message,variant:"destructive"})}}),Me=bt({mutationFn:async()=>{const R=await fetch("/api/zoom/process-attendance",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({dateRange:{start:y,end:w}})});if(!R.ok)throw new Error("Failed to process Zoom attendance");return R.json()},onSuccess:R=>{P({title:"Zoom Attendance Processed",description:`Processed ${R.totalProcessed} attendance records from ${y} to ${w}`}),R.errors&&R.errors.length>0&&console.warn("Processing errors:",R.errors),V()},onError:R=>{P({title:"Processing Failed",description:R.message,variant:"destructive"})}});return p.useEffect(()=>{k||Fe.mutate()},[]),H?e.jsx("div",{className:"p-8",children:"Loading sessions..."}):e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Attendance Tracking"}),e.jsx("p",{className:"text-gray-600 mt-1",children:"Track student attendance by session, class, and date with Zoom integration"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[k&&e.jsx("div",{className:"flex items-center gap-2",children:k.success?e.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[e.jsx(fN,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:"Zoom Connected"})]}):e.jsxs("div",{className:"flex items-center gap-1 text-red-600",children:[e.jsx(Qr,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:"Zoom Disconnected"})]})}),e.jsxs(es,{open:h,onOpenChange:x,children:[e.jsx(jr,{asChild:!0,children:e.jsxs(F,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(p7,{className:"w-4 h-4"}),"Zoom Attendance"]})}),e.jsxs(ts,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{children:e.jsx(ns,{children:"Zoom Attendance Integration"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsx("h3",{className:"font-semibold mb-3",children:"Connection Status"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2",children:k!=null&&k.success?e.jsxs(e.Fragment,{children:[e.jsx(fN,{className:"w-5 h-5 text-green-600"}),e.jsx("span",{className:"text-green-600 font-medium",children:"Zoom API Connected"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Qr,{className:"w-5 h-5 text-red-600"}),e.jsx("span",{className:"text-red-600 font-medium",children:"Zoom API Disconnected"})]})}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>Fe.mutate(),disabled:Fe.isPending,children:Fe.isPending?"Testing...":"Test Connection"})]}),(k==null?void 0:k.testResults)&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:["Last test: Found ",k.testResults.meetingsFound," meetings on ",k.testResults.date]})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsx("h3",{className:"font-semibold mb-3",children:"Process Single Date"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"single-date",children:"Date"}),e.jsx(je,{id:"single-date",type:"date",value:m,onChange:R=>g(R.target.value),className:"mt-1"})]}),e.jsx(F,{onClick:()=>be.mutate(),disabled:be.isPending,className:"w-full",children:be.isPending?"Processing...":"Process Attendance"})]})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsx("h3",{className:"font-semibold mb-3",children:"Process Date Range"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"start-date",children:"Start Date"}),e.jsx(je,{id:"start-date",type:"date",value:y,onChange:R=>b(R.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"end-date",children:"End Date"}),e.jsx(je,{id:"end-date",type:"date",value:w,onChange:R=>N(R.target.value),className:"mt-1"})]})]}),e.jsx(F,{onClick:()=>Me.mutate(),disabled:Me.isPending,className:"w-full",variant:"outline",children:Me.isPending?"Processing...":"Process Date Range"})]})]}),e.jsxs("div",{className:"text-sm text-gray-600",children:[e.jsx("p",{children:e.jsx("strong",{children:"How it works:"})}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-2",children:[e.jsx("li",{children:"Fetches Zoom meeting reports for the specified date(s)"}),e.jsx("li",{children:"Matches participants to enrolled students by name and email"}),e.jsx("li",{children:"Creates attendance records based on meeting participation"}),e.jsx("li",{children:"Automatically determines Present/Tardy/Absent status"}),e.jsxs("li",{children:[e.jsx("strong",{children:"NEW:"})," Automatically detects and records attendance for registered students who attended but aren't enrolled in that specific class"]})]}),e.jsxs("div",{className:"mt-3 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[e.jsx("p",{className:"text-blue-800 font-medium text-sm",children:"ð¯ Automatic Student Detection"}),e.jsx("p",{className:"text-blue-700 text-xs mt-1",children:"The system now automatically identifies registered students who show up to classes they're not enrolled in (like Ahern Academy students dropping into afternoon classes) and adds them to attendance records."}),e.jsx(F,{onClick:()=>Z.mutate(),disabled:Z.isPending,className:"w-full mt-3",variant:"secondary",children:Z.isPending?"Processing...":"Test Class Auto-Detection"})]})]})]})]})]})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(an,{className:"w-5 h-5"}),"Select Session"]})}),e.jsx(Se,{children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Academic Session"}),e.jsxs(St,{value:(s==null?void 0:s.toString())||"",onValueChange:R=>{t(parseInt(R)),r(null)},children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Choose a session..."})}),e.jsx(Ct,{children:z.map(R=>e.jsx(ce,{value:R.id.toString(),children:e.jsxs("div",{className:"flex items-center gap-2",children:[R.name,R.isActive&&e.jsx(we,{variant:"secondary",className:"text-xs",children:"Active"})]})},R.id))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Month"}),e.jsxs(St,{value:a,onValueChange:o,children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"2025-07",children:"July 2025"}),e.jsx(ce,{value:"2025-08",children:"August 2025"}),e.jsx(ce,{value:"2025-09",children:"September 2025"}),e.jsx(ce,{value:"2025-10",children:"October 2025"}),e.jsx(ce,{value:"2025-11",children:"November 2025"}),e.jsx(ce,{value:"2025-12",children:"December 2025"})]})]})]})]})})]}),s&&e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-5 h-5"}),T==null?void 0:T.name," Classes"]}
733)}),e.jsx(Se,{children:_?e.jsx("div",{children:"Loading classes..."}):se?e.jsxs("div",{className:"text-center py-8 text-red-500",children:["Error loading classes: ",se.message]}):U.length===0?e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No classes found for this session"}):e.jsxs(Ql,{value:(n==null?void 0:n.toString())||"",onValueChange:R=>r(parseInt(R)),children:[e.jsx(pl,{className:"flex flex-wrap w-full h-auto p-1 bg-gray-100 rounded-lg",children:U.map(R=>e.jsx(qs,{value:R.id.toString(),className:"flex-1 min-w-[140px] p-3 m-1 text-sm data-[state=active]:bg-white data-[state=active]:shadow-sm",children:e.jsxs("div",{className:"flex flex-col items-center space-y-1",children:[e.jsx("span",{className:"font-medium",children:R.className}),e.jsx("span",{className:"text-xs text-gray-600",children:R.timeSlot}),e.jsxs(we,{variant:"outline",className:"text-xs px-1 py-0",children:[R.enrolledCount," enrolled"]})]})},R.id))}),U.map(R=>e.jsx(Hs,{value:R.id.toString(),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:R.className}),e.jsxs("p",{className:"text-sm text-gray-600",children:[R.timeSlot," ⢠",R.days," ⢠",R.enrolledCount," enrolled students"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{onClick:()=>Ae.mutate(),disabled:Ae.isPending||Object.keys(c).length===0,size:"sm",children:"Save Changes"}),e.jsxs(F,{variant:"outline",size:"sm",onClick:()=>{ae(),M.invalidateQueries({queryKey:["/api/class-enrollments",n]}),V()},children:[e.jsx(Ko,{className:"w-4 h-4 mr-2"}),"Refresh"]}),e.jsxs(F,{variant:"outline",size:"sm",children:[e.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Export"]})]})]}),J?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"text-gray-500",children:"Loading students..."})}):W.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed",children:[e.jsx(Ms,{className:"w-12 h-12 mx-auto mb-4 text-gray-400"}),e.jsx("h3",{className:"text-lg font-medium",children:"No students enrolled"}),e.jsx("p",{className:"text-sm",children:"This class has no enrolled students for the current session."})]}):e.jsxs("div",{className:"bg-white rounded-lg border shadow-sm overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ol,{children:[e.jsx(cl,{className:"bg-gray-50",children:e.jsxs(Un,{children:[e.jsx(zt,{className:"w-56 sticky left-0 bg-gray-50 border-r-2 border-gray-200 font-semibold",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"w-4 h-4"}),"Student Name"]})}),ue.map(re=>{const O=vt.fromISO(re,{zone:"America/New_York"}),me=O.weekdayShort,Y=O.day;return e.jsx(zt,{className:"w-20 text-center border-r border-gray-200",children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:"font-medium",children:Y}),e.jsx("span",{className:"text-xs text-gray-500",children:me})]})},re)})]})}),e.jsx(dl,{children:W.map((re,O)=>e.jsxs(Un,{className:O%2===0?"bg-white":"bg-gray-50/50",children:[e.jsx(Vt,{className:"sticky left-0 bg-inherit border-r-2 border-gray-200 font-medium",children:e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"font-medium text-gray-900",children:re.name}),e.jsx("div",{className:"text-xs text-gray-500",children:re.familyName})]})}),ue.map(me=>e.jsx(Vt,{className:"text-center p-2 border-r border-gray-100",children:e.jsxs(St,{value:ge(re.id,me),onValueChange:Y=>G(re.id,me,Y),children:[e.jsx(At,{className:"w-14 h-8 text-xs border-gray-300 hover:border-blue-400 focus:border-blue-500",children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"none",children:"-"}),e.jsx(ce,{value:"P",className:"text-green-600 font-medium",children:"P"}),e.jsx(ce,{value:"A",className:"text-red-600 font-medium",children:"A"}),e.jsx(ce,{value:"T",className:"text-yellow-600 font-medium",children:"T"}),e.jsx(ce,{value:"D",className:"text-orange-600 font-medium",children:"D"}),e.jsx(ce,{value:"C",className:"text-gray-600 font-medium",children:"C"})]})]})},me))]},re.id))})]},`${n}-${a}
733-${ue.length}`)}),e.jsx("div",{className:"px-6 py-4 bg-gray-50 border-t border-gray-200",children:e.jsxs("div",{className:"flex items-center gap-6 text-sm",children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Legend:"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-green-600 font-medium",children:"P"}),e.jsx("span",{className:"text-gray-600",children:"Present"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-red-600 font-medium",children:"A"}),e.jsx("span",{className:"text-gray-600",children:"Absent"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-yellow-600 font-medium",children:"T"}),e.jsx("span",{className:"text-gray-600",children:"Tardy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-orange-600 font-medium",children:"D"}),e.jsx("span",{className:"text-gray-600",children:"Dismissed"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-gray-600 font-medium",children:"C"}),e.jsx("span",{className:"text-gray-600",children:"Cancelled"})]})]})})]})]})},R.id))]})})]})]})}var Pj="Progress",Ej=100,[cG]=or(Pj),[dG,uG]=cG(Pj),XP=p.forwardRef((s,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:o=mG,...c}=s;(a||a===0)&&!n3(a)&&console.error(hG(`${a}`,"Progress"));const u=n3(a)?a:Ej;r!==null&&!r3(r,u)&&console.error(fG(`${r}`,"Progress"));const h=r3(r,u)?r:null,x=g0(h)?o(h,u):void 0;return e.jsx(dG,{scope:n,value:h,max:u,children:e.jsx(_t.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":g0(h)?h:void 0,"aria-valuetext":x,role:"progressbar","data-state":tE(h,u),"data-value":h??void 0,"data-max":u,...c,ref:t})})});XP.displayName=Pj;var JP="ProgressIndicator",eE=p.forwardRef((s,t)=>{const{__scopeProgress:n,...r}=s,a=uG(JP,n);return e.jsx(_t.div,{"data-state":tE(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});eE.displayName=JP;function mG(s,t){return`${Math.round(s/t*100)}%`}function tE(s,t){return s==null?"indeterminate":s===t?"complete":"loading"}function g0(s){return typeof s=="number"}function n3(s){return g0(s)&&!isNaN(s)&&s>0}function r3(s,t){return g0(s)&&!isNaN(s)&&s<=t&&s>=0}function hG(s,t){return`Invalid prop \`max\` of value \`${s}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ej}\`.`}function fG(s,t){return`Invalid prop \`value\` of value \`${s}\` supplied to \`${t}\`. The \`value\` prop must be: 734 - a positive number 735 - less than the value passed to \`max\` (or ${Ej} if no \`max\` prop is set) 736 - \`null\` or \`undefined\` if the progress is indeterminate. 737 738Defaulting to \`null\`.`}var sE=XP,pG=eE;const U1=p.forwardRef(({className:s,value:t,...n},r)=>e.jsx(sE,{ref:r,className:pt("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...n,children:e.jsx(pG,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));U1.displayName=sE.displayName;
738const nE="America/New_York";function xG(s){var t;return typeof s=="string"?((t=s.match(/^\d{4}-\d{2}-\d{2}/))==null?void 0:t[0])||null:s instanceof Date&&!Number.isNaN(s.getTime())?s.toISOString().slice(0,10):null}function Hu(s){const t=xG(s);if(!t)return null;const n=vt.fromISO(t,{zone:nE}).startOf("day");return n.isValid?n:null}function Gu(s,t=vt.now().setZone(nE)){var x,m;if(s.isActive===!1||s.is_active===!1)return"archived";const n=Hu(s.startDate||s.start_date),r=Hu(s.endDate||s.end_date);if(!n||!r)return"archived";if(((x=s.schedule)==null?void 0:x.toLowerCase().includes("saturday"))||((m=s.description)==null?void 0:m.toLowerCase().includes("saturday")))return t>r.endOf("day")?"archived":t>=n?"active":"enrolling";const o=(n.weekday-5+7)%7,c=n.minus({days:o}).set({hour:18,minute:0,second:0,millisecond:0}),u=(5-r.weekday+7)%7,h=r.plus({days:u}).set({hour:18,minute:0,second:0,millisecond:0});return t>=h?"archived":t>=c?"active":"enrolling"}function gG(s){const t=s.filter(n=>Gu(n)!=="archived").sort((n,r)=>{var c,u;const a=((c=Hu(n.startDate||n.start_date))==null?void 0:c.toMillis())??Number.MAX_SAFE_INTEGER,o=((u=Hu(r.startDate||r.start_date))==null?void 0:u.toMillis())??Number.MAX_SAFE_INTEGER;return a-o});return t.find(n=>Gu(n)==="active")||t[0]||null}function yG(s){const t=Hu(s.startDate||s.start_date),n=Hu(s.endDate||s.end_date);return!t||!n?"":t.year===n.year?`${t.toFormat("MMMM d")}â${n.toFormat("MMMM d, yyyy")}`:`${t.toFormat("MMMM d, yyyy")}â${n.toFormat("MMMM d, yyyy")}`}const z1="2026â2027",q1=[{title:"1. Enrollment Agreement",requiresAgreement:!0,text:`AAC Voices is a private educational program and not a public school. Enrollment does not confer any entitlement to services under IDEA, Section 504, or other public education mandates. Educational supports, accommodations, and policies are governed solely by AAC Voices' internal procedures. 739 740The student named below is enrolling in Ahern Academy, a homeschool cooperative and part of AAC Voices Online, for the 2026â2027 school year. This contract is valid for this school year only and does not entitle the student to future enrollment.`},{title:"2. Program Inclusions & Tuition",requiresAgreement:!0,text:`Enrollment includes: 741⢠Attendance at Ahern Academy classes 742⢠Free registration for daily group classes (e.g., shared reading, shared writing, Talker Power, YAC) 743⢠Discounted registration for weekend and special classes 744 745Cost: 746⢠$487/month or $1,948/trimester (family payment rate) 747⢠This is a flat rate evenly dividing the trimester cost across months, regardless of school days 748⢠Third-party payers (such as school districts, agencies, or trusts) must sign a separate contract and are subject to different tuition rates 749⢠Scholarships and bartering options may be available upon request; you may be asked to fill out the federal school lunch paperwork to prioritize students with higher levels of needs`},{title:"3. Payment Terms",requiresAgreement:!0,text:`Tuition may be paid by the family directly or by a third-party payer (district, agency, trust). 750 751Payment deadlines: 752⢠Family payments: due on the 1st of the month 753⢠Third-party payments: require signed agreement between AAC Voices and the payer 754 755Other terms: 756⢠Payment is via Square unless otherwise arranged 757⢠All fees in USD 758⢠$100 per trimester invoice fee (for documentation needed for reimbursement) 759⢠Late payments beyond 30 days may incur fees 760 761Withdrawal does not remove financial obligation unless a replacement student is found.`},{title:"4. Attendance Policy",requiresAgreement:!0,text:`Caregivers are reminded that students make significantly more progress when their attendance rate is high and consistent. We ask that families communicate with staff proactively if attendance is expected to be inconsistent or disrupted for any reason. 762 763⢠Classes may be cancelled or rescheduled by AAC Voices with notice (typically via Facebook or Remind) 764⢠No refunds for missed classes unless cancelled by AAC Voices 765⢠Low-enrollment groups (3 or fewer students) may be cancelled 766 767Students are expected to: 768⢠Attend literacy/math at least 3x/week unless excused 769⢠Attend daily when enrolled 770⢠Remain on camera with caregiver present, unless prior permission is granted`},{title:"5. Participation Guidelines",requiresAgreement:!0,text:`Caregivers (Learning Coaches) must: 771⢠Be present and active during all sessions 772⢠Ensure working internet and device access 773⢠Support AAC use and emotional regulation 774⢠Help with Zoom tools (muting, chat, camera) 775⢠Follow all homeschool law requirements 776⢠Ensure student is clothed, safe, and supported`},{title:"6. Family Responsibilities",requiresAgreement:!0,text:`AAC Voices is a homeschool
776cooperative. Families are solely responsible for meeting all state, local, or federal homeschool requirements. 777 778Families must also: 779⢠Create a safe learning space 780⢠Communicate promptly with staff 781⢠Augment instruction outside of class`},{title:"7. Assessment Agreement",requiresAgreement:!0,text:"Families agree to fill out two caregiver assessments for planning purposes. In-class assessments may also be given."},{title:"8. Community Standards",requiresAgreement:!0,text:"AAC Voices is a respectful, inclusive, and supportive environment. Disruptive or harmful behavior may result in removal from the program."},{title:"9. Liability Waiver",requiresAgreement:!0,text:"AAC Voices and Ahern Academy are not responsible for any injuries, accidents, or technical failures that may occur during virtual or in-person participation. By enrolling, families acknowledge that participation is voluntary and accept full responsibility for the safety, supervision, and well-being of the student during all sessions."},{title:"10. Privacy and Data Use",requiresAgreement:!0,text:`AAC Voices is a private educational program and is not a public school or subject to FERPA or other public school regulations. By enrolling, families acknowledge that AAC Voices operates under its own internal policies and is not bound by the procedural safeguards or rights applicable to government-funded educational entities. 782 783AAC Voices collects limited personal and educational data to provide individualized support, maintain accurate records, and comply with legal and professional obligations. This may include names, attendance, session recordings, assessment results, caregiver feedback, and class participation. 784 785Data is used internally by AAC Voices staff only and is never sold or shared with third parties without explicit consent, except when required by law. Data is stored securely for the duration of a student's enrollment and retained for five (5) years after withdrawal or graduation for educational documentation and audit purposes. 786 787By signing this contract, families consent to this use and retention of educational data.`},{title:"11. Dispute Resolution",requiresAgreement:!0,text:"Most concerns can be resolved through direct communication. If unresolved, families may email Kate Ahern directly at [email protected]. AAC Voices is a private educational service and not bound to public school procedures."},{title:"12. Definitions",requiresAgreement:!1,text:`⢠Learning Coach / Caregiver: The adult responsible for supporting the student during class, ensuring safety, tech readiness, and emotional regulation. 788⢠Enrollment: Formal participation in any AAC Voices program during a specified session, trimester, or school year. 789⢠Session: A scheduled live class conducted over Zoom. 790⢠Withdrawal: When a student or family exits a program prior to the end of their term. 791⢠Replacement: A new student who fills a withdrawn student's slot, relieving the financial obligation.`}];function vG(){return`AAC Voices / Ahern Academy Contract â ${z1} School Year 792 793`+q1.map(s=>`${s.title} 794 795${s.text}`).join(` 796 797--- 798 799`)}const jG=()=>({name:"",email:"",phone:""});function a3({allowCancel:s,onCancel:t,onSigned:n,existingCaregivers:r=[]}){const{toast:a}=Is(),o=dn(),[c,u]=p.useState({}),[h,x]=p.useState(!1),[m,g]=p.useState(""),[y,b]=p.useState(""),[w,N]=p.useState(""),[k,E]=p.useState(()=>Array.from({length:3},(U,_)=>r[_]||jG())),M=q1.map((U,_)=>U.requiresAgreement?_:-1).filter(U=>U>=0).every(U=>c[U]),L=k.filter(U=>U.name.trim()&&(U.email.trim()||U.phone.trim())),B=M&&L.length>=1&&y.trim().length>1&&(!h||m.trim().length>0),z=bt({mutationFn:async()=>st("POST","/api/contracts/sign",{signatureName:y.trim(),sectionsAgreed:M,caregivers:L,photoReleaseConsent:h,photoReleaseSignature:h?m:null,additionalNotes:w.trim()||null,contractContent:vG()}),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/contracts/status"]}),a({title:"Success!",description:`Your ${z1} contract has been signed successfully.`}),n==null||n()},onError:U=>{a({title:"Error",description:U.message||"Failed to sign contract. Please try again.",variant:"destructive"})}}),H=(U,_,se)=>{E(ae=>ae.map((W,J)=>J===U?{...W,[_]:se}:W))},T={backgroundColor:"rgba(119, 219, 246, 0.15)",border:"1px solid rgba(93, 207, 242, 0.3)"};return e.jsxs("div",{className:"space-y-6 text-sm",children:[q1.map((U,_)=>e.jsxs("div",{style:T,className:"rounded-lg p-6",children:[e.jsx("h3",{className:"font-bold text-lg mb-3 text-gray-900",children:U.title}),e.jsx("div",{className:"text-gray-700 whitespace-pre-wrap mb-3",children:U.text}),U.requiresAgreement&&e.jsxs("div",{className:"bg-white/80 rounded p-3 flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",id:`section-agree-${_}`,checked:!!c[_],onChange:se=>u(ae=>({...ae,[_]:se.target.checked})),className:"h-5 w-5 text-blue-600 flex-shrink-0"}),e.jsx("label",{htmlFor:`section-agree-${_}`,className:"text-sm font-medium text-gray-900",children:"I agree"})]})]},U.title)),e.jsxs("div",{style:T,className:"rounded-lg p-6",children:[e.jsx("h3",{className:"font-bold text-lg mb-3 text-gray-900",children:"Photo Permission (Optional)"}),e.jsx("p",{className:"text-gray-700 mb-3",children:"I grant permission to AAC Voices to use photographs of my student, learning coach, or student work in newsletters, courses, web, and promotional use. No compensation will be provided."}),e.jsxs("div",{className:"bg-white/80 rounded p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("input",{type:"checkbox",id:"photo-consent-2026",checked:h,onChange:U=>x(U.target.checked),className:"h-5 w-5 text-blue-600 flex-shrink-0"}),e.jsx("label",{htmlFor:"photo-consent-2026",className:"text-sm font-medium text-gray-900",children:"Yes, I grant photo permission (optional)"})]}),h&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Type your initials to confirm:"}),e.jsx("input",{type:"text",placeholder:"Your initials (e.g., JD)",value:m,onChange:U=>g(U.target.value.toUpperCase()),className:"w-32 px-3 py-2 border border-gray-300 rounded text-sm",maxLength:5})]})]})]}),e.jsxs("div",{style:T,className:"rounded-lg p-6",children:[e.jsx("h3",{className:"font-bold text-lg mb-3 text-gray-900",children:"Caregivers"}),e.jsx("p",{className:"text-gray-700 mb-4",children:"Please list 1â3 caregivers associated with this family account, including an email address or phone number for each caregiver. At least one caregiver is required. Adding a caregiver will not remove or replace an existing caregiver. Caregiver removals must be requested separately and approved by AAC Voices staff."}),e.jsx("div",{className:"space-y-4",children:k.map((U,_)=>e.jsxs("div",{className:"bg-white/80 rounded p-3",children:[e.jsxs("div",{className:"text-sm font-semibold text-gray-800 mb
799-2",children:["Caregiver ",_+1," ",_===0?"(required)":"(optional)"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[e.jsx("input",{type:"text",placeholder:"Full name",value:U.name,onChange:se=>H(_,"name",se.target.value),className:"px-3 py-2 border border-gray-300 rounded text-sm"}),e.jsx("input",{type:"email",placeholder:"Email",value:U.email,onChange:se=>H(_,"email",se.target.value),className:"px-3 py-2 border border-gray-300 rounded text-sm"}),e.jsx("input",{type:"tel",placeholder:"Phone",value:U.phone,onChange:se=>H(_,"phone",se.target.value),className:"px-3 py-2 border border-gray-300 rounded text-sm"})]})]},_))})]}),e.jsxs("div",{style:T,className:"rounded-lg p-6",children:[e.jsx("h3",{className:"font-bold text-lg mb-3 text-gray-900",children:"Additional Notes"}),e.jsx("p",{className:"text-gray-700 mb-3 italic",children:"Is there anything else you wish to share? (optional)"}),e.jsx("textarea",{value:w,onChange:U=>N(U.target.value),placeholder:"Anything else you'd like us to know...",className:"w-full px-3 py-2 border border-gray-300 rounded text-sm min-h-[80px]",maxLength:2e3})]}),e.jsxs("div",{className:"border-t-2 pt-6",style:{borderColor:"#77dbf6"},children:[e.jsx("div",{className:"text-center mb-4",children:e.jsx("h3",{className:"font-bold text-lg text-gray-900",children:"Digital Signature"})}),e.jsxs("div",{style:{backgroundColor:"#77dbf6",border:"2px solid #5DCFF2"},className:"rounded-lg p-4 mb-4",children:[e.jsxs("p",{className:"text-sm text-white font-medium",children:['By entering your legal name and clicking "Sign Contract" below, you confirm agreement with all terms above for the ',z1," school year, including enrollment, participation, and payment terms."]}),h&&m&&e.jsxs("div",{className:"mt-3 p-2 bg-white/20 backdrop-blur-sm rounded text-white text-sm",children:["â Photo permission granted with initials: ",e.jsx("strong",{children:m})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Legal name (typed signature):"}),e.jsx("input",{type:"text",placeholder:"Your full legal name",value:y,onChange:U=>b(U.target.value),className:"w-full sm:w-80 px-3 py-2 border border-gray-300 rounded text-sm"})]}),!B&&e.jsxs("p",{className:"text-sm text-amber-700 mb-3",children:['To sign: check "I agree" on every section, list at least one caregiver, and type your legal name',h&&!m.trim()?", and enter your initials for photo permission":"","."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s&&e.jsx(F,{variant:"outline",onClick:t,className:"flex-1",children:"Remind Me Later"}),e.jsx(F,{onClick:()=>z.mutate(),disabled:!B||z.isPending,style:{backgroundColor:"#77dbf6",borderColor:"#5DCFF2"},className:"flex-1 px-8 py-3 hover:opacity-90 text-white border-2 disabled:opacity-50",children:z.isPending?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Processing Signature..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"h-4 w-4 mr-2"}),"Sign Contract"]})})]})]})]})}function bG(s){return s.programStatus==="approved"?{prompt:`AAC Voices is an approved provider for ${s.programName}. The state program determines eligibility.`,checkbox:"I want AAC Voices to bill this student's covered services through this state program."}:s.programStatus==="pending"?{prompt:`AAC Voices has an application pending for ${s.programName}.`,checkbox:"I would like to use this program for this student if AAC Voices is approved."}:s.programStatus==="potential"?{prompt:`${s.programName} may be available in your state. AAC Voices has not applied to become a provider.`,checkbox:"I would be interested in using this program for AAC Voices."}:{prompt:`No qualifying state funding program is currently listed for ${s.state||"your state"}.`,checkbox:"I know of a program AAC Voices may not know about."}}function i3({mode:s="dashboard"}){const t=dn(),{toast:n}=Is(),[r,a]=p.useState(!0),[o,c]=p.useState({}),[u,h]=p.useState({}),{data:x,isLoading:m}=nt({queryKey:["/api/portal/state-funding"]});p.useEffect(()=>{var k,E;if(!(x!=null&&x.options))return;const w={},N={};for(const P of x.options)w[P.studentId]=((k=P.selection)==null?void 0:k.caregiverNotes)||"",N[P.studentId]=((E=P.selection)==null?void 0:E.selected)||!1;c(w),h(N)},[x]);const g=bt({mutationFn:async w=>st("POST","/api/portal/state-funding",w),onSuccess:()=>{t.invalidateQueries({queryKey:["/api/portal/state-funding"]}),n({title:"Saved",description:"Your state funding preference has been updated."})},onError:w=>{n({title:"Unable to save",description:w.message||"Please try again.",variant:"destructive"})}}),y=((x==null?void 0:x.options)||[]).filter(w=>w.display&&(s==="manage"||!w.promptAcknowledged)),b=bt({mutationFn:async()=>st("POST","/api/portal/state-funding/dismiss",{studentIds:y.map(w=>w.studentId)}),onSuccess:()=>{t.invalidateQueries({queryKey:["/api/portal/state-funding"]}),a(!1)},onError:w=>{n({title:"Unable to dismiss",description:w.message||"Please try again.",variant:"destructive"})}});return m||y.length===0||s==="dashboard"&&!r?null:e.jsxs(Ce,{className:"border-blue-200 bg-blue-50/40",children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2 text-[#4A4A4A]",children:[e.jsx(jF,{
799className:"h-5 w-5 text-blue-600"}),"State Education Funding"]}),e.jsx("p",{className:"text-sm text-gray-600",children:s==="dashboard"?"State programs determine eligibility and provide funding through their own caregiver portals.":"Review or update your state education funding preferences."})]}),e.jsxs(Se,{className:"space-y-4",children:[y.map(w=>{var k,E;const N=bG(w);return e.jsxs("div",{className:"rounded-lg border bg-white p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:w.studentName}),w.programStatus==="approved"&&e.jsx(we,{className:"bg-green-600",children:"AAC Voices approved"}),w.programStatus==="pending"&&e.jsx(we,{variant:"secondary",children:"Application pending"})]}),e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:N.prompt}),w.programStatus==="approved"&&w.programPlatform&&e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Billing platform: ",w.programPlatform]}),w.programNote&&e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:w.programNote}),e.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[e.jsx(Gs,{id:`funding-${w.studentId}`,checked:!!u[w.studentId],onCheckedChange:P=>h(M=>({...M,[w.studentId]:P===!0}))}),e.jsx("label",{htmlFor:`funding-${w.studentId}`,className:"text-sm font-medium leading-5 text-gray-800",children:N.checkbox})]}),u[w.studentId]&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600",children:"Information you would like to share (optional)"}),e.jsx(Pt,{value:o[w.studentId]||"",onChange:P=>c(M=>({...M,[w.studentId]:P.target.value})),maxLength:2e3,placeholder:"Program name, official link, contact, or anything else you already know"})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx(F,{type:"button",size:"sm",disabled:g.isPending,onClick:()=>g.mutate({studentId:w.studentId,selected:!!u[w.studentId],caregiverNotes:o[w.studentId]||""}),children:"Save"}),((k=w.selection)==null?void 0:k.status)==="approved"&&e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Approved for: ",(w.selection.approvedServiceTypes||[]).join(", ")]}),((E=w.selection)==null?void 0:E.status)==="pending"&&e.jsx("span",{className:"text-xs text-amber-700",children:"Waiting for AAC Voices review"})]})]},w.studentId)}),s==="dashboard"&&e.jsx("div",{className:"flex border-t border-blue-100 pt-4 sm:justify-end",children:e.jsx(F,{type:"button",variant:"outline",className:"w-full border-blue-300 bg-white text-gray-800 hover:bg-blue-50 sm:w-auto",disabled:b.isPending,onClick:()=>b.mutate(),children:b.isPending?"Savingâ¦":"OK â Donât Show Again"})})]})]})}function rE(s){const t=String(s.paymentState||"").toLowerCase(),n=String(s.status||"").toLowerCase();return["","completed","persisted","received"].includes(t)&&s.databaseRecordCreated===!0&&(n==="completed"||n==="persisted"||t==="completed"||t==="persisted")}const Hn=s=>{if(s==null||s==="")return;const t=Number(s);return Number.isSafeInteger(t)&&t>0?t:void 0},Zh=s=>({className:typeof s.className=="string"?s.className.trim().toLowerCase():void 0,enrollmentId:Hn(s.enrollmentId),sessionId:Hn(s.sessionId),weekNumber:Hn(s.weekNumber),studentId:Hn(s.studentId),sessionBillingId:Hn(s.sessionBillingId)}),bv=s=>[Hn(s.enrollmentId)||"",Hn(s.sessionId)||"",Hn(s.weekNumber)||"",Hn(s.sessionBillingId)||"",Hn(s.studentId)||""].join(":"),W1=s=>{const t=new Set;return(s||[]).map(Zh).filter(n=>{const r=bv(n);return t.has(r)?!1:(t.add(r),!!r.replace(/:/g,""))}).sort((n,r)=>bv(n).localeCompare(bv(r)))},NG=(s,t)=>{const n=Zh(s),r=Zh(t);return!!(n.enrollmentId&&r.enrollmentId&&n.enrollmentId===r.enrollmentId&&n.sessionId===r.sessionId&&n.weekNumber===r.weekNumber)},wG=s=>{const t=new Set,n=/\bweek\s+(\d+)(?:\s+and\s+(\d+))?\b/gi,r=String(s||"");let a;for(;(a=n.exec(r))!==null;){const o=Hn(a[1]);o&&t.add(o);const c=Hn(a[2]);c&&t.add(c)}return Array.from(t)},AG=s=>{const t=[],n=new Set;for(const r of s||[]){if(String(r.status||"").toLowerCase()!=="paid")continue;if(Array.isArray(r.coverage)&&r.coverage.length>0){t.push(...W1(r.coverage));continue}const o=Hn(r.classSessionId??r.sessionId);if(o)for(const c of wG(r.description))n.add(`${o}-${c}`)}return{explicit:W1(t),legacySessionWeeks:n}},l3=(s,t)=>{const n=Hn(t.sessionId),r=Hn(t.weekNumber);return n&&r&&s.legacySessionWeeks.has(`${n}-${r}`)?!0:s.explicit.some(a=>{if(NG(a,t))return!0;const o=Zh(a),c=Zh(t);return!!(o.className&&c.className&&o.className===c.className&&o.sessionId===c.sessionId&&o.weekNumber===c.weekNumber)})},o3=(s,t)=>{const n=Hn(t);return n&&(s||[]).some(a=>
799Hn(a.id)===n&&String(a.status||"").toLowerCase()==="pending")?n:void 0},c3=s=>!!(s.coverage&&s.coverage.length>0||s.enrollmentBased||Hn(s.sessionBillingId)),ih=s=>{const t=s||[],n=t.some(c3),r=t.some(a=>!c3(a));return n&&r?{valid:!1,mixed:!0,message:"Weekly/session services and fees or special payments must be paid separately. Please create a separate checkout for the fee or special payment."}:{valid:!0,mixed:!1}},CG=s=>JSON.stringify({amountCents:Math.round(Number(s.amount)*100),...s.context?{context:s.context}:{},coverage:W1(s.coverage),pendingPaymentIds:Array.from(new Set((s.pendingPaymentIds||[]).map(Hn).filter(Boolean))).sort((t,n)=>t-n),sessionBillingIds:Array.from(new Set((s.sessionBillingIds||[]).map(Hn).filter(Boolean))).sort((t,n)=>t-n)}),Ix=async s=>{const t=new TextEncoder().encode(CG(s)),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(r=>r.toString(16).padStart(2,"0")).join("")},Yh="aac-portal-payment-attempt",aE=()=>{try{const s=localStorage.getItem(Yh);if(!s)return null;const t=JSON.parse(s);return!t||typeof t.key!="string"||typeof t.fingerprint!="string"||typeof t.status!="string"?null:t}catch{return null}},lh=s=>{try{localStorage.setItem(`${Yh}:${s.key}`,JSON.stringify(s))}catch{}},d3=s=>{try{const t=new Map,n=aE();n&&(n.familyId===void 0||n.familyId===s)&&t.set(n.key,n);for(let r=0;r<localStorage.length;r++){const a=localStorage.key(r);if(a!=null&&a.startsWith(`${Yh}:`))try{const o=JSON.parse(localStorage.getItem(a)||"null");(o==null?void 0:o.familyId)===s&&typeof o.key=="string"&&typeof o.fingerprint=="string"&&typeof o.status=="string"&&t.set(o.key,o)}catch{}}return Array.from(t.values())}catch{return[]}},Nv=(s,t,n)=>s.familyId===t&&s.fingerprint===n&&["submitted","received","unknown"].includes(s.status),wv=s=>{var t;try{localStorage.removeItem(`${Yh}:${s}`),((t=aE())==null?void 0:t.key)===s&&localStorage.removeItem(Yh)}catch{}},SG=s=>{const t=String(s.paymentState||"").toLowerCase();return rE(s)?!0:t==="unknown"||t==="received"?!1:t==="declined"||t==="not_charged"},u3=s=>{if(s.networkError)return"unknown";const t=s.payload||{},n=String(t.paymentState||"").toLowerCase(),r=!!(t.paymentId||t.squarePaymentId),a=t.databaseRecordCreated;return n==="declined"||n==="not_charged"?"declined":n==="unknown"?"unknown":s.httpOk&&r&&rE(t)?"completed":n==="received"||r&&a===!1?"received":(s.httpOk,"unknown")};async function kG(s,t={}){const r=await(t.fetcher||fetch)("/api/portal/payment-quote",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:t.signal}),a=await r.text();let o={};try{o=a?JSON.parse(a):{}}catch{o={}}if(!r.ok)throw new Error(o.message||a||`Quote failed (${r.status})`);const c={amount:Number(o.amount),grossAmount:Number(o.grossAmount),creditAmount:Number(o.creditAmount),remainingCredit:Number(o.remainingCredit),creditApplications:o.creditApplications,coverage:Array.isArray(o.coverage)?o.coverage:void 0,description:typeof o.description=="string"?o.description:void 0};if(!Number.isFinite(c.amount)||!Number.isFinite(c.grossAmount)||!Number.isFinite(c.creditAmount)||!Number.isFinite(c.remainingCredit)||c.amount<0||c.grossAmount<0||c.creditAmount<0||c.remainingCredit<0||!Array.isArray(c.creditApplications))throw new Error("The payment quote did not include valid credit details.");return c}async function $G(s,t){if(s===0)return;if(s<0||!Number.isFinite(s))throw new Error("The quoted card amount is invalid.");if(!t)throw new Error("Payment form not ready. Please refresh the page.");let n;try{n=await t.tokenize()}catch(r){throw new Error(`Tokenization failed: ${(r==null?void 0:r.message)||"Network or SDK error"}`)}if(n.status!=="OK"){const r=Array.isArray(n.errors)?n.errors[0]:void 0;throw new Error((r==null?void 0:r.message)||(r==null?void 0:r.detail)||(r==null?void 0:r.code)||"Card validation failed")}if(!n.token)throw new Error("No payment token generated");return n.token}function PG({isOpen:s,onClose:t}){const n=()=>{window.location.reload()},r=()=>{window.open("mailto:[email protected]?subject=Payment Issue - Need Assistance","_blank")},a=()=>{window.open("tel:+1-555-0123","_blank")};return e.jsx(es,{open:s,onOpenChange:t,children:e.jsxs(ts,{className:"max-w-md",children:[e.jsx(ss,{children:e.jsxs(ns,{className:"flex items-center gap-2 text-amber-800",children:[e.jsx(Qr,{className:"w-5 h-5"}),"Payment Help"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-200 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-amber-800 mb-2",children:"Having trouble completing your payment?"}),e.jsx("p",{className:"text-sm text-amber-700 mb-3",children:"We're here to help! Here are some common solutions:"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 rounded-lg",children:[e.jsx(ti,{className:"w-5 h-5 text-blue-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-blue-800",children:"Check Your Profile"}),e.jsx("p",{className:"text-sm text-blue-700",children:"Make sure your student profile is complete with all required information."})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-green-50 rounded-lg",children:[e.jsx(Ko,{className:"w-5 h-5 text-green-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-green-800",children:"Try Refreshing"}),e.jsx("p",{className:"text-sm text-green-700",children:"Sometimes refreshing the page and navigating back to payment resolves the issue."})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-purple-50 rounded-lg",children:[e.jsx(Or,{className:"w-5 h-5 text-purple-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-purple-800",children:"Payment Context"}),e.jsx("p",{className:"text-sm text-purple-700",children:"Ensure you've selected a specific class, session, or enrollment before attempting payment."})]})]})]}),e.jsxs("div",{className:"border-t pt-4",children:[e.jsx("h5",{className:"font-medium text-gray-800 mb
799-3",children:"Still need help?"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{onClick:n,variant:"outline",className:"w-full justify-start gap-2",children:[e.jsx(Ko,{className:"w-4 h-4"}),"Refresh Page & Try Again"]}),e.jsxs(F,{onClick:r,variant:"outline",className:"w-full justify-start gap-2",children:[e.jsx(ir,{className:"w-4 h-4"}),"Email Support Team"]}),e.jsxs(F,{onClick:a,variant:"outline",className:"w-full justify-start gap-2",children:[e.jsx(E0,{className:"w-4 h-4"}),"Call Support"]})]})]}),e.jsx("div",{className:"text-center pt-2",children:e.jsx(F,{onClick:t,className:"w-full",children:"Close"})})]})]})})}function EG({amount:s,description:t,familyId:n,studentId:r,enrollmentId:a,sessionId:o,sessionBillingIds:c,coverage:u,pendingPaymentIds:h,idempotencyKey:x,serviceType:m,paymentMonth:g,expectedAmount:y,onSuccess:b,onPaymentReceived:w,onPaymentDeclined:N,onCancel:k}){const[E,P]=p.useState(!1),[M,L]=p.useState(!1),[B,z]=p.useState(null),[H,T]=p.useState(null),[U,_]=p.useState(!1),[se,ae]=p.useState(""),[W,J]=p.useState(""),[ne,le]=p.useState(null),[V,Z]=p.useState(null),[ue,ge]=p.useState(null),[G,Ae]=p.useState(void 0),[Fe,be]=p.useState(!1),[Me,R]=p.useState(!1),[re,O]=p.useState(null),[me,Y]=p.useState(!1),[Te,Be]=p.useState(null),[ht,Mt]=p.useState(null),$=p.useRef(null),K=p.useRef(null),xe=p.useRef(null),[De,X]=p.useState(!1),_e=p.useRef(!1),[Le,A]=p.useState(0),[D,ie]=p.useState(!1),{toast:$e}=Is(),ke=dn(),S=n&&(r||a||o||c&&c.length>0||u&&u.length>0),[ve,Ze]=p.useState({squareSDK:!1,squareConfig:!1,cardReady:!1,lastError:null}),Qe=JSON.stringify({coverage:u||[],sessionBillingIds:c||[],pendingPaymentIds:h||[]}),ct=!!(u&&u.length>0||c&&c.length>0),It=ne??s,Zs=ue||t,Zt=G||u||[];p.useEffect(()=>{const Rt=K.current,Os=xe.current;if(!Rt||!Os)return;const vs=()=>{const Ts=parseFloat(getComputedStyle(document.documentElement).fontSize);X(Rt.clientHeight-Os.offsetHeight<Ts*8)},cs=new ResizeObserver(vs);return cs.observe(Rt),cs.observe(Os),vs(),()=>cs.disconnect()},[]),p.useEffect(()=>{if(Fe||ne===null||ne<=0||B)return;const Rt=setTimeout(()=>{qn()},100);return()=>clearTimeout(Rt)},[Fe,ne,B]),p.useEffect(()=>{let Rt=!1;const Os=new AbortController;return O(null),R(!1),be(!1),le(ct?null:s),Z(ct?null:{amount:s,grossAmount:s,creditAmount:0,remainingCredit:0,creditApplications:[]}),Ae(void 0),ge(null),ct?(be(!0),kG({coverage:u||[],sessionBillingIds:c||[],pendingPaymentIds:h||[]},{signal:Os.signal}).then(vs=>{Rt||(le(vs.amount),Z(vs),Ae(Array.isArray(vs.coverage)?vs.coverage:void 0),ge(vs.description||null),be(!1))}).catch(vs=>{Rt||(be(!1),O(vs instanceof Error?vs.message:"Unable to confirm the payment amount."))}),()=>{Rt=!0,Os.abort()}):(le(s),R(!0),()=>{Rt=!0})},[Qe,s,ct]),p.useEffect(()=>{let Rt=!1;ie(!0),Mt(null),Y(!1),Be(null);const Os={amount:It,coverage:Zt,pendingPaymentIds:h,sessionBillingIds:c},vs={familyId:n,studentId:r,enrollmentId:a,sessionId:o,serviceType:m,paymentMonth:g};return(async()=>{const[cs,Ts]=await Promise.all([Ix({...Os,context:vs}),Ix(Os)]);if(Rt)return;Mt(cs);const mn=d3(n),ds=mn.find(Ls=>Nv(Ls,n,cs));ie(!!(ds||mn.some(Ls=>Ls.familyId===void 0&&Ls.fingerprint===Ts))),ds&&(Y(!0),Be(ds.status==="submitted"?"unknown":ds.status));let ms=!1;if(await Promise.all(mn.map(async Ls=>{try{const xl=await fetch(`/api/portal/payment-attempt/${encodeURIComponent(Ls.key)}`,{credentials:"include",signal:AbortSignal.timeout(8e3)}),bn=await xl.json();if(Rt||!xl.ok||bn.idempotencyKey!==Ls.key)return;const ya=Nv(Ls,n,cs)||Ls.familyId===void 0&&Ls.fingerprint===Ts;if(SG(bn)){if(wv(Ls.key),u3({httpOk:!0,payload:bn})==="completed"){ms||(ms=ya);for(const ur of["/api/portal/payments","/api/portal/enrollments","/api/portal/carry-forward-credits","/api/session-billing-with-attendance"])ke.invalidateQueries({queryKey:[ur]})}}else if(ya){const ur=bn.paymentState==="received"?"received":"unknown";lh({...Ls,familyId:n,fingerprint:cs,status:ur}),Y(!0),Be(ur)}}catch{}})),Rt||_e.current)return;const Yt=d3(n).find(Ls=>Nv(Ls,n,cs));Y(!!Yt),Be(Yt?Yt.status==="submitted"?"unknown":Yt.status:null),ms&&!Yt&&b()})().catch(()=>{}).finally(()=>{Rt||ie(!1)}),()=>{Rt=!0}},[n,r,a,o,m,g,It,JSON.stringify(Zt),JSON.stringify(h||[]),JSON.stringify(c||[]),Le]);const qn=async()=>{try{const Rt=await st("GET","/api/square-config");if(!Rt.ok)throw new Error("Failed to get Square configuration");const Os=await Rt.json();if(!Os.applicationId)throw new Error("Square application ID not configured");let vs=0;for(;!window.Square&&vs<50;)await new Promise(ds=>setTimeout(ds,100)),vs++;if(!window.Square)throw new Error("Square SDK not available - please refresh the page");let cs;try{cs=Os.locationId?window.Square.payments(Os.applicationId,Os.locationId):window.Square.payments(Os.applicationId)}catch(ds){throw new Error(`Square initialization failed: ${ds.message||"Unknown error"}`)}if(!document.getElementById("square-card-element"))throw new Error("Payment form element not found");const mn=await cs.card({style:{input:{fontSize:"16px",fontFamily:"Arial, sans-serif",color:"#373F4A",backgroundColor:"transparent"},".input-container":{borderColor:"#E0E2E7",borderRadius:"6px"},".input-container.is-focus":{borderColor:"#006AFF"},".input-container.is-error":{borderColor:"#FF1600"}}});await mn.attach("#square-card-element"),T(cs),z(mn),L(!0),Ze(ds=>({...ds,squareSDK:!0,squareConfig:!0,cardReady:!0}))}catch(Rt){L(!1),Ze(Os=>({...Os,lastError:Rt.message})),$e({title:"Payment System Error",description:`Failed to initialize payment system: ${Rt.message}. Please refresh the page and try again.`,variant:"destructive"})}},xn=async()=>
799{if(_e.current||D)return;if(me){$e({title:"Payment Status Unclear",description:"This specific payment has an unresolved result. Check its status before paying for these items again. Other payments are not blocked.",variant:"destructive"});return}if(!S){$e({title:"Payment Information Missing",description:"Please check that your profile is complete and you've selected a class or session, then try again.",variant:"destructive"});return}if(Fe||re||ne===null||!Me){$e({title:"Confirm the Payment Amount",description:re||"Review and accept the authoritative payment amount before continuing.",variant:"destructive"});return}const Rt=It===0;if(!Rt&&!B){$e({title:"Payment Error",description:"Payment form not ready. Please refresh the page.",variant:"destructive"});return}const Os=/^\d{5}(-\d{4})?$/;if(!Rt&&!se.trim()){$e({title:"Cardholder Name Required",description:"Please enter the name as it appears on your card.",variant:"destructive"});return}if(!Rt&&(!W.trim()||!Os.test(W.trim()))){$e({title:"Valid Billing ZIP Required",description:"Please enter your 5-digit billing ZIP code (e.g., 12345).",variant:"destructive"});return}_e.current=!0,P(!0);try{const vs=await $G(It,B),cs=ht||await Ix({amount:It,coverage:Zt,pendingPaymentIds:h,sessionBillingIds:c,context:{familyId:n,studentId:r,enrollmentId:a,sessionId:o,serviceType:m,paymentMonth:g}}),Ts=x||(typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`checkout-${Date.now()}-${Math.random().toString(36).slice(2,12)}`);lh({key:Ts,familyId:n,fingerprint:cs,status:"submitted",createdAt:Date.now()});let mn,ds={};try{mn=await fetch("/api/create-payment-intent",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:It,expectedAmount:(V==null?void 0:V.grossAmount)??y??It,grossAmount:(V==null?void 0:V.grossAmount)??y??It,creditAmount:(V==null?void 0:V.creditAmount)??0,remainingCredit:(V==null?void 0:V.remainingCredit)??0,creditApplications:(V==null?void 0:V.creditApplications)??[],...vs?{sourceId:vs}:{},familyId:n,studentId:r,enrollmentId:a,sessionId:o,sessionBillingIds:c,coverage:Zt,pendingPaymentIds:h||[],idempotencyKey:Ts,description:Zs,serviceType:m||"Other Payment",billingPeriod:"one-time",paymentMonth:g,...vs?{cardholderName:se.trim(),billingZip:W.trim()}:{}})});const Yt=await mn.text();try{ds=Yt?JSON.parse(Yt):{}}catch{ds={message:Yt}}}catch{lh({key:Ts,familyId:n,fingerprint:cs,status:"unknown",createdAt:Date.now()}),Y(!0),Be("unknown"),A(Yt=>Yt+1),$e({title:"Payment Status Unclear",description:"The payment may have been submitted, but its result could not be confirmed. Do not retry; please contact AAC Voices.",variant:"destructive"});return}const ms=u3({httpOk:mn.ok,httpStatus:mn.status,payload:ds});if(ms==="completed"){wv(Ts),$e({title:"Payment Successful!",description:Rt?"Your carry-forward credit was applied successfully.":`Payment of $${It.toFixed(2)} has been processed.`,className:"border-l-4 border-l-aac-blue bg-aac-blue/10"}),b(ds.receiptUrl);return}if(ms==="received"){lh({key:Ts,familyId:n,fingerprint:cs,status:"received",createdAt:Date.now()}),Y(!0),Be("received"),$e({title:"Payment Received",description:"Square received this payment, but its account record needs review. Do not pay for these same items again. Other payments are not blocked."}),w==null||w();return}if(ms==="declined")throw wv(Ts),N==null||N(),new Error(ds.message||"Your card was declined. No payment was taken.");if(ms==="unknown"){lh({key:Ts,familyId:n,fingerprint:cs,status:"unknown",createdAt:Date.now()}),Y(!0),Be("unknown"),A(Yt=>Yt+1),$e({title:"Payment Status Unclear",description:"This payment result could not be confirmed. Checking its status will not charge you again. Other payments are not blocked.",variant:"destructive"});return}}catch(vs){$e({title:"Payment Failed",description:vs.message||"Payment could not be processed.",variant:"destructive"})}finally{_e.current=!1,P(!1)}},un=E?"Payment is processing. Please wait; do not submit another payment.":me?Te==="received"?"Square received this specific payment. Check its status before paying for these items again.":"This checkout has an uncertain result. Check its status before paying for these items again.":S?re?"The payment amount could not be confirmed. Review the error above.":Fe||ne===null?"Waiting for the confirmed payment amount.":It>0&&(!M||!B)?"The card form is not ready. Check the card section above for loading or error details.":It>
7990&&(!se.trim()||!W.trim())?"Enter the cardholder name and billing ZIP code above.":Me?null:"Review the amount and select its confirmation checkbox above.":"Required class or session information is missing. Review the warning above.";return e.jsxs(Ce,{ref:K,className:`flex min-h-0 min-w-0 flex-1 flex-col overscroll-contain ${De?"overflow-y-auto":"overflow-hidden"}`,children:[e.jsxs(Se,{className:`min-w-0 space-y-4 p-[8px] sm:p-4 scroll-py-4 [overflow-wrap:anywhere] ${De?"shrink-0":"min-h-0 flex-1 overflow-y-auto overscroll-contain"}`,children:[e.jsx(Ve,{className:"p-0",children:e.jsxs(Ue,{className:"flex items-center gap-2 text-base",children:[e.jsx(Or,{className:"h-5 w-5 shrink-0"}),"Secure Payment"]})}),e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium",children:"Payment Details"}),e.jsx("p",{className:"text-sm text-gray-600",children:Zs}),e.jsx("p",{className:"text-lg font-semibold text-blue-600",children:Fe?"Confirming amountâ¦":`Card payment: $${It.toFixed(2)}`}),V&&e.jsxs("div",{className:"mt-3 space-y-1 border-t pt-3 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap justify-between gap-x-2",children:[e.jsx("span",{children:"Services total"}),e.jsxs("strong",{children:["$",V.grossAmount.toFixed(2)]})]}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-x-2 text-green-700",children:[e.jsx("span",{children:"Carry-forward credit applied"}),e.jsxs("strong",{children:["â$",V.creditAmount.toFixed(2)]})]}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-x-2",children:[e.jsx("span",{children:"Remaining card payment"}),e.jsxs("strong",{children:["$",V.amount.toFixed(2)]})]}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-x-2 text-gray-600",children:[e.jsx("span",{children:"Credit remaining after payment"}),e.jsxs("strong",{children:["$",V.remainingCredit.toFixed(2)]})]})]}),ct&&ne!==null&&!re&&e.jsxs("label",{className:"mt-3 flex items-start gap-2 text-sm text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:Me,onChange:Rt=>R(Rt.target.checked),disabled:me||E,className:"mt-1"}),e.jsx("span",{children:"I reviewed the services total, applied credit, and remaining card payment shown above."})]}),re&&e.jsxs("p",{className:"mt-2 text-sm text-red-700",children:["We could not confirm this payment amount: ",re]})]}),me&&e.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-300 rounded-lg text-sm text-amber-800",children:[e.jsx("strong",{children:"This checkout needs a status check."})," ",Te==="received"?"Square received this payment, but its account record needs review. Do not pay for these same items again.":"This payment result could not be confirmed. Do not pay for these same items again until its status is confirmed."," ","Other payments are not blocked.",e.jsx(F,{type:"button",variant:"outline",className:"mt-2",disabled:D||E,onClick:()=>A(Rt=>Rt+1),children:D?"Checking statusâ¦":"Check payment status"})]}),!S&&e.jsx("div",{className:"p-4 bg-amber-50 border border-amber-200 rounded-lg",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-5 h-5 text-amber-600 mt-0.5",children:e.jsx(rl,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-amber-800 mb-2",children:"We're missing some information needed to complete this payment"}),e.jsx("p",{className:"text-sm text-amber-700 mb-3",children:"Please check the following:"}),e.jsxs("ul",{className:"text-sm text-amber-700 space-y-1 mb-4 pl-4",children:[e.jsx("li",{children:"⢠Is your student profile fully filled out?"}),e.jsx("li",{children:"⢠Are you logged in to the correct account?"}),e.jsx("li",{children:"⢠Did you select a class or session?"}),e.jsx("li",{children:"⢠Try refreshing the page and navigating back to this payment"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(F,{size:"sm",variant:"outline",onClick:()=>window.location.reload(),className:"bg-white hover:bg-amber-50 text-amber-700 border-amber-300",children:"Refresh Page"}),e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>_(!0),className:"bg-white hover:bg-amber-50 text-amber-700 border-amber-300",children:[e.jsx(qx,{className:"w-4 h-4 mr-1"}),"Get Help"]})]})]})]})}),It>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"cardholder-name",className:"text-sm font-medium",children:"Cardholder Name *"}),e.jsx(je,{id:"cardholder-name",type:"text",value:se,onChange:Rt=>ae(Rt.target.value),placeholder:"Name as it appears on card",className:"mt-1",disabled:!S,maxLength:50})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"billing-zip",className:"text-sm font-medium",children:"Billing ZIP Co
799de *"}),e.jsx(je,{id:"billing-zip",type:"text",value:W,onChange:Rt=>J(Rt.target.value.replace(/[^0-9-]/g,"")),placeholder:"12345",className:"mt-1",disabled:!S,maxLength:10})]})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Card Information *"}),e.jsx("div",{id:"square-card-element",ref:$,className:`p-[4px] sm:p-4 border rounded-lg bg-white min-h-[60px] ${S?"":"opacity-50"}`,children:!M&&e.jsx("div",{className:"text-gray-500 text-center",children:"Loading payment form..."})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[e.jsx(N2,{className:"w-4 h-4"}),e.jsx("span",{children:"Your payment is secured by Square"})]})]}):e.jsx("div",{className:"rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800",children:"Your available carry-forward credit covers this payment. No card is required."}),e.jsx("p",{id:"payment-readiness",role:"status","aria-live":"polite","aria-atomic":"true",className:"text-sm text-gray-700 empty:hidden",children:un})]}),e.jsx("div",{ref:xe,className:"shrink-0 border-t bg-white p-3",children:e.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] items-stretch gap-3",children:[e.jsx(F,{variant:"outline",onClick:k,disabled:E,className:"h-auto min-h-11 min-w-0 whitespace-normal px-3 py-2 [overflow-wrap:anywhere]",children:e.jsx("span",{className:"min-w-0",children:"Cancel"})}),e.jsx(F,{onClick:xn,"aria-describedby":un?"payment-readiness":void 0,disabled:E||D||me||Fe||!!re||ne===null||!Me||It>0&&(!M||!B)||!S||It>0&&(!se.trim()||!W.trim()),className:"h-auto min-h-11 min-w-0 whitespace-normal px-3 py-2 [overflow-wrap:anywhere] disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx("span",{className:"min-w-0",children:E?"Processing":me?"Payment Paused":re?"Amount Unavailable":Fe||ne===null?"Confirming Amount":It===0?"Apply Credit":`Pay $${It.toFixed(2)}`})})]})}),e.jsx(PG,{isOpen:U,onClose:()=>_(!1)})]})}function iE({isAuthenticated:s=!1}){const[t,n]=p.useState(["login"]),r=o=>{n(c=>c.includes(o)?c.filter(u=>u!==o):[...c,o])},a=[{id:"login",title:"Login Problems",icon:N2,color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:`"I can't log in to my account"`}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:"Double-check your email address (exactly as provided by AAC Voices)"}),e.jsx("li",{children:"Make sure there are no extra spaces before or after your password"}),e.jsx("li",{children:"Try typing your password in a text document first, then copy/paste it"}),e.jsx("li",{children:"Clear your browser cache or try an incognito/private window"}),e.jsx("li",{children:"Contact Kate directly: [email protected] or text (978) 420-4902"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:'"I forgot my password"'}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:'Click "Forgot your password?" on the login page'}),e.jsx("li",{children:"Email Kate at [email protected] with your registered email address"}),e.jsx("li",{children:'Include "Password Reset Request" in the subject line'})]})]})]})},{id:"enrollment",title:"How to Enroll in Classes",icon:ar,color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-200",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"Step-by-Step Enrollment Process:"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:"Log into your Family Portal at the AAC Voices website"}),e.jsx("li",{children:'Click the "Classes" tab in your portal navigation'}),e.jsx("li",{children:"Choose your session: Summer Trimester, Camp CommuniKate, or Fall Trimester"}),e.jsx("li",{children:"Select your classes by clicking on class cards that fit your schedule"}),e.jsx("li",{children:"Review class details including times, dates, and requirements"}),e.jsx("li",{children:"Choose enrollment period: 1 week (pick specific weeks), 1 month (auto-selects 4 weeks), or full trimester (auto-selects all weeks)"}),e.jsx("li",{children:'Complete enrollment by clicking "Enroll in Selected Classes"'}),e.jsx("li",{children:'Make payment using the "Make or Arrange Payment" button'})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-3",children:"Class Types Available:"}),e.jsxs("div",{className:"grid gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-blue-50 border border-blue-200",children:[e.jsx(ar,{className:"w-4 h-4 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Ahern Academy:"})," Full homeschool program (mornings) - Literacy (9:15, 10:30, 11:15) and Math (9:50, 11:45, 12:15)"]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-green-50 border border-green-200",children:[e.jsx(Pn,{className:"w-4 h-4 text-green-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Open Enrollment:"})," Afternoon classes - Shared Reading, Writing Workshop, Talker Power, Young Adult Chat, Arts, Cooking, Science"]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-purple-50 border border-purple-200",children:[e.jsx(ti,{className:"w-4 h-4 text-purple-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"1:1 Sessions:"})," Private instruction scheduled separately"]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-orange-50 border border-orange-200",children:[e.jsx(Ms,{className:"w-4 h-4 text-orange-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Young Adult Chat:"})," Social groups for older students"]})]})]})]})]})},{id:"payments",title:"Payment Information",icon:Or,color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-200",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"Current Rates (Through August 2025):"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ahern Academy:"})," $475/month, $1,900/trimester"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Open Enrollment Classes:"})," $40/week (1 class), $70/week (2 classes), $100/week (3 classes), $130/week (4 classes), $160/week (5+ classes)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"1:1 Sessions:"})," $150/hour (new students), $125/hour (established students)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Young Adult Chat:"})," $40/week"]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"New Rates (Starting September 2025):"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ahern Academy:"})," $487/month, $1,948/trimester"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Open Enrollment Classes:"})," $42/week (1 class), $74/week (2 classes), $108/week (3 classes), $138/week (4+ classes)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"1:1 Sessions:"})," $150/hour"]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-3",children:"Payment Status Categories:"}),e.jsxs("div",{className:"grid gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-green-50 border border-green-200",children:[e.jsx(As,{className:"w-4 h-4 text-green-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Paid in Full"})," - Payment has been completed and processed"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-red-50 border border-red-200",children:[e.jsx(Qr,{className:"w-4 h-4 text-red-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Payment Due"})," - Payment is required now or was due in the past"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-red-50 border border-red-200",children:[e.jsx(Qr,{className:"w-4 h-4 text-red-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Payment Overdue"})," - Payment deadline has passed and immediate action needed"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-orange-50 border border-orange-200",children:[e.jsx(an,{className:"w-4 h-4 text-orange-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Pay to Confirm Enrollment"})," - Payment required to secure your class spot"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-yellow-50 border border-yellow-200",children:[e.jsx(ys,{className:"w-4 h-4 text-yellow-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Upcoming Payment Due"})," - Future payment scheduled, not yet due"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-blue-50 border border-blue-200",children:[e.jsx(Ms,{className:"w-4 h-4 text-blue-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Scholarship (25%, 50%, 75%, 100%)"})," - Reduced rate or free based on financial assistance"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-purple-50 border border-purple-200",children:[e.jsx(Pn,{className:"w-4 h-4 text-purple-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Third Party"})," - Payment handled by someone else (school district, agency, etc.)"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-gray-50 border border-gray-200",children:[e.jsx(ti,{className:"w-4 h-4 text-gray-600 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Unenrolled"})," - No current class enrollments requiring payment"]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"How to Make Payments:"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:'Go to "Payments" tab in your family portal'}),e.jsx("li",{children:'Click "Make Payment" on any pending payment'}),e.jsx("li",{children:"Enter your payment amount (shows suggested amount, but you can pay partial amounts)"}),e.jsx("li",{children:"Fill in credit card information securely through Square"}),e.jsx("li",{children:"Review and submit your payment"}),e.jsx("li",{children:"Save your receipt (emailed automatically)"})]})]})]})},{id:"student-info",title:"Student Information",icon:ti,color:"text-purple-600",bgColor:"bg-purple-50",borderColor:"border-purple-200",content:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:`"My child's information looks wrong"`}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:`Use the "Edit" button on your student's card to make corrections`}),e.jsx("li",{children:"Some fields may only be editable by AAC Voices staff"}),e.jsx("li",{children:"Contact Kate for changes to enrollment status or program assignments"})]})]})})}
799,{id:"technical",title:"ð± Technical Difficulties",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:`"The website isn't working on my phone/tablet"`}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:"Try refreshing the page"}),e.jsx("li",{children:"Clear your browser cache"}),e.jsx("li",{children:"Update your browser app"}),e.jsx("li",{children:"Try switching between WiFi and mobile data"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:`"I'm getting error messages"`}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:"Take a screenshot of the error"}),e.jsx("li",{children:"Note what you were trying to do when it happened"}),e.jsx("li",{children:"Email the screenshot to [email protected]"})]})]})]})},{id:"troubleshooting",title:"ð§ Troubleshooting",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"Quick Solutions:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Can't find something?"})," Check all five tabs: Dashboard, Students, Classes, Payments, Caregiver Info"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Page won't load?"})," Refresh the page or try a different browser"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Buttons not working?"})," Make sure JavaScript is enabled in your browser"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Need immediate help?"})," Text Kate at (978) 420-4902"]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"Common Enrollment Issues:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsxs("li",{children:[e.jsx("strong",{children:`"I can't see any classes to enroll in"`})," - Make sure you've selected an active session first"]}),e.jsxs("li",{children:[e.jsx("strong",{children:'"My payment was declined"'})," - Verify card information and contact your bank"]}),e.jsxs("li",{children:[e.jsx("strong",{children:`"I enrolled but don't see a payment due"`})," - Payments may take 24 hours to generate"]}),e.jsxs("li",{children:[e.jsx("strong",{children:`"The cost doesn't look right"`})," - Check if scholarship discounts are applied"]})]})]})]})}];return e.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[e.jsx("div",{className:"text-center mb-8",children:e.jsxs("div",{className:"inline-flex items-center gap-3 p-4 bg-gradient-to-r from-[#77dbf6]/20 to-[#adcfff]/20 rounded-xl border border-[#77dbf6]/30 mb-4",children:[e.jsx(qx,{className:"w-8 h-8 text-[#77dbf6]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-[#4A4A4A]",children:"Help & Support"}),e.jsx("p",{className:"text-sm text-[#4A4A4A]/70",children:"Find answers to common questions"})]})]})}),e.jsx("div",{className:"space-y-4 mb-8",children:a.map(o=>e.jsx(Ce,{className:`border-2 ${o.borderColor}/30 shadow-sm hover:shadow-md transition-shadow`,children:e.jsxs(sj,{open:t.includes(o.id),onOpenChange:()=>r(o.id),children:[e.jsx(BS,{asChild:!0,children:e.jsx(Ve,{className:"cursor-pointer hover:bg-[#77dbf6]/5 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ue,{className:"text-xl text-[#4A4A4A] flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${o.bgColor} ${o.borderColor} border`,children:o.icon&&Ut.createElement(o.icon,{className:`w-5 h-5 ${o.color}`})}),o.title]}),t.includes(o.id)?e.jsx(ac,{className:"w-5 h-5 text-[#4A4A4A]"}):e.jsx(Bc,{className:"w-5 h-5 text-[#4A4A4A]"})]})})}),e.jsx(nj,{children:e.jsx(Se,{className:"pt-0",children:o.content})})]})},o.id))}),e.jsxs(Ce,{className:"bg-gradient-to-br from-[#adcfff] to-[#bfddff] border-[#77dbf6]",children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"text-xl text-[#4A4A4A] flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-[#77dbf6]/20 border border-[#77dbf6]/40",children:e.jsx(qx,{className:"w-5 h-5 text-[#77dbf6]"})}),"Getting Help"]}),e.jsx(rn,{className:"text-[#4A4A4A]",children:"When you need additional support beyond this help section"})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"Contact Methods:"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs(F,{variant:"outline",className:"flex items-center gap-2 h-auto p-4 bg-white/50 hover:bg-white/80",onClick:()=>window.open("mailto:[email protected]"),children:[e.jsx(ir,{className:"w-4 h-4"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold",children:"Email Kate"}),e.jsx("div",{className:"text-xs",children:"[email protected]"}),e.jsx("div",{className:"text-xs text-gray-600",children:"Best for detailed questions"})]})]}),e.jsxs(F,{variant:"outline",className:"flex items-center gap-2 h-auto p-4 bg-white/50 hover:bg-white/80",onClick:()=>window.open("tel:9784204902"),children:[e.jsx(E0,{className:"w-4 h-4"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold",children:"Text Kate"}),e.jsx("div",{className:"text-xs",children:"(978) 420-4902"}),e.jsx("div",{className:"text-xs text-gray-600",children:"For quick login help"})]})]}),e.jsxs(F,{variant:"outline",className:"flex items-center gap-2 h-auto p-4 bg-white/50 hover:bg-white/80",onClick:()=>window.open("https://www.aacvoices.org","_blank"),children:[e.jsx(Ya,{className:"w-4 h-4"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold",children:"Main Website"}),e.jsx("div",{className:"text-xs",children:"www.aacvoices.org"}),e.jsx("div",{className:"text-xs text-gray-600",children:"General information"})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-[#4A4A4A] mb-2",children:"When contacting support, please include:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-[#4A4A4A]",children:[e.jsx("li",{children:"Your registered email address"}),e.jsx("li",{children:"A description of the problem"}),e.jsx("li",{children:"What device/browser you're using"}),e.jsx("li",{children:"Any error messages you see"})]})]})]})]})]})}
799const Ah="America/New_York";function lE(s){var t;return typeof s=="string"?((t=s.match(/^\d{4}-\d{2}-\d{2}/))==null?void 0:t[0])||null:s instanceof Date&&!Number.isNaN(s.getTime())?s.toISOString().slice(0,10):null}function TG(s,t=vt.now().setZone(Ah)){return s.filter(n=>{if(n.isBreakWeek||Number(n.weekNumber)<=0)return!1;const r=lE(n.endDate);if(!r)return!1;const a=vt.fromISO(r,{zone:Ah}).endOf("day");return a.isValid&&a>=t}).sort((n,r)=>Number(n.weekNumber)-Number(r.weekNumber))}function _G(s,t){const n=s.findIndex(r=>Number(r.weekNumber)===t);return n<0?[]:s.slice(n,n+4).map(r=>Number(r.weekNumber))}function IG(s){return s.map(t=>Number(t.weekNumber))}function DG(s,t,n=vt.now().setZone(Ah)){const r=new Set(t.map(Number)),o=s.filter(x=>!x.isBreakWeek&&Number(x.weekNumber)>0&&r.has(Number(x.weekNumber))).map(x=>{const m=lE(x.startDate);return m?vt.fromISO(m,{zone:Ah}).startOf("day"):null}).filter(x=>!!(x!=null&&x.isValid)).sort((x,m)=>x.toMillis()-m.toMillis())[0];if(!o)return!1;const c=(o.weekday+1)%7,u=o.minus({days:c}).set({hour:12,minute:0,second:0,millisecond:0}),h=n.setZone(Ah);return h.isValid&&h>=u}const OG=()=>nt({queryKey:["rates","current"],queryFn:async()=>{const[s,t,n,r,a,o,c,u,h,x]=await Promise.all([st("POST","/api/calculate-rate",{serviceType:"ahern_academy",billingType:"monthly"}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"ahern_academy",billingType:"trimester"}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"open_enrollment",classesPerWeek:1}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"open_enrollment",classesPerWeek:2}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"open_enrollment",classesPerWeek:3}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"open_enrollment",classesPerWeek:4}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"open_enrollment",classesPerWeek:5}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"one_on_one",studentType:"established"}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"registration_fee"}).then(m=>m.json()),st("POST","/api/calculate-rate",{serviceType:"late_fee"}).then(m=>m.json())]);return{ahernMonthly:s.rate,ahernTrimester:t.rate,openEnrollment:[0,n.rate,r.rate,a.rate,o.rate,c.rate],oneOnOne:u.rate,registrationFee:h.rate,lateFee:x.rate,yac:n.rate}},staleTime:300*1e3}),m3=["Drama","Comedy","Story Writing","Sexuality"],Vc=[{id:"action",title:"What would you like to do?",description:"Choose your next step"},{id:"session",title:"Which session?",description:"Select the session you want to enroll in"},{id:"classes",title:"Which classes?",description:"Choose your classes for this session"},{id:"student",title:"Which student?",description:"Select the student for enrollment"},{id:"weeks",title:"Which weeks?",description:"Choose your enrollment period"},{id:"payment",title:"Payment",description:"Review and complete your enrollment"}];function FG({familyData:s,isOpen:t,initialSessionId:n,onClose:r,onComplete:a,onNavigateToPrograms:o}){const[c,u]=p.useState(0),[h,x]=p.useState({}),[m,g]=p.useState([]),[y,b]=p.useState(!1),[w,N]=p.useState({}),[k,E]=p.useState({}),[P,M]=p.useState(!1),{toast:L}=Is(),B=dn(),{data:z,isLoading:H,error:T}=OG(),U=$=>{const K=s.students.find(De=>De.id===$);return K?K.name&&K.name.trim()!=="":!1},_=$=>{var De;const K=s.students.find(X=>X.id===$);if(!K)return null;if(K.nicknames&&K.nicknames.trim())return K.nicknames;const xe=((De=K.name)==null?void 0:De.trim())||"";return xe||null},{data:se,isLoading:ae}=nt({queryKey:["/api/sessions/active"],enabled:t&&c>=1}),W=(se==null?void 0:se.filter($=>{const K=Gu($);return K==="enrolling"||K==="active"}))||[];p.useEffect(()=>{t&&n&&W.some($=>$.id===n)&&x($=>({...$,sessionId:n}))},[t,n,se]);const{data:J,isLoading:ne}=nt({queryKey:["/api/portal/class-slots",h.sessionId],queryFn:()=>st("GET",`/api/portal/class-slots?sessionId=${h.sessionId}`).then($=>$.json()),enabled:t&&!!h.sessionId&&c>=2}),le=()=>{var ie,$e;if(!((ie=h.classSlotIds)!=null&&ie.length))return{totalCost:0,breakdown:[]};if(!ue&&!m.length)return{totalCost:0,breakdown:[]};
799{const ke=s.students.find(S=>S.id===h.studentId);if(($e=ke==null?void 0:ke.studentCategories)!=null&&$e.includes("Ahern Academy"))return{totalCost:0,breakdown:[{description:"Included in your Ahern Academy tuition at no additional cost",cost:0}]}}if(!z)return{totalCost:0,breakdown:[{description:"Rates unavailable - please try again",cost:0}]};const $=h.classSlotIds.length,K=m.length,xe=(J==null?void 0:J.filter(ke=>{var S;return(S=h.classSlotIds)==null?void 0:S.includes(ke.id)}))||[];xe.some(ke=>ke.className.toLowerCase().includes("chit chat")||ke.className.toLowerCase().includes("book club"));const De=xe.filter(ke=>!ke.className.toLowerCase().includes("chit chat")&&!ke.className.toLowerCase().includes("book club")).length;if(De===0)return{totalCost:0,breakdown:[{description:`${$} free class${$>1?"es":""} Ã ${K} week${K>1?"s":""}`,cost:0}]};if(ue){const ke=ct=>ct.className.toLowerCase().includes("chit chat")||ct.className.toLowerCase().includes("book club"),S=new Map;for(const ct of xe)!ke(ct)&&ct.weekNumber!=null&&S.set(ct.weekNumber,(S.get(ct.weekNumber)??0)+1);for(const ct of xe)if(!ke(ct)&&ct.weekNumber==null)for(const It of k[ct.id]??[])S.set(It,(S.get(It)??0)+1);let ve=0;const Ze=[];
799for(const[ct,It]of[...S.entries()].sort((Zs,Zt)=>Zs[0]-Zt[0])){const Zs=z.openEnrollment[Math.min(It,5)];Zs&&(ve+=Zs,Ze.push({description:`Week ${ct}: ${It} class${It>1?"es":""} @ $${Zs}`,cost:Zs}))}const Qe=xe.filter(ke).length;if(Qe>0&&Ze.push({description:`${Qe} free class${Qe>1?"es":""} (Chit Chat Club)`,cost:0}),s.scholarshipPercentage===100){const ct=ve;ve=0,Ze.push({description:"Scholarship (100% covered)",cost:-ct})}return{totalCost:ve,breakdown:Ze}}const X=z.openEnrollment[Math.min(De,5)];if(!X)return{totalCost:0,breakdown:[{description:"Rate not available for selected class count",cost:0}]};const _e=X*K;let Le=_e;const A=[];De>0&&A.push({description:`${De} paid class${De>1?"es":""} Ã ${K} week${K>1?"s":""}`,cost:_e});const D=$-De;return D>0&&A.push({description:`${D} free class${D>1?"es":""} (Chit Chat Club)`,cost:0}),s.scholarshipPercentage===100&&(Le=0,A.push({description:"Scholarship (100% covered)",cost:-_e})),{totalCost:Le,breakdown:A}},{data:V=[],isLoading:Z}=nt({queryKey:["/api/week-calendar",h.sessionId],queryFn:()=>st("GET",`/api/week-calendar/${h.sessionId}`).then($=>$.json()),enabled:t&&!!h.sessionId&&c>=2}),ue=V.length>0,ge=TG(V),G=$=>!m3.includes($.className)||$.weekNumber==null?null:(J==null?void 0:J.find(K=>K.className===$.className&&K.timeSlot===$.timeSlot&&K.id!==$.id&&Math.abs((K.weekNumber??-99)-$.weekNumber)===1))??null,Ae=$=>{const K=h.classSlotIds||[],xe=K.includes($.id),De=G($);let X;xe?X=K.filter(_e=>_e!==$.id&&_e!==(De==null?void 0:De.id)):(X=[...K,$.id],De&&!K.includes(De.id)&&X.push(De.id)),x(_e=>({..._e,classSlotIds:X}))},Fe=$=>new Date($).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),be=$=>$==="trimester"?IG(ge):[],Me=($,K)=>{N(xe=>({...xe,[$]:K})),E(xe=>({...xe,[$]:be(K)}))},R=($,K)=>{const xe=_G(ge,K);E(De=>({...De,[$]:xe}))},re=$=>{var De;if(((De=h.classSlotIds)==null?void 0:De.includes($.id))??!1){x(X=>({...X,classSlotIds:(X.classSlotIds??[]).filter(_e=>_e!==$.id)})),E(X=>{const _e={...X};return delete _e[$.id],_e}),N(X=>{const _e={...X};return delete _e[$.id],_e});return}const xe=w[$.id]??"trimester";x(X=>{var _e;return{...X,classSlotIds:(_e=X.classSlotIds)!=null&&_e.includes($.id)?X.classSlotIds:[...X.classSlotIds??[],$.id]}}),N(X=>({...X,[$.id]:xe})),E(X=>({...X,[$.id]:be(xe)}))};p.useEffect(()=>{h.sessionId&&c===4&&g([])},[h.sessionId,c]),p.useEffect(()=>{if(V.length===0)return;const $=(J??[]).filter(K=>{var xe;return((xe=h.classSlotIds)==null?void 0:xe.includes(K.id))&&K.weekNumber==null});$.length&&E(K=>{var De;const xe={...K};for(const X of $){const _e=w[X.id]??"trimester";_e==="trimester"&&!((De=xe[X.id])!=null&&De.length)&&(xe[X.id]=be(_e))}return xe})},[V]);const O=()=>{if(!ue)return[...m];const $=(J??[]).filter(xe=>{var De;return(De=h.classSlotIds)==null?void 0:De.includes(xe.id)}),K=new Set;for(const xe of $){if(xe.weekNumber!=null){K.add(Number(xe.weekNumber));continue}for(const De of k[xe.id]??[])K.add(Number(De))}return Array.from(K).sort((xe,De)=>xe-De)},me=bt({mutationFn:async()=>{const $=le().totalCost;if(!ue)return await st("POST","/api/enrollments/bulk",{studentId:h.studentId,familyId:s.id,classSlotIds:h.classSlotIds,enrolledWeeks:m,enrollmentPeriod:h.enrollmentPeriod||"week",paymentAmount:$});const K=(J??[]).filter(A=>{var D;return(D=h.classSlotIds)==null?void 0:D.includes(A.id)}),xe=K.filter(A=>A.weekNumber!=null),De=K.filter(A=>A.weekNumber==null),X=[];xe.length&&X.push({slotIds:xe.map(A=>A.id),weeks:[],period:"week"});const _e=new Map;for(const A of De){const D=[...k[A.id]??[]].sort((S,ve)=>S-ve),ie=w[A.id]??"trimester",$e=`${ie}|${D.join(",")}`,ke=_e.get($e);ke?ke.slotIds.push(A.id):_e.set($e,{slotIds:[A.id],weeks:D,period:ie})}X.push(...Array.from(_e.values()));let Le=null;for(let A=0;A<X.length;A++)Le=await st("POST","/api/enrollments/bulk",{studentId:h.studentId,familyId:s.id,classSlotIds:X[A].slotIds,enrolledWeeks:X[A].weeks,enrollmentPeriod:X[A].period,paymentAmount:A===0?$:0});return Le},onSuccess:()=>{DG(V,O())&&setTimeout(()=>{L({title:"Late Registration Notice",description:"Since you registered after Saturday at noon, you may
799not receive the weekly password by email. Please text Kate at 978-596-4712 or email [email protected] to get this week's password.",duration:1e4})},500),B.invalidateQueries({queryKey:["/api/portal/enrollments"]}),B.invalidateQueries({queryKey:["/api/portal/payments"]}),M(!0)},onError:$=>{L({title:"Enrollment Failed",description:$.message||"There was an error processing your enrollment.",variant:"destructive"})}}),Y=()=>{var $,K,xe;switch(c){case 0:if(!h.action){L({title:"Please select an action",variant:"destructive"});return}if(h.action!=="enroll"){h.action==="schedule"&&o&&o(),r();return}break;case 1:if(!h.sessionId){L({title:"Please select a session",variant:"destructive"});return}break;case 2:if(!(($=h.classSlotIds)!=null&&$.length)){L({title:"Please select at least one class",variant:"destructive"});return}if(ue){const X=(J??[]).filter(_e=>{var Le;return((Le=h.classSlotIds)==null?void 0:Le.includes(_e.id))&&_e.weekNumber==null});for(const _e of X)if(!((K=k[_e.id])!=null&&K.length)){L({title:`Please select weeks for ${_e.className}`,variant:"destructive"});return}}break;case 3:if(!h.studentId&&s.students.length>1){L({title:"Please select a student",variant:"destructive"});return}!h.studentId&&s.students.length===1&&x(X=>({...X,studentId:s.students[0].id}));const De=h.studentId||((xe=s.students[0])==null?void 0:xe.id);if(De&&!U(De)){L({title:"Incomplete Student Profile",description:"Please complete the student's profile (name field) before continuing.",variant:"destructive",action:e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{Be(),window.location.href="/family-portal?tab=students"},children:"Complete Profile"})});return}break;case 4:if(!ue&&!m.length){L({title:"Please select at least one week",variant:"destructive"});return}break}if(c===2&&ue){const De=(J??[]).filter(X=>{var _e;return((_e=h.classSlotIds)==null?void 0:_e.includes(X.id))&&X.weekNumber!=null}).map(X=>X.weekNumber);g([...new Set(De)].sort((X,_e)=>X-_e))}if(c===2&&s.students.length===1){const De=s.students[0].id;if(!U(De)){L({title:"Incomplete Student Profile",description:"Please complete your student's profile (name field) before enrolling in classes.",variant:"destructive",action:e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{Be(),window.location.href="/family-portal?tab=students"},children:"Complete Profile"})});return}x(X=>({...X,studentId:De})),u(ue?5:4)}else u(c===3&&ue?5:De=>Math.min(De+1,Vc.length-1))},Te=()=>{c===5&&ue?u(s.students.length===1?2:3):c===4&&s.students.length===1?u(2):u($=>Math.max($-1,0))},Be=()=>{u(0),x({}),g([]),E({}),N({}),b(!1),M(!1),r()},ht=$=>{const K=$.timeSlot.toLowerCase(),xe=$.className.toLowerCase();return K==="yac"?{type:"Young Adult Chat",color:"bg-purple-100 text-purple-800"}:xe.includes("ahern")?{type:"Ahern Academy",color:"bg-blue-100 text-blue-800"}:xe.includes("chit chat")||xe.includes("book club")?{type:"Chit Chat Club (FREE)",color:"bg-orange-100 text-orange-800"}:{type:"Open Enrollment",color:"bg-green-100 text-green-800"}},Mt=()=>{var K,xe;switch(Vc[c].id){case"action":return e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"grid gap-3",children:[{id:"enroll",title:"Enroll in a class",description:"Add new class enrollments"},{id:"view",title:"View/edit enrollments",description:"Manage existing enrollments"},{id:"schedule",title:"View class schedules",description:"See class times and dates"}].map(X=>e.jsx(F,{variant:h.action===X.id?"default":"outline",className:"h-auto p-4 justify-start",onClick:()=>x(_e=>({..._e,action:X.id})),children:e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-medium",children:X.title}),e.jsx("div",{className:"text-sm text-muted-foreground",children:X.description})]})},X.id))})});case"session":return e.jsx("div",{className:"space-y-4",children:ae?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#77dbf6]"})}):W.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(an,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-lg font-medium text-gray-600",children:"No sessions available for enrollment"}),e.jsx("p",{className:"text-sm text-gray-500",children:"All current sessions have ended or are not yet open for enrollment."})]}):e.jsx("div",{className:"grid gap-3",children:W.map(X=>{const _e=Gu(X),Le=_e==="enrolling"?"text-green-600":"text-blue-600",A=_e==="enrolling"?"Enrollment Open":"Currently Active";return e.jsx(F,{variant:h.sessionId===X.id?"default":"outline",className:"h-auto p-4 justify-start whitespace-normal",onClick:()=>x(D=>({...D,sessionId:X.id})),children:e.jsxs("div",{className:"text-left flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("div",{className:"font-medium",children:X.name}),e.jsx("div",{className:`text-xs font-medium ${Le}`,children:A})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[new Date(X.startDate).toLocaleDateString()," - ",new Date(X.endDate).toLocaleDateString()]}),X.description&&e.jsx("div",{className:"text-sm text-muted-foreground mt-1 break-words",children:X.description})]})},X.id)})})});case"classes":return e.jsx("div",{className:"space-y-4",children:ne||ue&&Z?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#77dbf6]"})}):ue?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-gray-500",children:["Select each class you want. After selecting a class, choose Specific Weeks, 1 Month, or Full Trimester. Classes marked with",e.jsx("span",{className:"font-medium text-amber-600",children:" â
2-week commitment"})," automatically book both instructional weeks together."]}),(J??[]).filter(X=>X.weekNumber==null&&X.isActive).map(X=>{var Le,A;const _e=((Le=h.classSlotIds)==null?void 0:Le.includes(X.id))??!1;return e.jsxs("div",{className:"border-2 border-[#77dbf6]/50 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${_e?"bg-[#77dbf6]/10":"hover:bg-gray-50"}`,onClick:()=>re(X),children:[e.jsx(Gs,{checked:_e,onCheckedChange:()=>re(X),onClick:D=>D.stopPropagation()}),e.jsx("span",{className:"text-xs font-bold w-8 shrink-0 text-orange-600",children:X.timeSlot}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.jsx("span",{className:"text-sm font-medium",children:X.className})}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["Age ",X.ageRequirement,"+ · ",X.days]}),X.description&&e.jsx("p",{className:"text-xs text-gray-400 mt-0.5 leading-snug",children:X.description})]}),_e&&e.jsx(As,{className:"w-4 h-4 text-[#77dbf6] shrink-0"})]}),_e&&e.jsxs("div",{className:"px-3 pb-3 pt-2 bg-[#77dbf6]/5 border-t border-[#77dbf6]/20 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Enroll for:"}),["week","month","trimester"].map(D=>e.jsx("button",{type:"button",onClick:ie=>{ie.stopPropagation(),Me(X.id,D)},className:`text-xs px-2.5 py-1 rounded-full border transition-colors ${(w[X.id]??"trimester")===D?"bg-[#77dbf6] text-white border-[#77dbf6]":"text-gray-600 border-gray-300 hover:border-[#77dbf6]"}`,children:D==="week"?"Specific Weeks":D==="month"?"1 Month":"Full Trimester"},D))]}),(w[X.id]??"trimester")==="week"&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1.5 mt-1",children:ge.map(D=>e.jsxs("label",{className:"flex items-center gap-2 rounded border border-gray-200 px-2 py-1.5 cursor-pointer hover:border-[#77dbf6]",children:[e.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:(k[X.id]??[]).includes(D.weekNumber),onChange:ie=>{E($e=>{const ke=$e[X.id]??[];return{...$e,[X.id]:ie.target.checked?[...ke,D.weekNumber].sort((S,ve)=>S-ve):ke.filter(S=>S!==D.weekNumber)}})},onClick:ie=>ie.stopPropagation()}),e.jsxs("span",{className:"text-xs text-gray-600",children:["Week ",D.weekNumber," â ",Fe(D.startDate)," to ",Fe(D.endDate)]})]},D.weekNumber))}),(w[X.id]??"trimester")==="month"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-gray-600 font-medium",children:"Choose the first of four consecutive instructional weeks:"}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:ge.map((D,ie)=>{var S;const $e=Math.min(4,ge.length-ie),ke=((S=k[X.id])==null?void 0:S[0])===Number(D.weekNumber);return e.jsxs("button",{type:"button",onClick:ve=>{ve.stopPropagation(),R(X.id,Number(D.weekNumber))},className:`text-left text-xs px-2 py-1.5 rounded border transition-colors ${ke?"bg-[#77dbf6]/15 border-[#77dbf6] text-gray-800":"border-gray-300 text-gray-600 hover:border-[#77dbf6]"}`,children:["Start Week ",D.weekNumber," â ",Fe(D.startDate)," to ",Fe(D.endDate),$e<4&&e.jsxs("span",{className:"block text-amber-700",children:["Only ",$e," week",$e===1?"":"s"," remain"]})]},D.weekNumber)})})]}),(((A=k[X.id])==null?void 0:A.length)??0)>0&&e.jsxs("p",{className:"text-xs text-green-600 font-medium",children:[k[X.id].length," week",k[X.id].length!==1?"s":""," selected"]})]})]},X.id)}),e.jsx("div",{className:"space-y-3 pr-1",children:ge.map(X=>{const _e=(J??[]).filter(Le=>Le.weekNumber===X.weekNumber&&Le.isActive);return _e.length?e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-3 py-2 border-b",children:e.jsxs("span",{className:"font-semibold text-sm text-gray-700",children:["Week ",X.weekNumber," â ",Fe(X.startDate)," to ",Fe(X.endDate)]})}),e.jsx("div",{className:"divide-y",children:_e.map(Le=>{var $e;const A=(($e=h.classSlotIds)==null?void 0:$e.includes(Le.id))??!1,D=m3.includes(Le.className),ie=Le.timeSlot==="3pm"?"text-green-700":Le.timeSlot==="4pm"?"text-purple-700":"text-blue-700";return e.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 cursor-pointer transition-colors ${A?"bg-[#77dbf6]/10":"hover:bg-gray-50"}`,onClick:()=>Ae(Le),children:[e.jsx(Gs,{checked:A,onCheckedChange:()=>Ae(Le),onClick:ke=>ke.stopPropagation()}),e.jsx("span",{className:`text-xs font-bold w-8 shrink-0 ${ie}`,children:Le.timeSlot}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-sm font-medium",children:Le.className}),Le.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:Le.description})]}),D&&e.jsx("span",{className:"text-xs text-amber-600 font-medium shrink-0",children:"â
2-week"}),A&&e.jsx(As,{className:"w-4 h-4 text-[#77dbf6] shrink-0"})]},Le.id)})})]},X.weekNumber):null})}),(((K=h.classSlotIds)==null?void 0:K.length)??0)>0&&e.jsxs("p",{className:"text-sm text-[#77dbf6] font-medium",children:[h.classSlotIds.length," slot",h.classSlotIds.length!==1?"s":""," selected"]})]}):e.jsx("div",{className:"grid gap-3",children:J==null?void 0:J.filter(X=>X.isActive).map(X=>{var A;const _e=ht(X),Le=(A=h.classSlotIds)==null?void 0:A.includes(X.id);return e.jsx("div",{className:`p-4 border rounded-lg cursor-pointer transition-colors ${Le?"border-[#77dbf6] bg-[#77dbf6]/5":"border-gray-200 hover:border-gray-300"}`,onClick:()=>{const D=h.classSlotIds||[],ie=Le?D.filter($e=>$e!==X.id):[...D,X.id];x($e=>({...$e,classSlotIds:ie}))},children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"flex items-start space-x-3",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium",children:X.className}),e.jsxs("div",{className:"text-sm text-gray-600",children:[X.timeSlot," ⢠",X.days]}),X.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1",children:X.description}),X.specialNotes&&e.jsx("div",{className:"text-sm text-blue-600 mt-1",children:X.specialNotes})]})}),e.jsxs("div",{className:"flex flex-col items-end space-y-2",children:[e.jsx(we,{className:_e.color,children:_e.type}),Le&&e.jsx(As,{className:"w-5 h-5 text-[#77dbf6]"})]})]})},X.id)})})});case"student":return e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"grid gap-3",children:s.students.map(X=>e.jsx(F,{variant:h.studentId===X.id?"default":"outline",className:"h-auto p-4 justify-start",onClick:()=>x(_e=>({..._e,studentId:X.id})),children:e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-medium",children:X.nicknames||X.name}),e.jsx("div",{className:"text-sm text-muted-foreground",children:X.studentCategories.join(", ")})]})},X.id))})});case"weeks":return Z?e.jsx("div",{className:"text-center py-4",children:"Loading week options..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:()=>g(V.filter(X=>!X.isBreakWeek).map(X=>X.weekNumber)),children:"Select All"}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>g([]),children:"Clear All"})]}),e.jsx("div",{className:"grid gap-2 max-h-60 overflow-y-auto",children:V.map(X=>e.jsxs("div",{className:`flex items-center space-x-3 p-3 border rounded-lg ${X.isBreakWeek?"bg-gray-50 opacity-50":""}`,children:[e.jsx(Gs,{id:`week-${X.weekNumber}`,checked:m.includes(X.weekNumber),disabled:X.isBreakWeek,onCheckedChange:_e=>{g(_e?Le=>[...Le,X.weekNumber].sort((A,D)=>A-D):Le=>Le.filter(A=>A!==X.weekNumber))}}),e.jsxs("label",{htmlFor:`week-${X.weekNumber}`,className:`flex-1 text-sm ${X.isBreakWeek?"cursor-not-allowed":"cursor-pointer"}`,children:[e.jsxs("div",{className:"font-medium",children:["Week ",X.weekNumber,X.isBreakWeek&&e.jsx("span",{className:"ml-2 text-orange-600",children:"(Break Week)"})]}),e.jsxs("div",{className:"text-gray-500",children:[new Date(X.startDate).toLocaleDateString()," - ",new Date(X.endDate).toLocaleDateString()]})]})]},X.weekNumber))})]});case"payment":const De=le();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{className:"text-lg",children:"Enrollment Summary"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Classes Selected:"}),ue?e.jsxs(e.Fragment,{children:[[...h.classSlotIds??[]].map(X=>J==null?void 0:J.find(_e=>_e.id===X)).filter(X=>!!X&&X.weekNumber==null).map(X=>{var _e;return e.jsxs("div",{className:"text-sm text-gray-600",children:["⢠",X.timeSlot," â ",X.className,(((_e=k[X.id])==null?void 0:_e.length)??0)>0&&` (Weeks ${k[X.id].join(", ")})`]},X.id)}),[...h.classSlotIds??[]].map(X=>J==null?void 0:J.find(_e=>_e.id===X)).filter(X=>!!X&&X.weekNumber!=null).sort((X,_e)=>(X.weekNumber??0)-(_e.weekNumber??0)).map(X=>e.jsxs("div",{className:"text-sm text-gray-600",children:["⢠Week ",X.weekNumber," â ",X.timeSlot," â ",X.className]},X.id))]}):(xe=h.classSlotIds)==null?void 0:xe.map(X=>{const _e=J==null?void 0:J.find(Le=>Le.id===X);return _e?e.jsxs("div",{className:"text-sm text-gray-600",children:["⢠",_e.className," (",_e.timeSlot,")"]},X):null})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Student:"}),e.jsx("div",{className:"text-sm text-gray-600",children:_(h.studentId)||"Profile incomplete - please update student information"})]}),!ue&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-2",children:"Weeks Selected:"}),e.jsxs("div",{className:"text-sm text-gray-600",children:[m.length," week",m.length!==1?"s":"","(",m.join(", "),")"]})]}),e.jsxs("div",{className:"border-t pt-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Cost Breakdown:"}),De.breakdown.map((X,_e)=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:X.cost<0?"text-green-600":"",children:X.description}),e.jsxs("span",{className:X.cost<0?"text-green-600":"",children:[X.cost<0?"-":"","$",Math.abs(X.cost).toFixed(2)]})]},_e)),e.jsxs("div",{className:"flex justify-between font-bold text-lg mt-2 pt-2 border-t",children:[e.jsx("span",{children:"Total:"}),e.jsxs("span",{children:["$",De.totalCost.toFixed(2)]})]})]}),s.thirdPartyPayerName&&e.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qr,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium text-blue-800",children:["Third-party payer: ",s.third
799PartyPayerName]})]})})]})]}),P?e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"text-center py-4 space-y-4",children:[e.jsx(As,{className:"w-12 h-12 text-green-600 mx-auto"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-semibold text-green-800",children:"Enrollment Successful!"}),e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Your student has been enrolled in the selected class."})]}),e.jsxs("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-800",children:[e.jsx("strong",{children:"Important:"})," Enrollment is not completed until payment has been made."]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[e.jsx(F,{onClick:()=>{M(!1),x(X=>({...X,classSlotIds:[]})),g([]),E({}),N({}),u(2)},variant:"outline",children:"Enroll in More Classes"}),e.jsx(F,{onClick:()=>{M(!1),a()},children:"Make or Arrange Payment"}),e.jsx(F,{variant:"ghost",onClick:Be,children:"Close"})]})]})})}):e.jsx(Ce,{children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"text-center py-4",children:[De.totalCost>0?e.jsxs("p",{className:"text-sm text-gray-600 mb-4",children:["Payment of ",e.jsxs("strong",{children:["$",De.totalCost.toFixed(2)]})," will be arranged after enrollment. You can pay through the Payments tab."]}):e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"No payment required â your enrollment is covered."}),e.jsx(F,{onClick:()=>me.mutate(),disabled:me.isPending,className:"w-full",children:me.isPending?"Processing...":"Complete Enrollment"})]})})})]});default:return null}};return e.jsx(es,{open:t,onOpenChange:Be,children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto overflow-x-hidden",children:[e.jsx(ss,{children:e.jsxs(ns,{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/images/wizardbee.png",alt:"Wizard",className:"w-8 h-8 rounded-full"}),"Enrollment & Payment Wizard"]})}),e.jsx("div",{className:"flex items-center justify-between mb-6",children:Vc.map(($,K)=>{const xe=K===c,De=K<c;return e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`flex items-center justify-center w-10 h-10 rounded-full border-2 ${xe?"border-[#77dbf6] bg-[#77dbf6] text-white":De?"border-green-600 bg-green-600 text-white":"border-gray-300 bg-white text-gray-400"}`,children:De?e.jsx(As,{className:"w-5 h-5"}):e.jsx("span",{className:"text-sm font-bold",children:K+1})}),K<Vc.length-1&&e.jsx("div",{className:`w-12 h-0.5 mx-2 ${De?"bg-green-600":"bg-gray-300"}`})]},$.id)})}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-bold mb-2",children:Vc[c].title}),e.jsx("p",{className:"text-gray-600 mb-4",children:Vc[c].description}),Mt()]}),e.jsxs("div",{className:"flex justify-between pt-4 border-t",children:[e.jsxs(F,{variant:"outline",onClick:Te,disabled:c===0,children:[e.jsx(Mu,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{variant:"outline",onClick:Be,children:"Cancel"}),c<Vc.length-1?e.jsxs(F,{onClick:Y,children:["Next",e.jsx(Rl,{className:"w-4 h-4 ml-2"})]}):null]})]})]})})}var Xl="Accordion",RG=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Tj,MG,LG]=mf(Xl),[dg]=or(Xl,[LG,US]),_j=US(),oE=Ut.forwardRef((s,t)=>{const{type:n,...r}=s,a=r,o=r;return e.jsx(Tj.Provider,{scope:s.__scopeAccordion,children:n==="multiple"?e.jsx(qG,{...o,ref:t}):e.jsx(zG,{...a,ref:t})})});oE.displayName=Xl;var[cE,VG]=dg(Xl),[dE,UG]=dg(Xl,{collapsible:!1}),zG=Ut.forwardRef((s,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:o=!1,...c}=s,[u,h]=ga({prop:n,defaultProp:r,onChange:a});return e.jsx(cE,{scope:s.__scopeAccordion,value:u?[u]:[],onItemOpen:h,onItemClose:Ut.useCallback(()=>o&&h(""),[o,h]),children:e.jsx(dE,{scope:s.__scopeAccordion,collapsible:o,children:e.jsx(uE,{...c,ref:t})})})}),qG=Ut.forwardRef((s,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...o}=s,[c=[],u]=ga({prop:n,defaultProp:r,onChange:a}),h=Ut.useCallback(m=>u((g=[])=>[...g,m]),[u]),x=Ut.useCallback(m=>u((g=[])=>g.filter(y=>y!==m)),[u]);return e.jsx(cE,{scope:s.__scopeAccordion,value:c,onItemOpen:h,onItemClose:x,children:e.jsx(dE,{scope:s.__scopeAccordion,collapsible:!0,children:e.jsx(uE,{...o,ref:t})})})}),[WG,ug]=dg(Xl),uE=Ut.forwardRef((s,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:o="vertical",...c}=s,u=Ut.useRef(null),h=Cs(u,t),x=MG(n),g=Nf(a)==="ltr",y=ut(s.onKeyDown,b=>{var T;if(!RG.includes(b.key))return;const w=b.target,N=x().filter(U=>{var _;return!((_=U.ref.current)!=null&&_.disabled)}),k=N.findIndex(U=>U.ref.current===w),E=N.length;if(k===-1)return;b.preventDefault();let P=k;const M=0,L=E-1,B=()=>{P=k+1,P>L&&(P=M)},z=()=>{P=k-1,P<M&&(P=L)};switch(b.key){case"Home":P=M;break;case"End":P=L;break;case"ArrowRight":o==="horizontal"&&(g?B():z());break;case"ArrowDown":o==="vertical"&&B();break;case"ArrowLeft":o==="horizontal"&&(g?z():B());break;case"ArrowUp":o==="vertical"&&z();break}const H=P%E;(T=N[H].ref.current)==null||T.focus()});return e.jsx(WG,{scope:n,disabled:r,direction:a,orientation:o,children:e.jsx(Tj.Slot,{scope:n,children:e.jsx(_t.div,{...c,"data-orientation":o,ref:h,onKeyDown:r?void 0:y})})})}),y0="AccordionItem",[BG,Ij]=dg(y0),mE=Ut.forwardRef((s,t)=>{const{__scopeAccordion:n,value:r,...a}=s,o=ug(y0,n),c=VG(y0,n),u=_j(n),h=xa(),x=r&&c.value.includes(r)||!1,m=o.disabled||s.disabled;return e.jsx(BG,{scope:n,open:x,disabled:m,triggerId:h,children:e.jsx(WS,{"data-orientation":o.orientation,"data-state":yE(x),...u,...a,ref:t,disabled:m,open:x,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});mE.displayName=y0;var hE="AccordionHeader",fE=Ut.forwardRef((s,t)=>{const{__scopeAccordion:n,...r}
799=s,a=ug(Xl,n),o=Ij(hE,n);return e.jsx(_t.h3,{"data-orientation":a.orientation,"data-state":yE(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});fE.displayName=hE;var B1="AccordionTrigger",pE=Ut.forwardRef((s,t)=>{const{__scopeAccordion:n,...r}=s,a=ug(Xl,n),o=Ij(B1,n),c=UG(B1,n),u=_j(n);return e.jsx(Tj.ItemSlot,{scope:n,children:e.jsx(eU,{"aria-disabled":o.open&&!c.collapsible||void 0,"data-orientation":a.orientation,id:o.triggerId,...u,...r,ref:t})})});pE.displayName=B1;var xE="AccordionContent",gE=Ut.forwardRef((s,t)=>{const{__scopeAccordion:n,...r}=s,a=ug(Xl,n),o=Ij(xE,n),c=_j(n);return e.jsx(tU,{role:"region","aria-labelledby":o.triggerId,"data-orientation":a.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...s.style}})});gE.displayName=xE;function yE(s){return s?"open":"closed"}var KG=oE,HG=mE,GG=fE,vE=pE,jE=gE;const ZG=KG,zc=p.forwardRef(({className:s,...t},n)=>e.jsx(HG,{ref:n,className:pt("border-b",s),...t}));zc.displayName="AccordionItem";const qc=p.forwardRef(({className:s,children:t,...n},r)=>e.jsx(GG,{className:"flex",children:e.jsxs(vE,{ref:r,className:pt("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",s),...n,children:[t,e.jsx(ac,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));qc.displayName=vE.displayName;const Wc=p.forwardRef(({className:s,children:t,...n},r)=>e.jsx(jE,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:pt("pb-4 pt-0",s),children:t})}));Wc.displayName=jE.displayName;const YG=te.object({homeschoolReasoning:te.string().min(10,"Please provide at least a brief explanation"),communicationSkills:te.string().min(10,"Please describe your child's communication skills"),readingSkills:te.string().min(10,"Please describe your child's reading skills"),mathSkills:te.string().min(10,"Please describe your child's math skills"),specialInterests:te.string().min(1,"Please describe any special interests"),selfAdvocacySkills:te.string().min(10,"Please describe your child's self-advocacy skills"),traumaAndSupport:te.string().optional(),knownTriggers:te.string().optional(),regulationSkills:te.string().min(10,"Please describe how your child handles frustration and dysregulation"),regulationSupports:te.string().optional(),studentStrengths:te.string().min(10,"Please describe your child's strengths"),motorSkills:te.string().min(10,"Please describe your child's motor skills"),termGoals:te.string().min(10,"Please describe your goals for your child this term"),learningCoachName:te.string().min(1,"Learning coach name is required"),learningCoachAgreesToAttend:te.boolean().refine(s=>s===!0,{message:"Learning coach must agree to be present and engaged during all classes"}),learningCoachComfortLevel:te.string().min(1,"Please select a comfort level"),deviceForClasses:te.string().min(1,"Please specify the device for classes"),reliableInternet:te.boolean(),technologyIssues:te.string().optional(),howHeardAbout:te.string().min(1,"Please tell us how you heard about Ahern Academy"),additionalInfo:te.string().optional(),understandsYearCommitment:te.boolean().refine(s=>s===!0,{message:"You must understand and accept the year-long commitment"}),affirmationAccurate:te.boolean().refine(s=>s===!0,{message:"You must affirm that the information is accurate"}),electronicSignature:te.string().min(1,"Electronic signature is required"),signatureDate:te.string().min(1,"Signature date is required")});function QG({studentId:s,familyId:t,studentName:n,onSuccess:r,onCancel:a}){const[o,c]=p.useState(!1),{toast:u}=Is(),h=Da({resolver:Oa(YG),defaultValues:{homeschoolReasoning:"",communicationSkills:"",readingSkills:"",mathSkills:"",specialInterests:"",selfAdvocacySkills:"",traumaAndSupport:"",knownTriggers:"",regulationSkills:"",regulationSupports:"",studentStrengths:"",motorSkills:"",termGoals:"",learningCoachName:"",learningCoachAgreesToAttend:!1,learningCoachComfortLevel:"",deviceForClasses:"",reliableInternet:!1,technologyIssues:"",howHeardAbout:"",additionalInfo:"",understandsYearCommitment:!1,affirmationAccurate:!1,electronicSignature:"",signatureDate:new Date().toISOString().split("T")[0]}}),x=async m=>{c(!0);try{await st("POST","/api/ahern-academy-applications",{studentId:s,familyId:t,homeschoolReasoning:m.homeschoolReasoning,communicationSkills:m.communicationSkills,readingSkillsDetail:m.readingSkills,mathSkillsDetail:m.mathSkills,specialInterestsDetail:m.specialInterests,selfAdvocacySkills:m.selfAdvocacySkills,traumaAndSupport:m.traumaAndSupport,knownTriggers:m.knownTriggers,regulationSkills:m.regulationSkills,regulationSupports:m.regulationSupports,studentStrengths:m.studentStrengths,motorSkills:m.motorSkills,termGoals:m.termGoals,learningCoachName:m.learningCoachName,learningCoachAgreesToAttend:m.learningCoachAgreesToAttend,learningCoachComfortLevel:parseInt(m.learningCoachComfortLevel),deviceForClasses:m.deviceForClasses,reliableInternet:m.reliableInternet,technologyIssues:m.technologyIssues,howHeardAbout:m.howHeardAbout,additionalInfo:m.additionalInfo,understandsYearCommitment:m.understandsYearCommitment,affirmationAccurate:m.affirmationAccurate,electronicSignature:m.electronicSignature,signatureDate:m.signatureDate}
799),u({title:"Application Submitted!",description:"Your Ahern Academy application has been submitted successfully. You will receive a confirmation email shortly."}),r&&r()}catch(g){u({title:"Submission Failed",description:g.message||"Failed to submit application. Please try again.",variant:"destructive"})}finally{c(!1)}};return e.jsxs(Ce,{className:"max-w-4xl mx-auto",children:[e.jsxs(Ve,{className:"bg-gradient-to-r from-purple-50 to-blue-50",children:[e.jsxs(Ue,{className:"flex items-center gap-2 text-2xl",children:[e.jsx(ar,{className:"h-6 w-6 text-purple-600"}),"Ahern Academy Application - ",n]}),e.jsx(rn,{children:"Please complete all sections of this application. Fields marked with * are required."})]}),e.jsx(Se,{className:"pt-6",children:e.jsx(Fa,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(x),className:"space-y-6",children:[e.jsxs(ZG,{type:"multiple",defaultValue:["family","student","coach","tech","additional","contract"],className:"w-full",children:[e.jsxs(zc,{value:"family",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Family Information"}),e.jsx(Wc,{className:"space-y-4 pt-4",children:e.jsx(Ke,{control:h.control,name:"homeschoolReasoning",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Why are you considering or have been homeschooling? *"}),e.jsx(Mn,{children:"If this program will supplement in-person schooling, please explain why this arrangement is being chosen."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:4,placeholder:"Please describe your homeschooling journey and reasons..."})}),e.jsx(Ye,{})]})})})]}),e.jsxs(zc,{value:"student",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Student Information"}),e.jsxs(Wc,{className:"space-y-6 pt-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-medium text-sm text-muted-foreground",children:"Communication"}),e.jsx(Ke,{control:h.control,name:"communicationSkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Describe your child's current communication skills *"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:4,placeholder:"Current communication skills, AAC usage, etc..."})}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-medium text-sm text-muted-foreground",children:"Reading"}),e.jsx(Ke,{control:h.control,name:"readingSkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Describe your child's reading skills *"}),e.jsx(Mn,{children:"Do they know their letters or letter sounds, attend to picture books or chapter books being read aloud, decode or spell simple or complex words, etc.?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:4,placeholder:"Reading skills..."})}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-medium text-sm text-muted-foreground",children:"Math"}),e.jsx(Ke,{control:h.control,name:"mathSkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Describe your child's math skills *"}),e.jsx(Mn,{children:"Do they know their numbers, count, add, subtract, recognize shapes, sort items into groups, tell time, understand money, etc.?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:4,placeholder:"Math skills..."})}),e.jsx(Ye,{})]})})]}),e.jsx(Ke,{control:h.control,name:"specialInterests",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Special Interests *"}),e.jsx(Mn,{children:"Does your child have any special interests or highly preferred activities, people, places, or objects?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Special interests..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"selfAdvocacySkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Self-Advocacy *"}),e.jsx(Mn,{children:"Describe your child's self-advocacy skills (e.g., pushes away unwanted items or people, reaches for desired items or people, can ask for help, can solve basic problems, etc.)."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Self-advocacy skills..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"traumaAndSupport",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Trauma and Support"}),e.jsx(Mn,{children:"We work hard to create a safe, supportive, and trauma-informed environment. If your child has experienced challenges or trauma in educational or other settings, please share anything that will help us support them safely."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:4,placeholder:"Optional - any trauma history or support needs..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"knownTriggers",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Known Triggers"}),e.jsx(Mn,{children:"If there are any known triggers for your child, please describe them."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:2,placeholder:"Optional - known triggers..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"regulationSkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Regulation *"}),e.jsx(Mn,{children:"Describe how your child handles frustration, waiting, and dysregulation."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Regulation skills..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"regulationSupports",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Regulation Supports"}),e.jsx(Mn,{children:"What supports help when frustration or dysregulation occurs?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:2,placeholder:"Optional - supports that help..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"studentStrengths",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Strengths *"}),e.jsx(Mn,{children:"What are the best things about your child? What are their strengths?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Your child's strengths..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"motorSkills",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Motor Skills *"}),e.jsx(Mn,{children:"Describe your child's motor skills."}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Motor skills..."})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"termGoals",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Goals *"}),e.jsx(Mn,{children:"What are your goals for your child this term?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Goals for this term..."})}),e.jsx(Ye,{})]})})]})]}),e.jsxs(zc,{value:"coach",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Learning Coach"}),e.jsxs(Wc,{className:"space-y-4 pt-4",children:[e.jsx(Ke,{control:h.control,name:"learningCoachName",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Who will serve as the student's Learning Coach during classes? *"}),e.jsx(He,{children:e.jsx(je,{...m,placeholder:"Learning coach name"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"learningCoachAgreesToAttend",render:({field:m})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:m.value,onCheckedChange:m.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{children:"The Learning Coach agrees to be present and engaged during all classes *"}),e.jsx(Ye,{})]})]})}),e.jsx(Ke,{control:h.control,name:"learningCoachComfortLevel",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"How comfortable are you/the Learning Coach with supporting AAC and regulation during classes? *"}),e.jsxs(St,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select comfort level (1-5)"})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"1",children:"1 - Not comfortable at all"}),e.jsx(ce,{value:"2",children:"2 - Slightly comfortable"}),e.jsx(ce,{value:"3",children:"3 - Moderately comfortable"}),e.jsx(ce,{value:"4",children:"4 - Very comfortable"}),e.jsx(ce,{value:"5",children:"5 - Extremely comfortable"})]})]}),e.jsx(Mn,{children:"Note: We can provide additional training if needed."}),e.jsx(Ye,{})]})})]})]}),e.jsxs(zc,{value:"tech",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Technology"}),e.jsxs(Wc,{className:"space-y-4 pt-4",children:[e.jsx(Ke,{control:h.control,name:"deviceForClasses",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"What device will your child use for classes? *"}),e.jsx(He,{children:e.jsx(je,{...m,placeholder:"e.g., iPad, Laptop, Desktop computer"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"reliableInternet",render:({field:m})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:m.value,onCheckedChange:m.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{children:"I have a reliable internet connection for live sessions"}),e.jsx(Ye,{})]})]})}),e.jsx(Ke,{control:h.control,name:"technologyIssues",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Technology Issues"}),e.jsx(Mn,{children:"Are there any issues we should be aware of (e.g., camera, microphone, sound, AAC integration)?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:2,placeholder:"Optional - any technology concerns..."})}),e.jsx(Ye,{})]})})]})]}),e.jsxs(zc,{value:"additional",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Additional Information"}),e.jsxs(Wc,{className:"space-y-4 pt-4",children:[e.jsx(Ke,{control:h.control,name:"howHeardAbout",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"How did you hear about Ahern Academy? *"}),e.jsx(He,{children:e.jsx(je,{...m,placeholder:"e.g., Friend, Social media, Google search"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"additionalInfo",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Is there anything else you'd like us to know?"}),e.jsx(He,{children:e.jsx(Pt,{...m,rows:3,placeholder:"Optional - any additional information..."})}),e.jsx(Ye,{})]})})]})]}),e.jsxs(zc,{value:"contract",children:[e.jsx(qc,{className:"text-lg font-semibold",children:"Contract and Acknowledgment"}),e.jsxs(Wc,{className:"space-y-4 pt-4",children:[e.jsx(Ke,{control:h.control,name:"understandsYearCommitment",render:({field:m})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:m.value,onCheckedChange:m.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{children:"I understand that I will be expected to sign a contract if accepted, and that this contract requires a year-long commitment to Ahern Academy *"}),e.jsx(Ye,{})]})]})}),e.jsx(Ke,{control:h.control,name:"affirmationAccurate",render:({field:m})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:m.value,onCheckedChange:m.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{children:"I affirm that the information above is accurate to the best of my knowledge *"}),e.jsx(Ye,{})]})]})}),e.jsx(Ke,{control:h.control,name:"electronicSignature",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Electronic Signature *"}),e.jsx(Mn,{children:"Please type your full legal name as your electronic signature"}),e.jsx(He,{children:e.jsx(je,{...m,placeholder:"Your full legal name"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:h.control,name:"signatureDate",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Date *"}),e.jsx(He,{children:e.jsx(je,{...m,type:"date"})}),e.jsx(Ye,{})]})})]})]})]}),e.jsxs("div",{className:"flex gap-4 justify-end pt-6 border-t",children:[a&&e.jsx(F,{type:"button",variant:"outline",onClick:a,children:"Cancel"}),e.jsx(F,{type:"submit",disabled:o,className:"bg-purple-600 hover:bg-purple-700","data-testid":"button-submit-application",children:o?"Submitting...":e.jsxs(e.Fragment,{children:[e.jsx(ad,{
799className:"h-4 w-4 mr-2"}),"Submit Application"]})})]})]})})})]})}const XG="/assets/01_Lemonade_War_cover_UPDATED-1430640686_1788117778195-BFvwa6yX.webp",JG=()=>nt({queryKey:["/api/square-config"],retry:!1,staleTime:3e4}),bE=s=>nt({queryKey:["rates","family",s],queryFn:async()=>{if(!s)throw new Error("Family ID required for rate calculation");const n=await(await st("POST","/api/rates/family",{familyId:s,serviceStartDate:new Date().toISOString()})).json();return{ahernMonthly:n.rates.ahernAcademy.monthly.rate,ahernTrimester:n.rates.ahernAcademy.trimester.rate,openEnrollment:[0,n.rates.openEnrollment.oneClass.rate,n.rates.openEnrollment.twoClasses.rate,n.rates.openEnrollment.threeClasses.rate,n.rates.openEnrollment.fourClasses.rate,n.rates.openEnrollment.fiveClasses.rate],oneOnOne:n.rates.oneOnOne.rate,registrationFee:n.rates.registrationFee.rate,lateFee:n.rates.lateFee.rate,yac:n.rates.yac.rate}},enabled:!!s,staleTime:300*1e3}),K1=s=>{if(!s)return null;let t;if(typeof s=="string")if(s.includes("-")){const[o,c,u]=s.split("-").map(Number);t=new Date(o,c-1,u)}else t=new Date(s);else t=new Date(s);if(isNaN(t.getTime()))return null;const n=new Date;let r=n.getFullYear()-t.getFullYear();const a=n.getMonth()-t.getMonth();return(a<0||a===0&&n.getDate()<t.getDate())&&r--,r},H1=s=>!s||s<3?"PreK":{3:"PreK-3",4:"PreK-4",5:"Kindergarten",6:"1st Grade",7:"2nd Grade",8:"3rd Grade",9:"4th Grade",10:"5th Grade",11:"6th Grade",12:"7th Grade",13:"8th Grade",14:"9th Grade",15:"10th Grade",16:"11th Grade",17:"12th Grade",18:"12th Grade+"}[s]||(s>18?"Adult":"12th Grade+"),To=s=>{const t=s.birthday?K1(s.birthday):s.age,n=s.gradeEquivalent||(t?H1(t):null);return{age:t||"Not provided",grade:n||"Not provided"}},gx=s=>{const t=typeof s=="string"?parseFloat(s):s;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t)};function eZ({familyData:s,setActiveTab:t,setShowPaymentCreator:n,setShowEnrollmentWizard:r}){var re,O,me,Y,Te,Be,ht,Mt;const[a,o]=p.useState(null),[c,u]=p.useState(null),[h,x]=p.useState(null),[m,g]=p.useState("week"),[y,b]=p.useState(""),[w,N]=p.useState([]),[k,E]=p.useState(!1),[P,M]=p.useState(!1),[L,B]=p.useState(null),[z,H]=p.useState(!1),[T,U]=p.useState(null),{toast:_}=Is(),se=dn(),{data:ae}=bE(s==null?void 0:s.id),W=$=>{o($),setTimeout(()=>{const K=document.getElementById("available-classes");K?K.scrollIntoView({behavior:"smooth",block:"start"}):console.log("Classes section not found for scrolling")},200)},{data:J=[]}=nt({queryKey:["/api/portal/class-sessions"],queryFn:()=>st("GET","/api/portal/class-sessions").then($=>$.json())}),{data:ne=[]}=nt({queryKey:["/api/portal/class-slots",a],queryFn:()=>st("GET",`/api/portal/class-slots?sessionId=${a}`).then($=>$.json()),enabled:!!a}),{data:le}=nt({queryKey:["/api/sessions",a,"weeks"],queryFn:()=>st("GET",`/api/sessions/${a}/weeks`).then($=>$.json()),enabled:!!a}),{data:V=[]}=nt({queryKey:["/api/week-calendar",a],queryFn:()=>st("GET",`/api/week-calendar/${a}`).then($=>$.json()),enabled:!!a}),Z=ne.length>0&&ne.some($=>$.weekNumber!=null),ue=$=>new Date($).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),ge=p.useCallback(()=>{var ie,$e;if(!c||!w.length||!m){B(null);return}const $=(ie=s==null?void 0:s.students)==null?void 0:ie.find(ke=>ke.id===h),K=($e=$==null?void 0:$.studentCategories)==null?void 0:$e.includes("Ahern Academy"),xe=["3pm","4pm","5pm","7pm","yac"].includes(c.timeSlot)||c.className==="Young Adult Chat";if(K&&xe){const ke=c.className==="Young Adult Chat"||c.timeSlot==="yac"||c.timeSlot==="7pm";B({serviceType:ke?"Ahern Academy YAC Class":"Ahern Academy Afternoon Class",weeklyRate:0,numberOfWeeks:w.length,selectedWeeks:[...w].sort(),totalCost:0,className:c.className,enrollmentPeriod:m,isIncludedInTuition:!0,includedMessage:"Included in your Ahern Academy tuition at no additional cost"});return}const De=c.className==="Young Adult Chat",X=1;let _e,Le;if(De){if(!(ae!=null&&ae.yac)){B({serviceType:"Young Adult Chat",weeklyRate:0,numberOfWeeks:w.length,selectedWeeks:[...w].sort(),totalCost:0,className:c.className,enrollmentPeriod:m,errorMessage:"Rates unavailable - please try again"});return}_e=ae.yac,Le="Young Adult Chat"}else{if(!(ae!=null&&ae.openEnrollment[X])){B({serviceType:"Open Enrollment (1 class)",weeklyRate:0,numberOfWeeks:w.length,selectedWeeks:[...w].sort(),totalCost:0,className:c.className,enrollmentPeriod:m,errorMessage:"Rates unavailable - please try again"});return}_e=ae.openEnrollment[X],Le="Open Enrollment (1 class)"}const A=w.length,D=_e*A;B({serviceType:Le,weeklyRate:_e,numberOfWeeks:A,selectedWeeks:[...w].sort(),totalCost:D,className:c.className,enrollmentPeriod:m})},[c,w,m,h,s,ae]);p.useEffect(()=>{ge()},[c,w,m,ge]);const G=bt({mutationFn:async $=>{const K=await st("POST","/api/portal/class-enrollments",$);if(!K.ok){if(K.status===409){const xe=await K.json();throw xe.conflict&&xe.canModify?{type:"ENROLLMENT_CONFLICT",...xe}:new Error(xe.message||"Student is already enrolled in this class")}throw new Error("Failed to enroll in class")}return K.json()},onSuccess:async $=>{const K=(c==null?void 0:c.className)||"";if(E(!1),u(null),x(null),g("week"),b(""),N([]),(De=>{const X=De.toLowerCase();return X.includes("chit chat")||X.includes("book club")})(K)){console.log(`Skipping payment creation for free class: ${K}`),se.invalidateQueries({queryKey:["/api/portal/enrollments"]}),M(!0);return}se.invalidateQueries({queryKey:["/api/portal/enrollments"]}),se.invalidateQueries({queryKey:["/api/portal/payments"]}),M(!0)},onError:$=>{$.type==="ENROLLMENT_CONFLICT"?(U($),H(!0)):_({title:"Enrollment Failed",description:$.message||"Please try again or c
799ontact support.",variant:"destructive"})}}),Ae=$=>{switch($){case"3pm":return e.jsx(Pn,{className:"h-5 w-5"});case"4pm":return e.jsx(mN,{className:"h-5 w-5"});case"5pm":return e.jsx(ar,{className:"h-5 w-5"});case"yac":return e.jsx(rd,{className:"h-5 w-5"});default:return e.jsx(ys,{className:"h-5 w-5"})}},Fe=($,K)=>{switch(K){case"week":return ow($,7);case"month":return cw($,1);case"trimester":return cw($,3);default:return ow($,7)}},be=()=>{var A;if(!c||!h||!s)return;const $=(A=s.students)==null?void 0:A.find(D=>D.id===h);if(!$)return;const K=To($).age;if((typeof K=="number"?K:parseInt(K)||0)<c.ageRequirement){_({title:"Age Requirement Not Met",description:`This class requires students to be ${c.ageRequirement}+ years old. Your student is ${K} years old.`,variant:"destructive"});return}let De=w;if(le&&le.weeks){const D=le.weeks.filter(ie=>ie.isEnrollable);if(m==="trimester")De=D.map(ie=>ie.weekNumber);else if(m==="month"){const ie=le.currentWeek||1;De=D.filter($e=>$e.weekNumber>=ie&&$e.weekNumber<ie+4).map($e=>$e.weekNumber)}else if(m==="week"){if(w.length===0){_({title:"Week Selection Required",description:"Please select at least one week for enrollment.",variant:"destructive"});return}De=w}}const X=new Date,_e=Fe(X,m),Le={studentId:h,familyId:s.id,slotId:c.id,enrollmentPeriod:m,startDate:X.toISOString(),endDate:_e.toISOString(),enrollmentNotes:y||null,enrolledWeeks:De.length>0?De:null};G.mutate(Le)},Me=J.filter($=>{const K=Gu($);return K==="active"||K==="enrolling"}),R=(re=s==null?void 0:s.students)==null?void 0:re.find($=>$.id===h);return e.jsxs("div",{className:"space-y-8",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"border-2 border-dashed border-blue-300 bg-gradient-to-r from-blue-50 to-indigo-50 rounded-full w-80 h-80 flex items-center justify-center p-6",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"p-3 rounded-full bg-blue-100",children:e.jsx("img",{src:"/images/wizardbee.png",alt:"Wizard Bee",className:"h-8 w-8 rounded-full"})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Guided Enrollment"}),e.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Use our step-by-step wizard to enroll in classes. It will guide you through selecting sessions, classes, students, weeks, and payment in a simple, accessible way."}),e.jsxs(F,{onClick:()=>r(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium",children:[e.jsx(Rl,{className:"h-4 w-4 mr-2"}),"Start Enrollment Wizard"]})]})]})})}),e.jsx("div",{className:"border-t pt-6",children:e.jsx("div",{className:"text-center mb-6 p-4 bg-gray-50 rounded-lg",children:e.jsx("p",{className:"text-sm text-gray-600",children:"Or use the traditional enrollment method below (for advanced users)"})})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:"var(--modal-header-blue)"},children:e.jsx(an,{className:"h-5 w-5",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Select a Session"})]}),e.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:Me.map($=>e.jsx(Ce,{className:`cursor-pointer transition-all duration-300 hover:shadow-lg border-0 ${a===$.id?"ring-2 shadow-md scale-102":"hover:scale-101"}`,style:{backgroundColor:a===$.id?"var(--modal-header-ice)":"white",borderColor:a===$.id?"#77dbf6":"transparent"},onClick:()=>W($.id),children:e.jsxs(Se,{className:"p-0",children:[e.jsx("div",{className:"p-4 rounded-t-lg",style:{backgroundColor:"var(--modal-header-corn)"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg backdrop-blur-sm",children:e.jsx(an,{className:"h-5 w-5",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx(Ue,{className:"text-lg font-bold",style:{color:"#4A4A4A"},children:$.name}),e.jsx("p",{className:"text-sm mt-1",style:{color:"#4A4A4A"},children:$.description})]})]}),(()=>{switch(Gu($)){case"active":return e.jsx(we,{className:"bg-green-100 text-green-800 border-green-300 font-medium",children:"Currently Active"});case"enrolling":return e.jsx(we,{className:"bg-blue-100 text-blue-800 border-blue-300 font-medium",children:"Enrolling"});case"archived":return e.jsx(we,{className:"bg-gray-100 text-gray-800 border-gray-300 font-medium",children:"Archived"});default:return null}})()]})}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 rounded-lg p-3 border",style:{backgroundColor:"var(--modal-header-blue)",borderColor:"var(--modal-header-corn)"},children:[e.jsx(an,{className:"h-4 w-4",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",style:{color:"#4A4A4A"},children:"Duration"}),e.jsxs("p",{className:"text-sm font-semibold",style:{color:"#4A4A4A"},children:[zl(new Date($.startDate),"MMM d")," - ",zl(new Date($.endDate),"MMM d, yyyy")]})]})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(we,{variant:"outline",className:"text-sm font-medium px-3 py-1 border",style:{backgroundColor:"var(--modal-header-pink)",color:"#4A4A4A",borderColor:"var(--modal-header-lav)"},children:$.sessionType==="summer_camp"?"Summer Camp":"Trimester"})})]})]})},$.id))})]}),a&&ne.length>0&&e.jsxs("div",{id:"available-classes",className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:"var(--modal-header-lav)"},children:e.jsx(Pn,{className:"h-5 w-5",style:{color:"#4A4A4A"}})}),e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Available Classes"})]}),Z?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-gray-500",children:["Classes change each week. Click any class to enroll. Classes marked ",e.jsx("span",{className:"font-medium text-amber-600",children:"â
2-week"})," book both weeks together."]}),V.filter($=>!$.isBreakWeek).map($=>{const K=ne.filter(xe=>xe.weekNumber===$.weekNumber);return K.length?e.jsxs("div",{className:"border rounded-xl overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-4 py-3 font-semibold text-gray-700",style:{backgroundColor:"var(--modal-header-corn)"},children:["Week ",$.weekNumber," â ",ue($.startDate)," to ",ue($.endDate)]}),e.jsx("div",{className:"divide-y",children:K.map(xe=>{const De=["Drama","Comedy","Story Writing","Sexuality"].includes(xe.className),X=xe.timeSlot==="3pm"?"#16a34a":xe.timeSlot==="4pm"?"#7c3aed":"#2563eb";return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-3 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>{u(xe),E(!0)},children:[e.jsx("span",{className:"text-xs font-bold w-8 shrink-0",style:{color:X},children:xe.timeSlot}),e.jsx("span",{className:"flex-1 font-medium text-gray-800",children:xe.className}),De&&e.jsx("span",{className:"text-xs text-amber-600 font-medium",children:"â
2-week"}),e.jsx("button",{className:"text-xs font-medium px-3 py-1 rounded-lg border transition-colors",style:{backgroundColor:"var(--modal-header-ice)",color:"#4A4A4A",borderColor:"var(--modal-header-lav)"},onClick:_e=>{_e.stopPropagation(),u(xe),E(!0)},children:"Enroll"})]},xe.id)})})]},$.weekNumber):null})]}):e.jsx("div",{className:"grid gap-6",children:ne.map($=>e.jsx(Ce,{className:"w-full border-0 shadow-md hover:shadow-lg transition-all duration-300 overflow-hidden cursor-pointer",style:{backgroundColor:"white"},onClick:()=>{u($),E(!0)},children:e.jsxs(Se,{className:"p-0",children:[e.jsx("div",{className:"p-4",style:{backgroundColor:"var(--modal-header-blue)"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg backdrop-blur-sm",children:e.jsx("span",{style:{color:"#4A4A4A"},children:Ae($.timeSlot)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-lg font-bold",style:{color:"#4A4A4A"},children:$.className}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:$.description})]})]}),e.jsx(we,{className:"bg-white/50 border-white/50 text-sm font-medium text-center",style:{color:"#4A4A4A"},children:$.timeSlot==="yac"?"Young Adult Chat":`${$.timeSlot.toUpperCase()} EST`})]})}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"flex items-center space-x-2 rounded-lg p-3 border",style:{backgroundColor:"var(--modal-header-corn)",borderColor:"var(--modal-header-blue)"},children:[e.jsx(an,{className:"h-4 w-4",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",style:{color:"#4A4A4A"},children:"Schedule"}),e.jsx("p",{className:"text-sm font-semibold",style:{color:"#4A4A4A"},children:$.days})]})]}),e.jsxs("div",{className:"flex items-center space-x-2 rounded-lg p-3 border",style:{backgroundColor:"var(--modal-header-ice)",borderColor:"var(--modal-header-corn)"},children:[e.jsx(Ms,{className:"h-4 w-4",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",style:{color:"#4A4A4A"},children:"Requirements"}),e.jsxs("p",{className:"text-sm font-semibold",style:{color:"#4A4A4A"},children:[$.ageRequirement,"+ years"]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2 rounded-lg p-3 border",style:{backgroundColor:"var(--modal-header-lav)",borderColor:"var(--modal-header-ice)"},children:[e.jsx(ar,{className:"h-4 w-4",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",style:{color:"#4A4A4A"},children:"Capacity"}),e.jsxs("p",{className:"text-sm font-semibold",style:{color:"#4A4A4A"},children:[$.capacity," students max"]})]})]})]}),$.description&&e.jsx("div",{className:"rounded-lg p-4 border",style:{backgroundColor:"var(--modal-header-pink)",borderColor:"var(--modal-header-lav)"},children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(mN,{className:"h-5 w-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"About This Class"}),e.jsx("p",{style:{color:"#4A4A4A"},children:$.description})]})]})}),$.specialNotes&&e.jsx("div",{className:"border-l-4 p-4 rounded-r-lg",style:{backgroundColor:"var(--modal-header-corn)",borderLeftColor:"#feea6a"},children:e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(rd,{className:"h-5 w-5 mt-0.5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Important Note"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:$.specialNotes})]})]})}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsxs(F,{onClick:()=>{u($),E(!0)},className:"font-medium px-8 py-3 rounded-lg shadow-sm hover:shadow-md transition-all duration-200 transform hover:scale-102 focus:ring-4",style:{backgroundColor:"var(--modal-header-ice)",color:"#4A4A4A",borderColor:"var(--modal-header-lav)"},children:[e.jsx(ar,{className:"mr-2 h-5 w-5",style:{color:"#4A4A4A"}}),"Enroll in This Class"]})})]})]})},$.id))})]}),a&&ne.length===0&&e.jsx("div",{className:"text-center py-8",style:{color:"#4A4A4A"},children:"No classes available for this session yet"}),e.jsx(es,{open:k&&!!c,onOpenChange:$=>{E($),$||(u(null),N([]))},children:e.jsxs(ts,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",style:{backgroundColor:"white"},children:[e.jsxs(ss,{style:{backgroundColor:"var(--modal-header-blue)",padding:"1rem",margin:"-1.5rem -1.5rem 1rem -1.5rem",borderRadius:"0.5rem 0.5rem 0 0"},children:[e.jsxs(ns,{style:{color:"#4A4A4A"},children:["Enroll in ",c==null?void 0:c.className]}),e.jsxs(Pa,{style:{color:"#4A4A4A"},children:["Complete the enrollment form for ",(c==null?void 0:c.timeSlot)==="yac"?"Young Adult Chat":`${c==null?void 0:c.timeSlot.toUpperCase()} EST`]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"student",style:{color:"#4A4A4A"},children:"Select Student"}),e.jsxs(St,{value:h==null?void 0:h.toString(),onValueChange:$=>
799x(parseInt($)),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Choose a student"})}),e.jsx(Ct,{children:(O=s==null?void 0:s.students)==null?void 0:O.filter($=>$.id).map($=>e.jsxs(ce,{value:$.id.toString(),children:[$.name," (Age ",To($).age,")"]},$.id))})]}),R&&(typeof To(R).age=="number"?To(R).age:parseInt(To(R).age)||0)<((c==null?void 0:c.ageRequirement)??0)&&e.jsxs("p",{className:"text-sm mt-1",style:{color:"#dc2626"},children:["Age requirement not met. This class requires students to be ",(c==null?void 0:c.ageRequirement)??0,"+ years old."]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"period",style:{color:"#4A4A4A"},children:"Enrollment Period"}),e.jsxs(St,{value:m,onValueChange:g,children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"week",children:"1 Week"}),e.jsx(ce,{value:"month",children:"1 Month"}),((me=J.find($=>$.id===a))==null?void 0:me.sessionType)!=="summer_camp"&&e.jsx(ce,{value:"trimester",children:"Full Trimester"})]})]})]}),le&&le.weeks&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ne,{style:{color:"#4A4A4A"},children:m==="week"?"Select Weeks to Enroll":m==="month"?"Weeks Selected (Automatic for 1 Month)":"Weeks Selected (Automatic for Full Trimester)"}),e.jsx(we,{variant:"outline",style:{backgroundColor:"var(--modal-header-corn)",color:"#4A4A4A"},children:m==="week"?`${w.length} of ${le.weeks.filter($=>$.isEnrollable).length} weeks selected`:m==="month"?"Next 4 weeks will be selected":`All ${le.weeks.filter($=>$.isEnrollable).length} weeks will be selected`})]}),le.currentWeek&&e.jsxs("div",{className:"text-sm p-2 rounded",style:{backgroundColor:"var(--modal-header-blue)",color:"#4A4A4A"},children:["Currently ",le.sessionType==="summer_camp"?"Camp":"Trimester"," Week ",le.currentWeek]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 max-h-48 overflow-y-auto",children:le.weeks.map($=>{if(!$.isEnrollable)return null;const K=w.includes($.weekNumber),xe=le.currentWeek&&$.weekNumber<le.currentWeek,De=le.currentWeek&&$.weekNumber===le.currentWeek,X=m!=="week";return e.jsx("div",{className:`p-2 border rounded-lg transition-all ${X?"opacity-60 cursor-not-allowed border-gray-300 bg-gray-50":`cursor-pointer ${K?"border-aac-blue bg-aac-blue/10":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"}`} ${xe?"opacity-50":""}`,onClick:()=>{X||N(K?w.filter(_e=>_e!==$.weekNumber):[...w,$.weekNumber])},children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{checked:K,disabled:X,onChange:()=>{}}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"font-medium",style:{color:K?"#77dbf6":"#4A4A4A"},children:["Week ",$.weekNumber,De&&e.jsx(we,{className:"ml-1 text-xs",style:{backgroundColor:"#feea6a",color:"#4A4A4A"},children:"Current"}),X&&e.jsx(we,{className:"ml-1 text-xs",style:{backgroundColor:"#e3f2fd",color:"#1976d2"},children:"Auto"})]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[$.startDate," - ",$.endDate]}),$.isBreak&&e.jsx("div",{className:"text-xs text-orange-600",children:"Break Week"})]})]})},$.weekNumber)})}),m==="week"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{const $=le.weeks.filter(K=>K.isEnrollable).map(K=>K.weekNumber);N($)},style:{borderColor:"var(--modal-header-ice)",color:"#4A4A4A"},children:"Select All"}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>N([]),style:{borderColor:"var(--modal-header-ice)",color:"#4A4A4A"},children:"Clear All"})]}),m!=="week"&&e.jsxs("div",{className:"text-sm p-3 rounded-lg border",style:{backgroundColor:"var(--modal-header-blue)",color:"#4A4A4A"},children:["Week selection is automatic for ",m==="month"?"monthly":"trimester"," enrollment"]})]}),L&&e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border-2",style:{backgroundColor:L.isIncludedInTuition?"#f0f9f0":"#f0f9ff",borderColor:L.isIncludedInTuition?"#22c55e":"#77dbf6"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[L.isIncludedInTuition?e.jsx(As,{className:"h-5 w-5",style:{color:"#22c55e"}}):e.jsx(xr,{className:"h-5 w-5",style:{color:"#77dbf6"}}),e.jsx("h4",{className:"font-semibold text-lg",style:{color:"#4A4A4A"},children:L.isIncludedInTuition?"Enrollment Details":"Payment Calculation"})]}),L.isIncludedInTuition?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Class Type"}),e.jsx("p",{className:"text-lg font-bold",style:{color:"#22c55e"},children:L.serviceType})]}),e.jsxs("div",{className:"text-center p-3 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("p",{className:"text-xl font-bold text-green-800 mb-2",children:"No Additional Cost"}),e.jsx("p",{className:"text-sm text-green-700",children:L.includedMessage})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Weeks Selected"}),e.jsxs("p",{className:"text-lg font-bold",style:{color:"#4A4A4A"},children:[L.numberOfWeeks," weeks"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Service Type"}),e.jsx("p",{className:"text-lg font-bold",style:{color:"#77dbf6"},children:L.serviceType})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Weekly Rate"}),e.jsxs("p",{className:"text-lg font-bold",style:{color:"#4A4A4A"},children:[gx(L.weeklyRate),"/week"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Weeks Selected"}),e.jsxs("p",{className:"text-lg font-bold",style:{color:"#4A4A4A"},children:[L.numberOfWeeks," weeks"]})]})]}),e.jsxs("div",{className:"text-center pt-2 border-t border-aac-blue/20",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Total Due"}),e.jsx("p",{className:"text-2xl font-bold",style:{color:"#77dbf6"},children:gx(L.totalCost)}),e.jsxs("p",{className:"text-xs mt-1",style:{color:"#4A4A4A"},children:[L.numberOfWeeks," weeks à ",gx(L.weeklyRate)," = ",gx(L.totalCost)]})]})]}),L.selectedWeeks.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",style:{color:"#4A4A4A"},children:"Selected Weeks:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:L.selectedWeeks.map($=>e.jsxs(we,{className:L.isIncludedInTuition?"bg-green-100 text-green-800 border-green-300":"bg-aac-blue/10 text-aac-blue border-aac-blue",children:["Week ",$]},$))})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"notes",style:{color:"#4A4A4A"},children:"Notes and Comments *"}),e.jsx(Pt,{id:"notes",value:y,onChange:$=>b($.target.value),placeholder:"What did you sign up for and for whom?",rows:4,required:!0,className:y.trim()?"":"border-red-300"}),!y.trim()&&e.jsx("p",{className:"text-sm text-red-600 mt-1",children:"Please tell us what you signed up for and for whom as a backup verification."})]})]}),e.jsx(sl,{children:(()=>{const $=R?To(R).age:null,K=$&&typeof $=="number"?$:$&&parseInt($)||0,xe=!R||K>=((c==null?void 0:c.ageRequirement)??0);return e.jsxs(e.Fragment,{children:[e.jsx(F,{variant:"outline",onClick:()=>E(!1),style:{color:"#4A4A4A",borderColor:"var(--modal-header-ice)"},children:"Cancel"}),e.jsx(F,{onClick:()=>
799{if(!h){_({title:"Student Selection Required",description:"Please select a student before confirming enrollment.",variant:"destructive"});return}if(!xe){_({title:"Age Requirement Not Met",description:`This class requires students to be ${(c==null?void 0:c.ageRequirement)??0}+ years old. ${R==null?void 0:R.name} is ${K} years old.`,variant:"destructive"});return}if(!y.trim()){_({title:"Comments Required",description:"Please tell us what you signed up for and for whom as a backup verification.",variant:"destructive"});return}be()},disabled:G.isPending||!y.trim(),className:!h||!xe||!y.trim()?"opacity-50 cursor-not-allowed":"",style:{backgroundColor:"var(--modal-header-lav)",color:"#4A4A4A"},children:G.isPending?"Enrolling...":"Confirm Enrollment"})]})})()})]})}),e.jsx(es,{open:P,onOpenChange:M,children:e.jsxs(ts,{className:"sm:max-w-[500px]",style:{backgroundColor:"white"},children:[e.jsxs(ss,{style:{backgroundColor:"var(--modal-header-corn)",padding:"1rem",margin:"-1.5rem -1.5rem 1rem -1.5rem",borderRadius:"0.5rem 0.5rem 0 0"},children:[e.jsx(ns,{className:"text-center",style:{color:"#4A4A4A"},children:"Enrollment Successful!"}),e.jsx(Pa,{className:"text-center",style:{color:"#4A4A4A"},children:"Your student has been enrolled in the selected class."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg p-4 border",style:{backgroundColor:"var(--modal-header-pink)",borderColor:"#feea6a"},children:e.jsxs("p",{className:"text-sm text-center",style:{color:"#4A4A4A"},children:[e.jsx("strong",{children:"Important:"})," Enrollment is not completed until payment has been made."]})}),e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{style:{color:"#4A4A4A"},children:"Would you like to:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{onClick:()=>{M(!1)},className:"w-full border",variant:"outline",style:{backgroundColor:"var(--modal-header-ice)",color:"#4A4A4A",borderColor:"var(--modal-header-lav)"},children:[e.jsx(fa,{className:"h-4 w-4 mr-2",style:{color:"#4A4A4A"}}),"Enroll in More Classes"]}),e.jsxs(F,{onClick:()=>{M(!1),t("payments");const $=new URL(window.location.href);$.searchParams.set("tab","payments"),window.history.pushState({},"",$.toString()),n(!0)},className:"w-full",style:{backgroundColor:"var(--modal-header-lav)",color:"#4A4A4A"},children:[e.jsx(Or,{className:"h-4 w-4 mr-2",style:{color:"#4A4A4A"}}),"Make or Arrange Payment"]})]})]})]}),e.jsx(sl,{children:e.jsx(F,{variant:"ghost",onClick:()=>M(!1),className:"w-full",style:{color:"#4A4A4A"},children:"Close"})})]})}),e.jsx(es,{open:z,onOpenChange:H,children:e.jsxs(ts,{className:"sm:max-w-[600px]",style:{backgroundColor:"white"},children:[e.jsxs(ss,{style:{backgroundColor:"var(--modal-header-pink)",padding:"1rem",margin:"-1.5rem -1.5rem 1rem -1.5rem",borderRadius:"0.5rem 0.5rem 0 0"},children:[e.jsx(ns,{className:"text-center",style:{color:"#4A4A4A"},children:"Student Already Enrolled"}),e.jsx(Pa,{className:"text-center",style:{color:"#4A4A4A"},children:"Your student is already enrolled in this class. Would you like to modify your enrollment?"})]}),T&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg p-4 border",style:{backgroundColor:"var(--modal-header-ice)",borderColor:"#77dbf6"},children:[e.jsx("h4",{className:"font-semibold mb-2",style:{color:"#4A4A4A"},children:"Current Enrollment:"}),e.jsx("p",{style:{color:"#4A4A4A"},children:e.jsx("strong",{children:(Y=T.details)==null?void 0:Y.className})}),e.jsxs("p",{className:"text-sm",style:{color:"#666"},children:[(Te=T.details)==null?void 0:Te.timeSlot," ⢠",(Be=T.details)==null?void 0:Be.days]}),((Mt=(ht=T.details)==null?void 0:ht.currentWeeks)==null?void 0:Mt.length)>0&&e.jsxs("p",{className:"text-sm mt-2",style:{color:"#666"},children:["Currently enrolled weeks: ",T.details.currentWeeks.join(", ")]})]}),e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{style:{color:"#4A4A4A"},children:"What would you like to do?"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{onClick:()=>{H(!1),U(null)},className:"w-full border",variant:"outline",style:{backgroundColor:"var(--modal-header-ice)",color:"#4A4A4A",borderColor:"var(--modal-header-lav)"},children:[e.jsx(Zr,{className:"h-4 w-4 mr-2",style:{color:"#4A4A4A"}}),"Choose Different Weeks or Classes"]}
799),e.jsxs(F,{onClick:()=>{H(!1),U(null),t("payments");const $=new URL(window.location.href);$.searchParams.set("tab","payments"),window.history.pushState({},"",$.toString()),n(!0)},className:"w-full",style:{backgroundColor:"var(--modal-header-lav)",color:"#4A4A4A"},children:[e.jsx(Or,{className:"h-4 w-4 mr-2",style:{color:"#4A4A4A"}}),"Continue to Payment for Existing Enrollment"]})]})]}),e.jsx("div",{className:"text-center text-sm",style:{color:"#666"},children:e.jsx("p",{children:"If you need to change your enrollment weeks or add additional classes, please contact AAC Voices support."})})]}),e.jsx(sl,{children:e.jsx(F,{variant:"ghost",onClick:()=>{H(!1),U(null)},className:"w-full",style:{color:"#4A4A4A"},children:"Close"})})]})})]})}function tZ({approvedStudents:s,onSubmit:t,onCancel:n,isLoading:r}){const[a,o]=p.useState(""),[c,u]=p.useState(""),[h,x]=p.useState("60"),[m,g]=p.useState(""),{data:y,isLoading:b}=nt({queryKey:["/api/portal/available-time-slots"],enabled:s.length>0}),w=N=>{if(N.preventDefault(),!a||!c)return;const k=(y||[]).find(P=>P.id===c);if(!k)return;const E=`${k.date}T${k.startTime}`;t({studentId:parseInt(a),scheduledDateTime:E,duration:parseInt(h),sessionNotes:m})};return e.jsxs("form",{onSubmit:w,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"student",children:"Select Student"}),e.jsxs(St,{value:a,onValueChange:o,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Choose a student..."})}),e.jsx(Ct,{children:s.map(N=>e.jsx(ce,{value:N.id.toString(),children:N.name},N.id))})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{children:"Available Time Slots"}),b?e.jsx("div",{className:"text-center py-4 text-gray-500",children:"Loading available slots..."}):!y||(y||[]).length===0?e.jsx("div",{className:"text-center py-4 text-gray-500",children:"No available time slots found. Please contact AAC Voices to
799schedule."}):e.jsxs(St,{value:c,onValueChange:u,children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Choose an available time slot..."})}),e.jsx(Ct,{children:(y||[]).map(N=>{const k=new Date(N.date+"T12:00:00"),E=k.toLocaleDateString("en-US",{weekday:"long"}),P=k.toLocaleDateString("en-US",{month:"short",day:"numeric"}),M=new Date(`2000-01-01T${N.startTime}`).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return e.jsxs(ce,{value:N.id,children:[E,", ",P," at ",M," (",N.duration," min)"]},N.id)})})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"duration",children:"Duration (minutes)"}),e.jsxs(St,{value:h,onValueChange:x,children:[e.jsx(At,{children:e.jsx(kt,{})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"30",children:"30 minutes"}),e.jsx(ce,{value:"45",children:"45 minutes"}),e.jsx(ce,{value:"60",children:"60 minutes"}),e.jsx(ce,{value:"90",children:"90 minutes"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"notes",children:"Session Notes (Optional)"}),e.jsx(Pt,{id:"notes",value:m,onChange:N=>g(N.target.value),placeholder:"Any special requests or notes for this session...",rows:3})]}),e.jsxs(sl,{children:[e.jsx(F,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),e.jsx(F,{type:"submit",disabled:r,children:r?"Scheduling...":"Schedule Session"})]})]})}function sZ({session:s,onSubmit:t,onCancel:n,isLoading:r}){const[a,o]=p.useState(""),[c,u]=p.useState("");p.useEffect(()=>{if(s){const x=vt.fromISO(s.scheduledDateEtIso,{setZone:!0});o(x.toFormat("yyyy-MM-dd")),u(x.toFormat("HH:mm"))}},[s]);const h=x=>{if(x.preventDefault(),!a||!c)return;const m=`${a}T${c}:00`;t(m)};return s?e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{className:"text-sm text-gray-600 mb-4",children:[e.jsx("strong",{children:"Current Session:"})," ",s.studentName," - ",vt.fromISO(s.scheduledDateEtIso).toFormat("MMM dd, yyyy h:mm a")]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"new-date",children:"New Date"}),e.jsx(je,{id:"new-date",type:"date",value:a,onChange:x=>o(x.target.value),min:new Date().toISOString().split("T")[0],required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"new-time",children:"New Time"}),e.jsx(je,{id:"new-time",type:"time",value:c,onChange:x=>u(x.target.value),required:!0})]}),e.jsxs(sl,{children:[e.jsx(F,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),e.jsx(F,{type:"submit",disabled:r,children:r?"Rescheduling...":"Reschedule Session"})]})]}):null}function nZ({familyData:s,onOpenWizard:t}){var ae;const{data:n,isLoading:r}=nt({queryKey:["/api/portal/one-on-one-sessions"],enabled:!!s}),{data:a,isLoading:o}=nt({queryKey:["/api/portal/available-time-slots"],enabled:!!s}),{toast:c}=Is(),u=dn(),[h,x]=p.useState(!1),[m,g]=p.useState(!1),[y,b]=p.useState(null),[w,N]=p.useState(null),k=((ae=s==null?void 0:s.students)==null?void 0:ae.filter(W=>{var J;return((J=W.studentCategories)==null?void 0:J.includes("1:1 Sessions"))&&W.oneOnOneApproved}))||[],E=bt({mutationFn:async W=>st("POST","/api/portal/one-on-one-sessions/schedule",W),onSuccess:()=>{u.invalidateQueries({queryKey:["/api/portal/one-on-one-sessions"]}),c({title:"Session Scheduled",description:"Your 1:1 session has been scheduled successfully."}),x(!1)},onError:W=>{c({title:"Error",description:W.message||"Failed to schedule session",variant:"destructive"})}}),P=bt({mutationFn:async W=>st("PATCH",`/api/portal/one-on-one-sessions/${W}/cancel`),onSuccess:W=>{u.invalidateQueries({queryKey:["/api/portal/one-on-one-sessions"]});const J=W.billingApplied?`You provided ${W.hoursNotice} hours notice. Since this was less than 24 hours, the full session rate has been charged per our cancellation policy.`:`You provided ${W.hoursNotice} hours notice. No charge will be applied since you cancelled with more than 24 hours notice.`;c({title:"Session Cancelled",description:J,variant:W.billingApplied?"destructive":"default"})},onError:W=>{c({title:"Error",description:W.message||"Failed to cancel session",variant:"destructive"})}}),M=bt({mutationFn:async({sessionId:W,newDateTime:J})=>st("PATCH",`/api/portal/one-on-one-sessions/${W}/reschedule`,{newScheduledDateTime:J}),onSuccess:()=>
799{u.invalidateQueries({queryKey:["/api/portal/one-on-one-sessions"]}),c({title:"Session Rescheduled",description:"Your session has been rescheduled successfully."}),g(!1),b(null)},onError:W=>{c({title:"Error",description:W.message||"Failed to reschedule session",variant:"destructive"})}}),L=W=>{confirm("Are you sure you want to cancel this session? Please note our 24-hour cancellation policy may apply.")&&P.mutate(W)},B=W=>{b(W),g(!0)},z=W=>{if(k.length===1){const J=`${W.date}T${W.startTime}`;E.mutate({studentId:k[0].id,scheduledDateTime:J,duration:60,sessionNotes:`Quick booking for ${W.title}`})}else k.length>1?(N(W),x(!0)):c({title:"No Eligible Students",description:"You don't have any students approved for 1:1 sessions. Please contact AAC Voices for approval.",variant:"destructive"})};if(r)return e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Loading your 1:1 sessions..."})]});const H=vt.now().setZone("America/New_York"),T=(n==null?void 0:n.filter(W=>W.scheduledDateEtIso?vt.fromISO(W.scheduledDateEtIso,{setZone:!0})>H&&W.sessionStatus!=="cancelled":!1))||[],U=(n==null?void 0:n.filter(W=>W.scheduledDateEtIso?vt.fromISO(W.scheduledDateEtIso,{setZone:!0})<=H||W.sessionStatus==="cancelled":!1))||[],_=W=>vt.fromISO(W,{setZone:!0}).toFormat("EEEE, MMMM d, yyyy 'at' h:mm a"),se=W=>{const J=vt.now().setZone("America/New_York"),le=(W.scheduledDateEtIso?vt.fromISO(W.scheduledDateEtIso,{setZone:!0}):J)>J,V=W.sessionStatus;return V==="cancelled"?e.jsx(we,{variant:"destructive",children:"Cancelled"}):V==="completed"?e.jsx(we,{variant:"outline",className:"bg-green-50 text-green-700",children:"Completed"}):le?e.jsx(we,{variant:"default",className:"bg-blue-50 text-blue-700",children:"Upcoming"}):e.jsx(we,{variant:"outline",children:"Past"})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold",style:{color:"#4A4A4A"},children:"Your 1:1 Sessions"}),e.jsxs("p",{className:"text-gray-600 mt-2",children:["Manage your approved 1:1 sessions for ",k.map(W=>W.name).join(", ")]}),k.length>0&&e.jsx("div",{className:"mt-4",children:e.jsxs(F,{onClick:()=>x(!0),className:"bg-blue-600 hover:bg-blue-700",disabled:E.isPending,children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Schedule New Session"]})})]}),T.length>0&&e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(an,{className:"h-5 w-5"}),"Upcoming Sessions"]})}),e.jsx(Se,{className:"space-y-4",children:T.map(W=>e.jsx("div",{className:"border rounded-lg p-4 bg-blue-50",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-semibold",children:W.studentName}),se(W)]}),e.jsx("p",{className:"text-gray-600",children:_(W.scheduledDateEtIso)}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Duration: ",W.duration," minutes ⢠Rate: $",W.rate]}),W.zoomMeetingUrl&&e.jsxs("a",{href:W.zoomMeetingUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 hover:text-blue-800 text-sm",children:[e.jsx(Jv,{className:"h-4 w-4"}),"Join Zoom Meeting"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{variant:"outline",size:"sm",onClick:()=>B(W),disabled:M.isPending,children:"Reschedule"}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>L(W.id),disabled:P.isPending,children:"Cancel"})]})]})},W.id))})]}),U.length>0&&e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"h-5 w-5"}),"Past Sessions"]})}),e.jsxs(Se,{className:"space-y-4",children:[U.slice(0,5).map(W=>e.jsx("div",{className:"border rounded-lg p-4",children:e.jsx("div",{className:"flex justify-between items-start",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-semibold",children:W.studentName}),se(W)]}),e.jsx("p",{className:"text-gray-600",children:_(W.scheduledDateEtIso)}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Duration: ",W.duration," minutes ⢠Rate: $",W.rate]}),W.sessionNotes&&e.jsxs("p",{className:"text-sm text-gray-700 bg-gray-50 p-2 rounded",children:[e.jsx("strong",{children:"Notes:"})," ",W.sessionNotes]})]})})},W.id)),U.length>5&&e.jsxs("p",{className:"text-center text-gray-500 text-sm",children:["Showing recent 5 sessions. Total: ",U.length]})]})]}),o?e.jsx(Ce,{children:e.jsxs(Se,{className:"text-center py-8",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Loading available time slots..."})]})}):a&&(a||[]).length>0?e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(an,{className:"h-5 w-5"}),"Available Time Slots"]}),e.jsx("p",{className:"text-gray-600 text-sm",children:"Click any time slot below to quickly book a 1:1 session. All sessions are 60 minutes long."})]}),e.jsx(Se,{children:e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:(a||[]).map(W=>{const J=new Date(W.date+"T12:00:00"),ne=J.toLocaleDateString("en-US",{weekday:"long"}),le=J.toLocaleDateString("en-US",{month:"short",day:"numeric"}),V=new Date(`2000-01-01T${W.startTime}`).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});return e.jsx(Ce,{className:"hover:shadow-md transition-shadow cursor-pointer border-2 hover:border-blue-300 hover:bg-blue-50",onClick:()=>z(W),children:e.jsx(Se,{className:"p-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-sm font-medium text-blue-600 mb-1",children:ne}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:le}),e.jsxs("div",{className:"text-sm text-gray-600 mt-1",children:[V," EST"]}),e.jsxs("div",{className:"text-xs text-gray-500 mt-2",children:[W.duration," minutes"]}),e.jsx(F,{className:"mt-3 w-full",size:"sm",children:"Book This Time"})]})})},W.id)})})})]}):(!n||(n||[]).length===0)&&e.jsx(Ce,{children:e.jsxs(Se,{className:"text-center py-12",children:[e.jsx(an,{className:"h-12 w-12 mx-auto text-gray-400 mb-4"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-600 mb-2",children:"No Available Time Slots"}),e.jsx("p",{className:"text-gray-500 mb-4",children:"There are currently no available time slots for scheduling. Please check back later or contact us for assistance."})]})}),e.jsx(es,{open:h,onOpenChange:x,children:e.jsxs(ts,{className:"sm:max-w-[425px]",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Schedule New 1:1 Session"}),e.jsx(Pa,{children:"Schedule a new 1:1 session with one of your approved students."})]}),e.jsx(tZ,{approvedStudents:k,onSubmit:W=>E.mutate(W),onCancel:()=>x(!1),isLoading:E.isPending})]})}),e.jsx(es,{open:m,onOpenChange:g,children:e.jsxs(ts,{className:"sm:max-w-[425px]",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Reschedule Session"}),e.jsx(Pa,{children:"Choose a new date and time for your session."})]}),e.jsx(sZ,{session:y,onSubmit:W=>M.mutate({sessionId:y==null?void 0:y.id,newDateTime:W}),onCancel:()=>{g(!1),b(null)},isLoading:M.isPending})]})})]})}function oh(){var io,vc,Nm,Uf,zf,Td,_d,qf,Wf,Bf,Kf,Hf,wm,Gf,Zf,Yf,Qf,Id,Xf,Jf,ep,Am,tp,sp,np,rp,ap,ip,lp,Dd,lo,op,Cm,Sm,km,$m,Pm,jl,cp;const[s,t]=hl(),[n,r]=p.useState(!1),a=JG(),o=s.startsWith("/admin/family-portal"),c=()=>new URLSearchParams(window.location.search).get("tab")||"overview",[u,h]=p.useState(c()),[x,m]=p.useState(!1),[g,y]=p.useState(null),[b,w]=p.useState(!0),[N,k]=p.useState(!1),[E,P]=p.useState(!0),[M,L]=p.useState({isOpen:!1,enrollment:null,selectedWeeks:[]}),[B,z]=p.useState({isOpen:!1,studentId:null}),[H,T]=p.useState(""),[U,_]=p.useState("all"),[se,ae]=p.useState("all"),[W,J]=p.useState(null),[ne,le]=p.useState({caregiverOneName:"",caregiverOneEmail:"",caregiverOnePhone:"",caregiverTwoName:"",caregiverTwoEmail:"",caregiverTwoPhone:"",caregiverThreeName:"",caregiverThreeEmail:"",caregiverThreePhone:"",address:"",timeZone:"",paymentPreference:"",paymentMethod:"",thirdPartyPayerName:"",scholarshipPercentage:0,scholarshipInfo:""}
799),[V,Z]=p.useState({name:"",nicknames:"",birthday:"",age:0,gradeEquivalent:"",streetAddress:"",city:"",state:"",country:"",postalCode:"",diagnosis:"",currentAacSystems:"",accommodations:"",studentCategories:[],openEnrollmentClasses:1,contractSigned:!1,photoPermissionSigned:!1,specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",readingSkills:"",mathSkills:"",ahernLiteracyClass:"",ahernMathClass:""}),[ue,ge]=p.useState(null),[G,Ae]=p.useState(!1),[Fe,be]=p.useState(!1),[Me,R]=p.useState([]),[re,O]=p.useState({}),[me,Y]=p.useState(null),[Te,Be]=p.useState(null),[ht,Mt]=p.useState(!1),[$,K]=p.useState(null),[xe,De]=p.useState(null),[X,_e]=p.useState(!1),[Le,A]=p.useState({}),[D,ie]=p.useState({}),[$e,ke]=p.useState({email:"",password:""}),[S,ve]=p.useState(!1),[Ze,Qe]=p.useState(!1),[ct,It]=p.useState(()=>{const v=new Date;return`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`}),[Zs,Zt]=p.useState(!1),[qn,xn]=p.useState(null),[un,Rt]=p.useState(""),[Os,vs]=p.useState(""),[cs,Ts]=p.useState(!1),[mn,ds]=p.useState(!1),[ms,Yt]=p.useState(!1),[Ls,xl]=p.useState(!1),[bn,ya]=p.useState(""),[ur,ni]=p.useState(null),[Fi,Ri]=p.useState("trimester"),[ri,gl]=p.useState(null),[ai,ii]=p.useState(null),li=p.useRef(null),{user:Ss,isLoading:na,isAuthenticated:Mi}=U0(),en=dn(),{toast:hs}=Is(),{data:he,isLoading:q,error:Xe,refetch:Lt}=nt({queryKey:["/api/contracts/status"],enabled:Mi&&!!Ss,staleTime:0,gcTime:0,refetchOnMount:!0,retry:2});p.useEffect(()=>{he&&console.log("Contract Status Debug:",{requiresContract:he.requiresContract,hasSignedRenewal:he.hasSignedRenewal,currentPhase:he.currentPhase,contractModalDismissed:mn,showContractModal:cs,modalTriggered:ms})},[he,mn,cs,ms]),p.useEffect(()=>{Yt(!1)},[he==null?void 0:he.requiresContract,he==null?void 0:he.hasSignedRenewal,he==null?void 0:he.currentPhase]);const js=bt({mutationFn:async()=>st("POST","/api/contracts/sign",{photoReleaseConsent:Ls,photoReleaseSignature:Ls?bn:null}),onSuccess:()=>{en.invalidateQueries({queryKey:["/api/contracts/status"]}),Ts(!1),hs({title:"Success!",description:"Your contract has been signed successfully."})},onError:v=>{hs({title:"Error",description:v.message||"Failed to sign contract. Please try again.",variant:"destructive"})}});p.useEffect(()=>{if(he!=null&&he.requiresContract&&!(he!=null&&he.hasSignedRenewal)&&!ms&&(he==null?void 0:he.currentPhase)==="phase3_lockout"&&!mn&&!cs){const v=setTimeout(()=>{Ts(!0),Yt(!0)},1e3);return()=>clearTimeout(v)}},[he,mn]);const ps=async v=>{v.preventDefault();try{const Q=await st("POST","/api/auth/login",$e);en.invalidateQueries({queryKey:["/api/auth/user"]}),_e(!1),hs({title:"Success",description:"Logged in successfully"})}catch{hs({title:"Error",description:"Invalid credentials",variant:"destructive"})}},Xt=v=>{const Q=v.enrolledWeeks||[];L({isOpen:!0,enrollment:v,selectedWeeks:[...Q]})},Nn=async()=>{const{enrollment:v,selectedWeeks:Q}=M;if(Q.length>0)try{await st("PUT",`/api/portal/enrollments/${v.id}`,{enrolledWeeks:Q}),en.invalidateQueries({queryKey:["/api/portal/enrollments"]}),hs({title:"Success",description:"Enrollment updated successfully"}),L({isOpen:!1,enrollment:null,selectedWeeks:[]})}catch{hs({title:"Error",description:"Failed to update enrollment",variant:"destructive"})}else hs({title:"Error",description:"Please select at least one week",variant:"destructive"})},wn=v=>{L(Q=>({...Q,selectedWeeks:Q.selectedWeeks.includes(v)?Q.selectedWeeks.filter(Pe=>Pe!==v):[...Q.selectedWeeks,v].sort((Pe,qe)=>Pe-qe)}))},En=async v=>{if(confirm(`Are you sure you want to cancel the enrollment for ${v.className}? 800This action cannot be undone.`))try{await st("DELETE",`/api/portal/enrollments/${v.id}`),en.invalidateQueries({queryKey:["/api/portal/enrollments"]}),en.invalidateQueries({queryKey:["/api/portal/carry-forward-credits"]}),hs({title:"Success",description:"Enrollment cancelled successfully"})}catch(Pe){console.error("Error canceling enrollment:",Pe),hs({title:"Error",description:"Failed to cancel enrollment",variant:"destructive"})}},yl=p.useCallback(()=>{var bs;if(Me.length===0){Be(null);return}const v=Me.reduce((_s,Wt)=>_s+Wt.rate,0),Q=Me.map(_s=>_s.description).join(", "),Pe=Me.flatMap(_s=>_s.coverage||[]),qe=Array.from(new Set(Me.flatMap(_s=>_s.pendingPaymentIds||[]).filter(_s=>Number.isInteger(_s)))),dt=Array.from(new Set(Pe.map(_s=>_s.sessionBillingId).filter(_s=>Number.isInteger(_s))));Be({services:Me,total:v,expectedAmount:v,description:Q,coverage:Pe,pendingPaymentIds:qe,sessionBillingIds:dt,studentId:((bs=Pe.find(_s=>_s.studentId))==null?void 0:bs.studentId)||null,dueDate:new Date(Date.now()+720*60*60*1e3)})},[Me]);p.useEffect(()=>{yl()},[yl]),p.useEffect(()=>{Ss&&(Ss!=null&&Ss.requiresPasswordChange)&&ve(!0)},[Ss]),p.useEffect(()=>{if(Mi&&Ss&&!(Ss!=null&&Ss.requiresPasswordChange)&&!localStorage.getItem(`passwordReminder_${Ss.email}`)){const Q=setTimeout(()=>{Qe(!0),localStorage.setItem(`passwordReminder_${Ss.email}`,"true")},2e3);return()=>clearTimeout(Q)}},[Mi,Ss]);const{data:rt,isLoading:uc,error:Tn}=nt({queryKey:["/api/portal/family"],queryFn:Nx({on401:"throw"}),enabled:!!Ss,retry:(v,Q)=>{var Pe;return console.log("Family query retry check:",{failureCount:v,error:Q,status:Q==null?void 0:Q.status}),(Q==null?void 0:Q.status)===302?(console.log("302 detected, stopping retries"),!1):(Pe=Q==null?void 0:Q.message)!=null&&Pe.includes("302:")?(console.log("302 in message detected, stopping retries"),!1):v<3}}),{data:Qs,isLoading:xg,error:va}=bE(rt==null?void 0:rt.id);p.useEffect(()=>{if(Tn){console.log("Family error detected:",Tn),console.log("Error message:",Tn==null?void 0:Tn.message);const v=(Tn==null?void 0:Tn.message)||"";if(v.includes("302:")&&v.includes("Registration incomplete")){console.log("Redirecting to registration: family record not found"),t("/register-student");return}if((Tn==null?void 0:Tn.status)===302){const Q=Tn;Q.redirectTo&&(console.log("Redirecting to registration via status: family record not found"),t(Q.redirectTo))}}},[Tn,t]),p.useEffect(()=>
800{if(new URLSearchParams(window.location.search).get("newFamily")==="true"&&rt&&(!rt.students||(rt.students||[]).length===0)){h("students"),setTimeout(()=>{const qe=document.querySelector("[data-add-student]");qe&&qe.click()},500);const Pe=window.location.pathname+window.location.search.replace(/[?&]newFamily=true/,"");window.history.replaceState({},"",Pe)}},[rt]),p.useEffect(()=>{const Q=new URLSearchParams(window.location.search).get("tab");Q&&Q!==u&&h(Q)},[s,u]),p.useEffect(()=>{const v=()=>{const Pe=new URLSearchParams(window.location.search).get("tab")||"overview";h(Pe)};return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[]),p.useEffect(()=>{const v=Q=>{h(Q.detail)};return window.addEventListener("portal-tab-change",v),()=>window.removeEventListener("portal-tab-change",v)},[]),p.useEffect(()=>{if(W&&V.birthday){const v=K1(V.birthday);if(v!==null&&v!==V.age){const Q=H1(v);Z(Pe=>({...Pe,age:v,gradeEquivalent:Pe.gradeEquivalent||Q}))}}},[V.birthday,W]);const{data:Vs,isLoading:Wj,error:Mr}=nt({queryKey:["/api/portal/payments"],queryFn:Nx({on401:"throw"}),enabled:!!Ss,retry:(v,Q)=>{var Pe;return console.log("Payments query retry check:",{failureCount:v,error:Q,status:Q==null?void 0:Q.status}),(Q==null?void 0:Q.status)===302?(console.log("302 detected in payments, stopping retries"),!1):(Pe=Q==null?void 0:Q.message)!=null&&Pe.includes("302:")?(console.log("302 in payments message detected, stopping retries"),!1):v<3}}),{data:ra,isLoading:dm}=nt({queryKey:["/api/portal/credits"],enabled:!!Ss}),{data:br,isLoading:mc,isError:um,error:mm}=nt({queryKey:["/api/portal/carry-forward-credits"],enabled:!!Ss}),{data:Us,isLoading:Of,error:Ff}=nt({queryKey:["/api/portal/enrollments"],queryFn:Nx({on401:"throw"}),enabled:!!Ss,retry:(v,Q)=>{var Pe;return console.log("Enrollments query retry check:",{failureCount:v,error:Q,status:Q==null?void 0:Q.status}),(Q==null?void 0:Q.status)===302?(console.log("302 detected in enrollments, stopping retries"),!1):(Pe=Q==null?void 0:Q.message)!=null&&Pe.includes("302:")?(console.log("302 in enrollments message detected, stopping retries"),!1):v<3}}),{data:ja}=nt({queryKey:["/api/session-billing-with-attendance"],enabled:!!Ss}),Nd=p.useMemo(()=>Us?Array.from(new Set(Us.map(Q=>Q.sessionId).filter(Boolean))):[],[Us]),wd=jO({queries:Nd.map(v=>({queryKey:["/api/week-calendar",v],queryFn:()=>st("GET",`/api/week-calendar/${v}`).then(Q=>Q.json()),enabled:!!v}))}),Fs=p.useMemo(()=>{const v=new Map;return wd.forEach((Q,Pe)=>{if(Q.data&&Nd[Pe]){const qe=Nd[Pe];Q.data.forEach(dt=>{const bs=`${qe}-${dt.weekNumber}`;v.set(bs,dt)})}}),v},[wd,Nd]),{data:Lr,isLoading:Rf}=nt({queryKey:["/api/portal/resources"],enabled:!!Ss}),{data:cn,isLoading:Mf,refetch:gg}=nt({queryKey:["/api/portal/weekly-password"],enabled:!!Ss}),vl=bt({mutationFn:()=>st("POST","/api/portal/request-password"),onSuccess:()=>{hs({title:"Request Sent",description:"Your password request has been sent to Kate and Aliza via text message."})},onError:v=>{hs({title:"Request Failed",description:v.message||"Failed to send password request",variant:"destructive"})}}),{data:Ad=[],isLoading:Cd,isError:Li,refetch:Vi}=nt({queryKey:["/api/portal/class-sessions"],queryFn:()=>st("GET","/api/portal/class-sessions").then(v=>v.json()),enabled:!!Ss}),ks=p.useMemo(()=>gG(Ad),[Ad]),{data:to=[],isLoading:hc,isError:Ui,refetch:yg}=nt({queryKey:["/api/portal/class-slots",ks==null?void 0:ks.id],queryFn:()=>st("GET",`/api/portal/class-slots?sessionId=${ks==null?void 0:ks.id}`).then(v=>v.json()),enabled:!!(ks!=null&&ks.id)}),{data:fc,isLoading:pc,isError:vg,refetch:Lf}=nt({queryKey:["/api/sessions",ks==null?void 0:ks.id,"weeks","quick-enroll"],queryFn:()=>st("GET",`/api/sessions/${ks==null?void 0:ks.id}/weeks`).then(v=>v.json()),enabled:!!(ks!=null&&ks.id)}),so=p.useMemo(()=>{const v=new Date;return v.setHours(0,0,0,0),((fc==null?void 0:fc.weeks)||[]).filter(Q=>{const Pe=new Date(`${Q.endDate}T23:59:59`);return Q.isEnrollable&&!Q.isBreakWeek&&Q.weekNumber>0&&Pe>=v}).sort((Q,Pe)=>Q.weekNumber-Pe.weekNumber)},[fc]);p.useEffect(()=>{ni(null),ii(null)},[ks==null?void 0:ks.id]);const hm=()=>Fi==="week"?ai?[ai]:[]:Fi==="month"?so.slice(0,4).map(v=>v.weekNumber):so.map(v=>v.weekNumber),fm=bt({mutationFn:async v=>{const Q=await st("POST","/api/portal/class-enrollments",v);if(!Q.ok){const Pe=await Q.json();throw new Error(Pe.message||"Enrollment failed")}return Q.json()},onSuccess:()=>{en.invalidateQueries({queryKey:["/api/portal/enrollments"]}),en.invalidateQueries({queryKey:["/api/portal/payments"]}),ni(null),Ri("trimester"),gl(null),ii(null),hs({title:"Registration saved",description:"Choose the new class payment below to continue."})},onError:v=>{hs({title:"Sign-up failed",description:v.message||"Please try again or c
800ontact [email protected]",variant:"destructive"})}}),Nr=(Lr||[]).filter(v=>{const Q=!H||(v.original_name||v.name||v.filename||"").toLowerCase().includes(H.toLowerCase())||(v.description||"").toLowerCase().includes(H.toLowerCase())||(v.tags||[]).some(dt=>dt.toLowerCase().includes(H.toLowerCase())),Pe=U==="all"||(v.tags||[]).includes(U),qe=se==="all"||(v.accessLevels||[]).includes(se);return Q&&Pe&&qe})||[],no=[...Nr||[]].sort((v,Q)=>new Date(Q.uploadDate||Q.upload_date||0).getTime()-new Date(v.uploadDate||v.upload_date||0).getTime()).slice(0,3),ro=v=>{const Q=new Date(v.uploadDate||v.upload_date);return(new Date().getTime()-Q.getTime())/(1e3*3600*24)<=7},Sd=v=>{const Q=v.accessLevels||v.access_levels||v.accessLevel;if(!Q||Array.isArray(Q)&&Q.length===0)return["All Families"];const Pe={all:"All Families","ahern-academy":"Ahern Academy","open-enrollment":"Open Enrollment",yac:"Young Adult Chat","1:1":"1:1 Sessions","1:1 Sessions":"1:1 Sessions","Ahern Academy":"Ahern Academy","Open Enrollment":"Open Enrollment","Young Adult Chat":"Young Adult Chat","All Families":"All Families",admin:"Admin Only"};if(Array.isArray(Q))return Q.map(qe=>Pe[qe]||qe);try{const qe=JSON.parse(Q);if(Array.isArray(qe))return qe.map(dt=>Pe[dt]||dt)}catch{}return[Pe[Q]||Q]};p.useEffect(()=>{if(Mr){console.log("Payments error detected:",Mr),console.log("Error message:",Mr==null?void 0:Mr.message);const v=(Mr==null?void 0:Mr.message)||"";if(v.includes("302:")&&v.includes("Registration incomplete")){console.log("Redirecting to registration: family record not found (payments)"),t("/register-student");return}if((Mr==null?void 0:Mr.status)===302){const Q=Mr;Q.redirectTo&&(console.log("Redirecting to registration via status: family record not found (payments)"),t(Q.redirectTo))}}},[Mr,t]),p.useEffect(()=>{!na&&!Ss&&t("/")},[Ss,na,t]);const pm=!na&&Ss&&!q&&(he==null?void 0:he.requiresContract)&&!(he!=null&&he.hasSignedRenewal)&&(he==null?void 0:he.currentPhase)==="phase3_lockout";if(p.useEffect(()=>{pm&&!cs&&Ts(!0)},[pm,cs]),q)return e.jsx("div",{className:"p-8 text-center",children:"Checking contract status..."});if(pm)return e.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-blue-100",children:[e.jsxs("div",{className:"max-w-md mx-auto p-8 text-center",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices",className:"h-16 w-auto mx-auto mb-4"}),e.jsx("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(Js,{className:"h-8 w-8 text-blue-600"})})]}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Contract Signature Required"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"To continue using the AAC Voices portal, please sign your 2026â2027 Ahern Academy contract. This is required for all families."}),e.jsxs(F,{onClick:()=>Ts(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-3",children:[e.jsx(Js,{className:"h-5 w-5 mr-2"}),"Sign Contract Now"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-4",children:"Questions? Contact [email protected] for assistance."})]}),e.jsx(es,{open:cs,onOpenChange:v=>{v&&Ts(v)},children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{style:{background:"linear-gradient(135deg, #77dbf6 0%, #5DCFF2 100%)",borderRadius:"12px",padding:"24px",margin:"-24px -24px 24px -24px"},children:e.jsxs(ns,{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices",className:"h-12 w-auto"}),e.jsx("div",{className:"w-10 h-10 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:e.jsx(Js,{className:"h-5 w-5 text-white"})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-semibold text-white",children:"AAC Voices / Ahern Academy Contract"}),e.jsx("div",{className:"text-sm font-normal text-white/90",children:"2026â2027 School Year - Signature Required"})]})]})}),e.jsxs("div",{className:"space-y-6 text-sm",children:[e.jsxs("div",{className:"p-6 bg-red-50 border-l-4 border-red-400",children:[e.jsx("h3",{className:"text-lg font-semibold text-red-800 mb
800-2",children:"Action Required"}),e.jsx("p",{className:"text-red-700",children:"Portal access is restricted until you complete your contract signing. Please review and sign below to regain full access."})]}),e.jsx(a3,{existingCaregivers:he==null?void 0:he.caregivers,onSigned:()=>Ts(!1)})]})]})})]});if(na)return e.jsx("div",{className:"p-8 text-center",children:"Loading..."});if(!Ss)return null;if(uc)return e.jsx("div",{className:"p-8 text-center",children:"Loading your family information..."});if(console.log("Family query state:",{familyData:rt,familyLoading:uc,familyError:Tn,user:Ss}),Tn)return console.error("Family data error:",Tn),e.jsxs("div",{className:"p-8 text-center",children:["Error loading family data: ",Tn.message]});if(!rt)return e.jsx("div",{className:"p-8 text-center",children:"No family data found. Please contact support."});console.log("Family data loaded:",rt);const xc=v=>new Date(v).toLocaleDateString(),tr=v=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(typeof v=="string"?parseFloat(v):v),kd=()=>{if(rt){const v=rt;le({caregiverOneName:v.caregiverOneName||"",caregiverOneEmail:v.caregiverOneEmail||"",caregiverOnePhone:v.caregiverOnePhone||"",caregiverTwoName:v.caregiverTwoName||"",caregiverTwoEmail:v.caregiverTwoEmail||"",caregiverTwoPhone:v.caregiverTwoPhone||"",caregiverThreeName:v.caregiverThreeName||"",caregiverThreeEmail:v.caregiverThreeEmail||"",caregiverThreePhone:v.caregiverThreePhone||"",address:v.address||"",timeZone:v.timeZone||"",paymentPreference:v.paymentPreference||"",paymentMethod:v.paymentMethod||"",thirdPartyPayerName:v.thirdPartyPayerName||"",scholarshipPercentage:v.scholarshipPercentage||0,scholarshipInfo:v.scholarshipInfo||""}),k(!0)}},xm=async()=>{try{await st("PUT","/api/portal/family",ne),en.invalidateQueries({queryKey:["/api/portal/family"]}),k(!1),hs({title:"Success",description:"Family information updated successfully"})}catch{hs({title:"Error",description:"Failed to update family information",variant:"destructive"})}},gm=async v=>{var Pe;const Q=(Pe=v.target.files)==null?void 0:Pe[0];if(!(!Q||!W)){if(Q.size>200*1024*1024){hs({title:"Error",description:"File size must be under 200MB",variant:"destructive"});return}Y(W);try{const qe=new FormData;qe.append("file",Q);const dt=await fetch(`/api/students/${W}/upload-aac`,{method:"POST",body:qe,credentials:"include"}),bs=await dt.json();if(dt.ok){const _s=Q.name.toLowerCase().split(".").pop();let Wt="";switch(_s){case"wf":Wt="LAMP Words for Life";break;case"ce":Wt="TouchChat";break;case"p2gbk":Wt="Proloquo2Go";break;case"gridset":case"gridsetx":Wt="Grid for iPad";break;case"mti":Wt="PRC Unity";break;case"sps":Wt="TDSnap";break;case"azt":case"avrt":Wt="Avaz";break;case"jmm":Wt="MindExpress";break}O({...re,aacFileUrl:bs.fileUrl,fileName:bs.fileName,fileSize:bs.fileSize,primaryAacSystem:Wt||re.primaryAacSystem,primaryAacReady:!0}),en.invalidateQueries({queryKey:["/api/portal/family"]}),hs({title:"Success",description:Wt?`AAC file uploaded successfully. Primary AAC system set to ${Wt}.`:"AAC system file uploaded successfully"})}else throw new Error(bs.error||"Upload failed")}catch(qe){console.error("AAC upload error:",qe),hs({title:"Error",description:qe.message||"Failed to upload AAC system file",variant:"destructive"})}finally{Y(null),v.target.value=""}}},oi=async()=>{if(W)try{if((await fetch(`/api/students/${W}/aac-file`,{method:"DELETE",credentials:"include"})).ok)O({...re,aacFileUrl:"",fileName:"",fileSize:0}),en.invalidateQueries({queryKey:["/api/portal/family"]}),hs({title:"Success",description:"AAC file deleted successfully"});else throw new Error("Delete failed")}catch(v){console.error("AAC delete error:",v),hs({title:"Error",description:"Failed to delete AAC file",variant:"destructive"})}},gc=async()=>{if(W)try{const Q={...{...V,currentAacSystems:Array.isArray(V.currentAacSystems)?V.currentAacSystems:V.currentAacSystems?V.currentAacSystems.split(",").map(Pe=>Pe.trim()).filter(Pe=>Pe):[],accommodations:Array.isArray(V.accommodations)?V.accommodations:V.accommodations?V.accommodations.split(",").map(Pe=>Pe.trim()).filter(Pe=>Pe):[]},primaryAacReady:re.primaryAacReady,primaryAacSystem:re.primaryAacSystem,primaryAacOther:re.primaryAacOther,primaryAacPlatform:re.primaryAacPlatform,aacFileUrl:re.aacFileUrl};await st("PUT",`/api/students/${W}`,Q),en.invalidateQueries({queryKey:["/api/portal/family"]}),J(null),hs({title:"Success",description:"Student information updated successfully"})}catch(v){console.error("Student update error:",v),hs({title:"Error",description:"Failed to update student information",variant:"destructive"})}},$d=async(v,Q)=>
800{if(Q){if(Q.size>5*1024*1024){hs({title:"Error",description:"File size must be less than 5MB",variant:"destructive"});return}ge(v);try{const Pe=new FormData;if(Pe.append("photo",Q),Pe.append("uploadedBy","Family Member"),!(await fetch(`/api/students/${v}/photo`,{method:"POST",body:Pe})).ok)throw new Error("Upload failed");en.invalidateQueries({queryKey:["/api/portal/family"]}),hs({title:"Success",description:"Photo uploaded successfully"})}catch{hs({title:"Error",description:"Failed to upload photo",variant:"destructive"})}finally{ge(null)}}},ym=v=>{li.current&&(li.current.onchange=Q=>{var qe;const Pe=(qe=Q.target.files)==null?void 0:qe[0];Pe&&$d(v,Pe)},li.current.click())},Pd=(v,Q)=>{if(Q){const Pe=v.serviceType==="Other Payment"?{...v,rate:Le[v.serviceType]||0,description:D[v.serviceType]||"Custom payment - requires amount and description"}:v,qe=ih([...Me,Pe]);if(!qe.valid){hs({title:"Pay Services Separately",description:qe.message,variant:"destructive"});return}v.serviceType==="Other Payment"?R([...Me,Pe]):R([...Me,v])}else if(R(Me.filter(Pe=>Pe.serviceType!==v.serviceType)),v.serviceType==="Other Payment"){const Pe={...Le},qe={...D};delete Pe[v.serviceType],delete qe[v.serviceType],A(Pe),ie(qe)}},Ed=(v,Q)=>{A({...Le,[v]:Q});const Pe=Me.findIndex(qe=>qe.serviceType===v);if(Pe!==-1){const qe=[...Me],dt=D[v]||"Custom payment - requires amount and description";qe[Pe]={...qe[Pe],rate:Q,description:dt},R(qe)}},Vf=(v,Q)=>{ie({...D,[v]:Q});const Pe=Me.findIndex(qe=>qe.serviceType===v);if(Pe!==-1){const qe=[...Me];qe[Pe]={...qe[Pe],description:Q||"Custom payment - requires amount and description"},R(qe)}},Vr=()=>{const v=ao();if(!v||v.length===0)return console.log("No current enrollment selections, no late fee applies"),!1;const Q=new Date;return console.log("Checking late registration for current selections:",v.length),v.some(Pe=>{if(!Pe.startDate)return console.log("No start date for selection:",Pe.className),!1;const qe=new Date(Pe.startDate);if(console.log(`Selected class "${Pe.className}" starts:`,qe),qe<=Q)return console.log("Class already started, no late fee applies"),!1;const dt=new Date(qe),bs=(qe.getDay()+1)%7;return dt.setDate(qe.getDate()-bs),dt.setHours(12,0,0,0),console.log(`Saturday deadline for "${Pe.className}":`,dt),console.log("Current time:",Q),console.log("Past deadline?",Q>dt),Q>dt})},ao=()=>[],vm=()=>{var jc;const v=rt;if(console.log("ð³ CREATE PAYMENT DEBUG - Entry",{familyId:v==null?void 0:v.id,familyName:v==null?void 0:v.caregiverOneName,hasStudents:!!(v!=null&&v.students),studentCount:((jc=v==null?void 0:v.students)==null?void 0:jc.length)||0,hasCurrentRates:!!Qs,hasEnrollments:!!Us,enrollmentCount:(Us==null?void 0:Us.length)||0,hasPayments:!!Vs,paymentCount:(Vs==null?void 0:Vs.length)||0}),!(v!=null&&v.students)||!Qs)return console.log("ð³ CREATE PAYMENT DEBUG - Early exit",{reason:v!=null&&v.students?"No rates loaded":"No students",familyId:v==null?void 0:v.id}),[];console.log("ð getAvailableServices called",{hasEnrollments:!!Us,enrollmentCount:(Us==null?void 0:Us.length)||0,hasWeekInfoLookup:Fs.size>0,weekInfoLookupSize:Fs.size});const Q=[],Pe=v.paymentMethod==="third-party"||v.thirdPartyPayerName,qe=v.scholarshipPercentage===100;if(Pe||qe){const is=Qs.lateFee;return Q.push({serviceType:"Late Fee",description:"Late payment fee",rate:is,billingPeriod:"weekly"}),Qs!=null&&Qs.registrationFee&&Q.push({serviceType:"Other Payment",description:"Custom payment amount",rate:Math.round(Qs.registrationFee/4),billingPeriod:"one-time"}),Q}const dt=(v.students||[]).some(is=>{var fs;return(fs=is.studentCategories)==null?void 0:fs.includes("Ahern Academy")});if(Us&&(Us||[]).length>0){console.log("ð Processing enrollments for payment options",{totalEnrollments:Us.length,enrollments:Us.map(Ns=>({id:Ns.id,className:Ns.className,enrolledWeeks:Ns.enrolledWeeks,sessionId:Ns.sessionId,status:Ns.status,ended:Ns.ended}))});const is=AG(Vs),fs=(Us||[]).filter(Ns=>!Ns.ended);console.log("ð Active enrollments (excluding ended sessions):",{total:Us.length,active:fs.length,filtered:Us.length-fs.length});const mr=new Map,Wn=new Date;Wn.setHours(0,0,0,0);const co=new Date(Wn);
800co.setDate(co.getDate()-7),fs.forEach(Ns=>{const An=Ns.enrolledWeeks||[1],wr=Ns.sessionId;An.forEach(Qn=>{if(l3(is,{enrollmentId:Ns.id,className:Ns.className,sessionId:wr,weekNumber:Qn,studentId:Ns.studentId}))return;const Ar=`${wr}-${Qn}`,Cr=Fs.get(Ar);if(Cr&&Cr.endDate){const aa=new Date(Cr.endDate);if(!isNaN(aa.getTime())&&aa<co)return}const Ma=`${wr}-${Qn}`;mr.has(Ma)||mr.set(Ma,[]);const ci=mr.get(Ma);ci.some(aa=>aa.className===Ns.className&&aa.sessionId===wr)||ci.push({className:Ns.className,enrollmentId:Ns.id,sessionId:Ns.sessionId,studentId:Ns.studentId,pendingPaymentId:o3(Vs,Ns.paymentId)})})}),fs.forEach(Ns=>{if(!Ns.sessionId||Ns.ended)return;const An=Ns.sessionId,wr=Math.min(...Ns.enrolledWeeks||[1]);for(const[Qn,Ar]of Array.from(Fs.entries())){if(!Qn.startsWith(`${An}-`))continue;const Cr=parseInt(Qn.split("-")[1]);if(Cr<wr)continue;const Ma=`${An}-${Cr}`;if(l3(is,{enrollmentId:Ns.id,className:Ns.className,sessionId:An,weekNumber:Cr,studentId:Ns.studentId}))continue;const ci=Ar.endDate?new Date(Ar.endDate):null;if(ci&&ci<co)continue;mr.has(Ma)||mr.set(Ma,[]);const di=mr.get(Ma);di.some(Sr=>Sr.className===Ns.className&&Sr.sessionId===An)||di.push({className:Ns.className,enrollmentId:Ns.id,sessionId:An,studentId:Ns.studentId,pendingPaymentId:o3(Vs,Ns.paymentId)})}}),console.log("ð Grouped weekly enrollments (after filtering paid weeks)",{weekCount:mr.size,weeks:Array.from(mr.keys()).sort()});const bg=Array.from(mr.keys()).sort((Ns,An)=>{const[wr,Qn]=Ns.split("-").map(Number),[Ar,Cr]=An.split("-").map(Number);return wr-Ar||Qn-Cr});for(const Ns of bg){const[An,wr]=Ns.split("-").map(Number),Qn=wr,Ar=mr.get(Ns),Cr=zs=>zs.toLowerCase().includes("chit chat")||zs.toLowerCase().includes("book club"),Ma=Ar.filter(zs=>!Cr(zs.className)),ci=Ar.filter(zs=>Cr(zs.className)),di=Ar.length,aa=Ma.length,Sr=ci.length,Od=Ar.reduce((zs,Ur)=>(zs[Ur.className]=(zs[Ur.className]||0)+1,zs),{}),Nl=Object.entries(Od).map(([zs,Ur])=>Ur>1?`${zs} (${Ur} enrollments)`:zs).sort(),wl=An,zi=wl?Fs.get(`${wl}-${Qn}`):null;console.log(`ð Week ${Qn} info lookup`,{weekNum:Qn,sessionId:wl,lookupKey:`${wl}-${Qn}`,hasWeekInfo:!!zi,weekInfo:zi});let ui,ba;zi&&zi.startDate&&zi.endDate?(ui=new Date(zi.startDate),ba=new Date(zi.endDate),(isNaN(ui.getTime())||isNaN(ba.getTime()))&&(ui=null,ba=null)):(ui=null,ba=null);const Fd=`Week ${Qn}`,bc=zs=>!zs||isNaN(zs.getTime())?"TBD":`${zs.toLocaleString("default",{month:"short"})} ${zs.getDate()}`,dp=Nl.filter(zs=>!Cr(zs)).every(zs=>zs==="Young Adult Chat"),Tm=aa===0&&Sr>0;let Nc;Tm?Nc=0:dp?Nc=Qs.yac:Nc=Qs.openEnrollment[Math.min(aa,5)];const wc=Object.keys(Od).length;let Ac;Tm?Ac=`${Sr} free class${Sr>1?"es":""} (Chit Chat Club)`:Sr>0?Ac=`${di===wc?`${aa} paid class${aa>1?"es":""}`:`${aa} paid enrollments`} + ${Sr} free class${Sr>1?"es":""} (Chit Chat Club)`:Ac=di===wc?`${di} classes`:`${di} enrollments (${wc} unique classes)`,!dt&&Q.push({serviceType:`${Fd} Classes (Session ${wl})`,description:`${Fd} (${bc(ui)}-${bc(ba)}): ${Nl.join(", ")} - ${Ac}`,rate:Nc,billingPeriod:"weekly",enrollmentBased:!0,weekNumber:Qn,weekClasses:Nl,weekDateRange:`${bc(ui)}-${bc(ba)}`,totalEnrollments:di,uniqueClasses:wc,isCompletedSession:!1,coverage:Ar.map(zs=>({enrollmentId:zs.enrollmentId,sessionId:zs.sessionId,weekNumber:Qn,studentId:zs.studentId})),pendingPaymentIds:Array.from(new Set(Ar.map(zs=>zs.pendingPaymentId).filter(zs=>Number.isInteger(zs))))})}}const bs=(v.students||[]).some(is=>{var fs;return(fs=is.studentCategories)==null?void 0:fs.includes("Ahern Academy")}),_s=(v.students||[]).some(is=>{var fs;return(fs=is.studentCategories)==null?void 0:fs.includes("Open Enrollment")});(v.students||[]).some(is=>{var fs;return(fs=is.studentCategories)==null?void 0:fs.includes("1:1 Sessions")});const Wt=(v.students||[]).some(is=>{var fs;return(fs=is.studentCategories)==null?void 0:fs.includes("Young Adult Chat")}),Yn=Us?(Us||[]).filter(is=>bs&&is.sessionType==="Summer Camp"?!1:is.sessionType==="Open Enrollment"||is.sessionType==="YAC"||is.sessionType==="Summer Camp").length:0;if(bs){const is=Qs.ahernTrimester;Q.push({serviceType:"Ahern Academy Tuition (Trimester)",description:"Ahern Academy trimester tuition (literacy + math)",rate:is,billingPeriod:"trimester"})}if(bs){const is=Qs.ahernMonthly;Q.push({serviceType:"Ahern Academy Tuition (Monthly)",description:"Ahern Academy monthly tuition (literacy + math)",rate:is,billingPeriod:"monthly"})}const bl=Q.some(is=>is.enrollmentBased);if((_s||Wt)&&Yn>0&&!bs&&!bl){const is=Qs.openEnrollment[Math.min(Yn,5)];Q.push({serviceType:`Open Enrollment (${Yn} class${Yn>1?"es":""}/week)`,description:`Open Enrollment - ${Yn} class${Yn>1?"es":""} per week`,rate:is,billingPeriod:"weekly"})}if(ja&&ja.length>0&&ja.filter(fs=>fs.familyId===v.id&&(fs.status==="pending"||fs.status==="billed"||fs.billingStatus==="pending"||fs.billingStatus==="billed")).forEac
800h(fs=>{const mr=vt.fromISO(fs.scheduledDateEtIso,{setZone:!0}).toLocaleString(),Wn=`1:1 Session - ${fs.studentName} on ${mr}`;Q.push({serviceType:`1:1 Session (Billing ID: ${fs.id})`,description:Wn,rate:parseFloat(fs.chargeAmount||fs.amount),billingPeriod:"session",sessionBillingId:fs.id,coverage:[{sessionBillingId:fs.id,studentId:fs.studentId}],isCompletedSession:!0})}),!(Vs&&Vs.length>0)){const is=Qs.registrationFee;Q.push({serviceType:"Registration Fee",description:"One-time registration fee for new families",rate:is,billingPeriod:"trimester"})}if(Vr()){const is=Qs.lateFee;Q.push({serviceType:"Late Fee",description:"Late payment fee (registering after Saturday noon deadline)",rate:is,billingPeriod:"weekly"})}return Q.push({serviceType:"Other Payment",description:"For special circumstances only â contact [email protected] if unsure",rate:0,billingPeriod:"one-time",requiresCustomInput:!0,isEmergencyOnly:!0}),console.log("ð³ CREATE PAYMENT DEBUG - Final result",{familyId:v.id,familyName:v.caregiverOneName,totalServices:Q.length,enrollmentBasedServices:Q.filter(is=>is.enrollmentBased).length,serviceTypes:Q.map(is=>is.serviceType),hasWeeklyOptions:Q.some(is=>{var fs;return(fs=is.serviceType)==null?void 0:fs.includes("Week")})}),Q},yc=v=>{en.invalidateQueries({queryKey:["/api/portal/payments"]}),en.invalidateQueries({queryKey:["/api/portal/credits"]}),en.invalidateQueries({queryKey:["/api/portal/carry-forward-credits"]}),en.invalidateQueries({queryKey:["/api/portal/enrollments"]}),en.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),Mt(!1),Ae(!1),R([]),Be(null),K(null),De(null),v&&hs({title:"Payment Receipt Available",description:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:"Your payment was successful!"}),e.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 hover:text-blue-800 underline",children:[e.jsx(_F,{className:"h-4 w-4"}),"View/Download Receipt"]})]}),duration:1e4,className:"border-l-4 border-l-green-500 bg-green-50"})},jg=()=>{en.invalidateQueries({queryKey:["/api/portal/payments"]}),en.invalidateQueries({queryKey:["/api/portal/carry-forward-credits"]}),en.invalidateQueries({queryKey:["/api/portal/enrollments"]}),en.invalidateQueries({queryKey:["/api/session-billing-with-attendance"]}),Mt(!1),Ae(!1),R([]),Be(null),K(null),De(null)},jm=()=>{K(null),De(null)},bm=async()=>{if(!qn||!un){hs({title:"Error",description:"Please select a credit and enter an amount",variant:"destructive"});return}try{const v=await st("POST","/api/portal/apply-credit",{creditId:qn,paymentAmount:un,description:Os||"Account credit applied"});v.success&&(en.invalidateQueries({queryKey:["/api/portal/payments"]}),en.invalidateQueries({queryKey:["/api/portal/credits"]}),Zt(!1),xn(null),Rt(""),vs(""),hs({title:"Success",description:v.message}))}catch(v){hs({title:"Error",description:v.message||"Failed to apply credit",variant:"destructive"})}};return Mi?e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-[#77dbf6]/10 to-white",children:[e.jsx("input",{type:"file",ref:li,accept:"image/*",className:"hidden"}),!o&&e.jsx(Gt,{}),e.jsxs("div",{className:"max-w-6xl mx-auto p-3 md:p-6",children:[(he==null?void 0:he.requiresContract)&&!(he!=null&&he.hasSignedRenewal)&&!n&&e.jsxs("div",{className:`mb-4 md:mb-6 p-4 rounded-lg shadow-sm border relative ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"bg-gradient-to-r from-blue-50 to-blue-100 border-blue-200":"bg-gradient-to-r from-red-50 to-red-100 border-red-300"}`,children:[e.jsx(F,{onClick:()=>r(!0),variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-8 w-8 p-0 text-gray-500 hover:text-gray-700",children:e.jsx(Gr,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"bg-blue-100":"bg-red-100"}`,children:e.jsx(Js,{className:`h-5 w-5 ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"text-blue-600":"text-red-600"}`})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:["2026â2027 Contract Renewal Required",(he==null?void 0:he.currentPhase)==="phase2"&&" - Action Recommended",(he==null?void 0:he.currentPhase)==="phase3"&&" - Action Required"]}),e.jsxs("p",{className:"text-gray-700 mb-3",children:[(he==null?void 0:he.currentPhase)==="phase1"&&"Your Ahern Academy students need their contract signed. This ensures continued enrollment and access to all Ahern Academy programs.",(he==null?void 0:he.currentPhase)==="phase2"&&"Please sign your contract to secure your students' enrollment. The signing process is now active and ready for your signature.",(he==null?void 0:he.currentPhase)==="phase3"&&"Contract signing is required. Portal access is limited until you complete the contract signing process.",(he==null?void 0:he.currentPhase)==="phase3_lockout"&&"Contract signing is required. Portal access is limited until you complete the contract signing process."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(F,{onClick:()=>{(he==null?void 0:he.currentPhase)==="phase1"?h("contract-renewal"):Ts(!0)},className:`${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"bg-blue-600 hover:bg-blue-700":"bg-red-600 hover:bg-red-700"} text-white`,children:(he==null?void 0:he.currentPhase)==="phase1"?"Review Contract Info":"Sign Contract Now"}),e.jsx(F,{variant:"outline",className:`${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"border-blue-300 text-blue-700 hover:bg-blue-50":"border-red-300 text-red-700 hover:bg-red-50"}`,onClick:()=>h("contract-renewal"),children:"Learn More"})]}),e.jsx("p",{className:"text-sm text-gray-600 mt-2",children:"Please complete contract signing to secure enrollment."})]})]})]}),e.jsx("div",{className:"flex items-center justify-between mb-4 md:mb-6",children:e.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[e.jsxs("div",{children:[u==="overview"&&e.jsx("img",{src:"/images/dashboardlogo.png",alt:"Dashboard",className:"w-12 h-12 md:w-16 md:h-16"}),u==="students"&&e.jsx("img",{src:"/images/studentinfo logo.png",alt:"Students",className:"w-12 h-12 md:w-16 md:h-16"}),u==="classes"&&e.jsx("img",{src:"/images/enrolllogo.png",alt:"Classes",className:"w-12 h-12 md:w-16 md:h-16"}),u==="payments"&&e.jsx("img",{src:"/images/paymentlogo.png",alt:"Payments",className:"w-12 h-12 md:w-16 md:h-16"}),u==="family"&&e.jsx("img",{src:"/images/caregiver2logo.png",alt:"Caregiver Info",className:"w-12 h-12 md:w-16 md:h-16"}
800),u==="program-info"&&e.jsx("img",{src:"/images/geekbee.png",alt:"Program Information",className:"w-12 h-12 md:w-16 md:h-16"}),u==="help"&&e.jsx("img",{src:"/images/questionbee.png",alt:"Help",className:"w-12 h-12 md:w-16 md:h-16"}),u==="resources"&&e.jsx("img",{src:"/images/resourcebee.png",alt:"Resources",className:"w-12 h-12 md:w-16 md:h-16"}),u==="contract-renewal"&&e.jsx("img",{src:"/images/geekbee.png",alt:"Contract Renewal",className:"w-12 h-12 md:w-16 md:h-16"})]}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl md:text-3xl font-bold text-[#4A4A4A]",children:"AAC Voices Portal"}),e.jsxs("p",{className:"text-sm md:text-base text-[#4A4A4A]/80",children:["Welcome back, ",(rt==null?void 0:rt.caregiverOneName)||"Caregiver"]})]})]})}),e.jsx("div",{className:"mb-4 md:mb-6 p-3 rounded-lg bg-blue-50 border border-blue-200",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-blue-600 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-blue-800",children:[e.jsx("strong",{children:"Time Zone Notice:"})," All times displayed in this portal are in Eastern Time (ET). Please"," ",e.jsx("a",{href:"https://www.timeanddate.com/worldclock/converter.html?iso=20251013T120000&p1=179",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-blue-900 font-medium",children:"convert to your local time zone"})," ","as needed."]})]})}),e.jsxs(Ql,{value:u,onValueChange:v=>{h(v);const Q=new URL(window.location.href);Q.searchParams.set("tab",v),window.history.pushState({},"",Q.toString())},className:"space-y-4 md:space-y-6",children:[e.jsxs(pl,{className:`grid w-full h-auto bg-[#77dbf6]/10 border-[#77dbf6]/20 ${he!=null&&he.requiresContract&&!(he!=null&&he.hasSignedRenewal)?(io=rt==null?void 0:rt.students)!=null&&io.some(v=>{var Q;return((Q=v.studentCategories)==null?void 0:Q.includes("1:1 Sessions"))&&v.oneOnOneApproved})?"grid-cols-9":"grid-cols-8":(vc=rt==null?void 0:rt.students)!=null&&vc.some(v=>{var Q;return((Q=v.studentCategories)==null?void 0:Q.includes("1:1 Sessions"))&&v.oneOnOneApproved})?"grid-cols-8":"grid-cols-7"}`,children:[e.jsxs(qs,{value:"overview",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Dashboard"}),e.jsx("span",{className:"sm:hidden",children:"Dash"})]}),e.jsxs(qs,{value:"students",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Profile"}),e.jsx("span",{className:"sm:hidden",children:"Profile"})]}),e.jsx(qs,{value:"classes",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:"Classes"}),e.jsxs(qs,{value:"payments",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Payments"}),e.jsx("span",{className:"sm:hidden",children:"Pay"})]}),e.jsxs(qs,{value:"resources",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Resources"}),e.jsx("span",{className:"sm:hidden",children:"Files"})]}),e.jsxs(qs,{value:"program-info",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Program Info"}),e.jsx("span",{className:"sm:hidden",children:"Programs"})]}),e.jsxs(qs,{value:"help",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-[#77dbf6] data-[state=active]:text-white text-[#4A4A4A]",children:[e.jsx("span",{className:"hidden sm:inline",children:"Help"}),e.jsx("span",{className:"sm:hidden",children:"Help"})]}),(he==null?void 0:he.requiresContract)&&!(he!=null&&he.hasSignedRenewal)&&e.jsxs(qs,{value:"contract-renewal",className:"flex items-center text-xs md:text-sm p-2 md:p-3 data-[state=active]:bg-yellow-500 data-[state=active]:text-white text-yellow-700 bg-yellow-50 border border-yellow-200",children:[e.jsx("span",{className:"hidden sm:inline",children:"Contract"}),e.jsx("span",{className:"sm:hidden",children:"Contract"})]}),((Nm=rt==null?void 0:rt.students)==null?void 0:Nm.some(v=>{var Q;return((Q=v.studentCategories)==null?void 0:Q.includes("1:1 Sessions"))&&v.oneOnOneApproved}))&&e.jsxs(qs,{value:"one-on-one",className:"flex items-center text-xs md:text-sm p-2 md:p-3",children:[e.jsx("span",{className:"hidden sm:inline",children:"1:1 Sessions"}),e.jsx("span",{className:"sm:hidden",children:"1:1"})]})]}),e.jsxs(Hs,{value:"overview",className:"space-y-4 md:space-y-8",children:[e.jsx(i3,{}),e.jsxs("div",{className:"relative overflow-hidden rounded-xl md:rounded-2xl border",style:{backgroundColor:"var(--modal-header-ice)"},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-white/20 to-white/10"}),e.jsxs("div",{className:"relative p-4 md:p-8",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 mb-3 md:mb-4",children:[e.jsx("div",{className:"p-1 md:p-2 bg-white rounded-lg md:rounded-xl shadow-sm border border-white/50",children:e.jsx("img",{src:"/images/greatheartbeeWB.png",alt:"Welcome",className:"w-10 h-10 md:w-14 md:h-14"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg md:text-2xl font-bold",style:{color:"#4A4A4A"},children:["Welcome back, ",(rt==null?void 0:rt.caregiverOneName)||"Caregiver","!"]}),e.jsx("p",{className:"text-sm md:text-base font-medium",style:{color:"#4A4A4A"},children:"Your AAC Voices Portal Dashboard"})]})]}),e.jsx("p",{className:"text-sm md:text-base max-w-2xl leading-relaxed",style:{color:"#4A4A4A"},children:"Manage your student's journey, track progress, and stay connected with the AAC Voices community. Everything you need for supporting communication development is right here."})]})]}),ks&&e.jsx("div",{className:"grid md:grid-cols-2 gap-4 md:gap-6",children:e.jsx(Ce,{className:"border-0 shadow-md bg-gradient-to-r from-green-50 to-yellow-50 border-green-200",children:e.jsx(Se,{className:"p-4 md:p-6",children:e.jsxs("div",{className:"flex items-center gap-3 md:gap-4",children:[e.jsx("div",{className:"p-1 md:p-2 bg-white rounded-lg md:rounded-xl shadow-sm border border-white/50 flex-shrink-0",children:e.jsx("img",{src:"/images/readerbee.png",alt:`${ks.name} registration`,className:"h-10 w-10 md:h-12 md:w-12 object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("h3",{className:"text-base md:text-lg font-semibold text-gray-800 mb
800-1",children:[ks.name," Registration Now Open!"]}),e.jsxs("p",{className:"text-gray-600 text-xs md:text-sm mb-2 md:mb-3",children:["Registration is available for ",yG(ks),"."]}),e.jsxs(F,{onClick:()=>{y(ks.id),m(!0)},className:"text-white font-medium text-xs md:text-sm px-3 md:px-4 py-1 md:py-2 h-auto bg-green-500 hover:bg-green-600",children:["Register Now",e.jsx("svg",{className:"ml-1 md:ml-2 h-3 w-3 md:h-4 md:w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})})})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-3 md:gap-6",children:[e.jsx(Ce,{className:"border-0 shadow-md",style:{backgroundColor:"var(--modal-header-blue)"},children:e.jsx(Se,{className:"p-3 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Students Enrolled"}),e.jsx("p",{className:"text-xl md:text-3xl font-bold",style:{color:"#4A4A4A"},children:((Uf=rt.students)==null?void 0:Uf.length)||0})]}),e.jsx("div",{className:"p-2 md:p-3 bg-white rounded-lg md:rounded-xl",children:e.jsx(ar,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})})]})})}),e.jsx(Ce,{className:"border-0 shadow-md",style:{backgroundColor:"var(--modal-header-corn)"},children:e.jsx(Se,{className:"p-3 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Account Status"}),e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mt-1",children:[e.jsx(we,{className:"bg-white border-white text-xs",style:{color:"#4A4A4A"},children:"Active"}),e.jsx(As,{className:"w-3 h-3 md:w-4 md:h-4",style:{color:"#4A4A4A"}})]})]}),e.jsx("div",{className:"p-2 md:p-3 bg-white rounded-lg md:rounded-xl",children:e.jsx(vF,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})})]})})}),e.jsx(Ce,{className:"border-0 shadow-md",style:{backgroundColor:"var(--modal-header-lav)"},children:e.jsx(Se,{className:"p-3 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Classes Available"}),e.jsx("p",{className:"text-xl md:text-3xl font-bold",style:{color:"#4A4A4A"},children:"12+"})]}),e.jsx("div",{className:"p-2 md:p-3 bg-white rounded-lg md:rounded-xl",children:e.jsx(Pn,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})})]})})}),e.jsx(Ce,{className:"border-0 shadow-md",style:{backgroundColor:"var(--modal-header-pink)"},children:e.jsx(Se,{className:"p-3 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Outstanding Balance"}),e.jsxs("p",{className:"text-lg md:text-2xl font-bold",style:{color:"#4A4A4A"},children:["$",((qf=(_d=(Td=(zf=Vs==null?void 0:Vs.filter)==null?void 0:zf.call(Vs,v=>v.status==="pending"))==null?void 0:Td.reduce)==null?void 0:_d.call(Td,(v,Q)=>v+parseFloat(Q.amount),0))==null?void 0:qf.toFixed(2))||"0.00"]})]}),e.jsx("div",{className:"p-2 md:p-3 bg-white rounded-lg md:rounded-xl",children:e.jsx(xr,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})})]})})})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"rounded-t-lg md:rounded-t-xl p-4 md:p-6",style:{backgroundColor:"var(--modal-header-lav)"},children:e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"p-1.5 md:p-2 bg-white/60 rounded-md md:rounded-lg",children:e.jsx(Jv,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:"Weekly Zoom Password"}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Access this week's class meeting password"})]})]})}),e.jsx(Se,{className:"p-4 md:p-6",children:Mf?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("p",{className:"ml-3 text-gray-600",children:"Checking access..."})]}):cn!=null&&cn.hasAccess?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(As,{className:"w-6 h-6 text-green-600"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-green-800",children:"Password Available"}),e.jsx("p",{className:"text-sm text-green-600",children:"Your family has access to this week's classes"})]})]}),e.jsx("div",{className:"bg-white rounded-lg p-4 border border-green-200",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:"This Week's Password"}),e.jsx("div",{className:"text-2xl font-mono font-bold text-blue-600 bg-blue-50 rounded-lg py-3 px-4 border-2 border-blue-200",children:cn==null?void 0:cn.password}),(cn==null?void 0:cn.theme)&&e.jsxs("p",{className:"text-sm text-gray-500",children:["Theme: ",cn==null?void 0:cn.theme]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Week starting ",new Date(cn==null?void 0:cn.weekStart).toLocaleDateString()]})]})}),e.jsx("div",{className:"bg-blue-50 rounded-lg p-4 border border-blue-200 mt-3",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:"Join Your Class on Zoom"}),e.jsxs("a",{href:"https://us02web.zoom.us/j/9068539305",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2.5 px-6 rounded-lg transition-colors",children:[e.jsx(Jv,{className:"w-4 h-4"}),"Join Zoom Meeting"]}),e.jsxs("div",{className:"text-xs text-blue-700 space-y-0.5",children:[e.jsx("p",{children:"Meeting ID: 906 853 9305"}),e.jsx("p",{children:"When Zoom asks for the passcode, enter this week's password shown above."})]})]})})]}),(cn==null?void 0:cn.showRequestButton)&&e.jsxs("div",{className:"text-center",children:[e.jsx(F,{onClick:()=>vl.mutate(),disabled:vl.isPending,variant:"outline",className:"border-blue-300 text-blue-600 hover:bg-blue-50",children:vl.isPending?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600 mr-2"}),"Sending Request..."]}):e.jsxs(e.Fragment,{children:[e.jsx(rd,{className:"w-4 h-4 mr-2"}),"Text Kate"]})}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Having trouble? Send a quick text to our administrators"})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(qx,{className:"w-6 h-6 text-yellow-600"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-yellow-800",children:"Password Access"}),e.jsx("p",{className:"text-sm text-yellow-600",children:"Weekly passwords are for enrolled families"})]})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-yellow-200",children:[e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:(cn==null?void 0:cn.message)||"The Zoom password is emailed on Sundays to families enrolled in Ahern Academy, 1:1 sessions, or class programs."}),(cn==null?void 0:cn.showRequestButton)&&e.jsxs("div",{className:"text-center",children:[e.jsx(F,{onClick:()=>vl.mutate(),disabled:vl.isPending,variant:"outline",className:"border-blue-300 text-blue-600 hover:bg-blue-50",children:vl.isPending?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600 mr-2"}),"Sending Request..."]}):e.jsxs(e.Fragment,{children:[e.jsx(rd,{className:"w-4 h-4 mr-2"}),"Text Kate"]})}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"If there was a mistake with your enrollment status, you can request the password"})]})]})]})})})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"rounded-t-lg md:rounded-t-xl p-4 md:p-6",style:{backgroundColor:"var(--modal-header-lav)"},children:e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"p-1.5 md:p-2 bg-white/60 rounded-md md:rounded-lg",children:e.jsx(Pn,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:"Book Club"}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Upcoming book selections"})]})]})}),e.jsxs(Se,{className:"p-4 md:p-6",children:[e.jsx("div",{className:"p-3 mb-4 bg-blue-50 border border-blue-200 rounded-lg",children:e.jsxs("p",{className:"text-sm text-blue-800",children:[e.jsx("strong",{children:"Chit Chat Book Club:"})," AAC users ages 13+ are welcome to join! Free to attend."]})}),e.jsx("div",{className:"flex flex-col sm:flex-row justify-center gap-4",children:e.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 max-w-sm flex-1",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("img",{src:XG,alt:"The Lemonade War book cover",className:"w-32 h-48 object-cover rounded-lg shadow-md"})}),e.jsxs("div",{className:"flex-1 text-center w-full",children:[e.jsx("h4",{className:"text-xl font-bold text-green-900 mb-2",children:"The Lemonade War"}),e.jsx("p",{className:"text-md text-green-700 mb-2",children:"by Jacqueline Davies"}),e.jsx("p",{className:"text-sm text-green-600 font-medium mb-4",children:"September Selection"}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[e.jsxs("a",{href:"https://bookshop.org/lists/chit-chat-club-booklist",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-green-600 hover:bg-green-700 text-white font-semibold py-2 px-4 roun
800ded-lg transition-colors",children:[e.jsx(Ya,{className:"w-4 h-4"}),"Bookshop"]}),e.jsxs("a",{href:"https://amzn.to/4i3K26Q",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-green-600 hover:bg-green-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors",children:[e.jsx(Ya,{className:"w-4 h-4"}),"Libro.fm"]}),e.jsxs("a",{href:"https://amzn.to/4i3K26Q",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-green-600 hover:bg-green-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors",children:[e.jsx(Ya,{className:"w-4 h-4"}),"Amazon"]})]})]})]})})})]})]}),e.jsx("div",{className:"grid gap-4 md:gap-6",children:rt.students&&rt.students.length>0?rt.students.map(v=>e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-blue-100 to-purple-100 rounded-t-lg md:rounded-t-xl p-4 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ph,{className:"w-12 h-12 md:w-16 md:h-16 border-2 md:border-4 border-white/50",children:v.photoUrl?e.jsx(Eh,{src:v.photoUrl,alt:v.name}):e.jsx(Th,{className:"bg-blue-200 text-blue-800 text-base md:text-xl font-bold",children:v.name.split(" ").map(Q=>Q[0]).join("")})}),e.jsx(F,{onClick:()=>ym(v.id),size:"sm",className:"absolute -bottom-0.5 -right-0.5 md:-bottom-1 md:-right-1 h-6 w-6 md:h-7 md:w-7 rounded-full p-0 bg-blue-200 hover:bg-blue-300 text-blue-700",disabled:ue===v.id,children:ue===v.id?e.jsx("div",{className:"animate-spin h-3 w-3 border border-blue-700 rounded-full border-t-transparent"}):e.jsx(zx,{className:"h-3 w-3 md:h-4 md:w-4"})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:v.name}),e.jsx("div",{className:"flex flex-wrap gap-1 md:gap-2 mt-1",children:v.studentCategories&&v.studentCategories.length>0?v.studentCategories.map(Q=>e.jsx(we,{className:"text-xs bg-blue-100 text-blue-700 border-blue-300",children:Q},Q)):e.jsx(we,{className:"text-xs bg-gray-100 text-gray-600 border-gray-300",children:"No Programs"})})]})]}),e.jsxs(F,{onClick:()=>{Z({name:v.name||"",nicknames:v.nicknames||"",birthday:v.birthday||"",age:v.age||0,gradeEquivalent:v.gradeEquivalent||"",streetAddress:v.streetAddress||"",city:v.city||"",state:v.state||"",country:v.country||"",postalCode:v.postalCode||"",diagnosis:v.diagnosis||"",currentAacSystems:v.currentAacSystems||"",accommodations:v.accommodations||"",studentCategories:v.studentCategories||[],openEnrollmentClasses:v.openEnrollmentClasses||1,contractSigned:v.contractSigned||!1,photoPermissionSigned:v.photoPermissionSigned||!1,specialInterests:v.specialInterests||"",calmingStrategies:v.calmingStrategies||"",upsetTriggers:v.upsetTriggers||"",alphabetAccess:v.alphabetAccess||"",yesNoMethod:v.yesNoMethod||"",aacProficiency:v.aacProficiency||"",readingSkills:v.readingSkills||"",mathSkills:v.mathSkills||"",ahernLiteracyClass:v.ahernLiteracyClass||"",ahernMathClass:v.ahernMathClass||""}),J(v.id)},variant:"outline",size:"sm",className:"text-xs md:text-sm",children:[e.jsx(Zr,{className:"h-3 w-3 md:h-4 md:w-4 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})]})}),e.jsx(Se,{className:"p-4 md:p-6",children:W===v.id?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-name-${v.id}`,children:"Full Name"}),e.jsx(je,{id:`student-name-${v.id}`,value:V.name,onChange:Q=>Z(Pe=>({...Pe,name:Q.target.value})),placeholder:"Enter student's full name"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-nicknames-${v.id}`,children:"Preferred Name/Nicknames"}),e.jsx(je,{id:`student-nicknames-${v.id}`,value:V.nicknames,onChange:Q=>Z(Pe=>({...Pe,nicknames:Q.target.value})),placeholder:"What they like to be called"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-birthday-${v.id}`,children:"Date of Birth"}),e.jsx(je,{id:`student-birthday-${v.id}`,type:"date",value:V.birthday,onChange:Q=>Z(Pe=>({...Pe,birthday:Q.target.value}))})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-age-${v.id}`,children:"Current Age"}),e.jsx(je,{id:`student-age-${v.id}`,type:"number",value:V.age,onChange:Q=>Z(Pe=>({...Pe,age:parseInt(Q.target.value)||0})),placeholder:"Age in years"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-grade-${v.id}`,children:"Grade Equivalent"}),e.jsx(je,{id:`student-grade-${v.id}`,value:V.gradeEquivalent,onChange:Q=>Z(Pe=>({...Pe,gradeEquivalent:Q.target.value})),placeholder:"e.g., 3rd grade, K-1"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-diagnosis-${v.id}`,children:"Diagnosis/Special Needs"}),e.jsx(je,{id:`student-diagnosis-${v.id}`,value:V.diagnosis,onChange:Q=>Z(Pe=>({...Pe,diagnosis:Q.target.value})),placeholder:"Primary diagnosis or special needs"})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-aac-${v.id}`,children:"Current AAC Systems"}),e.jsx(Pt,{id:`student-aac-${v.id}`,value:V.currentAacSystems,onChange:Q=>Z(Pe=>({...Pe,currentAacSystems:Q.target.value})),placeholder:"Describe AAC devices, apps, or communication methods currently used",rows:3})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-accommodations-${v.id}`,children:"Accommodations & Support Needs"}),e.jsx(Pt,{id:`student-accommodations-${v.id}`,value:V.accommodations,onChange:Q=>Z(Pe=>({...Pe,accommodations:Q.target.value})),placeholder:"Learning accommodations, therapy services, or support strategies",rows:3})]}),e.jsxs("div",{children:[e.jsx(Ne,{children:"Program Categories"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[{value:"Open Enrollment",label:"Open Enrollment"},{value:"1:1 Sessions",label:"1:1 Sessions"},{value:"Young Adult Chat",label:"Young Adult Chat"}].map(({value:Q,label:Pe})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{checked:V.studentCategories.includes(Q),onCheckedChange:qe=>{Z(qe?dt=>({...dt,studentCategories:[...dt.studentCategories,Q]}):dt=>({...dt,studentCategories:dt.studentCategories.filter(bs=>bs!==Q)}))}}),e.jsx(Ne,{className:"text-sm",children:Pe})]},Q))})]}),e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsx("h4",{className:"font-medium mb-2 text-purple-900",children:"Ahern Academy - Our Homeschool Cooperative"}),e.jsx("p",{className:"text-sm text-purple-700 mb-3",children:"Ahern Academy is our full-time homeschool program. Ap
800plication required for enrollment."}),v.ahernAcademyApproved?e.jsxs("div",{className:"flex items-center space-x-2 text-green-700",children:[e.jsx(As,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Enrolled in Ahern Academy"})]}):v.ahernAcademyApplicationSubmitted?e.jsxs("div",{className:"flex items-center space-x-2 text-blue-700",children:[e.jsx(ys,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Application Pending - Awaiting Admin Approval"})]}):e.jsxs(F,{type:"button",variant:"outline",className:"border-purple-300 text-purple-900 hover:bg-purple-100",onClick:()=>{z({isOpen:!0,studentId:v.id})},"data-testid":"button-apply-ahern-academy",children:[e.jsx(ar,{className:"h-4 w-4 mr-2"}),"Apply for Ahern Academy"]})]}),v.ahernAcademyApproved&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-4 text-blue-800",children:"Ahern Academy Information"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`ahern-literacy-${v.id}`,children:"Literacy Class Assignment"}),e.jsxs(St,{value:V.ahernLiteracyClass,onValueChange:Q=>Z(Pe=>({...Pe,ahernLiteracyClass:Q})),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select literacy class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:15 Literacy",children:"9:15 Literacy (UFLI 1-30)"}),e.jsx(ce,{value:"10:30 Literacy",children:"10:30 Literacy (UFLI 60-90)"}),e.jsx(ce,{value:"11:15 Literacy",children:"11:15 Literacy (UFLI 30-60)"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`ahern-math-${v.id}`,children:"Math Class Assignment"}),e.jsxs(St,{value:V.ahernMathClass,onValueChange:Q=>Z(Pe=>({...Pe,ahernMathClass:Q})),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select math class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:50 Math",children:"9:50 Math"}),e.jsx(ce,{value:"11:45 Math",children:"11:45 Math"}),e.jsx(ce,{value:"12:15 Math",children:"12:15 Math"})]})]})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`special-interests-${v.id}`,children:"Special Interests"}),e.jsx(Pt,{id:`special-interests-${v.id}`,value:V.specialInterests,onChange:Q=>Z(Pe=>({...Pe,specialInterests:Q.target.value})),placeholder:"Things that motivate and engage the student",rows:2})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`calming-strategies-${v.id}`,children:"Calming Strategies"}),e.jsx(Pt,{id:`calming-strategies-${v.id}`,value:V.calmingStrategies,onChange:Q=>Z(Pe=>({...Pe,calmingStrategies:Q.target.value})),placeholder:"Effective ways to help student self-regulate",rows:2})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`upset-triggers-${v.id}`,children:"Known Triggers"}),e.jsx(Pt,{id:`upset-triggers-${v.id}`,value:V.upsetTriggers,onChange:Q=>Z(Pe=>({...Pe,upsetTriggers:Q.target.value})),placeholder:"Things that typically cause distress",rows:2})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`alphabet-access-${v.id}`,children:"Alphabet Access"}),e.jsx(Pt,{id:`alphabet-access-${v.id}`,value:V.alphabetAccess,onChange:Q=>Z(Pe=>({...Pe,alphabetAccess:Q.target.value})),placeholder:"How student accesses letters/spelling",rows:2})]})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-3 md:gap-4 mt-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`yes-no-method-${v.id}`,children:"Yes/No Method"}),e.jsx(je,{id:`yes-no-method-${v.id}`,value:V.yesNoMethod,onChange:Q=>Z(Pe=>({...Pe,yesNoMethod:Q.target.value})),placeholder:"How they indicate yes/no"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`aac-proficiency-${v.id}`,children:"AAC Proficiency"}),e.jsx(je,{id:`aac-proficiency-${v.id}`,value:V.aacProficiency,onChange:Q=>Z(Pe=>({...Pe,aacProficiency:Q.target.value})),placeholder:"Current AAC skill level"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`reading-skills-${v.id}`,children:"Reading Skills"}),e.jsx(je,{id:`reading-skills-${v.id}`,value:V.readingSkills,onChange:Q=>Z(Pe=>({...Pe,readingSkills:Q.target.value})),placeholder:"Current reading level"})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx(Ne,{htmlFor:`math-skills-${v.id}`,children:"Math Skills"}),e.jsx(je,{id:`math-skills-${v.id}`,value:V.mathSkills,onChange:Q=>Z(Pe=>({...Pe,mathSkills:Q.target.value})),placeholder:"Current math abilities and level"})]})]})}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsxs(F,{onClick:gc,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(Cx,{className:"h-4 w-4 mr-2"}),"Save Changes"]}),e.jsx(F,{onClick:()=>J(null),variant:"outline",children:"Cancel"})]})]}):e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 roun
800ded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(an,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Age & Grade"}),e.jsx("p",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:(()=>{const Q=v.birthday?K1(v.birthday):v.age,Pe=v.gradeEquivalent||(Q?H1(Q):null);return`${Q||"Not provided"} years old${Pe?` ⢠${Pe}`:""}`})()})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(uh,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Location"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:[v.city,v.state].filter(Boolean).join(", ")||"Not specified"})]})]})]}),e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 roun
800ded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(m7,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Primary Diagnosis"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:v.diagnosis||"Not specified"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(Ir,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Communication"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:v.currentAacSystems||"Not specified"})]})]})]})]}),v.accommodations&&e.jsxs("div",{className:"p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"#f0f9ff",border:"1px solid #bae6fd"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Ms,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#0284c7"}}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#0284c7"},children:"Support & Accommodations"})]}),e.jsx("p",{className:"text-sm md:text-base",style:{color:"#075985"},children:v.accommodations})]}),v.studentCategories&&v.studentCategories.includes("Ahern Academy")&&e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-3 text-blue-800",children:"Ahern Academy Information"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-sm text-blue-600 mb-1",children:"Literacy Class"}),e.jsx("p",{className:"font-medium text-blue-800",children:v.ahernLiteracyClass||"Not assigned"})]}),e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-sm text-blue-600 mb-1",children:"Math Class"}),e.jsx("p",{className:"font-medium text-blue-800",children:v.ahernMathClass||"Not assigned"})]})]}),(v.specialInterests||v.calmingStrategies||v.upsetTriggers)&&e.jsxs("div",{className:"grid md:grid-cols-3 gap-3 mb-4",children:[v.specialInterests&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Special Interests"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.specialInterests})]}),v.calmingStrategies&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Calming Strategies"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.calmingStrategies})]}),v.upsetTriggers&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Known Triggers"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.upsetTriggers})]})]}),(v.alphabetAccess||v.yesNoMethod||v.aacProficiency||v.readingSkills||v.mathSkills)&&e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[v.alphabetAccess&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Alphabet Access"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.alphabetAccess})]}),v.yesNoMethod&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Yes/No Method"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.yesNoMethod})]}),v.aacProficiency&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"AAC Proficiency"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.aacProficiency})]}),v.readingSkills&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Reading Skills"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.readingSkills})]}),v.mathSkills&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Math Skills"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.mathSkills})]})]})]})]})})]},v.id)):e.jsx(Ce,{children:e.jsx(Se,{className:"p-8 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"p-4 bg-blue-50 rounded-full",children:e.jsx(ar,{className:"w-8 h-8",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2",style:{color:"#4A4A4A"},children:"No students are currently registered under your caregiver account."}),e.jsx("p",{className:"text-sm mb-4",style:{color:"#4A4A4A"},children:"Get started by creating your first student profile."})]}),e.jsxs(F,{"data-add-student":!0,onClick:()=>
800{Z({name:"",nicknames:"",birthday:"",age:0,gradeEquivalent:"",streetAddress:"",city:"",state:"",country:"",postalCode:"",diagnosis:"",currentAacSystems:"",accommodations:"",studentCategories:[],openEnrollmentClasses:1,contractSigned:!1,photoPermissionSigned:!1,specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",readingSkills:"",mathSkills:"",ahernLiteracyClass:"",ahernMathClass:""}),J(-1)},className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-2",children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Create First Student Profile"]})]})})})}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-4 md:gap-8",children:[e.jsxs(Ce,{className:"lg:col-span-2 shadow-lg border-0",children:[e.jsx(Ve,{className:"rounded-t-lg md:rounded-t-xl p-4 md:p-6",style:{backgroundColor:"var(--modal-header-blue)"},children:e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"p-1.5 md:p-2 bg-white/60 rounded-md md:rounded-lg",children:e.jsx(Ms,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:"Caregiver Profile"}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Your contact information and account details"})]})]})}),e.jsx(Se,{className:"p-4 md:p-6",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 roun
800ded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(Ms,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Primary Contact"}),e.jsx("p",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:rt.caregiverOneName})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(ir,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Email Address"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:rt.caregiverOneEmail})]})]})]}),e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(E0,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Phone Number"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:rt.caregiverOnePhone||"Not provided"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 p-3 md:p-4 roun
800ded-lg md:rounded-xl",style:{backgroundColor:"#f8f9fa"},children:[e.jsx(uh,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:"Location"}),e.jsx("p",{className:"font-medium text-sm md:text-base",style:{color:"#4A4A4A"},children:rt.address?"Address on file":"Update address"})]})]})]})]})})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"rounded-t-lg md:rounded-t-xl p-4 md:p-6",style:{backgroundColor:"var(--modal-header-corn)"},children:e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"p-1.5 md:p-2 bg-white/60 rounded-md md:rounded-lg",children:e.jsx(Or,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-bold",style:{color:"#4A4A4A"},children:"Payment Overview"}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Account balance and history"})]})]})}),e.jsxs(Se,{className:"p-4 md:p-6 space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"text-center p-4 md:p-6 rounded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-ice)"},children:[e.jsx("div",{className:"flex items-center justify-center mb-2 md:mb-3",children:e.jsx("div",{className:"p-2 md:p-3 bg-white/60 rounded-full",children:e.jsx(xf,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})})}),e.jsx("p",{className:"text-xs md:text-sm mb-1",style:{color:"#4A4A4A"},children:"Total Payments Made"}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",style:{color:"#4A4A4A"},children:((Bf=(Wf=Vs==null?void 0:Vs.filter)==null?void 0:Wf.call(Vs,v=>v.status==="paid"))==null?void 0:Bf.length)||0}),e.jsx("p",{className:"text-xs",style:{color:"#4A4A4A"},children:"This year"})]}),((Hf=(Kf=Vs==null?void 0:Vs.filter)==null?void 0:Kf.call(Vs,v=>v.status==="pending"))==null?void 0:Hf.length)>
8000&&e.jsxs("div",{className:"p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-corn)",border:"1px solid #bfddff"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 md:mb-2",children:[e.jsx(xr,{className:"w-3 h-3 md:w-4 md:h-4",style:{color:"#4A4A4A"}}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:"Pending Payments"})]}),e.jsxs("p",{className:"text-xs",style:{color:"#4A4A4A"},children:["You have ",(Gf=(wm=Vs==null?void 0:Vs.filter)==null?void 0:wm.call(Vs,v=>v.status==="pending"))==null?void 0:Gf.length," pending payment(s)"]})]})]})]})]})]}),e.jsxs(Hs,{value:"students",className:"space-y-4 md:space-y-8",children:[e.jsx("div",{className:"grid gap-4 md:gap-6",children:rt.students&&rt.students.length>0?rt.students.map(v=>{var Q,Pe;return e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-blue-100 to-purple-100 rounded-t-lg md:rounded-t-xl p-4 md:p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ue,{className:"flex items-center gap-2 md:gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ph,{className:"w-12 h-12 md:w-16 md:h-16 border-2 md:border-4 border-white/50",children:v.photoUrl?e.jsx(Eh,{src:v.photoUrl,alt:v.name}):e.jsx(Th,{className:"bg-blue-200 text-blue-800 text-base md:text-xl font-bold",children:v.name.split(" ").map(qe=>qe[0]).join("")})}),e.jsx(F,{onClick:()=>ym(v.id),size:"sm",className:"absolute -bottom-0.5 -right-0.5 md:-bottom-1 md:-right-1 h-6 w-6 md:h-7 md:w-7 rounded-full p-0 bg-blue-200 hover:bg-blue-300 text-blue-700",disabled:ue===v.id,children:ue===v.id?e.jsx("div",{className:"animate-spin h-3 w-3 border border-blue-700 rounded-full border-t-transparent"}):e.jsx(zx,{className:"h-3 w-3 md:h-4 md:w-4"})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:v.name}),e.jsx("div",{className:"flex flex-wrap gap-1 md:gap-2 mt-1",children:v.studentCategories&&v.studentCategories.length>0?v.studentCategories.map(qe=>e.jsx(we,{className:"text-xs bg-blue-100 text-blue-700 border-blue-300",children:qe},qe)):e.jsx(we,{className:"text-xs bg-gray-100 text-gray-600 border-gray-300",children:"No Programs"})})]})]}),e.jsxs(F,{onClick:()=>{Z({name:v.name||"",nicknames:v.nicknames||"",birthday:v.birthday||"",age:v.age||0,gradeEquivalent:v.gradeEquivalent||"",streetAddress:v.streetAddress||"",city:v.city||"",state:v.state||"",country:v.country||"",postalCode:v.postalCode||"",diagnosis:v.diagnosis||"",currentAacSystems:v.currentAacSystems||"",accommodations:v.accommodations||"",studentCategories:v.studentCategories||[],openEnrollmentClasses:v.openEnrollmentClasses||1,contractSigned:v.contractSigned||!1,photoPermissionSigned:v.photoPermissionSigned||!1,specialInterests:v.specialInterests||"",calmingStrategies:v.calmingStrategies||"",upsetTriggers:v.upsetTriggers||"",alphabetAccess:v.alphabetAccess||"",yesNoMethod:v.yesNoMethod||"",aacProficiency:v.aacProficiency||"",readingSkills:v.readingSkills||"",mathSkills:v.mathSkills||"",ahernLiteracyClass:v.ahernLiteracyClass||"",ahernMathClass:v.ahernMathClass||""}),J(v.id)},variant:"outline",size:"sm",className:"text-xs md:text-sm",children:[e.jsx(Zr,{className:"h-3 w-3 md:h-4 md:w-4 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})]})}),e.jsx(Se,{className:"p-4 md:p-6",children:W===v.id?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-name-${v.id}`,children:"Full Name"}),e.jsx(je,{id:`student-name-${v.id}`,value:V.name,onChange:qe=>Z(dt=>({...dt,name:qe.target.value})),placeholder:"Enter student's full name"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-nicknames-${v.id}`,children:"Preferred Name/Nicknames"}),e.jsx(je,{id:`student-nicknames-${v.id}`,value:V.nicknames,onChange:qe=>Z(dt=>({...dt,nicknames:qe.target.value})),placeholder:"What they like to be called"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-birthday-${v.id}`,children:"Date of Birth"}),e.jsx(je,{id:`student-birthday-${v.id}`,type:"date",value:V.birthday,onChange:qe=>Z(dt=>({...dt,birthday:qe.target.value}))})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-age-${v.id}`,children:"Current Age"}),e.jsx(je,{id:`student-age-${v.id}`,type:"number",value:V.age,onChange:qe=>Z(dt=>({...dt,age:parseInt(qe.target.value)||0})),placeholder:"Age in years"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-grade-${v.id}`,children:"Grade Equivalent"}),e.jsx(je,{id:`student-grade-${v.id}`,value:V.gradeEquivalent,onChange:qe=>Z(dt=>({...dt,gradeEquivalent:qe.target.value})),placeholder:"e.g., 3rd grade, K-1"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-diagnosis-${v.id}`,children:"Diagnosis/Special Needs"}),e.jsx(je,{id:`student-diagnosis-${v.id}`,value:V.diagnosis,onChange:qe=>Z(dt=>({...dt,diagnosis:qe.target.value})),placeholder:"Primary diagnosis or special needs"})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-aac-${v.id}`,children:"Current AAC Systems"}),e.jsx(Pt,{id:`student-aac-${v.id}`,value:V.currentAacSystems,onChange:qe=>Z(dt=>({...dt,currentAacSystems:qe.target.value})),placeholder:"Describe AAC devices, apps, or communication methods currently used",rows:3})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`student-accommodations-${v.id}`,children:"Accommodations & Support Needs"}),e.jsx(Pt,{id:`student-accommodations-${v.id}`,value:V.accommodations,onChange:qe=>Z(dt=>({...dt,accommodations:qe.target.value})),placeholder:"Learning accommodations, therapy services, or support strategies",rows:3})]}),e.jsxs("div",{children:[e.jsx(Ne,{children:"Program Categories"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[{value:"Open Enrollment",label:"Open Enrollment"},{value:"1:1 Sessions",label:"1:1 Sessions"},{value:"Young Adult Chat",label:"Young Adult Chat"}].map(({value:qe,label:dt})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{checked:V.studentCategories.includes(qe),onCheckedChange:bs=>{Z(bs?_s=>({..._s,studentCategories:[..._s.studentCategories,qe]}):_s=>({..._s,studentCategories:_s.studentCategories.filter(Wt=>Wt!==qe)}))}}),e.jsx(Ne,{className:"text-sm",children:dt})]},qe))})]}),e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsx("h4",{className:"font-medium mb-2 text-purple-900",children:"Ahern Academy - Our Homeschool Cooperative"}),e.jsx("p",{className:"text-sm text-purple-700 mb-3",children:"Ahern Academy is our full-time homeschool program. Ap
800plication required for enrollment."}),v.ahernAcademyApproved?e.jsxs("div",{className:"flex items-center space-x-2 text-green-700",children:[e.jsx(As,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Enrolled in Ahern Academy"})]}):v.ahernAcademyApplicationSubmitted?e.jsxs("div",{className:"flex items-center space-x-2 text-blue-700",children:[e.jsx(ys,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Application Pending - Awaiting Admin Approval"})]}):e.jsxs(F,{type:"button",variant:"outline",className:"border-purple-300 text-purple-900 hover:bg-purple-100",onClick:()=>{z({isOpen:!0,studentId:v.id})},"data-testid":"button-apply-ahern-academy",children:[e.jsx(ar,{className:"h-4 w-4 mr-2"}),"Apply for Ahern Academy"]})]}),v.ahernAcademyApproved&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-4 text-blue-800",children:"Ahern Academy Information"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`ahern-literacy-${v.id}`,children:"Literacy Class Assignment"}),e.jsxs(St,{value:V.ahernLiteracyClass,onValueChange:qe=>Z(dt=>({...dt,ahernLiteracyClass:qe})),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select literacy class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:15 Literacy",children:"9:15 Literacy (UFLI 1-30)"}),e.jsx(ce,{value:"10:30 Literacy",children:"10:30 Literacy (UFLI 60-90)"}),e.jsx(ce,{value:"11:15 Literacy",children:"11:15 Literacy (UFLI 30-60)"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`ahern-math-${v.id}`,children:"Math Class Assignment"}),e.jsxs(St,{value:V.ahernMathClass,onValueChange:qe=>Z(dt=>({...dt,ahernMathClass:qe})),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select math class"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"9:50 Math",children:"9:50 Math"}),e.jsx(ce,{value:"11:45 Math",children:"11:45 Math"}),e.jsx(ce,{value:"12:15 Math",children:"12:15 Math"})]})]})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`special-interests-${v.id}`,children:"Special Interests"}),e.jsx(je,{id:`special-interests-${v.id}`,value:V.specialInterests,onChange:qe=>Z(dt=>({...dt,specialInterests:qe.target.value})),placeholder:"What motivates your student?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`calming-strategies-${v.id}`,children:"Calming Strategies"}),e.jsx(je,{id:`calming-strategies-${v.id}`,value:V.calmingStrategies,onChange:qe=>Z(dt=>({...dt,calmingStrategies:qe.target.value})),placeholder:"What helps when upset?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`upset-triggers-${v.id}`,children:"Upset Triggers"}),e.jsx(je,{id:`upset-triggers-${v.id}`,value:V.upsetTriggers,onChange:qe=>Z(dt=>({...dt,upsetTriggers:qe.target.value})),placeholder:"What causes distress?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`alphabet-access-${v.id}`,children:"Alphabet Access"}),e.jsx(je,{id:`alphabet-access-${v.id}`,value:V.alphabetAccess,onChange:qe=>Z(dt=>({...dt,alphabetAccess:qe.target.value})),placeholder:"How do they access letters?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`yes-no-method-${v.id}`,children:"Yes/No Method"}),e.jsx(je,{id:`yes-no-method-${v.id}`,value:V.yesNoMethod,onChange:qe=>Z(dt=>({...dt,yesNoMethod:qe.target.value})),placeholder:"How do they indicate yes/no?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`aac-proficiency-${v.id}`,children:"AAC Proficiency"}),e.jsx(je,{id:`aac-proficiency-${v.id}`,value:V.aacProficiency,onChange:qe=>Z(dt=>({...dt,aacProficiency:qe.target.value})),placeholder:"Current AAC skill level"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`reading-skills-${v.id}`,children:"Reading Skills"}),e.jsx(je,{id:`reading-skills-${v.id}`,value:V.readingSkills,onChange:qe=>Z(dt=>({...dt,readingSkills:qe.target.value})),placeholder:"Current reading level"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:`math-skills-${v.id}`,children:"Math Skills"}),e.jsx(je,{id:`math-skills-${v.id}`,value:V.mathSkills,onChange:qe=>Z(dt=>({...dt,mathSkills:qe.target.value})),placeholder:"Current math level"})]})]})]})}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsxs(F,{onClick:gc,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[e.jsx(Cx,{className:"h-4 w-4 mr-2"}),"Save Changes"]}),e.jsx(F,{onClick:()=>J(null),variant:"outline",children:"Cancel"})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(an,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:["Age: ",To(v).age]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:["Grade: ",To(v).grade]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:["Diagnosis: ",v.diagnosis||"Not provided"]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ir,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:["AAC: ",v.currentAacSystems?"Configured":"Not specified"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ms,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:["Support: ",v.accommodations?"Documented":"Not specified"]})]})]})]}),((Q=v.studentCategories)==null?void 0:Q.includes("Ahern Academy"))&&e.jsxs("div",{className:"p-3 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-2 text-blue-800",children:"Ahern Academy Class Assignments"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Literacy Class"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.ahernLiteracyClass||"Not assigned"})]}),e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Math Class"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.ahernMathClass||"Not assigned"})]})]})]}),((Pe=v.studentCategories)==null?void 0:Pe.includes("Ahern Academy"))&&e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[v.specialInterests&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Special Interests"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.specialInterests})]}),v.calmingStrategies&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Calming Strategies"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.calmingStrategies})]}),v.aacProficiency&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"AAC Proficiency"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.aacProficiency})]}),v.readingSkills&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Reading Skills"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.readingSkills})]}),v.mathSkills&&e.jsxs("div",{className:"p-3 bg-white rounded-lg",children:[e.jsx("p",{className:"text-xs text-blue-600 mb-1",children:"Math Skills"}),e.jsx("p",{className:"text-sm text-blue-800",children:v.mathSkills})]})]})]})})]},v.id)}):e.jsx(Ce,{children:e.jsx(Se,{className:"p-8 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"p-4 bg-blue-50 rounded-full",children:e.jsx(ar,{className:"w-8 h-8",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2",style:{color:"#4A4A4A"},children:"No students are currently registered under your caregiver account."}),e.jsx("p",{className:"text-sm mb-4",style:{color:"#4A4A4A"},children:"Get started by creating your first student profile."})]}),e.jsxs(F,{"data-add-student":!0,onClick:()=>
800{Z({name:"",nicknames:"",birthday:"",age:0,gradeEquivalent:"",streetAddress:"",city:"",state:"",country:"",postalCode:"",diagnosis:"",currentAacSystems:"",accommodations:"",studentCategories:[],openEnrollmentClasses:1,contractSigned:!1,photoPermissionSigned:!1,specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",readingSkills:"",mathSkills:"",ahernLiteracyClass:"",ahernMathClass:""}),J(-1)},className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-2",children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Create First Student Profile"]})]})})})}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0 p-4 md:p-6",children:[e.jsx(Ue,{className:"text-lg md:text-xl",style:{color:"#4A4A4A"},children:"Caregiver Information"}),e.jsx(F,{onClick:N?xm:kd,variant:N?"default":"outline",className:"w-full sm:w-auto text-sm md:text-base",children:N?e.jsxs(e.Fragment,{children:[e.jsx(Cx,{className:"h-3 w-3 md:h-4 md:w-4 mr-1 md:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Save Changes"}),e.jsx("span",{className:"sm:hidden",children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Zr,{className:"h-3 w-3 md:h-4 md:w-4 mr-1 md:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit Information"}),e.jsx("span",{className:"sm:hidden",children:"Edit"})]})})]}),e.jsx(Se,{className:"p-4 md:p-6",children:N?e.jsxs("div",{className:"grid md:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver1Name",children:"Primary Caregiver Name"}),e.jsx(je,{id:"caregiver1Name",value:ne.caregiverOneName||"",onChange:v=>le({...ne,caregiverOneName:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver1Email",children:"Primary Caregiver Email"}),e.jsx(je,{id:"caregiver1Email",type:"email",value:ne.caregiverOneEmail||"",onChange:v=>le({...ne,caregiverOneEmail:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver1Phone",children:"Primary Caregiver Phone"}),e.jsx(je,{id:"caregiver1Phone",value:ne.caregiverOnePhone||"",onChange:v=>le({...ne,caregiverOnePhone:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"address",children:"Address"}),e.jsx(Pt,{id:"address",value:ne.address||"",onChange:v=>le({...ne,address:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"timeZone",children:"Time Zone"}),e.jsxs(St,{value:ne.timeZone,onValueChange:v=>le({...ne,timeZone:v}),children:[e.jsx(At,{id:"timeZone",children:e.jsx(kt,{placeholder:"Select time zone"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"UTC-12",children:"UTC-12 (Baker Island)"}),e.jsx(ce,{value:"UTC-11",children:"UTC-11 (American Samoa)"}),e.jsx(ce,{value:"UTC-10",children:"UTC-10 (Hawaii)"}),e.jsx(ce,{value:"UTC-9",children:"UTC-9 (Alaska)"}),e.jsx(ce,{value:"UTC-8",children:"UTC-8 (Pacific - US/Canada)"}),e.jsx(ce,{value:"UTC-7",children:"UTC-7 (Mountain - US/Canada)"}),e.jsx(ce,{value:"UTC-6",children:"UTC-6 (Central - US/Canada)"}),e.jsx(ce,{value:"UTC-5",children:"UTC-5 (Eastern - US/Canada)"}),e.jsx(ce,{value:"UTC-4",children:"UTC-4 (Atlantic - Canada)"}),e.jsx(ce,{value:"UTC-3",children:"UTC-3 (Argentina, Brazil)"}),e.jsx(ce,{value:"UTC-2",children:"UTC-2 (Mid-Atlantic)"}),e.jsx(ce,{value:"UTC-1",children:"UTC-1 (Azores)"}),e.jsx(ce,{value:"UTC+0",children:"UTC+0 (London, Dublin)"}),e.jsx(ce,{value:"UTC+1",children:"UTC+1 (Paris, Berlin, Rome)"}),e.jsx(ce,{value:"UTC+2",children:"UTC+2 (Cairo, Athens, Helsinki)"}),e.jsx(ce,{value:"UTC+3",children:"UTC+3 (Moscow, Baghdad)"}),e.jsx(ce,{value:"UTC+4",children:"UTC+4 (Dubai, Baku)"}),e.jsx(ce,{value:"UTC+5",children:"UTC+5 (Karachi, Tashkent)"}),e.jsx(ce,{value:"UTC+5:30",children:"UTC+5:30 (India, Sri Lanka)"}),e.jsx(ce,{value:"UTC+6",children:"UTC+6 (Dhaka, Almaty)"}),e.jsx(ce,{value:"UTC+7",children:"UTC+7 (Bangkok, Jakarta)"}),e.jsx(ce,{value:"UTC+8",children:"UTC+8 (Beijing, Singapore)"}),e.jsx(ce,{value:"UTC+9",children:"UTC+9 (Tokyo, Seoul)"}),e.jsx(ce,{value:"UTC+9:30",children:"UTC+9:30 (Adelaide)"}),e.jsx(ce,{value:"UTC+10",children:"UTC+10 (Sydney, Melbourne)"}),e.jsx(ce,{value:"UTC+11",children:"UTC+11 (Solomon Islands)"}),e.jsx(ce,{value:"UTC+12",children:"UTC+12 (Fiji, Auckland)"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"paymentPreference",children:"Payment Preference"}),e.jsxs(St,{value:ne.paymentPreference,onValueChange:v=>le({...ne,paymentPreference:v}),children:[e.jsx(At,{id:"paymentPreference",children:e.jsx(kt,{placeholder:"Select payment preference"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"monthly",children:"Monthly"}),e.jsx(ce,{value:"trimester",children:"Trimester"}),e.jsx(ce,{value:"session",children:"Per Session"}),e.jsx(ce,{value:"weekly",children:"Weekly"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"paymentMethod",children:"Payment Method"}),e.jsxs(St,{value:ne.paymentMethod,onValueChange:v=>le({...ne,paymentMethod:v}),children:[e.jsx(At,{id:"paymentMethod",children:e.jsx(kt,{placeholder:"Select payment method"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"family_pays",children:"Family Pays"}),e.jsx(ce,{value:"third_party",children:"Third Party Pays"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"thirdPartyPayerName",children:"Third Party Payer Name"}),e.jsx(je,{id:"thirdPartyPayerName",value:ne.thirdPartyPayerName||"",onChange:v=>le({...ne,thirdPartyPayerName:v.target.value}),placeholder:"e.g., Insurance Company, School District"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"scholarshipPercentage",children:"Scholarship Percentage"}),e.jsx(je,{id:"scholarshipPercentage",type:"number",min:"0",max:"100",value:ne.scholarshipPercentage||"",onChange:v=>le({...ne,scholarshipPercentage:parseInt(v.target.value)||0}),placeholder:"0-100"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"scholarshipInfo",children:"Scholarship Information"}),e.jsx(Pt,{id:"scholarshipInfo",value:ne.scholarshipInfo||"",onChange:v=>le({...ne,scholarshipInfo:v.target.value}),placeholder:"Additional scholarship details"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",style:{color:"#4A4A4A"},children:"Secondary Caregivers"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h5",{className:"font-medium",style:{color:"#4A4A4A"},children:"Caregiver 2"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver2Name",children:"Name"}),e.jsx(je,{id:"caregiver2Name",value:ne.caregiverTwoName||"",onChange:v=>le({...ne,caregiverTwoName:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver2Email",children:"Email"}),e.jsx(je,{id:"caregiver2Email",type:"email",value:ne.caregiverTwoEmail||"",onChange:v=>le({...ne,caregiverTwoEmail:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver2Phone",children:"Phone"}),e.jsx(je,{id:"caregiver2Phone",value:ne.caregiverTwoPhone||"",onChange:v=>le({...ne,caregiverTwoPhone:v.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h5",{className:"font-medium",style:{color:"#4A4A4A"},children:"Caregiver 3"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver3Name",children:"Name"}),e.jsx(je,{id:"caregiver3Name",value:ne.caregiverThreeName||"",onChange:v=>le({...ne,caregiverThreeName:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver3Email",children:"Email"}),e.jsx(je,{id:"caregiver3Email",type:"email",value:ne.caregiverThreeEmail||"",onChange:v=>le({...ne,caregiverThreeEmail:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"caregiver3Phone",children:"Phone"}),e.jsx(je,{id:"caregiver3Phone",value:ne.caregiverThreePhone||"",onChange:v=>le({...ne,caregiverThreePhone:v.target.value})})]})]})]})]})]})]}):e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-3 md:p-4 roun
800ded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-blue)",border:"1px solid var(--modal-header-ice)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ti,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsx("h4",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:"Primary Caregiver"})]}),e.jsxs("div",{className:"space-y-2 text-xs md:text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Name:"}),e.jsx("p",{children:rt.caregiverOneName||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Email:"}),e.jsx("p",{children:rt.caregiverOneEmail||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Phone:"}),e.jsx("p",{children:rt.caregiverOnePhone||"Not provided"})]})]})]}),e.jsxs("div",{className:"p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-corn)",border:"1px solid var(--modal-header-lav)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(uh,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsx("h4",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:"Contact & Location"})]}),e.jsxs("div",{className:"space-y-2 text-xs md:text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Address:"}),e.jsx("p",{children:rt.address||"Not provided"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Time Zone:"}),e.jsx("p",{children:rt.timeZone||"Not set"})]})]})]}
800),e.jsxs("div",{className:"p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-lav)",border:"1px solid var(--modal-header-pink)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Or,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsx("h4",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:"Payment Information"})]}),e.jsxs("div",{className:"space-y-2 text-xs md:text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Payment Preference:"}),e.jsx("p",{children:rt.paymentPreference||"Not set"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Payment Method:"}),e.jsx("p",{children:rt.paymentMethod==="family_pays"?"Family Pays":rt.paymentMethod==="third_party"?"Third Party Pays":"Not set"})]}),rt.thirdPartyPayerName&&e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Third Party Payer:"}),e.jsx("p",{children:rt.thirdPartyPayerName})]}),rt.scholarshipPercentage>0&&e.jsx("div",{children:e.jsxs("p",{className:"text-xs md:text-sm",style:{color:"#4A4A4A"},children:["Scholarship: ",rt.scholarshipPercentage,"% discount applied"]})}),rt.scholarshipInfo&&e.jsx("div",{children:e.jsx("p",{className:"text-xs",style:{color:"#4A4A4A"},children:rt.scholarshipInfo})})]})]}),rt.students&&rt.students.length>
8000&&e.jsxs("div",{className:"p-3 md:p-4 rounded-lg md:rounded-xl",style:{backgroundColor:"var(--modal-header-ice)",border:"1px solid var(--modal-header-blue)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ms,{className:"w-4 h-4 md:w-5 md:h-5",style:{color:"#4A4A4A"}}),e.jsx("h4",{className:"font-semibold text-sm md:text-base",style:{color:"#4A4A4A"},children:"Student Status"})]}),e.jsx("div",{className:"grid md:grid-cols-1 gap-2",children:rt.students.map(v=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.5)"},children:[e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:v.name}),e.jsx(we,{className:`text-xs ${v.archived?"bg-gray-100 text-gray-600 border-gray-300":"bg-green-100 text-green-700 border-green-300"}`,children:v.archived?"Archived":"Active"})]},v.id))})]})]})})]})]}),e.jsxs(Hs,{value:"classes",className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"text-center mb-4 md:mb-6",children:[e.jsx("div",{className:"flex items-center justify-center gap-3 mb-3",children:e.jsx("img",{src:"/images/enrolllogo.png",alt:"AAC Voices Class Enrollment",className:"h-12 w-auto md:h-16"})}),e.jsx("h2",{className:"text-xl md:text-2xl font-bold tracking-tight",style:{color:"#4A4A4A"},children:"Class Enrollment"}),e.jsx("p",{className:"mt-1 md:mt-2 text-sm md:text-base",style:{color:"#4A4A4A"},children:"Register your student for AAC Voices classes"})]}),E&&((Zf=rt==null?void 0:rt.students)==null?void 0:Zf.some(v=>{var Q;return(Q=v.studentCategories)==null?void 0:Q.includes("Ahern Academy")}))&&e.jsx(Ce,{className:"bg-blue-50 border-blue-200",children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(As,{className:"h-5 w-5 text-blue-600 mt-0.5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-blue-900 mb-2",children:"Ahern Academy Students - Important Notice"}),e.jsxs("div",{className:"text-blue-800 space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Your Ahern Academy students are automatically enrolled in their literacy and math classes."}),"No further action is needed for these core classes."]}),e.jsxs("p",{children:["However, please enroll in any afternoon classes you plan to attend.",e.jsx("strong",{children:"These afternoon classes are included in your Ahern Academy tuition at no additional cost."})]})]})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>P(!1),className:"text-blue-600 hover:text-blue-800 hover:bg-blue-100 p-1","aria-label":"Close notice",children:e.jsx(Gr,{className:"h-4 w-4"})})})]})})}),!Of&&Us&&Us.length>0&&e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"rounded-t-lg md:rounded-t-xl p-4 md:p-6 cursor-pointer select-none",style:{backgroundColor:"var(--modal-header-ice)"},onClick:()=>w(v=>!v),children:e.jsxs(Ue,{className:"flex items-center justify-between gap-2 md:gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"p-1.5 md:p-2 bg-white/60 rounded-md md:rounded-lg",children:e.jsx(an,{className:"w-4 h-4 md:w-6 md:h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg md:text-xl font-bold",style:{color:"#4A4A4A"},children:["Current Class Enrollments",e.jsxs("span",{className:"ml-2 text-sm font-normal",style:{color:"#6B7280"},children:["(",Us.length,")"]})]}),e.jsx("p",{className:"text-xs md:text-sm font-medium",style:{color:"#4A4A4A"},children:b?"Click to view enrolled classes and selected weeks":"Your student's enrolled classes and selected weeks"})]})]}),e.jsx("div",{className:"p-1 rounded-md bg-white/60",children:b?e.jsx(ac,{className:"w-5 h-5",style:{color:"#4A4A4A"}}):e.jsx(pf,{className:"w-5 h-5",style:{color:"#4A4A4A"}})})]})}),!b&&e.jsx(Se,{className:"p-4 md:p-6",children:e.jsx("div",{className:"space-y-4",children:Us.map(v=>e.jsxs("div",{className:"border rounded-lg p-4",style:{backgroundColor:"#f8f9fa"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-lg",style:{color:"#4A4A4A"},children:v.className}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:v.sessionName}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(ys,{className:"w-4 h-4",style:{color:"#4A4A4A"}}),e.jsxs("span",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:[v.timeSlot," ⢠",v.days]})]}),v.description&&e.jsx("p",{className:"text-sm mt-2 leading-snug",style:{color:"#6B7280"},children:v.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"bg-green-100 text-green-800 border-green-200",children:v.status==="enrolled"?"Enrolled":"Active"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(F,{size:"sm",variant:"outline",onClick:()=>Xt(v),className:"h-7 px-2 text-xs",style:{borderColor:"#77dbf6",color:"#4A4A4A"},children:e.jsx(Zr,{className:"w-3 h-3"})}),e.jsx(F,{size:"sm",variant:"outline",onClick:()=>En(v),className:"h-7 px-2 text-xs border-red-300 text-red-600 hover:bg-red-50",children:e.jsx(Gr,{className:"w-3 h-3"})})]})]})]}),v.enrolledWeeks&&v.enrolledWeeks.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",style:{color:"#4A4A4A"},children:"Selected Weeks:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.enrolledWeeks.map(Q=>e.jsxs(we,{variant:"outline",className:"text-xs",children:["Week ",Q]},Q))})]}),e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-200",children:e.jsxs("p",{className:"text-sm",style:{color:"#4A4A4A"},children:[e.jsx("span",{className:"font-medium",children:"Student:"})," ",v.studentName]})})]},v.id))})})]}),e.jsx(eZ,{familyData:rt,setActiveTab:h,setShowPaymentCreator:Ae,setShowEnrollmentWizard:m})]}),e.jsxs(Hs,{value:"payments",className:"space-y-4 md:space-y-6",children:[e.jsx(i3,{mode:"manage"}),((Qf=(Yf=a.error)==null?void 0:Yf.response)==null?void 0:Qf.status)===503&&e.jsx(Ce,{className:"border-orange-200 bg-orange-50",children:e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:e.jsx(Or,{className:"h-6 w-6 text-orange-600"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-orange-900 mb-2",children:"Payment System Temporarily Unavailable"}),e.jsx("p",{className:"text-orange-800 mb-3",children:"The online payment system is temporarily disabled for maintenance to ensure data accuracy and customer protection."}),e.jsxs("div",{className:"flex items-center gap-2 text-orange-700",children:[e.jsx(ir,{className:"h-4 w-4"}),e.jsxs("span",{className:"text-sm",children:["For payment assistance, please contact: ",e.jsx("strong",{children:"[email protected]"})]})]})]})]})})}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0 p-4 md:p-6",children:[e.jsx(Ue,{className:"text-lg md:text-xl",style:{color:"#4A4A4A"},children:"Create Payment"}),e.jsx(F,{onClick:()=>Ae(!G),variant:G?"outline":"default",className:"w-full sm:w-auto text-sm md:text-base",children:G?e.jsxs(e.Fragment,{children:[e.jsx(Gr,{className:"h-3 w-3 md:h-4 md:w-4 mr-1 md:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Cancel"}),e.jsx("span",{className:"sm:hidden",children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"h-4 w-4 mr-2"}),"Create Payment"]})})]}),G&&e.jsxs(Se,{className:"space-y-4",children:[(()=>{const v=rt,Q=(v==null?void 0:v.paymentMethod)==="third-party"||(v==null?void 0:v.thirdPartyPayerName),Pe=(v==null?void 0:v.scholarshipPercentage)===100,qe=((v==null?void 0:v.students)||[]).some(Wt=>{var Yn;return(Yn=Wt.studentCategories)==null?void 0:Yn.includes("Ahern Academy")}),dt=Us&&(Us||[]).filter(Wt=>!Wt.ended).length>0,bs=ja&&ja.filter(Wt=>Wt.familyId===(v==null?void 0:v.id)&&(Wt.status==="pending"||Wt.status==="billed"||Wt.billingStatus==="pending"||Wt.billingStatus==="billed")).length>0;if(!(dt||bs||Q||Pe||qe)){const Wt=((v==null?void 0:v.students)||[]).filter(tn=>!tn.archived),Yn=Wt.length===1?Wt[0]:null,bl=ri||(Yn==null?void 0:Yn.id)||null;return e.jsxs("div",{className:"p-5 rounded-xl border-2 space-y-4",style:{backgroundColor:"var(--modal-header-ice)",borderColor:"#77dbf6"},children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-lg mb-1",style:{color:"#4A4A4A"},children:"Which class would you like to pay for?"}),e.jsx("p",{className:"text-sm text-gray-600",children:"We don't see an active sign-up for this trimester. Pick a class below and we'll get you registered right away."})]}),Wt.length>1&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"For which student?"}),e.jsxs(St,{value:(ri==null?void 0:ri.toString())||"",onValueChange:tn=>gl(parseInt(tn)),children:[e.jsx(At,{className:"mt-1",children:e.jsx(kt,{placeholder:"Select student"})}),e.jsx(Ct,{children:Wt.map(tn=>e.jsx(ce,{value:tn.id.toString(),children:tn.name},tn.id))})]})]}),ks&&e.jsxs("p",{className:"text-sm font-medium text-gray-700",children:["Registering for ",ks.name]}),Cd?e.jsx("p",{className:"text-sm text-gray-500 py-2",children:"Loading enrollment sessions..."}):Li?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-red-600",children:"We couldn't load enrollment sessions."}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>Vi(),children:"Try Again"})]}):ks?hc||pc?e.jsx("p",{className:"text-sm text-gray-500 py-2",children:"Loading available classes..."}):Ui||vg?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-red-600",children:"We couldn't load the available classes."}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>{yg(),Lf()},children:"Try Again"})]}):to.filter(tn=>tn.isActive!==!1).length>0?e.jsx("div",{className:"space-y-3",children:to.filter(tn=>tn.isActive!==!1).map(tn=>{var fs,mr;const jc=tn.timeSlot==="yac"||((fs=tn.className)==null?void 0:fs.toLowerCase().includes("young adult"))?(Qs==null?void 0:Qs.yac)||40:((mr=Qs==null?void 0:Qs.openEnrollment)==null?void 0:mr[1])||40,is=(ur==null?void 0:ur.id)===tn.id;return e.jsxs("div",{className:"rounded-xl border-2 overflow-hidden transition-all cursor-pointer",style:{borderColor:is?"#77dbf6":"#e5e7eb",backgroundColor:"white"},onClick:()=>ni(is?null:tn),children:[e.jsxs("div",{className:"p-4 flex items-center justify-between",style:{backgroundColor:is?"var(--modal-header-blue)":"var(--modal-header-corn)"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",style:{color:"#4A4A4A"},children:tn.className}),e.jsxs("p",{className:"text-sm text-gray-500",children:[tn.days,tn.timeSlot&&tn.timeSlot!=="yac"?` ⢠${tn.timeSlot.toUpperCase()} EST`:""]})]}),e.jsxs("p",{className:"text-sm font-medium text-gray-600",children:["$",jc,"/week"]})]}),is&&e.jsxs("div",{className:"p-4 border-t",style:{borderColor:"#77dbf6"},children:[e.jsx("p",{className:"text-sm font-medium mb-3",style:{color:"#4A4A4A"},children:"How long would you like to sign up for?"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:[{value:"week",label:"1 Week"},{value:"month",label:"1 Month"},{value:"trimester",label:"Rest of Trimester"}].map(Wn=>e.jsx("button",{onClick:co=>{co.stopPropagation(),Ri(Wn.value)},className:"px-4 py-2 rounded-lg text-sm font-medium border transition-all",style:{backgroundColor:Fi===Wn.value?"#77dbf6":"white",borderColor:Fi===Wn.value?"#77dbf6":"#d1d5db",color:"#4A4A4A"},children:Wn.label},Wn.value))}),Fi==="week"&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Choose a week"}),e.jsxs(St,{value:(ai==null?void 0:ai.toString())||"",onValueChange:Wn=>ii(parseInt(Wn)),children:[e.jsx(At,{className:"mt-1",children:e.jsx(kt,{placeholder:"Select an available week"})}),e.jsx(Ct,{children:so.map(Wn=>e.jsxs(ce,{value:Wn.weekNumber.toString(),children:["Week ",Wn.weekNumber,": ",new Date(`${Wn.startDate}T12:00:00`).toLocaleDateString(),"â",new Date(`${Wn.endDate}T12:00:00`).toLocaleDateString()]},Wn.weekNumber))})]})]})]})]},tn.id)})}):e.jsx("p",{className:"text-sm text-gray-600 py-2",children:"No active classes are available for this session."}):e.jsx("p",{className:"text-sm text-gray-600 py-2",children:"No current or upcoming enrollment session is available."}),ur&&e.jsx(F,{onClick:()=>{bl&&fm.mutate({slotId:ur.id,studentId:bl,enrollmentPeriod:Fi,enrolledWeeks:hm(),source:"payment-quick-enroll",notes:""})},disabled:fm.isPending||!bl||hm().length===0,className:"w-full font-semibold py-3",style:{backgroundColor:"#77dbf6",color:"#4A4A4A"},children:fm.isPending?"Signing up...":`Sign Up for ${ur.className} & Continue to Payment`}),e.jsx("p",{className:"text-xs text-gray-500",children:"Need help or a different arrangement? Contact [email protected]"})]})}return null})(),(()=>{const v=rt,Q=(v==null?void 0:v.paymentMethod)==="third-party"||(v==null?void 0:v.thirdPartyPayerName),Pe=(v==null?void 0:v.scholarshipPercentage)===100,qe=((v==null?void 0:v.students)||[]).some(Wt=>{var Yn;return(Yn=Wt.studentCategories)==null?void 0:Yn.includes("Ahern Academy")}),dt=Us&&(Us||[]).filter(Wt=>!Wt.ended).length>0,bs=ja&&ja.filter(Wt=>Wt.familyId===(v==null?void 0:v.id)&&(Wt.status==="pending"||Wt.status==="billed"||Wt.billingStatus==="pending"||Wt.billingStatus==="billed")).length>0;return dt||bs||Q||Pe||qe?!0:null})()&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-4 bg-green-50 rounded-lg border border-green-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-green-100 rounded-lg mt-0.5",children:e.jsx(xr,{className:"h-5 w-5 text-green-600"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-green-900 mb-2",children:"How to Create a Payment"}),e.jsxs("div",{className:"space-y-2 text-sm text-green-800",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"1. Select all services you're paying for:"})," Check the boxes next to ALL sessions, classes, or groups you want to pay for in this payment."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"2. Review the total:"})," Make sure the total amount matches what you intend to pay."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"3. Click the payment button:"})," Complete your payment through the secure payment form."]})]})]})]})}),((Id=rt==null?void 0:rt.students)==null?void 0:Id.some(v=>{var Q;return(Q=v.studentCategories)==null?void 0:Q.includes("Ahern Academy")}))&&e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h4",{className:"font-medium mb-3 text-blue-800",children:"Payment Month Selection"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"paymentMonth",className:"text-sm text-blue-700",children:"Select payment month for Ahern Academy tuition:"}),e.jsxs(St,{value:ct,onValueChange:It,children:[e.jsx(At,{className:"w-full",children:e.jsx(kt,{placeholder:"Select payment month"})}),e.jsx(Ct,{children:Array.from({length:15},(v,Q)=>{const Pe=new Date;Pe.setMonth(Pe.getMonth()-3+Q);const qe=`${Pe.getFullYear()}
800-${String(Pe.getMonth()+1).padStart(2,"0")}`,dt=Pe.toLocaleDateString("en-US",{year:"numeric",month:"long"});return e.jsx(ce,{value:qe,children:dt},qe)})})]}),e.jsx("p",{className:"text-xs text-blue-600",children:"This allows late payments to be properly categorized for the selected billing month."})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium mb-3",style:{color:"#4A4A4A"},children:"Select Services"}),e.jsx("div",{className:"space-y-3",children:xg?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-center text-gray-500",children:"Loading current rates..."})}):va?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-center text-red-500",children:"Failed to load rates. Please try again."})}):vm().map(v=>e.jsxs("div",{className:"space-y-3",children:[v.isEmergencyOnly&&e.jsx("div",{className:"mt-4 pt-4 border-t border-dashed border-gray-300",children:e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(rl,{className:"h-4 w-4 text-amber-500"}),e.jsx("span",{className:"text-xs font-medium text-amber-600 uppercase tracking-wide",children:"Special Circumstances Only"})]})}),e.jsxs("div",{className:`flex items-center justify-between p-4 border rounded-xl ${v.enrollmentBased?"border-aac-blue bg-gradient-to-r from-blue-50 to-cyan-50 shadow-lg":v.isEmergencyOnly?"border-amber-200 bg-amber-50/50 opacity-75":"border-gray-200 hover:border-gray-300"} transition-all duration-200`,children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(Gs,{checked:Me.some(Q=>Q.serviceType===v.serviceType),onCheckedChange:Q=>Pd(v,Q)}),e.jsxs("div",{children:[v.enrollmentBased&&!v.isCompletedSession&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(we,{className:"bg-aac-blue text-white text-xs px-2 py-1 rounded-full",children:"Recent Enrollment"}),e.jsx(xr,{className:"w-4 h-4 text-aac-blue"})]}),e.jsx("p",{className:"font-semibold text-base mb-1",style:{color:"#4A4A4A"},children:v.description}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#6B7280"},children:v.serviceType==="Other Payment"&&Le[v.serviceType]?`${tr(Le[v.serviceType])} / ${v.billingPeriod}`:`${tr(v.rate)} / ${v.billingPeriod}`})]})]}),e.jsx("div",{className:"text-right",children:e.jsx("p",{className:`text-2xl font-bold ${v.enrollmentBased?"text-aac-blue":""}`,style:{color:v.enrollmentBased?"#77dbf6":"#4A4A4A"},children:v.serviceType==="Other Payment"&&Le[v.serviceType]?tr(Le[v.serviceType]):tr(v.rate)})})]}),v.serviceType==="Other Payment"&&Me.some(Q=>Q.serviceType==="Other Payment")&&e.jsxs("div",{className:"ml-8 p-3 bg-gray-50 rounded-lg space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2 text-red-600",children:"*Payment Amount (Required):"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm",style:{color:"#4A4A4A"},children:"$"}),e.jsx("input",{type:"number",min:"1",step:"0.01",placeholder:"0.00",value:Le[v.serviceType]||"",onChange:Q=>{const Pe=parseFloat(Q.target.value)||0;Ed(v.serviceType,Pe)},className:"flex-1 px-3 py-2 border rounded-md text-sm",style:{borderColor:"#d1d5db"},required:!0})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2 text-red-600",children:"*What is this payment for? (Required):"}),e.jsx("input",{type:"text",placeholder:"e.g., Registration fee, Class payment, Late fee, etc.",value:D[v.serviceType]||"",onChange:Q=>{Vf(v.serviceType,Q.target.value)},className:"w-full px-3 py-2 border rounded-md text-sm",style:{borderColor:"#d1d5db"},required:!0}),e.jsx("p",{className:"text-xs mt-1",style:{color:"#6B7280"},children:"Help us categorize your payment correctly for billing records"})]})]})]},v.serviceType))})]}),Te&&e.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg space-y-3",children:[e.jsx("h5",{className:"font-medium",style:{color:"#4A4A4A"},children:"Payment Summary"}),!ih(Te.services).valid&&e.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:ih(Te.services).message}),e.jsx("div",{className:"space-y-2",children:Te.services.map((v,Q)=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{style:{color:"#4A4A4A"},children:v.description}),e.jsx("span",{style:{color:"#4A4A4A"},children:tr(v.rate)})]},Q))}),e.jsxs("div",{className:"border-t pt-2",children:[e.jsxs("div",{className:"flex justify-between font-semibold",children:[e.jsx("span",{style:{color:"#4A4A4A"},children:"Total Amount:"}),e.jsx("span",{className:"text-lg",style:{color:"#4A4A4A"},children:tr(Te.total)})]}),e.jsxs("p",{className:"text-sm mt-1",style:{color:"#4A4A4A"},children:["Due Date: ",xc(Te.dueDate.toISOString())]})]}),e.jsxs(F,{onClick:async()=>{var qe,dt;const v=ih(Te.services);if(!v.valid){hs({title:"Pay Services Separately",description:v.message,variant:"destructive"});return}if(((dt=(qe=a.error)==null?void 0:qe.response)==null?void 0:dt.status)===503){hs({title:"Payment System Unavailable",description:"The payment system is temporarily disabled for maintenance. Please contact [email protected] for payment assistance.",variant:"destructive"});return}if(Me.some(bs=>bs.serviceType==="Other Payment")){const bs=Le["Other Payment"]&&Le["Other Payment"]>0,_s=D["Other Payment"]&&D["Other Payment"].trim().length>0;if(!bs||!_s){hs({title:"Missing Information",description:"Please enter both an amount and description for the Other Payment option.",variant:"destructive"});return}const Wt=(D["Other Payment"]||"").toLowerCase();if(["yac","young adult","chat","class","enrollment","enroll","tuition","trimester","session","writing","history","reading","science","art"].some(tn=>Wt.includes(tn))&&!(Us&&Us.length>0)){hs({title:"Enrollment Required",description:"To pay for classes, please enroll first using the Classes tab.",variant:"destructive"}),setTimeout(()=>{h("classes");const oo=new URL(window.location.href);oo.searchParams.set("tab","classes"),window.history.pushState({},"",oo.toString())},2e3);return}}const Pe=await Ix({amount:Te.total,coverage:Te.coverage,pendingPaymentIds:Te.pendingPaymentIds,sessionBillingIds:Te.
800sessionBillingIds});if(!$||xe!==Pe){const bs=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`checkout-${Date.now()}-${Math.random().toString(36).slice(2,12)}`;K(bs),De(Pe)}Mt(!0)},className:"w-full mt-4",disabled:((Jf=(Xf=a.error)==null?void 0:Xf.response)==null?void 0:Jf.status)===503||!ih(Te.services).valid,children:[e.jsx(Or,{className:"h-4 w-4 mr-2"}),((Am=(ep=a.error)==null?void 0:ep.response)==null?void 0:Am.status)===503?"Payment System Unavailable":`Pay ${tr(Te.total)}`]})]})]})]})]}),e.jsxs(Ce,{className:((br==null?void 0:br.totalAvailable)||0)>0?"border-blue-300 bg-blue-50/30":"",children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(Ue,{style:{color:"#4A4A4A"},children:"Cancellation Carry-Forward Credit"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:"Available credit from cancelled weeks is automatically applied during checkout."})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-2xl font-bold text-blue-700",children:um?"Unavailable":mc?"â":tr((br==null?void 0:br.totalAvailable)||0)}),e.jsx("p",{className:"text-xs text-blue-600",children:um?"Could not load balance":"Available Balance"})]})]})}),e.jsx(Se,{children:um?e.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800",role:"alert",children:["We could not load your cancellation carry-forward credits. Please try again before checking out.",mm instanceof Error&&mm.message&&e.jsx("span",{className:"mt-1 block text-xs",children:mm.message})]}):mc?e.jsx("p",{className:"text-sm text-gray-500",children:"Loading carry-forward creditsâ¦"}):(tp=br==null?void 0:br.credits)!=null&&tp.length?e.jsx("div",{className:"space-y-3",children:br.credits.map(v=>e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg border border-blue-200 bg-white p-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-blue-900",children:v.studentName}),e.jsxs("p",{className:"text-sm text-blue-700",children:["Cancelled week starting ",xc(v.sourceWeekStart)]}),Number(v.reservedAmount)>0&&e.jsxs("p",{className:"mt-1 text-xs text-gray-600",children:[tr(Number(v.reservedAmount))," reserved for a checkout in progress"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-lg font-semibold text-blue-900",children:tr(Number(v.availableAmount))}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Originally ",tr(Number(v.originalAmount))]})]})]},v.id))}):e.jsx("p",{className:"text-sm text-gray-500",children:"No cancellation carry-forward credit is available."})})]}),e.jsxs(Ce,{className:Array.isArray(ra)&&ra.length>0?"border-green-300 bg-green-50/30":"",children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ue,{style:{color:"#4A4A4A"},children:"Account Credit Balance"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:Array.isArray(ra)&&ra.length>0?"Available credits from previous overpayments":"No available credits at this time"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-2xl font-bold text-green-700",children:tr(Array.isArray(ra)?ra.reduce((v,Q)=>v+parseFloat(Q.amount),0):0)}),e.jsx("p",{className:"text-xs text-green-600",children:"Available Balance"})]})]})}),Array.isArray(ra)&&ra.length>0&&e.jsx(Se,{children:e.jsx("div",{className:"space-y-4",children:ra.map(v=>e.jsxs("div",{className:"flex items-center justify-between p-4 border border-green-200 rounded-lg bg-white",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-green-800",children:v.description}),e.jsxs("p",{className:"text-sm text-green-600",children:["Created: ",xc(v.paidDate)]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-lg font-semibold text-green-800",children:tr(v.amount)}),e.jsx(we,{variant:"outline",className:"text-xs bg-green-100 text-green-700",children:"Available Credit"})]}),e.jsx(F,{onClick:()=>{xn(v.id),Rt(v.amount),Zt(!0)},size:"sm",variant:"outline",className:"text-green-700 border-green-300 hover:bg-green-100",children:"Apply Credit"})]})]},v.id))})})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{style:{color:"#4A4A4A"},children:"Payment History"})}),e.jsx(Se,{children:e.jsx("div",{className:"space-y-4",children:Vs&&Vs.filter(v=>
800v.status!=="cancelled").length>0?Vs.filter(v=>v.status!=="cancelled").map(v=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg border-gray-200",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",style:{color:"#4A4A4A"},children:v.description}),e.jsxs("p",{className:"text-sm",style:{color:"#4A4A4A"},children:["Due: ",xc(v.dueDate)]}),v.paidDate&&e.jsxs("p",{className:"text-sm",style:{color:"#4A4A4A"},children:["Paid: ",xc(v.paidDate)]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-lg font-semibold",style:{color:"#4A4A4A"},children:tr(v.amount)}),(()=>{const Q=v.status==="paid"||v.paidDate?"paid":v.status==="overdue"&&!v.paidDate?"overdue":"pending",Pe=zu(Q);return e.jsx(we,{variant:Pe.variant,className:Pe.className,children:Pe.text})})()]})]},v.id)):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"mb-4",style:{color:"#4A4A4A"},children:"No payment records found"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:'Use the "Create Payment" button above to generate payment records for your enrolled services.'})]})})})]})]}),e.jsxs(Hs,{value:"program-info",className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"text-center mb-4 md:mb-6",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold tracking-tight",style:{color:"#4A4A4A"},children:"Program Information"}),e.jsx("p",{className:"mt-1 md:mt-2 text-sm md:text-base",style:{color:"#4A4A4A"},children:"Understand our educational offerings"})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-blue-100 to-purple-100 rounded-t-xl",children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(Pn,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsx("div",{children:e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Ahern Academy"})})]})}),e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"mb-4",style:{color:"#4A4A4A"},children:"Ahern Academy morning classes with UFLI Literacy and Math curriculum, followed by afternoon open enrollment classes"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h4",{className:"font-semibold mb-3 text-lg",style:{color:"#4A4A4A"},children:"Morning Schedule (Spring 2026):"}),e.jsxs("div",{className:"grid gap-2 text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"9:15am - Literacy (UFLI Lessons 1-30)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"9:50am - Math"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"10:30am - Literacy (UFLI Lessons 60-90)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"11:15am - Literacy (UFLI Lessons 30-60)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"11:45am - Math"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"12:15pm - Math"})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-lg",style:{color:"#4A4A4A"},children:"Program Details:"}),e.jsxs("ul",{className:"space-y-2 text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Structured homeschool cooperative program"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"UFLI foundational literacy curriculum"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Zearn or Daily Life Math programs"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Small class sizes with individualized support"})]})]})]})]})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-green-100 to-emerald-100 rounded-t-xl",children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(an,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Spring 2026 Trimester"}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"January 5 - April 11, 2026"})]})]})}),e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"mb-4",style:{color:"#4A4A4A"},children:"13 week trimester with Medieval Times theme and one week mid-trimester break offering Full Time Ahern Academy Homeschool Cooperative, Open Enrollment Afternoon Classes M, Tu, Th and F with History elective, and Young Adult Chat Social Groups M-Th"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h4",{className:"font-semibold mb-3 text-lg",style:{color:"#4A4A4A"},children:"Program Options:"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Pn,{className:"w-5 h-5 text-blue-600"}),e.jsx("h5",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Ahern Academy Full Time"})]}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"}
800,children:"Comprehensive homeschool cooperative program"})]}),e.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ys,{className:"w-5 h-5 text-green-600"}),e.jsx("h5",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Open Enrollment Classes"})]}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:"Afternoon classes Monday, Tuesday, Thursday, and Friday"})]}),e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Ms,{className:"w-5 h-5 text-purple-600"}),e.jsx("h5",{className:"font-semibold",style:{color:"#4A4A4A"},children:"Young Adult Chat"})]}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:"Social groups Monday through Thursday"})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-lg",style:{color:"#4A4A4A"},children:"Key Features:"}),e.jsxs("ul",{className:"space-y-2 text-sm",style:{color:"#4A4A4A"},children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Flexible program combinations"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Age-appropriate social groups"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"Mid-trimester break for rest and planning"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(As,{className:"w-4 h-4 mt-0.5 text-green-600"}),e.jsx("span",{children:"FERPA-compliant educational records"})]})]})]})]})]}),e.jsxs(Ce,{className:"shadow-lg border-0",children:[e.jsx(Ve,{className:"bg-gradient-to-r from-gray-100 to-gray-200 rounded-t-xl",children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(ir,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Questions About Our Programs?"}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"We're here to help!"})]})]})}),e.jsx(Se,{className:"p-6",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-blue-50 rounded-lg",children:[e.jsx(ir,{className:"w-5 h-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-sm",style:{color:"#4A4A4A"},children:"Email Kate"}),e.jsx("p",{className:"text-sm text-blue-600",children:"[email protected]"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-green-50 rounded-lg",children:[e.jsx(rd,{className:"w-5 h-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-sm",style:{color:"#4A4A4A"},children:"Text Message"}),e.jsx("p",{className:"text-sm text-green-600",children:"(978) 420-4902"})]})]})]})})]})]}),e.jsx(Hs,{value:"help",className:"space-y-4 md:space-y-8",children:e.jsx(iE,{isAuthenticated:!0})}),e.jsxs(Hs,{value:"resources",className:"space-y-4 md:space-y-6",children:[no.length>0&&e.jsxs(Ce,{className:"bg-gradient-to-r from-[#77dbf6]/5 to-[#feea6a]/5 border-[#77dbf6]/30",children:[e.jsx(Ve,{className:"pb-3",children:e.jsxs(Ue,{className:"text-lg font-semibold flex items-center gap-2",style:{color:"#4A4A4A"},children:[e.jsx("div",{className:"p-1.5 bg-[#77dbf6]/20 rounded-lg",children:e.jsx(Js,{className:"w-4 h-4 text-[#77dbf6]"})}),"Recently Added"]})}),e.jsx(Se,{className:"pt-0",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:no.map(v=>e.jsxs("div",{className:"relative bg-white border border-[#77dbf6]/20 rounded-lg p-4 hover:shadow-md transition-all duration-200 hover:border-[#77dbf6]/40",children:[ro(v)&&e.jsx("div",{className:"absolute -top-2 -right-2 bg-gradient-to-r from-[#feea6a] to-[#77dbf6] text-white text-xs font-bold px-2 py-1 rounded-full shadow-sm",children:"NEW"}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-[#77dbf6]/10 rounded-lg flex-shrink-0",children:v.type==="link"?e.jsx(Ya,{className:"w-4 h-4 text-[#77dbf6]"}):e.jsx(Js,{className:"w-4 h-4 text-[#77dbf6]"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-medium text-sm text-[#4A4A4A] truncate",children:v.original_name||v.name||v.filename||"Untitled Resource"}),e.jsx("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2",children:v.description||"No description available"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:Sd(v).map(Q=>e.jsx(we,{variant:"secondary",className:"text-xs bg-[#77dbf6]/15 text-[#4A4A4A] border border-[#77dbf6]/30 px-1.5 py-0.5",children:Q},Q))}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx("span",{className:"text-xs text-gray-500",children:new Date(v.uploadDate||v.upload_date).toLocaleDateString()}),e.jsx(F,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs text-[#77dbf6] hover:bg-[#77dbf6]/10",onClick:()=>{v.type,window.open(v.url||v.file_path,"_blank")},children:v.type==="link"?"Visit":"View"})]})]})]})]},v.id))})})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0 p-4 md:p-6",children:[e.jsx(Ue,{className:"text-lg md:text-xl",style:{color:"#4A4A4A"},children:"All Resources"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"text-sm text-gray-600",children:[(Nr==null?void 0:Nr.length)||0," resource",(Nr==null?void 0:Nr.length)!==1?"s":""," available",H||U!=="all"||se!=="all"?` (${(Lr==null?void 0:Lr.length)||0} total)`:""]})})]}),e.jsxs(Se,{className:"p-4 md:p-6",children:[e.jsx("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg border",children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(je,{placeholder:"Search resources by name, description, or tags...",value:H,onChange:v=>T(v.target.value),className:"w-full"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(St,{value:U,onValueChange:_,children:[e.jsx(At,{className:"w-[180px]",children:e.jsx(kt,{placeholder:"Filter by tag"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Tags"}),Array.from(new Set(Lr==null?void 0:Lr.flatMap(v=>v.tags||[]))).map(v=>e.jsxs(ce,{value:v,children:["#",v]},v))]})]}),e.jsxs(St,{value:se,onValueChange:ae,children:[e.jsx(At,{className:"w-[180px]",children:e.jsx(kt,{placeholder:"Filter by level"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"all",children:"All Levels"}),Array.from(new Set(Lr==null?void 0:Lr.flatMap(v=>v.accessLevels||[]))).map(v=>e.jsx(ce,{value:v,children:v},v))]})]})]})]})}),Rf?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#77dbf6]"})}):Nr&&Nr.length>0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:Nr.map(v=>e.jsxs(Ce,{className:"bg-white hover:shadow-xl transition-all duration-300 transform hover:scale-[1.02] border-2 border-[#77dbf6]/20 hover:border-[#77dbf6]/40 shadow-lg rounded-xl overflow-hidden",children:[e.jsx(Ve,{className:"pb-2 sm:pb-3 bg-gradient-to-r from-[#77dbf6]/10 to-[#feea6a]/10 border-b border-[#77dbf6]/20 p-3 sm:p-4",children:e.jsx("div",{className:"flex items-start justify-between gap-2 sm:gap-3",children:e.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-3 min-w-0 flex-1",children:[e.jsx("div",{className:"p-1.5 sm:p-2 bg-white rounded-lg shadow-sm border border-[#77dbf6]/30 flex-shrink-0",children:v.type==="link"?e.jsx(Ya,{className:"w-4 h-4 sm:w-5 sm:h-5 text-[#77dbf6]"}):e.jsx(Js,{className:"w-4 h-4 sm:w-5 sm:h-5 text-[#77dbf6]"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-semibold text-[#4A4A4A] truncate text-sm sm:text-base leading-tight",children:v.name||v.filename}),e.jsx("p",{className:"text-xs sm:text-sm text-[#4A4A4A]/70 truncate mt-0.5",children:v.type==="link"?"External Link":"File"})]})]})})}),e.jsxs(Se,{className:"space-y-3 sm:space-y-4 p-3 sm:p-6",children:[v.description&&e.jsx("p",{className:"text-xs sm:text-sm text-[#4A4A4A]/80 leading-relaxed line-clamp-2",children:v.description}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(qe=>{const dt=qe.accessLevels||qe.access_levels||qe.accessLevel;if(!dt)return[];const bs={all:"All Families","ahern-academy":"Ahern Academy","open-enrollment":"Open Enrollment",yac:"Young Adult Chat","1:1":"1:1 Sessions","1:1 Sessions":"1:1 Sessions","Ahern Academy":"Ahern Academy","Open Enrollment":"Open Enrollment","Young Adult Chat":"Young Adult Chat","All Families":"All Families",admin:"Admin Only"};if(Array.isArray(dt))return dt.map(_s=>bs[_s]||_s);try{const _s=JSON.parse(dt);if(Array.isArray(_s))return _s.map(Wt=>bs[Wt]||Wt)}catch{}return[bs[dt]||dt]})(v).map(qe=>e.jsx(we,{variant:"secondary",className:"text-xs bg-[#77dbf6]/20 text-[#4A4A4A] border border-[#77dbf6]/40 px-2 py-0.5",children:qe},qe))}),v.tags&&v.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 sm:gap-2",children:[v.tags.slice(0,3).map((Q,Pe)=>e.jsxs(we,{variant:"secondary",className:"text-xs bg-[#feea6a]/20 text-[#4A4A4A] border border-[#feea6a]/40 hover:bg-[#feea6a]/30 transition-colors px-2 py-0.5",children:["#",Q]},Pe)),v.tags.length>3&&e.jsxs(we,{variant:"secondary",className:"text-xs bg-[#77dbf6]/20 text-[#4A4A4A] border border-[#77dbf6]/40 px-2 py-0.5",children:["+",v.tags.length-3]})]}),e.jsx("div",{className:"flex space-x-2 pt-2",children:v.type==="link"?e.jsxs(F,{size:"sm",className:"bg-[#77dbf6] hover:bg-[#5bd3f4] text-[#4A4A4A] font-semibold transition-all duration-200 transform hover:scale-105 shadow-lg flex-1 sm:flex-none",onClick:()=>window.open(v.url||v.file_path,"_blank"),children:[e.jsx(Ya,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"text-xs sm:text-sm",children:"Open"})]}):e.jsxs(F,{size:"sm",className:"bg-[#feea6a] hover:bg-[#eab308] text-[#4A4A4A] font-semibold transition-all duration-200 transform hover:scale-105 shadow-lg flex-1 sm:flex-none",onClick:()=>{const Q=v.url||v.file_path,Pe=document.createElement("a");Pe.href=Q,Pe.download=v.original_name||v.name,document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe)},children:[e.jsx(Xr,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"text-xs sm:text-sm",children:"Download"})]})})]})]},v.id))}):Lr&&Lr.length>0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-gray-500",children:"No resources match your search criteria."}),e.jsx("button",{onClick:()=>{T(""),_("all"),ae("all")},className:"mt-2 text-[#77dbf6] hover:underline",children:"Clear filters"})]}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:e.jsx("p",{children:"No resources available for your enrolled programs."})})]})]})]}),e.jsx(Hs,{value:"contract-renewal",className:"space-y-4 md:space-y-6",children:e.jsxs("div",{className:"bg-white rounded-lg border shadow-sm",children:[e.jsx("div",{className:"border-b p-4 md:p-6 bg-gradient-to-r from-blue-50 to-blue-100",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm border border-blue-200",children:e.jsx(Js,{className:"h-6 w-6 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-gray-900",children:"Contract Renewal"}),e.jsx("p",{className:"text-gray-600 mt-1",children:"Secure your student's continued enrollment for 2025"})]})]})}),e.jsxs("div",{className:"p-4 md:p-6 space-y-6",children:[e.jsxs("div",{className:`border rounded-lg p-4 ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"bg-blue-50 border-blue-200":"bg-red-50 border-red-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"bg-blue-100":"bg-red-100"}`,children:e.jsx("span",{className:`font-semibold text-sm ${(he==null?void 0:he.currentPhase)==="phase1"||(he==null?void 0:he.currentPhase)==="phase2"?"text-blue-600":"text-red-600"}`,children:(he==null?void 0:he.currentPhase)==="phase1"?"1":(he==null?void 0:he.currentPhase)==="phase2"?"2":(he==null?void 0:he.currentPhase)==="phase3"?"3":"4"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-gray-900",children:[(he==null?void 0:he.currentPhase)==="phase1"&&"Phase 1: Information & Preparation",(he==null?void 0:he.currentPhase)==="phase2"&&"Phase 2: Active Renewal Period",(he==null?void 0:he.currentPhase)==="phase3"&&"Phase 3: Required Action Period",(he==null?void 0:he.currentPhase)==="phase4"&&"Phase 4: Final Opportunity Period"]}
800),e.jsxs("p",{className:"text-sm text-gray-600",children:[(he==null?void 0:he.currentPhase)==="phase1"&&"Through August 17, 2026",(he==null?void 0:he.currentPhase)==="phase2"&&"August 18 - September 14, 2026",(he==null?void 0:he.currentPhase)==="phase3"&&"September 16 - December 15, 2025",(he==null?void 0:he.currentPhase)==="phase4"&&"October 15 - December 15, 2025"]})]})]}),e.jsxs("p",{className:"mt-3 text-sm text-gray-700",children:[(he==null?void 0:he.currentPhase)==="phase1"&&"We're providing early notice about contract renewal requirements and new rates for 2025. Use this time to review changes and prepare for the renewal process.",(he==null?void 0:he.currentPhase)==="phase2"&&"Contract signing is now available! Please review the 2025 terms and complete your renewal to secure enrollment for all Ahern Academy students.",(he==null?void 0:he.currentPhase)==="phase3"&&"Contract renewal is now required. Portal access is limited until you complete the signing process. Please sign immediately to maintain enrollment.",(he==null?void 0:he.currentPhase)==="phase4"&&"Final opportunity to sign your 2025 contract. After December 15th, contract signing will no longer be available. Secure your enrollment now."]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(As,{className:"h-5 w-5 text-green-600"}),"Current Contract Status"]})}),e.jsxs(Se,{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center p-3 bg-green-50 rounded-lg",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"2024 Contract"}),e.jsx(we,{variant:"outline",className:"bg-green-100 text-green-800 border-green-300",children:"Active & Valid"})]}),e.jsx("div",{className:"text-sm text-gray-600",children:"Your current contract covers your family's Ahern Academy enrollment through August 31, 2025."})]})]}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-5 w-5 text-yellow-600"}),"2025 Renewal Required"]})}),e.jsxs(Se,{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center p-3 bg-yellow-50 rounded-lg",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Deadline"}),e.jsx(we,{variant:"outline",className:"bg-yellow-100 text-yellow-800 border-yellow-300",children:"September 14, 2026"})]}),e.jsx("div",{className:"text-sm text-gray-600",children:"All Ahern Academy families must renew their contract by September 14th to secure enrollment for 2026â2027."})]})]})]}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"What to Expect"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-blue-600 font-semibold text-xs",children:"1"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Phase 1: Information Banner (Now - Aug 10)"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Early notification and information about the renewal process"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 bg-yellow-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-yellow-600 font-semibold text-xs",children:"2"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Phase 2: Gentle Reminders (Aug 11 - Sep 1)"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Optional renewal modal with contract signing available"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-red-600 font-semibold text-xs",children:"3"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Phase 3: Required Action (Sep 2 - Sep 15)"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Portal access limited until contract is signed"})]})]})]})]}),e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-amber-100 rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-amber-600 font-semibold",children:"!"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900 mb-2",children:"Important Notes"}),e.jsxs("ul",{className:"text-sm text-gray-700 space-y-1",children:[e.jsx("li",{children:"⢠Contract renewal is required for all Ahern Academy students"}),e.jsx("li",{children:"⢠Tuition is unchanged for 2026â2027: $487/month or $1,948/trimester"}),e.jsx("li",{children:"⢠Signing deadline is September 14, 2026"}),e.jsx("li",{children:"⢠Late renewals may result in loss of enrollment priority"})]})]})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-4",children:[e.jsxs(F,{variant:"outline",className:"flex-1",onClick:()=>h("overview"),children:[e.jsx(Mu,{className:"h-4 w-4 mr-2"}),"Back to Overview"]}),e.jsxs(F,{variant:"outline",className:"flex-1",onClick:()=>window.open("/2025-rates","_blank"),children:[e.jsx(xr,{className:"h-4 w-4 mr-2"}),"View 2025 Rates"]}),e.jsx(F,{className:`flex-1 text-white ${(he==null?void 0:he.currentPhase)==="phase1"?"bg-gray-400 cursor-not-allowed":(he==null?void 0:he.currentPhase)==="phase2"?"bg-blue-600 hover:bg-blue-700":"bg-red-600 hover:bg-red-700"}`,disabled:(he==null?void 0:he.currentPhase)==="phase1"||js.isPending,onClick:()=>(he==null?void 0:he.currentPhase)!=="phase1"&&Ts(!0),children:js.isPending?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Signing..."]}):(he==null?void 0:he.currentPhase)==="phase1"?e.jsxs(e.Fragment,{children:[e.jsx(ys,{className:"h-4 w-4 mr-2"}),"Contract Signing (Available Now)"]}):e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"h-4 w-4 mr-2"}),"Sign 2026â27 Contract"]})})]})]})]})}),((sp=rt==null?void 0:rt.students)==null?void 0:sp.some(v=>{var Q;return((Q=v.studentCategories)==null?void 0:Q.includes("1:1 Sessions"))&&v.oneOnOneApproved}))&&e.jsx(Hs,{value:"one-on-one",className:"space-y-4 md:space-y-6",children:e.jsx(nZ,{familyData:rt,onOpenWizard:()=>m(!0)})})]}),e.jsx(es,{open:W!==null,onOpenChange:()=>J(null),children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ss,{className:"pb-6",children:[e.jsx(ns,{className:"text-2xl font-bold",style:{color:"#4A4A4A"},children:"Edit Student Information"}),e.jsx(Pa,{className:"text-base",style:{color:"#6B7280"},children:"Update student details, educational information, and AAC system settings"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4 p-6 border rounded-lg",style:{backgroundColor:"var(--modal-header-blue)",borderColor:"var(--modal-header-corn)"},children:[e.jsxs("h3",{className:"text-xl font-bold flex items-center gap-3",style:{color:"#4A4A4A"},children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(ti,{className:"w-5 h-5",style:{color:"#4A4A4A"}})}),"Basic Information"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"studentName",children:"Name *"}),e.jsx(je,{id:"studentName",value:V.name||"",onChange:v=>Z({...V,name:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"nicknames",children:"Nicknames"}),e.jsx(je,{id:"nicknames",value:V.nicknames||"",onChange:v=>Z({...V,nicknames:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"birthday",children:"Birthday"}),e.jsx(je,{id:"birthday",type:"date",value:V.birthday||"",onChange:v=>Z({...V,birthday:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"studentAge",children:"Age"}),e.jsx(je,{id:"studentAge",type:"number",value:V.age||"",onChange:v=>Z({...V,age:parseInt(v.target.value)||0})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"gradeEquivalent",children:"Grade Equivalent"}),e.jsx(je,{id:"gradeEquivalent",value:V.gradeEquivalent||"",onChange:v=>Z({...V,gradeEquivalent:v.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-4 p-6 border rounded-lg",style:{backgroundColor:"var(--modal-header-corn)",borderColor:"var(--modal-header-ice)"},children:[e.jsxs("h3",{className:"text-xl font-bold flex items-center gap-3",style:{color:"#4A4A4A"},children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(uh,{className:"w-5 h-5",style:{color:"#4A4A4A"}})}),"Address Information"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(Ne,{htmlFor:"streetAddress",children:"Street Address"}),e.jsx(je,{id:"streetAddress",value:V.streetAddress||"",onChange:v=>Z({...V,streetAddress:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"city",children:"City"}),e.jsx(je,{id:"city",value:V.city||"",onChange:v=>Z({...V,city:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"state",children:"State/Province"}),e.jsx(je,{id:"state",value:V.state||"",onChange:v=>Z({...V,state:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"country",children:"Country"}),e.jsx(je,{id:"country",value:V.country||"",onChange:v=>Z({...V,country:v.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"postalCode",children:"Postal Code"}),e.jsx(je,{id:"postalCode",value:V.postalCode||"",onChange:v=>Z({...V,postalCode:v.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-4 p-6 border rounded-lg",style:{backgroundColor:"var(--modal-header-ice)",borderColor:"var(--modal-header-lav)"},children:[e.jsxs("h3",{className:"text-xl font-bold flex items-center gap-3",style:{color:"#4A4A4A"},children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(Pn,{className:"w-5 h-5",style:{color:"#4A4A4A"}})}),"Educational Information"]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"diagnosis",children:"Diagnosis"}),e.jsx(Pt,{id:"diagnosis",value:V.diagnosis||"",onChange:v=>Z({...V,diagnosis:v.target.value}),placeholder:"Student's diagnosis or disabilities"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"currentAacSystems",children:"AAC Systems"}),e.jsx(Pt,{id:"currentAacSystems",value:V.currentAacSystems||"",onChange:v=>Z({...V,currentAacSystems:v.target.value}),placeholder:"Current AAC devices and methods (separate multiple with commas)"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"accommodations",children:"Accommodations"}),e.jsx(Pt,{id:"accommodations",value:V.accommodations||"",onChange:v=>Z({...V,accommodations:v.target.value}),placeholder:"Educational accommodations needed (separate multiple with commas)"})]}),re.aacFileUrl?e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-blue-50",children:[e.jsx("h4",{className:"text-lg font-semibold text-blue-800",children:"Primary AAC System for Zoom Modeling"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"primaryAacSystem",children:"Primary AAC System"}),e.jsxs(St,{value:re.primaryAacSystem||"",onValueChange:v=>O({...re,primaryAacSystem:v}),children:[e.jsx(At,{children:e.jsx(kt,{placeholder:"Select primary AAC system"})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"TouchChat",children:"TouchChat"}),e.jsx(ce,{value:"Proloquo2Go",children:"Proloquo2Go"}),e.jsx(ce,{value:"LAMP Words for Life",children:"LAMP Words for Life"}),e.jsx(ce,{value:"Grid 3",children:"Grid 3"}),e.jsx(ce,{value:"PRC Unity",children:"PRC Unity"}),e.jsx(ce,{value:"Proloquo",children:"Proloquo"}),e.jsx(ce,{value:"Speak for Yourself",children:"Speak for Yourself"}),e.jsx(ce,{value:"CoughDrop",children:"CoughDrop"}),e.jsx(ce,{value:"Predictable",children:"Predictable"}),e.jsx(ce,{value:"Avaz",children:"Avaz"}),e.jsx(ce,{value:"MindExpress",children:"MindExpress"}),e.jsx(ce,{value:"Other",children:"Other"})]})]})]}),re.primaryAacSystem==="Other"&&e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"primaryAacOther",children:"Specify Other AAC System"}),e.jsx(je,{id:"primaryAacOther",value:re.primaryAacOther||"",onChange:v=>O({...re,primaryAacOther:v.target.value}),placeholder:"Name of AAC system"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"primaryAacPlatform",children:"Platform/Device"}),e.jsx(je,{id:"primaryAacPlatform",value:re.primaryAacPlatform||"",onChange:v=>O({...re,primaryAacPlatform:v.target.value}),placeholder:"iPad, Android tablet, dedicated device, etc."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Gs,{id:"primaryAacReady",checked:re.primaryAacReady||!1,onCheckedChange:v=>O({...re,primaryAacReady:v})}),e.jsx(Ne,{htmlFor:"primaryAacReady",className:"text-sm font-medium",children:"Ready for Zoom modeling"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{children:"AAC System Backup File"}),((rp=(np=rt==null?void 0:rt.students)==null?void 0:np.find(v=>v.id===W))==null?void 0:rp.aacFileUrl)&&e.jsx("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-4 w-4 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-green-800",children:((ip=(ap=rt==null?void 0:rt.students)==null?void 0:ap.find(v=>v.id===W))==null?void 0:ip.aacFileName)||"AAC backup file uploaded"}),e.jsx("p",{className:"text-xs text-green-600",children:(Dd=(lp=rt==null?void 0:rt.students)==null?void 0:lp.find(v=>v.id===W))!=null&&Dd.aacFileSize?`${Math.round(((op=(lo=rt==null?void 0:rt.students)==null?void 0:lo.find(v=>v.id===W))==null?void 0:op.aacFileSize)/1024/1024*100)/100} MB`:""})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>window.location.href=`/api/students/${W}/download-aac`,title:"Download AAC file",className:"flex items-center gap-1",children:[e.jsx(Xr,{className:"h-3 w-3"}),"Download"]}),e.jsxs(F,{size:"sm",variant:"outline",onClick:oi,className:"text-red-600 hover:text-red-700 flex items-center gap-1",title:"Delete AAC file",children:[e.jsx(pa,{className:"h-3 w-3"}),"Delete"]})]})]})}),e.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(gr,{className:"mx-auto h-8 w-8 text-gray-400 mb-2"}),e.jsxs("div",{className:"text-sm text-gray-600",children:[e.jsx("label",{htmlFor:"aac-file-upload",className:"cursor-pointer text-blue-600 hover:text-blue-500",children:(Sm=(Cm=rt==null?void 0:rt.students)==null?void 0:Cm.find(v=>v.id===W))!=null&&Sm.aacFileUrl?"Replace AAC backup file":"Upload AAC backup file"}),e.jsx("p",{className:"text-xs mt-1",children:"Supports .ce, .p2gbk, .wf, .gridset, .gridsetx, .mti, .sps, .azt, .avrt, .jmm files up to 200MB"})]}),e.jsx("input",{id:"aac-file-upload",type:"file",accept:".ce,.p2gbk,.wf,.gridset,.gridsetx,.mti,.sps,.azt,.avrt,.jmm",onChange:gm,className:"hidden"})]}),me===W&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600 mb-2",children:[e.jsx("span",{children:"Uploading..."}),e.jsx("span",{children:"0%"})]}),e.jsx(U1,{value:0,className:"h-2"})]})]})]})]}):e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-blue-50",children:[e.jsx("h4",{className:"text-lg font-semibold text-blue-800",children:"Primary AAC System for Zoom Modeling"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{children:"AAC System Backup File"}),e.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(gr,{className:"mx-auto h-8 w-8 text-gray-400 mb-2"}),e.jsxs("div",{className:"text-sm text-gray-600",children:[e.jsx("label",{htmlFor:"aac-file-upload",className:"cursor-pointer text-blue-600
800 hover:text-blue-500",children:"Upload AAC backup file"}),e.jsx("p",{className:"text-xs mt-1",children:"Supports .ce, .p2gbk, .wf, .gridset, .gridsetx, .mti, .sps, .azt, .avrt, .jmm files up to 200MB"})]}),e.jsx("input",{id:"aac-file-upload",type:"file",accept:".ce,.p2gbk,.wf,.gridset,.gridsetx,.mti,.sps,.azt,.avrt,.jmm",onChange:gm,className:"hidden"})]}),me===W&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600 mb-2",children:[e.jsx("span",{children:"Uploading..."}),e.jsx("span",{children:"0%"})]}),e.jsx(U1,{value:0,className:"h-2"})]})]}),(re.aacFileUrl||W&&((km=V.studentCategories)==null?void 0:km.find(v=>["Ahern Academy","Open Enrollment","1:1 Sessions","Young Adult Chat"].includes(v))))&&e.jsx("div",{className:"mt-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-4 w-4 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-green-800",children:re.fileName||"AAC backup file uploaded"}),e.jsx("p",{className:"text-xs text-green-600",children:re.fileSize?`${Math.round(re.fileSize/1024/1024*100)/100} MB`:""})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:re.aacFileUrl&&e.jsxs(e.Fragment,{children:[e.jsx(F,{size:"sm",variant:"outline",onClick:()=>window.location.href=`/api/students/${W}/download-aac`,title:"Download AAC file",children:"Download"}),e.jsx(F,{size:"sm",variant:"outline",onClick:oi,className:"text-red-600 hover:text-red-700",title:"Delete AAC file",children:e.jsx(Gr,{className:"h-3 w-3"})})]})})]})})]})]})]})]}),(()=>{var Q;const v=(Q=rt==null?void 0:rt.students)==null?void 0:Q.find(Pe=>Pe.id===W);return v?e.jsxs("div",{className:"p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsx("h4",{className:"font-medium mb-2 text-purple-900",children:"Ahern Academy - Our Homeschool Cooperative"}),e.jsx("p",{className:"text-sm text-purple-700 mb-3",children:"Ahern Academy is our full-time homeschool program. Application required for enrollment."}),v.ahernAcademyApproved?e.jsxs("div",{className:"flex items-center space-x-2 text-green-700",children:[e.jsx(As,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Enrolled in Ahern Academy"})]}):v.ahernAcademyApplicationSubmitted?e.jsxs("div",{className:"flex items-center space-x-2 text-blue-700",children:[e.jsx(ys,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Application Pending - Awaiting Admin Approval"})]}):e.jsxs(F,{type:"button",variant:"outline",className:"border-purple-300 text-purple-900 hover:bg-purple-100",onClick:()=>{z({isOpen:!0,studentId:v.id})},"data-testid":"button-apply-ahern-academy",children:[e.jsx(ar,{className:"h-4 w-4 mr-2"}),"Apply for Ahern Academy"]})]}):null})(),(($m=V.studentCategories)==null?void 0:$m.includes("Ahern Academy"))&&e.jsxs("div",{className:"space-y-4 p-6 border rounded-lg",style:{backgroundColor:"var(--modal-header-lav)",borderColor:"var(--modal-header-pink)"},children:[e.jsxs("h3",{className:"text-xl font-bold flex items-center gap-3",style:{color:"#4A4A4A"},children:[e.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:e.jsx(ar,{className:"w-5 h-5",style:{color:"#4A4A4A"}})}),"Ahern Academy Information"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"specialInterests",children:"Special Interests"}),e.jsx(Pt,{id:"specialInterests",value:V.specialInterests||"",onChange:v=>Z({...V,specialInterests:v.target.value}),placeholder:"What does this student love and enjoy?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"calmingStrategies",children:"Calming Strategies"}),e.jsx(Pt,{id:"calmingStrategies",value:V.calmingStrategies||"",onChange:v=>Z({...V,calmingStrategies:v.target.value}),placeholder:"What helps calm this student when upset?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"upsetTriggers",children:"Upset Triggers"}),e.jsx(Pt,{id:"upsetTriggers",value:V.upsetTriggers||"",onChange:v=>Z({...V,upsetTriggers:v.target.value}),placeholder:"What tends to upset this student?"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"alphabetAccess",children:"Alphabet Acce
800ss Method"}),e.jsx(je,{id:"alphabetAccess",value:V.alphabetAccess||"",onChange:v=>Z({...V,alphabetAccess:v.target.value}),placeholder:"How student accesses alphabet"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"yesNoMethod",children:"Yes/No Communication"}),e.jsx(je,{id:"yesNoMethod",value:V.yesNoMethod||"",onChange:v=>Z({...V,yesNoMethod:v.target.value}),placeholder:"How student says yes/no"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"aacProficiency",children:"AAC Proficiency"}),e.jsx(je,{id:"aacProficiency",value:V.aacProficiency||"",onChange:v=>Z({...V,aacProficiency:v.target.value}),placeholder:"Student's AAC skill level"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"readingSkills",children:"Reading Skills"}),e.jsx(je,{id:"readingSkills",value:V.readingSkills||"",onChange:v=>Z({...V,readingSkills:v.target.value}),placeholder:"Current reading abilities"})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"mathSkills",children:"Math Skills"}),e.jsx(je,{id:"mathSkills",value:V.mathSkills||"",onChange:v=>Z({...V,mathSkills:v.target.value}),placeholder:"Current math abilities"})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-4 pt-6 border-t",children:[e.jsx(F,{type:"button",variant:"outline",onClick:()=>J(null),className:"px-6 py-2",style:{borderColor:"#4A4A4A",color:"#4A4A4A"},children:"Cancel"}),e.jsx(F,{onClick:gc,className:"px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white font-semibold",children:"Save Changes"})]})]})]})}),e.jsx(es,{open:ht,onOpenChange:Mt,children:e.jsxs(ts,{className:"flex w-[calc(100%-16px)] max-w-md max-h-[calc(100vh-16px)] supports-[height:100dvh]:max-h-[calc(100dvh-16px)] flex-col gap-3 overflow-hidden p-[8px] sm:p-6",children:[e.jsx(ss,{className:"min-w-0 shrink-0 pr-6 [overflow-wrap:anywhere]",children:e.jsx(ns,{children:"Complete Payment"})}),Te&&e.jsx(EG,{amount:Te.total,expectedAmount:Te.expectedAmount,description:Te.description,familyId:rt.id,studentId:((jl=(Pm=rt.students)==null?void 0:Pm[0])==null?void 0:jl.id)||void 0,enrollmentId:void 0,sessionId:void 0,sessionBillingIds:Te.services.filter(v=>v.sessionBillingId).map(v=>v.sessionBillingId),coverage:Te.coverage,pendingPaymentIds:Te.pendingPaymentIds,idempotencyKey:$||void 0,serviceType:Te.services.map(v=>v.serviceType).join(", "),paymentMonth:ct,onSuccess:yc,onPaymentReceived:jg,onPaymentDeclined:jm,onCancel:()=>Mt(!1)})]})}),e.jsx(GC,{isOpen:S,onClose:()=>ve(!1),userEmail:(Ss==null?void 0:Ss.email)||""}),e.jsx(es,{open:Ze,onOpenChange:Qe,children:e.jsxs(ts,{className:"sm:max-w-md",style:{zIndex:9999,position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"white",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[e.jsxs(ss,{children:[e.jsxs(ns,{className:"flex items-center gap-2",style:{color:"#4A4A4A"},children:[e.jsx(ti,{className:"h-5 w-5",style:{color:"#77dbf6"}}),"Welcome to AAC Voices Portal!"]}),e.jsx(Pa,{style:{color:"#4A4A4A"},children:"You're now logged in and ready to access your family portal."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-yellow-600 font-semibold text-sm",children:"!"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-sm mb-2",style:{color:"#4A4A4A"},children:"Security Recommendation"}),e.jsx("p",{className:"text-sm",style:{color:"#4A4A4A"},children:"We strongly encourage you to change your password from the temporary one provided. This helps keep your family's educational information secure."})]})]})}),e.jsx("div",{className:"text-sm",style:{color:"#6b7280"},children:'You can change your password anytime by visiting the Caregiver Info tab and clicking "Account Settings".'})]}),e.jsxs(sl,{className:"flex gap-2 sm:gap-2",children:[e.jsx(F,{variant:"outline",onClick:()=>Qe(!1),className:"flex-1",children:"Continue with Current Password"}),e.jsx(F,{onClick:()=>{Qe(!1),ve(!0)},className:"flex-1",style:{backgroundColor:"#77dbf6",borderColor:"#77dbf6",color:"white"},children:"Change Password Now"})]})]})}),e.jsx(es,{open:Zs,onOpenChange:Zt,children:e.jsxs(ts,{className:"sm:max-w-md",children:[e.jsx(ss,{children:e.jsx(ns,{style:{color:"#4A4A4A"},children:"Apply Account Credit"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Credit Amount to Apply"}),e.jsxs("div",{className:"mt-1 relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx("span",{className:"text-gray-500 sm:text-sm",children:"$"})}),e.jsx("input",{type:"number",step:"0.01",min:"0",value:un,onChange:v=>Rt(v.target.value),className:"pl-7 block w-full border-gray-300 rounded-md shadow-sm focus:ring-aac-blue focus:border-aac-blue",placeholder:"0.00"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"Payment Description (Optional)"}),e.jsx("input",{type:"text",value:Os,onChange:v=>vs(v.target.value),className:"mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-aac-blue focus:border-aac-blue",placeholder:"e.g., Applied to August 2025 tuition"})]}),e.jsx("div",{className:"bg-blue-50 p-3 rounded-lg",children:e.jsx("p",{className:"text-sm text-blue-800",children:"This will create a payment record using your available account credit. The credit will be marked as used and cannot be applied again."})}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(F,{onClick:()=>{Zt(!1),xn(null),Rt(""),vs("")},variant:"outline",children:"Cancel"}),e.jsx(F,{onClick:bm,className:"bg-green-600 hover:bg-green-700 text-white",disabled:!qn||!un,children:"Apply Credit"})]})]})]})}),e.jsx(es,{open:cs,onOpenChange:v=>{(he==null?void 0:he.currentPhase)==="phase3_lockout"&&(he!=null&&he.requiresContract)&&!(he!=null&&he.hasSignedRenewal)||(v||ds(!0),Ts(v))},children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(ss,{style:{background:"linear-gradient(135deg, #77dbf6 0%, #5DCFF2 100%)",borderRadius:"12px",padding:"24px",margin:"-24px -24px 24px -24px"},children:e.jsxs(ns,{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices",className:"h-12 w-auto"}),e.jsx("div",{className:"w-10 h-10 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:e.jsx(Js,{className:"h-5 w-5 text-white"})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-semibold text-white",children:"AAC Voices / Ahern Academy Contract"}),e.jsx("div",{className:"text-sm font-normal text-white/90",children:"2026â2027 School Year"})]})]})}),e.jsxs("div",{className:"space-y-6 text-sm",children:[e.jsxs("div",{style:{backgroundColor:"#77dbf6",border:"2px s
800olid #5DCFF2"},className:"rounded-lg p-4",children:[e.jsx("h4",{className:"font-semibold text-white mb-2",children:(he==null?void 0:he.currentPhase)==="phase3_lockout"?"ð¨ Action Required":"⨠Contract Signing Now Available"}),e.jsx("p",{className:"text-sm text-white",children:(he==null?void 0:he.currentPhase)==="phase3_lockout"?"Contract signing is now required. Portal access is limited until you complete the 2026â2027 contract renewal.":"Please review the complete 2026â2027 contract below, list your caregivers, and provide your digital signature by September 14, 2026."})]}),e.jsx(a3,{allowCancel:(he==null?void 0:he.currentPhase)!=="phase3_lockout",existingCaregivers:he==null?void 0:he.caregivers,onCancel:()=>{Ts(!1),ds(!0)},onSigned:()=>Ts(!1)})]})]})}),e.jsx(es,{open:M.isOpen,onOpenChange:v=>{v||L({isOpen:!1,enrollment:null,selectedWeeks:[]})},children:e.jsxs(ts,{className:"max-w-md",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Edit Enrollment Weeks"}),e.jsxs(Pa,{children:["Select the weeks you want to enroll in for ",(cp=M.enrollment)==null?void 0:cp.className]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Array.from({length:12},(v,Q)=>Q+1).map(v=>e.jsxs(F,{variant:M.selectedWeeks.includes(v)?"default":"outline",size:"sm",onClick:()=>wn(v),className:"h-10",children:["Week ",v]},v))}),e.jsxs("div",{className:"text-sm text-gray-600",children:["Selected weeks: ",M.selectedWeeks.length>0?M.selectedWeeks.join(", "):"None selected"]})]}),e.jsxs(sl,{children:[e.jsx(F,{variant:"outline",onClick:()=>L({isOpen:!1,enrollment:null,selectedWeeks:[]}),children:"Cancel"}),e.jsx(F,{onClick:Nn,disabled:M.selectedWeeks.length===0,children:"Save Changes"})]})]})}),e.jsx(es,{open:B.isOpen,onOpenChange:v=>{v||z({isOpen:!1,studentId:null})},children:e.jsxs(ts,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ss,{children:[e.jsx(ns,{children:"Apply for Ahern Academy"}),e.jsx(Pa,{children:"Complete the comprehensive application for Ahern Academy enrollment. All fields are required unless marked optional."})]}),B.studentId&&rt&&(()=>{var Q;const v=(Q=rt.students)==null?void 0:Q.find(Pe=>Pe.id===B.studentId);return v?e.jsx(QG,{studentId:v.id,familyId:rt.id,studentName:v.name,onSuccess:()=>{z({isOpen:!1,studentId:null}),en.invalidateQueries({queryKey:["/api/portal/family"]}),hs({title:"Application Submitted",description:"Your Ahern Academy application has been submitted successfully. You will receive a confirmation email shortly."})},onCancel:()=>z({isOpen:!1,studentId:null})}):null})()]})}),e.jsx(FG,{familyData:rt,isOpen:x,initialSessionId:g,onClose:()=>{m(!1),y(null)},onComplete:()=>{m(!1),y(null),h("payments");const v=new URL(window.location.href);v.searchParams.set("tab","payments"),window.history.pushState({},"",v.toString()),Ae(!0),hs({title:"Enrollment Complete",description:"Please complete payment to finalize your enrollment.",variant:"default"})},onNavigateToPrograms:()=>{h("program-info");const v=new URL(window.location.href);v.searchParams.set("tab","program-info"),window.history.pushState({},"",v.toString())}}),e.jsx("input",{type:"file",ref:li,accept:"image/*",style:{display:"none"}})]})]}):e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs(Ce,{className:"w-full max-w-md",children:[e.jsxs(Ve,{children:[e.jsx(Ue,{className:"text-center",children:"AAC Voices Portal"}),e.jsx("p",{className:"text-center text-gray-600",children:"Sign in to access your caregiver information"})]}),e.jsx(Se,{children:e.jsxs("form",{onSubmit:ps,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"email",children:"Email"}),e.jsx(je,{id:"email",type:"email",value:$e.email,onChange:v=>ke({...$e,email:v.target.value}),placeholder:"Enter your email",required:!0})]}),e.jsxs("div",{children:[e.jsx(Ne,{htmlFor:"password",children:"Password"}),e.jsx(je,{id:"password",type:"password",value:$e.password,onChange:v=>ke({...$e,password:v.target.value}),placeholder:"Enter your password",required:!0})]}),e.jsx(F,{type:"submit",className:"w-full",children:"Sign In"}),e.jsx("div",{className:"text-sm text-center text-gray-600 mt-4",children:e.jsx("p",{children:"Contact AAC Voices for login assistance"})})]})})]})})}function yx(){const[s]=hl(),t=s.startsWith("/admin/program-information");return e.jsxs("div",{className:"min-h-screen",style:{backgroundColor:"#f8f9fa"},children:[!t&&e.jsx(Gt,{}),e.jsxs("div",{className:"max-w-6xl mx-auto p-4 md:p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold",style:{color:"#4A4A4A"},children:"Program Information"}),e.jsx("p",{className:"text-gray-600",children:"Understand our educational offerings"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs(Ce,{className:"border-0 shadow-lg",children:[e.jsx(Ve,{className:"rounded-t-lg p-6",style:{backgroundColor:"var(--modal-header-blue)"},children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(Pn,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Ahern Academy Spring 2026"}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"January 5 - April 11, 2026 (Medieval Times Theme)"})]})]})}),e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-700 mb-6",children:"Ahern Academy morning classes with UFLI Literacy and Math curriculum, followed by afternoon open enrollment classes including History, Shared Reading, Writing, Young Adult Chat, and Chit Chat Book Club."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Morning Schedule:"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"9:15am - Literacy (UFLI Lessons 1-30)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"9:50am - Math"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"10:30am - Literacy (UFLI Lessons 60-90)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"11:15am - Literacy (UFLI Lessons 30-60)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"11:45am - Math"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{children:"12:15pm - Math"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Program Details:"}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-600",children:[e.jsxs("p",{children:["⢠",e.jsx("strong",{children:"Literacy Classes:"})," UFLI evidence-based instruction"]}),e.jsxs("p",{children:["⢠",e.jsx("strong",{children:"Math:"})," Zearn or Daily Life Math"]}),e.jsxs("p",{children:["⢠",e.jsx("strong",{children:"History Elective:"})," Medieval Times theme"]}),e.jsx("p",{children:"⢠Morning structured classes Monday-Friday"}),e.jsx("p",{children:"⢠Small group instruction"})]})]})]})]})]}),e.jsxs(Ce,{className:"border-0 shadow-lg",children:[e.jsx(Ve,{className:"rounded-t-lg p-6",style:{backgroundColor:"var(--modal-header-corn)"},children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(Ms,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Camp CommuniKate 2025"}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"4-week virtual camp experience"})]})]})}),e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-700 mb-6",children:"Four week virtual camp experience offering Ahern Academy to accepted students and, Open Enrollment Afternoon Camp Activities and Young Adult Chat (13+) to all who wish to attend."}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Open Enrollment Afternoon Camp Activities"}),e.jsxs("div",{className:"space-y-3 text-sm text-gray-600",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-700 mb-1",children:"Cooking"}),e.jsx("p",{children:"Kitchen safety, microwave recipes, smoothies, campfire recipes with no fire"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-700 mb-1",children:"Camp Arts"}),e.jsx("p",{children:"Camp music, camp crafts (tie dye!), photography and videography"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-700 mb-1",children:"Awesome Academics"}),e.jsx("p",{children:"Animal science, campfire stories, writing texts and emails, summer science experiments"})]})]})]})}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Young Adult Chat"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Social communication groups for teens and young adults (ages 13+)"})]})})]})]}),e.jsxs(Ce,{className:"border-0 shadow-lg",children:[e.jsx(Ve,{className:"rounded-t-lg p-6",style:{backgroundColor:"var(--modal-header-ice)"},children:e.jsxs(Ue,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-white/60 rounded-lg",children:e.jsx(an,{className:"w-6 h-6",style:{color:"#4A4A4A"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",style:{color:"#4A4A4A"},children:"Spring 2026 Trimester"}),e.jsx("p",{className:"text-sm font-medium",style:{color:"#4A4A4A"},children:"January 5 - April 11, 2026"})]})]})}),e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-700 mb-6",children:"13 weeks with Medieval Times theme and one week mid-trimester break offering Full Time Ahern Academy Homeschool Cooperative to accepted students, Open Enrollment Afternoon Classes M/Tu/Th/F with History elective, and Young Adult Chat Social Groups (13+) M-Th."}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Full Time Ahern Academy Homeschool Cooperative"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Comprehensive morning homeschool program with structured literacy and math classes"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Open Enrollment Afternoon Classes"}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-3 h-3"}),e.jsx("span",{children:"3pm: History - Monday/Tuesday/Thursday Medieval Times history, Friday cooking medieval recipes"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-3 h-3"}),e.jsx("span",{children:"Shared Reading - Vocabulary instruction, comprehension activities, story elements instruction"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ys,{className:"w-3 h-3"}),e.jsx("span",{children:"Writing - Shared writing, writing with the alphabet, Friday history projects"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-semibold text-gray-800",children:"Young Adult Chat Social Groups"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Social communication groups for ages 13+ meeting Monday through Thursday"})]})]})]})]})]})]})]})}function Av(){hl();const s=t=>{t.preventDefault(),console.log("[DEBUG] Sign In button clicked, using direct navigation to /login"),window.location.href="/login"};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-yellow-50",children:[e.jsx("header",{className:"border-b bg-white/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center",children:e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices Logo",className:"h-12 w-auto"})}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsxs("a",{href:"https://www.aacvoices.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-2 text-aac-text hover:text-aac-blue-dark transition-colors",children:[e.jsx("span",{className:"text-sm",children:"Visit AAC Voices"}),e.jsx(Ya,{className:"h-4 w-4"})]}),e.jsx(F,{className:"bg-aac-blue text-white hover:bg-aac-blue-dark hover:scale-105 transition-all duration-200 shadow-lg",onClick:s,children:"Sign In"})]})]})})}),e.jsx("section",{className:"py-16 px-4",children:e.jsxs("div",{className:"container mx-auto text-center max-w-4xl",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/images/welcomelogo.png",alt:"AAC Voices Welcome Bee",className:"h-28 w-auto"})}),e.jsx("h1",{className:"text-5xl font-bold text-aac-text mb-6 leading-tight",children:e.jsx("span",{className:"bg-aac-yellow px-8 py-3 rounded-2xl inline-block",children:"AAC Voices"})}),e.jsx("p",{className:"text-xl text-aac-text-light mb-8 max-w-3xl mx-auto leading-relaxed",children:"Access your family's personalized dashboard, manage class enrollments, track payments, and stay connected with our supportive community of families navigating AAC together."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsx(Wl,{href:"/login",children:e.jsxs(F,{size:"lg",className:"bg-aac-blue text-white hover:bg-aac-blue-dark hover:scale-105 transition-all duration-200 px-8 py-4 text-lg font-semibold shadow-lg",children:[e.jsx(Ms,{className:"mr-2 h-5 w-5"}),"Access Family Portal"]})}),e.jsx(Wl,{href:"/register",children:e.jsx(F,{size:"lg",className:"bg-aac-blue text-white hover:bg-aac-blue-dark hover:scale-105 transition-all duration-200 px-8 py-4 text-lg font-semibold shadow-lg",children:"Create New Account"})})]})]})}),e.jsx("section",{className:"py-16 px-4 bg-white",children:e.jsxs("div",{className:"container mx-auto max-w-6xl",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-aac-text mb-4",children:"Everything You Need in One Place"}),e.jsx("p",{className:"text-aac-text-light text-lg max-w-2xl mx-auto",children:"AAC Voices Portal makes it easy to manage your child's AAC education journey with tools designed specifically for caregivers."})]}),e.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-blue/10 rounded-lg flex items-center justify-center mb-4",children:e.jsx(ar,{className:"h-6 w-6 text-aac-blue-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Class Enrollment"}),e.jsx(rn,{children:"Easy registration for Ahern Academy, Open Enrollment, and specialized programs"})]}),e.jsx(Se,{children:e.jsx("p",{className:"text-aac-text-light",children:"Browse available classes, check schedules, and enroll your child with
800just a few clicks. View real-time availability and waitlist status."})})]}),e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-yellow/20 rounded-lg flex items-center justify-center mb-4",children:e.jsx(Or,{className:"h-6 w-6 text-aac-yellow-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Payment Management"}),e.jsx(rn,{children:"Secure payment processing with flexible billing options"})]}),e.jsx(Se,{children:e.jsx("p",{className:"text-aac-text-light",children:"Make payments securely, view billing history, and manage your family's financial information with scholarship tracking and third-party billing support."})})]}),e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-blue/10 rounded-lg flex items-center justify-center mb-4",children:e.jsx(Ms,{className:"h-6 w-6 text-aac-blue-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Student Profiles"}),e.jsx(rn,{children:"Comprehensive tracking of your child's AAC journey and progress"})]}),e.jsx(Se,{children:e.jsx("p",{className:"text-aac-text-light",children:"Maintain detailed profiles including AAC systems, accommodations, and educational goals. Upload photos and track important milestones."})})]}),e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-yellow/20 rounded-lg flex items-center justify-center mb-4",children:e.jsx(rd,{className:"h-6 w-6 text-aac-yellow-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Family Communication"}),e.jsx(rn,{children:"Stay connected with updates, reminders, and community news"})]}),e.jsx(Se,{children:e.jsx("p",{className:"text-aac-text-light",children:"Receive important announcements, class reminders, and connect with other families in our supportive AAC community."})})]}),e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-blue/10 rounded-lg flex items-center justify-center mb-4",children:e.jsx(Pn,{className:"h-6 w-6 text-aac-blue-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Educational Resources"}),e.jsx(rn,{children:"Access helpful materials, guides, and learning resources"})]}),e.jsx(Se,{children:e.jsx("p",{className:"text-aac-text-light",children:"Download educational materials, access AAC resources, and find helpful guides to support your child's communication development."})})]}),e.jsxs(Ce,{className:"border-aac-blue/20 hover:border-aac-blue/40 transition-all duration-300 hover:shadow-lg",children:[e.jsxs(Ve,{children:[e.jsx("div",{className:"w-12 h-12 bg-aac-yellow/20 rounded-lg flex items-center justify-center mb-4",children:e.jsx(x7,{className:"h-6 w-6 text-aac-yellow-dark"})}),e.jsx(Ue,{className:"text-aac-text",children:"Secure & Private"}),e.jsx(rn,{children:"Data protection is in place for your family's information"})]}),e.jsx(Se,{children:e.jsxs("p",{className:"text-aac-text-light",children:["Find out more about privacy and security of our"," ",e.jsx("a",{href:"https://docs.replit.com/teams/information-security/overview",target:"_blank",rel:"noopener noreferrer",className:"text-aac-blue hover:text-aac-blue-dark underline",children:"app"}),", our"," ",e.jsx("a",{href:"https://neon.com/security",target:"_blank",rel:"noopener noreferrer",className:"text-aac-blue hover:text-aac-blue-dark underline",children:"database"})," ","and our"," ",e.jsx("a",{href:"https://squareup.com/help/us/en/article/3796-privacy-and-security",target:"_blank",rel:"noopener noreferrer",className:"text-aac-blue hover:text-aac-blue-dark underline",children:"payment system"}),"."]})})]})]})]})}),e.jsx("section",{className:"py-16 px-4 bg-white",children:e.jsxs("div",{className:"container mx-auto max-w-6xl",children:[e.jsx("h2",{className:"text-3xl font-bold text-center text-aac-text mb-12",children:"What Families Are Saying"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"bg-gradient-to-br from-aac-blue/5 to-aac-yellow/5 p-6 rounded-lg shadow-sm border border-aac-blue/20",children:[e.jsx("p",{className:"text-aac-text-light mb-4 italic",children:'"Kate created an amazing space where every student is valued, respected and challenged. Franek has tremendously improved his use of AAC and made many wonderful friends."'}),e.jsx("div",{className:"font-semibold text-aac-text",children:"Karolina K."}),e.jsx("div",{className:"text-sm text-aac-text-light",children:"Parent of Franek, Ontario"})]}),e.jsxs("div",{className:"bg-gradient-to-br from-aac-blue/5 to-aac-yellow/5 p-6 rounded-lg shadow-sm border border-aac-blue/20",children:[e.jsx("p",{className:"text-aac-text-light mb-4 italic",children:`"AAC Virtual Voices Groups have been an unexpected blessing. Luke found his tribe and is finally being heard and believed in. He's accepted for who he is."`}),e.jsx("div",{className:"font-semibold text-aac-text",children:"Christy S."}),e.jsx("div",{className:"text-sm text-aac-text-light",children:"Parent of Luke"})]}),e.jsxs("div",{className:"bg-gradient-to-br from-aac-blue/5 to-aac-yellow/5 p-6 rounded-lg shadow-sm border border-aac-blue/20",children:[e.jsx("p",{className:"text-aac-text-light mb-4 italic",children:`"I love that I've been able to sit in on your classes and am so impressed with the different things you introduce. You do such a great job!"`}),e.jsx("div",{className:"font-semibold text-aac-text",children:"Cami C."}),e.jsx("div",{className:"text-sm text-aac-text-light",children:"Behaviorist, California"})]})]})]})}),e.jsx("footer",{className:"py-8 px-4 bg-aac-neutral-800 text-white",children:e.jsxs("div",{className:"container mx-auto",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center",children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4 md:mb-0",children:[e.jsx("img",{src:"/images/largelogo.png",alt:"AAC Voices Logo",className:"h-8 w-auto"}),e.jsx("span",{className:"text-lg font-semibold text-white",children:"Bee Heard."})]}),e.jsxs("div",{className:"flex items-center space-x-6 text-sm",children:[e.jsx("a",{href:"https://www.aacvoices.org",target:"_blank",rel:"noopener noreferrer",className:"text-aac-yellow hover:text-aac-yellow-light transition-colors",children:"Main Website"}),e.jsx("a",{href:"https://www.aacvoices.org/about",target:"_blank",rel:"noopener noreferrer",className:"text-aac-yellow hover:text-aac-yellow-light transition-colors",children:"About Us"}),e.jsx("a",{href:"mailto:[email protected]",className:"text-aac-yellow hover:text-aac-yellow-light transition-colors",children:"Contact Kate"})]})]}),e.jsx("div",{className:"mt-6 pt-6 border-t border-white/20 text-center text-sm text-white",children:e.jsx("p",{children:"© 2025 AAC Voices. All rights reserved."})})]})})]})}const Ge=Symbol.for("drizzle:entityKind"),PJ=Symbol.for("drizzle:hasOwnEntityKind");function Ps(s,t){if(!s||typeof s!="object")return!1;if(s instanceof t)return!0;
800if(!Object.prototype.hasOwnProperty.call(t,Ge))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(s).constructor;if(n)for(;n;){if(Ge in n&&n[Ge]===t[Ge])return!0;n=Object.getPrototypeOf(n)}return!1}var n6;n6=Ge;class ml{constructor(t,n){fe(this,"name");fe(this,"keyAsName");fe(this,"primary");fe(this,"notNull");fe(this,"default");fe(this,"defaultFn");fe(this,"onUpdateFn");fe(this,"hasDefault");fe(this,"isUnique");fe(this,"uniqueName");fe(this,"uniqueType");fe(this,"dataType");fe(this,"columnType");fe(this,"enumValues");fe(this,"generated");fe(this,"generatedIdentity");fe(this,"config");this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}fe(ml,n6,"Column");var r6;r6=Ge;class NE{constructor(t,n,r){fe(this,"config");fe(this,"$default",this.$defaultFn);fe(this,"$onUpdate",this.$onUpdateFn);this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}}fe(NE,r6,"ColumnBuilder");const Zo=Symbol.for("drizzle:Name");var a6;a6=Ge;class wE{constructor(t,n){fe(this,"reference");fe(this,"_onUpdate","no action");fe(this,"_onDelete","no action");this.reference=()=>{const{name:r,columns:a,foreignColumns:o}=t();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t===void 0?"no action":t,this}onDelete(t){return this._onDelete=t===void 0?"no action":t,this}build(t){return new AE(t,this)}}fe(wE,a6,"PgForeignKeyBuilder");var i6;i6=Ge;class AE{constructor(t,n){fe(this,"reference");fe(this,"onUpdate");fe(this,"onDelete");this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}getName(){const{name:t,columns:n,foreignColumns:r}=this.reference(),a=n.map(u=>u.name),o=r.map(u=>u.name),c=[this.table[Zo],...a,r[0].table[Zo],...o];return t??`${c.join("_")}_fk`}}fe(AE,i6,"PgForeignKey");function rZ(s,...t){return s(...t)}function lm(s){return new kE(s)}function CE(s,t){return`${s[Zo]}_${t.join("_")}_unique`}var l6;l6=Ge;class SE{constructor(t,n){fe(this,"columns");fe(this,"nullsNotDistinctConfig",!1);this.name=n,this.columns=t}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(t){return new $E(t,this.columns,this.nullsNotDistinctConfig,this.name)}}fe(SE,l6,"PgUniqueConstraintBuilder");var o6;o6=Ge;class kE{constructor(t){fe(this,"name");this.name=t}on(...t){return new SE(t,this.name)}}fe(kE,o6,"PgUniqueOnConstraintBuilder");var c6;c6=Ge;class $E{constructor(t,n,r,a){fe(this,"columns");fe(this,"name");fe(this,"nullsNotDistinct",!1);this.table=t,this.columns=n,this.name=a??CE(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}getName(){return this.name}}fe($E,c6,"PgUniqueConstraint");function h3(s,t,n){for(let r=t;r<s.length;r++){const a=s[r];if(a==="\\"){r++;continue}if(a==='"')return[s.slice(t,r).replace(/\\/g,""),r+1];if(!n&&(a===","||a==="}"))return[s.slice(t,r).replace(/\\/g,""),r]}return[s.slice(t).replace(/\\/g,""),s.length]}function PE(s,t=0){const n=[];let r=t,a=!1;for(;r<s.length;){const o=s[r];if(o===","){(a||r===t)&&n.push(""),a=!0,r++;continue}if(a=!1,o==="\\"){r+=2;continue}if(o==='"'){const[h,x]=h3(s,r+1,!0);n.push(h),r=x;continue}if(o==="}")return[n,r+1];if(o==="{"){const[h,x]=PE(s,r+1);n.push(h),r=x;continue}const[c,u]=h3(s,r,!1);n.push(c),r=u}return[n,r]}function aZ(s){const[t]=PE(s,1);return t}function EE(s){return`{${s.map(t=>Array.isArray(t)?EE(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var d6,u6;class Ds extends(u6=NE,d6=Ge,u6){constructor(){super(...arguments);fe(this,"foreignKeyConfigs",[])}array(n){return new _E(this.config.name,this,n)}references(n,r={}){return this.foreignKeyConfigs.push({ref:n,actions:r}),this}unique(n,r){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=r==null?void 0:r.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}
800buildForeignKeys(n,r){return this.foreignKeyConfigs.map(({ref:a,actions:o})=>rZ((c,u)=>{const h=new wE(()=>{const x=c();return{columns:[n],foreignColumns:[x]}});return u.onUpdate&&h.onUpdate(u.onUpdate),u.onDelete&&h.onDelete(u.onDelete),h.build(r)},a,o))}buildExtraConfigColumn(n){return new TE(n,this.config)}}fe(Ds,d6,"PgColumnBuilder");var m6,h6;class us extends(h6=ml,m6=Ge,h6){constructor(t,n){n.uniqueName||(n.uniqueName=CE(t,[n.name])),super(t,n),this.table=t}}fe(us,m6,"PgColumn");var f6,p6;class TE extends(p6=us,f6=Ge,p6){constructor(){super(...arguments);fe(this,"indexConfig",{order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass});fe(this,"defaultConfig",{order:"asc",nulls:"last",opClass:void 0})}getSQLType(){return this.getSQLType()}asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}fe(TE,f6,"ExtraConfigColumn");var x6;x6=Ge;class Dx{constructor(t,n,r,a){fe(this,"name");fe(this,"keyAsName");fe(this,"type");fe(this,"indexConfig");this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=a}}fe(Dx,x6,"IndexedColumn");var g6,y6;class _E extends(y6=Ds,g6=Ge,y6){constructor(t,n,r){super(t,"array","PgArray"),this.config.baseBuilder=n,this.config.size=r}build(t){const n=this.config.baseBuilder.build(t);return new G1(t,this.config,n)}}fe(_E,g6,"PgArrayBuilder");var v6,j6;const w0=class w0 extends(j6=us,v6=Ge,j6){constructor(n,r,a,o){super(n,r);fe(this,"size");this.baseColumn=a,this.range=o,this.size=r.size}getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(n){return typeof n=="string"&&(n=aZ(n)),n.map(r=>this.baseColumn.mapFromDriverValue(r))}mapToDriverValue(n,r=!1){const a=n.map(o=>o===null?null:Ps(this.baseColumn,w0)?this.baseColumn.mapToDriverValue(o,!0):this.baseColumn.mapToDriverValue(o));return r?a:EE(a)}};fe(w0,v6,"PgArray");let G1=w0;const f3=Symbol.for("drizzle:isPgEnum");function iZ(s){return!!s&&typeof s=="function"&&f3 in s&&s[f3]===!0}var b6;b6=Ge;class bd{constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}}fe(bd,b6,"Subquery");var N6,w6;class lZ extends(w6=bd,N6=Ge,w6){}fe(lZ,N6,"WithSubquery");const oZ={startActiveSpan(s,t){return t()}},Yo=Symbol.for("drizzle:ViewBaseConfig"),Ox=Symbol.for("drizzle:Schema"),p3=Symbol.for("drizzle:Columns"),x3=Symbol.for("drizzle:ExtraConfigColumns"),Cv=Symbol.for("drizzle:OriginalName"),Sv=Symbol.for("drizzle:BaseName"),v0=Symbol.for("drizzle:IsAlias"),g3=Symbol.for("drizzle:ExtraConfigBuilder"),IE=Symbol.for("drizzle:IsDrizzleTable");var A6,C6,S6,k6,$6,P6,E6,T6,_6,I6;I6=Ge,_6=Zo,T6=Cv,E6=Ox,P6=p3,$6=x3,k6=Sv,S6=v0,C6=IE,A6=g3;class pn{constructor(t,n,r){fe(this,_6);fe(this,T6);fe(this,E6);fe(this,P6);fe(this,$6);fe(this,k6);fe(this,S6,!1);fe(this,C6,!0);fe(this,A6);this[Zo]=this[Cv]=t,this[Ox]=n,this[Sv]=r}}fe(pn,I6,"Table"),fe(pn,"Symbol",{Name:Zo,Schema:Ox,OriginalName:Cv,Columns:p3,ExtraConfigColumns:x3,BaseName:Sv,IsAlias:v0,ExtraConfigBuilder:g3});function DE(s){return typeof s=="object"&&s!==null&&IE in s}function y3(s){return s[Zo]}function EJ(s){return`${s[Ox]??"public"}.${s[Zo]}`}var D6;D6=Ge;class cZ{}fe(cZ,D6,"FakePrimitiveParam");function dZ(s){return s!=null&&typeof s.getSQL=="function"}function uZ(s){var n;const t={sql:"",params:[]};for(const r of s)t.sql+=r.sql,t.params.push(...r.params),(n=r.typings)!=null&&n.length&&(t.typings||(t.typings=[]),t.typings.push(...r.typings));return t}var O6;O6=Ge;class Za{constructor(t){fe(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new hn([this])}}fe(Za,O6,"StringChunk");var F6;F6=Ge;const Kc=class Kc{constructor(t){fe(this,"decoder",OE);fe(this,"shouldInlineParams",!1);fe(this,"usedTables",[]);this.queryChunks=t;for(const n of t)if(Ps(n,pn)){const r=n[pn.Symbol.Schema];this.usedTables.push(r===void 0?n[pn.Symbol.Name]:r+"."+n[pn.Symbol.Name])}}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return oZ.startActiveSpan("drizzle.buildSQL",n=>{const r=this.buildQueryFromSourceParams(this.queryChunks,t);return n==null||n.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(t,n){const r=Object.assign({}
800,n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:c,prepareTyping:u,inlineParams:h,paramStartIndex:x}=r;return uZ(t.map(m=>{var g;if(Ps(m,Za))return{sql:m.value.join(""),params:[]};if(Ps(m,Qh))return{sql:o(m.value),params:[]};if(m===void 0)return{sql:"",params:[]};if(Array.isArray(m)){const y=[new Za("(")];for(const[b,w]of m.entries())y.push(w),b<m.length-1&&y.push(new Za(", "));return y.push(new Za(")")),this.buildQueryFromSourceParams(y,r)}if(Ps(m,Kc))return this.buildQueryFromSourceParams(m.queryChunks,{...r,inlineParams:h||m.shouldInlineParams});if(Ps(m,pn)){const y=m[pn.Symbol.Schema],b=m[pn.Symbol.Name];return{sql:y===void 0||m[v0]?o(b):o(y)+"."+o(b),params:[]}}if(Ps(m,ml)){const y=a.getColumnCasing(m);if(n.invokeSource==="indexes")return{sql:o(y),params:[]};const b=m.table[pn.Symbol.Schema];return{sql:m.table[v0]||b===void 0?o(m.table[pn.Symbol.Name])+"."+o(y):o(b)+"."+o(m.table[pn.Symbol.Name])+"."+o(y),params:[]}}if(Ps(m,Dj)){const y=m[Yo].schema,b=m[Yo].name;return{sql:y===void 0||m[Yo].isAlias?o(b):o(y)+"."+o(b),params:[]}}if(Ps(m,om)){if(Ps(m.value,pd))return{sql:c(x.value++,m),params:[m],typings:["none"]};const y=m.value===null?null:m.encoder.mapToDriverValue(m.value);if(Ps(y,Kc))return this.buildQueryFromSourceParams([y],r);if(h)return{sql:this.mapInlineParam(y,r),params:[]};let b=["none"];return u&&(b=[u(m.encoder)]),{sql:c(x.value++,y),params:[y],typings:b}}return Ps(m,pd)?{sql:c(x.value++,m),params:[m],typings:["none"]}:Ps(m,Kc.Aliased)&&m.fieldAlias!==void 0?{sql:o(m.fieldAlias),params:[]}:Ps(m,bd)?m._.isWith?{sql:o(m._.alias),params:[]}:this.buildQueryFromSourceParams([new Za("("),m._.sql,new Za(") "),new Qh(m._.alias)],r):iZ(m)?m.schema?{sql:o(m.schema)+"."+o(m.enumName),params:[]}:{sql:o(m.enumName),params:[]}:dZ(m)?(g=m.shouldOmitSQLParens)!=null&&g.call(m)?this.buildQueryFromSourceParams([m.getSQL()],r):this.buildQueryFromSourceParams([new Za("("),m.getSQL(),new Za(")")],r):h?{sql:this.mapInlineParam(m,r),params:[]}:{sql:c(x.value++,m),params:[m],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){const r=t.toString();return n(r==="[object Object]"?JSON.stringify(t):r)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new Kc.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}};fe(Kc,F6,"SQL");let hn=Kc;var R6;R6=Ge;class Qh{constructor(t){fe(this,"brand");this.value=t}getSQL(){return new hn([this])}}fe(Qh,R6,"Name");function TJ(s){return new Qh(s)}function _J(s){return typeof s=="object"&&s!==null&&"mapToDriverValue"in s&&typeof s.mapToDriverValue=="function"}const OE={mapFromDriverValue:s=>s},FE={mapToDriverValue:s=>s},IJ={...OE,...FE};var M6;M6=Ge;class om{constructor(t,n=FE){fe(this,"brand");this.value=t,this.encoder=n}getSQL(){return new hn([this])}}fe(om,M6,"Param");function DJ(s,t){return new om(s,t)}function j0(s,...t){const n=[];(t.length>0||s.length>0&&s[0]!=="")&&n.push(new Za(s[0]));for(const[r,a]of t.entries())n.push(a,new Za(s[r+1]));return new hn(n)}(s=>{function t(){return new hn([])}s.empty=t;function n(h){return new hn(h)}s.fromList=n;function r(h){return new hn([new Za(h)])}s.raw=r;function a(h,x){const m=[];for(const[g,y]of h.entries())g>0&&x!==void 0&&m.push(x),m.push(y);return new hn(m)}s.join=a;function o(h){return new Qh(h)}s.identifier=o;function c(h){return new pd(h)}s.placeholder=c;function u(h,x){return new om(h,x)}s.param=u})(j0||(j0={}));(s=>{var n;n=Ge;const r=class r{constructor(o,c){fe(this,"isSelectionField",!1);this.sql=o,this.fieldAlias=c}getSQL(){return this.sql}clone(){return new r(this.sql,this.fieldAlias)}};fe(r,n,"SQL.Aliased");let t=r;s.Aliased=t})(hn||(hn={}));var L6;L6=Ge;class pd{constructor(t){this.name=t}getSQL(){return new hn([this])}}fe(pd,L6,"Placeholder");function OJ(s){return new pd(s)}function FJ(s,t){return s.map(n=>{if(Ps(n,pd)){if(!(n.name in t))throw new Error(`No value for placeholder "${n.name}" was provided`);return t[n.name]}if(Ps(n,om)&&Ps(n.value,pd)){if(!(n.value.name in t))throw new Error(`No value for placeholder "${n.value.name}" was provided`);return n.encoder.mapToDriverValue(t[n.value.name])}return n})}const RE=Symbol.for("drizzle:IsDrizzleView");var V6,U6,z6;z6=Ge,U6=Yo,V6=RE;class Dj{constructor({name:t,schema:n,selectedFields:r,query:a}){fe(this,U6);fe(this,V6,!0);this[Yo]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new hn([this])}}fe(Dj,z6,"View");function mZ(s){return typeof s=="object"&&s!==null&&RE in s}function RJ(s){return s[Yo].name}ml.prototype.getSQL=function(){return new hn([this])};pn.prototype.getSQL=function(){return new hn([this])};bd.prototype.getSQL=function(){return new hn([this])};function MJ(s,t,n){const r={},a=s.reduce((o,{path:c,field:u},h)=>{let x;Ps(u,ml)?x=u:Ps(u,hn)?x=u.decoder:Ps(u,bd)?x=u._.sql.decoder:x=u.sql.decoder;let m=o;for(const[g,y]of c.entries())if(g<c.length-1)y in m||(m[y]={}),m=m[y];else{const b=t[h],w=m[y]=b===null?null:x.mapFromDriverValue(b);if(n&&Ps(u,ml)&&c.length===2){const N=c[0];N in r?typeof r[N]=="string"&&r[N]!==y3(u.table)&&(r[N]=!1):r[N]=w===null?y3(u.table):!1}}return o},{});if(n&&Object.keys(r).length>0)for(const[o,c]of Object.entries(r))typeof c=="string"&&!n[c]&&(a[o]=null);return a}function v3(s,t){return Object.entries(s).reduce((n,[r,a])=>{if(typeof r!="string")return n;const o=t?[...t,r]:[r];return Ps(a,ml)||Ps(a,hn)||Ps(a,hn.Aliased)||Ps(a,bd)?n.push({path:o,field:a}):Ps(a,pn)?n.push(...v3(a[pn.Symbol.Columns],o)):n.push(...v3(a,o)),n},[])}function LJ(s,t){const n=Object.keys(s),r=Object.keys(t);if(n.length!==r.length)return!1;
800for(const[a,o]of n.entries())if(o!==r[a])return!1;return!0}function VJ(s,t){const n=Object.entries(t).filter(([,r])=>r!==void 0).map(([r,a])=>Ps(a,hn)||Ps(a,ml)?[r,a]:[r,new om(a,s[pn.Symbol.Columns][r])]);if(n.length===0)throw new Error("No values to set");return Object.fromEntries(n)}function UJ(s,t){for(const n of t)for(const r of Object.getOwnPropertyNames(n.prototype))r!=="constructor"&&Object.defineProperty(s.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))}function hZ(s){return s[pn.Symbol.Columns]}function fZ(s){return s[Yo].selectedFields}function zJ(s){return Ps(s,bd)?s._.alias:Ps(s,Dj)?s[Yo].name:Ps(s,hn)?void 0:s[pn.Symbol.IsAlias]?s[pn.Symbol.Name]:s[pn.Symbol.BaseName]}function cr(s,t){return{name:typeof s=="string"&&s.length>0?s:"",config:typeof s=="object"?s:t}}function qJ(s){if(typeof s!="object"||s===null||s.constructor.name!=="Object")return!1;if("logger"in s){const t=typeof s.logger;return!(t!=="boolean"&&(t!=="object"||typeof s.logger.logQuery!="function")&&t!=="undefined")}if("schema"in s){const t=typeof s.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in s){const t=typeof s.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in s)return!(s.mode!=="default"||s.mode!=="planetscale"||s.mode!==void 0);if("connection"in s){const t=typeof s.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in s){const t=typeof s.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(s).length===0}const WJ=typeof TextDecoder>"u"?null:new TextDecoder;var q6,W6;class _f extends(W6=Ds,q6=Ge,W6){generatedAlwaysAsIdentity(t){if(t){const{name:n,...r}=t;this.config.generatedIdentity={type:"always",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(t){if(t){const{name:n,...r}=t;this.config.generatedIdentity={type:"byDefault",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}fe(_f,q6,"PgIntColumnBaseBuilder");var B6,K6;class ME extends(K6=_f,B6=Ge,K6){constructor(t){super(t,"number","PgBigInt53")}build(t){return new LE(t,this.config)}}fe(ME,B6,"PgBigInt53Builder");var H6,G6;class LE extends(G6=us,H6=Ge,G6){getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}}fe(LE,H6,"PgBigInt53");var Z6,Y6;class VE extends(Y6=_f,Z6=Ge,Y6){constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new UE(t,this.config)}}fe(VE,Z6,"PgBigInt64Builder");var Q6,X6;class UE extends(X6=us,Q6=Ge,X6){getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}}fe(UE,Q6,"PgBigInt64");function pZ(s,t){const{name:n,config:r}=cr(s,t);return r.mode==="number"?new ME(n):new VE(n)}var J6,e5;class zE extends(e5=Ds,J6=Ge,e5){constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new qE(t,this.config)}}
800fe(zE,J6,"PgBigSerial53Builder");var t5,s5;class qE extends(s5=us,t5=Ge,s5){getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}}fe(qE,t5,"PgBigSerial53");var n5,r5;class WE extends(r5=Ds,n5=Ge,r5){constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new BE(t,this.config)}}fe(WE,n5,"PgBigSerial64Builder");var a5,i5;class BE extends(i5=us,a5=Ge,i5){getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}}fe(BE,a5,"PgBigSerial64");function xZ(s,t){const{name:n,config:r}=cr(s,t);return r.mode==="number"?new zE(n):new WE(n)}var l5,o5;class KE extends(o5=Ds,l5=Ge,o5){constructor(t){super(t,"boolean","PgBoolean")}build(t){return new HE(t,this.config)}}fe(KE,l5,"PgBooleanBuilder");var c5,d5;class HE extends(d5=us,c5=Ge,d5){getSQLType(){return"boolean"}}fe(HE,c5,"PgBoolean");function qt(s){return new KE(s??"")}var u5,m5;class GE extends(m5=Ds,u5=Ge,m5){constructor(t,n){super(t,"string","PgChar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new ZE(t,this.config)}}fe(GE,u5,"PgCharBuilder");var h5,f5;class ZE extends(f5=us,h5=Ge,f5){constructor(){super(...arguments);fe(this,"length",this.config.length);fe(this,"enumValues",this.config.enumValues)}getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}fe(ZE,h5,"PgChar");function gZ(s,t={}){const{name:n,config:r}=cr(s,t);return new GE(n,r)}var p5,x5;class YE extends(x5=Ds,p5=Ge,x5){constructor(t){super(t,"string","PgCidr")}build(t){return new QE(t,this.config)}}fe(YE,p5,"PgCidrBuilder");var g5,y5;class QE extends(y5=us,g5=Ge,y5){getSQLType(){return"cidr"}}fe(QE,g5,"PgCidr");function yZ(s){return new YE(s??"")}var v5,j5;class XE extends(j5=Ds,v5=Ge,j5){constructor(t,n,r){super(t,"custom","PgCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(t){return new JE(t,this.config)}}fe(XE,v5,"PgCustomColumnBuilder");var b5,N5;class JE extends(N5=us,b5=Ge,N5){constructor(n,r){super(n,r);fe(this,"sqlName");fe(this,"mapTo");fe(this,"mapFrom");this.sqlName=r.customTypeParams.dataType(r.fieldConfig),this.mapTo=r.customTypeParams.toDriver,this.mapFrom=r.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom=="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo=="function"?this.mapTo(n):n}}fe(JE,b5,"PgCustomColumn");function vZ(s){return(t,n)=>{const{name:r,config:a}=cr(t,n);return new XE(r,a,s)}}var w5,A5;class cm extends(A5=Ds,w5=Ge,A5){defaultNow(){return this.default(j0`now()`)}}fe(cm,w5,"PgDateColumnBaseBuilder");var C5,S5;class eT extends(S5=cm,C5=Ge,S5){constructor(t){super(t,"date","PgDate")}build(t){return new tT(t,this.config)}}fe(eT,C5,"PgDateBuilder");var k5,$5;class tT extends($5=us,k5=Ge,$5){getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}}fe(tT,k5,"PgDate");var P5,E5;class sT extends(E5=cm,P5=Ge,E5){constructor(t){super(t,"string","PgDateString")}build(t){return new nT(t,this.config)}}fe(sT,P5,"PgDateStringBuilder");var T5,_5;class nT extends(_5=us,T5=Ge,_5){getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}}fe(nT,T5,"PgDateString");function yr(s,t){const{name:n,config:r}=cr(s,t);return(r==null?void 0:r.mode)==="date"?new eT(n):new sT(n)}var I5,D5;class rT extends(D5=Ds,I5=Ge,D5){constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new aT(t,this.config)}}fe(rT,I5,"PgDoublePrecisionBuilder");var O5,F5;class aT extends(F5=us,O5=Ge,F5){getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}}fe(aT,O5,"PgDoublePrecision");function jZ(s){return new rT(s??"")}var R5,M5;class iT extends(M5=Ds,R5=Ge,M5){constructor(t){super(t,"string","PgInet")}build(t){return new lT(t,this.config)}}fe(iT,R5,"PgInetBuilder");var L5,V5;class lT extends(V5=us,L5=Ge,V5){getSQLType(){return"inet"}}fe(lT,L5,"PgInet");function bZ(s){return new iT(s??"")}var U5,z5;class oT extends(z5=_f,U5=Ge,z5){constructor(t){super(t,"number","PgInteger")}build(t){return new cT(t,this.config)}}fe(oT,U5,"PgIntegerBuilder");var q5,W5;class cT extends(W5=us,q5=Ge,W5){getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}}fe(cT,q5,"PgInteger");function tt(s){return new oT(s??"")}var B5,K5;
800class dT extends(K5=Ds,B5=Ge,K5){constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new uT(t,this.config)}}fe(dT,B5,"PgIntervalBuilder");var H5,G5;class uT extends(G5=us,H5=Ge,G5){constructor(){super(...arguments);fe(this,"fields",this.config.intervalConfig.fields);fe(this,"precision",this.config.intervalConfig.precision)}getSQLType(){const n=this.fields?` ${this.fields}`:"",r=this.precision?`(${this.precision})`:"";return`interval${n}${r}`}}fe(uT,H5,"PgInterval");function NZ(s,t={}){const{name:n,config:r}=cr(s,t);return new dT(n,r)}var Z5,Y5;class mT extends(Y5=Ds,Z5=Ge,Y5){constructor(t){super(t,"json","PgJson")}build(t){return new hT(t,this.config)}}fe(mT,Z5,"PgJsonBuilder");var Q5,X5;class hT extends(X5=us,Q5=Ge,X5){constructor(t,n){super(t,n)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}fe(hT,Q5,"PgJson");function wZ(s){return new mT(s??"")}var J5,e9;class fT extends(e9=Ds,J5=Ge,e9){constructor(t){super(t,"json","PgJsonb")}build(t){return new pT(t,this.config)}}fe(fT,J5,"PgJsonbBuilder");var t9,s9;class pT extends(s9=us,t9=Ge,s9){constructor(t,n){super(t,n)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}fe(pT,t9,"PgJsonb");function Zu(s){return new fT(s??"")}var n9,r9;class xT extends(r9=Ds,n9=Ge,r9){constructor(t){super(t,"array","PgLine")}build(t){return new gT(t,this.config)}}fe(xT,n9,"PgLineBuilder");var a9,i9;class gT extends(i9=us,a9=Ge,i9){getSQLType(){return"line"}mapFromDriverValue(t){const[n,r,a]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r),Number.parseFloat(a)]}mapToDriverValue(t){return`{${t[0]},${t[1]},${t[2]}}`}}fe(gT,a9,"PgLine");var l9,o9;class yT extends(o9=Ds,l9=Ge,o9){constructor(t){super(t,"json","PgLineABC")}build(t){return new vT(t,this.config)}}fe(yT,l9,"PgLineABCBuilder");var c9,d9;class vT extends(d9=us,c9=Ge,d9){getSQLType(){return"line"}mapFromDriverValue(t){const[n,r,a]=t.slice(1,-1).split(",");return{a:Number.parseFloat(n),b:Number.parseFloat(r),c:Number.parseFloat(a)}}mapToDriverValue(t){return`{${t.a},${t.b},${t.c}}`}}fe(vT,c9,"PgLineABC");function AZ(s,t){const{name:n,config:r}=cr(s,t);return!(r!=null&&r.mode)||r.mode==="tuple"?new xT(n):new yT(n)}var u9,m9;class jT extends(m9=Ds,u9=Ge,m9){constructor(t){super(t,"string","PgMacaddr")}build(t){return new bT(t,this.config)}}fe(jT,u9,"PgMacaddrBuilder");var h9,f9;class bT extends(f9=us,h9=Ge,f9){getSQLType(){return"macaddr"}}fe(bT,h9,"PgMacaddr");function CZ(s){return new jT(s??"")}var p9,x9;class NT extends(x9=Ds,p9=Ge,x9){constructor(t){super(t,"string","PgMacaddr8")}build(t){return new wT(t,this.config)}}fe(NT,p9,"PgMacaddr8Builder");var g9,y9;class wT extends(y9=us,g9=Ge,y9){getSQLType(){return"macaddr8"}}fe(wT,g9,"PgMacaddr8");function SZ(s){return new NT(s??"")}var v9,j9;class AT extends(j9=Ds,v9=Ge,j9){constructor(t,n,r){super(t,"string","PgNumeric"),this.config.precision=n,this.config.scale=r}build(t){return new CT(t,this.config)}}fe(AT,v9,"PgNumericBuilder");var b9,N9;class CT extends(N9=us,b9=Ge,N9){constructor(n,r){super(n,r);fe(this,"precision");fe(this,"scale");this.precision=r.precision,this.scale=r.scale}mapFromDriverValue(n){return typeof n=="string"?n:String(n)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}fe(CT,b9,"PgNumeric");var w9,A9;class ST extends(A9=Ds,w9=Ge,A9){constructor(t,n,r){super(t,"number","PgNumericNumber"),this.config.precision=n,this.config.scale=r}build(t){return new kT(t,this.config)}}fe(ST,w9,"PgNumericNumberBuilder");var C9,S9;class kT extends(S9=us,C9=Ge,S9){constructor(n,r){super(n,r);fe(this,"precision");fe(this,"scale");fe(this,"mapToDriverValue",String);this.precision=r.precision,this.scale=r.scale}mapFromDriverValue(n){return typeof n=="number"?n:Number(n)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}fe(kT,C9,"PgNumericNumber");var k9,$9;class $T extends($9=Ds,k9=Ge,$9){constructor(t,n,r){super(t,"bigint","PgNumericBigInt"),this.config.precision=n,this.config.scale=r}build(t){return new PT(t,this.config)}}fe($T,k9,"PgNumericBigIntBuilder");var P9,E9;class PT extends(E9=us,P9=Ge,E9){constructor(n,r){super(n,r);fe(this,"precision");fe(this,"scale");fe(this,"mapFromDriverValue",BigInt);fe(this,"mapToDriverValue",String);this.precision=r.precision,this.scale=r.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}fe(PT,P9,"PgNumericBigInt");function ET(s,t){const{name:n,config:r}=cr(s,t),a=r==null?void 0:r.mode;return a==="number"?new ST(n,r==null?void 0:r.precision,r==null?void 0:r.scale):a==="bigint"?new $T(n,r==null?void 0:r.precision,r==null?void 0:r.scale):new AT(n,r==null?void 0:r.precision,r==null?void 0:r.scale)}const ei=ET;var T9,_9;class TT extends(_9=Ds,T9=Ge,_9){constructor(t){super(t,"array","PgPointTuple")}build(t){return new _T(t,this.config)}}fe(TT,T9,"PgPointTupleBuilder");var I9,D9;class _T extends(D9=us,I9=Ge,D9){getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){const[n,r]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r)]}return[t.x,t.y]}mapToDriverValue(t){return`(${t[0]},${t[1]})`}}fe(_T,I9,"PgPointTuple");var O9,F9;class IT extends(F9=Ds,O9=Ge,F9){constructor(t){super(t,"json","PgPointObject")}build(t){return new DT(t,this.config)}}fe(IT,O9,"PgPointObjectBuilder");var R9,M9;class DT extends(M9=us,R9=Ge,M9){getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){const[n,r]=t.slice(1,-1).split(",");return{x:Number.parseFloat(n),y:Number.parseFloat(r)}}return t}mapToDriverValue(t){return`(${t.x},${t.y})`}}fe(DT,R9,"PgPointObject");function kZ(s,t){const{name:n,config:r}=cr(s,t);return!(r!=null&&r.mode)||r.mode==="tuple"?new TT(n):new IT(n)}function $Z(s){const t=[];for(let n=0;n<s.length;n+=2)t.push(Number.parseInt(s.slice(n,n+2),16));return new Uint8Array(t)}function j3(s,t){const n=new ArrayBuffer(8),r=new DataView(n);for(let a=0;a<8;a++)r.setUint8(a,s[t+a]);return r.getFloat64(0,!0)}function OT(s){const t=$Z(s);let n=0;const r=t[n];n+=1;const a=new DataView(t.buffer),o=a.getUint32(n,r===1);if(n+=4,o&536870912&&(a.getUint32(n,r===1),n+=4),(o&65535)===1){const c=j3(t,n);n+=8;const u=j3(t,n);return n+=8,[c,u]}throw new Error("Unsupported geometry type")}var L9,V9;class FT extends(V9=Ds,L9=Ge,V9){constructor(t){super(t,"array","PgGeometry")}build(t){return new RT(t,this.config)}}fe(FT,L9,"PgGeometryBuilder");var U9,z9;class RT extends(z9=us,U9=Ge,z9){getSQLType(){return"geometry(point)"}
800mapFromDriverValue(t){return OT(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}}fe(RT,U9,"PgGeometry");var q9,W9;class MT extends(W9=Ds,q9=Ge,W9){constructor(t){super(t,"json","PgGeometryObject")}build(t){return new LT(t,this.config)}}fe(MT,q9,"PgGeometryObjectBuilder");var B9,K9;class LT extends(K9=us,B9=Ge,K9){getSQLType(){return"geometry(point)"}mapFromDriverValue(t){const n=OT(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}}fe(LT,B9,"PgGeometryObject");function PZ(s,t){const{name:n,config:r}=cr(s,t);return!(r!=null&&r.mode)||r.mode==="tuple"?new FT(n):new MT(n)}var H9,G9;class VT extends(G9=Ds,H9=Ge,G9){constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new UT(t,this.config)}}fe(VT,H9,"PgRealBuilder");var Z9,Y9;class UT extends(Y9=us,Z9=Ge,Y9){constructor(n,r){super(n,r);fe(this,"mapFromDriverValue",n=>typeof n=="string"?Number.parseFloat(n):n)}getSQLType(){return"real"}}fe(UT,Z9,"PgReal");function zT(s){return new VT(s??"")}var Q9,X9;class qT extends(X9=Ds,Q9=Ge,X9){constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new WT(t,this.config)}}fe(qT,Q9,"PgSerialBuilder");var J9,eA;class WT extends(eA=us,J9=Ge,eA){getSQLType(){return"serial"}}fe(WT,J9,"PgSerial");function as(s){return new qT(s??"")}var tA,sA;class BT extends(sA=_f,tA=Ge,sA){constructor(t){super(t,"number","PgSmallInt")}build(t){return new KT(t,this.config)}}fe(BT,tA,"PgSmallIntBuilder");var nA,rA;class KT extends(rA=us,nA=Ge,rA){constructor(){super(...arguments);fe(this,"mapFromDriverValue",n=>typeof n=="string"?Number(n):n)}getSQLType(){return"smallint"}}fe(KT,nA,"PgSmallInt");function EZ(s){return new BT(s??"")}var aA,iA;class HT extends(iA=Ds,aA=Ge,iA){constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new GT(t,this.config)}}fe(HT,aA,"PgSmallSerialBuilder");var lA,oA;class GT extends(oA=us,lA=Ge,oA){getSQLType(){return"smallserial"}}fe(GT,lA,"PgSmallSerial");function TZ(s){return new HT(s??"")}var cA,dA;class ZT extends(dA=Ds,cA=Ge,dA){constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new YT(t,this.config)}}fe(ZT,cA,"PgTextBuilder");var uA,mA;class YT extends(mA=us,uA=Ge,mA){constructor(){super(...arguments);fe(this,"enumValues",this.config.enumValues)}getSQLType(){return"text"}}fe(YT,uA,"PgText");function de(s,t={}){const{name:n,config:r}=cr(s,t);return new ZT(n,r)}var hA,fA;class QT extends(fA=cm,hA=Ge,fA){constructor(t,n,r){super(t,"string","PgTime"),this.withTimezone=n,this.precision=r,this.config.withTimezone=n,this.config.precision=r}build(t){return new XT(t,this.config)}}fe(QT,hA,"PgTimeBuilder");var pA,xA;class XT extends(xA=us,pA=Ge,xA){constructor(n,r){super(n,r);fe(this,"withTimezone");fe(this,"precision");this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}fe(XT,pA,"PgTime");function _Z(s,t={}){const{name:n,config:r}=cr(s,t);return new QT(n,r.withTimezone??!1,r.precision)}var gA,yA;class JT extends(yA=cm,gA=Ge,yA){constructor(t,n,r){super(t,"date","PgTimestamp"),this.config.withTimezone=n,this.config.precision=r}build(t){return new e_(t,this.config)}}fe(JT,gA,"PgTimestampBuilder");var vA,jA;class e_ extends(jA=us,vA=Ge,jA){constructor(n,r){super(n,r);fe(this,"withTimezone");fe(this,"precision");fe(this,"mapToDriverValue",n=>n.toISOString());this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(n){return typeof n=="string"?new Date(this.withTimezone?n:n+"+0000"):n}}fe(e_,vA,"PgTimestamp");var bA,NA;class t_ extends(NA=cm,bA=Ge,NA){constructor(t,n,r){super(t,"string","PgTimestampString"),this.config.withTimezone=n,this.config.precision=r}build(t){return new s_(t,this.config)}}fe(t_,bA,"PgTimestampStringBuilder");var wA,AA;class s_ extends(AA=us,wA=Ge,AA){constructor(n,r){super(n,r);fe(this,"withTimezone");fe(this,"precision");this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}
800${this.withTimezone?" with time zone":""}`}mapFromDriverValue(n){if(typeof n=="string")return n;const r=n.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){const a=n.getTimezoneOffset(),o=a<=0?"+":"-";return`${r}${o}${Math.floor(Math.abs(a)/60).toString().padStart(2,"0")}`}return r}}fe(s_,wA,"PgTimestampString");function Re(s,t={}){const{name:n,config:r}=cr(s,t);return(r==null?void 0:r.mode)==="string"?new t_(n,r.withTimezone??!1,r.precision):new JT(n,(r==null?void 0:r.withTimezone)??!1,r==null?void 0:r.precision)}var CA,SA;class n_ extends(SA=Ds,CA=Ge,SA){constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(j0`gen_random_uuid()`)}build(t){return new r_(t,this.config)}}fe(n_,CA,"PgUUIDBuilder");var kA,$A;class r_ extends($A=us,kA=Ge,$A){getSQLType(){return"uuid"}}fe(r_,kA,"PgUUID");function IZ(s){return new n_(s??"")}var PA,EA;class a_ extends(EA=Ds,PA=Ge,EA){constructor(t,n){super(t,"string","PgVarchar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new i_(t,this.config)}}fe(a_,PA,"PgVarcharBuilder");var TA,_A;class i_ extends(_A=us,TA=Ge,_A){constructor(){super(...arguments);fe(this,"length",this.config.length);fe(this,"enumValues",this.config.enumValues)}getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}fe(i_,TA,"PgVarchar");function it(s,t={}){const{name:n,config:r}=cr(s,t);return new a_(n,r)}var IA,DA;class l_ extends(DA=Ds,IA=Ge,DA){constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new o_(t,this.config)}}fe(l_,IA,"PgBinaryVectorBuilder");var OA,FA;class o_ extends(FA=us,OA=Ge,FA){constructor(){super(...arguments);fe(this,"dimensions",this.config.dimensions)}getSQLType(){return`bit(${this.dimensions})`}}fe(o_,OA,"PgBinaryVector");function DZ(s,t){const{name:n,config:r}=cr(s,t);return new l_(n,r)}var RA,MA;class c_ extends(MA=Ds,RA=Ge,MA){constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new d_(t,this.config)}}fe(c_,RA,"PgHalfVectorBuilder");var LA,VA;class d_ extends(VA=us,LA=Ge,VA){constructor(){super(...arguments);fe(this,"dimensions",this.config.dimensions)}getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}}fe(d_,LA,"PgHalfVector");function OZ(s,t){const{name:n,config:r}=cr(s,t);return new c_(n,r)}var UA,zA;class u_ extends(zA=Ds,UA=Ge,zA){constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new m_(t,this.config)}}fe(u_,UA,"PgSparseVectorBuilder");var qA,WA;class m_ extends(WA=us,qA=Ge,WA){constructor(){super(...arguments);fe(this,"dimensions",this.config.dimensions)}getSQLType(){return`sparsevec(${this.dimensions})`}}fe(m_,qA,"PgSparseVector");function FZ(s,t){const{name:n,config:r}=cr(s,t);return new u_(n,r)}var BA,KA;class h_ extends(KA=Ds,BA=Ge,KA){constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new f_(t,this.config)}}fe(h_,BA,"PgVectorBuilder");var HA,GA;class f_ extends(GA=us,HA=Ge,GA){constructor(){super(...arguments);fe(this,"dimensions",this.config.dimensions)}getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}}fe(f_,HA,"PgVector");function RZ(s,t){const{name:n,config:r}=cr(s,t);return new h_(n,r)}function MZ(){return{bigint:pZ,bigserial:xZ,boolean:qt,char:gZ,cidr:yZ,customType:vZ,date:yr,doublePrecision:jZ,inet:bZ,integer:tt,interval:NZ,json:wZ,jsonb:Zu,line:AZ,macaddr:CZ,macaddr8:SZ,numeric:ET,point:kZ,geometry:PZ,real:zT,serial:as,smallint:EZ,smallserial:TZ,text:de,time:_Z,timestamp:Re,uuid:IZ,varchar:it,bit:DZ,halfvec:OZ,sparsevec:FZ,vector:RZ}}const Z1=Symbol.for("drizzle:PgInlineForeignKeys"),b3=Symbol.for("drizzle:EnableRLS");var ZA,YA,QA,XA,JA,e8;class Ch extends(e8=pn,JA=Ge,XA=Z1,QA=b3,YA=pn.Symbol.ExtraConfigBuilder,ZA=pn.Symbol.ExtraConfigColumns,e8){constructor(){super(...arguments);fe(this,XA,[]);fe(this,QA,!1);fe(this,YA);fe(this,ZA,{})}}fe(Ch,JA,"PgTable"),fe(Ch,"Symbol",Object.assign({},pn.Symbol,{InlineForeignKeys:Z1,EnableRLS:b3}));function LZ(s,t,n,r,a=s){const o=new Ch(s,r,a),c=typeof t=="function"?t(MZ()):t,u=Object.fromEntries(Object.entries(c).map(([m,g])=>{const y=g;y.setName(m);const b=y.build(o);return o[Z1].push(...y.buildForeignKeys(b,o)),[m,b]})),h=Object.fromEntries(Object.entries(c).map(([m,g])=>{const y=g;y.setName(m);const b=y.buildExtraConfigColumn(o);return[m,b]})),x=Object.assign(o,u);return x[pn.Symbol.Columns]=u,x[pn.Symbol.ExtraConfigColumns]=h,n&&(x[Ch.Symbol.ExtraConfigBuilder]=n),Object.assign(x,{enableRLS:()=>(x[Ch.Symbol.EnableRLS]=!0,x)})}const Qt=(s,t,n)=>LZ(s,t,n,void 0);var t8;t8=Ge;class p_{constructor(t,n){this.unique=t,this.name=n}on(...t){return new Fx(t.map(n=>{if(Ps(n,hn))return n;n=n;const r=new Dx(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,!1,this.name)}onOnly(...t){return new Fx(t.map(n=>{if(Ps(n,hn))return n;n=n;const r=new Dx(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new Fx(n.map(r=>{if(Ps(r,hn))return r;r=r;const a=new Dx(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}}fe(p_,t8,"PgIndexBuilderOn");var s8;s8=Ge;class Fx{constructor(t,n,r,a,o="btree"){fe(this,"config");this.config={name:a,columns:t,unique:n,only:r,method:o}}concurrently(){return this.config.concurrently=!0,this}with(t){return this.config.with=t,this}where(t){return this.config.where=t,this}build(t){return new x_(this.config,t)}}fe(Fx,s8,"PgIndexBuilder");var n8;n8=Ge;class x_{constructor(t,n){fe(this,"config");this.config={...t,table:n}}}fe(x_,n8,"PgIndex");function Gn(s){return new p_(!1,s)}const kn={INT8_MIN:-128,INT8_MAX:127,INT8_UNSIGNED_MAX:255,INT16_MIN:-32768,INT16_MAX:32767,INT16_UNSIGNED_MAX:65535,INT24_MIN:-8388608,INT24_MAX:8388607,INT24_UNSIGNED_MAX:16777215,INT32_MIN:-2147483648,INT32_MAX:2147483647,INT32_UNSIGNED_MAX:4294967295,INT48_MIN:-0x800000000000,INT48_MAX:0x7fffffffffff,INT48_UNSIGNED_MAX:0xffffffffffff,INT64_MIN:-9223372036854775808n,INT64_MAX:9223372036854775807n,INT64_UNSIGNED_MAX:18446744073709551615n};function Ln(s,t){return t.includes(s.columnType)}
800function VZ(s){return"enumValues"in s&&Array.isArray(s.enumValues)&&s.enumValues.length>0}const UZ=te.union([te.string(),te.number(),te.boolean(),te.null()]),zZ=te.union([UZ,te.record(te.any()),te.array(te.any())]),qZ=te.custom(s=>s instanceof Buffer);function g_(s,t){const n=(t==null?void 0:t.zodInstance)??te,r=(t==null?void 0:t.coerce)??{};let a;return VZ(s)&&(a=s.enumValues.length?n.enum(s.enumValues):n.string()),a||(Ln(s,["PgGeometry","PgPointTuple"])?a=n.tuple([n.number(),n.number()]):Ln(s,["PgGeometryObject","PgPointObject"])?a=n.object({x:n.number(),y:n.number()}):Ln(s,["PgHalfVector","PgVector"])?(a=n.array(n.number()),a=s.dimensions?a.length(s.dimensions):a):Ln(s,["PgLine"])?a=n.tuple([n.number(),n.number(),n.number()]):Ln(s,["PgLineABC"])?a=n.object({a:n.number(),b:n.number(),c:n.number()}):Ln(s,["PgArray"])?(a=n.array(g_(s.baseColumn,n)),a=s.size?a.length(s.size):a):s.dataType==="array"?a=n.array(n.any()):s.dataType==="number"?a=WZ(s,n,r):s.dataType==="bigint"?a=BZ(s,n,r):s.dataType==="boolean"?a=r===!0||r.boolean?n.coerce.boolean():n.boolean():s.dataType==="date"?a=r===!0||r.date?n.coerce.date():n.date():s.dataType==="string"?a=KZ(s,n,r):s.dataType==="json"?a=zZ:s.dataType==="custom"?a=n.any():s.dataType==="buffer"&&(a=qZ)),a||(a=n.any()),a}function WZ(s,t,n){let r=s.getSQLType().includes("unsigned"),a,o,c=!1;Ln(s,["MySqlTinyInt","SingleStoreTinyInt"])?(a=r?0:kn.INT8_MIN,o=r?kn.INT8_UNSIGNED_MAX:kn.INT8_MAX,c=!0):Ln(s,["PgSmallInt","PgSmallSerial","MySqlSmallInt","SingleStoreSmallInt"])?(a=r?0:kn.INT16_MIN,o=r?kn.INT16_UNSIGNED_MAX:kn.INT16_MAX,c=!0):Ln(s,["PgReal","MySqlFloat","MySqlMediumInt","SingleStoreMediumInt","SingleStoreFloat"])?(a=r?0:kn.INT24_MIN,o=r?kn.INT24_UNSIGNED_MAX:kn.INT24_MAX,c=Ln(s,["MySqlMediumInt","SingleStoreMediumInt"])):Ln(s,["PgInteger","PgSerial","MySqlInt","SingleStoreInt"])?(a=r?0:kn.INT32_MIN,o=r?kn.INT32_UNSIGNED_MAX:kn.INT32_MAX,c=!0):Ln(s,["PgDoublePrecision","MySqlReal","MySqlDouble","SingleStoreReal","SingleStoreDouble","SQLiteReal"])?(a=r?0:kn.INT48_MIN,o=r?kn.INT48_UNSIGNED_MAX:kn.INT48_MAX):Ln(s,["PgBigInt53","PgBigSerial53","MySqlBigInt53","MySqlSerial","SingleStoreBigInt53","SingleStoreSerial","SQLiteInteger"])?(r=r||Ln(s,["MySqlSerial","SingleStoreSerial"]),a=r?0:Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,c=!0):Ln(s,["MySqlYear","SingleStoreYear"])?(a=1901,o=2155,c=!0):(a=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER);let u=n===!0||n!=null&&n.number?t.coerce.number():t.number();return u=u.min(a).max(o),c?u.int():u}function BZ(s,t,n){const r=s.getSQLType().includes("unsigned"),a=r?0n:kn.INT64_MIN,o=r?kn.INT64_UNSIGNED_MAX:kn.INT64_MAX;return(n===!0||n!=null&&n.bigint?t.coerce.bigint():t.bigint()).min(a).max(o)}function KZ(s,t,n){if(Ln(s,["PgUUID"]))return t.string().uuid();let r,a,o=!1;Ln(s,["PgVarchar","SQLiteText"])?r=s.length:Ln(s,["MySqlVarChar","SingleStoreVarChar"])?r=s.length??kn.INT16_UNSIGNED_MAX:Ln(s,["MySqlText","SingleStoreText"])&&(s.textType==="longtext"?r=kn.INT32_UNSIGNED_MAX:s.textType==="mediumtext"?r=kn.INT24_UNSIGNED_MAX:s.textType==="text"?r=kn.INT16_UNSIGNED_MAX:r=kn.INT8_UNSIGNED_MAX),Ln(s,["PgChar","MySqlChar","SingleStoreChar"])&&(r=s.length,o=!0),Ln(s,["PgBinaryVector"])&&(a=/^[01]+$/,r=s.dimensions);let c=n===!0||n!=null&&n.string?t.coerce.string():t.string();return c=a?c.regex(a):c,r&&o?c.length(r):r?c.max(r):c}function y_(s){return DE(s)?hZ(s):fZ(s)}function v_(s,t,n,r){const a={};for(const[o,c]of Object.entries(s)){if(!Ps(c,ml)&&!Ps(c,hn)&&!Ps(c,hn.Aliased)&&typeof c=="object"){const g=DE(c)||mZ(c)?y_(c):c;a[o]=v_(g,t[o]??{},n,r);continue}const u=t[o];if(u!==void 0&&typeof u!="function"){a[o]=u;continue}const h=Ps(c,ml)?c:void 0,x=h?g_(h,r):te.any(),m=typeof u=="function"?u(x):x;n.never(h)||(a[o]=m,h&&(n.nullable(h)&&(a[o]=a[o].nullable()),n.optional(h)&&(a[o]=a[o].optional())))}return te.object(a)}const HZ={never:s=>{var t,n;return((t=s==null?void 0:s.generated)==null?void 0:t.type)==="always"||((n=s==null?void 0:s.generatedIdentity)==null?void 0:n.type)==="always"},optional:s=>!s.notNull||s.notNull&&s.hasDefault,nullable:s=>!s.notNull},Es=(s,t)=>{const n=y_(s);return v_(n,{},HZ)},GZ={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6\\d{4}",[5]],["[2-47]\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4}
800)","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[02-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|7[67])|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-79]\\d{7}"]]],AR
vendor: 5,619 bytes, line 800
800:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[["3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:(?:11[0-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68])))\\d{6}|(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}",[10]],["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|9(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:675\\d|9(?:11[0-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68]))))\\d{6}|9(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"],["800\\d{7,8}"],["60[04579]\\d{7}",[10]],0,0,["810\\d{7}",[10]]]],
vendor: 3,316 bytes, line 800
800AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684",[["684(?:274|6(?:22|33|44|55|77|88|9[19]))\\d{4}"],["684(?:2(?:48|5[2468]|7[246])|7(?:3[13]|70|82))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["1(?:11\\d|[2-9]\\d{3,11})|(?:316|463)\\d{3,10}|648[34]\\d{3,9}|(?:51|66|73)2\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-7]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}"],["6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}",[7,8,9,10,11,12,13]],["800\\d{6,10}",[9,10,11,12,13]],["(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}",[9,10,11,12,13]],0,0,0,0,["5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}",[5,6,7,8,9,10,11,12,13]],["8(?:10|2[018])\\d{6,10}|828\\d{5}",[8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[["5(?:2\\d|8[1-9])\\d{4}"],["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4
800-8]))\\d{4}"],["800\\d{4}"],["900\\d{4}"],0,0,0,0,["(?:28\\d|501)\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[["18[1-8]\\d{3,6}",[6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}"],["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"],["88\\d{7}"],["900200\\d{3}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}",[8]],["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"],["8[08]\\d{6}",[8]],["9[0246]\\d{6}",[8]],0,0,["703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}",[8]],0,0,["8[12]\\d{6}",[8]]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246",[["246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}"],["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:246976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,["246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}"],0,["24631\\d{5}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[["(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:[23]\\d|[45])\\d\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}"],["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]],["80[03]\\d{7}",[10]],0,0,0,0,0,["96(?:0[1-69]|1[0-479]|2[278]|3[13-9]|4[0-47-9]|54|6[69]|7[78]|88)\\d{6}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[["80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}",[8]],["4[5-9]\\d{7}",[9]],["800[1-9]\\d{4}",[8]],["(?:70(?:2[0-57]|3[04-7]|44|6[04-69]|7[0579])|90\\d\\d)\\d{4}",[8]],0,0,["78(?:0[578]|1[014-8]|2[25]|3[15-8]|48|5[05]|60|7[06-8]|9\\d)\\d{4}",[8]],0,0,["7879\\d{4}",[8]]]],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]],0,0,0,0,0,0,[["2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[01
80079])|5(?:[34]\\d|50|6[5-8]))\\d{4}"],["(?:0[1-7]|4[4-6]|5[0-8]|[67]\\d)\\d{6}"]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}",[6,7,8]],["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]],["(?:00800\\d\\d|800)\\d{5}",[8,12]],["90\\d{6}",[8]],0,0,0,0,0,["700\\d{5}",[8]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]],0,0,0,0,0,0,[["(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}"],["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"],["8[02369]\\d{6}"],["(?:87|9[0-8])\\d{6}"],0,0,0,0,0,["84\\d{6}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[["(?:22|31)\\d{6}"],["(?:29|6[1-9]|7[125-9])\\d{6}"]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]],0,0,0,0,0,0,[["012\\d{7}",[10]],["01(?:2[5-9]|[4-69]\\d)\\d{6}",[10]],0,0,0,0,["81\\d{6}",[8]],0,["857[58]\\d{4}",[8]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441",[["441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}"],["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}"],["(?:22[89]|[78]\\d\\d)\\d{4}"],0,0,0,0,0,0,["5[34]\\d{5}"]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[["(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}",[8]],["(?:57|[67]\\d)\\d{6}",[8]],["8001[07]\\d{4}",[9]],0,0,0,0,0,["50\\d{6}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[["(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}"],["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",[10]],["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]],["800\\d{6,7}",[9,10]],["[59]00\\d{6,7}",[9,10]],0,0,0,0,0,["(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370|864))\\d{4}|300\\d{5}",[8,10]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242",[["242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}"],["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"],["242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,["242225\\d{4}"]]],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]],0,0,0,0,0,0,[["(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}",[7]],["(?:1[67]|[78]7)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}",[7]],["(?:321|7(?:[1-8]\\d|9[03]))\\d{5}",[8]],["(?:0800|800\\d)\\d{6}",[10]],["90\\d{5}",[7]],0,0,0,0,["79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[["(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",[9]],["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]],["800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}"],["(?:810|902)\\d{7}",[10]],0,0,0,0,["249\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[["(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}",[7]],["6[0-35-7]\\d{5}",[7]],["0800\\d{7}",[11]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:12|573)\\d\\d|276)\\d{5}|[1-6]\\d{6}"],["88\\d{5}|(?:8[0-69]|9[016-9])\\d{7}",[7,9]]]],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]],0,0,0,0,0,0,[["(?:2[12]|61)\\d{6}"],["7[02-7]\\d{6}"],0,["8776\\d{4}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[["222[1-589]\\d{5}"],["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"],0,["80[0-2]\\d{6}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",[9]],["(?:6[89]|7[235-9])\\d{7}",[9]],["800\\d{6}",[9]],["90[016]\\d{6}",[9]],["878\\d{6}",[9]],["860\\d{9}",[12]],["5[18]\\d{7}",[9]],["74[0248]\\d{6}",[9]],0,["84[0248]\\d{6}",[9]]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[["2(?:[15]\\d{3}|7(?:2(?:0[23]|1[2357]|2[245]|3[45]|4[3-5])|3(?:06|1[69]|[2-6]7)))\\d{5}"],["0[157]\\d{8}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["(?:2\\d|3[13-7]|4[1-5])\\d{3}"],["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:(?:[24]\\d|50)\\d|3(?:[0346-9]\\d|1[0-35-9]|2[1-9]|5[0-24-9])|600)|646[59])|(?:600|80[1-9])\\d\\d|9(?:(?:10[0-2]|7[1-9]\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]],["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:(?:[24]\\d|50)\\d|3(?:[0346-9]\\d|1[0-35-9]|2[1-9]|5[0-24-9])|600)|646[59])|80[1-8]\\d\\d|9(?:(?:10[0-2]|7[1-9]\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]],["(?:123|8)00\\d{6}",[9,11]],0,0,0,0,0,["44\\d{7}",[9]],["600\\d{7,8}",[10,11]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[["2(?:22|33)\\d{6}",[9]],["(?:24[23]|6(?:[25-9]\\d|4[0-2]))\\d{6}",[9]],["88\\d{6,7}"]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4}
800)","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,[["(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|2(?:[02-57-9]\\d{3}|1(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))|(?:41[03]|8078|9(?:78|94))\\d\\d)\\d{5}|(?:10|2[0-57-9])(?:1(?:00|23)\\d\\d|95\\d{3,4})|(?:41[03]|9(?:78|94))(?:100\\d\\d|95\\d{3,4})|8078123|(?:43[35]|754|851)\\d{7,8}|(?:43[35]|754|851)(?:1(?:00\\d|23)\\d|95\\d{3,4})|(?:3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[13-9]\\d{6}|2(?:[0-24-9]\\d{5}|3\\d(?:\\d{4})?))|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[24-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[13-9]\\d{5}|2(?:[0-24-9]\\d{4}|3\\d(?:\\d{3})?))|9(?:[0-46-9]\\d{5}|5\\d{3,5}))",[7,8,9,10,11]],["1(?:610\\d|740[0-5])\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]],["(?:(?:10|21)8|8)00\\d{7}",[10,12]],["16[08]\\d{5}",[8]],0,0,0,0,0,["10(?:10\\d{4}|96\\d{3,4})|400\\d{7}|950\\d{7,8}|(?:2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",[7,8,9,10,11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?",0,0,0,[["601055(?:[0-4]\\d|50)\\d\\d|6010(?:[0-4]\\d|5[0-4])\\d{4}|(?:46|60(?:[18][1-9]|[24-7][2-9]))\\d{6}",[8,10]],["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:(?:0[0-5]|1\\d|5[01]|70)\\d|2(?:[0-3]\\d|4[1-9])|3(?:00|3[0-24-9]))|9(?:101|408))\\d{6}",[10]],["1800\\d{7}",[11]],["(?:19(?:0[01]|4[78])|901)\\d{7}",[10,11]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[["210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}",[8]],["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]],["800\\d{7}",[10]],["90[059]\\d{7}",[10]],0,0,0,0,["(?:210[0-6]|4\\d{3}|5100)\\d{4}",[8]]]],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:3[23]|4[89])\\d{4,6}|(?:31|4[36]|8(?:0[25]|78)\\d)\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}"],["(?:5\\d|6[2-4])\\d{6}",[8]],["800\\d{7}",[10]],0,0,0,0,0,0,["807\\d{7}",[10]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}"],["(?:36|5[1-389]|9\\d)\\d{5}"],["800\\d{4}"],0,0,0,0,0,["(?:3[3-5]|4[356])\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[["9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}"],["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"],0,0,0,0,0,["955\\d{5}",[8]],0,["60[0-2]\\d{4}",[7]]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}"],["9(?:10|[4-79]\\d)\\d{5}"],["800\\d{5}"],["90[09]\\d{5}"],["700\\d{5}"],0,["(?:50|77)\\d{6}"],0,0,["80[1-9]\\d{5}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}",[9]],["7060\\d{5}|(?:60[1-8]|7(?:0[2-5]|19|[2379]\\d))\\d{6}",[9]],["800\\d{6}",[9]],["9(?:0[05689]|76)\\d{6}",[9]],["70[01]\\d{6}",[9]],["9(?:3\\d{9}|6\\d{7,10})"],["9(?:5\\d|7[2-4])\\d{6}",[9]],0,["9[17]0\\d{6}",[9]],["8[134]\\d{7}",[9]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[["32\\d{9,11}|49[1-6]\\d{10}|322\\d{6}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][
8000-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}",[5,6,7,8,9,10,11,12,13,14,15]],["1(?:6[023]|7\\d)\\d{7,8}|15(?:[0-25-9]\\d\\d|3(?:10|33))\\d{6}",[10,11]],["800\\d{7,12}",[10,11,12,13,14,15]],["(?:137[7-9]|900(?:[135]|9\\d))\\d{6}",[10,11]],["700\\d{8}",[11]],["1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}",[12,13]],["18(?:1\\d{5,11}|[2-9]\\d{8})",[8,9,10,11,12,13,14]],["16(?:4\\d{1,10}|[89]\\d{1,11})",[4,5,6,7,8,9,10,11,12,13,14]],0,["180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}",[7,8,9,10,11,12,13,14]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[["2(?:1[2-5]|7[45])\\d{5}"],["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:[0-59][1-9]|[6-8]\\d)|3(?:[0-3][1-9]|4[13]|5[1-58]|6[1347-9]|7\\d|8[1-8]|9[1-79])|4(?:[0-25][1-9]|[34][2-9]|6[13-579]|7[13579]|8[1-47]|9[127])|5(?:[0-36][1-9]|4[146-9]|5[3-57-9]|7[568]|8[1-358]|9[1-69])|6(?:[0135][1-9]|2[1-68]|4[2-8]|6[1689]|[78]\\d|9[15689])|7(?:[0-69][1-9]|7[3-9]|8[147])|8(?:[16-9][1-9]|2[1-58])|9(?:[1-47-9][1-9]|6\\d))\\d{5}"],["(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"],["80\\d{6}"],["90\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767",[["767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\d{4}"],["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[["8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}"],["8[024]9[2-9]\\d{6}"],["800(?:14|[2-9]\\d)\\d{5}|8[024]9[01]\\d{6}|8(?:33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["9619\\d{5}|(?:[1-3]\\d|4[013-689])\\d{6}"],["5(?:4[0-29]|6[0-4])\\d{6}|(?:55|6\\d|7[7-9])\\d{7}",[9]],["800\\d{6}",[9]],["80[3-689]1\\d{5}",[9]],0,0,0,0,["98[23]\\d{6}",[9]],["80[12]1\\d{5}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["[2-7][2-7]\\d{6}",[8]],["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]],["1800\\d{7}|1[78]00\\d{6}",[10,11]],0,0,0,0,0,["[2-7]890\\d{4}",[8]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}",[7]],["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|[2-79]\\d\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[
8000-79]\\d|8[013-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]],["800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}"],["(?:40\\d\\d|900)\\d{4}",[7,8]],["70[0-2]\\d{5}",[8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0",0,0,0,0,0,[["13[23]\\d{6}|(?:15|57)\\d{6,7}|(?:2\\d|3|4[05-8]|5[05]|6[24-689]|8[2468]|9[235-7])\\d{7}",[8,9]],["1[0-25]\\d{8}",[10]],["800\\d{7}",[10]],["900\\d{7}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}"],["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]],0,0,0,0,0,0,[["96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:400|8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}"],["96906(?:09|10)\\d\\d|(?:590(?:10[0-2]|600)|97390\\d)\\d{3}|(?:6\\d|7[1-48])\\d{7}"],["[89]00\\d{6}"],["80[367]\\d{6}"],["70\\d{7}"],0,["51\\d{7}"],0,0,["90[12]\\d{6}"]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:11(?:[124]\\d\\d|3(?:[0-79]\\d|8[0-7])|5(?:[02-9]\\d|1[0-57-9])|6(?:[02-79]\\d|1[0-57-9]|8[0-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:119|22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}"],["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|2[1-35-79]|3\\d|77|86|99)|(?:8[01]|9\\d)\\d)\\d{6}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[["1[3-7][1-8]\\d{3,6}|(?:19[1-8]|[23568][1-8]\\d|9(?:00|[1-8]\\d))\\d{2,6}",[5,6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[["603\\d{4}|(?:3[0-6]|6[25-7]|8[58])\\d{5}",[7]],["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]],["0800\\d{7}",[11]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[["[2-47]\\d{4}"],["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-6]\\d)\\d)\\d{3}"],["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[["(?:20|[34]\\d|8[19])\\d{4}"],["(?:[27][1-9]|5\\d|9[16])\\d{4}"],["80[257-9]\\d{3}"],["90(?:[13-5][15-7]|2[125-7]|9\\d)\\d\\d"],0,0,0,0,["6[0-36]\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[["(?:26[013-9]|59[1-35-9])\\d{6}|(?:[13]\\d|2[0-57-9]|4[1-9]|5[0-8])\\d{7}"],["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"],["80[0-5]\\d{6}"],["836(?:0[0-36-9]|[1-9]\\d)\\d{4}|8(?:1[2-9]|2[2-47-9]|3[0-57-9]|[569]\\d|8[0-35-9])\\d{6}"],0,0,["80[6-9]\\d{6}"],0,["9\\d{8}"],["8(?:1[01]|2[0156]|4[024]|84)\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[["[01]1\\d{6}",[8]],["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])
800))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473",[["473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-4]|5[59]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}"],["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[6-8])|5(?:2[01]|3[3-8])|901)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}"],["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|4(?:0[04]0|411)|5222|9000)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|2[02]|3[0-6]|4[04]|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[02-6]|7[0-6])|4\\d\\d)|2(?:228|555)|3555|4(?:4(?:[02-9]\\d|14)|555)|5(?:[0157-9]\\d\\d|200|333|4(?:44|55))|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"],["800\\d{6}"],0,0,0,0,0,["70[67]\\d{6}"]]],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:4(?:[02-49]\\d|1[0-5]|5[6-9]|6[0-3]|80)|88\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:694(?:[0-249]\\d|3[0-8])|7093[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:396|76\\d)\\d|476[0-6])\\d{4}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0",0,0,0,0,0,[["3082[0-5]\\d{4}|3(?:0(?:[237]\\d|8[01])|[167](?:2[0-6]|7\\d|80)|2(?:2[0-5]|7\\d|80)|3(?:2[0-3]|7\\d|80)|4(?:2[013-9]|3[01]|7\\d|80)|5(?:2[0-7]|7\\d|80)|8(?:2[0-2]|7\\d|80)|9(?:[28]0|7\\d))\\d{5}",[9]],["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}",[9]],["800\\d{5,6}"]]],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[["2190[0-2]\\d{3}|2(?:0(?:[02]\\d|3[01])|16[24-9]|2[2-5]\\d)\\d{4}"],["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[["(?:19|3[1-7]|[68][1-9]|70|9\\d)\\d{4}"],["[245]\\d{5}"],["80\\d{4}"],0,0,0,0,0,["3[89]\\d{4}"]]],GM:["220","00","[48]\\d{8}|[2-9]\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|4(?:[0-35]|4[16-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[48]"]]],0,0,0,0,0,0,[["(?:4(?:[23]\\d\\d|4(?:1[024679]|(?:4(?:[237-9]\\d|4[14-9])|8[0-389]\\d)\\d|5(?:5(?:3\\d|4[0-7])|[67]\\d\\d)))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-389]\\d\\d)\\d{3}|44[6-9]\\d{4}"],["(?:(?:[23679]\\d|4[015]|8(?:(?:3[35]|6[68]|99)\\d|7(?:[27]\\d|4[015])))\\d|5(?:[0-489]\\d|56))\\d{4}|8[4-7]\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[["3(?:0(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])|1\\d\\d)\\d{4}",[8]],["6[0-356]\\d{7}",[9]],0,0,0,0,0,0,["722\\d{6}",[9]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[["33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}"],["(?:222|55\\d)\\d{6}"],["80\\d[1-9]\\d{5}"],["90\\d[1-9]\\d{5}
800"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",[10]],["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]],["800\\d{7,9}"],["90[19]\\d{7}",[10]],["70\\d{8}",[10]],0,["5005000\\d{3}",[10]],0,0,["8(?:0[16]|12|[27]5|50)\\d{7}",[10]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["[267][2-9]\\d{6}",[8]],["(?:[3-5]\\d\\d|80[0-4])\\d{5}",[8]],["18[01]\\d{8}",[11]],["19\\d{9}",[11]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671",[["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[478])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[16-9]))\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[["443\\d{6}",[9]],["9(?:5\\d|6[569]|77)\\d{6}",[9]],0,0,0,0,0,0,["40\\d{5}",[7]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56]
800)|50[0-6]|77[1-57])\\d{4}"],["(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-79]|70|8[067]))\\d{4}"],["(?:289|8(?:00|6[28]|88|99))\\d{4}"],["9008\\d{3}"],0,0,0,0,["515\\d{4}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2(?:[13-9]\\d|2[013-9])\\d|3(?:(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69])\\d|8(?:4[0-8]|[579]\\d|6[0-5]))|58(?:0[1-9]|1[2-9]))\\d{4}",[8]],["(?:4(?:0(?:6[0-3]|9[3-6])|24[3-6]|44[0-35-9]|6(?:4[0-57-9]|6[0-6])|7(?:4[0-48]|6[0-5]))|5(?:25[3-7]|35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|7(?:0(?:7[1-8]|8[0-8])|10[1-4])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-467]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-35])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]],["800\\d{6}",[9]],["900(?:[0-24-9]\\d{7}|3\\d{1,4})",[5,6,7,8,11]],["8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}",[8]],0,["30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}",[8]],["7(?:1(?:0[08]|1[0-3679]|3[013]|69|9[0136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[["2(?:2(?:0[0-59]|1[1-9]|[23]\\d|4[02-8]|5[57]|6[2458]|7[0135689]|8[01346-9]|9[0-2])|4(?:0[578]|2[3-59]|3[13-9]|4[0-68]|5[1-3589]|80)|5(?:0[2357-9]|1[1-6]|4[03-58]|5\\d|6[014-69]|7[04]|80)|6(?:[056]\\d|17|2[067]|3[047]|4[0-378]|[78][0-8]|9[01])|7(?:0[5-79]|2[01]|6[46-9]|7[02-9]|8[034]|91)|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}",[8]],["[37-9]\\d{7}",[8]],["8002\\d{7}",[11]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}",[8,9]],["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}",[8,9]],["80\\d{5,7}"],["6[01459]\\d{6}|6[01]\\d{5}",[7,8]],["7[45]\\d{6}",[8]],0,["62\\d{6,7}|72\\d{6}",[8,9]]]],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2\\d|5[1-5]|81|9[149])\\d{5}"],["(?:[34]\\d|5[568])\\d{6}"],["8\\d{7}"],0,0,0,0,0,["9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[["(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}",[8]],["(?:[257]0|3[01])\\d{7}",[9]],["(?:[48]0\\d|680[29])\\d{5}"],["9[01]\\d{6}",[8]],0,0,["38\\d{7}",[9]],0,["21\\d{7}",[9]]]],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[["2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",[7,8,9,10,11]],["8[1-35-9]\\d{7,10}",[9,10,11,12]],["00(?:1803\\d{5,11}|7803\\d{7})|(?:177\\d|800)\\d{5,7}",[8,9,10,11,12,13,14,15,16,17]],["809\\d{7}",[10]],0,0,["(?:1500|8071\\d{3})\\d{3}",[7,10]],0,0,["804\\d{7}",[10]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8\\d)|5[23679]|6[4-6]|7[14]|9[04])\\d{7}"],["8(?:22|[35-9]\\d)\\d{6}",[9]],["1800\\d{6}",[10]],["15(?:1[2-8]|[2-8]0|9[089])\\d{6}",[10]],["700\\d{6}",[9]],["88210[1-9]\\d{4}|8(?:[35-79]5\\d\\d|8(?:[013-9]\\d\\d|2(?:[01][1-9]|[2-9]\\d)))\\d{5}",[10]],["818\\d{6}",[9]],0,["76\\d{7}",[9]],["18[59]0\\d{6}",[10]]]],IL:["972","0(?:0|1(?:05|[2-9]))","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[["153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}
800",[8,11,12]],["55(?:4(?:0[0-3]|10|6[015-9])|57[0-289]|8[06][0-2])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[3-5]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]],["1(?:255|80[019]\\d{3})\\d{3}",[7,10]],["1212\\d{4}|1(?:200|9(?:0[0-2]|19|9\\d))\\d{6}",[8,10]],0,["151\\d{8,9}",[11,12]],["1599\\d{6}",[10]],0,["7(?:280[01]|38(?:[05]\\d|8[01358])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",[9]],["1700\\d{6}",[10]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24",[["1624(?:230|[5-8]\\d\\d)\\d{3}"],["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"],["808162\\d{4}"],["8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}"],["70\\d{8}"],0,["3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}"],0,["56\\d{8}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-6]|80[2-46]","11|2[02]|33|4[04]|79[1-6]|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[["(?:2717(?:[2-7]\\d|95)|6828[235-7]\\d)\\d{4}|(?:170[24]|280[13468]|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:271[0-689]|682[0-79]|782[0-6])[2-7]\\d{5}|(?:2(?:[02][2-79]|90)|3(?:23|80)|683|79[1-6])\\d{7}|(?:11|33|4[04]|80)[2-7]\\d{7}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[3-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1245]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2
800-689]|6[24578]|7[235689]|8[14-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|90)|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}",[10]],["(?:6(?:1279|828[01489])|7(?:887[02-9]|9313)|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:160[01]|6(?:(?:12|[2-4]1|5[17]|6[13]|80)[0189]|7(?:1[0189]|86))|7(?:1(?:2[0189]|9[0-5])|3(?:2[5-8]|[34][017-9]|9[016-9])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:731|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|4[0189]|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-5])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:[024]\\d|3[05-8]|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[07-9])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}",[10]],["000800\\d{7}|180(?:0\\d{4,9}|3\\d{9})"],["186[12]\\d{9}",[13]],0,0,["140\\d{7}",[10]],0,0,["1860\\d{7}",[11]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[["37\\d{5}"],["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}",[8,9]],["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)|94(?:000[09]|(?:12\\d|30[0-2])\\d|2(?:[02689]0\\d|121)|4(?:111|40\\d))\\d{4}",[6,7,10]],["9(?:(?:0[0-5]|[13]\\d|2[0-3])\\d\\d|9(?:[0-46]\\d\\d|5(?:10|5\\d)|8(?:[12]\\d|3[0-2]|88)|9(?:[01359]\\d|21|69|77|8[7-9])))\\d{5}",[10]],0,0,0,0,["96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])",[4,5]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}",[7]],["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"],["80[0-8]\\d{4}",[7]],["90(?:0\\d|1[5-79]|2[015-79]|3[135-79]|4[125-7]|5[25-79]|7[1-37]|8[0-35-7])\\d{3}",[7]],0,["(?:689|8(?:7[18]|80)|95[48])\\d{4}",[7]],["809\\d{4}",[7]],0,["49[0-24-79]\\d{4}",[7]]],"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[["8766060\\d{3}|(?:658(?:2(?:[5-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:52[35]|6(?:0[1-3579]|1[0235-9]|[23]\\d|40|5[06]|6[2-589]|7[0-25-9]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}"],["(?:6582(?:[0-4]\\d|95)|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[
80067])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0",0,0,0,0,0,[["87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",[8]],["(?:427|7(?:11|[29]\\d|[78][0-25-9]))\\d{6}",[9]],["80\\d{6}",[8]],["9\\d{7}",[8]],["70\\d{7}",[9]],0,["8(?:10|8\\d)\\d{5}",[8]],["74(?:66|77)\\d{5}",[9]],0,["85\\d{6}",[8]]]],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1",0,0,[["(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}",[9]],["[6-9]0[1-9]\\d{7}",[10]],["00777(?:[01]|5\\d)\\d\\d|(?:00(?:7778|882[1245])|(?:120|800\\d)\\d\\d)\\d{4}|00(?:37|66|78)\\d{6,13}"],["990\\d{6}",[9]],["60\\d{7}",[9]],0,["570\\d{6}",[9]],["20\\d{8}",[10]],["50[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:4[245]|5[1-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|66)\\d{6,7}",[7,8,9]],["(?:1(?:0[0-8]|[18]\\d|2[014]|30|4[0-5])|7\\d\\d)\\d{6}",[9]],["800[02-8]\\d{5,6}",[9,10]],["900[02-9]\\d{5}",[9]]]],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["312(?:5[0-79]\\d|9(?:[0-689]\\d|7[0-24-9]))\\d{3}|(?:3(?:1(?:2[0-46-8]|3[1-9]|47|[56]\\d)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}",[9]],["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}",[9]],["800\\d{6,7}"]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}
800|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})",[8,9]],["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]],["1800(?:1\\d|2[019])\\d{4}",[10]],["1900(?:1\\d|2[09])\\d{4}",[10]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[["(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}"],["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}",[8]],0,0,0,0,0,0,["30(?:0[01]\\d\\d|12(?:11|20))\\d\\d",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[["7[4-7]\\d{5}"],["[34]\\d{6}"],0,["8\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869",[["869(?:2(?:29|36)|302|4(?:6[015-9]|70)|56[5-7])\\d{4}"],["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:195|2)\\d|3[19]|4[159]|5[37]|6[17]|7[39]|85)\\d{6}"],["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[["(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}",[5,6,8,9,10]],["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]],["00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|[38]0)\\d{7}",[9,11,12,13,14]],["60[2-9]\\d{6}",[9]],["50\\d{8,9}",[10,11]],0,["1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[0168]|88)|8(?:00|33|55|77|99))\\d{4}",[8]],["15\\d{7,8}",[9,10]],["70\\d{8}",[10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[["2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}",[8]],["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:00|1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}",[8]],["18\\d{5}",[7]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345",[["345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|4[89]|88)|9(?:14|4[035-9]))\\d{4}"],["345(?:32[1-9]|4(?:1[2-6]|2[0-4])|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:345976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",[["7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9]|97)|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]|59))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59)))\\d{5}",[10]],["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]],["8(?:00|108\\d{3})\\d{7}"],["809\\d{7}",[10]],["808\\d{7}",[10]],0,0,0,["751\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[13]|[35-7][14]|41|8[1468])\\d{6}",[8]],["(?:20(?:[23579]\\d|8[78])|30[24]\\d)\\d{6}|30\\d{7}",[9,10]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[["7(?:62|8[0-6]|9[04-9])\\d{4}|(?:[14-69]\\d|2(?:[14-69]\\d|[78][1-9])|7[2-57]|8[02-9])\\d{5}
800"],["(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[7-9]|9[0-4]))\\d{5}"],0,["9[01]\\d{6}",[8]],0,0,0,0,0,["80\\d{6}",[8]]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758",[["758(?:234|4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|(?:63|75)8)\\d{4}"],["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0",0,0,0,[["(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}",[7]],["(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-68]\\d|1[01]|3[7-9]|7[02]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"],["8002[28]\\d\\d|80(?:05\\d|9)\\d{4}"],["90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",[7]],0,["697(?:42|56|[78]\\d)\\d{4}",[9]],["870(?:28|87)\\d\\d",[7]]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:12[2-9]|602|8[12]\\d|9(?:1\\d|22|9[245]))\\d{6}|(?:11|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}"],["7(?:[0-25-8]\\d|4[0-4])\\d{6}"],0,0,0,0,["1973\\d{5}"]]],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0",0,0,0,0,0,[["2\\d{7}",[8]],["(?:(?:(?:22|33)0|555|7(?:6[01]|7\\d)|88\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}",[7,9]],0,["332(?:02|[34]\\d)\\d{4}",[9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[["2\\d{7}"],["[56]\\d{7}"],["800[1256]\\d{4}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]",0,0,0,[["(?:3[1478]|4[124-6]|52)\\d{6}"],["6\\d{7}"],["80[02]\\d{5}"],["9(?:0[0239]|10)\\d{5}"],["70[05]\\d{5}"],0,["70[67]\\d{5}"],0,["[89]01\\d{5}"],["808\\d{5}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[["(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}"],["6(?:[26][18]|5[1568]|7[189]|81|9[128])\\d{6}",[9]],["800\\d{5}",[8]],["90[015]\\d{5}",[8]],0,0,0,0,["20(?:1\\d{5}|[2-689]\\d{1,7})",[4,5,6,7,8,9,10]],["801\\d{5}",[8]]]],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]],0,0,0,0,0,0,[["6\\d{7}"],["2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"],["80\\d{6}"],["90\\d{6}"],0,0,0,0,0,["81\\d{6}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0[56]|[1-6]\\d|7[124579]|8[124])|3(?:1\\d|2[2356])|4(?:[17]\\d|2[1-357]|5[2-4]|8[124])|5(?:[1347]\\d|2[1-469]|5[13-5]|8[1-4])|6(?:[1-479]\\d|5[2-57]|8[1-5])|7(?:[13]\\d|2[13-79])|8(?:[124]\\d|5[124]|84))\\d{6}"],["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]",[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-9])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0",0,0,0,0,0,[["(?:870|9[2-47-9]\\d)\\d{5}",[8]],["4(?:[46]\\d|5[1-9])\\d{5}|(?:3|[67]\\d)\\d{7}"],["(?:800|90\\d)\\d{5}",[8]]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}"],["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"],["800\\d{5}"],["90[056]\\d{5}"],0,0,["803\\d{5}"],0,["3[08]\\d{6}"],["808\\d{5}
800"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:0[2467]|1[24-7]|2[2-467]))\\d{5}",[8]],["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]],["80(?:[0-2578]|9\\d)\\d{5}"],["9(?:4[1568]|5[178])\\d{5}",[8]],0,0,["77[1-9]\\d{5}",[8]],0,["78[1-49]\\d{5}",[8]]]],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1",0,0,[["2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[356]|8[268]|9[2457])\\d{5}"],["3[2-9]\\d{7}"],0,0,0,0,0,0,["22\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[["(?:247|528|625)\\d{4}"],["(?:(?:23|54)5|329|45[35-8])\\d{4}"],0,0,0,0,0,0,["635\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2(?:62|77)0|3444)\\d|4[56]440)\\d{3}|(?:34|4[357])700\\d{3}|(?:2(?:[0-3]\\d|5[0-578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}"],["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"],["800\\d{5}"],["5\\d{7}"],0,0,0,0,0,["8(?:0[1-9]|[1-9]\\d)\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[["2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-69]))\\d{5}"],["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[0-3]|[679]\\d|8[2-59])\\d{6}"],["80\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:12|[28]\\d|3[56]|7[3-6]|9[0-6])\\d|4(?:2[29]|7[0-2]|83)|6)|2(?:2(?:00|8[34])|4(?:0\\d|22|7[0-2]|83)|51\\d\\d)|4(?:2(?:2\\d\\d|48[013])|3(?:20\\d|4(?:70|83)|56)|420\\d|5(?:2\\d|470))|6(?:0(?:[23]|88\\d)|(?:124|[56]2\\d)\\d|2472|3(?:20\\d|470)|4(?:2[04]\\d|472)|7(?:3\\d\\d|4[67]0|8(?:[01459]\\d|8))))\\d{4}|5(?:2(?:2\\d{5,6}|47[02]\\d{4})|(?:3472|4(?:2(?:1|86)|470)|522\\d|6(?:20\\d|483)|7(?:20\\d|48[01])|8(?:20\\d|47[02])|9(?:20\\d|470))\\d{4})|7(?:(?:0470|4(?:25\\d|470)|5(?:202|470|96\\d))\\d{4}|1(?:20\\d{4,5}|4(?:70|83)\\d{4}))|8(?:1(?:2\\d{5,6}|4(?:10|7[01]\\d)\\d{3})|2(?:2\\d{5,6}|(?:320|490\\d)\\d{3})|(?:3(?:2\\d\\d|470)|4[24-7]|5(?:(?:2\\d|51)\\d|4(?:[1-35-9]\\d|4[0-57-9]))|6[23])\\d{4})|(?:1[2-6]\\d|4(?:2[24-8]|3[2-7]|[46][2-6]|5[3-5])|5(?:[27][2-8]|3[2-68]|4[24-8]|5[23]|6[2-4]|8[24-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][24-8]|[15][2-7]|22|3[2-4])|8(?:1[2-689]|2[2-8]|(?:[35]2|64)\\d))\\d{4}|25\\d{5,6}|(?:2[2-9]|6(?:1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:3[24]|5[245]))\\d{4}",[6,7,8,9]],["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]],["80080(?:0[1-9]|2\\d)\\d{3}",[10]],0,0,0,0,0,["1333\\d{4}",[8]]]],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[["[12](?:2[1-3]|(?:3[2-8]|4[2-68]|5[1-4689])\\d)\\d{5,6}|7(?:0(?:[0-5]\\d|7[078]|80)|128)\\d{4}|[12]27\\d{6}|(?:11|2[16]|5[368])\\d{6}"],["(?:87[01]|92[0139])\\d{5}|(?:5[05]|6[069]|7[28]|8[0135689]|9[013-9])\\d{6}",[8]],0,0,0,0,0,0,["712[0-79]\\d{4}|7(?:1[013-9]|[5-79]\\d)\\d{5}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[["(?:28[2-9]|8(?:11|[2-57-9]\\d))\\d{5}",[8]],["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]],["0800\\d{3}",[7]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670",[["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:6(?:[03-7]\\d|1[05]|2[7-9]|8[0-39]|9[04-9])|89\\d)|80[6-9]\\d\\d|9(?:477[6-9]|767[4589]))\\d{4}"],["(?:69[67]\\d\\d|7091[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:397[0-3]|477[0-5]|76(?:6\\d|7[0-367]))\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[["(?:25[08]|35\\d|45[1-7])\\d{5}"],["[2-4][0-46-9]\\d{6}"],["800\\d{5}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664",[["6644(?:1[0-3]|91)\\d{4}"],["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[["20(?:3[1-4]|6[059])\\d{4}|2(?:0[19]|[1-357]\\d|60)\\d{5}"],["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"],["800(?:02|[3467]\\d)\\d{3}"],["5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}"],0,0,["501\\d{5}"],["7117\\d{4}"],["3550\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[["(?:2(?:[0346-8]\\d|1[0-8])|4(?:[013568]\\d|2[0-24-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",[7,8]],["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-7]|3[013]))\\d{5}",[8]],["802\\d{7}|80[0-2]\\d{4}",[7,10]],["30\\d{5}",[7]],0,0,0,["219\\d{4}",[7]],["3(?:20|9\\d)\\d{4}",[7]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["(?:3(?:0[0-4]|3[0-59])|6(?:[58][024689]|6[024-68]|7[02468]))\\d{4}",[7]],["(?:46[46]|[79]\\d\\d)\\d{4}",[7]],["800\\d{7}",[10]],["900\\d{7}",[10]],0,0,["4(?:0[01]|50)\\d{4}",[7]]],"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0",0,0,0,0,0,[["1[2-9]\\d{5}",[7]],["111\\d{6}|(?:2[12]|31|77|[89][89])\\d{7}",[9]]]],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:0[01]|2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["8(?:00|88)\\d{7}"],["900\\d{7}"],["500\\d{7}"],0,0,0,0,["300\\d{7}"]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["427[01]\\d{4}|(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}",[8,9]],["1(?:(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|9\\d{7,8})|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-79]|6[02-4]|8[02-5]))|(?:[26]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[23
8006]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]],["1[378]00\\d{6}",[10]],["1600\\d{6}",[10]],0,0,0,0,["15(?:4(?:6[0-4]\\d|8(?:0[125]|[17]\\d|21|3[01]|4[01589]|5[014]|6[02]))|6(?:32[0-6]|78\\d))\\d{4}",[10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}",[8]],["8[2-9]\\d{7}",[9]],["800\\d{6}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["64426\\d{3}|6(?:1(?:2[2-7]|3[01378]|4[0-4])|254|32[0237]|4(?:27|41|5[25])|52[236-8]|626|7(?:2[2-4]|30))\\d{4,5}|6(?:1(?:(?:0\\d|2[0189]|3[24-69]|4[5-9])\\d|17|69|7[014])|2(?:17|5[0-36-8]|69|70)|3(?:17|2[14-689]|34|6[289]|7[01]|81)|4(?:17|2[0-2]|4[06]|5[0137]|69|7[01])|5(?:17|2[0459]|69|7[01])|6(?:17|25|38|42|69|7[01])|7(?:17|2[569]|3[13]|6[89]|7[01]))\\d{4}"],["(?:60|8[1245])\\d{7}",[9]],["80\\d{7}",[9]],["8701\\d{5}",[9]],0,0,0,0,["8(?:3\\d\\d|86)\\d{5}"]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[["(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}"],["(?:[579]\\d|8[0-79])\\d{4}"],["050\\d{3}"],["36\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]],0,0,0,0,0,0,[["2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}"],["(?:23|7[0467]|[89]\\d)\\d{6}"],["08\\d{6}"],["09\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[["(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}"],["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[["20(?:[1259]\\d|3[013-9]|4[1-8]|6[024-689]|7[1-79]|8[2-9])\\d{6}",[10]],["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}",[10]],["800\\d{7,11}"],0,0,0,["700\\d{7,11}"]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[["2\\d{7}"],["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"],["1800\\d{4}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}",[9]],["(?:6[1-58]|970\\d)\\d{7}",[9,11]],["800\\d{4,7}",[7,8,9,10]],["90[069]\\d{4,7}",[7,8,9,10]],0,0,["140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d",[5,6,9]],["66\\d{7}",[9]],["(?:85|91)\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[["(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-46-9]|7[0-8])\\d{6}",[8]],["45(?:[0-24-9]\\d|3[0-57-9])\\d{4}|(?:4[016-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}
800",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[["(?:1[0-6]\\d|99[02-6])\\d{5}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-7])[2-6]\\d{5}",[8]],["9(?:00|6[0-3]|7[0-24-6]|8[0-24-68])\\d{7}",[10]],["1(?:66001|800\\d\\d)\\d{5}",[11]]]],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]],0,0,0,0,0,0,[["444\\d{4}"],["(?:222|55[3-9]|666|777|8\\d\\d|999)\\d{4}"]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[["[47]\\d{3}",[4]],["(?:[56]|888[1-9])\\d{3}"]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,[["240\\d{5}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}",[8]],["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}",[8,9,10]],["508\\d{6,7}|80\\d{6,8}",[8,9,10]],["(?:1[13-57-9]\\d{5}|50(?:0[08]|30|66|77|88))\\d{3}|90\\d{6,8}",[7,8,9,10]],["70\\d{7}",[9]],0,["8(?:1[16-9]|22|3\\d|4[045]|5[459]|6[235-9]|7[0-3579]|90)\\d{2,7}"]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[["2[1-6]\\d{6}",[8]],["(?:1505|90[1-9]\\d)\\d{4}|(?:7[124-9]|9[1-9])\\d{6}",[8]],["8007\\d{4,5}|(?:500|800[05])\\d{4}"],["900\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[147]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[0147-9]\\d|[25][0-5]|33|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[235-8]|9\\d))\\d{4}",[7]],["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]],["800\\d{4,5}|(?:00800|800\\d)\\d{6}"],["(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}",[7]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:(?:19[02-68]|(?:4[34]|5[14])[0-8]|687)\\d|7(?:173|(?:3[0-8]|55)\\d)|8(?:10[05689]|6(?:0[06-9]|1[6-9]|29)|7(?:0[0569]|[56]0)))\\d{4}|(?:1[0-8]|4[12]|5[236]|6[1-7]|7[246]|8[2-4])\\d{6}",[8]],["9\\d{8}",[9]],["800\\d{5}",[8]],["805\\d{5}",[8]],["80[24]\\d{5}",[8]],0,0,0,0,["801\\d{5}",[8]]],"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["4(?:0[4-689]|9[4-68])\\d{5}",[8]],["8[7-9]\\d{6}",[8]],["80[0-5]\\d{6}",[9]],0,0,0,["44\\d{4}",[6]],0,["499\\d{5}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85[02-46-9]"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[["(?:(?:3[0-2]|4[257]|5[34]|9[78])\\d|64[1-9]|85[02-46-9])\\d{4}",[7]],["(?:7\\d|8[1-58])\\d{6}",[8]],["180\\d{4}",[7]],0,0,0,0,["27[01]\\d{4}",[7]],["2(?:0[0-57]|7[568])\\d{4}",[7]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[["(?:(?:2[3-8]|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578])\\d{3}|88(?:22\\d\\d|42))\\d{4}|(?:2|8[2-8]\\d\\d)\\d{5}",[6,8,9,10]],["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]],["1800\\d{7,9}",[11,12,13]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6,7}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}",[9,10]],["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}",[10]],["800\\d{5}
800(?:\\d{3})?",[8,11]],["900\\d{5}",[8]],["122\\d{6}",[9]],0,["(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}",[11,12]]]],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:30|47\\d\\d)\\d{5}|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))",[7,9]],["21(?:1[013-5]|2\\d|3[1-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]],["800\\d{6,7}",[9,10]],["70[01346-8]\\d{6}",[9]],0,0,["804\\d{6}",[9]],["64\\d{4,7}",[6,7,8,9]],["39\\d{7}",[9]],["801\\d{6}",[9]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["80[6-9]\\d{6}|(?:[236-9]\\d|4[1-35-9]|5[0-47-9])\\d{4}"],["708(?:4[0-5]|5[0-6])\\d{4}|(?:[236-9]\\d|4[02-489]|5[02-9])\\d{4}"],["80[0-5]\\d{6}",[9]],["8[129]\\d{7}",[9]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[["(?:787|939)[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:22[2-47-9]|42[45]|82[014-68]|92[3569])\\d{5}",[8]],["5[69]\\d{7}",[9]],["1800\\d{6}",[10]],0,0,0,0,0,0,["1700\\d{6}",[10]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[["2(?:[12]\\d|3[1-689]|4[1-59]|[57][1-9]|6[1-35689]|8[1-69]|9[1256])\\d{6}"],["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"],["80[02]\\d{6}"],["(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[1-37]))\\d{5}"],["884[0-4689]\\d{5}"],["600\\d{6}|6[06]92(?:0\\d|3[349]|49)\\d{3}"],["70(?:38[01]|596|(?:7\\d|8[17])\\d)\\d{4}"],["6(?:222\\d|89(?:00|88|99))\\d{4}"],["30\\d{7}"],["80(?:8\\d|9[1579])\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}"],["(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:3[289]|4[246-8]|61|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:[14-68]\\d|2[4-68]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51|[67]\\d)|4(?:1\\d|3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-8])|7(?:4[0-4]|5\\d|6[1-
800578]|75|8[0-8])|858)\\d{5,6}",[7,8,9]],["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}",[9]],["9800\\d{5,7}",[9,10,11]],0,0,0,["[245]0\\d{6,7}|[36-9]0\\d{4,7}",[6,7,8,9]],0,["8700[0-4]\\d{4}",[9]]]],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]],0,0,0,0,0,0,[["4(?:(?:[014]\\d\\d|999)\\d|2022)\\d{3}",[8]],["[35-7]\\d{7}",[8]],["800\\d{4}|(?:0080[01]|800)\\d{6}",[7,9,11]],0,0,0,0,["2[136]\\d{5}",[7]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,[["[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d"],["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}",[9]],["800\\d{6}",[9]],["90[0136]\\d{6}",[9]],0,0,["(?:37\\d|80[578])\\d{6}",[9]],0,0,["801\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[["(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}",[7,8,9,10,11,12]],["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]],["800\\d{3,9}"],["(?:78\\d|90[0169])\\d{3,7}",[6,7,8,9,10]],0,0,["7[06]\\d{4,10}"]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",[["(?:3(?:0[12]|36|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:06|2[23568]\\d)\\d{6}"],["7[237-9]\\d{7}",[9]],["800\\d{6}",[9]],["900\\d{6}",[9]]]],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[["1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}",[9]],["579[0-8]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}",[9]],["800\\d{7}",[10]],["925\\d{6}",[9]],0,0,0,0,0,["920\\d{6}",[9]]]],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[["(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}",[5]],["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"],["1[38]\\d{3}",[5]],0,0,0,0,0,["5[12]\\d{3}",[5]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[["4[2-46]\\d{5}"],["2[125-8]\\d{5}"],["800[08]\\d{3}"],["85\\d{5}"],0,0,0,0,["971\\d{4}|(?:64|95)\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1(?:5\\d|8[35-7])\\d{6}"],["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[["(?:(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d|90[1-9])\\d{4,6}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}",[7,8,9]],["7[023689]\\d{7}",[9]],["20\\d{4,7}",[6,7,8,9]],["649\\d{6}|99[1-59]\\d{4}(?:\\d{3})?|9(?:00|39|44)[1-8]\\d{3,6}",[7,8,9,10]],["75[1-8]\\d{6}",[9]],["(?:25[245]|67[3-68])\\d{9}",[12]],["10[1-8]\\d{6}",[9]],["74[02-9]\\d{6}",[9]],0,["77[0-7]\\d{6}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}",[8]],["80[1-9]\\d{5}|(?:8[1-9]|9[0-8])\\d{6}",[8]],["(?:18|8)00\\d{7}",[10,11]],["1900\\d{7}",[11]],0,0,["7000\\d{7}",[11]],0,["(?:3[12]\\d|666)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[["2(?:[0-57-9]\\d|6[4-9])\\d\\d"],["[56]\\d{4}",[5]],0,0,0,0,0,0,["262\\d\\d",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:[1-357][2-8]|4[24-8])\\d{6}",[8]],["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[013]|51|6[489])\\d{6}",[8]],["80\\d{4,6}",[6,7,8]],["89[1-3]\\d{2,5}|90\\d{4,6}"],0,0,0,0,["(?:59\\d\\d|8(?:1(?:[67]\\d|8[0-589])|2(?:0\\d|2[0-37-9]|8[0-2489])|3[389]\\d))\\d{4}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79",[["79\\d{6}",[8]],["45(?:[0-24-9]\\d|3[0-57-9])\\d{4}|(?:4[016-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}
800",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:16|[2-9]\\d{3})|(?:(?:[3-5][1-8]\\d|819)\\d|601[1-5])\\d)\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d"],["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]],["800\\d{6}",[9]],["9(?:00|[78]\\d)\\d{6}",[9]],0,0,["96\\d{7}",[9]],["9090\\d{3}",[7]],["6(?:02|5[0-4]|9[0-6])\\d{6}",[9]],["8[5-9]\\d{7}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[["22[2-4][2-9]\\d{4}"],["(?:25|3[0-5]|66|7\\d|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[["0549(?:8[0157-9]|9\\d)\\d{4}",[10]],["6[16]\\d{6}",[8]],0,["7[178]\\d{6}",[8]],0,0,0,0,["5[158]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[["3(?:[026]\\d|3[89])\\d{6}"],["7(?:[015-8]\\d|21|90)\\d{6}"],["800\\d{6}"],["88[4689]\\d{6}"],0,0,0,0,["(?:39|93)\\d{7}"],["81[02468]\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0",0,0,0,0,0,[["(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|5[57-9])\\d{5}|(?:[134]\\d|8[125])\\d{4}",[6,7]],["(?:(?:15|(?:3[59]|4[89]|6\\d|7[0-35-9]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",[7,8,9]]]],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]],0,0,0,0,0,0,[["(?:2[1-3]|3[0-7]|4\\d|5[2-578])\\d{4}",[6]],["(?:6[08]|7[1-7]|8[1-9])\\d{5}",[7]],["80\\d{5}",[7]],["90\\d{5}",[7]],0,0,0,0,["(?:56|91\\d)\\d{4}"]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1[89]\\d{7}"],["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[["22\\d{5}"],["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["2(?:79(?:0[0347-9]|[1-9]\\d)|89(?:0[024589]|[1-9]\\d))\\d{3}|2(?:[1-69]\\d|[78][0-8])\\d{5}",[8]],["[5-7]\\d{7}",[8]],["800\\d{8}|80[01]\\d{4}",[7,11]],["900\\d{4}(?:\\d{4})?",[7,11]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721",[["7215(?:4[2-8]|8[39]|9[056])\\d{4}"],["7215(?:1[02]|2\\d|5[034679]|8[0-24-8])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0",0,0,0,0,0,[["(?:1(?:[1478]\\d|[2356])|21\\d|3(?:[13]\\d|4)|4[134]|5[1-3])\\d{6}|2[1-5]\\d{6}"],["(?:50|9[03-689])\\d{7}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[["[23][2-5]\\d{6}",[8]],["7[5-9]\\d{6}",[8]],["0800\\d{4}",[8]],["900\\d{6}",[9]],0,0,0,0,["70\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8",[["8\\d{3}"]]],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649",[["649(?:266|712|9(?:4\\d|50))\\d{4}"],["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,0,["649(?:71[01]|966)\\d{4}"]]],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,[["22(?:[37-9]0|5[0-5]|6[89])\\d{4}"],["(?:3[01]|[69]\\d|77|8[5-7])\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[["2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}"],["(?:7[0-389]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:1[0689]|2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}",[8]],["(?:(?:14|[89]\\d)\\d\\d|6(?:[1-6]\\d\\d|7(?:1[0-8]|2[4-7]|3[1-6])))\\d{5}",[9]],["(?:001800\\d|1800)\\d{6}",[10,13]],["1900\\d{6}",[10]],0,0,0,0,["6[08]\\d{7}",[9]]]],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4}
800)","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,[["(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}"],["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0-27-9]|2[0-27]|3[08]|40|5[05]|66|7[0157-9]|8[07-9])\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[["(?:2[2-4]|[34]\\d)\\d{2,5}"],["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[["(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",[7]],["7[2-8]\\d{6}",[8]],["80\\d{5}",[7]],["90\\d{5}",[7]],["70\\d{5}",[7]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,[["(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}"],["(?:6\\d|7[12])\\d{6}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[["81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}"],["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"],["8010\\d{4}"],["88\\d{6}"],0,0,0,0,0,["8[12]10\\d{4}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[["(?:2\\d|3[0-8]|4[0-4]|50|6[09]|7[0-24-69]|8[05])\\d{3}",[5]],["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]],["0800\\d{3}",[7]],0,0,0,0,0,["55[0-37-9]\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[["(?:2(?:1[26]|[28][2468]|[3-5][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",[10]],["5(?:61(?:011|61\\d)|82[2-5]\\d\\d)\\d{4}|5(?:[03-5]\\d|1[06]|24|6[24]|7[245]|9[46])\\d{7}",[10]],["8(?:00\\d{7}(?:\\d{2,3})?|11\\d{7})",[10,12,13]],["(?:8[89]8|900)\\d{7}",[10]],["592(?:21[12]|461)\\d{4}",[10]],0,["444\\d{4}",[7]],["512\\d{7}",[10]],["850\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868",[["868(?:2(?:01|1[5-9]|[23]\\d|4[0-2])|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}"],["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"],["868800\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],["868619\\d{4}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["2[02-9]\\d{3}",[5]],["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["(?:2[2-8]\\d|370|55[01]|7[1-9])\\d{6}|4(?:(?:0(?:0[1-9]|[2-48]\\d)|1[023]\\d)\\d{4,5}|(?:[239]\\d\\d|4(?:0[56]|12|49))\\d{5})|6(?:[01]\\d{7}|4(?:0[56]|12|24|4[09])\\d{4,5})|8(?:(?:2(?:3\\d|4[0-269]|[578]0|66)|36[24-9]|90\\d\\d)\\d{4}|4(?:0[56]|12|24|4[09])\\d{4,5})|(?:2(?:2(?:0\\d\\d|4(?:0[68]|[249]0|3[0-467]|5[0-25-9]|6[0235689]))|(?:3(?:[09]\\d|1[0-4])|(?:4\\d|5[0-49]|6[0-29]|7[0-5])\\d)\\d)|(?:(?:3[2-9]|5[2-8]|6[0-35-79]|8[7-9])\\d\\d|4(?:2(?:[089]\\d|7[1-9])|(?:3[0-4]|[78]\\d|9[01])\\d))\\d)\\d{3}",[8,9]],["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]],["80[0-79]\\d{6}|800\\d{5}",[8,9]],["20(?:[013-9]\\d\\d|2)\\d{4}",[7,9]],["99\\d{7}",[9]],0,["50[0-46-9]\\d{6}
800",[9]],0,["7010(?:[0-2679]\\d|3[0-7]|8[0-5])\\d{5}|70\\d{8}",[10,11]]],0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[["2[2-8]\\d{7}"],["(?:6[0-35-9]|7\\d)\\d{7}"],["80[08]\\d{6}"],["90\\d{7}"],0,0,0,0,["41\\d{7}"],["8(?:40|6[01])\\d{6}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}",[9]],["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}",[9]],["800[1-8]\\d{5,6}"],["900[239]\\d{5,6}"],0,0,0,0,["89[1-579]\\d{6}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024","20240"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["20[0-35-7]|4(?:6[45]|[7-9])|[7-9]","20(?:[0135-7]|2[5-9])|4(?:6[45]|[7-9])|[7-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[2-4]"],"0$1"]],"0",0,0,0,0,0,[["20(?:(?:24[09]|30[67])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[017]\\d|2[5-9]|3[1-4]|5[0-4]|6[15-9])|[34]\\d{3})\\d{5}"],["7(?:28|34)0\\d{5}|7(?:[014-8]\\d|2[01467]|3[0167]|9[0-589])\\d{6}"],["800[1-3]\\d{5}"],["90[1-3]\\d{6}"]]],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,[["(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}",[8]],["9[1-9]\\d{6}",[8]],["0004\\d{2,9}|(?:405|80[05])\\d{4}",[6,7,8,9,10,11,12,13]],["90[0-8]\\d{4}",[7]],0,0,["21\\d{2,3}",[4,5]]],"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]],0,0,0,0,0,0,[["(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}"],["(?:(?:[25]0|33|8[078]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698",[["06698\\d{1,6}",[6,7,8,9,10,11]],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784",[["784(?:266|3(?:6[6-9]|7\\d|8[0-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}"],["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"],0,0,0,["78451[0-2]\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|[4-6]00)\\d{7}"],["4(?:1[24-8]|2[246])\\d{7}"],["800\\d{7}"],["90[01]\\d{7}"],0,0,["501\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284",[["284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}"],["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340",[["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[["2(?:0[3-9]|1[0-689]|2[0-25-9]|[38][2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|9[0-4679])\\d{7}
800",[10]],["121[0-3]\\d{5}|(?:160|(?:3\\d|7[06-9])\\d|5(?:[1689]\\d|2[238]|59)|8(?:[1-8]\\d|9[6-9])|9(?:[0-8]\\d|9[013-9]))\\d{6}",[9]],["1800\\d{4,6}|12(?:0[13]|28)\\d{4}",[8,9,10]],["1900\\d{4,6}",[8,9,10]],0,0,["[17]99\\d{4}|69\\d{5,6}",[7,8]],0,["672\\d{6}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[["(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}",[5]],["(?:[58]\\d|7[0-7])\\d{5}",[7]],["81[18]\\d\\d",[5]],0,0,0,["(?:3[03]|900\\d)\\d{3}"],0,["9(?:0[1-9]|1[01])\\d{4}",[7]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["72\\d{4}",[6]],["(?:72|8[23])\\d{4}",[6]],["80[0-5]\\d{6}",[9]],0,0,["[48]0\\d{4}",[6]],0,0,["9[23]\\d{4}",[6]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["6[1-9]\\d{3}|(?:[2-5]|60)\\d{4}",[5,6]],["(?:7[1-35-8]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]],["800\\d{3}",[6]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0",0,0,0,0,0,[["38\\d{6,10}|(?:2[89]|39)(?:0\\d{5,6}|[1-9]\\d{5})"],["4[3-9]\\d{6}",[8]],["800\\d{5}",[8]],["900\\d{5}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["78[0-7]\\d{4}|17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-6])\\d{5}",[7,8]],["7[01378]\\d{7}",[9]]]],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0330|4302)|52087)0\\d{3}|(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}",[9]],["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:50[0-2]|[67]\\d\\d)\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]],["80\\d{7}",[9]],["(?:86[2-9]|9[0-2]\\d)\\d{6}",[9]],0,0,["861\\d{6,7}",[9,10]],0,["87(?:08[0-589]|15[0-79]|28[0-4]|31[1-9])\\d{4}|87(?:[02][0-79]|1[0-46-9]|3[02-9]|[4-9]\\d)\\d{5}",[9]],["860\\d{6}",[9]]]],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0",0,0,0,0,0,[["21[1-8]\\d{6}"],["(?:[59][5-8]|7[5-9])\\d{7}"],["800\\d{6}"],0,0,0,0,0,["63\\d{7}"]]],ZW:["263","00","(?:13|8\\d{4})\\d{5}|[235-8]\\d{8}|[2-689]\\d{6}",[7,9,10],[["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|29|58)|67[0-46-9]|(?:55|68)[0-69]"],"0$1"],["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|[27]|48)|37|675|(?:55|68)[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["548"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[256]|39|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["3"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:(?:(?:02[014]|72[03])\\d|48)\\d|2(?:[278]\\d|92)|583)|(?:37[56]|6[78]21\\d)\\d|5(?:483|525\\d\\d))\\d{3}|(?:2(?:0\\d|7[1-7])|(?:55|6[78])\\d)\\d{4}|(?:13|2(?:(?:42|9\\d)\\d|[56]20)|3(?:123|92\\d)|(?:4|542)\\d|6(?:[16]21|52[013])|8(?:[1349]28|523)|9[2-9])\\d{5}",[7,9]],["7(?:[1278]\\d|3[1-9]|9[01])\\d{6}",[9]],["80(?:[01]\\d|20|8[0-8])\\d{3}",[7]],0,0,0,0,0,["86(?:1[12]|22|30|44|55|77|8[368])\\d{6}",[10]]]]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4}
800)","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function ZZ(s,t){var n=Array.prototype.slice.call(t);return n.push(GZ),s.apply(this,n)}function N3(s,t){s=s.split("-"),t=t.split("-");for(var n=s[0].split("."),r=t[0].split("."),a=0;a<3;a++){var o=Number(n[a]),c=Number(r[a]);if(o>c)return 1;if(c>o)return-1;if(!isNaN(o)&&isNaN(c))return 1;if(isNaN(o)&&!isNaN(c))return-1}return s[1]&&t[1]?s[1]>t[1]?1:s[1]<t[1]?-1:0:!s[1]&&t[1]?1:s[1]&&!t[1]?-1:0}var YZ={}.constructor;function bu(s){return s!=null&&s.constructor===YZ}var QZ=/^\d+$/;function XZ(s){return QZ.test(s)}function Yu(s){"@babel/helpers - typeof";return Yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(s)}function mg(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")}function JZ(s,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,eY(r.key),r)}}function hg(s,t,n){return t&&JZ(s.prototype,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function eY(s){var t=tY(s,"string");return Yu(t)=="symbol"?t:t+""}function tY(s,t){if(Yu(s)!="object"||!s)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,t);if(Yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}var sY="1.2.0",nY="1.7.35",w3=" ext. ",Rr=function(){function s(t){mg(this,s),j_(t),this.metadata=t,N_.call(this,t)}return hg(s,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){var a,o;if(n&&(XZ(n)?o=n:a=n),r&&(o=r),a&&a!=="001"){var c=this.getCountryMetadata(a);if(!c)throw new Error("Unknown country: ".concat(a));this.numberingPlan=new A3(c,this)}else if(o){if(!this.hasCallingCode(o))throw new Error("Unknown calling code: ".concat(o));this.numberingPlan=new A3(this.getNumberingPlanMetadata(o),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var a=this.nonGeographic()[n];if(a)return a}else{var o=this.countryCallingCodes()[n];if(o&&o.length===1&&o[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])}(),A3=function(){function s(t,n){mg(this,s),this.globalMetadataObject=n,this.metadata=t,N_.call(this,n.metadata)}return hg(s,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return r.map(function(a){return new rY(a,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&C3(this.types(),n))return new iY(C3(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?w3:this.metadata[13]||w3}}])}(),rY=function(){function s(t,n){mg(this,s),this._format=t,this.metadata=n}return hg(s,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!aY.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),aY=/^\(?\$1\)?$/,iY=function(){function s(t,n){mg(this,s),this.type=t,this.metadata=n}return hg(s,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
vendor: 4,715 bytes, lines 800-801
800ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function C3(s,t){switch(t){case"FIXED_LINE":return s[0];case"MOBILE":return s[1];case"TOLL_FREE":return s[2];case"PREMIUM_RATE":return s[3];case"PERSONAL_NUMBER":return s[4];case"VOICEMAIL":return s[5];case"UAN":return s[6];case"PAGER":return s[7];case"VOIP":return s[8];case"SHARED_COST":return s[9]}}function j_(s){if(!s)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!bu(s)||!bu(s.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(bu(s)?"an object of shape: { "+Object.keys(s).join(", ")+" }":"a "+lY(s)+": "+s,"."))}var lY=function(t){return Yu(t)};function b_(s,t){var n=new Rr(t);if(n.hasCountry(s))return n.selectNumberingPlan(s).countryCallingCode();throw new Error("Unknown country: ".concat(s))}function oY(s,t){return t.countries.hasOwnProperty(s)}function N_(s){var t=s.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?N3(t,sY)===-1?this.v2=!0:N3(t,nY)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function Oj(s,t,n){return cY(s,void 0,t,n)}function cY(s,t,n,r){n&&(r=new Rr(r.metadata),r.selectNumberingPlan(n));var a=r.type(t),o=a&&a.possibleLengths()||r.possibleLengths();if(!o)return"IS_POSSIBLE";var c=s.length,u=o[0];return u===c?"IS_POSSIBLE":u>c?"TOO_SHORT":o[o.length-1]<c?"TOO_LONG":o.indexOf(c,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function dY(s,t,n){t===void 0&&(t={});var r=new Rr(n);if(t.v2){if(!s.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(s.country||s.countryCallingCode)}else{if(!s.phone)return!1;if(s.country){if(!r.hasCountry(s.country))throw new Error("Unknown country: ".concat(s.country));r.selectNumberingPlan(s.country)}else{if(!s.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(s.countryCallingCode)}}if(r.possibleLengths())return w_(s.phone||s.nationalNumber,r);if(s.countryCallingCode&&r.isNonGeographicCallingCode(s.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function w_(s,t){switch(Oj(s,void 0,t)){case"IS_POSSIBLE":return!0;default:return!1}}function Yl(s,t){return s=s||"",new RegExp("^(?:"+t+")$").test(s)}function uY(s,t){var n=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(n)return(n=n.call(s)).next.bind(n);if(Array.isArray(s)||(n=mY(s))||t){n&&(s=n);var r=0;return function(){return r>=s.length?{done:!0}:{done:!1,value:s[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 801In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mY(s,t){if(s){if(typeof s=="string")return S3(s,t);var n={}.toString.call(s).slice(8,-1);return n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set"?Array.from(s):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S3(s,t):void 0}}function S3(s,t){(t==null||t>s.length)&&(t=s.length);for(var n=0,r=Array(t);n<t;n++)r[n]=s[n];return r}var hY=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Fj(s,t,n){if(t=t||{},!(!s.country&&!s.countryCallingCode)){var r=new Rr(n);r.selectNumberingPlan(s.country||s.countryCallingCode);var a=t.v2?s.nationalNumber:s.phone;if(Yl(a,r.nationalNumberPattern())){if(kv(a,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||kv(a,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var o=uY(hY),c;!(c=o()).done;){var u=c.value;if(kv(a,u,r))return u}}}}function kv(s,t,n){var r=n.type(t);return!r||!r.pattern()||r.possibleLengths()&&r.possibleLengths().indexOf(s.length)<0?!1:Yl(s,r.pattern())}function fY(s,t,n){t=t||{};var r=new Rr(n);if(r.selectNumberingPlan(s.country||s.countryCallingCode),r.hasTypes())return Fj(s,t,r.metadata)!==void 0;var a=t.v2?s.nationalNumber:s.phone;return Yl(a,r.nationalNumberPattern())}var pY=/^[A-Z]{2}$/;function xY(s){return pY.test(s)}function gY(s,t){var n,r,a=new Rr(t);return xY(s)?(n=s,a.selectNumberingPlan(n),r=a.countryCallingCode()):r=s,{country:n,callingCode:r}}function yY(s,t,n){var r=new Rr(n),a=r.getCountryCodesForCallingCode(s);return a?a.filter(function(o){return vY(t,o,n)}):[]}function vY(s,t,n){var r=new Rr(n);return r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(s.length)>=0}var Rj=2,jY=17,bY=3,Di="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",NY="-â-ââã¼ï¼",wY="ï¼/",AY="ï¼.",CY="  Ââ
801â ã",SY="()ï¼ï¼ï¼»ï¼½\\[\\]",kY="~ââ¼ï½",b0="".concat(NY).concat(wY).concat(AY).concat(CY).concat(SY).concat(kY),Mj="+ï¼",$Y=new RegExp("(["+Di+"])");function PY(s,t,n,r){if(t){var a=new Rr(r);a.selectNumberingPlan(t||n);var o=new RegExp(a.IDDPrefix());if(s.search(o)===0){s=s.slice(s.match(o)[0].length);var c=s.match($Y);if(!(c&&c[1]!=null&&c[1].length>0&&c[1]==="0"))return s}}}function EY(s,t){if(s&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(s);if(r){var a,o,c=r.length-1,u=c>0&&r[c];if(t.nationalPrefixTransformRule()&&u)a=s.replace(n,t.nationalPrefixTransformRule()),c>1&&(o=r[1]);else{var h=r[0];a=s.slice(h.length),u&&(o=r[1])}var x;if(u){var m=s.indexOf(r[1]),g=s.slice(0,m);g===t.numberingPlan.nationalPrefix()&&(x=t.numberingPlan.nationalPrefix())}else x=r[0];return{nationalNumber:a,nationalPrefix:x,carrierCode:o}}}return{nationalNumber:s}}function TY(s,t){var n=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(n)return(n=n.call(s)).next.bind(n);if(Array.isArray(s)||(n=_Y(s))||t){n&&(s=n);var r=0;return function(){return r>=s.length?{done:!0}:{done:!1,value:s[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 802In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Y(s,t){if(s){if(typeof s=="string")return k3(s,t);var n={}.toString.call(s).slice(8,-1);return n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set"?Array.from(s):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k3(s,t):void 0}}function k3(s,t){(t==null||t>s.length)&&(t=s.length);for(var n=0,r=Array(t);n<t;n++)r[n]=s[n];return r}function IY(s,t,n){for(var r=new Rr(n),a=TY(t),o;!(o=a()).done;){var c=o.value;if(r.selectNumberingPlan(c),r.leadingDigits()){if(s&&s.search(r.leadingDigits())===0)return c}else if(Fj({phone:s,country:c},void 0,r.metadata))return c}}function A_(s,t){var n=t.nationalNumber,r=t.metadata,a=r.getCountryCodesForCallingCode(s);if(a)return a.length===1?a[0]:IY(n,a,r.metadata)}function Y1(s,t,n){var r=EY(s,n),a=r.carrierCode,o=r.nationalNumber;if(o!==s){if(!DY(s,o,n))return{nationalNumber:s};if(n.numberingPlan.possibleLengths()&&(t||(t=A_(n.numberingPlan.callingCode(),{nationalNumber:o,metadata:n})),!OY(o,t,n)))return{nationalNumber:s}}return{nationalNumber:o,carrierCode:a}}function DY(s,t,n){return!(Yl(s,n.nationalNumberPattern())&&!Yl(t,n.nationalNumberPattern()))}function OY(s,t,n){switch(Oj(s,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function FY(s,t,n,r,a){if(!(n||r))return{number:s};var o=n?b_(n,a):r;if(s.indexOf(o)===0){var c=new Rr(a);c.selectNumberingPlan(n||r);var u=s.slice(o.length),h=Y1(u,void 0,c),x=h.nationalNumber,m=Y1(s,void 0,c),g=m.nationalNumber;if(!Yl(g,c.nationalNumberPattern())&&Yl(x,c.nationalNumberPattern())||Oj(g,void 0,c)==="TOO_LONG")return{countryCallingCode:o,number:u}}return{number:s}}function C_(s,t,n,r,a){if(!s)return{};var o;if(s[0]!=="+"){var c=PY(s,n,r,a);if(c&&c!==s)o=!0,s="+"+c;else{if(n||r){var u=FY(s,t,n,r,a),h=u.countryCallingCode,x=u.number;if(h)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:h,number:x}}return{number:s}}}if(s[1]==="0")return{};for(var m=new Rr(a),g=2;g-1<=bY&&g<=s.length;){var y=s.slice(1,g);if(m.hasCallingCode(y))return m.selectNumberingPlan(y),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:y,number:s.slice(g)};g++}return{}}function RY(s){return s.replace(new RegExp("[".concat(b0,"]+"),"g")," ").trim()}var MY=/(\$\d)/;function LY(s,t,n){var r=n.useInternationalFormat,a=n.withNationalPrefix,o=s.replace(new RegExp(t.pattern()),r?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(MY,t.nationalPrefixFormattingRule()):t.format());return r?RY(o):o}var VY=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function UY(s,t,n){var r=new Rr(n);if(r.selectNumberingPlan(s||t),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(VY.test(r.IDDPrefix()))return r.IDDPrefix()}var zY=";ext=",cu=function(t){return"([".concat(Di,"]{1,").concat(t,"})")};function S_(s){var t="20",n="15",r="9",a="6",o="[  \\t,]*",c="[:\\.ï¼]?[  \\t,-]*",u="#?",h="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",x="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",m="[- ]+",g="[  \\t]*",y="(?:,{2}|;)",b=zY+cu(t),w=o+h+c+cu(t)+u,N=o+x+c+cu(r)+u,k=m+cu(a)+"#",E=g+y+c+cu(n)+u,P=g+"(?:,)+"+c+cu(r)+u;return b+"|"+w+"|"+N+"|"+k+"|"+E+"|"+P}var qY="["+Di+"]{"+Rj+"}",WY="["+Mj+"]{0,1}(?:["+b0+"]*["+Di+"]){3,}["+b0+Di+"]*",BY=new RegExp("^["+Mj+"]{0,1}(?:["+b0+"]*["+Di+"]){1,2}$","i"),KY=WY+"(?:"+S_()+")?",HY=new RegExp("^"+qY+"$|^"+KY+"$","i");function GY(s){return s.length>=Rj&&HY.test(s)}function ZY(s){return BY.test(s)}
vendor: 4,157 bytes, line 802
802function YY(s){var t=s.number,n=s.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}var $3={formatExtension:function(t,n,r){return"".concat(t).concat(r.ext()).concat(n)}};function QY(s,t,n,r){n?n=eQ({},$3,n):n=$3;var a=new Rr(r);if(s.country&&s.country!=="001"){if(!a.hasCountry(s.country))throw new Error("Unknown country: ".concat(s.country));a.selectNumberingPlan(s.country)}else if(s.countryCallingCode)a.selectNumberingPlan(s.countryCallingCode);else return s.phone||"";var o=a.countryCallingCode(),c=n.v2?s.nationalNumber:s.phone,u;switch(t){case"NATIONAL":return c?(u=N0(c,s.carrierCode,"NATIONAL",a,n),$v(u,s.ext,a,n.formatExtension)):"";case"INTERNATIONAL":return c?(u=N0(c,null,"INTERNATIONAL",a,n),u="+".concat(o," ").concat(u),$v(u,s.ext,a,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(c);case"RFC3966":return YY({number:"+".concat(o).concat(c),ext:s.ext});case"IDD":if(!n.fromCountry)return;var h=JY(c,s.carrierCode,o,n.fromCountry,a);return h?$v(h,s.ext,a,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function N0(s,t,n,r,a){var o=XY(r.formats(),s);return o?LY(s,o,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1)}):s}function XY(s,t){return tQ(s,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(t.search(r)!==0)return!1}return Yl(t,n.pattern())})}function $v(s,t,n,r){return t?r(s,t,n):s}function JY(s,t,n,r,a){var o=b_(r,a.metadata);if(o===n){var c=N0(s,t,"NATIONAL",a);return n==="1"?n+" "+c:c}var u=UY(r,void 0,a.metadata);if(u)return"".concat(u," ").concat(n," ").concat(N0(s,null,"INTERNATIONAL",a))}function eQ(){for(var s=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;s<n.length;){if(n[s])for(var a in n[s])n[0][a]=n[s][a];s++}return n[0]}function tQ(s,t){for(var n=0;n<s.length;){if(t(s[n]))return s[n];n++}}function Xh(s){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xh(s)}function P3(s,t){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(s,a).enumerable})),n.push.apply(n,r)}return n}function E3(s){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P3(Object(n),!0).forEach(function(r){sQ(s,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):P3(Object(n)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(n,r))})}return s}function sQ(s,t,n){return(t=k_(t))in s?Object.defineProperty(s,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[t]=n,s}function nQ(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")}function rQ(s,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,k_(r.key),r)}}function aQ(s,t,n){return t&&rQ(s.prototype,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function k_(s){var t=iQ(s,"string");return Xh(t)=="symbol"?t:t+""}function iQ(s,t){if(Xh(s)!="object"||!s)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,t);if(Xh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}var lQ=function(){function s(t,n,r){if(nQ(this,s),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(bu(n)&&bu(n.countries)){r=n;var a=t;if(!oQ.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
vendor: 7,674 bytes, lines 802-803
802var o=C_(a,void 0,void 0,void 0,r),c=o.countryCallingCode,u=o.number;if(n=u,t=c,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");j_(r);var h=gY(t,r),x=h.country,m=h.callingCode;this.country=x,this.countryCallingCode=m,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return aQ(s,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:yY(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return dY(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return fY(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new Rr(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return Fj(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return QY(this,n,r?E3(E3({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])}(),oQ=/^\+\d+$/;function Q1(s){"@babel/helpers - typeof";return Q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q1(s)}function cQ(s,t,n){return Object.defineProperty(s,"prototype",{writable:!1}),s}function dQ(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")}function uQ(s,t,n){return t=ef(t),mQ(s,Lj()?Reflect.construct(t,n||[],ef(s).constructor):t.apply(s,n))}function mQ(s,t){if(t&&(Q1(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hQ(s)}function hQ(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function fQ(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(t&&t.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),t&&Jh(s,t)}function X1(s){var t=typeof Map=="function"?new Map:void 0;return X1=function(r){if(r===null||!xQ(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return pQ(r,arguments,ef(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Jh(a,r)},X1(s)}function pQ(s,t,n){if(Lj())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(s.bind.apply(s,r));return n&&Jh(a,n.prototype),a}function Lj(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lj=function(){return!!s})()}function xQ(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function Jh(s,t){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Jh(s,t)}function ef(s){return ef=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ef(s)}var Vl=function(s){function t(n){var r;return dQ(this,t),r=uQ(this,t,[n]),Object.setPrototypeOf(r,t.prototype),r.name=r.constructor.name,r}return fQ(t,s),cQ(t)}(X1(Error)),T3=new RegExp("(?:"+S_()+")$","i");function gQ(s){var t=s.search(T3);if(t<0)return{};for(var n=s.slice(0,t),r=s.match(T3),a=1;a<r.length;){if(r[a])return{number:n,ext:r[a]};a++}}var yQ={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function vQ(s){return yQ[s]}function jQ(s,t){var n=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(n)return(n=n.call(s)).next.bind(n);if(Array.isArray(s)||(n=bQ(s))||t){n&&(s=n);var r=0;return function(){return r>=s.length?{done:!0}:{done:!1,value:s[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 803In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bQ(s,t){if(s){if(typeof s=="string")return _3(s,t);var n={}.toString.call(s).slice(8,-1);return n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set"?Array.from(s):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_3(s,t):void 0}}function _3(s,t){(t==null||t>s.length)&&(t=s.length);for(var n=0,r=Array(t);n<t;n++)r[n]=s[n];return r}function I3(s){for(var t="",n=jQ(s.split("")),r;!(r=n()).done;){var a=r.value;t+=NQ(a,t)||""}return t}function NQ(s,t,n){return s==="+"?t?void 0:"+":vQ(s)}var $_="+",wQ="[\\-\\.\\(\\)]?",D3="(["+Di+"]|"+wQ+")",AQ="^\\"+$_+D3+"*["+Di+"]"+D3+"*$",CQ=new RegExp(AQ,"g"),J1=Di,SQ="["+J1+"]+((\\-)*["+J1+"])*",kQ="a-zA-Z",$Q="["+kQ+"]+((\\-)*["+J1+"])*",PQ="^("+SQ+"\\.)*"+$Q+"\\.?$",EQ=new RegExp(PQ,"g"),O3="tel:",e2=";phone-context=",TQ=";isub=";function _Q(s){var t=s.indexOf(e2);if(t<0)return null;var n=t+e2.length;if(n>=s.length)return"";var r=s.indexOf(";",n);return r>=0?s.substring(n,r):s.substring(n)}function IQ(s){return s===null?!0:s.length===0?!1:CQ.test(s)||EQ.test(s)}function DQ(s,t){var n=t.extractFormattedPhoneNumber,r=_Q(s);if(!IQ(r))throw new Vl("NOT_A_NUMBER");var a;if(r===null)a=n(s)||"";else{a="",r.charAt(0)===$_&&(a+=r);var o=s.indexOf(O3),c;o>=0?c=o+O3.length:c=0;var u=s.indexOf(e2);a+=s.substring(c,u)}var h=a.indexOf(TQ);if(h>0&&(a=a.substring(0,h)),a!=="")return a}var OQ=250,FQ=new RegExp("["+Mj+Di+"]"),RQ=new RegExp("[^"+Di+"#]+$");function MQ(s,t,n){t=t||{};var r=new Rr(n);if(t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new Vl("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var a=VQ(s,t.v2,t.extract),o=a.number,c=a.ext,u=a.error;if(!o){if(t.v2)throw u==="TOO_SHORT"?new Vl("TOO_SHORT"):new Vl("NOT_A_NUMBER");return{}}var h=zQ(o,t.defaultCountry,t.defaultCallingCode,r),x=h.country,m=h.nationalNumber,g=h.countryCallingCode,y=h.countryCallingCodeSource,b=h.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Vl("INVALID_COUNTRY");return{}}if(!m||m.length<Rj){if(t.v2)throw new Vl("TOO_SHORT");return{}}if(m.length>jY){if(t.v2)throw new Vl("TOO_LONG");return{}}if(t.v2){var w=new lQ(g,m,r.metadata);return x&&(w.country=x),b&&(w.carrierCode=b),c&&(w.ext=c),w.__countryCallingCodeSource=y,w}var N=(t.extended?r.hasSelectedNumberingPlan():x)?Yl(m,r.nationalNumberPattern()):!1;return t.extended?{country:x,countryCallingCode:g,carrierCode:b,valid:N,possible:N?!0:!!(t.extended===!0&&r.possibleLengths()&&w_(m,r)),phone:m,ext:c}:N?UQ(x,m,c):{}}function LQ(s,t,n){if(s){if(s.length>OQ){if(n)throw new Vl("TOO_LONG");return}if(t===!1)return s;var r=s.search(FQ);if(!(r<0))return s.slice(r).replace(RQ,"")}}function VQ(s,t,n){var r=DQ(s,{extractFormattedPhoneNumber:function(c){return LQ(c,n,t)}});if(!r)return{};
vendor: 4,110 bytes, lines 803-804
803if(!GY(r))return ZY(r)?{error:"TOO_SHORT"}:{};var a=gQ(r);return a.ext?a:{number:r}}function UQ(s,t,n){var r={country:s,phone:t};return n&&(r.ext=n),r}function zQ(s,t,n,r){var a=C_(I3(s),void 0,t,n,r.metadata),o=a.countryCallingCodeSource,c=a.countryCallingCode,u=a.number,h;if(c)r.selectNumberingPlan(c);else if(u&&(t||n))t?(h=t,r.selectNumberingPlan(t),c=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),c=n);else return{};if(!u)return{countryCallingCodeSource:o,countryCallingCode:c};var x=Y1(I3(u),void 0,r),m=x.nationalNumber,g=x.carrierCode,y=A_(c,{nationalNumber:m,metadata:r});return y&&(h=y,y==="001"||r.selectNumberingPlan(h)),{country:h,countryCallingCode:c,countryCallingCodeSource:o,nationalNumber:m,carrierCode:g}}function tf(s){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(s)}function F3(s,t){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(s,a).enumerable})),n.push.apply(n,r)}return n}function R3(s){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F3(Object(n),!0).forEach(function(r){qQ(s,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):F3(Object(n)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(n,r))})}return s}function qQ(s,t,n){return(t=WQ(t))in s?Object.defineProperty(s,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[t]=n,s}function WQ(s){var t=BQ(s,"string");return tf(t)=="symbol"?t:t+""}function BQ(s,t){if(tf(s)!="object"||!s)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function KQ(s,t,n){return MQ(s,R3(R3({},t),{},{v2:!0}),n)}function sf(s){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(s)}function M3(s,t){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(s,a).enumerable})),n.push.apply(n,r)}return n}function HQ(s){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M3(Object(n),!0).forEach(function(r){GQ(s,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):M3(Object(n)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(n,r))})}return s}function GQ(s,t,n){return(t=ZQ(t))in s?Object.defineProperty(s,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[t]=n,s}function ZQ(s){var t=YQ(s,"string");return sf(t)=="symbol"?t:t+""}function YQ(s,t){if(sf(s)!="object"||!s)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function QQ(s,t){return tX(s)||eX(s,t)||JQ(s,t)||XQ()}function XQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 804In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JQ(s,t){if(s){if(typeof s=="string")return L3(s,t);var n={}.toString.call(s).slice(8,-1);return n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set"?Array.from(s):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L3(s,t):void 0}}function L3(s,t){(t==null||t>s.length)&&(t=s.length);for(var n=0,r=Array(t);n<t;n++)r[n]=s[n];return r}function eX(s,t){var n=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(n!=null){var r,a,o,c,u=[],h=!0,x=!1;try{if(o=(n=n.call(s)).next,t!==0)for(;
804!(h=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);h=!0);}catch(m){x=!0,a=m}finally{try{if(!h&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(x)throw a}}return u}}function tX(s){if(Array.isArray(s))return s}function sX(s){var t=Array.prototype.slice.call(s),n=QQ(t,4),r=n[0],a=n[1],o=n[2],c=n[3],u,h,x;if(typeof r=="string")u=r;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")c?(h=o,x=c):(h=void 0,x=o),a&&(h=HQ({defaultCountry:a},h));else if(bu(a))o?(h=a,x=o):x=a;else throw new Error("Invalid second argument: ".concat(a));return{text:u,options:h,metadata:x}}function nf(s){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(s)}function V3(s,t){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(s,a).enumerable})),n.push.apply(n,r)}return n}function U3(s){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V3(Object(n),!0).forEach(function(r){nX(s,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):V3(Object(n)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(n,r))})}return s}function nX(s,t,n){return(t=rX(t))in s?Object.defineProperty(s,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[t]=n,s}function rX(s){var t=aX(s,"string");return nf(t)=="symbol"?t:t+""}function aX(s,t){if(nf(s)!="object"||!s)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function iX(s,t,n){t&&t.defaultCountry&&!oY(t.defaultCountry,n)&&(t=U3(U3({},t),{},{defaultCountry:void 0}));try{return KQ(s,t,n)}catch(r){if(!(r instanceof Vl))throw r}}function lX(){var s=sX(arguments),t=s.text,n=s.options,r=s.metadata;return iX(t,n,r)}function oX(){return ZZ(lX,arguments)}const Pv=te.string().transform((s,t)=>{const n=s.trim();if(!n)return"";if(n.includes("@")&&te.string().email().safeParse(n).success)return n;if(/^\+?[\d\s().-]+$/.test(n)){const r=n.replace(/[\s().-]/g,""),a=r.startsWith("+"),o=/^\d{10}$/.test(r)||/^1\d{10}$/.test(r);if(a||o){const c=oX(r,a?void 0:"US");if(c!=null&&c.isValid()&&!c.ext&&(a||c.country==="US"||c.country==="CA"))return c.number}}return t.addIssue({code:te.ZodIssueCode.custom,message:"Enter a valid U.S./Canadian phone number, an international number starting with + and its country code, or an email address. Extensions are not supported."}),te.NEVER}),cX=Qt("sessions",{sid:it("sid").primaryKey(),sess:Zu("sess").notNull(),expire:Re("expire").notNull()},s=>[Gn("IDX_session_expire").on(s.expire)]),P_=Qt("users",{id:it("id").primaryKey(),email:it("email").unique(),firstName:it("first_name"),lastName:it("last_name"),profileImageUrl:it("profile_image_url"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow(),passwordHash:it("password_hash"),role:it("role").default("family"),isActive:qt("is_active").default(!0),lastLogin:Re("last_login"),requiresPasswordChange:qt("requires_password_change").default(!1),caregiverConfirmed:qt("caregiver_confirmed").default(!1),referralSource:de("referral_source"),completionDeadline:Re("completion_deadline"),remindersSent:tt("reminders_sent").default(0),lastEngagement:Re("last_engagement"),accountStatus:it("account_status").default("active"),gracePeriodExtended:qt("grace_period_extended").default(!1)}),dX=Qt("password_reset_tokens",{id:as("id").primaryKey(),email:it("email").notNull(),token:it("token").notNull().unique(),expiresAt:Re("expires_at").notNull(),usedAt:Re("used_at"),createdAt:Re("created_at").defaultNow()}),uX=Qt("account_cleanup_log",{id:as("id").primaryKey(),userId:it("user_id").notNull(),email:it("email").notNull(),action:it("action").notNull(),reason:de("reason"),emailSent:qt("email_sent").default(!1),createdAt:
804Re("created_at").defaultNow(),scheduledFor:Re("scheduled_for"),completed:qt("completed").default(!1)}),E_=Qt("zoom_password_queue",{id:as("id").primaryKey(),meetingId:it("meeting_id").notNull(),meetingType:it("meeting_type").notNull(),className:it("class_name"),currentPassword:it("current_password"),nextPassword:it("next_password"),passwordWeek:it("password_week").notNull(),rotationScheduled:Re("rotation_scheduled").notNull(),rotationCompleted:Re("rotation_completed"),rotationStatus:it("rotation_status").default("pending"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),T_=Qt("password_rotation_log",{id:as("id").primaryKey(),meetingId:it("meeting_id").notNull(),oldPassword:it("old_password"),newPassword:it("new_password"),rotationDate:Re("rotation_date").defaultNow(),success:qt("success").notNull(),errorMessage:de("error_message"),adminNotified:qt("admin_notified").default(!1)}),__=Qt("reminder_audit_log",{id:as("id").primaryKey(),reminderType:it("reminder_type",{length:20}).notNull(),weekStartEt:yr("week_start_et").notNull(),familyId:tt("family_id").notNull(),contentId:tt("content_id"),sentTimestampEt:Re("sent_timestamp_et").notNull(),phoneNumber:it("phone_number",{length:20}).notNull(),messagePreview:de("message_preview"),createdAt:Re("created_at").defaultNow()}),mX=Es(E_),hX=Es(T_),fX=Es(__),dr=Qt("families",{id:as("id").primaryKey(),email:de("email").notNull().unique(),address:de("address"),timeZone:de("time_zone"),caregiverOneName:de("caregiver_one_name").notNull(),caregiverOneEmail:de("caregiver_one_email"),caregiverOnePhone:de("caregiver_one_phone"),caregiverTwoName:de("caregiver_two_name"),caregiverTwoEmail:de("caregiver_two_email"),caregiverTwoPhone:de("caregiver_two_phone"),caregiverThreeName:de("caregiver_three_name"),caregiverThreeEmail:de("caregiver_three_email"),caregiverThreePhone:de("caregiver_three_phone"),registrationDate:Re("registration_date").defaultNow().notNull(),status:de("status").notNull().default("active"),paymentPreference:de("payment_preference").default("monthly"),paymentMethod:de("payment_method").default("family"),scholarshipInfo:de("scholarship_info"),scholarshipPercentage:zT("scholarship_percentage").default(0),thirdPartyPayerName:de("third_party_payer_name"),thirdPartyContact:de("third_party_contact"),aacAwarenessPromoApplied:qt("aac_awareness_promo_applied").default(!1),aacA
804warenessPromoDate:Re("aac_awareness_promo_date"),contractExemption:qt("contract_exemption").default(!1),contractExemptionReason:de("contract_exemption_reason")}),sa=Qt("students",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),name:de("name").notNull(),nicknames:de("nicknames"),birthday:yr("birthday"),age:tt("age"),gradeEquivalent:de("grade_equivalent"),streetAddress:de("street_address"),city:de("city"),state:de("state"),country:de("country"),postalCode:de("postal_code"),diagnosis:de("diagnosis"),currentAacSystems:de("current_aac_systems").array(),accommodations:de("accommodations").array(),studentCategories:de("student_categories").array().default([]),openEnrollmentClasses:tt("open_enrollment_classes").default(1),contractSigned:qt("contract_signed").default(!1),contractSignedDate:Re("contract_signed_date"),contractSignedBy:de("contract_signed_by"),photoPermissionSigned:qt("photo_permission_signed").default(!1),photoUrl:de("photo_url"),photoUploadedBy:de("photo_uploaded_by"),photoUploadedDate:Re("photo_uploaded_date"),emergencyContact:de("emergency_contact"),emergencyPhone:de("emergency_phone"),medicalInfo:de("medical_info"),otherInfo:de("other_info"),specialInterests:de("special_interests"),calmingStrategies:de("calming_strategies"),upsetTriggers:de("upset_triggers"),alphabetAccess:de("alphabet_access"),yesNoMethod:de("yes_no_method"),aacProficiency:de("aac_proficiency"),readingSkills:de("reading_skills"),mathSkills:de("math_skills"),notes:de("notes"),administrativeNotes:de("administrative_notes"),educationalNotes:de("educational_notes"),literacyLevel:tt("literacy_level"),mathLevel:tt("math_level"),ahernLiteracyClass:de("ahern_literacy_class"),ahernMathClass:de("ahern_math_class"),primaryAacReady:qt("primary_aac_ready").default(!1),primaryAacSystem:de("primary_aac_system"),primaryAacOther:de("primary_aac_other"),primaryAacPlatform:de("primary_aac_platform"),aacFileUrl:de("aac_file_url"),aacFileName:de("aac_file_name"),aacFileSize:tt("aac_file_size"),aacFileUploadedBy:de("aac_file_uploaded_by"),aacFileUploadedDate:de("aac_file_uploaded_date"),oneOnOneRate:tt("one_on_one_rate"),oneOnOneApproved:qt("one_on_one_approved").default(!1),ahernAcademyApproved:qt("ahern_academy_approved").default(!1),ahernAcademyApplicationSubmitted:qt("ahern_academy_application_submitted").default(!1),archived:qt("archived").default(!1),enrollmentDate:Re("enrollment_date").defaultNow().notNull()}),I_=Qt("ahern_academy_applications",{id:as("id").primaryKey(),studentId:tt("student_id").references(()=>sa.id).notNull(),familyId:tt("family_id").references(()=>dr.id).notNull(),homeschoolReasoning:de("homeschool_reasoning"),communicationSkills:de("communication_skills"),communicationEvaluationFiles:de("communication_evaluation_files").array(),readingSkills:de("reading_skills_detail"),readingEvaluationFiles:de("reading_evaluation_files").array(),mathSkills:de("math_skills_detail"),mathEvaluationFiles:de("math_evaluation_files").array(),specialInterestsDetail:de("special_interests_detail"),selfAdvocacySkills:de("self_advocacy_skills"),traumaAndSupport:de("trauma_and_support"),knownTriggers:de("known_triggers"),regulationSkills:de("regulation_skills"),regulationSupports:de("regulation_supports"),studentStrengths:de("student_strengths"),motorSkills:de("motor_skills"),termGoals:de("term_goals"),learningCoachName:de("learning_coach_name"),learningCoachAgreesToAttend:qt("learning_coach_agrees_to_attend"),learningCoachComfortLevel:tt("learning_coach_comfort_level"),deviceForClasses:de("device_for_classes"),reliableInternet:qt("reliable_internet"),technologyIssues:de("technology_issues"),howHeardAbout:de("how_heard_about"),additionalInfo:de("additional_info"),understandsYearCommitment:qt("understands_year_commitment"),affirmationAccurate:qt("affirmation_accurate"),electronicSignature:de("electronic_signature"),signatureDate:yr("signature_date"),submittedAt:Re("submitted_at").defaultNow().notNull(),adminNotifiedAt:Re("admin_notified_at"),followUpReminderSentAt:Re("follow_up_reminder_sent_at"),reviewedBy:de("reviewed_by"),reviewedAt:Re("reviewed_at"),status:de("status").default("pending"),rejectionReason:de("rejection_reason")}),dc=Qt("payments",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id),amount:ei("amount",{precision:10,scale:2}).notNull(),cashAmount:ei("cash_amount",{precision:10,scale:2}),creditAmount:ei("credit_amount",{precision:10,scale:2}),satisfiedAmount:ei("satisfied_amount",{precision:10,scale:2}),dueDate:yr("due_date").notNull(),paidDate:yr("paid_date"),status:de("status").notNull().default("pending"),description:de("description"),squarePaymentId:de("square_payment_id"),idempotencyKey:it("idempotency_key",{length:45}),serviceType:de("service_type"),serviceTypes:de("service_types").array(),billingPeriod:de("billing_period"),billingFrequency:de("billing_frequency"),recurringPaymentId:de("recurring_payment_id"),nextDueDate:Re("next_due_date"),autoGenerated:qt("auto_generated").default(!1),thirdPartyPayer:de("third_party_payer"),thirdPartyReference:de("third_party_reference"),isThirdPartyPayment:qt("is_third_party_payment").default(!1),sessionAppointmentId:tt("session_appointment_id").references(()=>Df.id),classSessionId:tt("class_session_id").references(()=>Jl.id),notes:de("notes"),sessionUserId:de("session_user_id"),sessionUserEmail:de("session_user_email"),sessionUserRole:de("session_user_role"),sessionId:de("session_id"),userAgent:de("user_agent"),ipAddress:de("ip_address"),createdAt:
804Re("created_at").defaultNow().notNull()}),D_=Qt("messages",{id:as("id").primaryKey(),subject:de("subject"),content:de("content").notNull(),channel:de("channel").notNull(),recipientCount:tt("recipient_count").default(0),sentAt:Re("sent_at").defaultNow(),senderName:de("sender_name"),deliveryStatus:de("delivery_status").default("sent"),messageId:de("message_id"),targetPrograms:de("target_programs").array(),customRecipients:de("custom_recipients").array(),type:de("type").default("email"),recipients:de("recipients").array(),sentDate:Re("sent_date").defaultNow(),sentBy:de("sent_by"),isDeleted:qt("is_deleted").default(!1),isArchived:qt("is_archived").default(!1),deletedAt:Re("deleted_at"),archivedAt:Re("archived_at"),audienceSelection:de("audience_selection"),audienceDisplayName:de("audience_display_name"),failedRecipients:de("failed_recipients").array()}),Vj=Qt("newsletters",{id:as("id").primaryKey(),subject:de("subject").notNull(),content:de("content").notNull(),status:de("status").notNull().default("draft"),sentDate:Re("sent_date"),createdDate:Re("created_date").defaultNow().notNull(),recipientCount:tt("recipient_count").default(0),sentCount:tt("sent_count").default(0),totalRecipients:tt("total_recipients").default(0),errorsCount:tt("errors_count").default(0),lastProgressAt:Re("last_progress_at"),openRate:ei("open_rate",{precision:5,scale:2}),clickRate:ei("click_rate",{precision:5,scale:2}),deliveredCount:tt("delivered_count").default(0),failedCount:tt("failed_count").default(0),sentBy:de("sent_by"),audience:de("audience"),followupRunAt:Re("followup_run_at"),followupRecipientCount:tt("followup_recipient_count").default(0)}),pX=Qt("newsletter_analytics",{id:as("id").primaryKey(),newsletterId:tt("newsletter_id").references(()=>Vj.id).notNull(),recipientEmail:de("recipient_email").notNull(),messageId:de("message_id"),delivered:qt("delivered").default(!1),scanned:qt("scanned").default(!1),opened:qt("opened").default(!1),clicked:qt("clicked").default(!1),bounced:qt("bounced").default(!1),unsubscribed:qt("unsubscribed").default(!1),deliveredAt:Re("delivered_at"),firstSeenAt:Re("first_seen_at"),openedAt:Re("opened_at"),clickedAt:Re("clicked_at"),bouncedAt:Re("bounced_at"),unsubscribedAt:Re("unsubscribed_at"),userAgent:de("user_agent"),signature:de("signature"),createdAt:Re("created_at").defaultNow().notNull()},s=>[lm("newsletter_analytics_unique_constraint").on(s.newsletterId,s.recipientEmail)]),O_=Qt("files",{id:as("id").primaryKey(),filename:de("filename").notNull(),original_name:de("original_name").notNull(),file_path:de("file_path").notNull(),file_size:tt("file_size"),mime_type:de("mime_type"),access_levels:de("access_levels").array().default([]),uploaded_by:de("uploaded_by"),uploaded_date:Re("uploaded_date").defaultNow(),description:de("description"),tags:de("tags").array().default([]),name:de("name"),type:de("type"),url:de("url"),uploadDate:Re("upload_date").defaultNow(),accessLevel:de("access_level")}),Jl=Qt("class_sessions",{id:as("id").primaryKey(),name:it("name",{length:255}).notNull(),sessionType:it("session_type",{length:50}).notNull(),startDate:Re("start_date").notNull(),endDate:Re("end_date").notNull(),description:de("description"),isActive:qt("is_active").default(!1),createdAt:Re("created_at").defaultNow().notNull()}),Uj=Qt("class_slots",{id:as("id").primaryKey(),sessionId:tt("session_id").references(()=>Jl.id).notNull(),timeSlot:it("time_slot",{length:50}).notNull(),className:it("class_name",{length:255}).notNull(),description:de("description"),days:it("days",{length:50}).notNull(),ageRequirement:tt("age_requirement").default(4),capacity:tt("capacity").default(15).notNull(),weeklyTheme:de("weekly_theme"),specialNotes:de("special_notes"),isActive:qt("is_active").default(!0),weekNumber:tt("week_number")}),If=Qt("class_enrollments",{id:as("id").primaryKey(),studentId:tt("student_id").references(()=>sa.id).notNull(),familyId:tt("family_id").references(()=>dr.id).notNull(),slotId:tt("slot_id").references(()=>Uj.id).notNull(),sessionId:tt("session_id").references(()=>Jl.id),enrollmentPeriod:it("enrollment_period",{length:50}
804).notNull(),enrolledWeeks:tt("enrolled_weeks").array(),startDate:Re("start_date").notNull(),endDate:Re("end_date").notNull(),status:it("status",{length:50}).default("active").notNull(),paymentId:tt("payment_id").references(()=>dc.id),helperName:de("helper_name"),helperContact:de("helper_contact"),specialAccommodations:de("special_accommodations"),enrollmentDate:Re("enrollment_date").defaultNow().notNull(),archivedDate:Re("archived_date"),billingActive:qt("billing_active").default(!0),archiveReason:it("archive_reason",{length:100}),reminder1WeekSent:qt("reminder_1week_sent").default(!1),reminder1DaySent:qt("reminder_1day_sent").default(!1),archiveNotificationSent:qt("archive_notification_sent").default(!1)}),F_=Qt("newsletter_subscribers",{id:as("id").primaryKey(),email:de("email").notNull().unique(),firstName:de("first_name"),lastName:de("last_name"),status:it("status",{length:20}).default("active").notNull(),subscribeDate:Re("subscribe_date").defaultNow().notNull(),unsubscribeDate:Re("unsubscribe_date"),interests:de("interests").array(),location:de("location"),source:de("source").default("mailchimp_import"),notes:de("notes"),lastSentDate:Re("last_sent_date"),isActive:qt("is_active").default(!0).notNull(),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()}),R_=Qt("newsletter_preferences",{id:as("id").primaryKey(),normalizedEmail:de("normalized_email").notNull().unique(),effectiveStatus:it("effective_status",{length:20}).notNull().default("needs_review"),suppressionReason:de("suppression_reason"),consentVersion:it("consent_version",{length:100}),consentText:de("consent_text"),consentedAt:Re("consented_at"),subscribedAt:Re("subscribed_at"),unsubscribedAt:Re("unsubscribed_at"),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[Gn("newsletter_preferences_status_idx").on(s.effectiveStatus)]),M_=Qt("newsletter_confirmation_tokens",{id:as("id").primaryKey(),normalizedEmail:de("normalized_email").notNull(),tokenHash:it("token_hash",{length:128}).notNull().unique(),firstName:de("first_name"),lastName:de("last_name"),consentVersion:it("consent_version",{length:100}).notNull(),consentText:de("consent_text").notNull(),consentedAt:Re("consented_at").notNull(),expiresAt:Re("expires_at").notNull(),usedAt:Re("used_at"),invalidatedAt:Re("invalidated_at"),confirmedAt:Re("confirmed_at"),createdAt:Re("created_at").defaultNow().notNull()},s=>[Gn("newsletter_confirmation_tokens_email_idx").on(s.normalizedEmail),Gn("newsletter_confirmation_tokens_expiry_idx").on(s.expiresAt)]),L_=Qt("newsletter_preference_events",{id:as("id").primaryKey(),normalizedEmail:de("normalized_email").notNull(),eventType:it("event_type",{length:40}).notNull(),effectiveStatus:it("effective_status",{length:20}).notNull(),source:it("source",{length:80}).notNull(),consentVersion:it("consent_version",{length:100}),consentText:de("consent_text"),tokenHash:it("token_hash",{length:128}),occurredAt:Re("occurred_at").defaultNow().notNull()},s=>[Gn("newsletter_preference_events_email_idx").on(s.normalizedEmail),Gn("newsletter_preference_events_occurred_idx").on(s.occurredAt)]),V_=Qt("shared_rate_limits",{id:as("id").primaryKey(),scope:it("scope",{length:80}).notNull(),rateKey:de("rate_key").notNull(),windowStartedAt:Re("window_started_at").defaultNow().notNull(),windowSeconds:tt("window_seconds").notNull().default(3600),maxAttempts:tt("max_attempts").notNull().default(1),attemptCount:tt("attempt_count").notNull().default(0),blockedUntil:Re("blocked_until"),enabled:qt("enabled").notNull().default(!0),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[lm("shared_rate_limits_scope_key_unique").on(s.scope,s.rateKey),Gn("shared_rate_limits_updated_idx").on(s.updatedAt)]),Df=Qt("session_appointments",{id:as("id").primaryKey(),studentId:tt("student_id").notNull().references(()=>sa.id),familyId:tt("family_id").notNull().references(()=>dr.id),scheduledDate:Re("scheduled_date").notNull(),durationMinutes:tt("duration_minutes").notNull().default(60),sessionType:it("session_type",{length:50}).notNull().default("1:1"),status:it("status",{length:20}).notNull().default("scheduled"),rate:ei("rate",{precision:10,scale:2}).notNull(),isRecurring:qt("is_recurring").default(!1),recurringPattern:it("recurring_pattern",{length:50}
804),recurringEndDate:Re("recurring_end_date"),parentAppointmentId:tt("parent_appointment_id"),notes:de("notes"),cancellationReason:de("cancellation_reason"),cancelledAt:Re("cancelled_at"),cancelledBy:it("cancelled_by",{length:20}),zoomMeetingId:it("zoom_meeting_id",{length:100}),zoomMeetingUrl:de("zoom_meeting_url"),serviceDate:it("service_date",{length:10}),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),U_=Qt("session_attendance",{id:as("id").primaryKey(),appointmentId:tt("appointment_id").notNull().references(()=>Df.id),studentId:tt("student_id").notNull().references(()=>sa.id),attendanceStatus:it("attendance_status",{length:20}).notNull().default("pending"),joinTime:Re("join_time",{withTimezone:!0}),leaveTime:Re("leave_time",{withTimezone:!0}),durationMinutes:tt("duration_minutes"),attendancePercentage:ei("attendance_percentage",{precision:5,scale:2}),isZoomTracked:qt("is_zoom_tracked").default(!1),zoomParticipantId:it("zoom_participant_id",{length:100}),manualOverride:qt("manual_override").default(!1),notes:de("notes"),zoomAiSummary:de("zoom_ai_summary"),zoomMeetingUuid:it("zoom_meeting_uuid",{length:100}),zoomMeetingTitle:it("zoom_meeting_title",{length:200}),sessionTranscript:de("session_transcript"),serviceDate:it("service_date",{length:10}),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),fg=Qt("session_billing",{id:as("id").primaryKey(),appointmentId:tt("appointment_id").notNull().references(()=>Df.id),familyId:tt("family_id").notNull().references(()=>dr.id),studentId:tt("student_id").notNull().references(()=>sa.id),sessionDate:yr("session_date").notNull(),billingStatus:it("billing_status",{length:20}).notNull().default("pending"),chargeAmount:ei("charge_amount",{precision:10,scale:2}).notNull(),chargeReason:it("charge_reason",{length:50}).notNull(),paymentId:tt("payment_id").references(()=>dc.id),waiveReason:de("waive_reason"),cancellationPolicy:qt("cancellation_policy_applied").default(!1),serviceDate:it("service_date",{length:10}),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),z_=Qt("payment_coverage",{id:as("id").primaryKey(),paymentId:tt("payment_id").references(()=>dc.id).notNull(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id),sessionId:tt("session_id").references(()=>Jl.id),enrollmentId:tt("enrollment_id").references(()=>If.id),weekNumber:tt("week_number"),sessionBillingId:tt("session_billing_id").references(()=>fg.id),coverageStatus:it("coverage_status",{length:16}).notNull().default("active"),createdAt:Re("created_at").defaultNow().notNull()},s=>[Gn("payment_coverage_payment_idx").on(s.paymentId),Gn("payment_coverage_enrollment_week_idx").on(s.enrollmentId,s.sessionId,s.weekNumber),Gn("payment_coverage_session_billing_idx").on(s.sessionBillingId)]),xX=Qt("payment_coverage_claims",{id:as("id").primaryKey(),coverageKey:it("coverage_key",{length:255}).notNull().unique(),familyId:tt("family_id").references(()=>dr.id).notNull(),idempotencyKey:it("idempotency_key",{length:45}).notNull(),expiresAt:Re("expires_at"),createdAt:Re("created_at").defaultNow().notNull()},s=>[Gn("payment_coverage_claims_family_idx").on(s.familyId),Gn("payment_coverage_claims_idempotency_idx").on(s.idempotencyKey)]),gX=Qt("payment_attempts",{idempotencyKey:it("idempotency_key",{length:45}).primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),requestFingerprint:it("request_fingerprint",{length:64}).notNull(),amount:ei("amount",{precision:10,scale:2}).notNull(),coverageFingerprint:de("coverage_fingerprint").notNull(),status:it("status",{length:24}).notNull().default("started"),squarePaymentId:de("square_payment_id"),paymentId:tt("payment_id").references(()=>dc.id),lastError:de("last_error"),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[Gn("payment_attempts_family_idx").on(s.familyId),Gn("payment_attempts_coverage_idx").on(s.familyId,s.coverageFingerprint)]),zj=Qt("carry_forward_credits",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),sourcePaymentId:tt("source_payment_id").references(()=>dc.id).notNull(),sourceEnrollmentId:tt("source_enrollment_id").references(()=>If.id).notNull(),sourceSessionId:tt("source_session_id").references(()=>Jl.id).notNull(),sourceWeekNumber:tt("source_week_number").notNull(),sourceWeekStart:yr("source_week_start").notNull(),originalAmount:ei("original_amount",{precision:10,scale:2}
804).notNull(),createdAt:Re("created_at").defaultNow().notNull()},s=>[lm("carry_forward_credits_source_payment_week_unique").on(s.sourcePaymentId,s.sourceWeekStart),Gn("carry_forward_credits_family_student_idx").on(s.familyId,s.studentId)]),q_=Qt("carry_forward_credit_applications",{id:as("id").primaryKey(),creditId:tt("credit_id").references(()=>zj.id).notNull(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),idempotencyKey:it("idempotency_key",{length:45}).notNull(),amount:ei("amount",{precision:10,scale:2}).notNull(),status:it("status",{length:16}).notNull().default("reserved"),destinationEnrollmentId:tt("destination_enrollment_id").references(()=>If.id).notNull(),destinationSessionId:tt("destination_session_id").references(()=>Jl.id).notNull(),destinationWeekNumber:tt("destination_week_number").notNull(),destinationCoverageKey:it("destination_coverage_key",{length:255}).notNull(),destinationCoverage:Zu("destination_coverage").notNull(),paymentId:tt("payment_id").references(()=>dc.id),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[lm("carry_forward_credit_application_exact_unique").on(s.creditId,s.idempotencyKey,s.destinationCoverageKey),Gn("carry_forward_credit_applications_credit_status_idx").on(s.creditId,s.status),Gn("carry_forward_credit_applications_attempt_idx").on(s.familyId,s.idempotencyKey)]),yX=Qt("sms_verification_requests",{id:as("id").primaryKey(),sessionBillingId:tt("session_billing_id").notNull().references(()=>fg.id),studentId:tt("student_id").notNull().references(()=>sa.id),familyId:tt("family_id").notNull().references(()=>dr.id),sessionDate:yr("session_date").notNull(),adminPhone:it("admin_phone",{length:20}).notNull(),referenceCode:it("reference_code",{length:10}).notNull().unique(),status:it("status",{length:20}).notNull().default("pending"),sentAt:Re("sent_at").defaultNow(),respondedAt:Re("responded_at"),response:it("response",{length:10}),expiresAt:Re("expires_at").notNull(),createdAt:Re("created_at").defaultNow()}),W_=Qt("admin_availability",{id:as("id").primaryKey(),title:it("title",{length:100}).notNull(),dayOfWeek:tt("day_of_week").notNull(),startTime:it("start_time",{length:8}).notNull(),endTime:it("end_time",{length:8}).notNull(),timeZone:it("time_zone",{length:50}).notNull().default("America/New_York"),sessionDuration:tt("session_duration").notNull().default(60),bufferTime:tt("buffer_time").notNull().default(0),maxConcurrentSessions:tt("max_concurrent_sessions").notNull().default(1),isActive:qt("is_active").notNull().default(!0),isRecurring:qt("is_recurring").notNull().default(!0),effectiveStartDate:yr("effective_start_date").notNull(),effectiveEndDate:yr("effective_end_date"),excludedDates:yr("excluded_dates").array(),sessionType:it("session_type",{length:50}).notNull().default("1:1"),notes:de("notes"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),pg=Qt("group_chats",{id:as("id").primaryKey(),name:de("name").notNull(),description:de("description"),category:de("category").notNull(),isActive:qt("is_active").default(!0).notNull(),createdBy:de("created_by").notNull(),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()}),B_=Qt("group_chat_members",{id:as("id").primaryKey(),groupId:tt("group_id").references(()=>pg.id).notNull(),familyId:tt("family_id").references(()=>dr.id).notNull(),joinedAt:Re("joined_at").defaultNow().notNull(),isActive:qt("is_active").default(!0).notNull()}),K_=Qt("group_chat_messages",{id:as("id").primaryKey(),groupId:tt("group_id").references(()=>pg.id).notNull(),senderType:de("sender_type").notNull(),senderId:de("sender_id").notNull(),senderName:de("sender_name").notNull(),content:de("content").notNull(),messageType:de("message_type").default("text").notNull(),mediaUrls:de("media_urls").array(),sentAt:Re("sent_at").defaultNow().notNull(),isDeleted:qt("is_deleted").default(!1).notNull()}),H_=Qt("weekly_passwords",{id:as("id").primaryKey(),weekStartDate:yr("week_start_date").notNull().unique(),password:de("password").notNull(),theme:de("theme"),createdBy:de("created_by").notNull(),createdAt:
804Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),G_=Qt("week_calendar",{id:as("id").primaryKey(),sessionId:tt("session_id").references(()=>Jl.id).notNull(),weekNumber:tt("week_number").notNull(),weekStart:yr("week_start").notNull(),weekEnd:yr("week_end").notNull(),isBreakWeek:qt("is_break_week").default(!1),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),vX=Es(G_).omit({id:!0,createdAt:!0,updatedAt:!0}),Z_=Qt("contract_renewals",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),contractYear:tt("contract_year").notNull().default(2025),contractVersion:de("contract_version").default("2025"),signedDate:Re("signed_date"),signatureData:Zu("signature_data"),photoReleaseConsent:qt("photo_release_consent").default(!1),photoReleaseSignature:de("photo_release_signature"),photoReleaseSignedAt:Re("photo_release_signed_at"),ipAddress:de("ip_address"),userAgent:de("user_agent"),contractContent:de("contract_content"),status:de("status").default("pending"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),jX=Qt("state_funding_selections",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),stateCode:de("state_code").notNull(),programName:de("program_name").notNull(),programStatus:de("program_status").notNull(),selected:qt("selected").notNull().default(!0),caregiverNotes:de("caregiver_notes"),status:de("status").notNull().default("pending"),approvedServiceTypes:de("approved_service_types").array().default([]),submittedAt:Re("submitted_at").defaultNow().notNull(),decidedAt:Re("decided_at"),decidedBy:de("decided_by"),optedOutAt:Re("opted_out_at"),notificationSentAt:Re("notification_sent_at"),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[lm("state_funding_student_program_unique").on(s.studentId,s.programName),Gn("state_funding_family_idx").on(s.familyId),Gn("state_funding_status_idx").on(s.status)]),bX=Qt("state_funding_prompt_acknowledgments",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),stateCode:de("state_code").notNull(),programName:de("program_name").notNull(),acknowledgedAt:Re("acknowledged_at").defaultNow().notNull(),createdAt:Re("created_at").defaultNow().notNull(),updatedAt:Re("updated_at").defaultNow().notNull()},s=>[lm("state_funding_prompt_student_state_program_unique").on(s.studentId,s.stateCode,s.programName),Gn("state_funding_prompt_family_idx").on(s.familyId)]),NX=Es(Z_).omit({id:!0,createdAt:!0,updatedAt:!0}),wX=Qt("contact_change_requests",{id:as("id").primaryKey(),familyId:tt("family_id").references(()=>dr.id).notNull(),contractYear:tt("contract_year").notNull(),requestType:de("request_type").notNull(),caregiverSlot:tt("caregiver_slot"),oldValue:Zu("old_value"),newValue:Zu("new_value"),approvalCode:de("approval_code"),status:de("status").notNull().default("pending"),decidedBy:de("decided_by"),decidedAt:Re("decided_at"),createdAt:Re("created_at").defaultNow()}),AX=te.object({email:te.string().email("Valid email is required"),caregiverOneName:te.string().min(1,"Primary caregiver name is required"),address:te.string().optional().default(""),timeZone:te.string().optional().default(""),caregiverOneEmail:te.string().optional().default(""),caregiverOnePhone:te.string().optional().default(""),caregiverTwoName:te.string().optional().default(""),caregiverTwoEmail:te.string().optional().default(""),caregiverTwoPhone:te.string().optional().default(""),caregiverThreeName:te.string().optional().default(""),caregiverThreeEmail:te.string().optional().default(""),caregiverThreePhone:te.string().optional().default(""),paymentPreference:te.enum(["weekly","monthly","trimester"]).optional(),paymentMethod:te.enum(["family","third-party","scholarship"]).optional(),scholarshipInfo:te.string().optional().default(""),scholarshipPercentage:te.number().min(0).max(100).optional().default(0),thirdPartyPayerName:te.string().optional().default(""),thirdPartyContact:te.string().optional().default("")}),CX=te.object({name:te.string().min(1,"Student name is required"),familyId:te.number(),nicknames:te.string().optional().default(""),birthday:te.string().optional().default(""),age:te.number().optional().default(4),gradeEquivalent:te.string().optional().default(""),streetAddress:te.string().optional().default(""),city:te.string().optional().default(""),state:te.string().optional().default(""),country:te.string().optional().default(""),postalCode:te.string().optional().default(""),diagnosis:te.string().optional().default(""),currentAacSystems:te.array(te.string()).optional().default([]),accommodations:te.array(te.string()).optional().default([]),studentCategories:te.array(te.string()).optional().default([]),openEnrollmentClasses:te.number().min(0).max(4).optional().default(1),contractSigned:te.boolean().optional().default(!1),contractSignedBy:te.string().optional().default(""),photoPermissionSigned:te.boolean().optional().default(!1),emergencyContact:te.string().optional().default(""),emergencyPhone:te.string().optional().default(""),medicalInfo:te.string().optional().default(""),otherInfo:te.string().optional().default(""),specialInterests:te.string().optional().default(""),calmingStrategies:te.string().optional().default(""),upsetTriggers:te.string().optional().default(""),alphabetAccess:te.string().optional().default(""),yesNoMethod:te.string().optional().default(""),aacProficiency:te.string().optional().default(""),readingSkills:te.string().optional().default(""),mathSkills:te.string().optional().default(""),notes:te.string().optional().default(""),archived:te.boolean().optional().default(!1)}),SX=Es(dc).omit({id:!0,createdAt:!0}),kX=Es(D_).omit({id:!0,sentDate:!0,deliveryStatus:!0}),$X=Es(Vj).omit({id:!0,status:!0,sentDate:!0,createdDate:!0,recipientCount:!0,openRate:!0}),PX=Es(pg).omit({id:!0,createdAt:!0,updatedAt:!0}),EX=Es(B_).omit({id:!0,joinedAt:!0}),TX=Es(K_).omit({id:!0,sentAt:!0}),_X=Es(O_).omit({id:!0,uploaded_date:!0,uploadDate:!0}),IX=te.object({name:te.string().optional(),type:te.enum(["file","link"]).optional(),url:te.string().optional(),description:te.string().optional(),uploadedBy:te.string().optional(),accessLevel:te.string().optional(),tags:te.array(te.string()).optional(),uploaded_by:te.string().optional(),access_level:te.string().optional(),access_levels:te.array(te.string()).optional(),accessLevels:te.array(te.string()).optional()}),DX=Es(Jl).omit({id:!0,createdAt:!0}),OX=Es(Uj).omit({id:!0}),FX=Es(If).omit({id:!0,enrollmentDate:!0}),RX=Es(F_).omit({id:!0,subscribeDate:!0,createdAt:!0,updatedAt:!0}),MX=Es(R_).omit({id:!0,createdAt:!0,updatedAt:!0}),LX=Es(M_).omit({id:!0,createdAt:!0}),VX=Es(L_).omit({id:!0}),UX=Es(V_).omit({id:!0,updatedAt:!0}),zX=Es(Df).omit({id:!0,createdAt:!0,updatedAt:!0}),qX=Es(U_).omit({id:!0,createdAt:!0,updatedAt:!0}),WX=Es(fg).omit({id:!0,createdAt:!0,updatedAt:!0}),BX=Es(z_).omit({id:!0,createdAt:!0}),KX=Es(zj).omit({id:!0,createdAt:!0}),HX=Es(q_).omit({id:!0,createdAt:!0,updatedAt:!0}),GX=Es(W_).omit({id:!0,createdAt:!0,updatedAt:!0}),ZX=Es(H_).omit({id:!0,createdAt:!0,updatedAt:!0}),YX=Es(P_).omit({id:!0,createdAt:!0,updatedAt:!0,lastLogin:!0}),Y_=te.object({email:te.string().email(),password:te.string().min(6)}),Q_=te.object({email:te.string().email(),password:te.string().min(6),firstName:te.string().min(1,"First name is required"),lastName:te.string().min(1,"Last name is required"),
804caregiverConfirmed:te.boolean().refine(s=>s===!0,{message:"You must confirm that you are a caregiver seeking AAC education services"}),referralSource:te.string().optional()});te.string().refine(s=>{if(!s||s.trim()==="")return!0;if(s.includes("@"))return te.string().email().safeParse(s).success;const t=/^\+1[0-9]{10}$/,n=/^\+[1-9][0-9]{1,14}$/;return t.test(s)||n.test(s)},{message:"Phone number must be in format +1XXXXXXXXXX (e.g., +15551234567) or provide an email address"});const X_=te.object({caregiverOneName:te.string().min(1,"Primary caregiver name is required"),caregiverOneEmail:te.string().email("Valid email required"),caregiverOnePhone:Pv.refine(s=>s!=="",{message:"Primary caregiver contact (phone or email) is required"}),caregiverTwoName:te.string().optional(),caregiverTwoEmail:te.string().email().optional().or(te.literal("")),caregiverTwoPhone:Pv.optional(),caregiverThreeName:te.string().optional(),caregiverThreeEmail:te.string().email().optional().or(te.literal("")),caregiverThreePhone:Pv.optional(),address:te.string().min(1,"Address is required"),timeZone:te.string().min(1,"Timezone is required"),studentName:te.string().min(1,"Student name is required"),studentNicknames:te.string().optional(),studentBirthday:te.string().min(1,"Birthday is required"),studentAge:te.number().min(4,"Student must be at least 4 years old"),studentGrade:te.string().optional(),studentAddress:te.string().optional(),studentCity:te.string().optional(),studentState:te.string().optional(),studentCountry:te.string().optional(),studentPostalCode:te.string().optional(),diagnosis:te.string().min(1,"Diagnosis is required"),currentAacSystems:te.array(te.string()).min(1,"At least one AAC system is required"),accommodations:te.array(te.string()).optional(),studentCategories:te.array(te.string()).min(1,"At least one program must be selected"),specialInterests:te.string().optional(),calmingStrategies:te.string().optional(),upsetTriggers:te.string().optional(),alphabetAccess:te.string().optional(),yesNoMethod:te.string().optional(),aacProficiency:te.string().optional(),readingSkills:te.string().optional(),mathSkills:te.string().optional(),contractSigned:te.boolean().optional(),photoPermissionSigned:te.boolean().default(!1)}).refine(s=>s.studentCategories.includes("Ahern Academy")?!!(s.specialInterests&&s.calmingStrategies&&s.upsetTriggers&&s.alphabetAccess&&s.yesNoMethod&&s.aacProficiency&&s.readingSkills&&s.mathSkills&&s.contractSigned):!0,{message:"All Ahern Academy fields are required when enrolling in Ahern Academy",path:["studentCategories"]}),J_=te.object({email:te.string().email("Please enter a valid email address")}),eI=te.object({token:te.string().min(1,"Reset token is required"),password:te.string().min(8,"Password must be at least 8 characters"),confirmPassword:te.string().min(1,"Please confirm your password")}).refine(s=>s.password===s.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),QX=Es(I_).omit({id:!0,submittedAt:!0,adminNotifiedAt:!0,followUpReminderSentAt:!0,reviewedAt:!0}),tI=Qt("zoom_tokens",{id:as("id").primaryKey(),userId:it("user_id",{length:100}).notNull().default("admin"),accountEmail:it("account_email",{length:255}),accessToken:de("access_token").notNull(),refreshToken:de("refresh_token").notNull(),tokenType:it("token_type",{length:50}).notNull().default("Bearer"),expiresAt:Re("expires_at").notNull(),scope:de("scope"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),XX=Es(tI).omit({id:!0,createdAt:!0,updatedAt:!0}),sI=Qt("cooking_recipes",{id:as("id").primaryKey(),weekNumber:tt("week_number").notNull().unique(),recipeName:de("recipe_name"),supplyList:de("supply_list"),description:de("description"),sendReminder:qt("send_reminder").default(!0),reason:it("reason"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),JX=Es(sI).omit({id:!0,createdAt:!0,updatedAt:!0}),nI=Qt("cooking_system_settings",{id:as("id").primaryKey(),settingKey:it("setting_key").notNull().unique(),settingValue:de("setting_value").notNull(),description:de("description"),updatedAt:Re("updated_at").defaultNow()}),eJ=Es(nI).omit({id:!0,updatedAt:!0}),rI=Qt("science_experiments",{id:as("id").primaryKey(),weekNumber:tt("week_number").notNull().unique(),experimentName:de("experiment_name"),supplyList:de("supply_list"),description:de("description"),sendReminder:qt("send_reminder").default(!0),reason:it("reason"),createdAt:
804Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),tJ=Es(rI).omit({id:!0,createdAt:!0,updatedAt:!0}),aI=Qt("science_system_settings",{id:as("id").primaryKey(),settingKey:it("setting_key").notNull().unique(),settingValue:de("setting_value").notNull(),description:de("description"),updatedAt:Re("updated_at").defaultNow()}),sJ=Es(aI).omit({id:!0,updatedAt:!0}),iI=Qt("manual_class_attendance",{id:as("id").primaryKey(),meetingUuid:it("meeting_uuid",{length:255}).notNull(),meetingTopic:it("meeting_topic",{length:255}).notNull(),meetingDate:yr("meeting_date").notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),attendanceStatus:it("attendance_status",{length:20}).notNull().default("present"),notes:de("notes"),recordedBy:it("recorded_by",{length:100}).notNull().default("admin"),recordedAt:Re("recorded_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),nJ=Es(iI).omit({id:!0,recordedAt:!0,updatedAt:!0}),qj=Qt("daily_class_sessions",{id:as("id").primaryKey(),sessionDate:yr("session_date").notNull(),classType:it("class_type").notNull(),className:it("class_name").notNull(),startTime:it("start_time").notNull(),endTime:it("end_time").notNull(),instructorNotes:de("instructor_notes"),createdAt:Re("created_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),lI=Qt("class_attendance",{id:as("id").primaryKey(),sessionId:tt("session_id").references(()=>qj.id).notNull(),studentId:tt("student_id").references(()=>sa.id).notNull(),attendanceStatus:it("attendance_status").notNull(),notes:de("notes"),recordedBy:it("recorded_by").notNull().default("Admin User"),recordedAt:Re("recorded_at").defaultNow(),updatedAt:Re("updated_at").defaultNow()}),rJ=Es(qj).omit({id:!0,createdAt:!0,updatedAt:!0}),aJ=Es(lI).omit({id:!0,recordedAt:!0,updatedAt:!0}),z3=Object.freeze(Object.defineProperty({__proto__:null,accountCleanupLog:uX,adminAvailability:W_,ahernAcademyApplications:I_,carryForwardCreditApplications:q_,carryForwardCredits:zj,classAttendance:lI,classEnrollments:If,classSessions:Jl,classSlots:Uj,contactChangeRequests:wX,contractRenewals:Z_,cookingRecipes:sI,cookingSystemSettings:nI,dailyClassSessions:qj,families:dr,files:O_,groupChatMembers:B_,groupChatMessages:K_,groupChats:pg,insertAdminAvailabilitySchema:GX,insertAhernAcademyApplicationSchema:QX,insertCarryForwardCreditApplicationSchema:HX,insertCarryForwardCreditSchema:KX,insertClassAttendanceSchema:aJ,insertClassEnrollmentSchema:FX,insertClassSessionSchema:DX,insertClassSlotSchema:OX,insertContractRenewalSchema:NX,insertCookingRecipeSchema:JX,insertCookingSystemSettingSchema:eJ,insertDailyClassSessionSchema:rJ,insertFamilySchema:AX,insertFileSchema:_X,insertGroupChatMemberSchema:EX,insertGroupChatMessageSchema:TX,insertGroupChatSchema:PX,insertManualClassAttendanceSchema:nJ,insertMessageSchema:kX,insertNewsletterConfirmationTokenSchema:LX,insertNewsletterPreferenceEventSchema:VX,insertNewsletterPreferenceSchema:MX,insertNewsletterSchema:$X,insertNewsletterSubscriberSchema:RX,insertPasswordRotationLogSchema:hX,insertPaymentCoverageSchema:BX,insertPaymentSchema:SX,insertReminderAuditLogSchema:fX,insertScienceExperimentSchema:tJ,insertScienceSystemSettingSchema:sJ,insertSessionAppointmentSchema:zX,insertSessionAttendanceSchema:qX,insertSessionBillingSchema:WX,insertSharedRateLimitSchema:UX,insertStudentSchema:CX,insertUserSchema:YX,insertWeekCalendarSchema:vX,insertWeeklyPasswordSchema:ZX,insertZoomPasswordQueueSchema:mX,insertZoomTokenSchema:XX,loginSchema:Y_,manualClassAttendance:iI,messages:D_,newsletterAnalytics:pX,newsletterConfirmationTokens:M_,newsletterPreferenceEvents:L_,newsletterPreferences:R_,newsletterSubscribers:F_,newsletters:Vj,passwordResetRequestSchema:J_,passwordResetSchema:eI,passwordResetTokens:dX,passwordRotationLog:T_,paymentAttempts:gX,paymentCoverage:z_,paymentCoverageClaims:xX,payments:dc,registerSchema:Q_,reminderAuditLog:__,scienceExperiments:rI,scienceSystemSettings:aI,sessionAppointments:Df,sessionAttendance:U_,sessionBilling:fg,sessions:cX,sharedRateLimits:V_,smsVerificationRequests:yX,stateFundingPromptAcknowledgments:bX,stateFundingSelections:jX,students:sa,unifiedRegistrationSchema:X_,updateFileSchema:IX,users:P_,weekCalendar:G_,weeklyPasswords:H_,zoomPasswordQueue:E_,zoomTokens:tI},Symbol.toStringTag,{value:"Module"}));function ch(){const{toast:s}=Is();dn();const[t,n]=p.useState(!1),[r,a]=p.useState(!1),o=Da({resolver:Oa(Y_),defaultValues:{email:"",password:""}}),c=bt({mutationFn:async h=>{console.log("=== MUTATION FUNCTION CALLED ==="),console.log("Data being sent:",h),n(!0);try{console.log("Making API request to /api/auth/login...");const x=await st("POST","/api/auth/login",h);console.log("API response status:",x.status),console.log("API response headers:",x.headers);const m=await x.json();return console.log("API response data:",m),m}catch(x){throw console.error("API request failed:",x),x}},onSuccess:async h=>{localStorage.setItem("aac-auth-user",JSON.stringify(h)),localStorage.setItem("aac-auth-timestamp",Date.now().toString()),s({title:"Login successful",description:"Welcome to AAC Voices Portal!"}),h.role==="family"?window.location.href="/portal":h.role==="admin"?window.location.href="/admin":window.location.href="/"},onError:h=>{console.error("Login error:",h),s({title:"Login failed",description:h.message||"Invalid email or password",variant:"destructive"})},onSettled:()=>{n(!1)}}),u=h=>{console.log("=== CLIENT LOGIN ATTEMPT ==="),console.log("Form data:",h),console.log("About to make API request...");try{c.mutate(h)}catch(x){console.error("Login mutation error:",x)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center py-4 sm:py-12 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-[#77dbf6] to-[#93e3f8]",children:e.jsxs(Ce,{className:"w-full max-w-lg shadow-2xl border-0 bg-white/95 backdrop-blur",children:[e.jsxs(Ve,{className:"space-y-4 text-center",children:[e.jsx(Ue,{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:"Sign in to AAC Voices Portal"}),e.jsx(rn,{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Enter your email and password to access your account"}),e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/images/loginlogo.png",alt:"AAC Voices Portal Sign In Logo",className:"h-24 w-auto object-contain"})})]}),e.jsxs(Se,{children:[e.jsx(Fa,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(u),className:"space-y-4",children:[e.jsx(Ke,{control:o.control,name:"email",render:({field:h})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"Email"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Enter your email address",type:"email",...h,disabled:t,className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A] placeholder-[#4A4A4A]/60"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:o.control,name:"password",render:({field:h})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"Password"}),e.jsx(He,{children:e.jsxs("div",{className:"relative",children:[e.jsx(je,{type:r?"text":"password",...h,disabled:t,className:"pr-10 border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A]"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>a(!r),children:r?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})}),e.jsx(Ye,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(F,{type:"submit",className:"w-full mr-2 bg-[#77dbf6] hover:bg-[#5DCFF2] text-white font-medium h-11 shadow-lg transition-all",disabled:t,children:t?"Signing in...":"Sign in"})}),e.jsxs("div",{className:"text-center",children:[e.jsx(Wl,{href:"/forgot-password",className:"text-sm text-[#77dbf6] hover:text-[#5DCFF2] underline font-medium",children:"Forgot your password?"}),e.jsx("div",{className:"mt-2 text-xs text-[#4A4A4A]/70",children:"Or contact Kate directly: [email protected] or text (978) 420-4902"})]})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-sm text-[#4A4A4A]",children:["Don't have an account?"," ",e.jsx(Wl,{href:"/register",className:"text-[#77dbf6] hover:text-[#5DCFF2] font-medium",children:"Create one here"})]})})]})]})})}function iJ(){const{toast:s}=Is(),[,t]=hl(),[n,r]=p.useState(!1),a=Da({resolver:Oa(Q_),defaultValues:{email:"",password:"",firstName:"",lastName:"",caregiverConfirmed:!1,referralSource:""}});p.useEffect(()=>{const m=localStorage.getItem("aac-voices-partial-registration");if(m)try{const g=JSON.parse(m);a.reset(g),s({title:"Welcome Back!",description:"Your previously saved information has been restored."})}catch(g){console.error("Error loading saved registration data:",g),localStorage.removeItem("aac-voices-partial-registration")}},[a,s]);const o=()=>{s({title:"Redirecting to Main Website",description:"Taking you to aacvoices.org for general information and resources."}),setTimeout(()=>{window.location.href="https://www.aacvoices.org"},2e3)},c=()=>{t("/")},u=()=>{const m=a.getValues();localStorage.setItem("aac-voices-partial-registration",JSON.stringify(m)),s({title:"Progress Saved",description:"Your information has been saved. You can return to complete registration later."}),t("/")},h=bt({mutationFn:async m=>{if(!m.caregiverConfirmed){o();return}const g=await st("POST","/api/auth/register",m);if(!g.ok){const y=await g.text();throw new Error(y||"Registration failed")}return g.json()},onSuccess:()=>{localStorage.removeItem("aac-voices-partial-registration"),s({title:"Account Created!",description:"Please complete your caregiver and student information."}),t("/register/complete")},onError:m=>{console.error("Registration error:",m),s({title:"Account creation failed",description:m.message||"Failed to create account",variant:"destructive"})},onSettled:()=>{r(!1)}}),x=m=>{r(!0),h.mutate(m)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center py-4 sm:py-12 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-[#77dbf6] to-[#93e3f8]",children:e.jsxs(Ce,{className:"w-full max-w-lg shadow-2xl border-0 bg-white/95 backdrop-blur",children:[e.jsxs(Ve,{className:"space-y-4 text-center",children:[e.jsx(Ue,{className:"text-xl sm:text-2xl font-bold text-[#4A4A4A]",children:"Create AAC Voices Portal Account"}),e.jsx(rn,{className:"text-[#4A4A4A]/80 text-sm sm:text-base",children:"Create an account to access the management portal"}),e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/images/createlogo.png",alt:"AAC Voices Portal Create Account Logo",className:"h-24 w-auto object-contain"})}),e.jsxs("div",{className:"text-center bg-[#feea6a]/20 p-3 rounded-lg border border-[#feea6a]/30",children:[e.jsx("p",{className:"text-sm text-[#4A4A4A] font-medium",children:"â±ï¸ This registration takes about 10-15 minutes to complete"}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70 mt-1",children:"You can save your progress and continue later if needed"})]}),e.jsxs("div",{className:"text-left bg-[#77dbf6]/10 p-4 rounded-lg border border-[#77dbf6]/30",children:[e.jsx("p",{className:"text-sm text-[#4A4A4A] font-semibold mb-2",children:"Immigrant Scholarship Program"}),e.jsxs("p",{className:"text-sm text-[#4A4A4A]",children:["If you are interested in our immigrant scholarship program, please text"," ",e.jsx("a",{href:"tel:978-596-4712",className:"text-[#4A90A4] font-medium hover:underline",children:"978-596-4712"})," ","or email"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-[#4A90A4] font-medium hover:underline",children:"[email protected]"}),"."]}),e.jsx("p",{className:"text-xs text-[#4A4A4A]/70 mt-2",children:"If privacy is a concern, you are welcome to use a throwaway email address, hide your email, or limit identifying information when contacting us."})]})]}),e.jsxs(Se,{children:[e.jsx(Fa,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(x),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"firstName",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"First Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"John",...m,disabled:n,className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A] placeholder-[#4A4A4A]/60"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"lastName",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"Last Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Doe",...m,disabled:n,className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A] placeholder-[#4A4A4A]/60"})}),e.jsx(Ye,{})]})})]}),e.jsx(Ke,{control:a.control,name:"email",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"Email"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Enter your email address",type:"email",...m,disabled:n,className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A] placeholder-[#4A4A4A]/60"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"password",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-[#4A4A4A] font-medium",children:"Password"}),e.jsx(He,{children:e.jsx(je,{type:"password",placeholder:"Minimum 6 characters",...m,disabled:n,className:"border-2 border-[#77dbf6]/30 focus:border-[#77dbf6] bg-[#77dbf6]/5 focus:bg-white transition-all h-11 text-[#4A4A4A] placeholder-[#4A4A4A]/60"})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"referralSource",render:({field:m})=>e.jsxs(We,{children:[e.jsx(ze,{children:"How did you hear about AAC Voices? (Optional)"}),e.jsxs(St,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(He,{children:e.jsx(At,{children:e.jsx(kt,{placeholder:"Select how you found us"})})}),e.jsxs(Ct,{children:[e.jsx(ce,{value:"google",children:"Google Search"}),e.jsx(ce,{value:"facebook",children:"Facebook"}),e.jsx(ce,{value:"instagram",children:"Instagram"}),e.jsx(ce,{value:"friend_referral",children:"Friend/Family Referral"}),e.jsx(ce,{value:"therapist_referral",children:"Therapist/Professional Referral"}),e.jsx(ce,{value:"school_referral",children:"School/Educational Referral"}),e.jsx(ce,{value:"support_group",children:"AAC Support Group"}),e.jsx(ce,{value:"conference",children:"Conference/Event"}),e.jsx(ce,{value:"other",children:"Other"})]})]}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverConfirmed",render:({field:m})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4 bg-blue-50",children:[e.jsx(He,{children:e.jsx(Gs,{checked:m.value,onCheckedChange:m.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ze,{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"I am a caregiver seeking AAC education services for my child or student *"}),e.jsxs("div",{className:"text-xs text-gray-600 space-y-1",children:[e.jsx("p",{children:"This portal is designed specifically for caregivers enrolling students in AAC education programs."}),e.jsx("p",{className:"font-medium text-amber-700",children:"â ï¸ If you're not a caregiver, you must confirm that you are a caregiver seeking AAC education services."}),e.jsxs("p",{children:["Not a caregiver? We'll automatically redirect you to ",e.jsx("span",{className:"font-medium",children:"aacvoices.org"})," for general information and resources."]})]})]}),e.jsx(Ye,{})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{type:"submit",className:"w-full bg-[#77dbf6] hover:bg-[#5DCFF2] text-white font-medium h-11 shadow-lg transition-all",disabled:n,children:n?"Creating account...":"Create account"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{type:"button",variant:"outline",className:"flex-1 border-[#feea6a] text-[#4A4A4A] hover:bg-[#feea6a]/10",onClick:u,disabled:n,children:"Save & Continue Later"}),e.jsx(F,{type:"button",variant:"ghost",className:"flex-1 text-[#4A4A4A] hover:bg-[#4A4A4A]/10",onClick:c,disabled:n,children:"Cancel"})]})
804]})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-sm text-[#4A4A4A]",children:["Already have an account?"," ",e.jsx(Wl,{href:"/login",className:"text-[#77dbf6] hover:text-[#5DCFF2] font-medium",children:"Sign in here"})]})})]})]})})}function Ev(){const[,s]=hl(),{toast:t}=Is(),[n,r]=p.useState(!1),a=Da({resolver:Oa(X_),defaultValues:{caregiverOneName:"",caregiverOneEmail:"",caregiverOnePhone:"",caregiverTwoName:"",caregiverTwoEmail:"",caregiverTwoPhone:"",caregiverThreeName:"",caregiverThreeEmail:"",caregiverThreePhone:"",address:"",timeZone:"America/New_York",studentName:"",studentNicknames:"",studentBirthday:"",studentAge:void 0,studentGrade:"",studentAddress:"",studentCity:"",studentState:"",studentCountry:"United States",studentPostalCode:"",diagnosis:"",currentAacSystems:[],accommodations:[],studentCategories:[],specialInterests:"",calmingStrategies:"",upsetTriggers:"",alphabetAccess:"",yesNoMethod:"",aacProficiency:"",readingSkills:"",mathSkills:"",contractSigned:!1,photoPermissionSigned:!1}}),o=bt({mutationFn:async y=>{const b=await st("POST","/api/auth/unified-register",y);if(!b.ok){const w=await b.text();throw new Error(w||"Registration failed")}return b.json()},onSuccess:()=>{t({title:"Registration Complete!",description:"Welcome to AAC Voices Portal! Your caregiver profile and student have been created."}),s("/portal")},onError:y=>{console.error("Unified registration error:",y),t({title:"Registration failed",description:y.message||"Failed to complete registration",variant:"destructive"})},onSettled:()=>{r(!1)}}),c=y=>{console.log("Form submission triggered with data:",y),r(!0),o.mutate(y)};p.useEffect(()=>{const y=a.formState.errors;Object.keys(y).length>0&&console.log("Form validation errors:",y)},[a.formState.errors]);const h=(a.watch("studentCategories")||[]).includes("Ahern Academy"),x=a.watch("studentBirthday"),m=y=>{if(!y)return 0;let b;if(y.includes("-")){const[E,P,M]=y.split("-").map(Number);b=new Date(E,P-1,M)}else b=new Date(y);if(isNaN(b.getTime()))return 0;const w=new Date;let N=w.getFullYear()-b.getFullYear();const k=w.getMonth()-b.getMonth();return(k<0||k===0&&w.getDate()<b.getDate())&&N--,N};p.useEffect(()=>{if(x){const y=m(x);a.setValue("studentAge",y)}},[x,a]);const g=async()=>{try{await st("POST","/api/auth/logout",{}),t({title:"Logged out",description:"You have been logged out successfully."}),s("/login")}catch(y){console.error("Logout error:",y)}};return e.jsx("div",{className:"min-h-screen py-12 px-4 sm:px-6 lg:px-8",style:{backgroundColor:"#77dbf6"},children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs(Ce,{children:[e.jsx(Ve,{className:"space-y-4",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Ue,{className:"text-2xl font-bold text-center",children:"Complete Your AAC Voices Portal Registration"}),e.jsx(rn,{className:"text-center",children:"Please provide your caregiver information and student details"})]}),e.jsx(F,{type:"button",variant:"ghost",onClick:g,className:"text-sm",children:"Cancel & Log Out"})]})}),e.jsx(Se,{children:e.jsx(Fa,{...a,children:e.jsxs("form",{noValidate:!0,onSubmit:a.handleSubmit(c),className:"space-y-8",children:[a.formState.isSubmitted&&Object.keys(a.formState.errors).length>0&&e.jsxs("div",{role:"alert",className:"rounded-md border border-red-300 bg-red-50 p-4 text-red-800",children:[e.jsx("p",{className:"font-semibold",children:"Please correct these fields to complete registration:"}),e.jsx("ul",{className:"list-disc pl-5",children:Object.entries(a.formState.errors).map(([y,b])=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"text-left underline",onClick:()=>a.setFocus(y),children:[y.replace(/([A-Z])/g," $1").replace(/^./,w=>w.toUpperCase()),": ",String((b==null?void 0:b.message)||"Please check this field")]})},y))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Primary Caregiver Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"caregiverOneName",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Name *"}),e.jsx(He,{children:e.jsx(je,{placeholder:"John Doe",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverOneEmail",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Email *"}),e.jsx(He,{children:e.jsx(je,{type:"email",placeholder:"Caregiver 1 email",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverOnePhone",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Phone *"}),e.jsx(He,{children:e.jsx(je,{placeholder:"(212) 555-0123 or [email protected]",...y,disabled:n})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"U.S./Canada: spaces, parentheses, and dashes are accepted. International: start with + and the country code. An email address is also accepted."}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"address",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Address *"}),e.jsx(He,{children:e.jsx(je,{placeholder:"123 Main St, City, State",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"timeZone",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Time Zone *"}),e.jsx(He,{children:e.jsxs("select",{...y,disabled:n,className:"w-full p-2 border rounded-md",children:[e.jsx("option",{value:"America/Ne
804w_York",children:"Eastern Time (ET)"}),e.jsx("option",{value:"America/Chicago",children:"Central Time (CT)"}),e.jsx("option",{value:"America/Denver",children:"Mountain Time (MT)"}),e.jsx("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),e.jsx("option",{value:"America/Anchorage",children:"Alaska Time (AKT)"}),e.jsx("option",{value:"Pacific/Honolulu",children:"Hawaii Time (HT)"})]})}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-md font-medium",children:"Additional Caregivers (Optional)"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(Ke,{control:a.control,name:"caregiverTwoName",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Second Caregiver Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Jane Doe",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverTwoEmail",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Second Caregiver Email"}),e.jsx(He,{children:e.jsx(je,{type:"email",placeholder:"Caregiver 2 email",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverTwoPhone",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Second Caregiver Phone"}),e.jsx(He,{children:e.jsx(je,{placeholder:"(212) 555-0123 or [email protected]",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverThreeName",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Third Caregiver Name"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Alex Smith",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverThreeEmail",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Third Caregiver Email"}),e.jsx(He,{children:e.jsx(je,{type:"email",placeholder:"Caregiver 3 email",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"caregiverThreePhone",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Third Caregiver Phone"}),e.jsx(He,{children:e.jsx(je,{placeholder:"(212) 555-0123 or [email protected]",...y,disabled:n})}),e.jsx(Ye,{})]})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Student Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"studentName",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Student Name *"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Student's full name",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentBirthday",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Birthday *"}),e.jsx(He,{children:e.jsx(je,{type:"date",...y,disabled:n})}),e.jsx("div",{className:"text-sm text-gray-500",children:"Click the calendar icon to select a date. Age will be calculated automatically."}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentGrade",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Grade Level"}),e.jsx(He,{children:e.jsx(je,{placeholder:"e.g., 5th grade",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentAge",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Age"}),e.jsx(He,{children:e.jsx(je,{type:"number",placeholder:"Student's age",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentNicknames",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Nicknames"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Preferred names or nicknames",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"diagnosis",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Diagnosis *"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Student's diagnosis or disabilities",...y,disabled:n})}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-md font-medium",children:"Student Address (if different from caregiver)"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"studentAddress",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Street Address"}),e.jsx(He,{children:e.jsx(je,{placeholder:"123 Student St",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentCity",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"City"}),e.jsx(He,{children:e.jsx(je,{placeholder:"City",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentState",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"State"}),e.jsx(He,{children:e.jsx(je,{placeholder:"State",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentCountry",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Country"}),e.jsx(He,{children:e.jsx(je,{placeholder:"Country",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"studentPostalCode",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Postal Code"}),e.jsx(He,{children:e.jsx(je,{placeholder:"12345",...y,disabled:n})}),e.jsx(Ye,{})]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-md font-medium",children:"AAC and Communication"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"currentAacSystems",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Current AAC Systems *"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"List AAC devices, apps, or communication methods (separate each with a new line)",value:Array.isArray(y.value)?y.value.join(` 805`):y.value,onChange:b=>{const w=b.target.value.split(` 806`).filter(N=>N.trim()!=="");y.onChange(w)},disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"accommodations",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Accommodations Needed"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"List any accommodations or support needs (separate each with a new line)",value:Array.isArray(y.value)?y.value.join(` 807`):y.value,onChange:b=>{const w=b.target.value.split(` 808`).filter(N=>N.trim()!=="");y.onChange(w)},disabled:n})}),e.jsx(Ye,{})]})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Program Interest"}),e.jsx(Ke,{control:a.control,name:"studentCategories",render:()=>e.jsxs(We,{children:[e.jsx(ze,{children:"Select programs you're interested in: *"}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Ahern Academy","Open Enrollment","1:1 Sessions","Young Adult Chat"].map(y=>e.jsx(Ke,{control:a.control,name:"studentCategories",render:({field:b})=>{var w;return e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:(w=b.value)==null?void 0:w.includes(y),onCheckedChange:N=>{var k;
808return N?b.onChange([...b.value,y]):b.onChange((k=b.value)==null?void 0:k.filter(E=>E!==y))},disabled:n})}),e.jsx(ze,{className:"font-normal",children:y})]})}},y))}),e.jsx(Ye,{})]})})]}),h&&e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-blue-50",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Ahern Academy Additional Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"specialInterests",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Special Interests"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"What does your student enjoy?",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"calmingStrategies",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Calming Strategies"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"What helps your student stay calm?",...y,disabled:n})}),e.jsx(Ye,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Ke,{control:a.control,name:"upsetTriggers",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Upset Triggers"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"What situations upset your student?",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"alphabetAccess",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Alphabet Access"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"How does your student access alphabet letters?",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"yesNoMethod",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Yes/No Communication"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"How does your student communicate yes and no?",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"aacProficiency",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"AAC Proficiency"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Describe your student's AAC skills and experience",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"readingSkills",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Reading Skills"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Describe your student's reading abilities",...y,disabled:n})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:a.control,name:"mathSkills",render:({field:y})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Math Skills"}),e.jsx(He,{children:e.jsx(Pt,{placeholder:"Describe your student's math abilities",...y,disabled:n})}),e.jsx(Ye,{})]})})]})]}),e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-gray-50",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Permissions and Agreements"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ke,{control:a.control,name:"photoPermissionSigned",render:({field:y})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:y.value,onCheckedChange:y.onChange,disabled:n})}),e.jsx(ze,{className:"font-normal",children:"I give permission for my student's photo to be used in AAC Voices promotional materials and communications."})]})}),h&&e.jsx(Ke,{control:a.control,name:"contractSigned",render:({field:y})=>e.jsxs(We,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(He,{children:e.jsx(Gs,{checked:y.value,onCheckedChange:y.onChange,disabled:n})}),e.jsx(ze,{className:"font-normal",children:"I agree to the Ahern Academy contract terms and conditions for full-time homeschool participation."})]})})]})]}),e.jsx("div",{className:"flex justify-center pt-4",children:e.jsx(F,{type:"submit",disabled:n,className:"w-full md:w-auto px-8",children:n?"Creating Registration...":"Complete Registration"})})]})})})]})})})}function vx(){const{toast:s}=Is(),[t,n]=p.useState(!1),r=Da({resolver:Oa(J_),defaultValues:{email:""}}),a=bt({mutationFn:async c=>st("POST","/api/auth/password-reset-request",c),onSuccess:()=>{n(!0),s({title:"Password reset email sent",description:"Check your email for reset instructions."})},onError:c=>{s({title:"Reset request failed",description:(c==null?void 0:c.message)||"Please try again",variant:"destructive"})}}),o=c=>{a.mutate(c)};return t?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{backgroundColor:"#6cdaf2"},children:e.jsxs(Ce,{className:"w-full max-w-lg shadow-2xl border-0",children:[e.jsxs(Ve,{className:"text-center space-y-4 pb-6",children:[e.jsx("img",{src:"/images/forgotpasswordlogo.png",alt:"Reset Password",className:"mx-auto h-16 w-auto"}),e.jsx(Ue,{className:"text-2xl font-bold text-gray-800",children:"Check Your Email"}),e.jsx(rn,{className:"text-gray-600 text-base",children:"We've sent password reset instructions to your email address."})]}),e.jsxs(Se,{className:"space-y-6",children:[e.jsxs("div",{className:"text-sm text-gray-600 text-center bg-blue-50 rounded-lg p-4",children:[e.jsx("p",{className:"mb-3",children:"Didn't receive the email? Check your spam folder or contact Kate at:"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium text-blue-700",children:"[email protected]"}),e.jsx("p",{className:"font-medium text-blue-700",children:"(978) 420-4902"})]})]}),e.jsx(Wl,{href:"/login",children:e.jsxs(F,{className:"w-full bg-white text-blue-600 hover:bg-gray-50 border border-blue-200 py-3 text-base font-medium shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105",children:[e.jsx(Mu,{className:"w-4 h-4 mr-2"}),"Back to Login"]})})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{backgroundColor:"#6cdaf2"},children:e.jsxs(Ce,{className:"w-full max-w-lg shadow-2xl border-0",children:[e.jsxs(Ve,{className:"text-center space-y-4 pb-6",children:[e.jsx("img",{src:"/images/forgotpasswordlogo.png",alt:"Reset Password",className:"mx-auto h-16 w-auto"}),e.jsx(Ue,{className:"text-2xl font-bold text-gray-800",children:"Reset Your Password"}),e.jsx(rn,{className:"text-gray-600 text-base",children:"Enter your email address and we'll send you a link to reset your password."})]}),e.jsx(Se,{className:"space-y-6",children:e.jsx(Fa,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(o),className:"space-y-6",children:[e.jsx(Ke,{control:r.control,name:"email",render:({field:c})=>e.jsxs(We,{children:[e.jsx(ze,{className:"text-gray-700 font-medium",children:"Email Address"}),e.jsx(He,{children:e.jsx(je,{type:"email",placeholder:"Enter your email address",...c,disabled:a.isPending,className:"py-3 text-base border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),e.jsx(Ye,{})]})}),e.jsx(F,{type:"submit",className:"w-full bg-white text-blue-600 hover:bg-gray-50 border border-blue-200 py-3 text-base font-medium shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105",disabled:a.isPending,children:a.isPending?"Sending...":"Send Reset Link"}),e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(Wl,{href:"/login",children:e.jsxs(F,{className:"w-full bg-white text-blue-600 hover:bg-gray-50 border border-blue-200 py-3 text-base font-medium shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105",children:[e.jsx(Mu,{className:"w-4 h-4 mr-2"}),"Back to Login"]})}),e.jsxs("div",{className:"text-sm text-gray-600 bg-blue-50 rounded-lg p-4",children:[e.jsx("p",{className:"mb-2",children:"Need help? Contact Kate directly:"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium text-blue-700",children:"[email protected]"}),e.jsx("p",{className:"font-medium text-blue-700",children:"(978) 420-4902"})]})]})]})]})})})]})})}function Rx(){console.log("ð¨ [CRITICAL DEBUG] ResetPassword component is rendering!");const{toast:s}=Is(),[t,n]=hl(),[r,a]=p.useState(""),[o,c]=p.useState(!1),[u,h]=p.useState(!1),[x,m]=p.useState(!1);p.useEffect(()=>{console.log("ð RESETPASSWORD COMPONENT LOADED"),console.log("ð FRONTEND TOKEN EXTRACTION DEBUG:"),console.log("- Full URL:",window.location.href),console.log("- Pathname:",window.location.pathname),console.log("- Search params:",window.location.search);const N=new URLSearchParams(window.location.search).get("token");console.log("- Raw query token:",N);const k=window.location.pathname.split("/"),E=k[k.length-1];console.log("- Path token:",E);let P=null;N&&N.length>=32?(P=decodeURIComponent(N),console.log("- Using query token (decoded):",P)):E&&E.length>
808=32&&E!=="reset-password"&&(P=E,console.log("- Using path token:",P)),P?(console.log("â
SETTING TOKEN:",P),console.log("- Token length:",P.length),console.log("- Token first 10 chars:",P.substring(0,10)),console.log("- Token last 10 chars:",P.substring(P.length-10)),a(P)):console.error("â NO VALID TOKEN FOUND")},[]);const g=Da({resolver:Oa(eI),defaultValues:{token:"",password:"",confirmPassword:""}});p.useEffect(()=>{r&&g.setValue("token",r)},[r,g]);const y=bt({mutationFn:async w=>{var k,E;console.log("ð FRONTEND REQUEST DEBUG:"),console.log("- Token being sent:",w.token),console.log("- Token length:",(k=w.token)==null?void 0:k.length),console.log("- Password length:",(E=w.password)==null?void 0:E.length),console.log("- Full request data:",JSON.stringify(w,null,2));const N=await st("POST","/api/auth/password-reset",w);return console.log("â
Backend response:",N),N},onSuccess:()=>{c(!0),s({title:"Password reset successful",description:"You can now log in with your new password."})},onError:w=>{console.error("â FRONTEND ERROR:",w),s({title:"Password reset failed",description:(w==null?void 0:w.message)||"Please try again or contact support",variant:"destructive"})}}),b=w=>{y.mutate(w)};return r?o?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-cyan-50 p-4",children:e.jsxs(Ce,{className:"w-full max-w-md",children:[e.jsxs(Ve,{className:"text-center space-y-2",children:[e.jsx("div",{className:"mx-auto w-12 h-12 bg-green-100 rounded-full flex items-center justify-center",children:e.jsx(As,{className:"w-6 h-6 text-green-600"})}),e.jsx(Ue,{className:"text-xl",children:"Password Reset Complete"}),e.jsx(rn,{children:"Your password has been successfully updated."})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsx(F,{onClick:()=>n("/login"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:"Sign In Now"}),e.jsx("div",{className:"text-sm text-gray-600 text-center",children:e.jsx("p",{children:"You can now log in with your new password."})})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-cyan-50 p-4",children:e.jsxs(Ce,{className:"w-full max-w-md",children:[e.jsxs(Ve,{className:"text-center space-y-2",children:[e.jsx("div",{className:"mx-auto w-fit",children:e.jsx("img",{src:"/images/forgotpasswordlogo.png",alt:"Password Reset",className:"w-16 h-16 object-contain"})}),e.jsx(Ue,{className:"text-xl",children:"Set New Password"}),e.jsx(rn,{children:"Enter your new password below. Make sure it's secure and easy for you to remember."})]}),e.jsx(Se,{children:e.jsx(Fa,{...g,children:e.jsxs("form",{onSubmit:g.handleSubmit(b),className:"space-y-4",children:[e.jsx(Ke,{control:g.control,name:"password",render:({field:w})=>e.jsxs(We,{children:[e.jsx(ze,{children:"New Password"}),e.jsx(He,{children:e.jsxs("div",{className:"relative",children:[e.jsx(je,{type:u?"text":"password",placeholder:"Enter new password",...w,disabled:y.isPending,className:"pr-10"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>h(!u),children:u?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})}),e.jsx(Ye,{})]})}),e.jsx(Ke,{control:g.control,name:"confirmPassword",render:({field:w})=>e.jsxs(We,{children:[e.jsx(ze,{children:"Confirm New Password"}),e.jsx(He,{children:e.jsxs("div",{className:"relative",children:[e.jsx(je,{type:x?"text":"password",placeholder:"Confirm new password",...w,disabled:y.isPending,className:"pr-10"}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>m(!x),children:x?e.jsx(nd,{className:"h-4 w-4",style:{color:"#4A4A4A"}}):e.jsx(Ea,{className:"h-4 w-4",style:{color:"#4A4A4A"}})})]})}),e.jsx(Ye,{})]})}),e.jsx(F,{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white",disabled:y.isPending,children:y.isPending?"Updating Password...":"Update Password"}),e.jsxs("div",{className:"text-sm text-gray-600 text-center",children:[e.jsx("p",{children:"Need help? Contact Kate:"}),e.jsxs("div",{className:"space-y-1 mt-1",children:[e.jsx("p",{className:"font-medium",children:"[email protected]"}),e.jsx("p",{className:"font-medium",children:"(978) 420-4902"})]})]})]})})})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-cyan-50 p-4",children:e.jsxs(Ce,{className:"w-full max-w-md",children:[e.jsxs(Ve,{className:"text-center space-y-2",children:[e.jsx("div",{className:"mx-auto w-12 h-12 bg-red-100 rounded-full flex items-center justify-center",children:e.jsx(Qr,{className:"w-6 h-6 text-red-600"})}),e.jsx(Ue,{className:"text-xl",children:"Invalid Reset Link"}
808),e.jsx(rn,{children:"This password reset link is invalid or has expired."})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"text-sm text-gray-600 text-center",children:[e.jsx("p",{children:"Please request a new password reset link or contact Kate for assistance:"}),e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsx("p",{className:"font-medium",children:"[email protected]"}),e.jsx("p",{className:"font-medium",children:"(978) 420-4902"})]})]}),e.jsx(F,{onClick:()=>n("/forgot-password"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:"Request New Reset Link"})]})]})})}function lJ(){return e.jsx(iE,{isAuthenticated:!1})}var oI="AlertDialog",[oJ]=or(oI,[SC]),eo=SC(),cI=s=>{const{__scopeAlertDialog:t,...n}=s,r=eo(t);return e.jsx(zC,{...r,...n,modal:!0})};cI.displayName=oI;var cJ="AlertDialogTrigger",dI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,a=eo(n);return e.jsx(qC,{...a,...r,ref:t})});dI.displayName=cJ;var dJ="AlertDialogPortal",uI=s=>{const{__scopeAlertDialog:t,...n}=s,r=eo(t);return e.jsx(WC,{...r,...n})};uI.displayName=dJ;var uJ="AlertDialogOverlay",mI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,a=eo(n);return e.jsx(z2,{...a,...r,ref:t})});mI.displayName=uJ;var Nu="AlertDialogContent",[mJ,hJ]=oJ(Nu),fJ=M8("AlertDialogContent"),hI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,children:r,...a}=s,o=eo(n),c=p.useRef(null),u=Cs(t,c),h=p.useRef(null);return e.jsx(lV,{contentName:Nu,titleName:fI,docsSlug:"alert-dialog",children:e.jsx(mJ,{scope:n,cancelRef:h,children:e.jsxs(q2,{role:"alertdialog",...o,...a,ref:u,onOpenAutoFocus:ut(a.onOpenAutoFocus,x=>{var m;x.preventDefault(),(m=h.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:[e.jsx(fJ,{children:r}),e.jsx(xJ,{contentRef:c})]})})})});hI.displayName=Nu;var fI="AlertDialogTitle",pI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,a=eo(n);return e.jsx(W2,{...a,...r,ref:t})});pI.displayName=fI;var xI="AlertDialogDescription",gI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,a=eo(n);return e.jsx(B2,{...a,...r,ref:t})});gI.displayName=xI;var pJ="AlertDialogAction",yI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,a=eo(n);return e.jsx(K2,{...a,...r,ref:t})});yI.displayName=pJ;var vI="AlertDialogCancel",jI=p.forwardRef((s,t)=>{const{__scopeAlertDialog:n,...r}=s,{cancelRef:a}=hJ(vI,n),o=eo(n),c=Cs(t,a);return e.jsx(K2,{...o,...r,ref:c})});jI.displayName=vI;var xJ=({contentRef:s})=>{const t=`\`${Nu}\` requires a description for the component to be accessible for screen reader users. 809 810You can add a description to the \`${Nu}\` by passing a \`${xI}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 811 812Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Nu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 813 814For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=s.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,s]),null},gJ=cI,yJ=dI,vJ=uI,bI=mI,NI=hI,wI=yI,AI=jI,CI=pI,SI=gI;const q3=gJ,W3=yJ,jJ=vJ,kI=p.forwardRef(({className:s,...t},n)=>e.jsx(bI,{className:pt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:n}));kI.displayName=bI.displayName;const t2=p.forwardRef(({className:s,...t},n)=>e.jsxs(jJ,{children:[e.jsx(kI,{}),e.jsx(NI,{ref:n,className:pt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
814nded-lg",s),...t})]}));t2.displayName=NI.displayName;const s2=({className:s,...t})=>e.jsx("div",{className:pt("flex flex-col space-y-2 text-center sm:text-left",s),...t});s2.displayName="AlertDialogHeader";const n2=({className:s,...t})=>e.jsx("div",{className:pt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});n2.displayName="AlertDialogFooter";const r2=p.forwardRef(({className:s,...t},n)=>e.jsx(CI,{ref:n,className:pt("text-lg font-semibold",s),...t}));r2.displayName=CI.displayName;const a2=p.forwardRef(({className:s,...t},n)=>e.jsx(SI,{ref:n,className:pt("text-sm text-muted-foreground",s),...t}));a2.displayName=SI.displayName;const i2=p.forwardRef(({className:s,...t},n)=>e.jsx(wI,{ref:n,className:pt(O2(),s),...t}));i2.displayName=wI.displayName;const l2=p.forwardRef(({className:s,...t},n)=>e.jsx(AI,{ref:n,className:pt(O2({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));l2.displayName=AI.displayName;function B3(){const{toast:s}=Is(),t=dn(),[n,r]=p.useState([]),{data:a=[],isLoading:o,refetch:c}=nt({queryKey:["/api/admin/incomplete-registrations"]}),u=bt({mutationFn:async()=>(await st("POST","/api/admin/incomplete-registrations/run-check")).json(),onSuccess:w=>{s({title:"Manual Check Complete",description:`Sent: ${w.sent}, Failed: ${w.failed}, Skipped: ${w.skipped}`}),t.invalidateQueries({queryKey:["/api/admin/incomplete-registrations"]})},onError:w=>{s({title:"Check Failed",description:w.message||"Failed to run manual check",variant:"destructive"})}}),h=bt({mutationFn:w=>st("POST","/api/admin/incomplete-registrations/mark-do-not-email",w),onSuccess:()=>{s({title:"Success",description:"User marked as do-not-email"}),t.invalidateQueries({queryKey:["/api/admin/incomplete-registrations"]}),r([])},onError:w=>{s({title:"Error",description:w.message||"Failed to mark as do-not-email",variant:"destructive"})}}),x=w=>{r(N=>N.includes(w)?N.filter(k=>k!==w):[...N,w])},m=()=>{n.length===a.length?r([]):r(a.map(w=>w.id))},g=w=>{const N=w.lastEngagement||w.createdAt;return Math.floor((Date.now()-new Date(N).getTime())/(1440*60*1e3))},y=w=>w>=3?"destructive":w>=2?"default":"secondary",b=w=>{const N=g(w);return N>=60?"text-red-600":N>=30?"text-orange-600":"text-yellow-600"};return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Incomplete Registrations"}),e.jsx("p",{className:"text-gray-600",children:"Review and manage accounts that haven't completed registration"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(F,{onClick:()=>u.mutate(),disabled:u.isPending,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(Ko,{className:`h-4 w-4 ${u.isPending?"animate-spin":""}`}),"Run Manual Check"]}),e.jsxs(F,{onClick:()=>c(),variant:"outline",children:[e.jsx(Ko,{className:"h-4 w-4"}),"Refresh"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Ve,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(rl,{className:"h-5 w-5 text-orange-500"}),"Review Summary"]}),e.jsx(rn,{children:"Accounts that have received 3+ reminders and been inactive for 30+ days need review"})]}),e.jsx(Se,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:a.length}),e.jsx("div",{className:"text-sm text-gray-600",children:"Total Incomplete"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-600",children:a.filter(w=>w.remindersSent>=3).length}),e.jsx("div",{className:"text-sm text-gray-600",children:"3+ Reminders Sent"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-orange-600",children:a.filter(w=>g(w)>=30).length}),e.jsx("div",{className:"text-sm text-gray-600",children:"30+ Days Inactive"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-700",children:a.filter(w=>w.remindersSent>=3&&g(w)>=30).length}),e.jsx("div",{className:"text-sm text-gray-600",children:"Need Review"})]})]})})]}),n.length>0&&e.jsx(Ce,{className:"bg-blue-50 border-blue-200",children:e.jsx(Se,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(we,{variant:"secondary",children:[n.length," selected"]}),e.jsx("span",{className:"text-sm text-gray-600",children:"Bulk actions available"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q3,{children:[e.jsx(W3,{asChild:!0,children:e.jsxs(F,{variant:"destructive",size:"sm",children:[e.jsx(Wo,{className:"h-4 w-4 mr-1"}),"Archive Selected"]})}),e.jsxs(t2,{children:[e.jsxs(s2,{children:[e.jsx(r2,{children:"Archive Selected Accounts?"}),e.jsxs(a2,{children:["This will mark ",n.length,' accounts as "do-not-email" and they will be archived. This action can be undone if needed.']})]}),e.jsxs(n2,{children:[e.jsx(l2,{children:"Cancel"}),e.jsx(i2,{onClick:()=>
814{n.forEach(w=>{const N=a.find(k=>k.id===w);N&&h.mutate({email:N.email,reason:"admin_bulk_archive"})})},children:"Archive Accounts"})]})]})]}),e.jsx(F,{variant:"outline",size:"sm",onClick:()=>r([]),children:"Clear Selection"})]})]})})}),e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ue,{children:["Incomplete Accounts (",a.length,")"]}),a.length>0&&e.jsx(F,{variant:"outline",size:"sm",onClick:m,children:n.length===a.length?"Deselect All":"Select All"})]})}),e.jsx(Se,{children:o?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Ko,{className:"h-6 w-6 animate-spin text-gray-400"}),e.jsx("span",{className:"ml-2 text-gray-600",children:"Loading incomplete registrations..."})]}):a.length===0?e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(ir,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),e.jsx("p",{className:"text-lg font-medium",children:"No incomplete registrations"}),e.jsx("p",{className:"text-sm",children:"All users have completed their registration or been processed"})]}):e.jsx("div",{className:"space-y-3",children:a.map(w=>{const N=g(w),k=w.remindersSent>=3&&N>=30;return e.jsxs("div",{className:`flex items-center justify-between p-4 border rounded-lg transition-colors ${n.includes(w.id)?"bg-blue-50 border-blue-200":k?"bg-red-50 border-red-200":"bg-white hover:bg-gray-50"}`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("input",{type:"checkbox",checked:n.includes(w.id),onChange:()=>x(w.id),className:"rounded"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"font-medium text-gray-900",children:w.firstName&&w.lastName?`${w.firstName} ${w.lastName}`:w.email}),k&&e.jsx(we,{variant:"destructive",children:"Needs Review"})]}),e.jsx("p",{className:"text-sm text-gray-600",children:w.email}),e.jsxs("div",{className:"flex items-center gap-4 mt-2",children:[e.jsxs(we,{variant:y(w.remindersSent),children:[w.remindersSent," reminders sent"]}),e.jsxs("span",{className:`text-sm flex items-center gap-1 ${b(w)}`,children:[e.jsx(ys,{className:"h-3 w-3"}),N," days inactive"]}),e.jsxs("span",{className:"text-sm text-gray-500",children:["Created ",new Date(w.createdAt).toLocaleDateString()]})]})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(q3,{children:[e.jsx(W3,{asChild:!0,children:e.jsx(F,{variant:"outline",size:"sm",children:e.jsx(Wo,{className:"h-4 w-4"})})}),e.jsxs(t2,{children:[e.jsxs(s2,{children:[e.jsx(r2,{children:"Archive Account?"}),e.jsxs(a2,{children:["This will mark ",w.email,' as "do-not-email" and archive the account. The user will no longer receive reminder emails.']})]}),e.jsxs(n2,{children:[e.jsx(l2,{children:"Cancel"}),e.jsx(i2,{onClick:()=>h.mutate({email:w.email,reason:"admin_manual_archive"}),children:"Archive Account"})]})]})]})})]},w.id)})})})]})]})}function bJ(){const[s,t]=p.useState("17"),[n,r]=p.useState(!1),[a,o]=p.useState(!1),{toast:c}=Is(),u=async()=>{r(!0);try{const x=await st("POST","/api/admin/impersonate-family",{familyId:parseInt(s)});if(x.ok){const m=await x.json();o(!0),c({title:"Impersonation Started",description:`Now viewing as ${m.family.name} (${m.family.email})`}),window.location.href="/family-portal"}else{const m=await x.json();throw new Error(m.message)}}catch(x){c({title:"Impersonation Failed",description:x.message,variant:"destructive"})}finally{r(!1)}},h=async()=>{r(!0);try{const x=await st("POST","/api/admin/stop-impersonation",{});if(x.ok)o(!1),c({title:"Impersonation Ended",description:"Returned to admin view"}),window.location.reload();else{const m=await x.json();throw new Error(m.message)}}catch(x){c({title:"Stop Impersonation Failed",description:x.message,variant:"destructive"})}finally{r(!1)}};return e.jsx("div",{className:"min-h-screen bg-gray-50 p-8",children:e.jsx("div",{className:"max-w-md mx-auto",children:e.jsxs(Ce,{children:[e.jsx(Ve,{children:e.jsx(Ue,{children:"Admin Family Impersonation"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Family ID"}),e.jsx(je,{type:"number",value:s,onChange:x=>t(x.target.value),placeholder:"Enter family ID",disabled:a})]}),e.jsx("div",{className:"space-y-2",children:a?e.jsx(F,{onClick:h,disabled:n,variant:"outline",className:"w-full",children:n?"Stopping...":"Stop Impersonation"}):e.jsx(F,{onClick:u,disabled:!s||n,className:"w-full",children:n?"Starting...":"Start Impersonation"})}),e.jsxs("div",{className:"text-sm text-gray-600",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Family ID 17:"})," Braylynn Blackman ([email protected])"]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Purpose:"})," Debug payment system issues"]})]})]})]})})})}function NJ(){const{isAuthenticated:s,isLoading:t,user:n}=U0();return t?e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{className:"text-lg",children:"Loading..."})}):e.jsx(wJ,{isAuthenticated:s,user:n})}function wJ({isAuthenticated:s,user:t}){return s?(t==null?void 0:t.role)==="both"?e.jsx("div",{className:"min-h-screen bg-aac-neutral-50",children:e.jsxs(sx,{children:[e.jsx(xt,{path:"/forgot-password",component:vx}),e.jsx(xt,{path:"/reset-password/:token?",component:Rx}),e.jsx(xt,{path:"/admin/billing-dashboard",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(BW,{})]})}),e.jsx(xt,{path:"/portal",component:oh}),e.jsx(xt,{path:"/register-student",component:Ev}),e.jsx(xt,{path:"/",component:()=>(window.location.href="/admin",e.jsx("div",{children:"Redirecting to admin dashboard..."}))}),e.jsx(xt,{path:"/admin",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(iv,{})]})}),e.jsx(xt,{path:"/admin/enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(Xw,{})]})}),e.jsx(xt,{path:"/admin/payment-enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(Jw,{})]})}),e.jsx(xt,{path:"/admin/payment-test",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(QB,{})]})}),e.jsx(xt,{path:"/admin/communications",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(e3,{})]})}),e.jsx(xt,{path:"/admin/class-enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx($1,{})]})}),e.jsx(xt,{path:"/admin/resources",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(rw,{})]})}),e.jsx(xt,{path:"/admin/weekly-passwords",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(aw,{})]})}),e.jsx(xt,{path:"/admin/family-portal",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(oh,{})]})}),e.jsx(xt,{path:"/admin/impersonate",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(bJ,{})]})}),e.jsx(xt,{path:"/admin/session-scheduling",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(V1,{})]})}),e.jsx(xt,{path:"/admin/attendance-tracking",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(s3,{})]})}),e.jsx(xt,{path:"/admin/attendance-tracking-old",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(t3,{})]})}),e.jsx(xt,{path:"/admin/program-information",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(yx,{})]})}),e.jsx(xt,{path:"/admin/incomplete-registrations",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(B3,{})]})}),e.jsx(xt,{path:"/admin/students",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(h1,{})]})}),e.jsx(xt,{path:"/admin/contract-tracking",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(xw,{})]})}),e.jsx(xt,{path:"/admin/messages",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(w1,{})]})}),e.jsx(xt,{path:"/admin/newsletters",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(A1,{})]})}),e.jsx(xt,{path:"/admin/newsletter-subscribers",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(S1,{})]})}),e.jsx(xt,{path:"/admin/enrollment-summary",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(iw,{})]})}),e.jsx(xt,{path:"/admin/checkout",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(gw,{})]})}),e.jsx(xt,{path:"/admin/payment-reconciliation",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(yw,{})]})}),e.jsx(xt,{path:"/admin/class-registration",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(vw,{})]})}),e.jsx(xt,{path:"/program-information",component:yx}),e.jsx(xt,{path:"/login",component:ch}),e.jsx(xt,{component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(iv,{})]})})]})}):(t==null?void 0:t.role)==="family"?e.jsx("div",{className:"min-h-screen bg-aac-neutral-50",children:e.jsxs(sx,{children:[e.jsx(xt,{path:"/forgot-password",component:vx}),e.jsx(xt,{path:"/reset-password/:token?",component:Rx}),e.jsx(xt,{path:"/portal",component:oh}),e.jsx(xt,{path:"/register-student",component:Ev}),e.jsx(xt,{path:"/program-information",component:yx}),e.jsx(xt,{path:"/login",component:ch}),e.jsx(xt,{path:"/",component:()=>(window.location.href="/portal",e.jsx("div",{children:"Redirecting to portal..."}))}),e.jsx(xt,{component:()=>(window.location.href="/portal",e.jsx("div",{children:"Redirecting to portal..."}))})]})}):(t==null?void 0:t.role)==="admin"?e.jsx("div",{className:"min-h-screen bg-aac-neutral-50",children:e.jsxs(sx,{children:[e.jsx(xt,{path:"/forgot-password",component:vx}),e.jsx(xt,{path:"/reset-password/:token?",component:Rx}),e.jsx(xt,{path:"/",component:()=>(window.location.href="/admin",e.jsx("div",{children:"Redirecting to admin dashboard..."}))}),e.jsx(xt,{path:"/admin",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(iv,{})]})}),e.jsx(xt,{path:"/admin/students",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(h1,{})]})}),e.jsx(xt,{path:"/admin/contract-tracking",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(xw,{})]})}),e.jsx(xt,{path:"/admin/messages",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(w1,{})]})}),e.jsx(xt,{path:"/admin/newsletters",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(A1,{})]})}),e.jsx(xt,{path:"/admin/newsletter-subscribers",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(S1,{})]})}),e.jsx(xt,{path:"/admin/resources",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(rw,{})]})}),e.jsx(xt,{path:"/admin/weekly-passwords",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(aw,{})]})}),e.jsx(xt,{path:"/admin/incomplete-registrations",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(B3,{})]})}),e.jsx(xt,{path:"/admin/enrollment-summary",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(iw,{})]})}),e.jsx(xt,{path:"/admin/enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(Xw,{})]})}),e.jsx(xt,{path:"/admin/payment-enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(Jw,{})]})}),e.jsx(xt,{path:"/admin/communications",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(e3,{})]})}),e.jsx(xt,{path:"/admin/checkout",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(gw,{})]})}),e.jsx(xt,{path:"/admin/payment-reconciliation",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(yw,{})]})}),e.jsx(xt,{path:"/admin/family-portal",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(oh,{})]})}),e.jsx(xt,{path:"/admin/class-registration",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(vw,{})]})}),e.jsx(xt,{path:"/admin/class-enrollment",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx($1,{})]})}),e.jsx(xt,{path:"/admin/family-portal",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(oh,{})]})}),e.jsx(xt,{path:"/admin/session-scheduling",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(V1,{})]})}),e.jsx(xt,{path:"/admin/attendance-tracking",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(s3,{})]})}),e.jsx(xt,{path:"/admin/attendance-tracking-old",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(t3,{})]})}),e.jsx(xt,{path:"/admin/program-information",component:()=>e.jsxs("div",{className:"min-h-screen bg-aac-neutral-50",children:[e.jsx(Gt,{}),e.jsx(yx,{})]})}),e.jsx(xt,{component:Av})]})}):(window.location.href="/",e.jsx("div",{children:"Redirecting..."})):e.jsxs(sx,{children:[e.jsx(xt,{path:"/login",component:ch}),e.jsx(xt,{path:"/register",component:iJ}),e.jsx(xt,{path:"/register/complete",component:Ev}),e.jsx(xt,{path:"/forgot-password",component:vx}),e.jsx(xt,{path:"/help",component:lJ}),e.jsx(xt,{path:"/portal",component:ch}),e.jsx(xt,{path:"/admin",component:ch}),e.jsx(xt,{path:"/",component:Av}),e.jsx(xt,{component:Av})]})}function AJ(){return window.location.pathname.startsWith("/reset-password/")?e.jsx(sN,{client:Xi,children:e.jsxs(Ml,{children:[e.jsx(gN,{}),e.jsx(Rx,{})]})}):e.jsx(sN,{client:Xi,children:e.jsx(Ml,{children:e.jsxs(WM,{children:[e.jsx(gN,{}),e.jsx(NJ,{})]})})})}window.addEventListener("unhandledrejection",s=>{var t,n,r,a;if((n=(t=s.reason)==null?void 0:t.message)!=null&&n.includes("401")||(a=(r=s.reason)==null?void 0:r.message)!=null&&a.includes("Not authenticated")){s.preventDefault();return}console.warn("Unhandled promise rejection:",s.reason),s.preventDefault()});window.addEventListener("error",s=>{console.warn("Global error:",s.error)});PD.createRoot(document.getElementById("root")).render(e.jsx(AJ,{}));export{DE as $,VJ as A,FJ as B,ml as C,MJ as D,qJ as E,z3 as F,Sv as G,NE as H,g3 as I,x3 as J,cZ as K,v0 as L,pd as M,Q
814h as N,Cv as O,Ch as P,Za as Q,cr as R,bd as S,pn as T,RJ as U,Yo as V,lZ as W,fZ as X,PJ as Y,_J as Z,dZ as _,Dj as a,mZ as a0,TJ as a1,OE as a2,FE as a3,IJ as a4,DJ as a5,OJ as a6,WJ as a7,hn as b,us as c,om as d,Ge as e,pT as f,y3 as g,hT as h,Ps as i,CT as j,XT as k,e_ as l,s_ as m,tT as n,v3 as o,nT as p,r_ as q,EJ as r,j0 as s,hZ as t,oZ as u,zJ as v,LJ as w,UJ as x,Ox as y,p3 as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.