(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))f(g);new MutationObserver(g=>{for(const v of g)if(v.type==="childList")for(const U of v.addedNodes)U.tagName==="LINK"&&U.rel==="modulepreload"&&f(U)}).observe(document,{childList:!0,subtree:!0});function N(g){const v={};return g.integrity&&(v.integrity=g.integrity),g.referrerPolicy&&(v.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?v.credentials="include":g.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function f(g){if(g.ep)return;g.ep=!0;const v=N(g);fetch(g.href,v)}})();function ih(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var Qu={exports:{}},Qi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Km;function tx(){if(Km)return Qi;Km=1;var c=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function N(f,g,v){var U=null;if(v!==void 0&&(U=""+v),g.key!==void 0&&(U=""+g.key),"key"in g){v={};for(var S in g)S!=="key"&&(v[S]=g[S])}else v=g;return g=v.ref,{$$typeof:c,type:f,key:U,ref:g!==void 0?g:null,props:v}}return Qi.Fragment=b,Qi.jsx=N,Qi.jsxs=N,Qi}var Im;function ax(){return Im||(Im=1,Qu.exports=tx()),Qu.exports}var a=ax(),Zu={exports:{}},Qe={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Pm;function sx(){if(Pm)return Qe;Pm=1;var c=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),U=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),J=Symbol.iterator;function X(w){return w===null||typeof w!="object"?null:(w=J&&w[J]||w["@@iterator"],typeof w=="function"?w:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,M={};function m(w,H,F){this.props=w,this.context=H,this.refs=M,this.updater=F||G}m.prototype.isReactComponent={},m.prototype.setState=function(w,H){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,H,"setState")},m.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function j(){}j.prototype=m.prototype;function Y(w,H,F){this.props=w,this.context=H,this.refs=M,this.updater=F||G}var z=Y.prototype=new j;z.constructor=Y,$(z,m.prototype),z.isPureReactComponent=!0;var ce=Array.isArray;function pe(){}var K={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function Ce(w,H,F){var xe=F.ref;return{$$typeof:c,type:w,key:H,ref:xe!==void 0?xe:null,props:F}}function Se(w,H){return Ce(w.type,H,w.props)}function de(w){return typeof w=="object"&&w!==null&&w.$$typeof===c}function R(w){var H={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(F){return H[F]})}var me=/\/+/g;function ye(w,H){return typeof w=="object"&&w!==null&&w.key!=null?R(""+w.key):H.toString(36)}function fe(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(pe,pe):(w.status="pending",w.then(function(H){w.status==="pending"&&(w.status="fulfilled",w.value=H)},function(H){w.status==="pending"&&(w.status="rejected",w.reason=H)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function q(w,H,F,xe,P){var Te=typeof w;(Te==="undefined"||Te==="boolean")&&(w=null);var ze=!1;if(w===null)ze=!0;else switch(Te){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(w.$$typeof){case c:case b:ze=!0;break;case V:return ze=w._init,q(ze(w._payload),H,F,xe,P)}}if(ze)return P=P(w),ze=xe===""?"."+ye(w,0):xe,ce(P)?(F="",ze!=null&&(F=ze.replace(me,"$&/")+"/"),q(P,H,F,"",function(E){return E})):P!=null&&(de(P)&&(P=Se(P,F+(P.key==null||w&&w.key===P.key?"":(""+P.key).replace(me,"$&/")+"/")+ze)),H.push(P)),1;ze=0;var Be=xe===""?".":xe+":";if(ce(w))for(var k=0;k<w.length;k++)xe=w[k],Te=Be+ye(xe,k),ze+=q(xe,H,F,Te,P);else if(k=X(w),typeof k=="function")for(w=k.call(w),k=0;!(xe=w.next()).done;)xe=xe.value,Te=Be+ye(xe,k++),ze+=q(xe,H,F,Te,P);else if(Te==="object"){if(typeof w.then=="function")return q(fe(w),H,F,xe,P);throw H=String(w),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ze}function ie(w,H,F){if(w==null)return w;var xe=[],P=0;return q(w,xe,"","",function(Te){return H.call(F,Te,P++)}),xe}function je(w){if(w._status===-1){var H=w._result;H=H(),H.then(function(F){(w._status===0||w._status===-1)&&(w._status=1,w._result=F)},function(F){(w._status===0||w._status===-1)&&(w._status=2,w._result=F)}),w._status===-1&&(w._status=0,w._result=H)}if(w._status===1)return w._result.default;throw w._result}var Ae=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},_e={map:ie,forEach:function(w,H,F){ie(w,function(){H.apply(this,arguments)},F)},count:function(w){var H=0;return ie(w,function(){H++}),H},toArray:function(w){return ie(w,function(H){return H})||[]},only:function(w){if(!de(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Qe.Activity=O,Qe.Children=_e,Qe.Component=m,Qe.Fragment=N,Qe.Profiler=g,Qe.PureComponent=Y,Qe.StrictMode=f,Qe.Suspense=T,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(w){return K.H.useMemoCache(w)}},Qe.cache=function(w){return function(){return w.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(w,H,F){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var xe=$({},w.props),P=w.key;if(H!=null)for(Te in H.key!==void 0&&(P=""+H.key),H)!ne.call(H,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&H.ref===void 0||(xe[Te]=H[Te]);var Te=arguments.length-2;if(Te===1)xe.children=F;else if(1<Te){for(var ze=Array(Te),Be=0;Be<Te;Be++)ze[Be]=arguments[Be+2];xe.children=ze}return Ce(w.type,P,xe)},Qe.createContext=function(w){return w={$$typeof:U,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:v,_context:w},w},Qe.createElement=function(w,H,F){var xe,P={},Te=null;if(H!=null)for(xe in H.key!==void 0&&(Te=""+H.key),H)ne.call(H,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(P[xe]=H[xe]);var ze=arguments.length-2;if(ze===1)P.children=F;else if(1<ze){for(var Be=Array(ze),k=0;k<ze;k++)Be[k]=arguments[k+2];P.children=Be}if(w&&w.defaultProps)for(xe in ze=w.defaultProps,ze)P[xe]===void 0&&(P[xe]=ze[xe]);return Ce(w,Te,P)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(w){return{$$typeof:S,render:w}},Qe.isValidElement=de,Qe.lazy=function(w){return{$$typeof:V,_payload:{_status:-1,_result:w},_init:je}},Qe.memo=function(w,H){return{$$typeof:_,type:w,compare:H===void 0?null:H}},Qe.startTransition=function(w){var H=K.T,F={};K.T=F;try{var xe=w(),P=K.S;P!==null&&P(F,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(pe,Ae)}catch(Te){Ae(Te)}finally{H!==null&&F.types!==null&&(H.types=F.types),K.T=H}},Qe.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Qe.use=function(w){return K.H.use(w)},Qe.useActionState=function(w,H,F){return K.H.useActionState(w,H,F)},Qe.useCallback=function(w,H){return K.H.useCallback(w,H)},Qe.useContext=function(w){return K.H.useContext(w)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(w,H){return K.H.useDeferredValue(w,H)},Qe.useEffect=function(w,H){return K.H.useEffect(w,H)},Qe.useEffectEvent=function(w){return K.H.useEffectEvent(w)},Qe.useId=function(){return K.H.useId()},Qe.useImperativeHandle=function(w,H,F){return K.H.useImperativeHandle(w,H,F)},Qe.useInsertionEffect=function(w,H){return K.H.useInsertionEffect(w,H)},Qe.useLayoutEffect=function(w,H){return K.H.useLayoutEffect(w,H)},Qe.useMemo=function(w,H){return K.H.useMemo(w,H)},Qe.useOptimistic=function(w,H){return K.H.useOptimistic(w,H)},Qe.useReducer=function(w,H,F){return K.H.useReducer(w,H,F)},Qe.useRef=function(w){return K.H.useRef(w)},Qe.useState=function(w){return K.H.useState(w)},Qe.useSyncExternalStore=function(w,H,F){return K.H.useSyncExternalStore(w,H,F)},Qe.useTransition=function(){return K.H.useTransition()},Qe.version="19.2.0",Qe}var e0;function oh(){return e0||(e0=1,Zu.exports=sx()),Zu.exports}var y=oh();const lx=ih(y);var Xu={exports:{}},Zi={},Fu={exports:{}},Wu={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var t0;function rx(){return t0||(t0=1,(function(c){function b(q,ie){var je=q.length;q.push(ie);e:for(;0<je;){var Ae=je-1>>>1,_e=q[Ae];if(0<g(_e,ie))q[Ae]=ie,q[je]=_e,je=Ae;else break e}}function N(q){return q.length===0?null:q[0]}function f(q){if(q.length===0)return null;var ie=q[0],je=q.pop();if(je!==ie){q[0]=je;e:for(var Ae=0,_e=q.length,w=_e>>>1;Ae<w;){var H=2*(Ae+1)-1,F=q[H],xe=H+1,P=q[xe];if(0>g(F,je))xe<_e&&0>g(P,F)?(q[Ae]=P,q[xe]=je,Ae=xe):(q[Ae]=F,q[H]=je,Ae=H);else if(xe<_e&&0>g(P,je))q[Ae]=P,q[xe]=je,Ae=xe;else break e}}return ie}function g(q,ie){var je=q.sortIndex-ie.sortIndex;return je!==0?je:q.id-ie.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;c.unstable_now=function(){return v.now()}}else{var U=Date,S=U.now();c.unstable_now=function(){return U.now()-S}}var T=[],_=[],V=1,O=null,J=3,X=!1,G=!1,$=!1,M=!1,m=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function z(q){for(var ie=N(_);ie!==null;){if(ie.callback===null)f(_);else if(ie.startTime<=q)f(_),ie.sortIndex=ie.expirationTime,b(T,ie);else break;ie=N(_)}}function ce(q){if($=!1,z(q),!G)if(N(T)!==null)G=!0,pe||(pe=!0,R());else{var ie=N(_);ie!==null&&fe(ce,ie.startTime-q)}}var pe=!1,K=-1,ne=5,Ce=-1;function Se(){return M?!0:!(c.unstable_now()-Ce<ne)}function de(){if(M=!1,pe){var q=c.unstable_now();Ce=q;var ie=!0;try{e:{G=!1,$&&($=!1,j(K),K=-1),X=!0;var je=J;try{t:{for(z(q),O=N(T);O!==null&&!(O.expirationTime>q&&Se());){var Ae=O.callback;if(typeof Ae=="function"){O.callback=null,J=O.priorityLevel;var _e=Ae(O.expirationTime<=q);if(q=c.unstable_now(),typeof _e=="function"){O.callback=_e,z(q),ie=!0;break t}O===N(T)&&f(T),z(q)}else f(T);O=N(T)}if(O!==null)ie=!0;else{var w=N(_);w!==null&&fe(ce,w.startTime-q),ie=!1}}break e}finally{O=null,J=je,X=!1}ie=void 0}}finally{ie?R():pe=!1}}}var R;if(typeof Y=="function")R=function(){Y(de)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ye=me.port2;me.port1.onmessage=de,R=function(){ye.postMessage(null)}}else R=function(){m(de,0)};function fe(q,ie){K=m(function(){q(c.unstable_now())},ie)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(q){q.callback=null},c.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<q?Math.floor(1e3/q):5},c.unstable_getCurrentPriorityLevel=function(){return J},c.unstable_next=function(q){switch(J){case 1:case 2:case 3:var ie=3;break;default:ie=J}var je=J;J=ie;try{return q()}finally{J=je}},c.unstable_requestPaint=function(){M=!0},c.unstable_runWithPriority=function(q,ie){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var je=J;J=q;try{return ie()}finally{J=je}},c.unstable_scheduleCallback=function(q,ie,je){var Ae=c.unstable_now();switch(typeof je=="object"&&je!==null?(je=je.delay,je=typeof je=="number"&&0<je?Ae+je:Ae):je=Ae,q){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=je+_e,q={id:V++,callback:ie,priorityLevel:q,startTime:je,expirationTime:_e,sortIndex:-1},je>Ae?(q.sortIndex=je,b(_,q),N(T)===null&&q===N(_)&&($?(j(K),K=-1):$=!0,fe(ce,je-Ae))):(q.sortIndex=_e,b(T,q),G||X||(G=!0,pe||(pe=!0,R()))),q},c.unstable_shouldYield=Se,c.unstable_wrapCallback=function(q){var ie=J;return function(){var je=J;J=ie;try{return q.apply(this,arguments)}finally{J=je}}}})(Wu)),Wu}var a0;function nx(){return a0||(a0=1,Fu.exports=rx()),Fu.exports}var Ju={exports:{}},xa={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var s0;function ix(){if(s0)return xa;s0=1;var c=oh();function b(T){var _="https://react.dev/errors/"+T;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var V=2;V<arguments.length;V++)_+="&args[]="+encodeURIComponent(arguments[V])}return"Minified React error #"+T+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function N(){}var f={d:{f:N,r:function(){throw Error(b(522))},D:N,C:N,L:N,m:N,X:N,S:N,M:N},p:0,findDOMNode:null},g=Symbol.for("react.portal");function v(T,_,V){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:O==null?null:""+O,children:T,containerInfo:_,implementation:V}}var U=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(T,_){if(T==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return xa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,xa.createPortal=function(T,_){var V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(b(299));return v(T,_,null,V)},xa.flushSync=function(T){var _=U.T,V=f.p;try{if(U.T=null,f.p=2,T)return T()}finally{U.T=_,f.p=V,f.d.f()}},xa.preconnect=function(T,_){typeof T=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,f.d.C(T,_))},xa.prefetchDNS=function(T){typeof T=="string"&&f.d.D(T)},xa.preinit=function(T,_){if(typeof T=="string"&&_&&typeof _.as=="string"){var V=_.as,O=S(V,_.crossOrigin),J=typeof _.integrity=="string"?_.integrity:void 0,X=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;V==="style"?f.d.S(T,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:O,integrity:J,fetchPriority:X}):V==="script"&&f.d.X(T,{crossOrigin:O,integrity:J,fetchPriority:X,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},xa.preinitModule=function(T,_){if(typeof T=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var V=S(_.as,_.crossOrigin);f.d.M(T,{crossOrigin:V,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&f.d.M(T)},xa.preload=function(T,_){if(typeof T=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var V=_.as,O=S(V,_.crossOrigin);f.d.L(T,V,{crossOrigin:O,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},xa.preloadModule=function(T,_){if(typeof T=="string")if(_){var V=S(_.as,_.crossOrigin);f.d.m(T,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:V,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else f.d.m(T)},xa.requestFormReset=function(T){f.d.r(T)},xa.unstable_batchedUpdates=function(T,_){return T(_)},xa.useFormState=function(T,_,V){return U.H.useFormState(T,_,V)},xa.useFormStatus=function(){return U.H.useHostTransitionStatus()},xa.version="19.2.0",xa}var l0;function ox(){if(l0)return Ju.exports;l0=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(b){console.error(b)}}return c(),Ju.exports=ix(),Ju.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var r0;function cx(){if(r0)return Zi;r0=1;var c=nx(),b=oh(),N=ox();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function U(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function T(e){if(v(e)!==e)throw Error(f(188))}function _(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(f(188));return t!==e?null:e}for(var s=e,l=t;;){var n=s.return;if(n===null)break;var i=n.alternate;if(i===null){if(l=n.return,l!==null){s=l;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===s)return T(n),e;if(i===l)return T(n),t;i=i.sibling}throw Error(f(188))}if(s.return!==l.return)s=n,l=i;else{for(var u=!1,p=n.child;p;){if(p===s){u=!0,s=n,l=i;break}if(p===l){u=!0,l=n,s=i;break}p=p.sibling}if(!u){for(p=i.child;p;){if(p===s){u=!0,s=i,l=n;break}if(p===l){u=!0,l=i,s=n;break}p=p.sibling}if(!u)throw Error(f(189))}}if(s.alternate!==l)throw Error(f(190))}if(s.tag!==3)throw Error(f(188));return s.stateNode.current===s?e:t}function V(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=V(e),t!==null)return t;e=e.sibling}return null}var O=Object.assign,J=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),Ce=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case m:return"Profiler";case M:return"StrictMode";case ce:return"Suspense";case pe:return"SuspenseList";case Ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case Y:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var fe=Array.isArray,q=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=N.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je={pending:!1,data:null,method:null,action:null},Ae=[],_e=-1;function w(e){return{current:e}}function H(e){0>_e||(e.current=Ae[_e],Ae[_e]=null,_e--)}function F(e,t){_e++,Ae[_e]=e.current,e.current=t}var xe=w(null),P=w(null),Te=w(null),ze=w(null);function Be(e,t){switch(F(Te,t),F(P,e),F(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vm(t),e=jm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(xe),F(xe,e)}function k(){H(xe),H(P),H(Te)}function E(e){e.memoizedState!==null&&F(ze,e);var t=xe.current,s=jm(t,e.type);t!==s&&(F(P,e),F(xe,s))}function te(e){P.current===e&&(H(xe),H(P)),ze.current===e&&(H(ze),Bi._currentValue=je)}var re,Ne;function Me(e){if(re===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||"",Ne=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+re+e+Ne}var We=!1;function Je(e,t){if(!e||We)return"";We=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ee){var I=ee}Reflect.construct(e,[],ue)}else{try{ue.call()}catch(ee){I=ee}e.call(ue.prototype)}}else{try{throw Error()}catch(ee){I=ee}(ue=e())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ee){if(ee&&I&&typeof ee.stack=="string")return[ee.stack,I.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),u=i[0],p=i[1];if(u&&p){var C=u.split(`
`),Z=p.split(`
`);for(n=l=0;l<C.length&&!C[l].includes("DetermineComponentFrameRoot");)l++;for(;n<Z.length&&!Z[n].includes("DetermineComponentFrameRoot");)n++;if(l===C.length||n===Z.length)for(l=C.length-1,n=Z.length-1;1<=l&&0<=n&&C[l]!==Z[n];)n--;for(;1<=l&&0<=n;l--,n--)if(C[l]!==Z[n]){if(l!==1||n!==1)do if(l--,n--,0>n||C[l]!==Z[n]){var le=`
`+C[l].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=l&&0<=n);break}}}finally{We=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Me(s):""}function at(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me("Lazy");case 13:return e.child!==t&&t!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return Me("Activity");default:return""}}function Bt(e){try{var t="",s=null;do t+=at(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var Gt=Object.prototype.hasOwnProperty,Vt=c.unstable_scheduleCallback,yt=c.unstable_cancelCallback,ea=c.unstable_shouldYield,ke=c.unstable_requestPaint,se=c.unstable_now,we=c.unstable_getCurrentPriorityLevel,Ee=c.unstable_ImmediatePriority,ht=c.unstable_UserBlockingPriority,he=c.unstable_NormalPriority,it=c.unstable_LowPriority,Ve=c.unstable_IdlePriority,Et=c.log,Re=c.unstable_setDisableYieldValue,ta=null,Lt=null;function Ft(e){if(typeof Et=="function"&&Re(e),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(ta,e)}catch{}}var wt=Math.clz32?Math.clz32:Ye,ge=Math.log,et=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(ge(e)/et|0)|0}var Ze=256,zt=262144,Ge=4194304;function W(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ft(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var n=0,i=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var p=l&134217727;return p!==0?(l=p&~i,l!==0?n=W(l):(u&=p,u!==0?n=W(u):s||(s=p&~e,s!==0&&(n=W(s))))):(p=l&~i,p!==0?n=W(p):u!==0?n=W(u):s||(s=l&~e,s!==0&&(n=W(s)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,s=t&-t,i>=s||i===32&&(s&4194048)!==0)?t:n}function ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sr(){var e=Ge;return Ge<<=1,(Ge&62914560)===0&&(Ge=4194304),e}function fa(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Qt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,s,l,n,i){var u=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var p=e.entanglements,C=e.expirationTimes,Z=e.hiddenUpdates;for(s=u&~s;0<s;){var le=31-wt(s),ue=1<<le;p[le]=0,C[le]=-1;var I=Z[le];if(I!==null)for(Z[le]=null,le=0;le<I.length;le++){var ee=I[le];ee!==null&&(ee.lane&=-536870913)}s&=~ue}l!==0&&Ks(e,l,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(u&~t))}function Ks(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-wt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function ut(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-wt(s),n=1<<l;n&t|e[l]&t&&(e[l]|=t),s&=~n}}function Ta(e,t){var s=t&-t;return s=(s&42)!==0?1:Yr(s),(s&(e.suspendedLanes|t))!==0?0:s}function Yr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Zt(){var e=ie.p;return e!==0?e:(e=window.event,e===void 0?32:$m(e.type))}function Oa(e,t){var s=ie.p;try{return ie.p=e,t()}finally{ie.p=s}}var At=Math.random().toString(36).slice(2),Xe="__reactFiber$"+At,Ot="__reactProps$"+At,ma="__reactContainer$"+At,hs="__reactEvents$"+At,ed="__reactListeners$"+At,td="__reactHandles$"+At,jl="__reactResources$"+At,Nl="__reactMarker$"+At;function Cn(e){delete e[Xe],delete e[Ot],delete e[hs],delete e[ed],delete e[td]}function Qa(e){var t=e[Xe];if(t)return t;for(var s=e.parentNode;s;){if(t=s[ma]||s[Xe]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Mm(e);e!==null;){if(s=e[Xe])return s;e=Mm(e)}return t}e=s,s=e.parentNode}return null}function Ia(e){if(e=e[Xe]||e[ma]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function kl(e){var t=e[jl];return t||(t=e[jl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Wt(e){e[Nl]=!0}var no=new Set,Rt={};function fs(e,t){_l(e,t),_l(e+"Capture",t)}function _l(e,t){for(Rt[e]=t,e=0;e<t.length;e++)no.add(t[e])}var io=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tn={},oo={};function ad(e){return Gt.call(oo,e)?!0:Gt.call(Tn,e)?!1:io.test(e)?oo[e]=!0:(Tn[e]=!0,!1)}function zr(e,t,s){if(ad(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Rr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function ms(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function Ea(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function On(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function co(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var n=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(u){s=""+u,i.call(this,u)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(u){s=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function En(e){if(!e._valueTracker){var t=On(e)?"checked":"value";e._valueTracker=co(e,t,""+e[t])}}function uo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=On(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function Ur(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ho=/[\n"\\]/g;function La(e){return e.replace(ho,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Is(e,t,s,l,n,i,u,p){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ea(t)):e.value!==""+Ea(t)&&(e.value=""+Ea(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?Hr(e,u,Ea(t)):s!=null?Hr(e,u,Ea(s)):l!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Ea(p):e.removeAttribute("name")}function lr(e,t,s,l,n,i,u,p){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||s!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){En(e);return}s=s!=null?""+Ea(s):"",t=t!=null?""+Ea(t):s,p||t===e.value||(e.value=t),e.defaultValue=t}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=p?e.checked:!!l,e.defaultChecked=!!l,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),En(e)}function Hr(e,t,s){t==="number"&&Ur(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Pa(e,t,s,l){if(e=e.options,t){t={};for(var n=0;n<s.length;n++)t["$"+s[n]]=!0;for(s=0;s<e.length;s++)n=t.hasOwnProperty("$"+e[s].value),e[s].selected!==n&&(e[s].selected=n),n&&l&&(e[s].defaultSelected=!0)}else{for(s=""+Ea(s),t=null,n=0;n<e.length;n++){if(e[n].value===s){e[n].selected=!0,l&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function es(e,t,s){if(t!=null&&(t=""+Ea(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Ea(s):""}function fo(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(f(92));if(fe(l)){if(1<l.length)throw Error(f(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=Ea(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),En(e)}function Sl(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var sd=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mo(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||sd.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function go(e,t,s){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var n in t)l=t[n],t.hasOwnProperty(n)&&s[n]!==l&&mo(e,n,l)}else for(var i in t)t.hasOwnProperty(i)&&mo(e,i,t[i])}function Ln(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ld=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),rd=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Dl(e){return rd.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function gs(){}var qr=null;function An(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ml=null,Cl=null;function xo(e){var t=Ia(e);if(t&&(e=t.stateNode)){var s=e[Ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Is(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+La(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var n=l[Ot]||null;if(!n)throw Error(f(90));Is(l,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&uo(l)}break e;case"textarea":es(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Pa(e,!!s.multiple,t,!1)}}}var Yn=!1;function po(e,t,s){if(Yn)return e(t,s);Yn=!0;try{var l=e(t);return l}finally{if(Yn=!1,(Ml!==null||Cl!==null)&&(vc(),Ml&&(t=Ml,e=Cl,Cl=Ml=null,xo(t),e)))for(t=0;t<e.length;t++)xo(e[t])}}function rr(e,t){var s=e.stateNode;if(s===null)return null;var l=s[Ot]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(f(231,t,typeof s));return s}var xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zn=!1;if(xs)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){zn=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{zn=!1}var Os=null,Rn=null,Br=null;function yo(){if(Br)return Br;var e,t=Rn,s=t.length,l,n="value"in Os?Os.value:Os.textContent,i=n.length;for(e=0;e<s&&t[e]===n[e];e++);var u=s-e;for(l=1;l<=u&&t[s-l]===n[i-l];l++);return Br=n.slice(e,1<l?1-l:void 0)}function Gr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tl(){return!0}function Vr(){return!1}function ga(e){function t(s,l,n,i,u){this._reactName=s,this._targetInst=n,this.type=l,this.nativeEvent=i,this.target=u,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(s=e[p],this[p]=s?s(i):i[p]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Tl:Vr,this.isPropagationStopped=Vr,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),t}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ir=ga(Es),or=O({},Es,{view:0,detail:0}),nd=ga(or),Un,Hn,Ol,vt=O({},or,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ol&&(Ol&&e.type==="mousemove"?(Un=e.screenX-Ol.screenX,Hn=e.screenY-Ol.screenY):Hn=Un=0,Ol=e),Un)},movementY:function(e){return"movementY"in e?e.movementY:Hn}}),El=ga(vt),cr=O({},vt,{dataTransfer:0}),id=ga(cr),bo=O({},or,{relatedTarget:0}),qn=ga(bo),od=O({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),$r=ga(od),Ls=O({},Es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bn=ga(Ls),cd=O({},Es,{data:0}),ts=ga(cd),dd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gn={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"},ud={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ud[e])?!!t[e]:!1}function Vn(){return hd}var Qr=O({},or,{key:function(e){if(e.key){var t=dd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type==="keypress"?Gr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$n=ga(Qr),fd=O({},vt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vo=ga(fd),md=O({},or,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn}),jo=ga(md),gd=O({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),xd=ga(gd),pd=O({},vt,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yd=ga(pd),bd=O({},Es,{newState:0,oldState:0}),No=ga(bd),vd=[9,13,27,32],As=xs&&"CompositionEvent"in window,dr=null;xs&&"documentMode"in document&&(dr=document.documentMode);var Qn=xs&&"TextEvent"in window&&!dr,wo=xs&&(!As||dr&&8<dr&&11>=dr),Zr=" ",ko=!1;function _o(e,t){switch(e){case"keyup":return vd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function So(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ll=!1;function Do(e,t){switch(e){case"compositionend":return So(t);case"keypress":return t.which!==32?null:(ko=!0,Zr);case"textInput":return e=t.data,e===Zr&&ko?null:e;default:return null}}function jd(e,t){if(Ll)return e==="compositionend"||!As&&_o(e,t)?(e=yo(),Br=Rn=Os=null,Ll=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wo&&t.locale!=="ko"?null:t.data;default:return null}}var Mo={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 kt(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mo[e.type]:t==="textarea"}function Co(e,t,s,l){Ml?Cl?Cl.push(l):Cl=[l]:Ml=l,t=Dc(t,"onChange"),0<t.length&&(s=new ir("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var ur=null,Al=null;function Nd(e){mm(e,0)}function Xr(e){var t=wl(e);if(uo(t))return e}function To(e,t){if(e==="change")return t}var Yl=!1;if(xs){var Zn;if(xs){var Xn="oninput"in document;if(!Xn){var Oo=document.createElement("div");Oo.setAttribute("oninput","return;"),Xn=typeof Oo.oninput=="function"}Zn=Xn}else Zn=!1;Yl=Zn&&(!document.documentMode||9<document.documentMode)}function hr(){ur&&(ur.detachEvent("onpropertychange",fr),Al=ur=null)}function fr(e){if(e.propertyName==="value"&&Xr(Al)){var t=[];Co(t,Al,e,An(e)),po(Nd,t)}}function Fn(e,t,s){e==="focusin"?(hr(),ur=t,Al=s,ur.attachEvent("onpropertychange",fr)):e==="focusout"&&hr()}function wd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xr(Al)}function Eo(e,t){if(e==="click")return Xr(t)}function kd(e,t){if(e==="input"||e==="change")return Xr(t)}function Wn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var na=typeof Object.is=="function"?Object.is:Wn;function Ps(e,t){if(na(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var n=s[l];if(!Gt.call(t,n)||!na(e[n],t[n]))return!1}return!0}function Lo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ao(e,t){var s=Lo(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Lo(s)}}function Yo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ur(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ur(e.document)}return t}function Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _d=xs&&"documentMode"in document&&11>=document.documentMode,zl=null,Kn=null,mr=null,In=!1;function Pn(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;In||zl==null||zl!==Ur(l)||(l=zl,"selectionStart"in l&&Jn(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),mr&&Ps(mr,l)||(mr=l,l=Dc(Kn,"onSelect"),0<l.length&&(t=new ir("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=zl)))}function el(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Rl={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},va={},Ys={};xs&&(Ys=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function zs(e){if(va[e])return va[e];if(!Rl[e])return e;var t=Rl[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Ys)return va[e]=t[s];return e}var Ro=zs("animationend"),ei=zs("animationiteration"),ti=zs("animationstart"),Sd=zs("transitionrun"),Dd=zs("transitionstart"),Uo=zs("transitioncancel"),Ho=zs("transitionend"),qo=new Map,ai="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ai.push("scrollEnd");function Za(e,t){qo.set(e,t),fs(t,[e])}var Fr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Aa=[],Ul=0,si=0;function Wr(){for(var e=Ul,t=si=Ul=0;t<e;){var s=Aa[t];Aa[t++]=null;var l=Aa[t];Aa[t++]=null;var n=Aa[t];Aa[t++]=null;var i=Aa[t];if(Aa[t++]=null,l!==null&&n!==null){var u=l.pending;u===null?n.next=n:(n.next=u.next,u.next=n),l.pending=n}i!==0&&Bo(s,n,i)}}function Jr(e,t,s,l){Aa[Ul++]=e,Aa[Ul++]=t,Aa[Ul++]=s,Aa[Ul++]=l,si|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function li(e,t,s,l){return Jr(e,t,s,l),Kr(e)}function tl(e,t){return Jr(e,null,null,t),Kr(e)}function Bo(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var n=!1,i=e.return;i!==null;)i.childLanes|=s,l=i.alternate,l!==null&&(l.childLanes|=s),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-wt(s),e=i.hiddenUpdates,l=e[n],l===null?e[n]=[t]:l.push(t),t.lane=s|536870912),i):null}function Kr(e){if(50<Ai)throw Ai=0,gu=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ps={};function Md(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ja(e,t,s,l){return new Md(e,t,s,l)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ys(e,t){var s=e.alternate;return s===null?(s=ja(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Go(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ir(e,t,s,l,n,i){var u=0;if(l=e,typeof e=="function")ri(e)&&(u=1);else if(typeof e=="string")u=Vg(e,s,xe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ce:return e=ja(31,s,t,n),e.elementType=Ce,e.lanes=i,e;case $:return al(s.children,n,i,t);case M:u=8,n|=24;break;case m:return e=ja(12,s,t,n|2),e.elementType=m,e.lanes=i,e;case ce:return e=ja(13,s,t,n),e.elementType=ce,e.lanes=i,e;case pe:return e=ja(19,s,t,n),e.elementType=pe,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:u=10;break e;case j:u=9;break e;case z:u=11;break e;case K:u=14;break e;case ne:u=16,l=null;break e}u=29,s=Error(f(130,e===null?"null":typeof e,"")),l=null}return t=ja(u,s,t,n),t.elementType=e,t.type=l,t.lanes=i,t}function al(e,t,s,l){return e=ja(7,e,l,t),e.lanes=s,e}function ni(e,t,s){return e=ja(6,e,null,t),e.lanes=s,e}function ii(e){var t=ja(18,null,null,0);return t.stateNode=e,t}function Pr(e,t,s){return t=ja(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oi=new WeakMap;function ia(e,t){if(typeof e=="object"&&e!==null){var s=oi.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Bt(t)},oi.set(e,t),t)}return{value:e,source:t,stack:Bt(t)}}var Xa=[],bs=0,gr=null,as=0,Na=[],wa=0,Rs=null,ss=1,ls="";function vs(e,t){Xa[bs++]=as,Xa[bs++]=gr,gr=e,as=t}function Vo(e,t,s){Na[wa++]=ss,Na[wa++]=ls,Na[wa++]=Rs,Rs=e;var l=ss;e=ls;var n=32-wt(l)-1;l&=~(1<<n),s+=1;var i=32-wt(t)+n;if(30<i){var u=n-n%5;i=(l&(1<<u)-1).toString(32),l>>=u,n-=u,ss=1<<32-wt(t)+n|s<<n|l,ls=i+e}else ss=1<<i|s<<n|l,ls=e}function ci(e){e.return!==null&&(vs(e,1),Vo(e,1,0))}function di(e){for(;e===gr;)gr=Xa[--bs],Xa[bs]=null,as=Xa[--bs],Xa[bs]=null;for(;e===Rs;)Rs=Na[--wa],Na[wa]=null,ls=Na[--wa],Na[wa]=null,ss=Na[--wa],Na[wa]=null}function $o(e,t){Na[wa++]=ss,Na[wa++]=ls,Na[wa++]=Rs,ss=t.id,ls=t.overflow,Rs=e}var aa=null,Dt=null,st=!1,Us=null,Ya=!1,ui=Error(f(519));function Hs(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xr(ia(t,e)),ui}function Qo(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Xe]=e,t[Ot]=l,s){case"dialog":nt("cancel",t),nt("close",t);break;case"iframe":case"object":case"embed":nt("load",t);break;case"video":case"audio":for(s=0;s<zi.length;s++)nt(zi[s],t);break;case"source":nt("error",t);break;case"img":case"image":case"link":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"input":nt("invalid",t),lr(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",t);break;case"textarea":nt("invalid",t),fo(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||ym(t.textContent,s)?(l.popover!=null&&(nt("beforetoggle",t),nt("toggle",t)),l.onScroll!=null&&nt("scroll",t),l.onScrollEnd!=null&&nt("scrollend",t),l.onClick!=null&&(t.onclick=gs),t=!0):t=!1,t||Hs(e,!0)}function Zo(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:Ya=!1;return;case 27:case 3:Ya=!0;return;default:aa=aa.return}}function Hl(e){if(e!==aa)return!1;if(!st)return Zo(e),st=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Tu(e.type,e.memoizedProps)),s=!s),s&&Dt&&Hs(e),Zo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Dt=Dm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Dt=Dm(e)}else t===27?(t=Dt,Kl(e.type)?(e=Yu,Yu=null,Dt=e):Dt=t):Dt=aa?cs(e.stateNode.nextSibling):null;return!0}function sl(){Dt=aa=null,st=!1}function hi(){var e=Us;return e!==null&&(Ba===null?Ba=e:Ba.push.apply(Ba,e),Us=null),e}function xr(e){Us===null?Us=[e]:Us.push(e)}var fi=w(null),js=null,Ns=null;function qs(e,t,s){F(fi,t._currentValue),t._currentValue=s}function ws(e){e._currentValue=fi.current,H(fi)}function pr(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function ql(e,t,s,l){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var u=n.child;i=i.firstContext;e:for(;i!==null;){var p=i;i=n;for(var C=0;C<t.length;C++)if(p.context===t[C]){i.lanes|=s,p=i.alternate,p!==null&&(p.lanes|=s),pr(i.return,s,e),l||(u=null);break e}i=p.next}}else if(n.tag===18){if(u=n.return,u===null)throw Error(f(341));u.lanes|=s,i=u.alternate,i!==null&&(i.lanes|=s),pr(u,s,e),u=null}else u=n.child;if(u!==null)u.return=n;else for(u=n;u!==null;){if(u===e){u=null;break}if(n=u.sibling,n!==null){n.return=u.return,u=n;break}u=u.return}n=u}}function Bl(e,t,s,l){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var u=n.alternate;if(u===null)throw Error(f(387));if(u=u.memoizedProps,u!==null){var p=n.type;na(n.pendingProps.value,u.value)||(e!==null?e.push(p):e=[p])}}else if(n===ze.current){if(u=n.alternate,u===null)throw Error(f(387));u.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Bi):e=[Bi])}n=n.return}e!==null&&ql(t,e,s,l),t.flags|=262144}function en(e){for(e=e.firstContext;e!==null;){if(!na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ll(e){js=e,Ns=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sa(e){return Xo(js,e)}function tn(e,t){return js===null&&ll(e),Xo(e,t)}function Xo(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ns===null){if(e===null)throw Error(f(308));Ns=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ns=Ns.next=t;return s}var Fo=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Cd=c.unstable_scheduleCallback,Td=c.unstable_NormalPriority,Ht={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mi(){return{controller:new Fo,data:new Map,refCount:0}}function yr(e){e.refCount--,e.refCount===0&&Cd(Td,function(){e.controller.abort()})}var br=null,rs=0,rl=0,Gl=null;function Od(e,t){if(br===null){var s=br=[];rs=0,rl=ju(),Gl={status:"pending",value:void 0,then:function(l){s.push(l)}}}return rs++,t.then(Wo,Wo),t}function Wo(){if(--rs===0&&br!==null){Gl!==null&&(Gl.status="fulfilled");var e=br;br=null,rl=0,Gl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function be(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(n){s.push(n)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var n=0;n<s.length;n++)(0,s[n])(t)},function(n){for(l.status="rejected",l.reason=n,n=0;n<s.length;n++)(0,s[n])(void 0)}),l}var Jo=q.S;q.S=function(e,t){Gf=se(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Od(e,t),Jo!==null&&Jo(e,t)};var nl=w(null);function an(){var e=nl.current;return e!==null?e:Ct.pooledCache}function lt(e,t){t===null?F(nl,nl.current):F(nl,t.pool)}function vr(){var e=an();return e===null?null:{parent:Ht._currentValue,pool:e}}var il=Error(f(460)),jr=Error(f(474)),sn=Error(f(542)),ln={then:function(){}};function Ko(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Io(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(gs,gs),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gi(e),e;default:if(typeof t.status=="string")t.then(gs,gs);else{if(e=Ct,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=l}},function(l){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gi(e),e}throw oa=t,il}}function ol(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(oa=s,il):s}}var oa=null;function Po(){if(oa===null)throw Error(f(459));var e=oa;return oa=null,e}function gi(e){if(e===il||e===sn)throw Error(f(483))}var Vl=null,Nr=0;function wr(e){var t=Nr;return Nr+=1,Vl===null&&(Vl=[]),Io(Vl,e,t)}function kr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _r(e,t){throw t.$$typeof===J?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rn(e){function t(B,A){if(e){var Q=B.deletions;Q===null?(B.deletions=[A],B.flags|=16):Q.push(A)}}function s(B,A){if(!e)return null;for(;A!==null;)t(B,A),A=A.sibling;return null}function l(B){for(var A=new Map;B!==null;)B.key!==null?A.set(B.key,B):A.set(B.index,B),B=B.sibling;return A}function n(B,A){return B=ys(B,A),B.index=0,B.sibling=null,B}function i(B,A,Q){return B.index=Q,e?(Q=B.alternate,Q!==null?(Q=Q.index,Q<A?(B.flags|=67108866,A):Q):(B.flags|=67108866,A)):(B.flags|=1048576,A)}function u(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function p(B,A,Q,oe){return A===null||A.tag!==6?(A=ni(Q,B.mode,oe),A.return=B,A):(A=n(A,Q),A.return=B,A)}function C(B,A,Q,oe){var Ue=Q.type;return Ue===$?le(B,A,Q.props.children,oe,Q.key):A!==null&&(A.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&ol(Ue)===A.type)?(A=n(A,Q.props),kr(A,Q),A.return=B,A):(A=Ir(Q.type,Q.key,Q.props,null,B.mode,oe),kr(A,Q),A.return=B,A)}function Z(B,A,Q,oe){return A===null||A.tag!==4||A.stateNode.containerInfo!==Q.containerInfo||A.stateNode.implementation!==Q.implementation?(A=Pr(Q,B.mode,oe),A.return=B,A):(A=n(A,Q.children||[]),A.return=B,A)}function le(B,A,Q,oe,Ue){return A===null||A.tag!==7?(A=al(Q,B.mode,oe,Ue),A.return=B,A):(A=n(A,Q),A.return=B,A)}function ue(B,A,Q){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=ni(""+A,B.mode,Q),A.return=B,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case X:return Q=Ir(A.type,A.key,A.props,null,B.mode,Q),kr(Q,A),Q.return=B,Q;case G:return A=Pr(A,B.mode,Q),A.return=B,A;case ne:return A=ol(A),ue(B,A,Q)}if(fe(A)||R(A))return A=al(A,B.mode,Q,null),A.return=B,A;if(typeof A.then=="function")return ue(B,wr(A),Q);if(A.$$typeof===Y)return ue(B,tn(B,A),Q);_r(B,A)}return null}function I(B,A,Q,oe){var Ue=A!==null?A.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:p(B,A,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case X:return Q.key===Ue?C(B,A,Q,oe):null;case G:return Q.key===Ue?Z(B,A,Q,oe):null;case ne:return Q=ol(Q),I(B,A,Q,oe)}if(fe(Q)||R(Q))return Ue!==null?null:le(B,A,Q,oe,null);if(typeof Q.then=="function")return I(B,A,wr(Q),oe);if(Q.$$typeof===Y)return I(B,A,tn(B,Q),oe);_r(B,Q)}return null}function ee(B,A,Q,oe,Ue){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return B=B.get(Q)||null,p(A,B,""+oe,Ue);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case X:return B=B.get(oe.key===null?Q:oe.key)||null,C(A,B,oe,Ue);case G:return B=B.get(oe.key===null?Q:oe.key)||null,Z(A,B,oe,Ue);case ne:return oe=ol(oe),ee(B,A,Q,oe,Ue)}if(fe(oe)||R(oe))return B=B.get(Q)||null,le(A,B,oe,Ue,null);if(typeof oe.then=="function")return ee(B,A,Q,wr(oe),Ue);if(oe.$$typeof===Y)return ee(B,A,Q,tn(A,oe),Ue);_r(A,oe)}return null}function Oe(B,A,Q,oe){for(var Ue=null,gt=null,Le=A,Pe=A=0,ct=null;Le!==null&&Pe<Q.length;Pe++){Le.index>Pe?(ct=Le,Le=null):ct=Le.sibling;var xt=I(B,Le,Q[Pe],oe);if(xt===null){Le===null&&(Le=ct);break}e&&Le&&xt.alternate===null&&t(B,Le),A=i(xt,A,Pe),gt===null?Ue=xt:gt.sibling=xt,gt=xt,Le=ct}if(Pe===Q.length)return s(B,Le),st&&vs(B,Pe),Ue;if(Le===null){for(;Pe<Q.length;Pe++)Le=ue(B,Q[Pe],oe),Le!==null&&(A=i(Le,A,Pe),gt===null?Ue=Le:gt.sibling=Le,gt=Le);return st&&vs(B,Pe),Ue}for(Le=l(Le);Pe<Q.length;Pe++)ct=ee(Le,B,Pe,Q[Pe],oe),ct!==null&&(e&&ct.alternate!==null&&Le.delete(ct.key===null?Pe:ct.key),A=i(ct,A,Pe),gt===null?Ue=ct:gt.sibling=ct,gt=ct);return e&&Le.forEach(function(ar){return t(B,ar)}),st&&vs(B,Pe),Ue}function He(B,A,Q,oe){if(Q==null)throw Error(f(151));for(var Ue=null,gt=null,Le=A,Pe=A=0,ct=null,xt=Q.next();Le!==null&&!xt.done;Pe++,xt=Q.next()){Le.index>Pe?(ct=Le,Le=null):ct=Le.sibling;var ar=I(B,Le,xt.value,oe);if(ar===null){Le===null&&(Le=ct);break}e&&Le&&ar.alternate===null&&t(B,Le),A=i(ar,A,Pe),gt===null?Ue=ar:gt.sibling=ar,gt=ar,Le=ct}if(xt.done)return s(B,Le),st&&vs(B,Pe),Ue;if(Le===null){for(;!xt.done;Pe++,xt=Q.next())xt=ue(B,xt.value,oe),xt!==null&&(A=i(xt,A,Pe),gt===null?Ue=xt:gt.sibling=xt,gt=xt);return st&&vs(B,Pe),Ue}for(Le=l(Le);!xt.done;Pe++,xt=Q.next())xt=ee(Le,B,Pe,xt.value,oe),xt!==null&&(e&&xt.alternate!==null&&Le.delete(xt.key===null?Pe:xt.key),A=i(xt,A,Pe),gt===null?Ue=xt:gt.sibling=xt,gt=xt);return e&&Le.forEach(function(ex){return t(B,ex)}),st&&vs(B,Pe),Ue}function St(B,A,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===$&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case X:e:{for(var Ue=Q.key;A!==null;){if(A.key===Ue){if(Ue=Q.type,Ue===$){if(A.tag===7){s(B,A.sibling),oe=n(A,Q.props.children),oe.return=B,B=oe;break e}}else if(A.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&ol(Ue)===A.type){s(B,A.sibling),oe=n(A,Q.props),kr(oe,Q),oe.return=B,B=oe;break e}s(B,A);break}else t(B,A);A=A.sibling}Q.type===$?(oe=al(Q.props.children,B.mode,oe,Q.key),oe.return=B,B=oe):(oe=Ir(Q.type,Q.key,Q.props,null,B.mode,oe),kr(oe,Q),oe.return=B,B=oe)}return u(B);case G:e:{for(Ue=Q.key;A!==null;){if(A.key===Ue)if(A.tag===4&&A.stateNode.containerInfo===Q.containerInfo&&A.stateNode.implementation===Q.implementation){s(B,A.sibling),oe=n(A,Q.children||[]),oe.return=B,B=oe;break e}else{s(B,A);break}else t(B,A);A=A.sibling}oe=Pr(Q,B.mode,oe),oe.return=B,B=oe}return u(B);case ne:return Q=ol(Q),St(B,A,Q,oe)}if(fe(Q))return Oe(B,A,Q,oe);if(R(Q)){if(Ue=R(Q),typeof Ue!="function")throw Error(f(150));return Q=Ue.call(Q),He(B,A,Q,oe)}if(typeof Q.then=="function")return St(B,A,wr(Q),oe);if(Q.$$typeof===Y)return St(B,A,tn(B,Q),oe);_r(B,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,A!==null&&A.tag===6?(s(B,A.sibling),oe=n(A,Q),oe.return=B,B=oe):(s(B,A),oe=ni(Q,B.mode,oe),oe.return=B,B=oe),u(B)):s(B,A)}return function(B,A,Q,oe){try{Nr=0;var Ue=St(B,A,Q,oe);return Vl=null,Ue}catch(Le){if(Le===il||Le===sn)throw Le;var gt=ja(29,Le,null,B.mode);return gt.lanes=oe,gt.return=B,gt}finally{}}}var cl=rn(!0),ns=rn(!1),ks=!1;function xi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Bs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gs(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(bt&2)!==0){var n=l.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),l.pending=t,t=Kr(e),Bo(e,null,s),t}return Jr(e,l,t,s),Kr(e)}function Sr(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ut(e,s)}}function yi(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var n=null,i=null;if(s=s.firstBaseUpdate,s!==null){do{var u={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};i===null?n=i=u:i=i.next=u,s=s.next}while(s!==null);i===null?n=i=t:i=i.next=t}else n=i=t;s={baseState:l.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var bi=!1;function Dr(){if(bi){var e=Gl;if(e!==null)throw e}}function Mr(e,t,s,l){bi=!1;var n=e.updateQueue;ks=!1;var i=n.firstBaseUpdate,u=n.lastBaseUpdate,p=n.shared.pending;if(p!==null){n.shared.pending=null;var C=p,Z=C.next;C.next=null,u===null?i=Z:u.next=Z,u=C;var le=e.alternate;le!==null&&(le=le.updateQueue,p=le.lastBaseUpdate,p!==u&&(p===null?le.firstBaseUpdate=Z:p.next=Z,le.lastBaseUpdate=C))}if(i!==null){var ue=n.baseState;u=0,le=Z=C=null,p=i;do{var I=p.lane&-536870913,ee=I!==p.lane;if(ee?(ot&I)===I:(l&I)===I){I!==0&&I===rl&&(bi=!0),le!==null&&(le=le.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var Oe=e,He=p;I=t;var St=s;switch(He.tag){case 1:if(Oe=He.payload,typeof Oe=="function"){ue=Oe.call(St,ue,I);break e}ue=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=He.payload,I=typeof Oe=="function"?Oe.call(St,ue,I):Oe,I==null)break e;ue=O({},ue,I);break e;case 2:ks=!0}}I=p.callback,I!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=n.callbacks,ee===null?n.callbacks=[I]:ee.push(I))}else ee={lane:I,tag:p.tag,payload:p.payload,callback:p.callback,next:null},le===null?(Z=le=ee,C=ue):le=le.next=ee,u|=I;if(p=p.next,p===null){if(p=n.shared.pending,p===null)break;ee=p,p=ee.next,ee.next=null,n.lastBaseUpdate=ee,n.shared.pending=null}}while(!0);le===null&&(C=ue),n.baseState=C,n.firstBaseUpdate=Z,n.lastBaseUpdate=le,i===null&&(n.shared.lanes=0),Zl|=u,e.lanes=u,e.memoizedState=ue}}function ec(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function tc(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ec(s[e],t)}var za=w(null),nn=w(0);function ac(e,t){e=yl,F(nn,e),F(za,t),yl=e|t.baseLanes}function vi(){F(nn,yl),F(za,za.current)}function ji(){yl=nn.current,H(za),H(nn)}var ka=w(null),Ra=null;function Vs(e){var t=e.alternate;F(qt,qt.current&1),F(ka,e),Ra===null&&(t===null||za.current!==null||t.memoizedState!==null)&&(Ra=e)}function Ni(e){F(qt,qt.current),F(ka,e),Ra===null&&(Ra=e)}function is(e){e.tag===22?(F(qt,qt.current),F(ka,e),Ra===null&&(Ra=e)):_a()}function _a(){F(qt,qt.current),F(ka,ka.current)}function Sa(e){H(ka),Ra===e&&(Ra=null),H(qt)}var qt=w(0);function on(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Lu(s)||Au(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _s=0,$e=null,mt=null,Mt=null,dl=!1,Ie=!1,r=!1,o=0,d=0,h=null,x=0;function D(){throw Error(f(321))}function ae(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!na(e[s],t[s]))return!1;return!0}function De(e,t,s,l,n,i){return _s=i,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?Ih:$d,r=!1,i=s(l,n),r=!1,Ie&&(i=tt(t,s,l,n)),qe(e),i}function qe(e){q.H=_i;var t=mt!==null&&mt.next!==null;if(_s=0,Mt=mt=$e=null,dl=!1,d=0,h=null,t)throw Error(f(300));e===null||Jt||(e=e.dependencies,e!==null&&en(e)&&(Jt=!0))}function tt(e,t,s,l){$e=e;var n=0;do{if(Ie&&(h=null),d=0,Ie=!1,25<=n)throw Error(f(301));if(n+=1,Mt=mt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}q.H=Ph,i=t(s,l)}while(Ie);return i}function ca(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?wi(t):t,e=e.useState()[0],(mt!==null?mt.memoizedState:null)!==e&&($e.flags|=1024),t}function Fa(){var e=o!==0;return o=0,e}function os(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Ed(e){if(dl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}dl=!1}_s=0,Mt=mt=$e=null,Ie=!1,d=o=0,h=null}function Da(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?$e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Xt(){if(mt===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=Mt===null?$e.memoizedState:Mt.next;if(t!==null)Mt=t,mt=e;else{if(e===null)throw $e.alternate===null?Error(f(467)):Error(f(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Mt===null?$e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wi(e){var t=d;return d+=1,h===null&&(h=[]),e=Io(h,e,t),t=$e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?Ih:$d),e}function lc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wi(e);if(e.$$typeof===Y)return sa(e)}throw Error(f(438,String(e)))}function Ld(e){var t=null,s=$e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=$e.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=sc(),$e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=Se;return t.index++,s}function ul(e,t){return typeof t=="function"?t(e):t}function rc(e){var t=Xt();return Ad(t,mt,e)}function Ad(e,t,s){var l=e.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=s;var n=e.baseQueue,i=l.pending;if(i!==null){if(n!==null){var u=n.next;n.next=i.next,i.next=u}t.baseQueue=n=i,l.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var p=u=null,C=null,Z=t,le=!1;do{var ue=Z.lane&-536870913;if(ue!==Z.lane?(ot&ue)===ue:(_s&ue)===ue){var I=Z.revertLane;if(I===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ue===rl&&(le=!0);else if((_s&I)===I){Z=Z.next,I===rl&&(le=!0);continue}else ue={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},C===null?(p=C=ue,u=i):C=C.next=ue,$e.lanes|=I,Zl|=I;ue=Z.action,r&&s(i,ue),i=Z.hasEagerState?Z.eagerState:s(i,ue)}else I={lane:ue,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},C===null?(p=C=I,u=i):C=C.next=I,$e.lanes|=ue,Zl|=ue;Z=Z.next}while(Z!==null&&Z!==t);if(C===null?u=i:C.next=p,!na(i,e.memoizedState)&&(Jt=!0,le&&(s=Gl,s!==null)))throw s;e.memoizedState=i,e.baseState=u,e.baseQueue=C,l.lastRenderedState=i}return n===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Yd(e){var t=Xt(),s=t.queue;if(s===null)throw Error(f(311));s.lastRenderedReducer=e;var l=s.dispatch,n=s.pending,i=t.memoizedState;if(n!==null){s.pending=null;var u=n=n.next;do i=e(i,u.action),u=u.next;while(u!==n);na(i,t.memoizedState)||(Jt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),s.lastRenderedState=i}return[i,l]}function yh(e,t,s){var l=$e,n=Xt(),i=st;if(i){if(s===void 0)throw Error(f(407));s=s()}else s=t();var u=!na((mt||n).memoizedState,s);if(u&&(n.memoizedState=s,Jt=!0),n=n.queue,Ud(jh.bind(null,l,n,e),[e]),n.getSnapshot!==t||u||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,cn(9,{destroy:void 0},vh.bind(null,l,n,s,t),null),Ct===null)throw Error(f(349));i||(_s&127)!==0||bh(l,t,s)}return s}function bh(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=$e.updateQueue,t===null?(t=sc(),$e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function vh(e,t,s,l){t.value=s,t.getSnapshot=l,Nh(t)&&wh(e)}function jh(e,t,s){return s(function(){Nh(t)&&wh(e)})}function Nh(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!na(e,s)}catch{return!0}}function wh(e){var t=tl(e,2);t!==null&&Ga(t,e,2)}function zd(e){var t=Da();if(typeof e=="function"){var s=e;if(e=s(),r){Ft(!0);try{s()}finally{Ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t}function kh(e,t,s,l){return e.baseState=s,Ad(e,mt,typeof l=="function"?l:ul)}function Z0(e,t,s,l,n){if(oc(e))throw Error(f(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(u){i.listeners.push(u)}};q.T!==null?s(!0):i.isTransition=!1,l(i),s=t.pending,s===null?(i.next=t.pending=i,_h(t,i)):(i.next=s.next,t.pending=s.next=i)}}function _h(e,t){var s=t.action,l=t.payload,n=e.state;if(t.isTransition){var i=q.T,u={};q.T=u;try{var p=s(n,l),C=q.S;C!==null&&C(u,p),Sh(e,t,p)}catch(Z){Rd(e,t,Z)}finally{i!==null&&u.types!==null&&(i.types=u.types),q.T=i}}else try{i=s(n,l),Sh(e,t,i)}catch(Z){Rd(e,t,Z)}}function Sh(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Dh(e,t,l)},function(l){return Rd(e,t,l)}):Dh(e,t,s)}function Dh(e,t,s){t.status="fulfilled",t.value=s,Mh(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,_h(e,s)))}function Rd(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,Mh(t),t=t.next;while(t!==l)}e.action=null}function Mh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function Th(e,t){if(st){var s=Ct.formState;if(s!==null){e:{var l=$e;if(st){if(Dt){t:{for(var n=Dt,i=Ya;n.nodeType!==8;){if(!i){n=null;break t}if(n=cs(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Dt=cs(n.nextSibling),l=n.data==="F!";break e}}Hs(l)}l=!1}l&&(t=s[0])}}return s=Da(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},s.queue=l,s=Wh.bind(null,$e,l),l.dispatch=s,l=zd(!1),i=Vd.bind(null,$e,!1,l.queue),l=Da(),n={state:t,dispatch:null,action:e,pending:null},l.queue=n,s=Z0.bind(null,$e,n,i,s),n.dispatch=s,l.memoizedState=e,[t,s,!1]}function Oh(e){var t=Xt();return Eh(t,mt,e)}function Eh(e,t,s){if(t=Ad(e,t,Ch)[0],e=rc(ul)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=wi(t)}catch(u){throw u===il?sn:u}else l=t;t=Xt();var n=t.queue,i=n.dispatch;return s!==t.memoizedState&&($e.flags|=2048,cn(9,{destroy:void 0},X0.bind(null,n,s),null)),[l,i,e]}function X0(e,t){e.action=t}function Lh(e){var t=Xt(),s=mt;if(s!==null)return Eh(t,s,e);Xt(),t=t.memoizedState,s=Xt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function cn(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=$e.updateQueue,t===null&&(t=sc(),$e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Ah(){return Xt().memoizedState}function nc(e,t,s,l){var n=Da();$e.flags|=e,n.memoizedState=cn(1|t,{destroy:void 0},s,l===void 0?null:l)}function ic(e,t,s,l){var n=Xt();l=l===void 0?null:l;var i=n.memoizedState.inst;mt!==null&&l!==null&&ae(l,mt.memoizedState.deps)?n.memoizedState=cn(t,i,s,l):($e.flags|=e,n.memoizedState=cn(1|t,i,s,l))}function Yh(e,t){nc(8390656,8,e,t)}function Ud(e,t){ic(2048,8,e,t)}function F0(e){$e.flags|=4;var t=$e.updateQueue;if(t===null)t=sc(),$e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function zh(e){var t=Xt().memoizedState;return F0({ref:t,nextImpl:e}),function(){if((bt&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function Rh(e,t){return ic(4,2,e,t)}function Uh(e,t){return ic(4,4,e,t)}function Hh(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qh(e,t,s){s=s!=null?s.concat([e]):null,ic(4,4,Hh.bind(null,t,e),s)}function Hd(){}function Bh(e,t){var s=Xt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&ae(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Gh(e,t){var s=Xt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&ae(t,l[1]))return l[0];if(l=e(),r){Ft(!0);try{e()}finally{Ft(!1)}}return s.memoizedState=[l,t],l}function qd(e,t,s){return s===void 0||(_s&1073741824)!==0&&(ot&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=$f(),$e.lanes|=e,Zl|=e,s)}function Vh(e,t,s,l){return na(s,t)?s:za.current!==null?(e=qd(e,s,l),na(e,t)||(Jt=!0),e):(_s&42)===0||(_s&1073741824)!==0&&(ot&261930)===0?(Jt=!0,e.memoizedState=s):(e=$f(),$e.lanes|=e,Zl|=e,t)}function $h(e,t,s,l,n){var i=ie.p;ie.p=i!==0&&8>i?i:8;var u=q.T,p={};q.T=p,Vd(e,!1,t,s);try{var C=n(),Z=q.S;if(Z!==null&&Z(p,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var le=be(C,l);ki(e,t,le,Ka(e))}else ki(e,t,l,Ka(e))}catch(ue){ki(e,t,{then:function(){},status:"rejected",reason:ue},Ka())}finally{ie.p=i,u!==null&&p.types!==null&&(u.types=p.types),q.T=u}}function W0(){}function Bd(e,t,s,l){if(e.tag!==5)throw Error(f(476));var n=Qh(e).queue;$h(e,n,t,je,s===null?W0:function(){return Zh(e),s(l)})}function Qh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:je,baseState:je,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:je},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zh(e){var t=Qh(e);t.next===null&&(t=e.alternate.memoizedState),ki(e,t.next.queue,{},Ka())}function Gd(){return sa(Bi)}function Xh(){return Xt().memoizedState}function Fh(){return Xt().memoizedState}function J0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Ka();e=Bs(s);var l=Gs(t,e,s);l!==null&&(Ga(l,t,s),Sr(l,t,s)),t={cache:mi()},e.payload=t;return}t=t.return}}function K0(e,t,s){var l=Ka();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oc(e)?Jh(t,s):(s=li(e,t,s,l),s!==null&&(Ga(s,e,l),Kh(s,t,l)))}function Wh(e,t,s){var l=Ka();ki(e,t,s,l)}function ki(e,t,s,l){var n={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oc(e))Jh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var u=t.lastRenderedState,p=i(u,s);if(n.hasEagerState=!0,n.eagerState=p,na(p,u))return Jr(e,t,n,0),Ct===null&&Wr(),!1}catch{}finally{}if(s=li(e,t,n,l),s!==null)return Ga(s,e,l),Kh(s,t,l),!0}return!1}function Vd(e,t,s,l){if(l={lane:2,revertLane:ju(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(t)throw Error(f(479))}else t=li(e,s,l,2),t!==null&&Ga(t,e,2)}function oc(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Jh(e,t){Ie=dl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Kh(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ut(e,s)}}var _i={readContext:sa,use:lc,useCallback:D,useContext:D,useEffect:D,useImperativeHandle:D,useLayoutEffect:D,useInsertionEffect:D,useMemo:D,useReducer:D,useRef:D,useState:D,useDebugValue:D,useDeferredValue:D,useTransition:D,useSyncExternalStore:D,useId:D,useHostTransitionStatus:D,useFormState:D,useActionState:D,useOptimistic:D,useMemoCache:D,useCacheRefresh:D};_i.useEffectEvent=D;var Ih={readContext:sa,use:lc,useCallback:function(e,t){return Da().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:Yh,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,nc(4194308,4,Hh.bind(null,t,e),s)},useLayoutEffect:function(e,t){return nc(4194308,4,e,t)},useInsertionEffect:function(e,t){nc(4,2,e,t)},useMemo:function(e,t){var s=Da();t=t===void 0?null:t;var l=e();if(r){Ft(!0);try{e()}finally{Ft(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Da();if(s!==void 0){var n=s(t);if(r){Ft(!0);try{s(t)}finally{Ft(!1)}}}else n=t;return l.memoizedState=l.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=K0.bind(null,$e,e),[l.memoizedState,e]},useRef:function(e){var t=Da();return e={current:e},t.memoizedState=e},useState:function(e){e=zd(e);var t=e.queue,s=Wh.bind(null,$e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Hd,useDeferredValue:function(e,t){var s=Da();return qd(s,e,t)},useTransition:function(){var e=zd(!1);return e=$h.bind(null,$e,e.queue,!0,!1),Da().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=$e,n=Da();if(st){if(s===void 0)throw Error(f(407));s=s()}else{if(s=t(),Ct===null)throw Error(f(349));(ot&127)!==0||bh(l,t,s)}n.memoizedState=s;var i={value:s,getSnapshot:t};return n.queue=i,Yh(jh.bind(null,l,i,e),[e]),l.flags|=2048,cn(9,{destroy:void 0},vh.bind(null,l,i,s,t),null),s},useId:function(){var e=Da(),t=Ct.identifierPrefix;if(st){var s=ls,l=ss;s=(l&~(1<<32-wt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=o++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=x++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gd,useFormState:Th,useActionState:Th,useOptimistic:function(e){var t=Da();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Vd.bind(null,$e,!0,s),s.dispatch=t,[e,t]},useMemoCache:Ld,useCacheRefresh:function(){return Da().memoizedState=J0.bind(null,$e)},useEffectEvent:function(e){var t=Da(),s={impl:e};return t.memoizedState=s,function(){if((bt&2)!==0)throw Error(f(440));return s.impl.apply(void 0,arguments)}}},$d={readContext:sa,use:lc,useCallback:Bh,useContext:sa,useEffect:Ud,useImperativeHandle:qh,useInsertionEffect:Rh,useLayoutEffect:Uh,useMemo:Gh,useReducer:rc,useRef:Ah,useState:function(){return rc(ul)},useDebugValue:Hd,useDeferredValue:function(e,t){var s=Xt();return Vh(s,mt.memoizedState,e,t)},useTransition:function(){var e=rc(ul)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:wi(e),t]},useSyncExternalStore:yh,useId:Xh,useHostTransitionStatus:Gd,useFormState:Oh,useActionState:Oh,useOptimistic:function(e,t){var s=Xt();return kh(s,mt,e,t)},useMemoCache:Ld,useCacheRefresh:Fh};$d.useEffectEvent=zh;var Ph={readContext:sa,use:lc,useCallback:Bh,useContext:sa,useEffect:Ud,useImperativeHandle:qh,useInsertionEffect:Rh,useLayoutEffect:Uh,useMemo:Gh,useReducer:Yd,useRef:Ah,useState:function(){return Yd(ul)},useDebugValue:Hd,useDeferredValue:function(e,t){var s=Xt();return mt===null?qd(s,e,t):Vh(s,mt.memoizedState,e,t)},useTransition:function(){var e=Yd(ul)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:wi(e),t]},useSyncExternalStore:yh,useId:Xh,useHostTransitionStatus:Gd,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var s=Xt();return mt!==null?kh(s,mt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Ld,useCacheRefresh:Fh};Ph.useEffectEvent=zh;function Qd(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:O({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zd={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=Ka(),n=Bs(l);n.payload=t,s!=null&&(n.callback=s),t=Gs(e,n,l),t!==null&&(Ga(t,e,l),Sr(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=Ka(),n=Bs(l);n.tag=1,n.payload=t,s!=null&&(n.callback=s),t=Gs(e,n,l),t!==null&&(Ga(t,e,l),Sr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Ka(),l=Bs(s);l.tag=2,t!=null&&(l.callback=t),t=Gs(e,l,s),t!==null&&(Ga(t,e,s),Sr(t,e,s))}};function ef(e,t,s,l,n,i,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,u):t.prototype&&t.prototype.isPureReactComponent?!Ps(s,l)||!Ps(n,i):!0}function tf(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Zd.enqueueReplaceState(t,t.state,null)}function Cr(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=O({},s));for(var n in e)s[n]===void 0&&(s[n]=e[n])}return s}function af(e){Fr(e)}function sf(e){console.error(e)}function lf(e){Fr(e)}function cc(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function rf(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Xd(e,t,s){return s=Bs(s),s.tag=3,s.payload={element:null},s.callback=function(){cc(e,t)},s}function nf(e){return e=Bs(e),e.tag=3,e}function of(e,t,s,l){var n=s.type.getDerivedStateFromError;if(typeof n=="function"){var i=l.value;e.payload=function(){return n(i)},e.callback=function(){rf(t,s,l)}}var u=s.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){rf(t,s,l),typeof n!="function"&&(Xl===null?Xl=new Set([this]):Xl.add(this));var p=l.stack;this.componentDidCatch(l.value,{componentStack:p!==null?p:""})})}function I0(e,t,s,l,n){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&Bl(t,s,n,!0),s=ka.current,s!==null){switch(s.tag){case 31:case 13:return Ra===null?jc():s.alternate===null&&$t===0&&($t=3),s.flags&=-257,s.flags|=65536,s.lanes=n,l===ln?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),yu(e,l,n)),!1;case 22:return s.flags|=65536,l===ln?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),yu(e,l,n)),!1}throw Error(f(435,s.tag))}return yu(e,l,n),jc(),!1}if(st)return t=ka.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,l!==ui&&(e=Error(f(422),{cause:l}),xr(ia(e,s)))):(l!==ui&&(t=Error(f(423),{cause:l}),xr(ia(t,s))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,l=ia(l,s),n=Xd(e.stateNode,l,n),yi(e,n),$t!==4&&($t=2)),!1;var i=Error(f(520),{cause:l});if(i=ia(i,s),Li===null?Li=[i]:Li.push(i),$t!==4&&($t=2),t===null)return!0;l=ia(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=n&-n,s.lanes|=e,e=Xd(s.stateNode,l,e),yi(s,e),!1;case 1:if(t=s.type,i=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Xl===null||!Xl.has(i))))return s.flags|=65536,n&=-n,s.lanes|=n,n=nf(n),of(n,e,s,l),yi(s,n),!1}s=s.return}while(s!==null);return!1}var Fd=Error(f(461)),Jt=!1;function da(e,t,s,l){t.child=e===null?ns(t,null,s,l):cl(t,e.child,s,l)}function cf(e,t,s,l,n){s=s.render;var i=t.ref;if("ref"in l){var u={};for(var p in l)p!=="ref"&&(u[p]=l[p])}else u=l;return ll(t),l=De(e,t,s,u,i,n),p=Fa(),e!==null&&!Jt?(os(e,t,n),hl(e,t,n)):(st&&p&&ci(t),t.flags|=1,da(e,t,l,n),t.child)}function df(e,t,s,l,n){if(e===null){var i=s.type;return typeof i=="function"&&!ri(i)&&i.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=i,uf(e,t,i,l,n)):(e=Ir(s.type,null,l,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!au(e,n)){var u=i.memoizedProps;if(s=s.compare,s=s!==null?s:Ps,s(u,l)&&e.ref===t.ref)return hl(e,t,n)}return t.flags|=1,e=ys(i,l),e.ref=t.ref,e.return=t,t.child=e}function uf(e,t,s,l,n){if(e!==null){var i=e.memoizedProps;if(Ps(i,l)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=l=i,au(e,n))(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,hl(e,t,n)}return Wd(e,t,s,l,n)}function hf(e,t,s,l){var n=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|s:s,e!==null){for(l=t.child=e.child,n=0;l!==null;)n=n|l.lanes|l.childLanes,l=l.sibling;l=n&~i}else l=0,t.child=null;return ff(e,t,i,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&lt(t,i!==null?i.cachePool:null),i!==null?ac(t,i):vi(),is(t);else return l=t.lanes=536870912,ff(e,t,i!==null?i.baseLanes|s:s,s,l)}else i!==null?(lt(t,i.cachePool),ac(t,i),_a(),t.memoizedState=null):(e!==null&&lt(t,null),vi(),_a());return da(e,t,n,s),t.child}function Si(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ff(e,t,s,l,n){var i=an();return i=i===null?null:{parent:Ht._currentValue,pool:i},t.memoizedState={baseLanes:s,cachePool:i},e!==null&&lt(t,null),vi(),is(t),e!==null&&Bl(e,t,l,!0),t.childLanes=n,null}function dc(e,t){return t=hc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mf(e,t,s){return cl(t,e.child,null,s),e=dc(t,t.pendingProps),e.flags|=2,Sa(t),t.memoizedState=null,e}function P0(e,t,s){var l=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(l.mode==="hidden")return e=dc(t,l),t.lanes=536870912,Si(null,e);if(Ni(t),(e=Dt)?(e=Sm(e,Ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rs!==null?{id:ss,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},s=ii(e),s.return=t,t.child=s,aa=t,Dt=null)):e=null,e===null)throw Hs(t);return t.lanes=536870912,null}return dc(t,l)}var i=e.memoizedState;if(i!==null){var u=i.dehydrated;if(Ni(t),n)if(t.flags&256)t.flags&=-257,t=mf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(Jt||Bl(e,t,s,!1),n=(s&e.childLanes)!==0,Jt||n){if(l=Ct,l!==null&&(u=Ta(l,s),u!==0&&u!==i.retryLane))throw i.retryLane=u,tl(e,u),Ga(l,e,u),Fd;jc(),t=mf(e,t,s)}else e=i.treeContext,Dt=cs(u.nextSibling),aa=t,st=!0,Us=null,Ya=!1,e!==null&&$o(t,e),t=dc(t,l),t.flags|=4096;return t}return e=ys(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(f(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Wd(e,t,s,l,n){return ll(t),s=De(e,t,s,l,void 0,n),l=Fa(),e!==null&&!Jt?(os(e,t,n),hl(e,t,n)):(st&&l&&ci(t),t.flags|=1,da(e,t,s,n),t.child)}function gf(e,t,s,l,n,i){return ll(t),t.updateQueue=null,s=tt(t,l,s,n),qe(e),l=Fa(),e!==null&&!Jt?(os(e,t,i),hl(e,t,i)):(st&&l&&ci(t),t.flags|=1,da(e,t,s,i),t.child)}function xf(e,t,s,l,n){if(ll(t),t.stateNode===null){var i=ps,u=s.contextType;typeof u=="object"&&u!==null&&(i=sa(u)),i=new s(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Zd,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},xi(t),u=s.contextType,i.context=typeof u=="object"&&u!==null?sa(u):ps,i.state=t.memoizedState,u=s.getDerivedStateFromProps,typeof u=="function"&&(Qd(t,s,u,l),i.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(u=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),u!==i.state&&Zd.enqueueReplaceState(i,i.state,null),Mr(t,l,i,n),Dr(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var p=t.memoizedProps,C=Cr(s,p);i.props=C;var Z=i.context,le=s.contextType;u=ps,typeof le=="object"&&le!==null&&(u=sa(le));var ue=s.getDerivedStateFromProps;le=typeof ue=="function"||typeof i.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,le||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(p||Z!==u)&&tf(t,i,l,u),ks=!1;var I=t.memoizedState;i.state=I,Mr(t,l,i,n),Dr(),Z=t.memoizedState,p||I!==Z||ks?(typeof ue=="function"&&(Qd(t,s,ue,l),Z=t.memoizedState),(C=ks||ef(t,s,C,l,I,Z,u))?(le||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"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=Z),i.props=l,i.state=Z,i.context=u,l=C):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,pi(e,t),u=t.memoizedProps,le=Cr(s,u),i.props=le,ue=t.pendingProps,I=i.context,Z=s.contextType,C=ps,typeof Z=="object"&&Z!==null&&(C=sa(Z)),p=s.getDerivedStateFromProps,(Z=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==ue||I!==C)&&tf(t,i,l,C),ks=!1,I=t.memoizedState,i.state=I,Mr(t,l,i,n),Dr();var ee=t.memoizedState;u!==ue||I!==ee||ks||e!==null&&e.dependencies!==null&&en(e.dependencies)?(typeof p=="function"&&(Qd(t,s,p,l),ee=t.memoizedState),(le=ks||ef(t,s,le,l,I,ee,C)||e!==null&&e.dependencies!==null&&en(e.dependencies))?(Z||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,ee,C),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,ee,C)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ee),i.props=l,i.state=ee,i.context=C,l=le):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,uc(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=cl(t,e.child,null,n),t.child=cl(t,null,s,n)):da(e,t,s,n),t.memoizedState=i.state,e=t.child):e=hl(e,t,n),e}function pf(e,t,s,l){return sl(),t.flags|=256,da(e,t,s,l),t.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kd(e){return{baseLanes:e,cachePool:vr()}}function Id(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Ja),e}function yf(e,t,s){var l=t.pendingProps,n=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(qt.current&2)!==0),u&&(n=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(n?Vs(t):_a(),(e=Dt)?(e=Sm(e,Ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rs!==null?{id:ss,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},s=ii(e),s.return=t,t.child=s,aa=t,Dt=null)):e=null,e===null)throw Hs(t);return Au(e)?t.lanes=32:t.lanes=536870912,null}var p=l.children;return l=l.fallback,n?(_a(),n=t.mode,p=hc({mode:"hidden",children:p},n),l=al(l,n,s,null),p.return=t,l.return=t,p.sibling=l,t.child=p,l=t.child,l.memoizedState=Kd(s),l.childLanes=Id(e,u,s),t.memoizedState=Jd,Si(null,l)):(Vs(t),Pd(t,p))}var C=e.memoizedState;if(C!==null&&(p=C.dehydrated,p!==null)){if(i)t.flags&256?(Vs(t),t.flags&=-257,t=eu(e,t,s)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),p=l.fallback,n=t.mode,l=hc({mode:"visible",children:l.children},n),p=al(p,n,s,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,cl(t,e.child,null,s),l=t.child,l.memoizedState=Kd(s),l.childLanes=Id(e,u,s),t.memoizedState=Jd,t=Si(null,l));else if(Vs(t),Au(p)){if(u=p.nextSibling&&p.nextSibling.dataset,u)var Z=u.dgst;u=Z,l=Error(f(419)),l.stack="",l.digest=u,xr({value:l,source:null,stack:null}),t=eu(e,t,s)}else if(Jt||Bl(e,t,s,!1),u=(s&e.childLanes)!==0,Jt||u){if(u=Ct,u!==null&&(l=Ta(u,s),l!==0&&l!==C.retryLane))throw C.retryLane=l,tl(e,l),Ga(u,e,l),Fd;Lu(p)||jc(),t=eu(e,t,s)}else Lu(p)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Dt=cs(p.nextSibling),aa=t,st=!0,Us=null,Ya=!1,e!==null&&$o(t,e),t=Pd(t,l.children),t.flags|=4096);return t}return n?(_a(),p=l.fallback,n=t.mode,C=e.child,Z=C.sibling,l=ys(C,{mode:"hidden",children:l.children}),l.subtreeFlags=C.subtreeFlags&65011712,Z!==null?p=ys(Z,p):(p=al(p,n,s,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,Si(null,l),l=t.child,p=e.child.memoizedState,p===null?p=Kd(s):(n=p.cachePool,n!==null?(C=Ht._currentValue,n=n.parent!==C?{parent:C,pool:C}:n):n=vr(),p={baseLanes:p.baseLanes|s,cachePool:n}),l.memoizedState=p,l.childLanes=Id(e,u,s),t.memoizedState=Jd,Si(e.child,l)):(Vs(t),s=e.child,e=s.sibling,s=ys(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=s,t.memoizedState=null,s)}function Pd(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=ja(22,e,null,t),e.lanes=0,e}function eu(e,t,s){return cl(t,e.child,null,s),e=Pd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bf(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),pr(e.return,t,s)}function tu(e,t,s,l,n,i){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:n,treeForkCount:i}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=l,u.tail=s,u.tailMode=n,u.treeForkCount=i)}function vf(e,t,s){var l=t.pendingProps,n=l.revealOrder,i=l.tail;l=l.children;var u=qt.current,p=(u&2)!==0;if(p?(u=u&1|2,t.flags|=128):u&=1,F(qt,u),da(e,t,l,s),l=st?as:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bf(e,s,t);else if(e.tag===19)bf(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(s=t.child,n=null;s!==null;)e=s.alternate,e!==null&&on(e)===null&&(n=s),s=s.sibling;s=n,s===null?(n=t.child,t.child=null):(n=s.sibling,s.sibling=null),tu(t,!1,n,s,i,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&on(e)===null){t.child=n;break}e=n.sibling,n.sibling=s,s=n,n=e}tu(t,!0,s,null,i,l);break;case"together":tu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function hl(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Zl|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Bl(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,s=ys(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ys(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function au(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&en(e)))}function eg(e,t,s){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),qs(t,Ht,e.memoizedState.cache),sl();break;case 27:case 5:E(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:qs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ni(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Vs(t),t.flags|=128,null):(s&t.child.childLanes)!==0?yf(e,t,s):(Vs(t),e=hl(e,t,s),e!==null?e.sibling:null);Vs(t);break;case 19:var n=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(Bl(e,t,s,!1),l=(s&t.childLanes)!==0),n){if(l)return vf(e,t,s);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),F(qt,qt.current),l)break;return null;case 22:return t.lanes=0,hf(e,t,s,t.pendingProps);case 24:qs(t,Ht,e.memoizedState.cache)}return hl(e,t,s)}function jf(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Jt=!0;else{if(!au(e,s)&&(t.flags&128)===0)return Jt=!1,eg(e,t,s);Jt=(e.flags&131072)!==0}else Jt=!1,st&&(t.flags&1048576)!==0&&Vo(t,as,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ol(t.elementType),t.type=e,typeof e=="function")ri(e)?(l=Cr(e,l),t.tag=1,t=xf(null,t,e,l,s)):(t.tag=0,t=Wd(null,t,e,l,s));else{if(e!=null){var n=e.$$typeof;if(n===z){t.tag=11,t=cf(null,t,e,l,s);break e}else if(n===K){t.tag=14,t=df(null,t,e,l,s);break e}}throw t=ye(e)||e,Error(f(306,t,""))}}return t;case 0:return Wd(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,n=Cr(l,t.pendingProps),xf(e,t,l,n,s);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(f(387));l=t.pendingProps;var i=t.memoizedState;n=i.element,pi(e,t),Mr(t,l,null,s);var u=t.memoizedState;if(l=u.cache,qs(t,Ht,l),l!==i.cache&&ql(t,[Ht],s,!0),Dr(),l=u.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=pf(e,t,l,s);break e}else if(l!==n){n=ia(Error(f(424)),t),xr(n),t=pf(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Dt=cs(e.firstChild),aa=t,st=!0,Us=null,Ya=!0,s=ns(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(sl(),l===n){t=hl(e,t,s);break e}da(e,t,l,s)}t=t.child}return t;case 26:return uc(e,t),e===null?(s=Em(t.type,null,t.pendingProps,null))?t.memoizedState=s:st||(s=t.type,e=t.pendingProps,l=Mc(Te.current).createElement(s),l[Xe]=t,l[Ot]=e,ua(l,s,e),Wt(l),t.stateNode=l):t.memoizedState=Em(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return E(t),e===null&&st&&(l=t.stateNode=Cm(t.type,t.pendingProps,Te.current),aa=t,Ya=!0,n=Dt,Kl(t.type)?(Yu=n,Dt=cs(l.firstChild)):Dt=n),da(e,t,t.pendingProps.children,s),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((n=l=Dt)&&(l=Tg(l,t.type,t.pendingProps,Ya),l!==null?(t.stateNode=l,aa=t,Dt=cs(l.firstChild),Ya=!1,n=!0):n=!1),n||Hs(t)),E(t),n=t.type,i=t.pendingProps,u=e!==null?e.memoizedProps:null,l=i.children,Tu(n,i)?l=null:u!==null&&Tu(n,u)&&(t.flags|=32),t.memoizedState!==null&&(n=De(e,t,ca,null,null,s),Bi._currentValue=n),uc(e,t),da(e,t,l,s),t.child;case 6:return e===null&&st&&((e=s=Dt)&&(s=Og(s,t.pendingProps,Ya),s!==null?(t.stateNode=s,aa=t,Dt=null,e=!0):e=!1),e||Hs(t)),null;case 13:return yf(e,t,s);case 4:return Be(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=cl(t,null,l,s):da(e,t,l,s),t.child;case 11:return cf(e,t,t.type,t.pendingProps,s);case 7:return da(e,t,t.pendingProps,s),t.child;case 8:return da(e,t,t.pendingProps.children,s),t.child;case 12:return da(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,qs(t,t.type,l.value),da(e,t,l.children,s),t.child;case 9:return n=t.type._context,l=t.pendingProps.children,ll(t),n=sa(n),l=l(n),t.flags|=1,da(e,t,l,s),t.child;case 14:return df(e,t,t.type,t.pendingProps,s);case 15:return uf(e,t,t.type,t.pendingProps,s);case 19:return vf(e,t,s);case 31:return P0(e,t,s);case 22:return hf(e,t,s,t.pendingProps);case 24:return ll(t),l=sa(Ht),e===null?(n=an(),n===null&&(n=Ct,i=mi(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=s),n=i),t.memoizedState={parent:l,cache:n},xi(t),qs(t,Ht,n)):((e.lanes&s)!==0&&(pi(e,t),Mr(t,null,null,s),Dr()),n=e.memoizedState,i=t.memoizedState,n.parent!==l?(n={parent:l,cache:l},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),qs(t,Ht,l)):(l=i.cache,qs(t,Ht,l),l!==n.cache&&ql(t,[Ht],s,!0))),da(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function fl(e){e.flags|=4}function su(e,t,s,l,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Ff())e.flags|=8192;else throw oa=ln,jr}else e.flags&=-16777217}function Nf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rm(t))if(Ff())e.flags|=8192;else throw oa=ln,jr}function fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?sr():536870912,e.lanes|=t,fn|=t)}function Di(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var n=e.child;n!==null;)s|=n.lanes|n.childLanes,l|=n.subtreeFlags&65011712,l|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)s|=n.lanes|n.childLanes,l|=n.subtreeFlags,l|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function tg(e,t,s){var l=t.pendingProps;switch(di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(t),null;case 1:return Yt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ws(Ht),k(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?fl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hi())),Yt(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(fl(t),i!==null?(Yt(t),Nf(t,i)):(Yt(t),su(t,n,null,l,s))):i?i!==e.memoizedState?(fl(t),Yt(t),Nf(t,i)):(Yt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&fl(t),Yt(t),su(t,n,e,l,s)),null;case 27:if(te(t),s=Te.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fl(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return Yt(t),null}e=xe.current,Hl(t)?Qo(t):(e=Cm(n,l,s),t.stateNode=e,fl(t))}return Yt(t),null;case 5:if(te(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fl(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return Yt(t),null}if(i=xe.current,Hl(t))Qo(t);else{var u=Mc(Te.current);switch(i){case 1:i=u.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=u.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=u.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=u.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=u.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?u.createElement("select",{is:l.is}):u.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?u.createElement(n,{is:l.is}):u.createElement(n)}}i[Xe]=t,i[Ot]=l;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=i;e:switch(ua(i,n,l),n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&fl(t)}}return Yt(t),su(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&fl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(f(166));if(e=Te.current,Hl(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,n=aa,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}e[Xe]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||ym(e.nodeValue,s)),e||Hs(t,!0)}else e=Mc(e).createTextNode(l),e[Xe]=t,t.stateNode=e}return Yt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hl(t),s!==null){if(e===null){if(!l)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[Xe]=t}else sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Yt(t),e=!1}else s=hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Sa(t),t):(Sa(t),null);if((t.flags&128)!==0)throw Error(f(558))}return Yt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!n)throw Error(f(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[Xe]=t}else sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Yt(t),n=!1}else n=hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Sa(t),t):(Sa(t),null)}return Sa(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==n&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),fc(t,t.updateQueue),Yt(t),null);case 4:return k(),e===null&&_u(t.stateNode.containerInfo),Yt(t),null;case 10:return ws(t.type),Yt(t),null;case 19:if(H(qt),l=t.memoizedState,l===null)return Yt(t),null;if(n=(t.flags&128)!==0,i=l.rendering,i===null)if(n)Di(l,!1);else{if($t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=on(e),i!==null){for(t.flags|=128,Di(l,!1),e=i.updateQueue,t.updateQueue=e,fc(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Go(s,e),s=s.sibling;return F(qt,qt.current&1|2),st&&vs(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&se()>yc&&(t.flags|=128,n=!0,Di(l,!1),t.lanes=4194304)}else{if(!n)if(e=on(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,fc(t,e),Di(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!st)return Yt(t),null}else 2*se()-l.renderingStartTime>yc&&s!==536870912&&(t.flags|=128,n=!0,Di(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=se(),e.sibling=null,s=qt.current,F(qt,n?s&1|2:s&1),st&&vs(t,l.treeForkCount),e):(Yt(t),null);case 22:case 23:return Sa(t),ji(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(Yt(t),t.subtreeFlags&6&&(t.flags|=8192)):Yt(t),s=t.updateQueue,s!==null&&fc(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&H(nl),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ws(Ht),Yt(t),null;case 25:return null;case 30:return null}throw Error(f(156,t.tag))}function ag(e,t){switch(di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ws(Ht),k(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return te(t),null;case 31:if(t.memoizedState!==null){if(Sa(t),t.alternate===null)throw Error(f(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(qt),null;case 4:return k(),null;case 10:return ws(t.type),null;case 22:case 23:return Sa(t),ji(),e!==null&&H(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ws(Ht),null;case 25:return null;default:return null}}function wf(e,t){switch(di(t),t.tag){case 3:ws(Ht),k();break;case 26:case 27:case 5:te(t);break;case 4:k();break;case 31:t.memoizedState!==null&&Sa(t);break;case 13:Sa(t);break;case 19:H(qt);break;case 10:ws(t.type);break;case 22:case 23:Sa(t),ji(),e!==null&&H(nl);break;case 24:ws(Ht)}}function Mi(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var n=l.next;s=n;do{if((s.tag&e)===e){l=void 0;var i=s.create,u=s.inst;l=i(),u.destroy=l}s=s.next}while(s!==n)}}catch(p){Nt(t,t.return,p)}}function $l(e,t,s){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var i=n.next;l=i;do{if((l.tag&e)===e){var u=l.inst,p=u.destroy;if(p!==void 0){u.destroy=void 0,n=t;var C=s,Z=p;try{Z()}catch(le){Nt(n,C,le)}}}l=l.next}while(l!==i)}}catch(le){Nt(t,t.return,le)}}function kf(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{tc(t,s)}catch(l){Nt(e,e.return,l)}}}function _f(e,t,s){s.props=Cr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Nt(e,t,l)}}function Ci(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(n){Nt(e,t,n)}}function $s(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(n){Nt(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(n){Nt(e,t,n)}else s.current=null}function Sf(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(n){Nt(e,e.return,n)}}function lu(e,t,s){try{var l=e.stateNode;kg(l,e.type,s,t),l[Ot]=t}catch(n){Nt(e,e.return,n)}}function Df(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kl(e.type)||e.tag===4}function ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Df(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nu(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=gs));else if(l!==4&&(l===27&&Kl(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(nu(e,t,s),e=e.sibling;e!==null;)nu(e,t,s),e=e.sibling}function mc(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Kl(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(mc(e,t,s),e=e.sibling;e!==null;)mc(e,t,s),e=e.sibling}function Mf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ua(t,l,s),t[Xe]=e,t[Ot]=s}catch(i){Nt(e,e.return,i)}}var ml=!1,Kt=!1,iu=!1,Cf=typeof WeakSet=="function"?WeakSet:Set,ra=null;function sg(e,t){if(e=e.containerInfo,Mu=Yc,e=zo(e),Jn(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var n=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{s.nodeType,i.nodeType}catch{s=null;break e}var u=0,p=-1,C=-1,Z=0,le=0,ue=e,I=null;t:for(;;){for(var ee;ue!==s||n!==0&&ue.nodeType!==3||(p=u+n),ue!==i||l!==0&&ue.nodeType!==3||(C=u+l),ue.nodeType===3&&(u+=ue.nodeValue.length),(ee=ue.firstChild)!==null;)I=ue,ue=ee;for(;;){if(ue===e)break t;if(I===s&&++Z===n&&(p=u),I===i&&++le===l&&(C=u),(ee=ue.nextSibling)!==null)break;ue=I,I=ue.parentNode}ue=ee}s=p===-1||C===-1?null:{start:p,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Cu={focusedElem:e,selectionRange:s},Yc=!1,ra=t;ra!==null;)if(t=ra,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ra=e;else for(;ra!==null;){switch(t=ra,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)n=e[s],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,s=t,n=i.memoizedProps,i=i.memoizedState,l=s.stateNode;try{var Oe=Cr(s.type,n);e=l.getSnapshotBeforeUpdate(Oe,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(He){Nt(s,s.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Eu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Eu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(f(163))}if(e=t.sibling,e!==null){e.return=t.return,ra=e;break}ra=t.return}}function Tf(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:xl(e,s),l&4&&Mi(5,s);break;case 1:if(xl(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(u){Nt(s,s.return,u)}else{var n=Cr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){Nt(s,s.return,u)}}l&64&&kf(s),l&512&&Ci(s,s.return);break;case 3:if(xl(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{tc(e,t)}catch(u){Nt(s,s.return,u)}}break;case 27:t===null&&l&4&&Mf(s);case 26:case 5:xl(e,s),t===null&&l&4&&Sf(s),l&512&&Ci(s,s.return);break;case 12:xl(e,s);break;case 31:xl(e,s),l&4&&Lf(e,s);break;case 13:xl(e,s),l&4&&Af(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=hg.bind(null,s),Eg(e,s))));break;case 22:if(l=s.memoizedState!==null||ml,!l){t=t!==null&&t.memoizedState!==null||Kt,n=ml;var i=Kt;ml=l,(Kt=t)&&!i?pl(e,s,(s.subtreeFlags&8772)!==0):xl(e,s),ml=n,Kt=i}break;case 30:break;default:xl(e,s)}}function Of(e){var t=e.alternate;t!==null&&(e.alternate=null,Of(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Cn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ut=null,Ua=!1;function gl(e,t,s){for(s=s.child;s!==null;)Ef(e,t,s),s=s.sibling}function Ef(e,t,s){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(ta,s)}catch{}switch(s.tag){case 26:Kt||$s(s,t),gl(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Kt||$s(s,t);var l=Ut,n=Ua;Kl(s.type)&&(Ut=s.stateNode,Ua=!1),gl(e,t,s),Ui(s.stateNode),Ut=l,Ua=n;break;case 5:Kt||$s(s,t);case 6:if(l=Ut,n=Ua,Ut=null,gl(e,t,s),Ut=l,Ua=n,Ut!==null)if(Ua)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(s.stateNode)}catch(i){Nt(s,t,i)}else try{Ut.removeChild(s.stateNode)}catch(i){Nt(s,t,i)}break;case 18:Ut!==null&&(Ua?(e=Ut,km(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),jn(e)):km(Ut,s.stateNode));break;case 4:l=Ut,n=Ua,Ut=s.stateNode.containerInfo,Ua=!0,gl(e,t,s),Ut=l,Ua=n;break;case 0:case 11:case 14:case 15:$l(2,s,t),Kt||$l(4,s,t),gl(e,t,s);break;case 1:Kt||($s(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&_f(s,t,l)),gl(e,t,s);break;case 21:gl(e,t,s);break;case 22:Kt=(l=Kt)||s.memoizedState!==null,gl(e,t,s),Kt=l;break;default:gl(e,t,s)}}function Lf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jn(e)}catch(s){Nt(t,t.return,s)}}}function Af(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jn(e)}catch(s){Nt(t,t.return,s)}}function lg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cf),t;default:throw Error(f(435,e.tag))}}function gc(e,t){var s=lg(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var n=fg.bind(null,e,l);l.then(n,n)}})}function Ha(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var n=s[l],i=e,u=t,p=u;e:for(;p!==null;){switch(p.tag){case 27:if(Kl(p.type)){Ut=p.stateNode,Ua=!1;break e}break;case 5:Ut=p.stateNode,Ua=!1;break e;case 3:case 4:Ut=p.stateNode.containerInfo,Ua=!0;break e}p=p.return}if(Ut===null)throw Error(f(160));Ef(i,u,n),Ut=null,Ua=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yf(t,e),t=t.sibling}var Ss=null;function Yf(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ha(t,e),qa(e),l&4&&($l(3,e,e.return),Mi(3,e),$l(5,e,e.return));break;case 1:Ha(t,e),qa(e),l&512&&(Kt||s===null||$s(s,s.return)),l&64&&ml&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var n=Ss;if(Ha(t,e),qa(e),l&512&&(Kt||s===null||$s(s,s.return)),l&4){var i=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,n=n.ownerDocument||n;t:switch(l){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Nl]||i[Xe]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(l),n.head.insertBefore(i,n.querySelector("head > title"))),ua(i,l,s),i[Xe]=e,Wt(i),l=i;break e;case"link":var u=Ym("link","href",n).get(l+(s.href||""));if(u){for(var p=0;p<u.length;p++)if(i=u[p],i.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&i.getAttribute("rel")===(s.rel==null?null:s.rel)&&i.getAttribute("title")===(s.title==null?null:s.title)&&i.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){u.splice(p,1);break t}}i=n.createElement(l),ua(i,l,s),n.head.appendChild(i);break;case"meta":if(u=Ym("meta","content",n).get(l+(s.content||""))){for(p=0;p<u.length;p++)if(i=u[p],i.getAttribute("content")===(s.content==null?null:""+s.content)&&i.getAttribute("name")===(s.name==null?null:s.name)&&i.getAttribute("property")===(s.property==null?null:s.property)&&i.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&i.getAttribute("charset")===(s.charSet==null?null:s.charSet)){u.splice(p,1);break t}}i=n.createElement(l),ua(i,l,s),n.head.appendChild(i);break;default:throw Error(f(468,l))}i[Xe]=e,Wt(i),l=i}e.stateNode=l}else zm(n,e.type,e.stateNode);else e.stateNode=Am(n,l,e.memoizedProps);else i!==l?(i===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):i.count--,l===null?zm(n,e.type,e.stateNode):Am(n,l,e.memoizedProps)):l===null&&e.stateNode!==null&&lu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ha(t,e),qa(e),l&512&&(Kt||s===null||$s(s,s.return)),s!==null&&l&4&&lu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ha(t,e),qa(e),l&512&&(Kt||s===null||$s(s,s.return)),e.flags&32){n=e.stateNode;try{Sl(n,"")}catch(Oe){Nt(e,e.return,Oe)}}l&4&&e.stateNode!=null&&(n=e.memoizedProps,lu(e,n,s!==null?s.memoizedProps:n)),l&1024&&(iu=!0);break;case 6:if(Ha(t,e),qa(e),l&4){if(e.stateNode===null)throw Error(f(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(Oe){Nt(e,e.return,Oe)}}break;case 3:if(Oc=null,n=Ss,Ss=Cc(t.containerInfo),Ha(t,e),Ss=n,qa(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{jn(t.containerInfo)}catch(Oe){Nt(e,e.return,Oe)}iu&&(iu=!1,zf(e));break;case 4:l=Ss,Ss=Cc(e.stateNode.containerInfo),Ha(t,e),qa(e),Ss=l;break;case 12:Ha(t,e),qa(e);break;case 31:Ha(t,e),qa(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gc(e,l)));break;case 13:Ha(t,e),qa(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pc=se()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gc(e,l)));break;case 22:n=e.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,Z=ml,le=Kt;if(ml=Z||n,Kt=le||C,Ha(t,e),Kt=le,ml=Z,qa(e),l&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(s===null||C||ml||Kt||Tr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){C=s=t;try{if(i=C.stateNode,n)u=i.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{p=C.stateNode;var ue=C.memoizedProps.style,I=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;p.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(Oe){Nt(C,C.return,Oe)}}}else if(t.tag===6){if(s===null){C=t;try{C.stateNode.nodeValue=n?"":C.memoizedProps}catch(Oe){Nt(C,C.return,Oe)}}}else if(t.tag===18){if(s===null){C=t;try{var ee=C.stateNode;n?_m(ee,!0):_m(C.stateNode,!1)}catch(Oe){Nt(C,C.return,Oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,gc(e,s))));break;case 19:Ha(t,e),qa(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gc(e,l)));break;case 30:break;case 21:break;default:Ha(t,e),qa(e)}}function qa(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Df(l)){s=l;break}l=l.return}if(s==null)throw Error(f(160));switch(s.tag){case 27:var n=s.stateNode,i=ru(e);mc(e,i,n);break;case 5:var u=s.stateNode;s.flags&32&&(Sl(u,""),s.flags&=-33);var p=ru(e);mc(e,p,u);break;case 3:case 4:var C=s.stateNode.containerInfo,Z=ru(e);nu(e,Z,C);break;default:throw Error(f(161))}}catch(le){Nt(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tf(e,t.alternate,t),t=t.sibling}function Tr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$l(4,t,t.return),Tr(t);break;case 1:$s(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&_f(t,t.return,s),Tr(t);break;case 27:Ui(t.stateNode);case 26:case 5:$s(t,t.return),Tr(t);break;case 22:t.memoizedState===null&&Tr(t);break;case 30:Tr(t);break;default:Tr(t)}e=e.sibling}}function pl(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,n=e,i=t,u=i.flags;switch(i.tag){case 0:case 11:case 15:pl(n,i,s),Mi(4,i);break;case 1:if(pl(n,i,s),l=i,n=l.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(Z){Nt(l,l.return,Z)}if(l=i,n=l.updateQueue,n!==null){var p=l.stateNode;try{var C=n.shared.hiddenCallbacks;if(C!==null)for(n.shared.hiddenCallbacks=null,n=0;n<C.length;n++)ec(C[n],p)}catch(Z){Nt(l,l.return,Z)}}s&&u&64&&kf(i),Ci(i,i.return);break;case 27:Mf(i);case 26:case 5:pl(n,i,s),s&&l===null&&u&4&&Sf(i),Ci(i,i.return);break;case 12:pl(n,i,s);break;case 31:pl(n,i,s),s&&u&4&&Lf(n,i);break;case 13:pl(n,i,s),s&&u&4&&Af(n,i);break;case 22:i.memoizedState===null&&pl(n,i,s),Ci(i,i.return);break;case 30:break;default:pl(n,i,s)}t=t.sibling}}function ou(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&yr(s))}function cu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yr(e))}function Ds(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rf(e,t,s,l),t=t.sibling}function Rf(e,t,s,l){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ds(e,t,s,l),n&2048&&Mi(9,t);break;case 1:Ds(e,t,s,l);break;case 3:Ds(e,t,s,l),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yr(e)));break;case 12:if(n&2048){Ds(e,t,s,l),e=t.stateNode;try{var i=t.memoizedProps,u=i.id,p=i.onPostCommit;typeof p=="function"&&p(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){Nt(t,t.return,C)}}else Ds(e,t,s,l);break;case 31:Ds(e,t,s,l);break;case 13:Ds(e,t,s,l);break;case 23:break;case 22:i=t.stateNode,u=t.alternate,t.memoizedState!==null?i._visibility&2?Ds(e,t,s,l):Ti(e,t):i._visibility&2?Ds(e,t,s,l):(i._visibility|=2,dn(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),n&2048&&ou(u,t);break;case 24:Ds(e,t,s,l),n&2048&&cu(t.alternate,t);break;default:Ds(e,t,s,l)}}function dn(e,t,s,l,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,u=t,p=s,C=l,Z=u.flags;switch(u.tag){case 0:case 11:case 15:dn(i,u,p,C,n),Mi(8,u);break;case 23:break;case 22:var le=u.stateNode;u.memoizedState!==null?le._visibility&2?dn(i,u,p,C,n):Ti(i,u):(le._visibility|=2,dn(i,u,p,C,n)),n&&Z&2048&&ou(u.alternate,u);break;case 24:dn(i,u,p,C,n),n&&Z&2048&&cu(u.alternate,u);break;default:dn(i,u,p,C,n)}t=t.sibling}}function Ti(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,n=l.flags;switch(l.tag){case 22:Ti(s,l),n&2048&&ou(l.alternate,l);break;case 24:Ti(s,l),n&2048&&cu(l.alternate,l);break;default:Ti(s,l)}t=t.sibling}}var Oi=8192;function un(e,t,s){if(e.subtreeFlags&Oi)for(e=e.child;e!==null;)Uf(e,t,s),e=e.sibling}function Uf(e,t,s){switch(e.tag){case 26:un(e,t,s),e.flags&Oi&&e.memoizedState!==null&&$g(s,Ss,e.memoizedState,e.memoizedProps);break;case 5:un(e,t,s);break;case 3:case 4:var l=Ss;Ss=Cc(e.stateNode.containerInfo),un(e,t,s),Ss=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Oi,Oi=16777216,un(e,t,s),Oi=l):un(e,t,s));break;default:un(e,t,s)}}function Hf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ei(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];ra=l,Bf(l,e)}Hf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qf(e),e=e.sibling}function qf(e){switch(e.tag){case 0:case 11:case 15:Ei(e),e.flags&2048&&$l(9,e,e.return);break;case 3:Ei(e);break;case 12:Ei(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,xc(e)):Ei(e);break;default:Ei(e)}}function xc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];ra=l,Bf(l,e)}Hf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$l(8,t,t.return),xc(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,xc(t));break;default:xc(t)}e=e.sibling}}function Bf(e,t){for(;ra!==null;){var s=ra;switch(s.tag){case 0:case 11:case 15:$l(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:yr(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,ra=l;else e:for(s=e;ra!==null;){l=ra;var n=l.sibling,i=l.return;if(Of(l),l===s){ra=null;break e}if(n!==null){n.return=i,ra=n;break e}ra=i}}}var rg={getCacheForType:function(e){var t=sa(Ht),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return sa(Ht).controller.signal}},ng=typeof WeakMap=="function"?WeakMap:Map,bt=0,Ct=null,rt=null,ot=0,jt=0,Wa=null,Ql=!1,hn=!1,du=!1,yl=0,$t=0,Zl=0,Or=0,uu=0,Ja=0,fn=0,Li=null,Ba=null,hu=!1,pc=0,Gf=0,yc=1/0,bc=null,Xl=null,la=0,Fl=null,mn=null,bl=0,fu=0,mu=null,Vf=null,Ai=0,gu=null;function Ka(){return(bt&2)!==0&&ot!==0?ot&-ot:q.T!==null?ju():Zt()}function $f(){if(Ja===0)if((ot&536870912)===0||st){var e=zt;zt<<=1,(zt&3932160)===0&&(zt=262144),Ja=e}else Ja=536870912;return e=ka.current,e!==null&&(e.flags|=32),Ja}function Ga(e,t,s){(e===Ct&&(jt===2||jt===9)||e.cancelPendingCommit!==null)&&(gn(e,0),Wl(e,ot,Ja,!1)),Qt(e,s),((bt&2)===0||e!==Ct)&&(e===Ct&&((bt&2)===0&&(Or|=s),$t===4&&Wl(e,ot,Ja,!1)),Qs(e))}function Qf(e,t,s){if((bt&6)!==0)throw Error(f(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ve(e,t),n=l?cg(e,t):pu(e,t,!0),i=l;do{if(n===0){hn&&!l&&Wl(e,t,0,!1);break}else{if(s=e.current.alternate,i&&!ig(s)){n=pu(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var p=e;n=Li;var C=p.current.memoizedState.isDehydrated;if(C&&(gn(p,u).flags|=256),u=pu(p,u,!1),u!==2){if(du&&!C){p.errorRecoveryDisabledLanes|=i,Or|=i,n=4;break e}i=Ba,Ba=n,i!==null&&(Ba===null?Ba=i:Ba.push.apply(Ba,i))}n=u}if(i=!1,n!==2)continue}}if(n===1){gn(e,0),Wl(e,t,0,!0);break}e:{switch(l=e,i=n,i){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t)break;case 6:Wl(l,t,Ja,!Ql);break e;case 2:Ba=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(n=pc+300-se(),10<n)){if(Wl(l,t,Ja,!Ql),ft(l,0,!0)!==0)break e;bl=t,l.timeoutHandle=Nm(Zf.bind(null,l,s,Ba,bc,hu,t,Ja,Or,fn,Ql,i,"Throttled",-0,0),n);break e}Zf(l,s,Ba,bc,hu,t,Ja,Or,fn,Ql,i,null,-0,0)}}break}while(!0);Qs(e)}function Zf(e,t,s,l,n,i,u,p,C,Z,le,ue,I,ee){if(e.timeoutHandle=-1,ue=t.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gs},Uf(t,i,ue);var Oe=(i&62914560)===i?pc-se():(i&4194048)===i?Gf-se():0;if(Oe=Qg(ue,Oe),Oe!==null){bl=i,e.cancelPendingCommit=Oe(em.bind(null,e,t,i,s,l,n,u,p,C,le,ue,null,I,ee)),Wl(e,i,u,!Z);return}}em(e,t,i,s,l,n,u,p,C)}function ig(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var n=s[l],i=n.getSnapshot;n=n.value;try{if(!na(i(),n))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wl(e,t,s,l){t&=~uu,t&=~Or,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var n=t;0<n;){var i=31-wt(n),u=1<<i;l[i]=-1,n&=~u}s!==0&&Ks(e,s,t)}function vc(){return(bt&6)===0?(Yi(0),!1):!0}function xu(){if(rt!==null){if(jt===0)var e=rt.return;else e=rt,Ns=js=null,Ed(e),Vl=null,Nr=0,e=rt;for(;e!==null;)wf(e.alternate,e),e=e.return;rt=null}}function gn(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Dg(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),bl=0,xu(),Ct=e,rt=s=ys(e.current,null),ot=t,jt=0,Wa=null,Ql=!1,hn=ve(e,t),du=!1,fn=Ja=uu=Or=Zl=$t=0,Ba=Li=null,hu=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var n=31-wt(l),i=1<<n;t|=e[n],l&=~i}return yl=t,Wr(),s}function Xf(e,t){$e=null,q.H=_i,t===il||t===sn?(t=Po(),jt=3):t===jr?(t=Po(),jt=4):jt=t===Fd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wa=t,rt===null&&($t=1,cc(e,ia(t,e.current)))}function Ff(){var e=ka.current;return e===null?!0:(ot&4194048)===ot?Ra===null:(ot&62914560)===ot||(ot&536870912)!==0?e===Ra:!1}function Wf(){var e=q.H;return q.H=_i,e===null?_i:e}function Jf(){var e=q.A;return q.A=rg,e}function jc(){$t=4,Ql||(ot&4194048)!==ot&&ka.current!==null||(hn=!0),(Zl&134217727)===0&&(Or&134217727)===0||Ct===null||Wl(Ct,ot,Ja,!1)}function pu(e,t,s){var l=bt;bt|=2;var n=Wf(),i=Jf();(Ct!==e||ot!==t)&&(bc=null,gn(e,t)),t=!1;var u=$t;e:do try{if(jt!==0&&rt!==null){var p=rt,C=Wa;switch(jt){case 8:xu(),u=6;break e;case 3:case 2:case 9:case 6:ka.current===null&&(t=!0);var Z=jt;if(jt=0,Wa=null,xn(e,p,C,Z),s&&hn){u=0;break e}break;default:Z=jt,jt=0,Wa=null,xn(e,p,C,Z)}}og(),u=$t;break}catch(le){Xf(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ns=js=null,bt=l,q.H=n,q.A=i,rt===null&&(Ct=null,ot=0,Wr()),u}function og(){for(;rt!==null;)Kf(rt)}function cg(e,t){var s=bt;bt|=2;var l=Wf(),n=Jf();Ct!==e||ot!==t?(bc=null,yc=se()+500,gn(e,t)):hn=ve(e,t);e:do try{if(jt!==0&&rt!==null){t=rt;var i=Wa;t:switch(jt){case 1:jt=0,Wa=null,xn(e,t,i,1);break;case 2:case 9:if(Ko(i)){jt=0,Wa=null,If(t);break}t=function(){jt!==2&&jt!==9||Ct!==e||(jt=7),Qs(e)},i.then(t,t);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:Ko(i)?(jt=0,Wa=null,If(t)):(jt=0,Wa=null,xn(e,t,i,7));break;case 5:var u=null;switch(rt.tag){case 26:u=rt.memoizedState;case 5:case 27:var p=rt;if(u?Rm(u):p.stateNode.complete){jt=0,Wa=null;var C=p.sibling;if(C!==null)rt=C;else{var Z=p.return;Z!==null?(rt=Z,Nc(Z)):rt=null}break t}}jt=0,Wa=null,xn(e,t,i,5);break;case 6:jt=0,Wa=null,xn(e,t,i,6);break;case 8:xu(),$t=6;break e;default:throw Error(f(462))}}dg();break}catch(le){Xf(e,le)}while(!0);return Ns=js=null,q.H=l,q.A=n,bt=s,rt!==null?0:(Ct=null,ot=0,Wr(),$t)}function dg(){for(;rt!==null&&!ea();)Kf(rt)}function Kf(e){var t=jf(e.alternate,e,yl);e.memoizedProps=e.pendingProps,t===null?Nc(e):rt=t}function If(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=gf(s,t,t.pendingProps,t.type,void 0,ot);break;case 11:t=gf(s,t,t.pendingProps,t.type.render,t.ref,ot);break;case 5:Ed(t);default:wf(s,t),t=rt=Go(t,yl),t=jf(s,t,yl)}e.memoizedProps=e.pendingProps,t===null?Nc(e):rt=t}function xn(e,t,s,l){Ns=js=null,Ed(t),Vl=null,Nr=0;var n=t.return;try{if(I0(e,n,t,s,ot)){$t=1,cc(e,ia(s,e.current)),rt=null;return}}catch(i){if(n!==null)throw rt=n,i;$t=1,cc(e,ia(s,e.current)),rt=null;return}t.flags&32768?(st||l===1?e=!0:hn||(ot&536870912)!==0?e=!1:(Ql=e=!0,(l===2||l===9||l===3||l===6)&&(l=ka.current,l!==null&&l.tag===13&&(l.flags|=16384))),Pf(t,e)):Nc(t)}function Nc(e){var t=e;do{if((t.flags&32768)!==0){Pf(t,Ql);return}e=t.return;var s=tg(t.alternate,t,yl);if(s!==null){rt=s;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);$t===0&&($t=5)}function Pf(e,t){do{var s=ag(e.alternate,e);if(s!==null){s.flags&=32767,rt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){rt=e;return}rt=e=s}while(e!==null);$t=6,rt=null}function em(e,t,s,l,n,i,u,p,C){e.cancelPendingCommit=null;do wc();while(la!==0);if((bt&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));if(i=t.lanes|t.childLanes,i|=si,Ke(e,s,i,u,p,C),e===Ct&&(rt=Ct=null,ot=0),mn=t,Fl=e,bl=s,fu=i,mu=n,Vf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mg(he,function(){return rm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=q.T,q.T=null,n=ie.p,ie.p=2,u=bt,bt|=4;try{sg(e,t,s)}finally{bt=u,ie.p=n,q.T=l}}la=1,tm(),am(),sm()}}function tm(){if(la===1){la=0;var e=Fl,t=mn,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var l=ie.p;ie.p=2;var n=bt;bt|=4;try{Yf(t,e);var i=Cu,u=zo(e.containerInfo),p=i.focusedElem,C=i.selectionRange;if(u!==p&&p&&p.ownerDocument&&Yo(p.ownerDocument.documentElement,p)){if(C!==null&&Jn(p)){var Z=C.start,le=C.end;if(le===void 0&&(le=Z),"selectionStart"in p)p.selectionStart=Z,p.selectionEnd=Math.min(le,p.value.length);else{var ue=p.ownerDocument||document,I=ue&&ue.defaultView||window;if(I.getSelection){var ee=I.getSelection(),Oe=p.textContent.length,He=Math.min(C.start,Oe),St=C.end===void 0?He:Math.min(C.end,Oe);!ee.extend&&He>St&&(u=St,St=He,He=u);var B=Ao(p,He),A=Ao(p,St);if(B&&A&&(ee.rangeCount!==1||ee.anchorNode!==B.node||ee.anchorOffset!==B.offset||ee.focusNode!==A.node||ee.focusOffset!==A.offset)){var Q=ue.createRange();Q.setStart(B.node,B.offset),ee.removeAllRanges(),He>St?(ee.addRange(Q),ee.extend(A.node,A.offset)):(Q.setEnd(A.node,A.offset),ee.addRange(Q))}}}}for(ue=[],ee=p;ee=ee.parentNode;)ee.nodeType===1&&ue.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<ue.length;p++){var oe=ue[p];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Yc=!!Mu,Cu=Mu=null}finally{bt=n,ie.p=l,q.T=s}}e.current=t,la=2}}function am(){if(la===2){la=0;var e=Fl,t=mn,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var l=ie.p;ie.p=2;var n=bt;bt|=4;try{Tf(e,t.alternate,t)}finally{bt=n,ie.p=l,q.T=s}}la=3}}function sm(){if(la===4||la===3){la=0,ke();var e=Fl,t=mn,s=bl,l=Vf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?la=5:(la=0,mn=Fl=null,lm(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Xl=null),dt(s),t=t.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(ta,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=q.T,n=ie.p,ie.p=2,q.T=null;try{for(var i=e.onRecoverableError,u=0;u<l.length;u++){var p=l[u];i(p.value,{componentStack:p.stack})}}finally{q.T=t,ie.p=n}}(bl&3)!==0&&wc(),Qs(e),n=e.pendingLanes,(s&261930)!==0&&(n&42)!==0?e===gu?Ai++:(Ai=0,gu=e):Ai=0,Yi(0)}}function lm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,yr(t)))}function wc(){return tm(),am(),sm(),rm()}function rm(){if(la!==5)return!1;var e=Fl,t=fu;fu=0;var s=dt(bl),l=q.T,n=ie.p;try{ie.p=32>s?32:s,q.T=null,s=mu,mu=null;var i=Fl,u=bl;if(la=0,mn=Fl=null,bl=0,(bt&6)!==0)throw Error(f(331));var p=bt;if(bt|=4,qf(i.current),Rf(i,i.current,u,s),bt=p,Yi(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(ta,i)}catch{}return!0}finally{ie.p=n,q.T=l,lm(e,t)}}function nm(e,t,s){t=ia(s,t),t=Xd(e.stateNode,t,2),e=Gs(e,t,2),e!==null&&(Qt(e,2),Qs(e))}function Nt(e,t,s){if(e.tag===3)nm(e,e,s);else for(;t!==null;){if(t.tag===3){nm(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Xl===null||!Xl.has(l))){e=ia(s,e),s=nf(2),l=Gs(t,s,2),l!==null&&(of(s,l,t,e),Qt(l,2),Qs(l));break}}t=t.return}}function yu(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new ng;var n=new Set;l.set(t,n)}else n=l.get(t),n===void 0&&(n=new Set,l.set(t,n));n.has(s)||(du=!0,n.add(s),e=ug.bind(null,e,t,s),t.then(e,e))}function ug(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ct===e&&(ot&s)===s&&($t===4||$t===3&&(ot&62914560)===ot&&300>se()-pc?(bt&2)===0&&gn(e,0):uu|=s,fn===ot&&(fn=0)),Qs(e)}function im(e,t){t===0&&(t=sr()),e=tl(e,t),e!==null&&(Qt(e,t),Qs(e))}function hg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),im(e,s)}function fg(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,n=e.memoizedState;n!==null&&(s=n.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(f(314))}l!==null&&l.delete(t),im(e,s)}function mg(e,t){return Vt(e,t)}var kc=null,pn=null,bu=!1,_c=!1,vu=!1,Jl=0;function Qs(e){e!==pn&&e.next===null&&(pn===null?kc=pn=e:pn=pn.next=e),_c=!0,bu||(bu=!0,xg())}function Yi(e,t){if(!vu&&_c){vu=!0;do for(var s=!1,l=kc;l!==null;){if(e!==0){var n=l.pendingLanes;if(n===0)var i=0;else{var u=l.suspendedLanes,p=l.pingedLanes;i=(1<<31-wt(42|e)+1)-1,i&=n&~(u&~p),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(s=!0,um(l,i))}else i=ot,i=ft(l,l===Ct?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||ve(l,i)||(s=!0,um(l,i));l=l.next}while(s);vu=!1}}function gg(){om()}function om(){_c=bu=!1;var e=0;Jl!==0&&Sg()&&(e=Jl);for(var t=se(),s=null,l=kc;l!==null;){var n=l.next,i=cm(l,t);i===0?(l.next=null,s===null?kc=n:s.next=n,n===null&&(pn=s)):(s=l,(e!==0||(i&3)!==0)&&(_c=!0)),l=n}la!==0&&la!==5||Yi(e),Jl!==0&&(Jl=0)}function cm(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var u=31-wt(i),p=1<<u,C=n[u];C===-1?((p&s)===0||(p&l)!==0)&&(n[u]=Tt(p,t)):C<=t&&(e.expiredLanes|=p),i&=~p}if(t=Ct,s=ot,s=ft(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(jt===2||jt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&yt(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ve(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&yt(l),dt(s)){case 2:case 8:s=ht;break;case 32:s=he;break;case 268435456:s=Ve;break;default:s=he}return l=dm.bind(null,e),s=Vt(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&yt(l),e.callbackPriority=2,e.callbackNode=null,2}function dm(e,t){if(la!==0&&la!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(wc()&&e.callbackNode!==s)return null;var l=ot;return l=ft(e,e===Ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Qf(e,l,t),cm(e,se()),e.callbackNode!=null&&e.callbackNode===s?dm.bind(null,e):null)}function um(e,t){if(wc())return null;Qf(e,t,!0)}function xg(){Mg(function(){(bt&6)!==0?Vt(Ee,gg):om()})}function ju(){if(Jl===0){var e=rl;e===0&&(e=Ze,Ze<<=1,(Ze&261888)===0&&(Ze=256)),Jl=e}return Jl}function hm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Dl(""+e)}function fm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function pg(e,t,s,l,n){if(t==="submit"&&s&&s.stateNode===n){var i=hm((n[Ot]||null).action),u=l.submitter;u&&(t=(t=u[Ot]||null)?hm(t.formAction):u.getAttribute("formAction"),t!==null&&(i=t,u=null));var p=new ir("action","action",null,l,n);e.push({event:p,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Jl!==0){var C=u?fm(n,u):new FormData(n);Bd(s,{pending:!0,data:C,method:n.method,action:i},null,C)}}else typeof i=="function"&&(p.preventDefault(),C=u?fm(n,u):new FormData(n),Bd(s,{pending:!0,data:C,method:n.method,action:i},i,C))},currentTarget:n}]})}}for(var Nu=0;Nu<ai.length;Nu++){var wu=ai[Nu],yg=wu.toLowerCase(),bg=wu[0].toUpperCase()+wu.slice(1);Za(yg,"on"+bg)}Za(Ro,"onAnimationEnd"),Za(ei,"onAnimationIteration"),Za(ti,"onAnimationStart"),Za("dblclick","onDoubleClick"),Za("focusin","onFocus"),Za("focusout","onBlur"),Za(Sd,"onTransitionRun"),Za(Dd,"onTransitionStart"),Za(Uo,"onTransitionCancel"),Za(Ho,"onTransitionEnd"),_l("onMouseEnter",["mouseout","mouseover"]),_l("onMouseLeave",["mouseout","mouseover"]),_l("onPointerEnter",["pointerout","pointerover"]),_l("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),vg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zi));function mm(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],n=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var u=l.length-1;0<=u;u--){var p=l[u],C=p.instance,Z=p.currentTarget;if(p=p.listener,C!==i&&n.isPropagationStopped())break e;i=p,n.currentTarget=Z;try{i(n)}catch(le){Fr(le)}n.currentTarget=null,i=C}else for(u=0;u<l.length;u++){if(p=l[u],C=p.instance,Z=p.currentTarget,p=p.listener,C!==i&&n.isPropagationStopped())break e;i=p,n.currentTarget=Z;try{i(n)}catch(le){Fr(le)}n.currentTarget=null,i=C}}}}function nt(e,t){var s=t[hs];s===void 0&&(s=t[hs]=new Set);var l=e+"__bubble";s.has(l)||(gm(t,e,2,!1),s.add(l))}function ku(e,t,s){var l=0;t&&(l|=4),gm(s,e,l,t)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function _u(e){if(!e[Sc]){e[Sc]=!0,no.forEach(function(s){s!=="selectionchange"&&(vg.has(s)||ku(s,!1,e),ku(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sc]||(t[Sc]=!0,ku("selectionchange",!1,t))}}function gm(e,t,s,l){switch($m(t)){case 2:var n=Fg;break;case 8:n=Wg;break;default:n=qu}s=n.bind(null,t,s,e),n=void 0,!zn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),l?n!==void 0?e.addEventListener(t,s,{capture:!0,passive:n}):e.addEventListener(t,s,!0):n!==void 0?e.addEventListener(t,s,{passive:n}):e.addEventListener(t,s,!1)}function Su(e,t,s,l,n){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var u=l.tag;if(u===3||u===4){var p=l.stateNode.containerInfo;if(p===n)break;if(u===4)for(u=l.return;u!==null;){var C=u.tag;if((C===3||C===4)&&u.stateNode.containerInfo===n)return;u=u.return}for(;p!==null;){if(u=Qa(p),u===null)return;if(C=u.tag,C===5||C===6||C===26||C===27){l=i=u;continue e}p=p.parentNode}}l=l.return}po(function(){var Z=i,le=An(s),ue=[];e:{var I=qo.get(e);if(I!==void 0){var ee=ir,Oe=e;switch(e){case"keypress":if(Gr(s)===0)break e;case"keydown":case"keyup":ee=$n;break;case"focusin":Oe="focus",ee=qn;break;case"focusout":Oe="blur",ee=qn;break;case"beforeblur":case"afterblur":ee=qn;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=El;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=id;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=jo;break;case Ro:case ei:case ti:ee=$r;break;case Ho:ee=xd;break;case"scroll":case"scrollend":ee=nd;break;case"wheel":ee=yd;break;case"copy":case"cut":case"paste":ee=Bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=vo;break;case"toggle":case"beforetoggle":ee=No}var He=(t&4)!==0,St=!He&&(e==="scroll"||e==="scrollend"),B=He?I!==null?I+"Capture":null:I;He=[];for(var A=Z,Q;A!==null;){var oe=A;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||B===null||(oe=rr(A,B),oe!=null&&He.push(Ri(A,oe,Q))),St)break;A=A.return}0<He.length&&(I=new ee(I,Oe,null,s,le),ue.push({event:I,listeners:He}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",I&&s!==qr&&(Oe=s.relatedTarget||s.fromElement)&&(Qa(Oe)||Oe[ma]))break e;if((ee||I)&&(I=le.window===le?le:(I=le.ownerDocument)?I.defaultView||I.parentWindow:window,ee?(Oe=s.relatedTarget||s.toElement,ee=Z,Oe=Oe?Qa(Oe):null,Oe!==null&&(St=v(Oe),He=Oe.tag,Oe!==St||He!==5&&He!==27&&He!==6)&&(Oe=null)):(ee=null,Oe=Z),ee!==Oe)){if(He=El,oe="onMouseLeave",B="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(He=vo,oe="onPointerLeave",B="onPointerEnter",A="pointer"),St=ee==null?I:wl(ee),Q=Oe==null?I:wl(Oe),I=new He(oe,A+"leave",ee,s,le),I.target=St,I.relatedTarget=Q,oe=null,Qa(le)===Z&&(He=new He(B,A+"enter",Oe,s,le),He.target=Q,He.relatedTarget=St,oe=He),St=oe,ee&&Oe)t:{for(He=jg,B=ee,A=Oe,Q=0,oe=B;oe;oe=He(oe))Q++;oe=0;for(var Ue=A;Ue;Ue=He(Ue))oe++;for(;0<Q-oe;)B=He(B),Q--;for(;0<oe-Q;)A=He(A),oe--;for(;Q--;){if(B===A||A!==null&&B===A.alternate){He=B;break t}B=He(B),A=He(A)}He=null}else He=null;ee!==null&&xm(ue,I,ee,He,!1),Oe!==null&&St!==null&&xm(ue,St,Oe,He,!0)}}e:{if(I=Z?wl(Z):window,ee=I.nodeName&&I.nodeName.toLowerCase(),ee==="select"||ee==="input"&&I.type==="file")var gt=To;else if(kt(I))if(Yl)gt=kd;else{gt=wd;var Le=Fn}else ee=I.nodeName,!ee||ee.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?Z&&Ln(Z.elementType)&&(gt=To):gt=Eo;if(gt&&(gt=gt(e,Z))){Co(ue,gt,s,le);break e}Le&&Le(e,I,Z),e==="focusout"&&Z&&I.type==="number"&&Z.memoizedProps.value!=null&&Hr(I,"number",I.value)}switch(Le=Z?wl(Z):window,e){case"focusin":(kt(Le)||Le.contentEditable==="true")&&(zl=Le,Kn=Z,mr=null);break;case"focusout":mr=Kn=zl=null;break;case"mousedown":In=!0;break;case"contextmenu":case"mouseup":case"dragend":In=!1,Pn(ue,s,le);break;case"selectionchange":if(_d)break;case"keydown":case"keyup":Pn(ue,s,le)}var Pe;if(As)e:{switch(e){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Ll?_o(e,s)&&(ct="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ct="onCompositionStart");ct&&(wo&&s.locale!=="ko"&&(Ll||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Ll&&(Pe=yo()):(Os=le,Rn="value"in Os?Os.value:Os.textContent,Ll=!0)),Le=Dc(Z,ct),0<Le.length&&(ct=new ts(ct,e,null,s,le),ue.push({event:ct,listeners:Le}),Pe?ct.data=Pe:(Pe=So(s),Pe!==null&&(ct.data=Pe)))),(Pe=Qn?Do(e,s):jd(e,s))&&(ct=Dc(Z,"onBeforeInput"),0<ct.length&&(Le=new ts("onBeforeInput","beforeinput",null,s,le),ue.push({event:Le,listeners:ct}),Le.data=Pe)),pg(ue,e,Z,s,le)}mm(ue,t)})}function Ri(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Dc(e,t){for(var s=t+"Capture",l=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=rr(e,s),n!=null&&l.unshift(Ri(e,n,i)),n=rr(e,t),n!=null&&l.push(Ri(e,n,i))),e.tag===3)return l;e=e.return}return[]}function jg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xm(e,t,s,l,n){for(var i=t._reactName,u=[];s!==null&&s!==l;){var p=s,C=p.alternate,Z=p.stateNode;if(p=p.tag,C!==null&&C===l)break;p!==5&&p!==26&&p!==27||Z===null||(C=Z,n?(Z=rr(s,i),Z!=null&&u.unshift(Ri(s,Z,C))):n||(Z=rr(s,i),Z!=null&&u.push(Ri(s,Z,C)))),s=s.return}u.length!==0&&e.push({event:t,listeners:u})}var Ng=/\r\n?/g,wg=/\u0000|\uFFFD/g;function pm(e){return(typeof e=="string"?e:""+e).replace(Ng,`
`).replace(wg,"")}function ym(e,t){return t=pm(t),pm(e)===t}function _t(e,t,s,l,n,i){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Sl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Sl(e,""+l);break;case"className":Rr(e,"class",l);break;case"tabIndex":Rr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Rr(e,s,l);break;case"style":go(e,l,i);break;case"data":if(t!=="object"){Rr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Dl(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(s==="formAction"?(t!=="input"&&_t(e,t,"name",n.name,n,null),_t(e,t,"formEncType",n.formEncType,n,null),_t(e,t,"formMethod",n.formMethod,n,null),_t(e,t,"formTarget",n.formTarget,n,null)):(_t(e,t,"encType",n.encType,n,null),_t(e,t,"method",n.method,n,null),_t(e,t,"target",n.target,n,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Dl(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=gs);break;case"onScroll":l!=null&&nt("scroll",e);break;case"onScrollEnd":l!=null&&nt("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(s=l.__html,s!=null){if(n.children!=null)throw Error(f(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Dl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":nt("beforetoggle",e),nt("toggle",e),zr(e,"popover",l);break;case"xlinkActuate":ms(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ms(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ms(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ms(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ms(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ms(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ms(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ms(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ms(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=ld.get(s)||s,zr(e,s,l))}}function Du(e,t,s,l,n,i){switch(s){case"style":go(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(s=l.__html,s!=null){if(n.children!=null)throw Error(f(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Sl(e,l):(typeof l=="number"||typeof l=="bigint")&&Sl(e,""+l);break;case"onScroll":l!=null&&nt("scroll",e);break;case"onScrollEnd":l!=null&&nt("scrollend",e);break;case"onClick":l!=null&&(e.onclick=gs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rt.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(n=s.endsWith("Capture"),t=s.slice(2,n?s.length-7:void 0),i=e[Ot]||null,i=i!=null?i[s]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof l=="function")){typeof i!="function"&&i!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,n);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):zr(e,s,l)}}}function ua(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var l=!1,n=!1,i;for(i in s)if(s.hasOwnProperty(i)){var u=s[i];if(u!=null)switch(i){case"src":l=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:_t(e,t,i,u,s,null)}}n&&_t(e,t,"srcSet",s.srcSet,s,null),l&&_t(e,t,"src",s.src,s,null);return;case"input":nt("invalid",e);var p=i=u=n=null,C=null,Z=null;for(l in s)if(s.hasOwnProperty(l)){var le=s[l];if(le!=null)switch(l){case"name":n=le;break;case"type":u=le;break;case"checked":C=le;break;case"defaultChecked":Z=le;break;case"value":i=le;break;case"defaultValue":p=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(f(137,t));break;default:_t(e,t,l,le,s,null)}}lr(e,i,p,C,Z,u,n,!1);return;case"select":nt("invalid",e),l=u=i=null;for(n in s)if(s.hasOwnProperty(n)&&(p=s[n],p!=null))switch(n){case"value":i=p;break;case"defaultValue":u=p;break;case"multiple":l=p;default:_t(e,t,n,p,s,null)}t=i,s=u,e.multiple=!!l,t!=null?Pa(e,!!l,t,!1):s!=null&&Pa(e,!!l,s,!0);return;case"textarea":nt("invalid",e),i=n=l=null;for(u in s)if(s.hasOwnProperty(u)&&(p=s[u],p!=null))switch(u){case"value":l=p;break;case"defaultValue":n=p;break;case"children":i=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(f(91));break;default:_t(e,t,u,p,s,null)}fo(e,l,n,i);return;case"option":for(C in s)if(s.hasOwnProperty(C)&&(l=s[C],l!=null))switch(C){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:_t(e,t,C,l,s,null)}return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(l=0;l<zi.length;l++)nt(zi[l],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in s)if(s.hasOwnProperty(Z)&&(l=s[Z],l!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:_t(e,t,Z,l,s,null)}return;default:if(Ln(t)){for(le in s)s.hasOwnProperty(le)&&(l=s[le],l!==void 0&&Du(e,t,le,l,s,void 0));return}}for(p in s)s.hasOwnProperty(p)&&(l=s[p],l!=null&&_t(e,t,p,l,s,null))}function kg(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,u=null,p=null,C=null,Z=null,le=null;for(ee in s){var ue=s[ee];if(s.hasOwnProperty(ee)&&ue!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":C=ue;default:l.hasOwnProperty(ee)||_t(e,t,ee,null,l,ue)}}for(var I in l){var ee=l[I];if(ue=s[I],l.hasOwnProperty(I)&&(ee!=null||ue!=null))switch(I){case"type":i=ee;break;case"name":n=ee;break;case"checked":Z=ee;break;case"defaultChecked":le=ee;break;case"value":u=ee;break;case"defaultValue":p=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(f(137,t));break;default:ee!==ue&&_t(e,t,I,ee,l,ue)}}Is(e,u,p,C,Z,le,i,n);return;case"select":ee=u=p=I=null;for(i in s)if(C=s[i],s.hasOwnProperty(i)&&C!=null)switch(i){case"value":break;case"multiple":ee=C;default:l.hasOwnProperty(i)||_t(e,t,i,null,l,C)}for(n in l)if(i=l[n],C=s[n],l.hasOwnProperty(n)&&(i!=null||C!=null))switch(n){case"value":I=i;break;case"defaultValue":p=i;break;case"multiple":u=i;default:i!==C&&_t(e,t,n,i,l,C)}t=p,s=u,l=ee,I!=null?Pa(e,!!s,I,!1):!!l!=!!s&&(t!=null?Pa(e,!!s,t,!0):Pa(e,!!s,s?[]:"",!1));return;case"textarea":ee=I=null;for(p in s)if(n=s[p],s.hasOwnProperty(p)&&n!=null&&!l.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:_t(e,t,p,null,l,n)}for(u in l)if(n=l[u],i=s[u],l.hasOwnProperty(u)&&(n!=null||i!=null))switch(u){case"value":I=n;break;case"defaultValue":ee=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(f(91));break;default:n!==i&&_t(e,t,u,n,l,i)}es(e,I,ee);return;case"option":for(var Oe in s)if(I=s[Oe],s.hasOwnProperty(Oe)&&I!=null&&!l.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:_t(e,t,Oe,null,l,I)}for(C in l)if(I=l[C],ee=s[C],l.hasOwnProperty(C)&&I!==ee&&(I!=null||ee!=null))switch(C){case"selected":e.selected=I&&typeof I!="function"&&typeof I!="symbol";break;default:_t(e,t,C,I,l,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in s)I=s[He],s.hasOwnProperty(He)&&I!=null&&!l.hasOwnProperty(He)&&_t(e,t,He,null,l,I);for(Z in l)if(I=l[Z],ee=s[Z],l.hasOwnProperty(Z)&&I!==ee&&(I!=null||ee!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(f(137,t));break;default:_t(e,t,Z,I,l,ee)}return;default:if(Ln(t)){for(var St in s)I=s[St],s.hasOwnProperty(St)&&I!==void 0&&!l.hasOwnProperty(St)&&Du(e,t,St,void 0,l,I);for(le in l)I=l[le],ee=s[le],!l.hasOwnProperty(le)||I===ee||I===void 0&&ee===void 0||Du(e,t,le,I,l,ee);return}}for(var B in s)I=s[B],s.hasOwnProperty(B)&&I!=null&&!l.hasOwnProperty(B)&&_t(e,t,B,null,l,I);for(ue in l)I=l[ue],ee=s[ue],!l.hasOwnProperty(ue)||I===ee||I==null&&ee==null||_t(e,t,ue,I,l,ee)}function bm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _g(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var n=s[l],i=n.transferSize,u=n.initiatorType,p=n.duration;if(i&&p&&bm(u)){for(u=0,p=n.responseEnd,l+=1;l<s.length;l++){var C=s[l],Z=C.startTime;if(Z>p)break;var le=C.transferSize,ue=C.initiatorType;le&&bm(ue)&&(C=C.responseEnd,u+=le*(C<p?1:(p-Z)/(C-Z)))}if(--l,t+=8*(i+u)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mu=null,Cu=null;function Mc(e){return e.nodeType===9?e:e.ownerDocument}function vm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Tu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ou=null;function Sg(){var e=window.event;return e&&e.type==="popstate"?e===Ou?!1:(Ou=e,!0):(Ou=null,!1)}var Nm=typeof setTimeout=="function"?setTimeout:void 0,Dg=typeof clearTimeout=="function"?clearTimeout:void 0,wm=typeof Promise=="function"?Promise:void 0,Mg=typeof queueMicrotask=="function"?queueMicrotask:typeof wm<"u"?function(e){return wm.resolve(null).then(e).catch(Cg)}:Nm;function Cg(e){setTimeout(function(){throw e})}function Kl(e){return e==="head"}function km(e,t){var s=t,l=0;do{var n=s.nextSibling;if(e.removeChild(s),n&&n.nodeType===8)if(s=n.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(n),jn(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ui(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ui(s);for(var i=s.firstChild;i;){var u=i.nextSibling,p=i.nodeName;i[Nl]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&i.rel.toLowerCase()==="stylesheet"||s.removeChild(i),i=u}}else s==="body"&&Ui(e.ownerDocument.body);s=n}while(s);jn(t)}function _m(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Eu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Eu(s),Cn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Tg(e,t,s,l){for(;e.nodeType===1;){var n=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Nl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=cs(e.nextSibling),e===null)break}return null}function Og(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=cs(e.nextSibling),e===null))return null;return e}function Sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=cs(e.nextSibling),e===null))return null;return e}function Lu(e){return e.data==="$?"||e.data==="$~"}function Au(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Eg(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function cs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Yu=null;function Dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return cs(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Mm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Cm(e,t,s){switch(t=Mc(s),e){case"html":if(e=t.documentElement,!e)throw Error(f(452));return e;case"head":if(e=t.head,!e)throw Error(f(453));return e;case"body":if(e=t.body,!e)throw Error(f(454));return e;default:throw Error(f(451))}}function Ui(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cn(e)}var ds=new Map,Tm=new Set;function Cc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vl=ie.d;ie.d={f:Lg,r:Ag,D:Yg,C:zg,L:Rg,m:Ug,X:qg,S:Hg,M:Bg};function Lg(){var e=vl.f(),t=vc();return e||t}function Ag(e){var t=Ia(e);t!==null&&t.tag===5&&t.type==="form"?Zh(t):vl.r(e)}var yn=typeof document>"u"?null:document;function Om(e,t,s){var l=yn;if(l&&typeof t=="string"&&t){var n=La(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof s=="string"&&(n+='[crossorigin="'+s+'"]'),Tm.has(n)||(Tm.add(n),e={rel:e,crossOrigin:s,href:t},l.querySelector(n)===null&&(t=l.createElement("link"),ua(t,"link",e),Wt(t),l.head.appendChild(t)))}}function Yg(e){vl.D(e),Om("dns-prefetch",e,null)}function zg(e,t){vl.C(e,t),Om("preconnect",e,t)}function Rg(e,t,s){vl.L(e,t,s);var l=yn;if(l&&e&&t){var n='link[rel="preload"][as="'+La(t)+'"]';t==="image"&&s&&s.imageSrcSet?(n+='[imagesrcset="'+La(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(n+='[imagesizes="'+La(s.imageSizes)+'"]')):n+='[href="'+La(e)+'"]';var i=n;switch(t){case"style":i=bn(e);break;case"script":i=vn(e)}ds.has(i)||(e=O({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ds.set(i,e),l.querySelector(n)!==null||t==="style"&&l.querySelector(Hi(i))||t==="script"&&l.querySelector(qi(i))||(t=l.createElement("link"),ua(t,"link",e),Wt(t),l.head.appendChild(t)))}}function Ug(e,t){vl.m(e,t);var s=yn;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+La(l)+'"][href="'+La(e)+'"]',i=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=vn(e)}if(!ds.has(i)&&(e=O({rel:"modulepreload",href:e},t),ds.set(i,e),s.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(qi(i)))return}l=s.createElement("link"),ua(l,"link",e),Wt(l),s.head.appendChild(l)}}}function Hg(e,t,s){vl.S(e,t,s);var l=yn;if(l&&e){var n=kl(l).hoistableStyles,i=bn(e);t=t||"default";var u=n.get(i);if(!u){var p={loading:0,preload:null};if(u=l.querySelector(Hi(i)))p.loading=5;else{e=O({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ds.get(i))&&zu(e,s);var C=u=l.createElement("link");Wt(C),ua(C,"link",e),C._p=new Promise(function(Z,le){C.onload=Z,C.onerror=le}),C.addEventListener("load",function(){p.loading|=1}),C.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Tc(u,t,l)}u={type:"stylesheet",instance:u,count:1,state:p},n.set(i,u)}}}function qg(e,t){vl.X(e,t);var s=yn;if(s&&e){var l=kl(s).hoistableScripts,n=vn(e),i=l.get(n);i||(i=s.querySelector(qi(n)),i||(e=O({src:e,async:!0},t),(t=ds.get(n))&&Ru(e,t),i=s.createElement("script"),Wt(i),ua(i,"link",e),s.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function Bg(e,t){vl.M(e,t);var s=yn;if(s&&e){var l=kl(s).hoistableScripts,n=vn(e),i=l.get(n);i||(i=s.querySelector(qi(n)),i||(e=O({src:e,async:!0,type:"module"},t),(t=ds.get(n))&&Ru(e,t),i=s.createElement("script"),Wt(i),ua(i,"link",e),s.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function Em(e,t,s,l){var n=(n=Te.current)?Cc(n):null;if(!n)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=bn(s.href),s=kl(n).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=bn(s.href);var i=kl(n).hoistableStyles,u=i.get(e);if(u||(n=n.ownerDocument||n,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,u),(i=n.querySelector(Hi(e)))&&!i._p&&(u.instance=i,u.state.loading=5),ds.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ds.set(e,s),i||Gg(n,e,s,u.state))),t&&l===null)throw Error(f(528,""));return u}if(t&&l!==null)throw Error(f(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=vn(s),s=kl(n).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function bn(e){return'href="'+La(e)+'"'}function Hi(e){return'link[rel="stylesheet"]['+e+"]"}function Lm(e){return O({},e,{"data-precedence":e.precedence,precedence:null})}function Gg(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ua(t,"link",s),Wt(t),e.head.appendChild(t))}function vn(e){return'[src="'+La(e)+'"]'}function qi(e){return"script[async]"+e}function Am(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+La(s.href)+'"]');if(l)return t.instance=l,Wt(l),l;var n=O({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Wt(l),ua(l,"style",n),Tc(l,s.precedence,e),t.instance=l;case"stylesheet":n=bn(s.href);var i=e.querySelector(Hi(n));if(i)return t.state.loading|=4,t.instance=i,Wt(i),i;l=Lm(s),(n=ds.get(n))&&zu(l,n),i=(e.ownerDocument||e).createElement("link"),Wt(i);var u=i;return u._p=new Promise(function(p,C){u.onload=p,u.onerror=C}),ua(i,"link",l),t.state.loading|=4,Tc(i,s.precedence,e),t.instance=i;case"script":return i=vn(s.src),(n=e.querySelector(qi(i)))?(t.instance=n,Wt(n),n):(l=s,(n=ds.get(i))&&(l=O({},s),Ru(l,n)),e=e.ownerDocument||e,n=e.createElement("script"),Wt(n),ua(n,"link",l),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Tc(l,s.precedence,e));return t.instance}function Tc(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,i=n,u=0;u<l.length;u++){var p=l[u];if(p.dataset.precedence===t)i=p;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function zu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oc=null;function Ym(e,t,s){if(Oc===null){var l=new Map,n=Oc=new Map;n.set(s,l)}else n=Oc,l=n.get(s),l||(l=new Map,n.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),n=0;n<s.length;n++){var i=s[n];if(!(i[Nl]||i[Xe]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var u=i.getAttribute(t)||"";u=e+u;var p=l.get(u);p?p.push(i):l.set(u,[i])}}return l}function zm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Vg(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Rm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $g(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var n=bn(l.href),i=t.querySelector(Hi(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ec.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=i,Wt(i);return}i=t.ownerDocument||t,l=Lm(l),(n=ds.get(n))&&zu(l,n),i=i.createElement("link"),Wt(i);var u=i;u._p=new Promise(function(p,C){u.onload=p,u.onerror=C}),ua(i,"link",l),s.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ec.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Uu=0;function Qg(e,t){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Uu===0&&(Uu=62500*_g());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Uu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(n)}}:null}function Ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lc=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lc=new Map,t.forEach(Zg,e),Lc=null,Ec.call(e))}function Zg(e,t){if(!(t.state.loading&4)){var s=Lc.get(e);if(s)var l=s.get(null);else{s=new Map,Lc.set(e,s);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var u=n[i];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(s.set(u.dataset.precedence,u),l=u)}l&&s.set(null,l)}n=t.instance,u=n.getAttribute("data-precedence"),i=s.get(u)||l,i===l&&s.set(null,n),s.set(u,n),this.count++,l=Ec.bind(this),n.addEventListener("load",l),n.addEventListener("error",l),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Bi={$$typeof:Y,Provider:null,Consumer:null,_currentValue:je,_currentValue2:je,_threadCount:0};function Xg(e,t,s,l,n,i,u,p,C){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fa(0),this.hiddenUpdates=fa(null),this.identifierPrefix=l,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Um(e,t,s,l,n,i,u,p,C,Z,le,ue){return e=new Xg(e,t,s,u,C,Z,le,ue,p),t=1,i===!0&&(t|=24),i=ja(3,null,null,t),e.current=i,i.stateNode=e,t=mi(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:s,cache:t},xi(i),e}function Hm(e){return e?(e=ps,e):ps}function qm(e,t,s,l,n,i){n=Hm(n),l.context===null?l.context=n:l.pendingContext=n,l=Bs(t),l.payload={element:s},i=i===void 0?null:i,i!==null&&(l.callback=i),s=Gs(e,l,t),s!==null&&(Ga(s,e,t),Sr(s,e,t))}function Bm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Hu(e,t){Bm(e,t),(e=e.alternate)&&Bm(e,t)}function Gm(e){if(e.tag===13||e.tag===31){var t=tl(e,67108864);t!==null&&Ga(t,e,67108864),Hu(e,67108864)}}function Vm(e){if(e.tag===13||e.tag===31){var t=Ka();t=Yr(t);var s=tl(e,t);s!==null&&Ga(s,e,t),Hu(e,t)}}var Yc=!0;function Fg(e,t,s,l){var n=q.T;q.T=null;var i=ie.p;try{ie.p=2,qu(e,t,s,l)}finally{ie.p=i,q.T=n}}function Wg(e,t,s,l){var n=q.T;q.T=null;var i=ie.p;try{ie.p=8,qu(e,t,s,l)}finally{ie.p=i,q.T=n}}function qu(e,t,s,l){if(Yc){var n=Bu(l);if(n===null)Su(e,t,l,zc,s),Qm(e,l);else if(Kg(n,e,t,s,l))l.stopPropagation();else if(Qm(e,l),t&4&&-1<Jg.indexOf(e)){for(;n!==null;){var i=Ia(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var u=W(i.pendingLanes);if(u!==0){var p=i;for(p.pendingLanes|=2,p.entangledLanes|=2;u;){var C=1<<31-wt(u);p.entanglements[1]|=C,u&=~C}Qs(i),(bt&6)===0&&(yc=se()+500,Yi(0))}}break;case 31:case 13:p=tl(i,2),p!==null&&Ga(p,i,2),vc(),Hu(i,2)}if(i=Bu(l),i===null&&Su(e,t,l,zc,s),i===n)break;n=i}n!==null&&l.stopPropagation()}else Su(e,t,l,null,s)}}function Bu(e){return e=An(e),Gu(e)}var zc=null;function Gu(e){if(zc=null,e=Qa(e),e!==null){var t=v(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=U(t),e!==null)return e;e=null}else if(s===31){if(e=S(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zc=e,null}function $m(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(we()){case Ee:return 2;case ht:return 8;case he:case it:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Vu=!1,Il=null,Pl=null,er=null,Gi=new Map,Vi=new Map,tr=[],Jg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Qm(e,t){switch(e){case"focusin":case"focusout":Il=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(t.pointerId)}}function $i(e,t,s,l,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:i,targetContainers:[n]},t!==null&&(t=Ia(t),t!==null&&Gm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Kg(e,t,s,l,n){switch(t){case"focusin":return Il=$i(Il,e,t,s,l,n),!0;case"dragenter":return Pl=$i(Pl,e,t,s,l,n),!0;case"mouseover":return er=$i(er,e,t,s,l,n),!0;case"pointerover":var i=n.pointerId;return Gi.set(i,$i(Gi.get(i)||null,e,t,s,l,n)),!0;case"gotpointercapture":return i=n.pointerId,Vi.set(i,$i(Vi.get(i)||null,e,t,s,l,n)),!0}return!1}function Zm(e){var t=Qa(e.target);if(t!==null){var s=v(t);if(s!==null){if(t=s.tag,t===13){if(t=U(s),t!==null){e.blockedOn=t,Oa(e.priority,function(){Vm(s)});return}}else if(t===31){if(t=S(s),t!==null){e.blockedOn=t,Oa(e.priority,function(){Vm(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Bu(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);qr=l,s.target.dispatchEvent(l),qr=null}else return t=Ia(s),t!==null&&Gm(t),e.blockedOn=s,!1;t.shift()}return!0}function Xm(e,t,s){Rc(e)&&s.delete(t)}function Ig(){Vu=!1,Il!==null&&Rc(Il)&&(Il=null),Pl!==null&&Rc(Pl)&&(Pl=null),er!==null&&Rc(er)&&(er=null),Gi.forEach(Xm),Vi.forEach(Xm)}function Uc(e,t){e.blockedOn===t&&(e.blockedOn=null,Vu||(Vu=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,Ig)))}var Hc=null;function Fm(e){Hc!==e&&(Hc=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){Hc===e&&(Hc=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],n=e[t+2];if(typeof l!="function"){if(Gu(l||s)===null)continue;break}var i=Ia(s);i!==null&&(e.splice(t,3),t-=3,Bd(i,{pending:!0,data:n,method:s.method,action:l},l,n))}}))}function jn(e){function t(C){return Uc(C,e)}Il!==null&&Uc(Il,e),Pl!==null&&Uc(Pl,e),er!==null&&Uc(er,e),Gi.forEach(t),Vi.forEach(t);for(var s=0;s<tr.length;s++){var l=tr[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<tr.length&&(s=tr[0],s.blockedOn===null);)Zm(s),s.blockedOn===null&&tr.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var n=s[l],i=s[l+1],u=n[Ot]||null;if(typeof i=="function")u||Fm(s);else if(u){var p=null;if(i&&i.hasAttribute("formAction")){if(n=i,u=i[Ot]||null)p=u.formAction;else if(Gu(n)!==null)continue}else p=u.action;typeof p=="function"?s[l+1]=p:(s.splice(l,3),l-=3),Fm(s)}}}function Wm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(u){return n=u})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function $u(e){this._internalRoot=e}qc.prototype.render=$u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var s=t.current,l=Ka();qm(s,l,e,t,null,null)},qc.prototype.unmount=$u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qm(e.current,2,null,e,null,null),vc(),t[ma]=null}};function qc(e){this._internalRoot=e}qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zt();e={blockedOn:null,target:e,priority:t};for(var s=0;s<tr.length&&t!==0&&t<tr[s].priority;s++);tr.splice(s,0,e),s===0&&Zm(e)}};var Jm=b.version;if(Jm!=="19.2.0")throw Error(f(527,Jm,"19.2.0"));ie.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=_(t),e=e!==null?V(e):null,e=e===null?null:e.stateNode,e};var Pg={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{ta=Bc.inject(Pg),Lt=Bc}catch{}}return Zi.createRoot=function(e,t){if(!g(e))throw Error(f(299));var s=!1,l="",n=af,i=sf,u=lf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=Um(e,1,!1,null,null,s,l,null,n,i,u,Wm),e[ma]=t.current,_u(e),new $u(t)},Zi.hydrateRoot=function(e,t,s){if(!g(e))throw Error(f(299));var l=!1,n="",i=af,u=sf,p=lf,C=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(n=s.identifierPrefix),s.onUncaughtError!==void 0&&(i=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(p=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),t=Um(e,1,!0,t,s??null,l,n,C,i,u,p,Wm),t.context=Hm(null),s=t.current,l=Ka(),l=Yr(l),n=Bs(l),n.callback=null,Gs(s,n,l),s=l,t.current.lanes=s,Qt(t,s),Qs(t),e[ma]=t.current,_u(e),new qc(t)},Zi.version="19.2.0",Zi}var n0;function dx(){if(n0)return Xu.exports;n0=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(b){console.error(b)}}return c(),Xu.exports=cx(),Xu.exports}var ux=dx();const hx=ih(ux),fx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),us=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),a.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),a.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),a.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),pa=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 22a10 10 0 1 0-10-10"}),a.jsx("path",{d:"M2 12h20"}),a.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),Fs=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"9",cy:"21",r:"1"}),a.jsx("circle",{cx:"20",cy:"21",r:"1"}),a.jsx("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),ch=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),dh=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),mx=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),so=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),ha=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),gx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),a.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),a.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),a.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),Ws=({className:c,style:b})=>a.jsxs("svg",{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",className:c,style:b,children:[a.jsx("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.2"}),a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),a.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),a.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),ba=({className:c,style:b,width:N=24,height:f=24})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:c,style:b,width:N,height:f,children:a.jsx("path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1.5-1.5-3-1-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z"})}),xx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M2 9a3 3 0 0 1 0 6v5a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5a3 3 0 0 1 0-6V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),a.jsx("path",{d:"M13 5v2"}),a.jsx("path",{d:"M13 17v2"}),a.jsx("path",{d:"M13 11v2"})]}),Ca=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),px=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),pt=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"6 9 12 15 18 9"})}),uh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"m12 5 7 7-7 7"})]}),Jc=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),a.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),Fe=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),a.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),q0=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),lo=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),Gc=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),a.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),a.jsx("path",{d:"M12 11h4"}),a.jsx("path",{d:"M12 16h4"}),a.jsx("path",{d:"M8 11h.01"}),a.jsx("path",{d:"M8 16h.01"})]}),Dn=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"}),a.jsx("path",{d:"M12 12v9"}),a.jsx("path",{d:"m16 16-4-4-4 4"})]}),eo=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("polyline",{points:"4 7 4 4 20 4 20 7"}),a.jsx("line",{x1:"9",y1:"20",x2:"15",y2:"20"}),a.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"20"})]}),Va=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"}),a.jsx("path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"}),a.jsx("path",{d:"M7 21h10"}),a.jsx("path",{d:"M12 3v18"}),a.jsx("path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"})]}),to=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z"}),a.jsx("path",{d:"M7 7h.01"})]}),ya=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),a.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),Js=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("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"})}),$a=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ro=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"22",y1:"12",x2:"18",y2:"12"}),a.jsx("line",{x1:"6",y1:"12",x2:"2",y2:"12"}),a.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"2"}),a.jsx("line",{x1:"12",y1:"22",x2:"12",y2:"18"})]}),Ts=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),a.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),hh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),a.jsx("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"})]}),Ar=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),fh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),a.jsx("path",{d:"M3 11V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5"}),a.jsx("path",{d:"M8 6V4"}),a.jsx("path",{d:"M16 6V4"}),a.jsx("circle",{cx:"6",cy:"16",r:"2"}),a.jsx("circle",{cx:"18",cy:"16",r:"2"})]}),mh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M16 18h2a2 2 0 0 0 2-2V8a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v8a2 2 0 0 0 2 2h2"}),a.jsx("path",{d:"M6 18h12"}),a.jsx("path",{d:"M18 14h-5"}),a.jsx("path",{d:"M6 14h.01"}),a.jsx("path",{d:"M10 4v2"}),a.jsx("path",{d:"M14 4v2"}),a.jsx("path",{d:"M8 18v2"}),a.jsx("path",{d:"M16 18v2"})]}),ao=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M14 16.5 12 14l-2 2.5"}),a.jsx("path",{d:"M14 16.5a2 2 0 0 1-4 0"}),a.jsx("path",{d:"M18 19H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2Z"}),a.jsx("path",{d:"M7 12V8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v4"})]}),i0=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72"})]}),Ic=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),gh=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),yx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),a.jsx("polyline",{points:"12 19 5 12 12 5"})]}),bx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),a.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),a.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),a.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),xh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]}),vx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),a.jsx("polyline",{points:"13 2 13 9 20 9"})]}),jx=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:c,children:a.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),Nx=({className:c})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:c,children:[a.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),a.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}),Mn=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),wx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),a.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]}),B0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})}),G0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),o0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),kx=[{name:"داشبورد",icon:gx,id:"dashboard"},{name:"مرسولات",icon:Ws,id:"shipments",children:[{name:"ثبت مرسوله",id:"register-shipment"},{name:"لیست درخواست‌های من",id:"my-shipment-requests"}]},{name:"سفر ها",icon:ba,id:"trips",children:[{name:"ثبت سفر",id:"register-trip"},{name:"لیست سفرهای من",id:"my-trips"}]},{name:"خرید اینترنتی",icon:Fs,id:"online-purchase",children:[{name:"ثبت خرید اینترنتی",id:"register-online-purchase"},{name:"لیست درخواست‌های من",id:"my-purchase-requests"}]},{name:"پیام ها",icon:so,id:"messages"},{name:"تیکت‌ها",icon:xx,id:"tickets-parent",children:[{name:"لیست تیکت‌ها",id:"tickets"},{name:"ارسال تیکت جدید",id:"new-ticket"}]},{name:"حساب کاربری",icon:Ca,id:"account"},{name:"خروج",icon:px,id:"logout"}],_x=({isOpen:c,currentPage:b,onNavigate:N})=>{const[f,g]=y.useState(""),v=S=>{g(T=>T===S?"":S)},U=S=>{N(S)};return a.jsxs("aside",{className:`bg-custom-light-card dark:bg-custom-dark-blue-light w-64 p-6 flex flex-col h-screen fixed lg:sticky top-0 right-0 z-40 transition-transform duration-300 ease-in-out ${c?"translate-x-0":"translate-x-full"} lg:translate-x-0`,children:[a.jsx("div",{className:"flex items-center justify-between mb-10",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(hh,{className:"w-10 h-10 text-custom-purple"}),a.jsx("span",{className:"text-2xl font-bold text-gray-800 dark:text-white mr-2",children:"اینوببر"})]})}),a.jsx("nav",{className:"flex-grow",children:a.jsx("ul",{children:kx.map(S=>{var O;const T=(O=S.children)==null?void 0:O.some(J=>J.id===b),_=f===S.id;if(S.children)return a.jsxs("li",{className:"my-1",children:[a.jsxs("div",{className:`flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors ${T?"text-custom-purple":"hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>v(S.id),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(S.icon,{className:"w-5 h-5 ml-3"}),a.jsx("span",{className:`${T?"font-semibold":""}`,children:S.name})]}),a.jsx(pt,{className:`w-5 h-5 transition-transform ${_?"rotate-180":""}`})]}),_&&a.jsx("ul",{className:"mr-6 mt-1 border-r-2 border-gray-200 dark:border-gray-600",children:S.children.map(J=>{const X=b===J.id;return a.jsxs("li",{className:`p-2 pr-4 my-1 cursor-pointer rounded-r-lg transition-colors relative ${X?"bg-custom-purple/10 text-custom-purple":"hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>U(J.id),children:[X&&a.jsx("div",{className:"absolute right-0 top-0 h-full w-1 bg-custom-purple rounded-r-full"}),a.jsx("span",{className:`${X?"font-bold":""}`,children:J.name})]},J.id)})})]},S.id);const V=b===S.id;return a.jsxs("li",{className:`flex items-center p-3 my-1 cursor-pointer transition-colors ${V?"bg-custom-purple text-white rounded-lg":"rounded-lg hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>U(S.id),children:[a.jsx(S.icon,{className:"w-5 h-5 ml-3"}),a.jsx("span",{className:`flex-grow ${V?"font-semibold":""}`,children:S.name})]},S.id)})})})]})},Sx=({onMenuClick:c,theme:b,toggleTheme:N,onNavigate:f})=>a.jsxs("header",{className:"flex items-center justify-between p-4 sm:p-4 lg:p-4 bg-custom-light-card dark:bg-custom-dark-blue-light shadow-md dark:shadow-none sticky top-0 z-20",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("button",{onClick:c,className:"lg:hidden text-gray-500 dark:text-gray-400 mr-4","aria-label":"Open menu",children:a.jsx(fx,{className:"w-6 h-6"})})}),a.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-4 space-x-reverse",children:[a.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-3 space-x-reverse",children:[a.jsxs("button",{onClick:()=>f("messages"),className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue-light rounded-full cursor-pointer relative","aria-label":"Messages",children:[a.jsx(mx,{className:"h-6 w-6 text-gray-600 dark:text-gray-300"}),a.jsx("span",{className:"absolute top-0 right-0 block h-2 w-2 rounded-full ring-2 ring-custom-light-card dark:ring-custom-dark-blue-light bg-custom-orange"})]}),a.jsx("button",{onClick:N,className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue-light rounded-full cursor-pointer","aria-label":"Toggle theme",children:b==="dark"?a.jsx(ch,{className:"h-6 w-6 text-yellow-400"}):a.jsx(dh,{className:"h-6 w-6 text-gray-800"})})]}),a.jsx("img",{src:"https://picsum.photos/id/64/100/100",alt:"User Avatar",className:"w-12 h-12 rounded-full"})]})]}),c0=({onNavigate:c})=>{const[b,N]=y.useState([]),[f,g]=y.useState(!0),[v,U]=y.useState(""),[S,T]=y.useState("all"),[_,V]=y.useState("all"),O=$=>{if(!$)return"تاریخ نامعلوم";const M=new Date($),j=new Date().getTime()-M.getTime(),Y=Math.floor(j/6e4),z=Math.floor(j/36e5),ce=Math.floor(j/864e5);return Y<1?"الان":Y<60?`${Y} دقیقه پیش`:z<24?`${z} ساعت پیش`:ce<7?`${ce} روز پیش`:new Intl.DateTimeFormat("fa-IR",{day:"numeric",month:"short"}).format(M)},J=async()=>{var $;try{g(!0);const[M,m,j,Y,z,ce]=await Promise.all([X("https://eino.eifa.site/users-api/public/api/online-purchase/my-requests"),X("https://eino.eifa.site/users-api/public/api/online-purchase/my-shopper"),X("https://eino.eifa.site/users-api/public/api/shipments/my-list"),X("https://eino.eifa.site/users-api/public/api/trips/my-trips"),X("https://eino.eifa.site/users-api/public/api/trips/my-companions"),X("https://eino.eifa.site/users-api/public/api/tickets")]),pe=[];if(M.ok&&((await M.json()).data||[]).forEach(ne=>{pe.push({id:`pr-${ne.id}`,type:"purchase-request",title:ne.title||"درخواست خرید بدون عنوان",status:ne.status==="active"?"active":"pending",time:O(ne.created_at),rawDate:ne.created_at,icon:Fs,color:"cyan",detailRoute:"purchase-request-detail",detailId:ne.id})}),m.ok){const K=await m.json();if(K.data){const ne=K.data;pe.push({id:`po-${ne.id}`,type:"purchase-offer",title:(($=ne.service_title)==null?void 0:$.trim())||`آماده خرید از ${ne.country||"کشور نامشخص"}`,status:ne.status==="active"?"active":"pending",time:O(ne.created_at||ne.updated_at),rawDate:ne.created_at||ne.updated_at,icon:Ca,color:"orange",detailRoute:"purchase-shopper-detail",detailId:ne.id})}}if(j.ok&&((await j.json()).data||[]).forEach(ne=>{pe.push({id:`sh-${ne.id}`,type:ne.type==="send"?"shipment-send":"shipment-carry",title:ne.title,status:ne.status,time:O(ne.created_at),rawDate:ne.created_at,icon:ne.type==="send"?Ws:ba,color:ne.type==="send"?"cyan":"orange",detailRoute:"shipment-detail",detailId:ne.id})}),Y.ok&&((await Y.json()).data||[]).forEach(ne=>{pe.push({id:`tr-${ne.id}`,type:"trip",title:`سفر از ${ne.origin_city} به ${ne.destination_city}`,status:ne.status==="active"?"active":ne.status==="completed"?"completed":"pending",time:O(ne.created_at),rawDate:ne.created_at,icon:ba,color:"orange",detailRoute:"trip-detail",detailId:ne.id})}),z.ok&&((await z.json()).data||[]).forEach(ne=>{pe.push({id:`co-${ne.id}`,type:"companion",title:`همسفر: ${ne.origin_city} → ${ne.destination_city}`,status:ne.status==="active"?"active":ne.status==="completed"?"completed":"pending",time:O(ne.created_at),rawDate:ne.created_at,icon:Ca,color:"cyan",detailRoute:"trip-detail",detailId:ne.id})}),ce.ok){const K=await ce.json();if(Array.isArray(K.data)){const ne={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"};K.data.forEach(Ce=>{pe.push({id:`tk-${Ce.id}`,type:"ticket",title:Ce.subject||"بدون عنوان",status:ne[Ce.status]||"pending",time:O(Ce.updated_at||Ce.created_at),rawDate:Ce.updated_at||Ce.created_at,icon:o0,color:ne[Ce.status]==="answered"?"green":ne[Ce.status]==="closed"?"gray":"orange",detailRoute:"ticket-detail",detailId:Ce.id})})}}pe.sort((K,ne)=>new Date(ne.rawDate).getTime()-new Date(K.rawDate).getTime()),N(pe)}catch(M){console.error("Error fetching dashboard data:",M)}finally{g(!1)}},X=$=>Mx($);y.useEffect(()=>{J()},[]);const G={total:b.length,active:b.filter($=>$.status==="active"||$.status==="answered").length,pending:b.filter($=>$.status==="pending").length,tickets:b.filter($=>$.type==="ticket").length};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"داشبورد من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خلاصه‌ی فعالیت‌های شما در یک نما"})]}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-6 gap-4",children:[{icon:Jc,title:"ثبت مرسوله جدید",color:"purple",page:"register-shipment"},{icon:Gc,title:"مرسوله‌های من",color:"cyan",page:"my-shipment-requests"},{icon:Jc,title:"ثبت سفر جدید",color:"orange",page:"register-trip"},{icon:Gc,title:"سفرهای من",color:"pink",page:"my-trips"},{icon:Jc,title:"ثبت خرید اینترنتی",color:"green",page:"register-online-purchase"},{icon:Gc,title:"خریدهای من",color:"blue",page:"my-purchase-requests"}].map(($,M)=>a.jsx(Dx,{icon:$.icon,title:$.title,color:$.color,pageId:$.page,onNavigate:c},M))}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsx(Vc,{icon:q0,title:"فعال/پاسخ داده شده",value:G.active,variant:"green"}),a.jsx(Vc,{icon:Mn,title:"در انتظار",value:G.pending,variant:"orange"}),a.jsx(Vc,{icon:o0,title:"تیکت‌های باز",value:G.tickets,variant:"blue"}),a.jsx(Vc,{icon:Gc,title:"کل فعالیت‌ها",value:G.total,variant:"purple"})]})]})},Dx=({icon:c,title:b,description:N,color:f,pageId:g,onNavigate:v})=>{const U={purple:"from-custom-purple to-custom-light-purple",cyan:"from-custom-cyan to-teal-400",orange:"from-custom-orange to-amber-400",pink:"from-custom-pink to-rose-400",green:"from-green-500 to-emerald-400",blue:"from-blue-500 to-sky-400"};return a.jsxs("div",{onClick:()=>v(g),className:`relative bg-gradient-to-br ${U[f]} p-4 rounded-2xl text-white shadow-lg hover:shadow-xl hover:scale-[1.02] transform transition-all duration-300 cursor-pointer overflow-hidden group`,children:[a.jsx(c,{className:"absolute -right-2 -top-2 w-16 h-16 text-white/10 transform rotate-12"}),a.jsxs("div",{className:"relative z-10",children:[a.jsx("div",{className:"bg-white/20 w-10 h-10 rounded-full flex items-center justify-center mb-2",children:a.jsx(c,{className:"w-5 h-5"})}),a.jsx("h3",{className:"font-bold text-sm",children:b}),N&&a.jsx("p",{className:"opacity-80 mt-1 text-xs",children:N})]})]})},Vc=({icon:c,title:b,value:N,variant:f="purple"})=>{const g={green:"text-green-500",orange:"text-custom-orange",blue:"text-blue-500",purple:"text-custom-purple"};return a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl flex items-center",children:[a.jsx("div",{className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue rounded-full ml-3",children:a.jsx(c,{className:`w-5 h-5 ${g[f]}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-xs",children:b}),a.jsx("p",{className:"text-xl font-bold text-gray-900 dark:text-white",children:N})]})]})},Mx=(c,b={})=>fetch(c,{...b,headers:{"X-Auth-Token":localStorage.getItem("auth_token"),"Content-Type":"application/json",...b.headers}}),d0={registerShipment:(c,b=[])=>{const N=new FormData;return Object.keys(c).forEach(f=>{typeof c[f]=="object"&&c[f]!==null?Object.keys(c[f]).forEach(g=>{N.append(`${f}[${g}]`,c[f][g])}):N.append(f,c[f])}),b.forEach((f,g)=>{N.append(`images[${g}]`,f)}),fetch("https://eino.eifa.site/users-api/public/api/shipments/register",{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")},body:N})},registerCarryTrip:c=>{const b=new FormData;return Object.keys(c).forEach(N=>{typeof c[N]=="object"&&c[N]!==null?Object.keys(c[N]).forEach(f=>{b.append(`${N}[${f}]`,c[N][f])}):b.append(N,c[N])}),fetch("https://eino.eifa.site/users-api/public/api/shipments/carry",{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")},body:b})}},Cx=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("send"),[g,v]=y.useState("fixed"),[U,S]=y.useState("IRT"),[T,_]=y.useState(!1),[V,O]=y.useState([]),[J,X]=y.useState({isOpen:!1,field:null}),[G,$]=y.useState(null),[M,m]=y.useState(null),[j,Y]=y.useState(""),[z,ce]=y.useState(""),[pe,K]=y.useState(""),[ne,Ce]=y.useState(""),[Se,de]=y.useState(""),[R,me]=y.useState(""),[ye,fe]=y.useState(""),[q,ie]=y.useState(""),[je,Ae]=y.useState(""),[_e,w]=y.useState(""),[H,F]=y.useState(""),[xe,P]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(""),[E,te]=y.useState(""),[re,Ne]=y.useState(""),[Me,We]=y.useState(!1),Je=G?`${G.lat.toFixed(5)}, ${G.lng.toFixed(5)}`:"",at=M?`${M.lat.toFixed(5)}, ${M.lng.toFixed(5)}`:"",Bt=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}];y.useEffect(()=>{$(null),m(null),Y(""),ce(""),K(""),Ce(""),de(""),me(""),w(""),F(""),P(""),ze(""),k(""),fe(""),ie(""),Ae(""),te(""),Ne(""),O([]),v("fixed"),S("IRT"),_(!1)},[N]);const Gt=he=>{const it=he.target.files;if(it){const Ve=Array.from(it).map(Et=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Et),file:Et}));O(Et=>[...Et,...Ve])}},Vt=he=>{O(it=>it.filter(Ve=>Ve.id!==he))},yt=y.useCallback(he=>{he.preventDefault(),he.stopPropagation();const it=he.dataTransfer.files;if(it&&it.length>0){const Ve=Array.from(it).filter(Et=>Et.type.startsWith("image/")).map(Et=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Et),file:Et}));O(Et=>[...Et,...Ve])}},[]),ea=he=>{he.preventDefault(),he.stopPropagation()},ke=he=>{X({isOpen:!0,field:he})},se=()=>{X({isOpen:!1,field:null})},we=he=>{J.field==="origin"?$(he):J.field==="destination"&&m(he),se()},Ee=async he=>{he.preventDefault(),We(!0);try{const it={origin:{country:j,city:z,address:pe,coordinates:G?`${G.lat},${G.lng}`:""},destination:{country:ne,city:Se,address:R,coordinates:M?`${M.lat},${M.lng}`:""},price_type:g,show_phone:T?1:0};g==="fixed"&&(it.currency=U,N==="send"?it.amount=Be:it.amount=re);let Ve;if(N==="send"){const Re={...it,title:_e,description:H,weight:xe,category:Te};Ve=await d0.registerShipment(Re,V.map(ta=>ta.file))}else{const Re=Lt=>{if(!Lt)return null;const[Ft,wt,ge]=Lt.split("/").map(Number);return new Date(Ft+621,wt-1,ge).toISOString().split("T")[0]},ta={...it,departure_date:Re(ye),arrival_date:q?Re(q):null,carry_weight_capacity:E,trip_description:je||""};Ve=await d0.registerCarryTrip(ta)}const Et=await Ve.json();if(!Ve.ok){const Re=Et.errors?Object.values(Et.errors)[0]:Et.message;c(Array.isArray(Re)?Re[0]:Re);return}b("با موفقیت ثبت شد!"),ht()}catch(it){c("خطای اتصال به سرور"),console.error(it)}finally{We(!1)}},ht=()=>{$(null),m(null),Y(""),ce(""),K(""),Ce(""),de(""),me(""),w(""),F(""),P(""),ze(""),k(""),fe(""),ie(""),Ae(""),te(""),Ne(""),O([]),_(!1),v("fixed"),S("IRT")};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="send"?"ثبت مرسوله جدید":"ثبت سفر جدید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="send"?"اطلاعات مرسوله خود را برای حمل وارد کنید.":"اطلاعات سفر خود را برای حمل مرسوله وارد کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="carry"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("send"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="send"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"ارسال مرسوله",children:[a.jsx(Ws,{className:"h-5 w-5"}),a.jsx("span",{children:"ارسال مرسوله"})]}),a.jsxs("button",{type:"button",onClick:()=>f("carry"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="carry"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"حمل مرسوله",children:[a.jsx(ba,{className:"h-5 w-5"}),a.jsx("span",{children:"حمل مرسوله"})]})]})})})]}),N==="send"?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"تصاویر مرسوله"}),a.jsxs("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:yt,onDragOver:ea,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Dn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید و رها کنید"]}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"PNG, JPG or GIF (MAX. 800x400px)"})]}),a.jsx("input",{id:"file-upload",type:"file",className:"hidden",multiple:!0,accept:"image/*",onChange:Gt})]})]}),V.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"پیش‌نمایش"}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:V.map(he=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:he.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{onClick:()=>Vt(he.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx($a,{className:"w-4 h-4"})})]},he.id))})]})]}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{onSubmit:Ee,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات اصلی مرسوله"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Ma,{icon:eo,id:"title",placeholder:"مثال: کتاب‌های درسی",label:"عنوان مرسوله",value:_e,onChange:he=>w(he.target.value)}),a.jsx(h0,{icon:us,id:"description",placeholder:"جزئیات بیشتر در مورد مرسوله، شرایط نگهداری و...",label:"توضیحات (اختیاری)",value:H,onChange:he=>F(he.target.value)}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ma,{icon:Va,id:"weight",placeholder:"به کیلوگرم",label:"وزن تقریبی",type:"number",value:xe,onChange:he=>P(he.target.value)}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"category",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"دسته‌بندی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(to,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("select",{id:"category",value:Te,onChange:he=>ze(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("option",{value:"",children:"انتخاب کنید"}),a.jsx("option",{value:"documents",children:"مدارک و اسناد"}),a.jsx("option",{value:"electronics",children:"لوازم الکترونیکی"}),a.jsx("option",{value:"clothing",children:"پوشاک"}),a.jsx("option",{value:"furniture",children:"اثاثیه منزل"}),a.jsx("option",{value:"miscellaneous",children:"متفرقه"})]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. مبدأ و مقصد"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx($c,{onButtonClick:()=>ke("origin"),value:Je,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ma,{icon:pa,id:"origin_country",placeholder:"مثال: ایران",label:"کشور",value:j,onChange:he=>Y(he.target.value)}),a.jsx(Ma,{icon:Fe,id:"origin_city",placeholder:"مثال: تهران",label:"شهر",value:z,onChange:he=>ce(he.target.value)})]}),a.jsx(Ma,{icon:Ts,id:"origin_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:pe,onChange:he=>K(he.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx($c,{onButtonClick:()=>ke("destination"),value:at,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ma,{icon:pa,id:"destination_country",placeholder:"مثال: کانادا",label:"کشور",value:ne,onChange:he=>Ce(he.target.value)}),a.jsx(Ma,{icon:Fe,id:"destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:Se,onChange:he=>de(he.target.value)})]}),a.jsx(Ma,{icon:Ts,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:R,onChange:he=>me(he.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"قیمت"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>v("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>v("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]}),g==="fixed"&&a.jsxs("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"currency",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ya,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:"currency",value:U,onChange:he=>S(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:Bt.map(({value:he,label:it})=>a.jsx("option",{value:he,children:it},he))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"amount",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مبلغ"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ya,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:"amount",type:"number",placeholder:"مبلغ",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:Be,onChange:he=>k(he.target.value)})]})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(f0,{enabled:T,setEnabled:_})]})]})]}),a.jsx("button",{type:"submit",disabled:Me,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:Me?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):"ثبت و انتشار مرسوله"})]})})]}):a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{onSubmit:Ee,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. مبدأ و مقصد سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx($c,{onButtonClick:()=>ke("origin"),value:Je,id:"origin_carry",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ma,{icon:pa,id:"origin_country_carry",placeholder:"مثال: ایران",label:"کشور",value:j,onChange:he=>Y(he.target.value)}),a.jsx(Ma,{icon:Fe,id:"origin_city_carry",placeholder:"مثال: تهران",label:"شهر",value:z,onChange:he=>ce(he.target.value)})]}),a.jsx(Ma,{icon:Ts,id:"origin_address_carry",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:pe,onChange:he=>K(he.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx($c,{onButtonClick:()=>ke("destination"),value:at,id:"destination_carry",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ma,{icon:pa,id:"destination_country_carry",placeholder:"مثال: کانادا",label:"کشور",value:ne,onChange:he=>Ce(he.target.value)}),a.jsx(Ma,{icon:Fe,id:"destination_city_carry",placeholder:"مثال: تورنتو",label:"شهر",value:Se,onChange:he=>de(he.target.value)})]}),a.jsx(Ma,{icon:Ts,id:"destination_address_carry",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:R,onChange:he=>me(he.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. جزئیات سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(u0,{id:"departure_date",label:"تاریخ حرکت",value:ye,onChange:fe}),a.jsx(u0,{id:"arrival_date",label:"تاریخ رسیدن",value:q,onChange:ie})]}),a.jsx("div",{className:"mt-6",children:a.jsx(Ma,{icon:Va,id:"carry_weight",label:"ظرفیت حمل",placeholder:"حداکثر وزن قابل حمل به کیلوگرم",type:"number",value:E,onChange:he=>te(he.target.value)})}),a.jsx("div",{className:"mt-6",children:a.jsx(h0,{icon:us,id:"trip_description",label:"توضیحات (اختیاری)",placeholder:"توضیحات بیشتر در مورد سفر، نوع وسیله نقلیه، اقلام ممنوعه و...",value:je,onChange:he=>Ae(he.target.value)})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"قیمت"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>v("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>v("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]}),g==="fixed"&&a.jsxs("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"currency_carry",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ya,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:"currency_carry",value:U,onChange:he=>S(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:Bt.map(({value:he,label:it})=>a.jsx("option",{value:he,children:it},he))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"amount_carry",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مبلغ به ازای هر کیلوگرم"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ya,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:"amount_carry",type:"number",placeholder:"مبلغ",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:re,onChange:he=>Ne(he.target.value)})]})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(f0,{enabled:T,setEnabled:_})]})]})]}),a.jsx("button",{type:"submit",disabled:Me,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:Me?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):"ثبت و اعلام سفر"})]})}),a.jsx(Ax,{isOpen:J.isOpen,onClose:se,onConfirm:we,field:J.field})]})},Tx=c=>[1,5,9,13,17,22,26,30].includes(c%33),Ox=(c,b)=>b<7?31:b<12?30:b===12?Tx(c)?30:29:0,Ex=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N,f]=c.split("/").map(Number);return{year:b,month:N,day:f}},Lx=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],u0=({id:c,label:b,value:N,onChange:f})=>{const v=Ex().year,[U,S]=y.useState(),[T,_]=y.useState(),[V,O]=y.useState(),J=Array.from({length:4},(j,Y)=>v+Y),X=U&&T?Ox(U,T):31;y.useEffect(()=>{if(N){const[j,Y,z]=N.split("/").map(Number);S(j),_(Y),O(z)}else S(void 0),_(void 0),O(void 0)},[N]),y.useEffect(()=>{f(U&&T&&V?`${U}/${T}/${V}`:"")},[U,T,V,f]),y.useEffect(()=>{V&&V>X&&O(X)},[X,V]);const G=j=>S(Number(j.target.value)),$=j=>_(Number(j.target.value)),M=j=>O(Number(j.target.value)),m="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:V||"",onChange:M,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:X},(j,Y)=>Y+1).map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:$,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),Lx.map((j,Y)=>a.jsx("option",{value:Y+1,children:j},Y))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:U||"",onChange:G,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),J.map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Ma=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:U,step:S,min:T})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:U,step:S,min:T})]})]}),h0=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),$c=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),f0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Ax=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),U=y.useRef(null),[S,T]=y.useState(null),[_,V]=y.useState(""),[O,J]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),V("")};if(U.current&&!g.current){const j=L.map(U.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",Y=>{const{lat:z,lng:ce}=Y.latlng;T({lat:z,lng:ce}),v.current?v.current.setLatLng(Y.latlng):v.current=L.marker(Y.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){J(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:Y,lon:z}=j[0],ce=parseFloat(Y),pe=parseFloat(z),K={lat:ce,lng:pe};T(K),g.current&&(g.current.setView(K,15),v.current?v.current.setLatLng(K):v.current=L.marker(K).addTo(g.current))}else console.log("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),console.log("خطایی در جستجوی مکان رخ داد.")}finally{J(!1)}}},G=async()=>{if(!navigator.geolocation){console.log("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){console.log("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:Y}=m.coords,z={lat:j,lng:Y};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}console.log(j)})},$=()=>{S?N(S):console.log("لطفاً یک موقعیت روی نقشه انتخاب کنید.")};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx($a,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ha,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>V(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:G,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:U,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:$,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},m0=[{id:1,title:"بسته مدارک مهم شرکتی",imageUrl:"https://picsum.photos/seed/docs1/400/300",origin:{country:"ایران",city:"تهران"},destination:{country:"کانادا",city:"تورنتو"},weight:.5,category:"مدارک و اسناد",fee:50,currency:"USD",datePosted:"۳ ساعت پیش"},{id:2,title:"لپتاپ و لوازم جانبی",imageUrl:"https://picsum.photos/seed/laptop2/400/300",origin:{country:"آمریکا",city:"لس آنجلس"},destination:{country:"ایران",city:"شیراز"},weight:3,category:"لوازم الکترونیکی",fee:120,currency:"USD",datePosted:"۱ روز پیش"},{id:3,title:"مجموعه کتاب‌های نایاب",imageUrl:"https://picsum.photos/seed/books3/400/300",origin:{country:"ایران",city:"اصفهان"},destination:{country:"آلمان",city:"برلین"},weight:4.5,category:"کتاب و مجله",fee:80,currency:"EUR",datePosted:"۲ روز پیش"},{id:4,title:"لباس‌های محلی و صنایع دستی",imageUrl:"https://picsum.photos/seed/crafts4/400/300",origin:{country:"ایران",city:"یزد"},destination:{country:"آمریکا",city:"نیویورک"},weight:2,category:"پوشاک",fee:65,currency:"USD",datePosted:"۵ روز پیش"},{id:5,title:"هدیه تولد (عطر و ادکلن)",imageUrl:"https://picsum.photos/seed/perfume5/400/300",origin:{country:"فرانسه",city:"پاریس"},destination:{country:"ایران",city:"تهران"},weight:1,category:"هدیه",fee:40,currency:"EUR",datePosted:"۱ هفته پیش"},{id:6,title:"قطعات یدکی خودرو",imageUrl:"https://picsum.photos/seed/carparts6/400/300",origin:{country:"آلمان",city:"مونیخ"},destination:{country:"ایران",city:"تبریز"},weight:8,category:"قطعات",fee:200,currency:"EUR",datePosted:"۲ هفته پیش"}],Yx=({onNavigate:c})=>{const[b,N]=y.useState(m0),[f,g]=y.useState(m0),[v,U]=y.useState(""),[S,T]=y.useState(""),[_,V]=y.useState(""),[O,J]=y.useState(""),[X,G]=y.useState(""),[$,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.origin.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.origin.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.destination.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.destination.city.toLowerCase().includes(X.toLowerCase()))),$){case"fee_asc":m.sort((j,Y)=>j.fee-Y.fee);break;case"fee_desc":m.sort((j,Y)=>Y.fee-j.fee);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,$,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"پیدا کردن مرسوله"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مرسوله‌های موجود برای حمل را مشاهده و انتخاب کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Xi,{id:"searchQuery",label:"عنوان مرسوله",placeholder:"مثال: کتاب...",value:v,onChange:m=>U(m.target.value),icon:ha}),a.jsx(Xi,{id:"originCountry",label:"کشور مبدا",placeholder:"مثال: ایران",value:S,onChange:m=>T(m.target.value),icon:pa}),a.jsx(Xi,{id:"originCity",label:"شهر مبدا",placeholder:"مثال: تهران",value:_,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(Xi,{id:"destinationCountry",label:"کشور مقصد",placeholder:"مثال: کانادا",value:O,onChange:m=>J(m.target.value),icon:pa}),a.jsx(Xi,{id:"destinationCity",label:"شهر مقصد",placeholder:"مثال: تورنتو",value:X,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(zx,{value:$,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(ha,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(Rx,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ws,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"مرسوله‌ای یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ مرسوله‌ای با این مشخصات یافت نشد."})]})]})},Xi=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),zx=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"fee_asc",children:"کارمزد: کم به زیاد"}),a.jsx("option",{value:"fee_desc",children:"کارمزد: زیاد به کم"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),Rx=({id:c,title:b,imageUrl:N,origin:f,destination:g,weight:v,category:U,fee:S,currency:T,datePosted:_,onNavigate:V})=>a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:N,alt:b,className:"w-full h-48 object-cover"}),a.jsx("div",{className:"absolute top-0 right-0 m-2 px-3 py-1 bg-black/60 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:_}),a.jsx("div",{className:"absolute top-0 left-0 m-2 px-3 py-1 bg-custom-cyan/80 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:U})]}),a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white mb-3 flex-grow",children:b}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Qc,{icon:Ws,label:"مبدا",value:`${f.city}, ${f.country}`}),a.jsx(Qc,{icon:Fe,label:"مقصد",value:`${g.city}, ${g.country}`}),a.jsx(Qc,{icon:Va,label:"وزن تقریبی",value:`${v} کیلوگرم`}),a.jsx(Qc,{icon:ya,label:"هزینه حمل",value:`${S.toLocaleString()} ${T}`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>V("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(so,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>{V("shipment-detail",c.toString())},className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})]}),Qc=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),g0=[{id:"private_car",name:"ماشین شخصی",icon:ao},{id:"bus",name:"اتوبوس",icon:fh},{id:"train",name:"قطار",icon:mh},{id:"airplane",name:"هواپیما",icon:ba}],x0={registerTrip:c=>fetch("https://eino.eifa.site/users-api/public/api/trips/register",{method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":localStorage.getItem("auth_token")},body:JSON.stringify(c)}),registerCompanion:c=>fetch("https://eino.eifa.site/users-api/public/api/trips/companion",{method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":localStorage.getItem("auth_token")},body:JSON.stringify(c)})},Ux=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("register"),[g,v]=y.useState(!1),[U,S]=y.useState(!1),[T,_]=y.useState({isOpen:!1,field:null}),[V,O]=y.useState(null),[J,X]=y.useState(null),[G,$]=y.useState(""),[M,m]=y.useState(""),[j,Y]=y.useState(""),[z,ce]=y.useState(""),[pe,K]=y.useState(""),[ne,Ce]=y.useState(""),[Se,de]=y.useState(""),[R,me]=y.useState([]),[ye,fe]=y.useState(""),[q,ie]=y.useState(""),[je,Ae]=y.useState(""),[_e,w]=y.useState(""),H=V?`${V.lat.toFixed(5)}, ${V.lng.toFixed(5)}`:"",F=J?`${J.lat.toFixed(5)}, ${J.lng.toFixed(5)}`:"",xe=k=>{_({isOpen:!0,field:k})},P=()=>{_({isOpen:!1,field:null})},Te=k=>{T.field==="origin"?O(k):T.field==="destination"&&X(k),P()};y.useEffect(()=>{O(null),X(null),$(""),m(""),Y(""),ce(""),K(""),Ce(""),fe(""),ie(""),Ae(""),de(""),me([]),w("")},[N]);const ze=k=>{me(E=>E.includes(k)?E.filter(te=>te!==k):[...E,k])},Be=async k=>{k.preventDefault(),S(!0);try{let E,te;if(N==="register"){if(!G||!M||!z||!pe||!Se||!ye||!_e)throw new Error("لطفا تمام فیلدهای обязаاری را پر کنید");E={origin:{country:G,city:M,address:j,coordinates:V?`${V.lat},${V.lng}`:null},destination:{country:z,city:pe,address:ne,coordinates:J?`${J.lat},${J.lng}`:null},vehicle_type:Se,departure_date:ye,arrival_date:q,capacity:parseFloat(_e),description:je,show_phone:g},te=x0.registerTrip}else{if(!G||!M||!z||!pe||R.length===0||!ye||!_e)throw new Error("لطفا تمام فیلدهای обязаاری را پر کنید");E={origin:{country:G,city:M,address:j,coordinates:V?`${V.lat},${V.lng}`:null},destination:{country:z,city:pe,address:ne,coordinates:J?`${J.lat},${J.lng}`:null},vehicle_types:R,available_from:ye,available_to:q,capacity:parseFloat(_e),description:je,show_phone:g},te=x0.registerCompanion}const re=await te(E),Ne=await re.json();if(!re.ok){const Me=await re.json(),We=Me.messages||Me.error||"خطا در ثبت اطلاعات";if(Me.errors){const Je=Object.values(Me.errors)[0];c(Array.isArray(Je)?Je[0]:String(Je))}else c(We);return}b(N==="register"?"سفر با موفقیت ثبت شد!":"آمادگی برای همسفری با موفقیت ثبت شد!"),O(null),X(null),$(""),m(""),Y(""),ce(""),K(""),Ce(""),fe(""),ie(""),Ae(""),de(""),me([]),w(""),v(!1)}catch(E){c(E.message||"خطای ناشناخته رخ داد")}finally{S(!1)}};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="register"?"ثبت سفر جدید":"اعلام آمادگی برای همسفری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="register"?"اطلاعات سفر خود را برای حمل مرسوله وارد کنید.":"اطلاعات مسیر و زمان در دسترس بودن خود را ثبت کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="companion"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("register"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="register"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"ثبت سفر",children:[a.jsx(ba,{className:"h-5 w-5"}),a.jsx("span",{children:"ثبت سفر"})]}),a.jsxs("button",{type:"button",onClick:()=>f("companion"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="companion"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"همسفر می‌شوم",children:[a.jsx(Ca,{className:"h-5 w-5"}),a.jsx("span",{children:"همسفر می‌شوم"})]})]})})})]}),a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{onSubmit:Be,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. مبدأ و مقصد سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(y0,{onButtonClick:()=>xe("origin"),value:H,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Er,{icon:pa,id:"origin_country",placeholder:"مثال: ایران",label:"کشور",value:G,onChange:k=>$(k.target.value)}),a.jsx(Er,{icon:Fe,id:"origin_city",placeholder:"مثال: تهران",label:"شهر",value:M,onChange:k=>m(k.target.value)})]}),a.jsx(Er,{icon:Ts,id:"origin_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:j,onChange:k=>Y(k.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(y0,{onButtonClick:()=>xe("destination"),value:F,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Er,{icon:pa,id:"destination_country",placeholder:"مثال: کانادا",label:"کشور",value:z,onChange:k=>ce(k.target.value)}),a.jsx(Er,{icon:Fe,id:"destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:pe,onChange:k=>K(k.target.value)})]}),a.jsx(Er,{icon:Ts,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:ne,onChange:k=>Ce(k.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:N==="register"?"۲. جزئیات سفر":"۲. زمان و ظرفیت در دسترس"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(p0,{id:N==="register"?"departure_date":"available_from_date",label:N==="register"?"تاریخ حرکت":"در دسترس از تاریخ",value:ye,onChange:fe}),a.jsx(p0,{id:N==="register"?"arrival_date":"available_to_date",label:N==="register"?"تاریخ رسیدن":"در دسترس تا تاریخ",value:q,onChange:ie})]}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[N==="register"?a.jsx(Hx,{label:"نوع وسیله نقلیه",options:g0,selectedValue:Se,onChange:de}):a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسیله‌های نقلیه مورد نظر"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:g0.map(k=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${R.includes(k.id)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:R.includes(k.id),onChange:()=>ze(k.id),className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${R.includes(k.id)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:R.includes(k.id)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx(k.icon,{className:`w-6 h-6 ml-2 transition-colors ${R.includes(k.id)?"text-custom-purple":"text-gray-500 dark:text-gray-400"}`}),a.jsx("span",{className:`font-semibold transition-colors ${R.includes(k.id)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:k.name})]},k.id))})]}),a.jsx(Er,{icon:Va,id:"capacity",label:"ظرفیت حمل",placeholder:"حداکثر وزن قابل حمل به کیلوگرم",type:"number",value:_e,onChange:k=>w(k.target.value)})]}),a.jsx("div",{className:"mt-6",children:a.jsx(Qx,{icon:us,id:"description",label:"توضیحات (اختیاری)",placeholder:N==="register"?"توضیحات بیشتر در مورد سفر، نوع وسیله نقلیه، اقلام ممنوعه و...":"توضیحات بیشتر در مورد نوع سفر، شرایط خاص و...",value:je,onChange:k=>Ae(k.target.value)})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. اطلاعات تماس"}),a.jsx("div",{className:"mt-6",children:a.jsx(qx,{enabled:g,setEnabled:v})})]}),a.jsx("button",{type:"submit",disabled:U,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed",children:U?"در حال ثبت...":N==="register"?"ثبت و اعلام سفر":"ثبت آمادگی"})]})}),a.jsx(Xx,{isOpen:T.isOpen,onClose:P,onConfirm:Te,field:T.field})]})},Hx=({selectedValue:c,onChange:b,options:N,label:f})=>{const[g,v]=y.useState(!1),U=y.useRef(null),S=N.find(T=>T.id===c);return y.useEffect(()=>{const T=_=>{U.current&&!U.current.contains(_.target)&&v(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[U]),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",ref:U,children:[a.jsxs("button",{type:"button",onClick:()=>v(!g),className:"w-full flex items-center justify-between text-right pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("div",{className:"flex items-center",children:S?a.jsxs(a.Fragment,{children:[a.jsx(S.icon,{className:"w-5 h-5 ml-2 text-gray-500 dark:text-gray-400"}),a.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:S.name})]}):a.jsx("span",{className:"text-gray-400",children:"یک گزینه را انتخاب کنید"})}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:`w-5 h-5 text-gray-400 transition-transform ${g?"rotate-180":""}`})})]}),g&&a.jsx("ul",{className:"absolute z-10 w-full mt-1 bg-custom-light-card dark:bg-custom-dark-blue-light border border-gray-300 dark:border-gray-600 rounded-lg shadow-lg max-h-60 overflow-auto",children:N.map(T=>a.jsxs("li",{onClick:()=>{b(T.id),v(!1)},className:"flex items-center p-3 cursor-pointer hover:bg-gray-100 dark:hover:bg-custom-dark-blue",children:[a.jsx(T.icon,{className:"w-5 h-5 ml-3 text-gray-500 dark:text-gray-400"}),a.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:T.name})]},T.id))})]})]})},qx=({enabled:c,setEnabled:b})=>a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(Zx,{enabled:c,setEnabled:b})]}),Bx=c=>[1,5,9,13,17,22,26,30].includes(c%33),Gx=(c,b)=>b<7?31:b<12?30:b===12?Bx(c)?30:29:0,Vx=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N,f]=c.split("/").map(Number);return{year:b,month:N,day:f}},$x=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],p0=({id:c,label:b,value:N,onChange:f})=>{const v=Vx().year,[U,S]=y.useState(),[T,_]=y.useState(),[V,O]=y.useState(),J=Array.from({length:4},(j,Y)=>v+Y),X=U&&T?Gx(U,T):31;y.useEffect(()=>{if(N){const[j,Y,z]=N.split("/").map(Number);S(j),_(Y),O(z)}else S(void 0),_(void 0),O(void 0)},[N]),y.useEffect(()=>{f(U&&T&&V?`${U}/${T}/${V}`:"")},[U,T,V,f]),y.useEffect(()=>{V&&V>X&&O(X)},[X,V]);const G=j=>S(Number(j.target.value)),$=j=>_(Number(j.target.value)),M=j=>O(Number(j.target.value)),m="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_day",value:V||"",onChange:M,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:X},(j,Y)=>Y+1).map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_month",value:T||"",onChange:$,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),$x.map((j,Y)=>a.jsx("option",{value:Y+1,children:j},Y))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_year",value:U||"",onChange:G,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),J.map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Er=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:U})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:U})]})]}),Qx=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),y0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),Zx=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Xx=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),U=y.useRef(null),[S,T]=y.useState(null),[_,V]=y.useState(""),[O,J]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),V("")};if(U.current&&!g.current){const j=L.map(U.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",Y=>{const{lat:z,lng:ce}=Y.latlng;T({lat:z,lng:ce}),v.current?v.current.setLatLng(Y.latlng):v.current=L.marker(Y.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){J(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:Y,lon:z}=j[0],ce=parseFloat(Y),pe=parseFloat(z),K={lat:ce,lng:pe};T(K),g.current&&(g.current.setView(K,15),v.current?v.current.setLatLng(K):v.current=L.marker(K).addTo(g.current))}else alert("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),alert("خطایی در جستجوی مکان رخ داد.")}finally{J(!1)}}},G=async()=>{if(!navigator.geolocation){alert("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){alert("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید. لطفاً آن را در تنظیمات مرورگر خود فعال کنید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:Y}=m.coords,z={lat:j,lng:Y};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}alert(j)})},$=()=>{S&&N(S)};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx($a,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ha,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>V(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:G,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:U,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:$,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},b0=[{id:1,user:{name:"رضا محمدی",avatar:"https://picsum.photos/id/1012/100/100",rating:4.8},title:"سفر هفتگی از تهران به تورنتو",origin:{country:"ایران",city:"تهران"},destination:{country:"کانادا",city:"تورنتو"},departureDate:"۱۴۰۳/۰۵/۱۰",arrivalDate:"۱۴۰۳/۰۵/۱۱",carryCapacity:7,vehicleTypes:["airplane"],datePosted:"۱ ساعت پیش"},{id:2,user:{name:"مریم حسینی",avatar:"https://picsum.photos/id/1013/100/100",rating:4.9},title:"حمل بار با خودرو شخصی از اصفهان به شیراز",origin:{country:"ایران",city:"اصفهان"},destination:{country:"ایران",city:"شیراز"},departureDate:"۱۴۰۳/۰۵/۱۲",arrivalDate:"۱۴۰۳/۰۵/۱۲",carryCapacity:20,vehicleTypes:["car"],datePosted:"۸ ساعت پیش"},{id:3,user:{name:"علی اکبری",avatar:"https://picsum.photos/id/1015/100/100",rating:4.5},title:"سفر با قطار از مشهد به تهران",origin:{country:"ایران",city:"مشهد"},destination:{country:"ایران",city:"تهران"},departureDate:"۱۴۰۳/۰۵/۱۵",arrivalDate:"۱۴۰۳/۰۵/۱۵",carryCapacity:15,vehicleTypes:["train"],datePosted:"۲ روز پیش"},{id:4,user:{name:"سارا نادری",avatar:"https://picsum.photos/id/1016/100/100",rating:5},title:"آماده حمل بار از آلمان به ایران",origin:{country:"آلمان",city:"برلین"},destination:{country:"ایران",city:"تهران"},departureDate:"۱۴۰۳/۰۶/۰۱",arrivalDate:"۱۴۰۳/۰۶/۰۱",carryCapacity:10,vehicleTypes:["airplane","bus"],datePosted:"۳ روز پیش"}],Fx=({onNavigate:c})=>{const[b,N]=y.useState(b0),[f,g]=y.useState(b0),[v,U]=y.useState(""),[S,T]=y.useState(""),[_,V]=y.useState(""),[O,J]=y.useState(""),[X,G]=y.useState(""),[$,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.origin.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.origin.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.destination.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.destination.city.toLowerCase().includes(X.toLowerCase()))),$){case"capacity_asc":m.sort((j,Y)=>j.carryCapacity-Y.carryCapacity);break;case"capacity_desc":m.sort((j,Y)=>Y.carryCapacity-j.carryCapacity);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,$,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"پیدا کردن همسفر"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"لیست افرادی که آماده همسفری و حمل مرسوله شما هستند را مشاهده کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Fi,{id:"searchQuery",label:"جستجو در عنوان",placeholder:"مثال: سفر از تهران...",value:v,onChange:m=>U(m.target.value),icon:ha}),a.jsx(Fi,{id:"originCountry",label:"کشور مبدا",placeholder:"مثال: ایران",value:S,onChange:m=>T(m.target.value),icon:pa}),a.jsx(Fi,{id:"originCity",label:"شهر مبدا",placeholder:"مثال: تهران",value:_,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(Fi,{id:"destinationCountry",label:"کشور مقصد",placeholder:"مثال: کانادا",value:O,onChange:m=>J(m.target.value),icon:pa}),a.jsx(Fi,{id:"destinationCity",label:"شهر مقصد",placeholder:"مثال: تورنتو",value:X,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(Wx,{value:$,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(ha,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(Kx,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ca,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"همسفری یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ همسفری با این مشخصات یافت نشد."})]})]})},Fi=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),Wx=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"capacity_asc",children:"ظرفیت حمل: کم به زیاد"}),a.jsx("option",{value:"capacity_desc",children:"ظرفیت حمل: زیاد به کم"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),Jx={airplane:ba,car:ao,bus:fh,train:mh},Kx=({id:c,user:b,title:N,origin:f,destination:g,departureDate:v,arrivalDate:U,carryCapacity:S,vehicleTypes:T,datePosted:_,onNavigate:V})=>a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("img",{src:b.avatar,alt:b.name,className:"w-12 h-12 rounded-full"}),a.jsxs("div",{className:"mr-3",children:[a.jsx("h3",{className:"font-bold text-gray-800 dark:text-white",children:b.name}),a.jsxs("div",{className:"flex items-center text-xs text-amber-500",children:[a.jsx("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})}),a.jsx("span",{className:"mr-1 font-bold",children:b.rating})]})]})]}),a.jsx("div",{className:"px-3 py-1 bg-custom-light-bg dark:bg-custom-dark-blue text-gray-500 dark:text-gray-400 text-xs font-bold rounded-full",children:_})]}),a.jsx("h4",{className:"text-lg font-semibold text-gray-800 dark:text-white mb-3 flex-grow",children:N}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Wi,{icon:Fe,label:"مبدا",value:`${f.city}, ${f.country}`}),a.jsx(Wi,{icon:Fe,label:"مقصد",value:`${g.city}, ${g.country}`}),a.jsx(Wi,{icon:Ar,label:"تاریخ حرکت",value:v}),a.jsx(Wi,{icon:Ar,label:"تاریخ رسیدن",value:U}),a.jsx(Wi,{icon:Va,label:"ظرفیت حمل",value:`${S} کیلوگرم`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"flex items-center justify-between mt-2 mb-4",children:[a.jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"وسیله نقلیه:"}),a.jsx("div",{className:"flex gap-2",children:T.map(O=>{const J=Jx[O];return a.jsx("div",{title:O,className:"w-6 h-6 p-1 flex items-center justify-center text-custom-purple bg-custom-purple/10 rounded-full",children:a.jsx(J,{className:"w-4 h-4"})},O)})})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>V("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(so,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>V("trip-detail",c.toString()),className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})}),Wi=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),Ix=({onNavigate:c})=>{const[b,N]=y.useState([]),[f,g]=y.useState(!1),[v,U]=y.useState(null),[S,T]=y.useState({title:"",department:"technical",priority:"medium",message:""}),_=$=>{const M=$.target.files;if(M){if(b.length+M.length>5){U("حداکثر ۵ فایل می‌توانید آپلود کنید");return}const m=Array.from(M).map(j=>({id:Date.now()+Math.random(),url:URL.createObjectURL(j),file:j}));N(j=>[...j,...m]),U(null)}},V=$=>{const M=b.find(m=>m.id===$);M&&URL.revokeObjectURL(M.url),N(m=>m.filter(j=>j.id!==$))},O=y.useCallback($=>{$.preventDefault(),$.stopPropagation();const M=$.dataTransfer.files;if(M&&M.length>0){if(b.length+M.length>5){U("حداکثر ۵ فایل می‌توانید آپلود کنید");return}const m=Array.from(M).map(j=>({id:Date.now()+Math.random(),url:URL.createObjectURL(j),file:j}));N(j=>[...j,...m]),U(null)}},[b.length]),J=$=>{$.preventDefault(),$.stopPropagation()},X=async $=>{if($.preventDefault(),g(!0),U(null),!S.title.trim()||!S.message.trim()){U("عنوان و متن پیام الزامی هستند"),g(!1);return}try{const M=localStorage.getItem("auth_token");if(!M)throw new Error("لطفاً ابتدا وارد شوید");const m=new FormData;m.append("title",S.title),m.append("department",S.department),m.append("priority",S.priority),m.append("message",S.message),b.forEach(z=>{m.append("attachments[]",z.file)});const j=await fetch("https://eino.eifa.site/users-api/public/api/tickets",{method:"POST",headers:{"X-Auth-Token":M},body:m}),Y=await j.json();if(!j.ok)throw new Error(Y.message||Y.errors?Object.values(Y.errors).flat().join(", "):"خطا در ارسال تیکت");c("tickets")}catch(M){U(M.message||"خطای ناشناخته رخ داد")}finally{g(!1)}},G=$=>{const{name:M,value:m}=$.target;T(j=>({...j,[M]:m}))};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[v&&a.jsxs("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg",children:[a.jsx("strong",{children:"خطا:"})," ",v]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ارسال تیکت جدید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مشکل یا پیشنهاد خود را با ما در میان بگذارید."})]}),a.jsxs("button",{onClick:()=>c("tickets"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:[a.jsx(uh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت به لیست"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{onSubmit:X,className:"space-y-8 bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Px,{icon:eo,id:"title",name:"title",placeholder:"مثال: مشکل در پرداخت",label:"عنوان تیکت",value:S.title,onChange:G,required:!0}),a.jsxs(v0,{icon:to,id:"department",name:"department",label:"دپارتمان",value:S.department,onChange:G,required:!0,children:[a.jsx("option",{value:"technical",children:"پشتیبانی فنی"}),a.jsx("option",{value:"financial",children:"مالی"}),a.jsx("option",{value:"suggestions",children:"پیشنهادات"})]})]}),a.jsxs(v0,{icon:Mn,id:"priority",name:"priority",label:"اولویت",value:S.priority,onChange:G,required:!0,children:[a.jsx("option",{value:"low",children:"کم"}),a.jsx("option",{value:"medium",children:"متوسط"}),a.jsx("option",{value:"high",children:"زیاد"})]}),a.jsx(ep,{icon:us,id:"message",name:"message",placeholder:"لطفا مشکل خود را با جزئیات کامل شرح دهید...",label:"متن پیام",value:S.message,onChange:G,required:!0}),a.jsx("button",{type:"submit",disabled:f,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2 disabled:bg-gray-400 disabled:cursor-not-allowed",children:f?a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):a.jsxs(a.Fragment,{children:[a.jsx(Ic,{className:"w-5 h-5"}),a.jsx("span",{children:"ارسال تیکت"})]})})]})}),a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"پیوست فایل (اختیاری)"}),a.jsxs("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:O,onDragOver:J,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Dn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"PNG, JPG, PDF, DOC, DOCX (حداکثر ۱۰MB)"}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:"حداکثر ۵ فایل"})]}),a.jsx("input",{id:"file-upload",type:"file",className:"hidden",multiple:!0,accept:"image/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",onChange:_})]})]}),b.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["فایل‌های پیوست شده (",b.length,"/5)"]}),a.jsx("div",{className:"space-y-3",children:b.map($=>a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg border border-gray-200 dark:border-gray-600",children:[a.jsxs("div",{className:"flex items-center gap-3 overflow-hidden flex-1",children:[a.jsx(gh,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),a.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[a.jsx("span",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:$.file.name}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[($.file.size/(1024*1024)).toFixed(2)," MB"]})]})]}),a.jsx("button",{type:"button",onClick:()=>V($.id),className:"p-1 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full flex-shrink-0 ml-2",children:a.jsx($a,{className:"w-4 h-4"})})]},$.id))})]})]})]})]})},Px=({id:c,name:b,icon:N,label:f,placeholder:g,value:v,onChange:U,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,name:b,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:g,value:v,onChange:U,required:S})]})]}),v0=({id:c,name:b,icon:N,label:f,children:g,value:v,onChange:U,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,name:b,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:U,required:S,children:g}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]}),ep=({id:c,name:b,icon:N,label:f,placeholder:g,value:v,onChange:U,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,name:b,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[150px] resize-y",placeholder:g,value:v,onChange:U,required:S})]})]}),tp=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("request"),[g,v]=y.useState([]),[U,S]=y.useState([]),[T,_]=y.useState("IRT"),[V,O]=y.useState(!1),[J,X]=y.useState({isOpen:!1,field:null}),[G,$]=y.useState(null),[M,m]=y.useState(""),[j,Y]=y.useState(""),[z,ce]=y.useState(""),[pe,K]=y.useState(""),[ne,Ce]=y.useState(""),[Se,de]=y.useState(""),[R,me]=y.useState(""),[ye,fe]=y.useState(""),[q,ie]=y.useState([]),[je,Ae]=y.useState([]),[_e,w]=y.useState(!1),[H,F]=y.useState(""),[xe,P]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(""),[E,te]=y.useState(""),re=G?`${G.lat.toFixed(5)}, ${G.lng.toFixed(5)}`:"",Ne=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}],Me=[{value:"electronics",label:"الکترونیک"},{value:"fashion",label:"مد و پوشاک"},{value:"books",label:"کتاب و رسانه"},{value:"home",label:"خانه و آشپزخانه"},{value:"beauty",label:"آرایشی و بهداشتی"},{value:"other",label:"سایر"}];y.useEffect(()=>()=>{[...g,...U].forEach(se=>URL.revokeObjectURL(se.url))},[g,U]);const We=(se,we)=>{const Ee=se.target.files;if(Ee){const ht=Array.from(Ee).map(he=>({id:Date.now()+Math.random(),url:URL.createObjectURL(he),file:he}));we==="request"?v(he=>[...he,...ht]):S(he=>[...he,...ht])}},Je=(se,we)=>{(we==="request"?v:S)(ht=>{const he=ht.find(it=>it.id===se);return he&&URL.revokeObjectURL(he.url),ht.filter(it=>it.id!==se)})},at=y.useCallback((se,we)=>{se.preventDefault(),se.stopPropagation();const Ee=se.dataTransfer.files;if(Ee&&Ee.length>0){const ht=Array.from(Ee).filter(he=>he.type.startsWith("image/")).map(he=>({id:Date.now()+Math.random(),url:URL.createObjectURL(he),file:he}));we==="request"?v(he=>[...he,...ht]):S(he=>[...he,...ht])}},[]),Bt=se=>{se.preventDefault(),se.stopPropagation()},Gt=se=>{X({isOpen:!0,field:se})},Vt=()=>{X({isOpen:!1,field:null})},yt=se=>{J.field==="delivery"&&$(se),Vt()},ea=async se=>{if(se.preventDefault(),w(!0),!H.trim()||Be===""||E===""){c("لطفاً فیلدهای اجباری (عنوان، قیمت کالا، هزینه پیشنهادی) را پر کنید."),w(!1);return}const we=new FormData;we.append("title",H.trim()),xe&&we.append("link",xe),Te&&we.append("description",Te),G&&(we.append("delivery_lat",G.lat.toString()),we.append("delivery_lng",G.lng.toString())),M&&we.append("delivery_country",M),j&&we.append("delivery_city",j),z&&we.append("delivery_address",z),we.append("item_price",Be.toString()),we.append("proposed_fee",E.toString()),we.append("currency",T),we.append("show_phone",V?"1":"0"),g.forEach(Ee=>we.append("images[]",Ee.file));try{const Ee=await It("https://eino.eifa.site/users-api/public/api/online-purchase/request",{method:"POST",body:we}),ht=await Ee.json();if(!Ee.ok){const he=ht.message||"خطا در ثبت درخواست";c(he);return}b("درخواست خرید با موفقیت ثبت شد!"),F(""),P(""),ze(""),$(null),m(""),Y(""),ce(""),k(""),te(""),_("IRT"),O(!1),v([])}catch(Ee){console.error("خطا در ارسال درخواست خرید:",Ee),c(Ee.message||"خطا در ارتباط با سرور")}finally{w(!1)}},ke=async se=>{if(se.preventDefault(),w(!0),!pe.trim()||!ne.trim()){c("لطفاً کشور و شهر خود را وارد کنید."),w(!1);return}const we=new FormData;we.append("country",pe.trim()),we.append("city",ne.trim()),ye&&we.append("service_title",ye),q.length>0&&q.forEach(Ee=>we.append("categories[]",Ee)),je.length>0&&je.forEach(Ee=>we.append("supported_sites[]",Ee)),Se&&we.append("fee_description",Se),R&&we.append("capabilities",R),U.length>0&&U.forEach(Ee=>we.append("images[]",Ee.file)),we.append("show_phone",V?"1":"0");try{const Ee=await It("https://eino.eifa.site/users-api/public/api/online-purchase/shopper",{method:"POST",body:we}),ht=await Ee.json();if(!Ee.ok){const he=ht.message||"خطا در ثبت اطلاعات";c(he);return}b("اطلاعات شما با موفقیت ثبت شد!"),K(""),Ce(""),fe(""),ie([]),Ae([]),de(""),me(""),S([]),O(!1)}catch(Ee){console.error("خطا در ثبت اطلاعات خریدار:",Ee),c(Ee.message||"خطا در ارتباط با سرور")}finally{w(!1)}};return y.useEffect(()=>{O(!1),N==="request"?(v([]),F(""),P(""),ze(""),$(null),m(""),Y(""),ce(""),k(""),te(""),_("IRT")):(S([]),K(""),Ce(""),fe(""),ie([]),Ae([]),de(""),me(""))},[N]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="request"?"ثبت درخواست خرید اینترنتی":"اعلام آمادگی برای انجام خرید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="request"?"اطلاعات کالای مورد نظر خود برای خرید را ثبت کنید.":"اطلاعات خود را برای پذیرش سفارشات خرید ثبت کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="accept"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("request"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="request"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"درخواست خرید",children:[a.jsx(Fs,{className:"h-5 w-5"}),a.jsx("span",{children:"درخواست خرید"})]}),a.jsxs("button",{type:"button",onClick:()=>f("accept"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="accept"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"قبول کردن خرید",children:[a.jsx(Ca,{className:"h-5 w-5"}),a.jsx("span",{children:"قبول کردن خرید"})]})]})})})]}),N==="request"?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"تصویر کالا"}),a.jsxs("label",{htmlFor:"file-upload-request",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:se=>at(se,"request"),onDragOver:Bt,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Dn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-request",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:se=>We(se,"request")})]})]}),g.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["پیش‌نمایش (",g.length," تصویر)"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:g.map(se=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:se.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Je(se.id,"request"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx($a,{className:"w-4 h-4"})})]},se.id))})]})]}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{className:"space-y-8",onSubmit:ea,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات کالا"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Ms,{icon:eo,id:"title",placeholder:"مثال: گوشی موبایل سامسونگ",label:"عنوان کالا *",value:H,onChange:se=>F(se.target.value),required:!0}),a.jsx(Ms,{icon:i0,id:"link",placeholder:"https://example.com/product",label:"لینک خرید (اختیاری)",value:xe,onChange:se=>P(se.target.value)}),a.jsx(Ku,{icon:us,id:"description",placeholder:"جزئیات بیشتر در مورد کالا، رنگ، مدل، سایز و...",label:"توضیحات (اختیاری)",value:Te,onChange:se=>ze(se.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. محل تحویل کالا"}),a.jsx("div",{className:"mt-6",children:a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد تحویل"}),a.jsx(sp,{onButtonClick:()=>Gt("delivery"),value:re,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه (اختیاری)"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ms,{icon:pa,id:"destination_country",placeholder:"مثال: ایران",label:"کشور (اختیاری)",value:M,onChange:se=>m(se.target.value)}),a.jsx(Ms,{icon:Fe,id:"destination_city",placeholder:"مثال: تهران",label:"شهر (اختیاری)",value:j,onChange:se=>Y(se.target.value)})]}),a.jsx(Ms,{icon:Ts,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی (اختیاری)",value:z,onChange:se=>ce(se.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ms,{icon:ya,id:"item_price",placeholder:"مثال: 5000000",label:"قیمت کالا *",type:"number",value:Be,onChange:se=>k(se.target.value?Number(se.target.value):""),required:!0}),a.jsx(Ms,{icon:ya,id:"proposed_fee",placeholder:"مثال: 200000",label:"هزینه پیشنهادی انجام *",type:"number",value:E,onChange:se=>te(se.target.value?Number(se.target.value):""),required:!0})]}),a.jsx(ap,{id:"currency",icon:ya,label:"واحد پولی *",value:T,onChange:se=>_(se.target.value),children:Ne.map(({value:se,label:we})=>a.jsx("option",{value:se,children:we},se))}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(j0,{enabled:V,setEnabled:O})]})]})]}),a.jsx("button",{type:"submit",disabled:_e,className:"w-full bg-custom-purple hover:bg-custom-light-purple disabled:bg-gray-400 text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50",children:_e?"در حال ثبت...":"ثبت درخواست خرید"})]})})]}):a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{className:"space-y-8",onSubmit:ke,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. عنوان خدمات شما"}),a.jsx(Ms,{icon:eo,id:"service_title",label:"عنوان خدمات (اختیاری)",placeholder:"مثال: خرید از آمازون، خرید لپ‌تاپ و موبایل",value:ye,onChange:se=>fe(se.target.value)})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. دسته‌بندی کالاهای قابل خرید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"دسته‌بندی‌هایی که می‌توانید از آن‌ها خرید کنید را انتخاب نمایید:"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Me.map(se=>a.jsxs("label",{className:`flex items-center justify-between p-4 border rounded-lg cursor-pointer transition-all duration-200 ${q.includes(se.value)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("span",{className:`font-semibold transition-colors ${q.includes(se.value)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:se.label}),a.jsx("input",{type:"checkbox",checked:q.includes(se.value),onChange:we=>{we.target.checked?ie(Ee=>[...Ee,se.value]):ie(Ee=>Ee.filter(ht=>ht!==se.value))},className:"sr-only"}),q.includes(se.value)&&a.jsx(G0,{className:"w-5 h-5 text-custom-purple"})]},se.value))})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. سایت‌هایی که می‌توانید از آن‌ها خرید کنید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx(Ms,{icon:i0,id:"supported_sites",label:"سایت‌ها (با کاما جدا کنید)",placeholder:"مثال: amazon.com, aliexpress.com, ebay.com",value:je.join(", "),onChange:se=>{const Ee=se.target.value.split(",").map(ht=>ht.trim()).filter(ht=>ht.length>0);Ae(Ee)}}),a.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"نام دامنه سایت‌ها را با کاما جدا کنید. (اختیاری)"})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۴. محل فعالیت شما"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ms,{icon:pa,id:"shopper_country",placeholder:"مثال: آمریکا",label:"کشور *",value:pe,onChange:se=>K(se.target.value),required:!0}),a.jsx(Ms,{icon:Fe,id:"shopper_city",placeholder:"مثال: نیویورک",label:"شهر *",value:ne,onChange:se=>Ce(se.target.value),required:!0})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۵. تصویر (اختیاری)"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("label",{htmlFor:"file-upload-shopper",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:se=>at(se,"shopper"),onDragOver:Bt,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Dn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"آپلود عکس"})," (اختیاری)"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-shopper",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:se=>We(se,"shopper")})]}),U.length>0&&a.jsxs("div",{className:"pt-4",children:[a.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["پیش‌نمایش (",U.length," تصویر):"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:U.map(se=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:se.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Je(se.id,"shopper"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx($a,{className:"w-4 h-4"})})]},se.id))})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۶. جزئیات خدمات"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Ku,{icon:ya,id:"fee_description",label:"توضیحات کارمزد (اختیاری)",placeholder:"نحوه محاسبه کارمزد خود را توضیح دهید (مثلاً: درصدی از قیمت کالا، مبلغ ثابت و...)",value:Se,onChange:se=>de(se.target.value)}),a.jsx(Ku,{icon:us,id:"capabilities",label:"توضیحات بیشتر (اختیاری)",placeholder:"اطلاعات بیشتر در مورد خدماتی که ارائه می‌دهید، تجربیات قبلی، شرایط خاص و...",value:R,onChange:se=>me(se.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۷. اطلاعات تماس"}),a.jsx("div",{className:"mt-6",children:a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(j0,{enabled:V,setEnabled:O})]})})]}),a.jsx("button",{type:"submit",disabled:_e,className:"w-full bg-custom-purple hover:bg-custom-light-purple disabled:bg-gray-400 text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50",children:_e?"در حال ثبت...":"ثبت آمادگی برای خرید"})]})}),a.jsx(lp,{isOpen:J.isOpen,onClose:Vt,onConfirm:yt,field:J.field})]})},Ms=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:U,min:S,step:T,required:_=!1})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:U,min:S,step:T,required:_})]})]}),Ku=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),ap=({id:c,icon:b,label:N,children:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,children:f}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]}),sp=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"انتخاب"})]})]}),j0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),lp=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),U=y.useRef(null),[S,T]=y.useState(null),[_,V]=y.useState(""),[O,J]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),V("")};if(U.current&&!g.current){const j=L.map(U.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",Y=>{const{lat:z,lng:ce}=Y.latlng;T({lat:z,lng:ce}),v.current?v.current.setLatLng(Y.latlng):v.current=L.marker(Y.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){J(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:Y,lon:z}=j[0],ce=parseFloat(Y),pe=parseFloat(z),K={lat:ce,lng:pe};T(K),g.current&&(g.current.setView(K,15),v.current?v.current.setLatLng(K):v.current=L.marker(K).addTo(g.current))}else alert("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),alert("خطایی در جستجوی مکان رخ داد.")}finally{J(!1)}}},G=async()=>{if(!navigator.geolocation){alert("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){alert("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید. لطفاً آن را در تنظیمات مرورگر خود فعال کنید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:Y}=m.coords,z={lat:j,lng:Y};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}alert(j)})},$=()=>{S&&N(S)};return c?a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ","ثبت موقعیت تحویل"]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx($a,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ha,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>V(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:G,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:U,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:$,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]}):null},N0=[{id:1,title:"گوشی موبایل سامسونگ S23 Ultra",imageUrl:"https://picsum.photos/seed/s23ultra/400/300",purchaseLocation:{country:"آمریکا",city:"نیویورک"},deliveryLocation:{country:"ایران",city:"تهران"},itemPrice:1199,proposedFee:100,currency:"USD",datePosted:"۲ ساعت پیش"},{id:2,title:"کتاب Clean Architecture",imageUrl:"https://picsum.photos/seed/cleanarch/400/300",purchaseLocation:{country:"کانادا",city:"تورنتو"},deliveryLocation:{country:"ایران",city:"اصفهان"},itemPrice:45,proposedFee:15,currency:"CAD",datePosted:"۱ روز پیش"},{id:3,title:"پردازنده گرافیکی Nvidia RTX 4080",imageUrl:"https://picsum.photos/seed/rtx4080/400/300",purchaseLocation:{country:"آمریکا",city:"لس آنجلس"},deliveryLocation:{country:"ایران",city:"شیراز"},itemPrice:1250,proposedFee:150,currency:"USD",datePosted:"۳ روز پیش"},{id:4,title:"ست لگو Star Wars",imageUrl:"https://picsum.photos/seed/legosw/400/300",purchaseLocation:{country:"آلمان",city:"برلین"},deliveryLocation:{country:"ایران",city:"مشهد"},itemPrice:200,proposedFee:40,currency:"EUR",datePosted:"۵ روز پیش"},{id:5,title:"کیف دستی زنانه برند Coach",imageUrl:"https://picsum.photos/seed/coachbag/400/300",purchaseLocation:{country:"آمریکا",city:"نیویورک"},deliveryLocation:{country:"ایران",city:"تهران"},itemPrice:350,proposedFee:60,currency:"USD",datePosted:"۱ هفته پیش"},{id:6,title:"کفش ورزشی نایکی Air Jordan",imageUrl:"https://picsum.photos/seed/jordans/400/300",purchaseLocation:{country:"کانادا",city:"ونکوور"},deliveryLocation:{country:"ایران",city:"تبریز"},itemPrice:180,proposedFee:35,currency:"CAD",datePosted:"۲ هفته پیش"}],rp=({onNavigate:c})=>{const[b,N]=y.useState(N0),[f,g]=y.useState(N0),[v,U]=y.useState(""),[S,T]=y.useState(""),[_,V]=y.useState(""),[O,J]=y.useState(""),[X,G]=y.useState(""),[$,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.purchaseLocation.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.purchaseLocation.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.deliveryLocation.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.deliveryLocation.city.toLowerCase().includes(X.toLowerCase()))),$){case"fee_asc":m.sort((j,Y)=>j.proposedFee-Y.proposedFee);break;case"fee_desc":m.sort((j,Y)=>Y.proposedFee-j.proposedFee);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,$,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"قبول کردن خرید اینترنتی"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"لیست تمام خریدهای ثبت شده توسط کاربران را مشاهده کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Ji,{id:"searchQuery",label:"عنوان کالا",placeholder:"مثال: گوشی موبایل...",value:v,onChange:m=>U(m.target.value),icon:ha}),a.jsx(Ji,{id:"purchaseCountry",label:"کشور خرید",placeholder:"مثال: آمریکا",value:S,onChange:m=>T(m.target.value),icon:pa}),a.jsx(Ji,{id:"purchaseCity",label:"شهر خرید",placeholder:"مثال: نیویورک",value:_,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(Ji,{id:"deliveryCountry",label:"کشور تحویل",placeholder:"مثال: ایران",value:O,onChange:m=>J(m.target.value),icon:pa}),a.jsx(Ji,{id:"deliveryCity",label:"شهر تحویل",placeholder:"مثال: تهران",value:X,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(np,{value:$,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(ha,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(ip,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Fs,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"درخواستی یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ درخواستی با این مشخصات یافت نشد."})]})]})},Ji=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),np=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"fee_asc",children:"کارمزد: کم به زیاد"}),a.jsx("option",{value:"fee_desc",children:"کارمزد: زیاد به کم"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),ip=({id:c,title:b,imageUrl:N,purchaseLocation:f,deliveryLocation:g,itemPrice:v,proposedFee:U,currency:S,datePosted:T,onNavigate:_})=>a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:N,alt:b,className:"w-full h-48 object-cover"}),a.jsx("div",{className:"absolute top-0 right-0 m-2 px-3 py-1 bg-black/60 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:T})]}),a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white mb-3 flex-grow",children:b}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Zc,{icon:Fs,label:"خرید از",value:`${f.city}, ${f.country}`}),a.jsx(Zc,{icon:Fe,label:"تحویل در",value:`${g.city}, ${g.country}`}),a.jsx(Zc,{icon:ya,label:"قیمت کالا",value:`${v.toLocaleString()} ${S}`}),a.jsx(Zc,{icon:ya,label:"کارمزد پیشنهادی",value:`${U.toLocaleString()} ${S}`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>_("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(so,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>_("purchase-detail",c.toString()),className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})]}),Zc=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),ph=({open:c,title:b="حذف آیتم",message:N="آیا از حذف این مورد مطمئن هستید؟ این عملیات غیرقابل بازگشت است.",onCancel:f,onConfirm:g})=>c?a.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-md rounded-2xl shadow-xl p-6 animate-scale-in relative",children:[a.jsx("h3",{className:"text-xl font-bold text-gray-800 dark:text-white mb-4",children:b}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed mb-6",children:N}),a.jsxs("div",{className:"flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:f,className:"px-4 py-2 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200",children:"انصراف"}),a.jsx("button",{onClick:g,className:"px-4 py-2 rounded-lg bg-red-600 hover:bg-red-700 text-white",children:"حذف کن"})]})]})}):null,op=({onNavigate:c,showSuccess:b,showError:N})=>{var de;const[f,g]=y.useState(""),[v,U]=y.useState("all"),[S,T]=y.useState("all"),[_,V]=y.useState([]),[O,J]=y.useState([]),[X,G]=y.useState(!0),[$,M]=y.useState(null),[m,j]=y.useState(null),[Y,z]=y.useState({open:!1,item:null}),ce=R=>{if(!R)return"تاریخ نامعلوم";const me=new Date(R),fe=Math.floor((new Date().getTime()-me.getTime())/(1e3*60*60));return fe<1?"چند دقیقه پیش":fe<24?`${fe} ساعت پیش`:fe<168?`${Math.floor(fe/24)} روز پیش`:`${Math.floor(fe/168)} هفته پیش`},pe=async()=>{var R,me,ye,fe,q,ie;try{G(!0),M(null);const Ae=(await(await It("https://eino.eifa.site/users-api/public/api/online-purchase/my-requests")).json()).data||[],_e=await It("https://eino.eifa.site/users-api/public/api/online-purchase/my-shopper");if(!_e.ok)throw new Error("خطا در دریافت پروفایل خریدار");const H=(await _e.json()).data,F=Ae.map(P=>{var Te,ze,Be,k,E;return{id:P.id.toString(),type:"request",title:P.title||"بدون عنوان",requestDate:ce(P.created_at),status:P.status==="active"?"active":"pending",fee:((Te=P.proposed_fee)==null?void 0:Te.toString())||"0",currency:P.currency||"IRT",location:[P.delivery_city,P.delivery_country].filter(Boolean).join("، ")||"—",imageUrl:((Be=(ze=P.images)==null?void 0:ze[0])==null?void 0:Be.url)||((E=(k=P.images)==null?void 0:k[0])!=null&&E.path?`https://eino.eifa.site/users-api/public/${P.images[0].path}`:void 0)}}),xe=[];if(H&&H.id){const P=(R=H.service_title)!=null&&R.trim()?H.service_title.trim():`آماده خرید از ${H.country||"کشور نامشخص"}`;xe.push({id:H.id.toString(),type:"offer",title:P,requestDate:ce(H.created_at||H.updated_at),status:H.status==="active"?"active":"pending",fee:((me=H.fee_description)==null?void 0:me.trim())||"توافقی",currency:"",shopperLocation:[(ye=H.city)==null?void 0:ye.trim(),(fe=H.country)==null?void 0:fe.trim()].filter(Boolean).join("، ")||"—",imageUrl:(ie=(q=H.images)==null?void 0:q[0])==null?void 0:ie.url})}V([...F,...xe])}catch(je){console.error("خطا در دریافت داده‌ها:",je),M(je.message||"خطا در بارگذاری اطلاعات")}finally{G(!1)}};y.useEffect(()=>{pe()},[]),y.useEffect(()=>{const R=f.toLowerCase(),me=_.filter(ye=>{const fe=ye.title.toLowerCase().includes(R),q=v==="all"||ye.status===v,ie=S==="all"||ye.type===S;return fe&&q&&ie});J(me)},[f,v,S,_]);const K=R=>{console.log("🔴 DELETE CLICKED:",R),z({open:!0,item:R})},ne=()=>{z({open:!1,item:null})},Ce=async()=>{const R=Y.item;if(R){j(R.id);try{const me=R.type==="request"?`online-purchase/request/${R.id}`:`online-purchase/shopper/${R.id}`,ye=await It(`https://eino.eifa.site/users-api/public/api/${me}`,{method:"DELETE"});if(!ye.ok){const fe=await ye.json();throw new Error(fe.message||"خطا در حذف")}b(R.type==="request"?"درخواست خرید با موفقیت حذف شد":"پروفایل خریدار با موفقیت حذف شد"),V(fe=>fe.filter(q=>q.id!==R.id)),z({open:!1,item:null})}catch(me){N(me.message||"خطا در حذف آیتم")}finally{j(null)}}},Se=R=>{R.type==="request"?c("purchase-request-detail",R.id,{isOwnerView:!0}):c("purchase-shopper-detail",R.id,{isOwnerView:!0})};return X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال بارگذاری..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):$?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در بارگذاری اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:$}),a.jsx("button",{onClick:pe,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"درخواست‌های خرید و پروفایل خریداری شما"})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در فعالیت‌ها...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:R=>g(R.target.value)}),a.jsx(ha,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:R=>U(R.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:R=>T(R.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"request",children:"درخواست خرید"}),a.jsx("option",{value:"offer",children:"قبول کردن خرید"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل فعالیت‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.length})]}),a.jsx(Fs,{className:"w-8 h-8 text-custom-purple"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"درخواست‌های خرید"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="request").length})]}),a.jsx(Fs,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"پروفایل خریدار"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="offer").length})]}),a.jsx(Ca,{className:"w-8 h-8 text-custom-orange"})]})})]}),a.jsx("div",{className:"space-y-6",children:O.length>0?O.map(R=>a.jsx(cp,{item:R,onViewDetails:Se,onDelete:K,isDeleting:m===R.id},`${R.type}-${R.id}`)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Fs,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"فعالیتی یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"شما هنوز درخواست یا پروفایل خریداری ثبت نکرده‌اید.":"هیچ فعالیتی با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-online-purchase"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین فعالیت"})]})}),a.jsx(ph,{open:Y.open,title:((de=Y.item)==null?void 0:de.type)==="request"?"حذف درخواست خرید":"حذف پروفایل خریدار",message:Y.item?`آیا از حذف "${Y.item.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`:"آیا مطمئن هستید؟",onCancel:ne,onConfirm:Ce})]})},cp=({item:c,onViewDetails:b,onDelete:N,isDeleting:f})=>{const g=c.type==="request",v=()=>{switch(c.status){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"rejected":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500",children:"رد شده"});default:return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500",children:c.status})}};return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32",children:c.imageUrl?a.jsx("img",{src:c.imageUrl,alt:c.title,className:"w-full h-full object-cover rounded-xl",onError:U=>{const S=U.currentTarget.parentElement;S&&(S.innerHTML=`
                                    <div class="w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center">
                                        <svg class="w-16 h-16 text-custom-purple/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                        </svg>
                                    </div>
                                `)}}):a.jsx("div",{className:"w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:g?a.jsx(Fs,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(Ca,{className:"w-16 h-16 text-custom-purple/50"})})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${g?"text-custom-cyan":"text-custom-orange"}`,children:[g?a.jsx(Fs,{className:"w-5 h-5"}):a.jsx(Ca,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:g?"درخواست خرید":"قبول کردن خرید"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:c.title})]}),a.jsx("div",{className:"flex-shrink-0",children:v()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(Iu,{icon:lo,label:"تاریخ ثبت",value:c.requestDate}),a.jsx(Iu,{icon:ya,label:g?"هزینه پیشنهادی":"شرایط کارمزد",value:`${c.fee} ${c.currency}`.trim(),valueClassName:g?"text-green-600 dark:text-green-400":"text-gray-800 dark:text-gray-200"}),a.jsx(Iu,{icon:Fe,label:g?"محل تحویل":"محل فعالیت",value:g?c.location:c.shopperLocation})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>N(c),disabled:f,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:f?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsxs(a.Fragment,{children:[a.jsx($a,{className:"w-4 h-4"}),a.jsx("span",{children:"حذف"})]})}),a.jsx("button",{onClick:()=>b(c),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},Iu=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"-"})]}),dp=({onNavigate:c,showSuccess:b,showError:N})=>{var de;const[f,g]=y.useState(""),[v,U]=y.useState("all"),[S,T]=y.useState("all"),[_,V]=y.useState([]),[O,J]=y.useState([]),[X,G]=y.useState(!0),[$,M]=y.useState(null),[m,j]=y.useState(null),[Y,z]=y.useState({open:!1,item:null}),ce=R=>{if(!R)return"تاریخ نامعلوم";const me=new Date(R),fe=Math.floor((new Date().getTime()-me.getTime())/(1e3*60*60));return fe<1?"چند دقیقه پیش":fe<24?`${fe} ساعت پیش`:fe<168?`${Math.floor(fe/24)} روز پیش`:`${Math.floor(fe/168)} هفته پیش`},pe=async()=>{try{G(!0),M(null);const R=await It("https://eino.eifa.site/users-api/public/api/shipments/my-list");if(!R.ok)throw new Error("خطا در دریافت لیست مرسوله‌ها");const me=await R.json();V(me.data||[])}catch(R){console.error("خطا در دریافت داده‌ها:",R),M(R.message||"خطا در بارگذاری اطلاعات")}finally{G(!1)}};y.useEffect(()=>{pe()},[]),y.useEffect(()=>{const R=f.toLowerCase(),me=_.filter(ye=>{const fe=ye.title||ye.origin_city.toLowerCase().includes(R)||ye.destination_city.toLowerCase().includes(R),q=v==="all"||ye.status===v,ie=S==="all"||ye.type===S;return fe&&q&&ie});J(me)},[f,v,S,_]);const K=R=>{z({open:!0,item:R})},ne=async()=>{if(!Y.item)return;const R=Y.item;j(R.id),z({open:!1,item:null});try{const me=await It(`https://eino.eifa.site/users-api/public/api/shipments/${R.id}`,{method:"DELETE"});if(!me.ok){const ye=await me.json();throw new Error(ye.message||"خطا در حذف")}b("مرسوله با موفقیت حذف شد"),V(ye=>ye.filter(fe=>fe.id!==R.id))}catch(me){N(me.message||"خطا در حذف مرسوله")}finally{j(null)}},Ce=()=>{z({open:!1,item:null})},Se=R=>{c("shipment-detail",R.id,{isOwnerView:!0})};return X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال بارگذاری..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):$?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در بارگذاری اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:$}),a.jsx("button",{onClick:pe,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مرسولات و سفرهای ثبت شده خود را مدیریت کنید."})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در مرسوله‌ها...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:R=>g(R.target.value)}),a.jsx(ha,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:R=>U(R.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"rejected",children:"رد شده"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:R=>T(R.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"send",children:"ارسال مرسوله"}),a.jsx("option",{value:"carry",children:"حمل مرسوله (سفر)"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل مرسوله‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.length})]}),a.jsx(Ws,{className:"w-8 h-8 text-custom-purple"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"ارسال مرسوله"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="send").length})]}),a.jsx(Ws,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"سفرها (حمل)"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="carry").length})]}),a.jsx(ba,{className:"w-8 h-8 text-custom-orange"})]})})]}),a.jsx("div",{className:"space-y-6",children:O.length>0?O.map(R=>a.jsx(up,{item:R,formatDate:ce,onViewDetails:Se,onDelete:K,isDeleting:m===R.id},R.id)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ws,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"مرسوله‌ای یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"شما هنوز مرسوله یا سفری ثبت نکرده‌اید.":"هیچ مرسوله‌ای با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-shipment"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین مرسوله"})]})}),a.jsx(ph,{open:Y.open,title:"حذف مرسوله",message:`آیا از حذف "${(de=Y.item)==null?void 0:de.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`,onCancel:Ce,onConfirm:ne})]})},up=({item:c,formatDate:b,onViewDetails:N,onDelete:f,isDeleting:g})=>{const v=c.type==="send",U=()=>{switch(c.status){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"rejected":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500",children:"رد شده"});default:return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500",children:c.status})}},S=()=>[c.origin_city,c.origin_country].filter(Boolean).join("، ")||"—",T=()=>[c.destination_city,c.destination_country].filter(Boolean).join("، ")||"—",_=()=>{if(c.price_type==="negotiable")return"توافقی";if(c.amount&&c.currency){const V={IRT:"تومان",USD:"دلار",CAD:"دلار کانادا",IQD:"دینار"};return`${c.amount} ${V[c.currency]||c.currency}`}return"—"};return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32",children:v&&c.images&&c.images.length>0?a.jsx("img",{src:c.images[0].url,alt:c.title,className:"w-full h-full object-cover rounded-xl",onError:V=>{const O=V.currentTarget.parentElement;O&&(O.innerHTML=`
                                    <div class="w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center">
                                        <svg class="w-16 h-16 text-custom-purple/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
                                        </svg>
                                    </div>
                                `)}}):a.jsx("div",{className:"w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:v?a.jsx(Ws,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(ba,{className:"w-16 h-16 text-custom-purple/50"})})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${v?"text-custom-cyan":"text-custom-orange"}`,children:[v?a.jsx(Ws,{className:"w-5 h-5"}):a.jsx(ba,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:v?"ارسال مرسوله":"حمل مرسوله (سفر)"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:c.title})]}),a.jsx("div",{className:"flex-shrink-0",children:U()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(Nn,{icon:lo,label:"تاریخ ثبت",value:b(c.created_at)}),a.jsx(Nn,{icon:Fe,label:"مبدأ",value:S()}),a.jsx(Nn,{icon:Fe,label:"مقصد",value:T()}),v?a.jsx(Nn,{icon:Va,label:"وزن",value:c.weight?`${c.weight} کیلوگرم`:"—"}):a.jsx(Nn,{icon:Va,label:"ظرفیت حمل",value:c.carry_weight_capacity?`${c.carry_weight_capacity} کیلوگرم`:"—"}),a.jsx(Nn,{icon:ya,label:"قیمت",value:_(),valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>f(c),disabled:g,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:g?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsxs(a.Fragment,{children:[a.jsx($a,{className:"w-4 h-4"}),a.jsx("span",{children:"حذف"})]})}),a.jsx("button",{onClick:()=>N(c),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},Nn=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"—"})]}),hp=({onNavigate:c,showSuccess:b,showError:N})=>{var Se,de;const[f,g]=y.useState(""),[v,U]=y.useState("all"),[S,T]=y.useState("all"),[_,V]=y.useState([]),[O,J]=y.useState(!0),[X,G]=y.useState(null),[$,M]=y.useState(null),[m,j]=y.useState({open:!1,item:null}),Y=async()=>{var R,me;try{J(!0),G(null);const ye=await It("https://eino.eifa.site/users-api/public/api/trips/my-trips"),fe=await It("https://eino.eifa.site/users-api/public/api/trips/my-companions");if(!ye.ok||!fe.ok)throw new Error("خطا در دریافت اطلاعات");const q=await ye.json(),ie=await fe.json(),je=((R=q.data)==null?void 0:R.map(w=>({id:w.id.toString(),type:"trip",title:`سفر از ${w.origin_city} به ${w.destination_city}`,requestDate:ce(w.created_at),status:z(w.status),origin:`${w.origin_city}, ${w.origin_country}`,destination:`${w.destination_city}, ${w.destination_country}`,departureDate:w.departure_date,capacity:w.capacity,created_at:w.created_at,origin_country:w.origin_country,origin_city:w.origin_city,destination_country:w.destination_country,destination_city:w.destination_city,vehicle_type:w.vehicle_type,description:w.description,show_phone:w.show_phone})))||[],Ae=((me=ie.data)==null?void 0:me.map(w=>({id:w.id.toString(),type:"companion",title:`همسفر برای مسیر ${w.origin_city} به ${w.destination_city}`,requestDate:ce(w.created_at),status:z(w.status),origin:`${w.origin_city}, ${w.origin_country}`,destination:`${w.destination_city}, ${w.destination_country}`,departureDate:w.available_from,capacity:w.capacity,created_at:w.created_at,origin_country:w.origin_country,origin_city:w.origin_city,destination_country:w.destination_country,destination_city:w.destination_city,vehicle_types:w.vehicle_types,description:w.description,show_phone:w.show_phone})))||[],_e=[...je,...Ae];V(_e)}catch(ye){G(ye.message||"خطا در دریافت اطلاعات"),console.error("Error fetching user trips:",ye)}finally{J(!1)}},z=R=>{switch(R){case"active":return"active";case"completed":return"completed";case"cancelled":return"completed";case"inactive":return"completed";default:return"pending"}},ce=R=>{if(!R)return"تاریخ نامعلوم";const me=new Date(R),fe=new Date().getTime()-me.getTime(),q=Math.floor(fe/(1e3*60)),ie=Math.floor(fe/(1e3*60*60)),je=Math.floor(fe/(1e3*60*60*24));return q<60?`${q} دقیقه پیش`:ie<24?`${ie} ساعت پیش`:je<7?`${je} روز پیش`:new Date(R).toLocaleDateString("fa-IR")},pe=_.filter(R=>{const me=f.toLowerCase(),ye=R.title.toLowerCase().includes(me)||R.origin.toLowerCase().includes(me)||R.destination.toLowerCase().includes(me),fe=v==="all"||R.status===v,q=S==="all"||R.type===S;return ye&&fe&&q});y.useEffect(()=>{Y()},[]);const K=R=>{j({open:!0,item:R})},ne=async()=>{if(!m.item)return;const R=m.item;M(R.id),j({open:!1,item:null});try{const me=R.type==="trip"?"trip":"companion",ye=await It(`https://eino.eifa.site/users-api/public/api/trips/${me}/${R.id}`,{method:"DELETE"});if(!ye.ok){const fe=await ye.json();throw new Error(fe.message||"خطا در حذف")}b(R.type==="trip"?"سفر با موفقیت حذف شد":"همسفری با موفقیت حذف شد"),V(fe=>fe.filter(q=>q.id!==R.id))}catch(me){N(me.message||"خطا در حذف آیتم")}finally{M(null)}},Ce=()=>{j({open:!1,item:null})};return O?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال دریافت اطلاعات..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در دریافت اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:X}),a.jsx("button",{onClick:Y,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"سفرها و اعلام آمادگی‌های همسفری خود را مدیریت کنید."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل سفرها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="trip").length})]}),a.jsx(ba,{className:"w-8 h-8 text-custom-orange"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل همسفرها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.type==="companion").length})]}),a.jsx(Ca,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"فعال"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(R=>R.status==="active").length})]}),a.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:a.jsx("span",{className:"text-white text-sm",children:"✓"})})]})})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در عنوان، مبدأ یا مقصد...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:R=>g(R.target.value)}),a.jsx(ha,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:R=>U(R.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"completed",children:"انجام شده"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:R=>T(R.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"trip",children:"سفرهای من"}),a.jsx("option",{value:"companion",children:"همسفری‌های من"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsx("div",{className:"space-y-6",children:pe.length>0?pe.map(R=>a.jsx(fp,{request:R,onNavigate:c,onDelete:K,isDeleting:$===R.id},`${R.type}-${R.id}`)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(ba,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"سفری یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"هنوز هیچ سفری ثبت نکرده‌اید.":"هیچ سفری با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-trip"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین سفر"})]})}),a.jsx(ph,{open:m.open,title:((Se=m.item)==null?void 0:Se.type)==="trip"?"حذف سفر":"حذف همسفری",message:`آیا از حذف "${(de=m.item)==null?void 0:de.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`,onCancel:Ce,onConfirm:ne})]})},fp=({request:c,onNavigate:b,onDelete:N,isDeleting:f})=>{const{id:g,type:v,title:U,requestDate:S,status:T,origin:_,destination:V,departureDate:O,capacity:J}=c,X=()=>{switch(T){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"completed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400",children:"انجام شده"})}},G=v==="trip";return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32 bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:G?a.jsx(ba,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(Ca,{className:"w-16 h-16 text-custom-purple/50"})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${G?"text-custom-orange":"text-custom-cyan"}`,children:[G?a.jsx(ba,{className:"w-5 h-5"}):a.jsx(Ca,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:G?"سفر":"همسفری"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:U})]}),a.jsx("div",{className:"flex-shrink-0",children:X()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(Ki,{icon:lo,label:"تاریخ ثبت",value:S}),a.jsx(Ki,{icon:Fe,label:"مبدأ",value:_}),a.jsx(Ki,{icon:Fe,label:"مقصد",value:V}),a.jsx(Ki,{icon:Ar,label:"تاریخ حرکت",value:O}),G&&J!==void 0&&a.jsx(Ki,{icon:Va,label:"ظرفیت",value:`${J} کیلوگرم`})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>N(c),disabled:f,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:f?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsx("span",{children:"حذف"})}),a.jsx("button",{onClick:()=>b("trip-detail",{tripId:g,type:v},{isOwnerView:!0}),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},Ki=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"-"})]}),w0=[{id:1,user:{name:"علی رضایی",avatar:"https://picsum.photos/id/1005/100/100",online:!0},lastMessage:"باشه حتما، فردا هماهنگ می‌کنم.",timestamp:"۵ دقیقه پیش",unreadCount:2,messages:[{id:1,text:"سلام، بسته من کی به دستم میرسه؟",timestamp:"۱۰:۳۰",sender:"them"},{id:2,text:"سلام علی جان، لطفاً شماره سفارشت رو بفرست.",timestamp:"۱۰:۳۱",sender:"me"},{id:3,text:"شماره سفارش ۱۲۳۴۵ هست.",timestamp:"۱۰:۳۲",sender:"them"},{id:4,text:"ممنون. در حال بررسی هستم...",timestamp:"۱۰:۳۳",sender:"me"},{id:5,text:"باشه حتما، فردا هماهنگ می‌کنم.",timestamp:"۱۰:۳۵",sender:"them"}]},{id:2,user:{name:"زهرا احمدی",avatar:"https://picsum.photos/id/1011/100/100",online:!1},lastMessage:"ممنونم از راهنماییتون.",timestamp:"۲ ساعت پیش",unreadCount:0,messages:[{id:1,text:"سلام، وقت بخیر",timestamp:"۰۸:۱۵",sender:"them"},{id:2,text:"سلام خانم احمدی، در خدمتم.",timestamp:"۰۸:۱۶",sender:"me"},{id:3,text:"میخواستم در مورد وضعیت سفرم بپرسم.",timestamp:"۰۸:۱۷",sender:"them"},{id:4,text:"سفر شما طبق برنامه در حال انجام است.",timestamp:"۰۸:۲۰",sender:"me"},{id:5,text:"ممنونم از راهنماییتون.",timestamp:"۰۸:۲۱",sender:"them"}]},{id:3,user:{name:"پشتیبانی",avatar:"https://picsum.photos/id/1025/100/100",online:!0},lastMessage:"خواهش میکنم، روز خوبی داشته باشید.",timestamp:"دیروز",unreadCount:0,messages:[{id:1,text:"مشکل گزارش شده شما بررسی و حل شد.",timestamp:"دیروز",sender:"them"},{id:2,text:"خیلی ممنون از پیگیری شما.",timestamp:"دیروز",sender:"me"},{id:3,text:"خواهش میکنم، روز خوبی داشته باشید.",timestamp:"دیروز",sender:"them"}]},{id:4,user:{name:"محمد قاسمی",avatar:"https://picsum.photos/id/1027/100/100",online:!1},lastMessage:"آدرس رو لطف می‌کنید؟",timestamp:"۳ روز پیش",unreadCount:1,messages:[{id:1,text:"آدرس رو لطف می‌کنید؟",timestamp:"۳ روز پیش",sender:"them"}]}],mp=()=>{var Se;const[c,b]=y.useState(w0),[N,f]=y.useState(((Se=w0[0])==null?void 0:Se.id)||null),[g,v]=y.useState(""),[U,S]=y.useState(!1),[T,_]=y.useState(0),V=y.useRef(null),O=y.useRef(null),J=y.useRef(null),X=y.useRef(null),G=y.useRef([]),$=y.useRef(!1),M=y.useRef(null),m=y.useRef(c);m.current=c;const j=c.find(de=>de.id===N),Y=()=>{var de;(de=V.current)==null||de.scrollIntoView({behavior:"smooth"})};y.useEffect(()=>{N&&Y()},[j==null?void 0:j.messages,N]),y.useEffect(()=>()=>{J.current&&J.current.state==="recording"&&J.current.stop(),X.current&&clearInterval(X.current),m.current.forEach(de=>{de.messages.forEach(R=>{var me,ye;(me=R.audio)!=null&&me.url&&URL.revokeObjectURL(R.audio.url),(ye=R.file)!=null&&ye.url&&URL.revokeObjectURL(R.file.url)})})},[]);const z=(de,R,me)=>{const ye=c.map(q=>q.id===de?{...q,messages:[...q.messages,me],lastMessage:R,timestamp:"همین الان"}:q),fe=ye.findIndex(q=>q.id===de);if(fe>-1){const[q]=ye.splice(fe,1);ye.unshift(q)}b(ye)},ce=de=>{if(de.preventDefault(),!g.trim()||!N)return;const R=new Date,me={id:Date.now(),text:g,timestamp:`${R.getHours()}:${R.getMinutes().toString().padStart(2,"0")}`,sender:"me"};z(N,g,me),v("")},pe=de=>{var me;const R=(me=de.target.files)==null?void 0:me[0];if(R&&N){const ye={id:Date.now(),file:{url:URL.createObjectURL(R),name:R.name,type:R.type},timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),sender:"me"};z(N,R.name,ye)}de.target&&(de.target.value="")},K=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia||!window.MediaRecorder){alert("مرورگر شما از ضبط صدا پشتیبانی نمی‌کند.");return}const R=["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/webm","audio/mp4","audio/aac"].find(me=>MediaRecorder.isTypeSupported(me));if(!R){alert("مرورگر شما از هیچ فرمت صوتی پشتیبانی نمی‌کند.");return}M.current=R;try{G.current=[],$.current=!1;const me=await navigator.mediaDevices.getUserMedia({audio:!0});J.current=new MediaRecorder(me,{mimeType:M.current}),J.current.ondataavailable=ye=>{G.current.push(ye.data)},J.current.onstop=()=>{var ye;if((ye=J.current)==null||ye.stream.getTracks().forEach(fe=>fe.stop()),$.current){const fe=new Blob(G.current,{type:M.current});if(fe.size>0){const q=URL.createObjectURL(fe),ie={id:Date.now(),audio:{url:q,duration:T},timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),sender:"me"};N&&z(N,"پیام صوتی",ie)}}G.current=[],$.current=!1},J.current.start(),S(!0),_(0),X.current=setInterval(()=>{_(ye=>ye+1)},1e3)}catch(me){console.error("Error starting recording:",me);let ye="دسترسی به میکروفون امکان‌پذیر نیست. لطفا دسترسی لازم را بدهید.";me instanceof DOMException&&(me.name==="NotAllowedError"?ye="شما اجازه دسترسی به میکروفون را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.":me.name==="NotFoundError"?ye="هیچ میکروفونی یافت نشد.":me.name==="NotReadableError"&&(ye="مشکلی در سخت‌افزار میکروفون شما وجود دارد.")),alert(ye)}},ne=de=>{var R;U&&($.current=de,((R=J.current)==null?void 0:R.state)==="recording"&&J.current.stop(),X.current&&(clearInterval(X.current),X.current=null),S(!1))},Ce=de=>{const R=Math.floor(de/60).toString().padStart(2,"0"),me=(de%60).toString().padStart(2,"0");return`${R}:${me}`};return a.jsxs("div",{className:"flex h-[calc(100vh-130px)] bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-lg overflow-hidden",children:[a.jsxs("div",{className:`w-full md:w-1/3 lg:w-1/4 flex flex-col border-l border-gray-200 dark:border-gray-700 transition-all duration-300 ${N&&"hidden"} md:flex`,children:[a.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[a.jsx("h2",{className:"text-xl font-bold",children:"پیام‌ها"}),a.jsxs("div",{className:"relative mt-4",children:[a.jsx("input",{type:"text",placeholder:"جستجو در پیام‌ها...",className:"w-full pr-10 pl-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"}),a.jsx(ha,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:c.map(de=>a.jsxs("button",{onClick:()=>f(de.id),className:`w-full text-right flex items-center p-4 border-b border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors ${N===de.id?"bg-custom-purple/10 dark:bg-custom-purple/20":""}`,children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:de.user.avatar,alt:de.user.name,className:"w-12 h-12 rounded-full"}),de.user.online&&a.jsx("span",{className:"absolute bottom-0 right-0 block h-3 w-3 rounded-full bg-green-500 ring-2 ring-custom-light-card dark:ring-custom-dark-blue-light"})]}),a.jsxs("div",{className:"flex-1 mr-4 overflow-hidden",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"font-semibold text-gray-800 dark:text-gray-200",children:de.user.name}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 flex-shrink-0",children:de.timestamp})]}),a.jsxs("div",{className:"flex justify-between items-center mt-1",children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 truncate",children:de.lastMessage}),de.unreadCount>0&&a.jsx("span",{className:"bg-custom-purple text-white text-xs font-bold rounded-full px-2 py-0.5",children:de.unreadCount})]})]})]},de.id))})]}),a.jsx("div",{className:`flex-1 flex-col ${j?"flex":"hidden"} md:flex`,children:j?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-custom-light-card dark:bg-custom-dark-blue-light/50",children:[a.jsx("button",{className:"md:hidden ml-2 p-2",onClick:()=>f(null),children:a.jsx(yx,{className:"w-6 h-6 transform rotate-180"})}),a.jsx("img",{src:j.user.avatar,alt:j.user.name,className:"w-12 h-12 rounded-full"}),a.jsxs("div",{className:"mr-4",children:[a.jsx("h3",{className:"font-bold text-lg",children:j.user.name}),j.user.online&&a.jsxs("p",{className:"text-sm text-green-500 flex items-center",children:[" ",a.jsx("span",{className:"h-2 w-2 bg-green-500 rounded-full inline-block ml-2"})," آنلاین"]})]})]}),a.jsxs("div",{className:"flex-1 p-6 overflow-y-auto bg-custom-light-bg dark:bg-custom-dark-blue space-y-4",children:[j.messages.map(de=>a.jsx("div",{className:`flex ${de.sender==="me"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-md flex items-end gap-2 ${de.sender==="me"?"flex-row-reverse":"flex-row"}`,children:[de.sender==="them"&&a.jsx("img",{src:j.user.avatar,className:"w-8 h-8 rounded-full self-end mb-3"}),a.jsxs("div",{children:[a.jsxs("div",{className:`px-4 py-2 rounded-2xl ${de.sender==="me"?"bg-custom-purple text-white rounded-br-none":"bg-white dark:bg-custom-dark-blue-light text-gray-800 dark:text-gray-200 rounded-bl-none"}`,children:[de.text&&a.jsx("p",{children:de.text}),de.audio&&a.jsx(gp,{src:de.audio.url}),de.file&&a.jsx(xp,{file:de.file})]}),a.jsx("p",{className:`text-xs text-gray-400 mt-1 px-1 ${de.sender==="me"?"text-left":"text-right"}`,children:de.timestamp})]})]})},de.id)),a.jsx("div",{ref:V})]}),a.jsx("div",{className:"p-4 bg-custom-light-card dark:bg-custom-dark-blue-light border-t border-gray-200 dark:border-gray-700",children:U?a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("button",{onClick:()=>ne(!1),className:"p-3 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full transition-colors",children:a.jsx(xh,{className:"w-6 h-6"})}),a.jsxs("div",{className:"flex items-center gap-2 text-lg font-mono text-red-500",children:[a.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),a.jsx("span",{children:Ce(T)})]}),a.jsx("button",{onClick:()=>ne(!0),className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg",children:a.jsx(Ic,{className:"w-6 h-6"})})]}):a.jsxs("form",{onSubmit:ce,className:"flex items-center space-x-2 space-x-reverse",children:[a.jsx("input",{ref:O,type:"file",onChange:pe,className:"hidden"}),a.jsx("button",{type:"button",onClick:()=>{var de;return(de=O.current)==null?void 0:de.click()},className:"p-2 text-gray-500 dark:text-gray-400 hover:text-custom-purple dark:hover:text-custom-light-purple rounded-full",children:a.jsx(gh,{className:"w-6 h-6"})}),a.jsx("input",{type:"text",value:g,onChange:de=>v(de.target.value),placeholder:"پیام خود را بنویسید...",className:"flex-1 pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-full bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"}),g.trim()?a.jsx("button",{type:"submit",className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg disabled:bg-gray-400",children:a.jsx(Ic,{className:"w-6 h-6"})}):a.jsx("button",{type:"button",onClick:K,className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg",children:a.jsx(bx,{className:"w-6 h-6"})})]})})]}):a.jsxs("div",{className:"flex-1 flex-col items-center justify-center text-center text-gray-500 dark:text-gray-400 bg-custom-light-bg dark:bg-custom-dark-blue hidden md:flex",children:[a.jsx(so,{className:"w-24 h-24 mb-4 text-gray-300 dark:text-gray-600"}),a.jsx("h2",{className:"text-2xl font-semibold",children:"گفتگویی را انتخاب کنید"}),a.jsx("p",{children:"برای شروع مکالمه، یک نفر را از لیست انتخاب کنید."})]})})]})},gp=({src:c})=>{const b=y.useRef(null),[N,f]=y.useState(!1),[g,v]=y.useState(0),[U,S]=y.useState(0);y.useEffect(()=>{const O=b.current;if(!O)return;const J=()=>{isFinite(O.duration)&&S(O.duration)},X=()=>v(O.currentTime),G=()=>{f(!1),v(0)};return O.addEventListener("loadedmetadata",J),O.addEventListener("timeupdate",X),O.addEventListener("ended",G),()=>{O.removeEventListener("loadedmetadata",J),O.removeEventListener("timeupdate",X),O.removeEventListener("ended",G)}},[]);const T=()=>{b.current&&(N?b.current.pause():b.current.play(),f(!N))},_=O=>{if(!isFinite(O)||O<0)return"0:00";const J=Math.floor(O/60),X=Math.floor(O%60).toString().padStart(2,"0");return`${J}:${X}`},V=U>0?g/U*100:0;return a.jsxs("div",{className:"flex items-center gap-2 w-48 text-current",children:[a.jsx("audio",{ref:b,src:c,preload:"metadata"}),a.jsx("button",{onClick:T,className:"p-2 flex-shrink-0",children:N?a.jsx(Nx,{className:"w-5 h-5"}):a.jsx(jx,{className:"w-5 h-5"})}),a.jsxs("div",{className:"w-full h-1 bg-gray-400/50 dark:bg-gray-500/50 rounded-full relative",children:[a.jsx("div",{className:"absolute top-0 right-0 h-1 bg-current rounded-full",style:{width:`${V}%`}}),a.jsx("div",{className:"absolute h-3 w-3 bg-current rounded-full top-1/2 -mt-1.5",style:{right:`calc(${V}% - 6px)`}})]}),a.jsx("span",{className:"text-xs text-inherit opacity-70 w-10 text-center",children:_(U)})]})},xp=({file:c})=>a.jsx("a",{href:c.url,download:c.name,className:"flex flex-col gap-2 max-w-xs cursor-pointer",children:c.type.startsWith("image/")?a.jsx("img",{src:c.url,alt:c.name,className:"rounded-lg max-w-full h-auto"}):a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-black/10 dark:bg-white/10",children:[a.jsx(vx,{className:"w-8 h-8 flex-shrink-0"}),a.jsx("span",{className:"text-sm truncate font-medium",children:c.name})]})}),pp=c=>{const b={technical:"پشتیبانی فنی",financial:"مالی",sales:"فروش",suggestions:"پیشنهادات",general:"عمومی"},N={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"},f=g=>{const v=new Date(g),S=new Date().getTime()-v.getTime(),T=Math.floor(S/6e4),_=Math.floor(S/36e5),V=Math.floor(S/864e5);return T<1?"الان":T<60?`${T} دقیقه پیش`:_<24?`${_} ساعت پیش`:V<7?`${V} روز پیش`:new Intl.DateTimeFormat("fa-IR",{year:"numeric",month:"long",day:"numeric"}).format(v)};return{id:String(c.id),subject:c.subject||c.title,department:b[c.department]||c.department,lastUpdate:f(c.updated_at||c.created_at),status:N[c.status]||"pending",priority:c.priority||"normal",created_at:c.created_at,replies_count:c.replies_count||0}},yp={async request(c,b={}){try{const N=await It(`https://eino.eifa.site/users-api/public/api${c}`,b),f=N.headers.get("content-type");if(!f||!f.includes("application/json"))throw console.error("Response is not JSON:",await N.text()),new Error("پاسخ سرور به فرمت JSON نیست");const g=await N.json();if(!g.success&&g.message)throw new Error(g.message);return g}catch(N){throw console.error("API Error:",N),N instanceof Error?N.message==="Token expired or invalid"||N.message==="SESSION_EXPIRED"?new Error("SESSION_EXPIRED"):N:new Error("خطای ناشناخته در ارتباط با سرور")}},async getTickets(){return this.request("/tickets")}},bp=({onNavigate:c})=>{const[b,N]=y.useState(""),[f,g]=y.useState("all"),[v,U]=y.useState("all"),[S,T]=y.useState([]),[_,V]=y.useState(!0),[O,J]=y.useState(null),X=async()=>{try{V(!0),J(null),console.log("Fetching tickets from: /api/tickets");const z=await yp.getTickets();if(console.log("API Response:",z),z.success&&Array.isArray(z.data)){const ce=z.data.map(pp);console.log("Transformed tickets:",ce),T(ce)}else throw new Error(z.message||"فرمت پاسخ سرور نامعتبر است")}catch(z){console.error("Error fetching tickets:",z),z.message==="SESSION_EXPIRED"&&J("session_expired")}finally{V(!1)}};y.useEffect(()=>{X()},[]);const G=S.filter(z=>{const ce=b.toLowerCase(),pe=z.subject.toLowerCase().includes(ce)||z.id.toLowerCase().includes(ce),K=f==="all"||z.status===f,ne=v==="all"||z.department===v;return pe&&K&&ne}),$=z=>{switch(z){case"answered":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500 border border-green-500/20",children:"پاسخ داده شده"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange border border-custom-orange/20",children:"در حال بررسی"});case"closed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400 border border-gray-500/20",children:"بسته شده"})}},M=z=>{switch(z){case"high":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500 border border-red-500/20",children:"بالا"});case"normal":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:"متوسط"});case"low":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 border border-gray-500/20",children:"پایین"});default:return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:"متوسط"})}},m=()=>{X()},j=()=>{localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),c("dashboard"),window.location.reload()},Y=()=>O==="session_expired"?a.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Mn,{className:"w-8 h-8 text-amber-500 flex-shrink-0"}),a.jsxs("div",{className:"flex-grow",children:[a.jsx("h3",{className:"font-semibold text-amber-800 dark:text-amber-300 mb-2",children:"زمان احراز هویت به پایان رسیده"}),a.jsx("p",{className:"text-amber-700 dark:text-amber-400 mb-4",children:"برای ادامه کار، لطفاً مجدداً وارد حساب کاربری خود شوید."}),a.jsx("button",{onClick:j,className:"bg-amber-500 hover:bg-amber-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ورود مجدد"})]})]})}):a.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Mn,{className:"w-8 h-8 text-red-500 flex-shrink-0"}),a.jsxs("div",{className:"flex-grow",children:[a.jsx("h3",{className:"font-semibold text-red-800 dark:text-red-300 mb-2",children:"خطا در دریافت اطلاعات"}),a.jsx("p",{className:"text-red-700 dark:text-red-400 mb-4",children:O}),a.jsx("button",{onClick:m,className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"تلاش مجدد"})]})]})});return _?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال دریافت اطلاعات..."})]}),a.jsx("div",{className:"space-y-4",children:[...Array(5)].map((z,ce)=>a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm animate-pulse",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-300 dark:bg-gray-600 rounded-lg"}),a.jsxs("div",{className:"flex-grow space-y-2",children:[a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-3/4"}),a.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/2"})]}),a.jsx("div",{className:"w-20 h-8 bg-gray-300 dark:bg-gray-600 rounded-full"})]})},ce))})]}):O?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در دریافت اطلاعات"})]}),a.jsx(Y,{})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"تیکت‌های پشتیبانی خود را مدیریت کنید."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل تیکت‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.length})]}),a.jsx("div",{className:"w-12 h-12 bg-blue-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-blue-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"در حال بررسی"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(z=>z.status==="pending").length})]}),a.jsx("div",{className:"w-12 h-12 bg-custom-orange/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-custom-orange",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"پاسخ داده شده"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(z=>z.status==="answered").length})]}),a.jsx("div",{className:"w-12 h-12 bg-green-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-green-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"بسته شده"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(z=>z.status==="closed").length})]}),a.jsx("div",{className:"w-12 h-12 bg-gray-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-gray-500 dark:text-gray-400",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})})})]})})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex flex-col lg:flex-row items-center justify-between gap-4",children:[a.jsxs("div",{className:"w-full lg:w-auto flex-grow grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در موضوع یا شناسه تیکت...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:b,onChange:z=>N(z.target.value)}),a.jsx(ha,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:z=>g(z.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"answered",children:"پاسخ داده شده"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"closed",children:"بسته شده"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:z=>U(z.target.value),children:[a.jsx("option",{value:"all",children:"همه دپارتمان‌ها"}),a.jsx("option",{value:"پشتیبانی فنی",children:"پشتیبانی فنی"}),a.jsx("option",{value:"مالی",children:"مالی"}),a.jsx("option",{value:"فروش",children:"فروش"}),a.jsx("option",{value:"پیشنهادات",children:"پیشنهادات"}),a.jsx("option",{value:"عمومی",children:"عمومی"})]}),a.jsx(pt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),a.jsxs("button",{onClick:()=>c("new-ticket"),className:"w-full lg:w-auto flex-shrink-0 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-6 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(Jc,{className:"w-5 h-5"}),a.jsx("span",{children:"تیکت جدید"})]})]})}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-right",children:[a.jsx("thead",{className:"bg-custom-light-bg dark:bg-custom-dark-blue text-gray-500 dark:text-gray-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 font-semibold",children:"شناسه"}),a.jsx("th",{className:"p-4 font-semibold",children:"موضوع"}),a.jsx("th",{className:"p-4 font-semibold hidden lg:table-cell",children:"دپارتمان"}),a.jsx("th",{className:"p-4 font-semibold hidden md:table-cell",children:"اولویت"}),a.jsx("th",{className:"p-4 font-semibold hidden sm:table-cell",children:"آخرین بروزرسانی"}),a.jsx("th",{className:"p-4 font-semibold",children:"وضعیت"}),a.jsx("th",{className:"p-4 font-semibold",children:"عملیات"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:G.length>0?G.map(z=>a.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-custom-dark-blue transition-colors",children:[a.jsxs("td",{className:"p-4 font-mono text-custom-purple font-bold",children:["#",z.id]}),a.jsxs("td",{className:"p-4",children:[a.jsx("div",{className:"font-semibold text-gray-800 dark:text-gray-200",children:z.subject}),a.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 lg:hidden mt-1",children:[z.department," ",z.replies_count?`• ${z.replies_count} پاسخ`:""]})]}),a.jsx("td",{className:"p-4 hidden lg:table-cell",children:a.jsx("span",{className:"px-2 py-1 text-xs bg-custom-purple/10 text-custom-purple rounded-full border border-custom-purple/20",children:z.department})}),a.jsx("td",{className:"p-4 hidden md:table-cell",children:M(z.priority||"normal")}),a.jsx("td",{className:"p-4 hidden sm:table-cell text-gray-500 dark:text-gray-400",children:z.lastUpdate}),a.jsx("td",{className:"p-4",children:$(z.status)}),a.jsx("td",{className:"p-4",children:a.jsx("button",{onClick:()=>{console.log("🔘 Button clicked!"),console.log("🎫 Ticket:",z),console.log("🆔 Ticket ID:",z.id),c("ticket-detail",z.id)},className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-xs",children:"مشاهده"})})]},z.id)):a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"text-center p-12",children:a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mb-4",children:a.jsx(ha,{className:"w-8 h-8 text-gray-400"})}),a.jsx("h3",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200 mb-2",children:S.length===0?"هنوز هیچ تیکتی ندارید":"تیکتی یافت نشد"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4 text-center",children:S.length===0?"برای شروع اولین تیکت خود را ایجاد کنید.":"هیچ تیکتی با فیلترهای انتخاب شده مطابقت ندارد."}),S.length===0&&a.jsx("button",{onClick:()=>c("new-ticket"),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ایجاد اولین تیکت"})]})})})})]})}),G.length>0&&a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["نمایش ",G.length," از ",S.length," تیکت"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{disabled:!0,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"قبلی"}),a.jsx("span",{className:"px-3 py-1 text-sm bg-custom-purple text-white rounded-lg",children:"1"}),a.jsx("button",{disabled:!0,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"بعدی"})]})]})})]}),a.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-white text-sm",children:"💡"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-blue-800 dark:text-blue-300 mb-2",children:"راهنمای تیکت‌ها"}),a.jsxs("ul",{className:"text-sm text-blue-700 dark:text-blue-400 space-y-1",children:[a.jsxs("li",{children:["• تیکت‌های ",a.jsx("span",{className:"font-semibold",children:"در حال بررسی"})," توسط پشتیبانی در دست اقدام هستند"]}),a.jsxs("li",{children:["• تیکت‌های ",a.jsx("span",{className:"font-semibold",children:"پاسخ داده شده"})," نیاز به پاسخ‌گویی شما دارند"]}),a.jsxs("li",{children:["• می‌توانید تیکت‌های حل شده را ",a.jsx("span",{className:"font-semibold",children:"ببندید"})]}),a.jsxs("li",{children:["• برای مسائل فوری از اولویت ",a.jsx("span",{className:"font-semibold",children:"بالا"})," استفاده کنید"]})]})]})]})})]})},vp=({ticketId:c,onNavigate:b})=>{const[N,f]=y.useState(null),[g,v]=y.useState(!0),[U,S]=y.useState(null),[T,_]=y.useState(""),[V,O]=y.useState(!1),J=m=>{const j=new Date(m),z=new Date().getTime()-j.getTime(),ce=Math.floor(z/6e4),pe=Math.floor(z/36e5),K=Math.floor(z/864e5);return ce<1?"الان":ce<60?`${ce} دقیقه پیش`:pe<24?`${pe} ساعت پیش`:K<7?`${K} روز پیش`:new Intl.DateTimeFormat("fa-IR",{year:"numeric",month:"long",day:"numeric"}).format(j)},X=m=>{const j={technical:"پشتیبانی فنی",financial:"مالی",sales:"فروش",suggestions:"پیشنهادات",general:"عمومی"},Y={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"};return{id:String(m.id),subject:m.subject||m.title,department:j[m.department]||m.department,lastUpdate:J(m.updated_at||m.created_at),status:Y[m.status]||"pending",priority:m.priority||"normal",created_at:m.created_at,messages:(m.replies||[]).map(z=>({id:z.id,sender:z.is_admin?"support":"user",text:z.message||z.content,timestamp:J(z.created_at),created_at:z.created_at}))}},G=async()=>{try{v(!0),S(null),console.log("🎫 Fetching ticket:",c);const j=await(await It(`https://eino.eifa.site/users-api/public/api/tickets/${c}`)).json();if(console.log("✅ API Response:",j),j.success&&j.data){const Y=X(j.data);console.log("✅ Transformed ticket:",Y),f(Y)}else throw new Error(j.message||"تیکت یافت نشد")}catch(m){console.error("❌ Error fetching ticket:",m),m.message==="Token expired or invalid"?S("session_expired"):S(m.message||"خطا در دریافت اطلاعات تیکت")}finally{v(!1)}},$=async m=>{if(m.preventDefault(),!(!T.trim()||!c))try{O(!0);const Y=await(await It(`https://eino.eifa.site/users-api/public/api/tickets/${c}/reply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:T})})).json();if(Y.success)_(""),await G();else throw new Error(Y.message||"خطا در ارسال پاسخ")}catch(j){console.error("Error sending reply:",j),alert(j.message||"خطا در ارسال پاسخ")}finally{O(!1)}};y.useEffect(()=>{console.log("🎫 TicketDetailPage mounted"),console.log("📋 ticketId:",c),G()},[c]);const M=m=>{switch(m){case"answered":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500 border border-green-500/20",children:"پاسخ داده شده"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange border border-custom-orange/20",children:"در حال بررسی"});case"closed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400 border border-gray-500/20",children:"بسته شده"})}};return g?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("div",{className:"h-8 w-64 bg-gray-300 dark:bg-gray-600 rounded animate-pulse"}),a.jsx("div",{className:"h-4 w-48 bg-gray-300 dark:bg-gray-600 rounded mt-2 animate-pulse"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4",children:[...Array(3)].map((m,j)=>a.jsxs("div",{className:"flex gap-4",children:[a.jsx("div",{className:"w-10 h-10 bg-gray-300 dark:bg-gray-600 rounded-full animate-pulse"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-3/4 animate-pulse"}),a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-1/2 animate-pulse"})]})]},j))})]}):U?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsx("div",{children:a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"خطا"})}),a.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Mn,{className:"w-8 h-8 text-red-500 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-red-800 dark:text-red-300 mb-2",children:U==="session_expired"?"زمان احراز هویت به پایان رسیده":"خطا در دریافت اطلاعات"}),a.jsx("p",{className:"text-red-700 dark:text-red-400 mb-4",children:U}),a.jsx("button",{onClick:()=>b("tickets"),className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"بازگشت به لیست تیکت‌ها"})]})]})})]}):N?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold text-gray-800 dark:text-white flex items-center gap-3",children:[N.subject,M(N.status)]}),a.jsxs("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:["جزئیات و گفتگوی مربوط به تیکت #",N.id]})]}),a.jsxs("button",{onClick:()=>b("tickets"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors self-start sm:self-center",children:[a.jsx(uh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت به لیست"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 flex flex-col space-y-6",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-6",children:N.messages.length>0?N.messages.map(m=>a.jsxs("div",{className:`flex items-start gap-4 ${m.sender==="user"?"flex-row-reverse":""}`,children:[a.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${m.sender==="user"?"bg-custom-purple":"bg-custom-cyan"}`,children:m.sender==="user"?a.jsx(Ca,{className:"w-6 h-6 text-white"}):a.jsx(wx,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:`w-full max-w-xl p-4 rounded-xl ${m.sender==="user"?"bg-custom-purple/10 dark:bg-custom-purple/20 rounded-tr-none":"bg-gray-100 dark:bg-custom-dark-blue rounded-tl-none"}`,children:[a.jsx("p",{className:"text-gray-800 dark:text-gray-200",children:m.text}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-2 text-left",children:m.timestamp})]})]},m.id)):a.jsx("p",{className:"text-center text-gray-500",children:"هنوز پاسخی ثبت نشده است"})}),N.status!=="closed"?a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-800 dark:text-gray-200",children:"ارسال پاسخ جدید"}),a.jsxs("form",{onSubmit:$,className:"space-y-4",children:[a.jsx("textarea",{value:T,onChange:m=>_(m.target.value),placeholder:"پاسخ خود را اینجا بنویسید...",className:"w-full pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[120px] resize-y",disabled:V}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("button",{type:"button",className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:[a.jsx(gh,{className:"w-5 h-5"}),a.jsx("span",{children:"پیوست فایل"})]}),a.jsxs("button",{type:"submit",disabled:V||!T.trim(),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-6 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Ic,{className:"w-5 h-5"}),a.jsx("span",{children:V?"در حال ارسال...":"ارسال پاسخ"})]})]})]})]}):a.jsx("div",{className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 p-4 rounded-xl text-center",children:a.jsx("p",{className:"font-semibold",children:"این تیکت بسته شده است و امکان ارسال پاسخ جدید وجود ندارد."})})]}),a.jsx("div",{className:"lg:col-span-1",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4 sticky top-28",children:[a.jsx("h3",{className:"text-lg font-semibold mb-2 pb-3 border-b border-gray-200 dark:border-gray-700",children:"اطلاعات تیکت"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(us,{className:"w-5 h-5"}),a.jsx("span",{children:"شناسه تیکت"})]}),a.jsxs("span",{className:"font-mono font-semibold text-gray-800 dark:text-gray-200",children:["#",N.id]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(to,{className:"w-5 h-5"}),a.jsx("span",{children:"دپارتمان"})]}),a.jsx("span",{className:"font-semibold text-gray-800 dark:text-gray-200",children:N.department})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(lo,{className:"w-5 h-5"}),a.jsx("span",{children:"آخرین بروزرسانی"})]}),a.jsx("span",{className:"font-semibold text-gray-800 dark:text-gray-200",children:N.lastUpdate})]})]})})]})]}):a.jsxs("div",{className:"text-center p-8",children:[a.jsx("h2",{className:"text-xl font-bold",children:"تیکت یافت نشد"}),a.jsx("button",{onClick:()=>b("tickets"),className:"mt-4 text-custom-purple hover:underline",children:"بازگشت به لیست تیکت‌ها"})]})},jp=()=>{const[c,b]=y.useState(""),[N,f]=y.useState(""),[g,v]=y.useState("09123456789"),[U,S]=y.useState(null),[T,_]=y.useState("unverified"),V=m=>{const j=m.target.files;if(j&&j[0]){const Y=j[0];S({id:Date.now(),url:URL.createObjectURL(Y),file:Y})}},O=()=>{U&&(URL.revokeObjectURL(U.url),S(null))},J=y.useCallback(m=>{m.preventDefault(),m.stopPropagation();const j=m.dataTransfer.files;if(j&&j[0]&&j[0].type.startsWith("image/")){const Y=j[0];S({id:Date.now(),url:URL.createObjectURL(Y),file:Y})}},[]),X=m=>{m.preventDefault(),m.stopPropagation()},G=m=>{m.preventDefault(),_("pending"),window.scrollTo(0,0)},$=()=>{switch(T){case"verified":return a.jsxs("div",{className:"bg-green-500/10 border border-green-500/20 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-green-500 rounded-full p-2",children:a.jsx(q0,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-green-600 dark:text-green-400 text-lg",children:"حساب کاربری تایید شده"}),a.jsx("p",{className:"text-green-700/80 dark:text-green-400/80 text-sm mt-1",children:"هویت شما تایید شده است و می‌توانید از تمام امکانات استفاده کنید."})]})]});case"pending":return a.jsxs("div",{className:"bg-custom-orange/10 border border-custom-orange/20 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-custom-orange rounded-full p-2",children:a.jsx(lo,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-custom-orange text-lg",children:"در حال بررسی مدارک"}),a.jsx("p",{className:"text-custom-orange/80 text-sm mt-1",children:"مدارک شما ارسال شده و در صف بررسی توسط کارشناسان است."})]})]});case"unverified":default:return a.jsxs("div",{className:"bg-gray-500/10 border border-gray-500/20 dark:bg-gray-700/30 dark:border-gray-600 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-gray-500 dark:bg-gray-600 rounded-full p-2",children:a.jsx(Mn,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-gray-700 dark:text-gray-200 text-lg",children:"حساب کاربری تایید نشده"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:"لطفاً برای استفاده از خدمات، فرم زیر را تکمیل و کارت ملی خود را ارسال کنید."})]})]})}},M=T!=="unverified";return a.jsxs("div",{className:"flex flex-col max-w-4xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"حساب کاربری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مدیریت اطلاعات شخصی و احراز هویت."})]}),$(),a.jsxs("form",{onSubmit:G,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات هویتی"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام و نام خانوادگی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Ca,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition disabled:opacity-60 disabled:cursor-not-allowed",placeholder:"مثال: علی رضایی",value:c,onChange:m=>b(m.target.value),disabled:M,required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"کد ملی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(us,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",maxLength:10,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition disabled:opacity-60 disabled:cursor-not-allowed font-mono dir-ltr text-right",placeholder:"0123456789",value:N,onChange:m=>{const j=m.target.value.replace(/[^0-9]/g,"");f(j)},disabled:M,required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"شماره موبایل"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Js,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition opacity-60 cursor-not-allowed font-mono dir-ltr text-right",value:g,readOnly:!0,disabled:!0})]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصویر کارت ملی"}),U?a.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-gray-200 dark:border-gray-700",children:[a.jsx("img",{src:U.url,alt:"ID Card Preview",className:"w-full h-64 object-cover"}),!M&&a.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:a.jsxs("button",{type:"button",onClick:O,className:"bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-colors",children:[a.jsx($a,{className:"w-5 h-5"}),a.jsx("span",{children:"حذف و انتخاب مجدد"})]})})]}):a.jsxs("label",{htmlFor:"id-card-upload",className:`flex flex-col items-center justify-center w-full h-64 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-xl bg-custom-light-bg dark:bg-custom-dark-blue transition-colors ${M?"opacity-60 cursor-not-allowed":"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800"}`,onDrop:M?void 0:J,onDragOver:M?void 0:X,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6 text-center px-4",children:[a.jsx("div",{className:"p-4 bg-gray-200 dark:bg-gray-700 rounded-full mb-4",children:a.jsx(Dn,{className:"w-8 h-8 text-gray-500 dark:text-gray-400"})}),a.jsx("p",{className:"mb-2 text-lg font-medium text-gray-700 dark:text-gray-200",children:"تصویر روی کارت ملی خود را بارگذاری کنید"}),a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:M?"امکان تغییر تصویر وجود ندارد":"برای انتخاب کلیک کنید یا تصویر را اینجا رها کنید"}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-2",children:"JPG, PNG (Max. 2MB)"})]}),a.jsx("input",{id:"id-card-upload",type:"file",className:"hidden",accept:"image/*",onChange:V,disabled:M})]})]}),!M&&a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{type:"submit",className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-8 rounded-xl transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed",disabled:!c||!N||!U,children:"ثبت اطلاعات و درخواست تایید"})})]}),a.jsxs("div",{className:"mt-12 p-4 border border-dashed border-gray-300 dark:border-gray-700 rounded-lg opacity-50 hover:opacity-100 transition-opacity",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"تنظیمات دمو (برای مشاهده وضعیت‌های مختلف):"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"button",onClick:()=>_("unverified"),className:"px-3 py-1 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:"تایید نشده"}),a.jsx("button",{type:"button",onClick:()=>_("pending"),className:"px-3 py-1 bg-yellow-200 dark:bg-yellow-900 rounded text-xs",children:"در حال بررسی"}),a.jsx("button",{type:"button",onClick:()=>_("verified"),className:"px-3 py-1 bg-green-200 dark:bg-green-900 rounded text-xs",children:"تایید شده"})]})]})]})},V0=()=>{const c="M-100 400 C 100 200, 250 600, 450 400 C 550 300, 650 300, 650 400 C 650 500, 550 600, 450 500 C 350 400, 250 400, 250 500 C 250 600, 450 700, 650 500 C 850 300, 1150 300, 1350 500 L1500 500",b="flightPath",N="trailMask";return a.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden","aria-hidden":"true",children:a.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 1400 800",preserveAspectRatio:"xMidYMid slice",className:"absolute inset-0 opacity-40 dark:opacity-70",children:[a.jsxs("defs",{children:[a.jsx("path",{id:b,d:c,fill:"none"}),a.jsx("mask",{id:N,children:a.jsx("use",{href:`#${b}`,stroke:"white",strokeWidth:"5",className:"animate-draw-trail"})})]}),a.jsx("use",{href:`#${b}`,stroke:"currentColor",strokeWidth:"2",strokeDasharray:"8 12",className:"text-custom-purple",mask:`url(#${N})`}),a.jsx("g",{className:"animate-fly-plane",children:a.jsx(ba,{className:"text-custom-purple",width:50,height:50,style:{transform:"translate(-25px, -25px)"}})})]})})},Np=({onLogin:c,theme:b,toggleTheme:N,showError:f})=>{const[g,v]=y.useState(""),[U,S]=y.useState(null),T=V=>{V.preventDefault();const O=g.trim();if(O.length===11&&O.startsWith("09"))c(O),S(null);else{const J="لطفاً یک شماره موبایل معتبر (11 رقمی با 09) وارد کنید.";S(J),f(J)}},_=b==="dark";return a.jsxs("div",{className:"relative min-h-screen",children:[U&&a.jsxs("div",{className:"fixed top-4 left-1/2 transform -translate-x-1/2 z-50 bg-red-500 text-white px-6 py-3 rounded-lg shadow-lg flex items-center animate-fade-in",children:[a.jsx("span",{children:U}),a.jsx("button",{onClick:()=>S(null),className:"mr-3 text-white hover:text-gray-200","aria-label":"بستن",children:"✕"})]}),a.jsxs("div",{className:`relative flex items-center justify-center min-h-screen font-sans overflow-hidden
                ${_?"bg-custom-dark-blue text-white bg-[radial-gradient(#27314e_1px,transparent_1px)]":"bg-gradient-to-br from-gray-100 via-purple-50 to-indigo-100 text-gray-800 bg-[radial-gradient(#c7d2fe_1px,transparent_1px)]"} [background-size:16px_16px]`,children:[a.jsx(V0,{}),a.jsx("div",{className:"absolute top-6 left-6 z-20",children:a.jsx("button",{onClick:N,className:`p-2 rounded-full cursor-pointer shadow-md transition-colors
                            ${_?"bg-custom-dark-blue-light":"bg-white border border-gray-200 hover:bg-gray-50"}`,"aria-label":"Toggle theme",children:_?a.jsx(ch,{className:"h-6 w-6 text-yellow-400"}):a.jsx(dh,{className:"h-6 w-6 text-indigo-600"})})}),a.jsxs("div",{className:`relative z-10 w-full max-w-sm p-8 space-y-8 rounded-2xl shadow-xl backdrop-blur-sm
                    ${_?"bg-custom-dark-blue-light/80 border border-white/10":"bg-white/90 border border-gray-200 shadow-purple-100/50"}`,children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center mb-6",children:[a.jsx(hh,{className:`w-12 h-12 ${_?"text-custom-purple":"text-indigo-600"}`}),a.jsx("span",{className:`text-4xl font-bold mr-3 ${_?"text-white":"text-gray-800"}`,children:"اینوببر"})]}),a.jsx("h2",{className:`text-2xl font-bold ${_?"text-white":"text-gray-800"}`,children:"ورود | ثبت نام"}),a.jsx("p",{className:`mt-2 ${_?"text-gray-400":"text-gray-500"}`,children:"لطفا شماره موبایل خود را وارد کنید"})]}),a.jsxs("form",{className:"space-y-6",onSubmit:T,children:[a.jsx("input",{id:"phone",name:"phone",type:"tel",autoComplete:"tel",required:!0,className:`w-full px-4 py-3 text-center tracking-[.2em] rounded-lg focus:outline-none focus:ring-2 transition-colors
                                ${_?"bg-custom-dark-blue border border-gray-700 placeholder-gray-500 text-white focus:ring-custom-purple":"bg-gray-50 border border-gray-300 placeholder-gray-400 text-gray-800 focus:ring-indigo-500 focus:border-indigo-500"}`,placeholder:"۰۹۱۲*******",value:g,onChange:V=>v(V.target.value)}),a.jsx("button",{type:"submit",className:`w-full py-3 px-4 rounded-lg font-semibold transition-colors duration-300 text-white
                                ${_?"bg-custom-purple hover:bg-custom-light-purple":"bg-indigo-600 hover:bg-indigo-700 shadow-lg shadow-indigo-200"}`,children:"ورود"})]}),a.jsx("p",{className:`text-xs text-center ${_?"text-gray-500":"text-gray-400"}`,children:"ورود شما به معنای پذیرش قوانین سایت است"})]})]})]})},wp=({onVerify:c,onResend:b,theme:N,toggleTheme:f})=>{const[g,v]=y.useState(new Array(6).fill("")),U=y.useRef([]),S=N==="dark",T=(J,X)=>{var M;const G=J.target.value;if(isNaN(Number(G)))return;const $=[...g];$[X]=G.substring(G.length-1),v($),G&&X<5&&((M=U.current[X+1])==null||M.focus())},_=(J,X)=>{var G;J.key==="Backspace"&&!g[X]&&X>0&&((G=U.current[X-1])==null||G.focus())},V=J=>{var G;J.preventDefault();const X=J.clipboardData.getData("text");if(X.length===6&&/^\d+$/.test(X)){const $=X.split("");v($),(G=U.current[5])==null||G.focus()}},O=J=>{J.preventDefault();const X=g.join("");X.length===6?c(X):alert("لطفاً کد 6 رقمی را کامل وارد کنید.")};return a.jsxs("div",{className:`relative flex items-center justify-center min-h-screen font-sans overflow-hidden
            ${S?"bg-custom-dark-blue text-white bg-[radial-gradient(#27314e_1px,transparent_1px)]":"bg-gradient-to-br from-gray-100 via-purple-50 to-indigo-100 text-gray-800 bg-[radial-gradient(#c7d2fe_1px,transparent_1px)]"} [background-size:16px_16px]`,children:[a.jsx(V0,{}),a.jsx("div",{className:"absolute top-6 left-6 z-20",children:a.jsx("button",{onClick:f,className:`p-2 rounded-full cursor-pointer shadow-md transition-colors
                        ${S?"bg-custom-dark-blue-light":"bg-white border border-gray-200 hover:bg-gray-50"}`,"aria-label":"Toggle theme",children:S?a.jsx(ch,{className:"h-6 w-6 text-yellow-400"}):a.jsx(dh,{className:"h-6 w-6 text-indigo-600"})})}),a.jsxs("div",{className:`relative z-10 w-full max-w-md p-8 space-y-8 rounded-2xl shadow-xl backdrop-blur-sm
                ${S?"bg-custom-dark-blue-light/80 border border-white/10":"bg-white/90 border border-gray-200 shadow-purple-100/50"}`,children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center mb-6",children:[a.jsx(hh,{className:`w-12 h-12 ${S?"text-custom-purple":"text-indigo-600"}`}),a.jsx("span",{className:`text-4xl font-bold mr-3 ${S?"text-white":"text-gray-800"}`,children:"اینوببر"})]}),a.jsx("h2",{className:`text-2xl font-bold ${S?"text-white":"text-gray-800"}`,children:"کد تایید را وارد کنید"}),a.jsx("p",{className:`mt-2 ${S?"text-gray-400":"text-gray-500"}`,children:"کد تایید برای شما ارسال گردید."})]}),a.jsxs("form",{onSubmit:O,children:[a.jsx("div",{className:"flex justify-center gap-2 mb-6",dir:"ltr",onPaste:V,children:g.map((J,X)=>a.jsx("input",{type:"text",name:"otp",inputMode:"numeric",pattern:"[0-9]*",maxLength:1,className:`w-12 h-14 sm:w-14 sm:h-14 text-center text-2xl font-semibold rounded-lg focus:outline-none focus:ring-2 transition-colors
                                    ${S?"bg-custom-dark-blue border border-gray-700 text-white focus:ring-custom-purple":"bg-gray-50 border border-gray-300 text-gray-800 focus:ring-indigo-500 focus:border-indigo-500"}`,value:J,onChange:G=>T(G,X),onKeyDown:G=>_(G,X),ref:G=>{U.current[X]=G},autoFocus:X===0},X))}),a.jsx("button",{type:"submit",className:`w-full py-3 px-4 rounded-lg font-semibold transition-colors duration-300 text-white
                            ${S?"bg-custom-purple hover:bg-custom-light-purple":"bg-indigo-600 hover:bg-indigo-700 shadow-lg shadow-indigo-200"}`,children:"ادامه"})]}),a.jsx("div",{className:"text-center",children:a.jsx("button",{onClick:b,className:`text-sm hover:underline transition-colors
                            ${S?"text-custom-light-purple":"text-indigo-600 hover:text-indigo-700"}`,children:"دریافت مجدد کد"})})]})]})};function kp(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Kc={exports:{}},_p=Kc.exports,k0;function Sp(){return k0||(k0=1,(function(c,b){(function(N,f){c.exports=f()})(_p,(function(){var N;function f(){return N.apply(null,arguments)}function g(r){N=r}function v(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function U(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function S(r,o){return Object.prototype.hasOwnProperty.call(r,o)}function T(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var o;for(o in r)if(S(r,o))return!1;return!0}function _(r){return r===void 0}function V(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function O(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function J(r,o){var d=[],h,x=r.length;for(h=0;h<x;++h)d.push(o(r[h],h));return d}function X(r,o){for(var d in o)S(o,d)&&(r[d]=o[d]);return S(o,"toString")&&(r.toString=o.toString),S(o,"valueOf")&&(r.valueOf=o.valueOf),r}function G(r,o,d,h){return Mo(r,o,d,h,!0).utc()}function $(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function M(r){return r._pf==null&&(r._pf=$()),r._pf}var m;Array.prototype.some?m=Array.prototype.some:m=function(r){var o=Object(this),d=o.length>>>0,h;for(h=0;h<d;h++)if(h in o&&r.call(this,o[h],h,o))return!0;return!1};function j(r){var o=null,d=!1,h=r._d&&!isNaN(r._d.getTime());if(h&&(o=M(r),d=m.call(o.parsedDateParts,function(x){return x!=null}),h=o.overflow<0&&!o.empty&&!o.invalidEra&&!o.invalidMonth&&!o.invalidWeekday&&!o.weekdayMismatch&&!o.nullInput&&!o.invalidFormat&&!o.userInvalidated&&(!o.meridiem||o.meridiem&&d),r._strict&&(h=h&&o.charsLeftOver===0&&o.unusedTokens.length===0&&o.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(r))r._isValid=h;else return h;return r._isValid}function Y(r){var o=G(NaN);return r!=null?X(M(o),r):M(o).userInvalidated=!0,o}var z=f.momentProperties=[],ce=!1;function pe(r,o){var d,h,x,D=z.length;if(_(o._isAMomentObject)||(r._isAMomentObject=o._isAMomentObject),_(o._i)||(r._i=o._i),_(o._f)||(r._f=o._f),_(o._l)||(r._l=o._l),_(o._strict)||(r._strict=o._strict),_(o._tzm)||(r._tzm=o._tzm),_(o._isUTC)||(r._isUTC=o._isUTC),_(o._offset)||(r._offset=o._offset),_(o._pf)||(r._pf=M(o)),_(o._locale)||(r._locale=o._locale),D>0)for(d=0;d<D;d++)h=z[d],x=o[h],_(x)||(r[h]=x);return r}function K(r){pe(this,r),this._d=new Date(r._d!=null?r._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),ce===!1&&(ce=!0,f.updateOffset(this),ce=!1)}function ne(r){return r instanceof K||r!=null&&r._isAMomentObject!=null}function Ce(r){f.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+r)}function Se(r,o){var d=!0;return X(function(){if(f.deprecationHandler!=null&&f.deprecationHandler(null,r),d){var h=[],x,D,ae,De=arguments.length;for(D=0;D<De;D++){if(x="",typeof arguments[D]=="object"){x+=`
[`+D+"] ";for(ae in arguments[0])S(arguments[0],ae)&&(x+=ae+": "+arguments[0][ae]+", ");x=x.slice(0,-2)}else x=arguments[D];h.push(x)}Ce(r+`
Arguments: `+Array.prototype.slice.call(h).join("")+`
`+new Error().stack),d=!1}return o.apply(this,arguments)},o)}var de={};function R(r,o){f.deprecationHandler!=null&&f.deprecationHandler(r,o),de[r]||(Ce(o),de[r]=!0)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;function me(r){return typeof Function<"u"&&r instanceof Function||Object.prototype.toString.call(r)==="[object Function]"}function ye(r){var o,d;for(d in r)S(r,d)&&(o=r[d],me(o)?this[d]=o:this["_"+d]=o);this._config=r,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function fe(r,o){var d=X({},r),h;for(h in o)S(o,h)&&(U(r[h])&&U(o[h])?(d[h]={},X(d[h],r[h]),X(d[h],o[h])):o[h]!=null?d[h]=o[h]:delete d[h]);for(h in r)S(r,h)&&!S(o,h)&&U(r[h])&&(d[h]=X({},d[h]));return d}function q(r){r!=null&&this.set(r)}var ie;Object.keys?ie=Object.keys:ie=function(r){var o,d=[];for(o in r)S(r,o)&&d.push(o);return d};var je={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Ae(r,o,d){var h=this._calendar[r]||this._calendar.sameElse;return me(h)?h.call(o,d):h}function _e(r,o,d){var h=""+Math.abs(r),x=o-h.length,D=r>=0;return(D?d?"+":"":"-")+Math.pow(10,Math.max(0,x)).toString().substr(1)+h}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,F={},xe={};function P(r,o,d,h){var x=h;typeof h=="string"&&(x=function(){return this[h]()}),r&&(xe[r]=x),o&&(xe[o[0]]=function(){return _e(x.apply(this,arguments),o[1],o[2])}),d&&(xe[d]=function(){return this.localeData().ordinal(x.apply(this,arguments),r)})}function Te(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function ze(r){var o=r.match(w),d,h;for(d=0,h=o.length;d<h;d++)xe[o[d]]?o[d]=xe[o[d]]:o[d]=Te(o[d]);return function(x){var D="",ae;for(ae=0;ae<h;ae++)D+=me(o[ae])?o[ae].call(x,r):o[ae];return D}}function Be(r,o){return r.isValid()?(o=k(o,r.localeData()),F[o]=F[o]||ze(o),F[o](r)):r.localeData().invalidDate()}function k(r,o){var d=5;function h(x){return o.longDateFormat(x)||x}for(H.lastIndex=0;d>=0&&H.test(r);)r=r.replace(H,h),H.lastIndex=0,d-=1;return r}var E={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function te(r){var o=this._longDateFormat[r],d=this._longDateFormat[r.toUpperCase()];return o||!d?o:(this._longDateFormat[r]=d.match(w).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[r])}var re="Invalid date";function Ne(){return this._invalidDate}var Me="%d",We=/\d{1,2}/;function Je(r){return this._ordinal.replace("%d",r)}var at={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Bt(r,o,d,h){var x=this._relativeTime[d];return me(x)?x(r,o,d,h):x.replace(/%d/i,r)}function Gt(r,o){var d=this._relativeTime[r>0?"future":"past"];return me(d)?d(o):d.replace(/%s/i,o)}var Vt={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function yt(r){return typeof r=="string"?Vt[r]||Vt[r.toLowerCase()]:void 0}function ea(r){var o={},d,h;for(h in r)S(r,h)&&(d=yt(h),d&&(o[d]=r[h]));return o}var ke={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function se(r){var o=[],d;for(d in r)S(r,d)&&o.push({unit:d,priority:ke[d]});return o.sort(function(h,x){return h.priority-x.priority}),o}var we=/\d/,Ee=/\d\d/,ht=/\d{3}/,he=/\d{4}/,it=/[+-]?\d{6}/,Ve=/\d\d?/,Et=/\d\d\d\d?/,Re=/\d\d\d\d\d\d?/,ta=/\d{1,3}/,Lt=/\d{1,4}/,Ft=/[+-]?\d{1,6}/,wt=/\d+/,ge=/[+-]?\d+/,et=/Z|[+-]\d\d:?\d\d/gi,Ye=/Z|[+-]\d\d(?::?\d\d)?/gi,Ze=/[+-]?\d+(\.\d{1,3})?/,zt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ge=/^[1-9]\d?/,W=/^([1-9]\d|\d)/,ft;ft={};function ve(r,o,d){ft[r]=me(o)?o:function(h,x){return h&&d?d:o}}function Tt(r,o){return S(ft,r)?ft[r](o._strict,o._locale):new RegExp(sr(r))}function sr(r){return fa(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(o,d,h,x,D){return d||h||x||D}))}function fa(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Qt(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function Ke(r){var o=+r,d=0;return o!==0&&isFinite(o)&&(d=Qt(o)),d}var Ks={};function ut(r,o){var d,h=o,x;for(typeof r=="string"&&(r=[r]),V(o)&&(h=function(D,ae){ae[o]=Ke(D)}),x=r.length,d=0;d<x;d++)Ks[r[d]]=h}function Ta(r,o){ut(r,function(d,h,x,D){x._w=x._w||{},o(d,x._w,x,D)})}function Yr(r,o,d){o!=null&&S(Ks,r)&&Ks[r](o,d._a,d,r)}function dt(r){return r%4===0&&r%100!==0||r%400===0}var Zt=0,Oa=1,At=2,Xe=3,Ot=4,ma=5,hs=6,ed=7,td=8;P("Y",0,0,function(){var r=this.year();return r<=9999?_e(r,4):"+"+r}),P(0,["YY",2],0,function(){return this.year()%100}),P(0,["YYYY",4],0,"year"),P(0,["YYYYY",5],0,"year"),P(0,["YYYYYY",6,!0],0,"year"),ve("Y",ge),ve("YY",Ve,Ee),ve("YYYY",Lt,he),ve("YYYYY",Ft,it),ve("YYYYYY",Ft,it),ut(["YYYYY","YYYYYY"],Zt),ut("YYYY",function(r,o){o[Zt]=r.length===2?f.parseTwoDigitYear(r):Ke(r)}),ut("YY",function(r,o){o[Zt]=f.parseTwoDigitYear(r)}),ut("Y",function(r,o){o[Zt]=parseInt(r,10)});function jl(r){return dt(r)?366:365}f.parseTwoDigitYear=function(r){return Ke(r)+(Ke(r)>68?1900:2e3)};var Nl=Qa("FullYear",!0);function Cn(){return dt(this.year())}function Qa(r,o){return function(d){return d!=null?(wl(this,r,d),f.updateOffset(this,o),this):Ia(this,r)}}function Ia(r,o){if(!r.isValid())return NaN;var d=r._d,h=r._isUTC;switch(o){case"Milliseconds":return h?d.getUTCMilliseconds():d.getMilliseconds();case"Seconds":return h?d.getUTCSeconds():d.getSeconds();case"Minutes":return h?d.getUTCMinutes():d.getMinutes();case"Hours":return h?d.getUTCHours():d.getHours();case"Date":return h?d.getUTCDate():d.getDate();case"Day":return h?d.getUTCDay():d.getDay();case"Month":return h?d.getUTCMonth():d.getMonth();case"FullYear":return h?d.getUTCFullYear():d.getFullYear();default:return NaN}}function wl(r,o,d){var h,x,D,ae,De;if(!(!r.isValid()||isNaN(d))){switch(h=r._d,x=r._isUTC,o){case"Milliseconds":return void(x?h.setUTCMilliseconds(d):h.setMilliseconds(d));case"Seconds":return void(x?h.setUTCSeconds(d):h.setSeconds(d));case"Minutes":return void(x?h.setUTCMinutes(d):h.setMinutes(d));case"Hours":return void(x?h.setUTCHours(d):h.setHours(d));case"Date":return void(x?h.setUTCDate(d):h.setDate(d));case"FullYear":break;default:return}D=d,ae=r.month(),De=r.date(),De=De===29&&ae===1&&!dt(D)?28:De,x?h.setUTCFullYear(D,ae,De):h.setFullYear(D,ae,De)}}function kl(r){return r=yt(r),me(this[r])?this[r]():this}function Wt(r,o){if(typeof r=="object"){r=ea(r);var d=se(r),h,x=d.length;for(h=0;h<x;h++)this[d[h].unit](r[d[h].unit])}else if(r=yt(r),me(this[r]))return this[r](o);return this}function no(r,o){return(r%o+o)%o}var Rt;Array.prototype.indexOf?Rt=Array.prototype.indexOf:Rt=function(r){var o;for(o=0;o<this.length;++o)if(this[o]===r)return o;return-1};function fs(r,o){if(isNaN(r)||isNaN(o))return NaN;var d=no(o,12);return r+=(o-d)/12,d===1?dt(r)?29:28:31-d%7%2}P("M",["MM",2],"Mo",function(){return this.month()+1}),P("MMM",0,0,function(r){return this.localeData().monthsShort(this,r)}),P("MMMM",0,0,function(r){return this.localeData().months(this,r)}),ve("M",Ve,Ge),ve("MM",Ve,Ee),ve("MMM",function(r,o){return o.monthsShortRegex(r)}),ve("MMMM",function(r,o){return o.monthsRegex(r)}),ut(["M","MM"],function(r,o){o[Oa]=Ke(r)-1}),ut(["MMM","MMMM"],function(r,o,d,h){var x=d._locale.monthsParse(r,h,d._strict);x!=null?o[Oa]=x:M(d).invalidMonth=r});var _l="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),io="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Tn=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,oo=zt,ad=zt;function zr(r,o){return r?v(this._months)?this._months[r.month()]:this._months[(this._months.isFormat||Tn).test(o)?"format":"standalone"][r.month()]:v(this._months)?this._months:this._months.standalone}function Rr(r,o){return r?v(this._monthsShort)?this._monthsShort[r.month()]:this._monthsShort[Tn.test(o)?"format":"standalone"][r.month()]:v(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ms(r,o,d){var h,x,D,ae=r.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],h=0;h<12;++h)D=G([2e3,h]),this._shortMonthsParse[h]=this.monthsShort(D,"").toLocaleLowerCase(),this._longMonthsParse[h]=this.months(D,"").toLocaleLowerCase();return d?o==="MMM"?(x=Rt.call(this._shortMonthsParse,ae),x!==-1?x:null):(x=Rt.call(this._longMonthsParse,ae),x!==-1?x:null):o==="MMM"?(x=Rt.call(this._shortMonthsParse,ae),x!==-1?x:(x=Rt.call(this._longMonthsParse,ae),x!==-1?x:null)):(x=Rt.call(this._longMonthsParse,ae),x!==-1?x:(x=Rt.call(this._shortMonthsParse,ae),x!==-1?x:null))}function Ea(r,o,d){var h,x,D;if(this._monthsParseExact)return ms.call(this,r,o,d);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),h=0;h<12;h++){if(x=G([2e3,h]),d&&!this._longMonthsParse[h]&&(this._longMonthsParse[h]=new RegExp("^"+this.months(x,"").replace(".","")+"$","i"),this._shortMonthsParse[h]=new RegExp("^"+this.monthsShort(x,"").replace(".","")+"$","i")),!d&&!this._monthsParse[h]&&(D="^"+this.months(x,"")+"|^"+this.monthsShort(x,""),this._monthsParse[h]=new RegExp(D.replace(".",""),"i")),d&&o==="MMMM"&&this._longMonthsParse[h].test(r))return h;if(d&&o==="MMM"&&this._shortMonthsParse[h].test(r))return h;if(!d&&this._monthsParse[h].test(r))return h}}function On(r,o){if(!r.isValid())return r;if(typeof o=="string"){if(/^\d+$/.test(o))o=Ke(o);else if(o=r.localeData().monthsParse(o),!V(o))return r}var d=o,h=r.date();return h=h<29?h:Math.min(h,fs(r.year(),d)),r._isUTC?r._d.setUTCMonth(d,h):r._d.setMonth(d,h),r}function co(r){return r!=null?(On(this,r),f.updateOffset(this,!0),this):Ia(this,"Month")}function En(){return fs(this.year(),this.month())}function uo(r){return this._monthsParseExact?(S(this,"_monthsRegex")||ho.call(this),r?this._monthsShortStrictRegex:this._monthsShortRegex):(S(this,"_monthsShortRegex")||(this._monthsShortRegex=oo),this._monthsShortStrictRegex&&r?this._monthsShortStrictRegex:this._monthsShortRegex)}function Ur(r){return this._monthsParseExact?(S(this,"_monthsRegex")||ho.call(this),r?this._monthsStrictRegex:this._monthsRegex):(S(this,"_monthsRegex")||(this._monthsRegex=ad),this._monthsStrictRegex&&r?this._monthsStrictRegex:this._monthsRegex)}function ho(){function r(qe,tt){return tt.length-qe.length}var o=[],d=[],h=[],x,D,ae,De;for(x=0;x<12;x++)D=G([2e3,x]),ae=fa(this.monthsShort(D,"")),De=fa(this.months(D,"")),o.push(ae),d.push(De),h.push(De),h.push(ae);o.sort(r),d.sort(r),h.sort(r),this._monthsRegex=new RegExp("^("+h.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function La(r,o,d,h,x,D,ae){var De;return r<100&&r>=0?(De=new Date(r+400,o,d,h,x,D,ae),isFinite(De.getFullYear())&&De.setFullYear(r)):De=new Date(r,o,d,h,x,D,ae),De}function Is(r){var o,d;return r<100&&r>=0?(d=Array.prototype.slice.call(arguments),d[0]=r+400,o=new Date(Date.UTC.apply(null,d)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(r)):o=new Date(Date.UTC.apply(null,arguments)),o}function lr(r,o,d){var h=7+o-d,x=(7+Is(r,0,h).getUTCDay()-o)%7;return-x+h-1}function Hr(r,o,d,h,x){var D=(7+d-h)%7,ae=lr(r,h,x),De=1+7*(o-1)+D+ae,qe,tt;return De<=0?(qe=r-1,tt=jl(qe)+De):De>jl(r)?(qe=r+1,tt=De-jl(r)):(qe=r,tt=De),{year:qe,dayOfYear:tt}}function Pa(r,o,d){var h=lr(r.year(),o,d),x=Math.floor((r.dayOfYear()-h-1)/7)+1,D,ae;return x<1?(ae=r.year()-1,D=x+es(ae,o,d)):x>es(r.year(),o,d)?(D=x-es(r.year(),o,d),ae=r.year()+1):(ae=r.year(),D=x),{week:D,year:ae}}function es(r,o,d){var h=lr(r,o,d),x=lr(r+1,o,d);return(jl(r)-h+x)/7}P("w",["ww",2],"wo","week"),P("W",["WW",2],"Wo","isoWeek"),ve("w",Ve,Ge),ve("ww",Ve,Ee),ve("W",Ve,Ge),ve("WW",Ve,Ee),Ta(["w","ww","W","WW"],function(r,o,d,h){o[h.substr(0,1)]=Ke(r)});function fo(r){return Pa(r,this._week.dow,this._week.doy).week}var Sl={dow:0,doy:6};function sd(){return this._week.dow}function mo(){return this._week.doy}function go(r){var o=this.localeData().week(this);return r==null?o:this.add((r-o)*7,"d")}function Ln(r){var o=Pa(this,1,4).week;return r==null?o:this.add((r-o)*7,"d")}P("d",0,"do","day"),P("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),P("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),P("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),P("e",0,0,"weekday"),P("E",0,0,"isoWeekday"),ve("d",Ve),ve("e",Ve),ve("E",Ve),ve("dd",function(r,o){return o.weekdaysMinRegex(r)}),ve("ddd",function(r,o){return o.weekdaysShortRegex(r)}),ve("dddd",function(r,o){return o.weekdaysRegex(r)}),Ta(["dd","ddd","dddd"],function(r,o,d,h){var x=d._locale.weekdaysParse(r,h,d._strict);x!=null?o.d=x:M(d).invalidWeekday=r}),Ta(["d","e","E"],function(r,o,d,h){o[h]=Ke(r)});function ld(r,o){return typeof r!="string"?r:isNaN(r)?(r=o.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function rd(r,o){return typeof r=="string"?o.weekdaysParse(r)%7||7:isNaN(r)?null:r}function Dl(r,o){return r.slice(o,7).concat(r.slice(0,o))}var gs="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),qr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),An="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ml=zt,Cl=zt,xo=zt;function Yn(r,o){var d=v(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return r===!0?Dl(d,this._week.dow):r?d[r.day()]:d}function po(r){return r===!0?Dl(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function rr(r){return r===!0?Dl(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function xs(r,o,d){var h,x,D,ae=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)D=G([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(D,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(D,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(D,"").toLocaleLowerCase();return d?o==="dddd"?(x=Rt.call(this._weekdaysParse,ae),x!==-1?x:null):o==="ddd"?(x=Rt.call(this._shortWeekdaysParse,ae),x!==-1?x:null):(x=Rt.call(this._minWeekdaysParse,ae),x!==-1?x:null):o==="dddd"?(x=Rt.call(this._weekdaysParse,ae),x!==-1||(x=Rt.call(this._shortWeekdaysParse,ae),x!==-1)?x:(x=Rt.call(this._minWeekdaysParse,ae),x!==-1?x:null)):o==="ddd"?(x=Rt.call(this._shortWeekdaysParse,ae),x!==-1||(x=Rt.call(this._weekdaysParse,ae),x!==-1)?x:(x=Rt.call(this._minWeekdaysParse,ae),x!==-1?x:null)):(x=Rt.call(this._minWeekdaysParse,ae),x!==-1||(x=Rt.call(this._weekdaysParse,ae),x!==-1)?x:(x=Rt.call(this._shortWeekdaysParse,ae),x!==-1?x:null))}function zn(r,o,d){var h,x,D;if(this._weekdaysParseExact)return xs.call(this,r,o,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(x=G([2e3,1]).day(h),d&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(x,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(x,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(x,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[h]||(D="^"+this.weekdays(x,"")+"|^"+this.weekdaysShort(x,"")+"|^"+this.weekdaysMin(x,""),this._weekdaysParse[h]=new RegExp(D.replace(".",""),"i")),d&&o==="dddd"&&this._fullWeekdaysParse[h].test(r))return h;if(d&&o==="ddd"&&this._shortWeekdaysParse[h].test(r))return h;if(d&&o==="dd"&&this._minWeekdaysParse[h].test(r))return h;if(!d&&this._weekdaysParse[h].test(r))return h}}function nr(r){if(!this.isValid())return r!=null?this:NaN;var o=Ia(this,"Day");return r!=null?(r=ld(r,this.localeData()),this.add(r-o,"d")):o}function Os(r){if(!this.isValid())return r!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return r==null?o:this.add(r-o,"d")}function Rn(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var o=rd(r,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function Br(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Tl.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(S(this,"_weekdaysRegex")||(this._weekdaysRegex=Ml),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function yo(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Tl.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(S(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Cl),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gr(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Tl.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(S(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xo),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Tl(){function r(ca,Fa){return Fa.length-ca.length}var o=[],d=[],h=[],x=[],D,ae,De,qe,tt;for(D=0;D<7;D++)ae=G([2e3,1]).day(D),De=fa(this.weekdaysMin(ae,"")),qe=fa(this.weekdaysShort(ae,"")),tt=fa(this.weekdays(ae,"")),o.push(De),d.push(qe),h.push(tt),x.push(De),x.push(qe),x.push(tt);o.sort(r),d.sort(r),h.sort(r),x.sort(r),this._weekdaysRegex=new RegExp("^("+x.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Vr(){return this.hours()%12||12}function ga(){return this.hours()||24}P("H",["HH",2],0,"hour"),P("h",["hh",2],0,Vr),P("k",["kk",2],0,ga),P("hmm",0,0,function(){return""+Vr.apply(this)+_e(this.minutes(),2)}),P("hmmss",0,0,function(){return""+Vr.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),P("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),P("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Es(r,o){P(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Es("a",!0),Es("A",!1);function ir(r,o){return o._meridiemParse}ve("a",ir),ve("A",ir),ve("H",Ve,W),ve("h",Ve,Ge),ve("k",Ve,Ge),ve("HH",Ve,Ee),ve("hh",Ve,Ee),ve("kk",Ve,Ee),ve("hmm",Et),ve("hmmss",Re),ve("Hmm",Et),ve("Hmmss",Re),ut(["H","HH"],Xe),ut(["k","kk"],function(r,o,d){var h=Ke(r);o[Xe]=h===24?0:h}),ut(["a","A"],function(r,o,d){d._isPm=d._locale.isPM(r),d._meridiem=r}),ut(["h","hh"],function(r,o,d){o[Xe]=Ke(r),M(d).bigHour=!0}),ut("hmm",function(r,o,d){var h=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Ot]=Ke(r.substr(h)),M(d).bigHour=!0}),ut("hmmss",function(r,o,d){var h=r.length-4,x=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Ot]=Ke(r.substr(h,2)),o[ma]=Ke(r.substr(x)),M(d).bigHour=!0}),ut("Hmm",function(r,o,d){var h=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Ot]=Ke(r.substr(h))}),ut("Hmmss",function(r,o,d){var h=r.length-4,x=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Ot]=Ke(r.substr(h,2)),o[ma]=Ke(r.substr(x))});function or(r){return(r+"").toLowerCase().charAt(0)==="p"}var nd=/[ap]\.?m?\.?/i,Un=Qa("Hours",!0);function Hn(r,o,d){return r>11?d?"pm":"PM":d?"am":"AM"}var Ol={calendar:je,longDateFormat:E,invalidDate:re,ordinal:Me,dayOfMonthOrdinalParse:We,relativeTime:at,months:_l,monthsShort:io,week:Sl,weekdays:gs,weekdaysMin:An,weekdaysShort:qr,meridiemParse:nd},vt={},El={},cr;function id(r,o){var d,h=Math.min(r.length,o.length);for(d=0;d<h;d+=1)if(r[d]!==o[d])return d;return h}function bo(r){return r&&r.toLowerCase().replace("_","-")}function qn(r){for(var o=0,d,h,x,D;o<r.length;){for(D=bo(r[o]).split("-"),d=D.length,h=bo(r[o+1]),h=h?h.split("-"):null;d>0;){if(x=$r(D.slice(0,d).join("-")),x)return x;if(h&&h.length>=d&&id(D,h)>=d-1)break;d--}o++}return cr}function od(r){return!!(r&&r.match("^[^/\\\\]*$"))}function $r(r){var o=null,d;if(vt[r]===void 0&&c&&c.exports&&od(r))try{o=cr._abbr,d=kp,d("./locale/"+r),Ls(o)}catch{vt[r]=null}return vt[r]}function Ls(r,o){var d;return r&&(_(o)?d=ts(r):d=Bn(r,o),d?cr=d:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),cr._abbr}function Bn(r,o){if(o!==null){var d,h=Ol;if(o.abbr=r,vt[r]!=null)R("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=vt[r]._config;else if(o.parentLocale!=null)if(vt[o.parentLocale]!=null)h=vt[o.parentLocale]._config;else if(d=$r(o.parentLocale),d!=null)h=d._config;else return El[o.parentLocale]||(El[o.parentLocale]=[]),El[o.parentLocale].push({name:r,config:o}),null;return vt[r]=new q(fe(h,o)),El[r]&&El[r].forEach(function(x){Bn(x.name,x.config)}),Ls(r),vt[r]}else return delete vt[r],null}function cd(r,o){if(o!=null){var d,h,x=Ol;vt[r]!=null&&vt[r].parentLocale!=null?vt[r].set(fe(vt[r]._config,o)):(h=$r(r),h!=null&&(x=h._config),o=fe(x,o),h==null&&(o.abbr=r),d=new q(o),d.parentLocale=vt[r],vt[r]=d),Ls(r)}else vt[r]!=null&&(vt[r].parentLocale!=null?(vt[r]=vt[r].parentLocale,r===Ls()&&Ls(r)):vt[r]!=null&&delete vt[r]);return vt[r]}function ts(r){var o;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return cr;if(!v(r)){if(o=$r(r),o)return o;r=[r]}return qn(r)}function dd(){return ie(vt)}function Gn(r){var o,d=r._a;return d&&M(r).overflow===-2&&(o=d[Oa]<0||d[Oa]>11?Oa:d[At]<1||d[At]>fs(d[Zt],d[Oa])?At:d[Xe]<0||d[Xe]>24||d[Xe]===24&&(d[Ot]!==0||d[ma]!==0||d[hs]!==0)?Xe:d[Ot]<0||d[Ot]>59?Ot:d[ma]<0||d[ma]>59?ma:d[hs]<0||d[hs]>999?hs:-1,M(r)._overflowDayOfYear&&(o<Zt||o>At)&&(o=At),M(r)._overflowWeeks&&o===-1&&(o=ed),M(r)._overflowWeekday&&o===-1&&(o=td),M(r).overflow=o),r}var ud=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,hd=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vn=/Z|[+-]\d\d(?::?\d\d)?/,Qr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],$n=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],fd=/^\/?Date\((-?\d+)/i,vo=/^(?:(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{4}))$/,md={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function jo(r){var o,d,h=r._i,x=ud.exec(h)||hd.exec(h),D,ae,De,qe,tt=Qr.length,ca=$n.length;if(x){for(M(r).iso=!0,o=0,d=tt;o<d;o++)if(Qr[o][1].exec(x[1])){ae=Qr[o][0],D=Qr[o][2]!==!1;break}if(ae==null){r._isValid=!1;return}if(x[3]){for(o=0,d=ca;o<d;o++)if($n[o][1].exec(x[3])){De=(x[2]||" ")+$n[o][0];break}if(De==null){r._isValid=!1;return}}if(!D&&De!=null){r._isValid=!1;return}if(x[4])if(Vn.exec(x[4]))qe="Z";else{r._isValid=!1;return}r._f=ae+(De||"")+(qe||""),Zr(r)}else r._isValid=!1}function gd(r,o,d,h,x,D){var ae=[xd(r),io.indexOf(o),parseInt(d,10),parseInt(h,10),parseInt(x,10)];return D&&ae.push(parseInt(D,10)),ae}function xd(r){var o=parseInt(r,10);return o<=49?2e3+o:o<=999?1900+o:o}function pd(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function yd(r,o,d){if(r){var h=qr.indexOf(r),x=new Date(o[0],o[1],o[2]).getDay();if(h!==x)return M(d).weekdayMismatch=!0,d._isValid=!1,!1}return!0}function bd(r,o,d){if(r)return md[r];if(o)return 0;var h=parseInt(d,10),x=h%100,D=(h-x)/100;return D*60+x}function No(r){var o=vo.exec(pd(r._i)),d;if(o){if(d=gd(o[4],o[3],o[2],o[5],o[6],o[7]),!yd(o[1],d,r))return;r._a=d,r._tzm=bd(o[8],o[9],o[10]),r._d=Is.apply(null,r._a),r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),M(r).rfc2822=!0}else r._isValid=!1}function vd(r){var o=fd.exec(r._i);if(o!==null){r._d=new Date(+o[1]);return}if(jo(r),r._isValid===!1)delete r._isValid;else return;if(No(r),r._isValid===!1)delete r._isValid;else return;r._strict?r._isValid=!1:f.createFromInputFallback(r)}f.createFromInputFallback=Se("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(r){r._d=new Date(r._i+(r._useUTC?" UTC":""))});function As(r,o,d){return r??o??d}function dr(r){var o=new Date(f.now());return r._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Qn(r){var o,d,h=[],x,D,ae;if(!r._d){for(x=dr(r),r._w&&r._a[At]==null&&r._a[Oa]==null&&wo(r),r._dayOfYear!=null&&(ae=As(r._a[Zt],x[Zt]),(r._dayOfYear>jl(ae)||r._dayOfYear===0)&&(M(r)._overflowDayOfYear=!0),d=Is(ae,0,r._dayOfYear),r._a[Oa]=d.getUTCMonth(),r._a[At]=d.getUTCDate()),o=0;o<3&&r._a[o]==null;++o)r._a[o]=h[o]=x[o];for(;o<7;o++)r._a[o]=h[o]=r._a[o]==null?o===2?1:0:r._a[o];r._a[Xe]===24&&r._a[Ot]===0&&r._a[ma]===0&&r._a[hs]===0&&(r._nextDay=!0,r._a[Xe]=0),r._d=(r._useUTC?Is:La).apply(null,h),D=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[Xe]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==D&&(M(r).weekdayMismatch=!0)}}function wo(r){var o,d,h,x,D,ae,De,qe,tt;o=r._w,o.GG!=null||o.W!=null||o.E!=null?(D=1,ae=4,d=As(o.GG,r._a[Zt],Pa(kt(),1,4).year),h=As(o.W,1),x=As(o.E,1),(x<1||x>7)&&(qe=!0)):(D=r._locale._week.dow,ae=r._locale._week.doy,tt=Pa(kt(),D,ae),d=As(o.gg,r._a[Zt],tt.year),h=As(o.w,tt.week),o.d!=null?(x=o.d,(x<0||x>6)&&(qe=!0)):o.e!=null?(x=o.e+D,(o.e<0||o.e>6)&&(qe=!0)):x=D),h<1||h>es(d,D,ae)?M(r)._overflowWeeks=!0:qe!=null?M(r)._overflowWeekday=!0:(De=Hr(d,h,x,D,ae),r._a[Zt]=De.year,r._dayOfYear=De.dayOfYear)}f.ISO_8601=function(){},f.RFC_2822=function(){};function Zr(r){if(r._f===f.ISO_8601){jo(r);return}if(r._f===f.RFC_2822){No(r);return}r._a=[],M(r).empty=!0;var o=""+r._i,d,h,x,D,ae,De=o.length,qe=0,tt,ca;for(x=k(r._f,r._locale).match(w)||[],ca=x.length,d=0;d<ca;d++)D=x[d],h=(o.match(Tt(D,r))||[])[0],h&&(ae=o.substr(0,o.indexOf(h)),ae.length>0&&M(r).unusedInput.push(ae),o=o.slice(o.indexOf(h)+h.length),qe+=h.length),xe[D]?(h?M(r).empty=!1:M(r).unusedTokens.push(D),Yr(D,h,r)):r._strict&&!h&&M(r).unusedTokens.push(D);M(r).charsLeftOver=De-qe,o.length>0&&M(r).unusedInput.push(o),r._a[Xe]<=12&&M(r).bigHour===!0&&r._a[Xe]>0&&(M(r).bigHour=void 0),M(r).parsedDateParts=r._a.slice(0),M(r).meridiem=r._meridiem,r._a[Xe]=ko(r._locale,r._a[Xe],r._meridiem),tt=M(r).era,tt!==null&&(r._a[Zt]=r._locale.erasConvertYear(tt,r._a[Zt])),Qn(r),Gn(r)}function ko(r,o,d){var h;return d==null?o:r.meridiemHour!=null?r.meridiemHour(o,d):(r.isPM!=null&&(h=r.isPM(d),h&&o<12&&(o+=12),!h&&o===12&&(o=0)),o)}function _o(r){var o,d,h,x,D,ae,De=!1,qe=r._f.length;if(qe===0){M(r).invalidFormat=!0,r._d=new Date(NaN);return}for(x=0;x<qe;x++)D=0,ae=!1,o=pe({},r),r._useUTC!=null&&(o._useUTC=r._useUTC),o._f=r._f[x],Zr(o),j(o)&&(ae=!0),D+=M(o).charsLeftOver,D+=M(o).unusedTokens.length*10,M(o).score=D,De?D<h&&(h=D,d=o):(h==null||D<h||ae)&&(h=D,d=o,ae&&(De=!0));X(r,d||o)}function So(r){if(!r._d){var o=ea(r._i),d=o.day===void 0?o.date:o.day;r._a=J([o.year,o.month,d,o.hour,o.minute,o.second,o.millisecond],function(h){return h&&parseInt(h,10)}),Qn(r)}}function Ll(r){var o=new K(Gn(Do(r)));return o._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function Do(r){var o=r._i,d=r._f;return r._locale=r._locale||ts(r._l),o===null||d===void 0&&o===""?Y({nullInput:!0}):(typeof o=="string"&&(r._i=o=r._locale.preparse(o)),ne(o)?new K(Gn(o)):(O(o)?r._d=o:v(d)?_o(r):d?Zr(r):jd(r),j(r)||(r._d=null),r))}function jd(r){var o=r._i;_(o)?r._d=new Date(f.now()):O(o)?r._d=new Date(o.valueOf()):typeof o=="string"?vd(r):v(o)?(r._a=J(o.slice(0),function(d){return parseInt(d,10)}),Qn(r)):U(o)?So(r):V(o)?r._d=new Date(o):f.createFromInputFallback(r)}function Mo(r,o,d,h,x){var D={};return(o===!0||o===!1)&&(h=o,o=void 0),(d===!0||d===!1)&&(h=d,d=void 0),(U(r)&&T(r)||v(r)&&r.length===0)&&(r=void 0),D._isAMomentObject=!0,D._useUTC=D._isUTC=x,D._l=d,D._i=r,D._f=o,D._strict=h,Ll(D)}function kt(r,o,d,h){return Mo(r,o,d,h,!1)}var Co=Se("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=kt.apply(null,arguments);return this.isValid()&&r.isValid()?r<this?this:r:Y()}),ur=Se("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=kt.apply(null,arguments);return this.isValid()&&r.isValid()?r>this?this:r:Y()});function Al(r,o){var d,h;if(o.length===1&&v(o[0])&&(o=o[0]),!o.length)return kt();for(d=o[0],h=1;h<o.length;++h)(!o[h].isValid()||o[h][r](d))&&(d=o[h]);return d}function Nd(){var r=[].slice.call(arguments,0);return Al("isBefore",r)}function Xr(){var r=[].slice.call(arguments,0);return Al("isAfter",r)}var To=function(){return Date.now?Date.now():+new Date},Yl=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Zn(r){var o,d=!1,h,x=Yl.length;for(o in r)if(S(r,o)&&!(Rt.call(Yl,o)!==-1&&(r[o]==null||!isNaN(r[o]))))return!1;for(h=0;h<x;++h)if(r[Yl[h]]){if(d)return!1;parseFloat(r[Yl[h]])!==Ke(r[Yl[h]])&&(d=!0)}return!0}function Xn(){return this._isValid}function Oo(){return va(NaN)}function hr(r){var o=ea(r),d=o.year||0,h=o.quarter||0,x=o.month||0,D=o.week||o.isoWeek||0,ae=o.day||0,De=o.hour||0,qe=o.minute||0,tt=o.second||0,ca=o.millisecond||0;this._isValid=Zn(o),this._milliseconds=+ca+tt*1e3+qe*6e4+De*1e3*60*60,this._days=+ae+D*7,this._months=+x+h*3+d*12,this._data={},this._locale=ts(),this._bubble()}function fr(r){return r instanceof hr}function Fn(r){return r<0?Math.round(-1*r)*-1:Math.round(r)}function wd(r,o,d){var h=Math.min(r.length,o.length),x=Math.abs(r.length-o.length),D=0,ae;for(ae=0;ae<h;ae++)Ke(r[ae])!==Ke(o[ae])&&D++;return D+x}function Eo(r,o){P(r,0,0,function(){var d=this.utcOffset(),h="+";return d<0&&(d=-d,h="-"),h+_e(~~(d/60),2)+o+_e(~~d%60,2)})}Eo("Z",":"),Eo("ZZ",""),ve("Z",Ye),ve("ZZ",Ye),ut(["Z","ZZ"],function(r,o,d){d._useUTC=!0,d._tzm=Wn(Ye,r)});var kd=/([\+\-]|\d\d)/gi;function Wn(r,o){var d=(o||"").match(r),h,x,D;return d===null?null:(h=d[d.length-1]||[],x=(h+"").match(kd)||["-",0,0],D=+(x[1]*60)+Ke(x[2]),D===0?0:x[0]==="+"?D:-D)}function na(r,o){var d,h;return o._isUTC?(d=o.clone(),h=(ne(r)||O(r)?r.valueOf():kt(r).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+h),f.updateOffset(d,!1),d):kt(r).local()}function Ps(r){return-Math.round(r._d.getTimezoneOffset())}f.updateOffset=function(){};function Lo(r,o,d){var h=this._offset||0,x;if(!this.isValid())return r!=null?this:NaN;if(r!=null){if(typeof r=="string"){if(r=Wn(Ye,r),r===null)return this}else Math.abs(r)<16&&!d&&(r=r*60);return!this._isUTC&&o&&(x=Ps(this)),this._offset=r,this._isUTC=!0,x!=null&&this.add(x,"m"),h!==r&&(!o||this._changeInProgress?ti(this,va(r-h,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?h:Ps(this)}function Ao(r,o){return r!=null?(typeof r!="string"&&(r=-r),this.utcOffset(r,o),this):-this.utcOffset()}function Yo(r){return this.utcOffset(0,r)}function zo(r){return this._isUTC&&(this.utcOffset(0,r),this._isUTC=!1,r&&this.subtract(Ps(this),"m")),this}function Jn(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var r=Wn(et,this._i);r!=null?this.utcOffset(r):this.utcOffset(0,!0)}return this}function _d(r){return this.isValid()?(r=r?kt(r).utcOffset():0,(this.utcOffset()-r)%60===0):!1}function zl(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Kn(){if(!_(this._isDSTShifted))return this._isDSTShifted;var r={},o;return pe(r,this),r=Do(r),r._a?(o=r._isUTC?G(r._a):kt(r._a),this._isDSTShifted=this.isValid()&&wd(r._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function mr(){return this.isValid()?!this._isUTC:!1}function In(){return this.isValid()?this._isUTC:!1}function Pn(){return this.isValid()?this._isUTC&&this._offset===0:!1}var el=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Rl=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function va(r,o){var d=r,h=null,x,D,ae;return fr(r)?d={ms:r._milliseconds,d:r._days,M:r._months}:V(r)||!isNaN(+r)?(d={},o?d[o]=+r:d.milliseconds=+r):(h=el.exec(r))?(x=h[1]==="-"?-1:1,d={y:0,d:Ke(h[At])*x,h:Ke(h[Xe])*x,m:Ke(h[Ot])*x,s:Ke(h[ma])*x,ms:Ke(Fn(h[hs]*1e3))*x}):(h=Rl.exec(r))?(x=h[1]==="-"?-1:1,d={y:Ys(h[2],x),M:Ys(h[3],x),w:Ys(h[4],x),d:Ys(h[5],x),h:Ys(h[6],x),m:Ys(h[7],x),s:Ys(h[8],x)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(ae=Ro(kt(d.from),kt(d.to)),d={},d.ms=ae.milliseconds,d.M=ae.months),D=new hr(d),fr(r)&&S(r,"_locale")&&(D._locale=r._locale),fr(r)&&S(r,"_isValid")&&(D._isValid=r._isValid),D}va.fn=hr.prototype,va.invalid=Oo;function Ys(r,o){var d=r&&parseFloat(r.replace(",","."));return(isNaN(d)?0:d)*o}function zs(r,o){var d={};return d.months=o.month()-r.month()+(o.year()-r.year())*12,r.clone().add(d.months,"M").isAfter(o)&&--d.months,d.milliseconds=+o-+r.clone().add(d.months,"M"),d}function Ro(r,o){var d;return r.isValid()&&o.isValid()?(o=na(o,r),r.isBefore(o)?d=zs(r,o):(d=zs(o,r),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function ei(r,o){return function(d,h){var x,D;return h!==null&&!isNaN(+h)&&(R(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),D=d,d=h,h=D),x=va(d,h),ti(this,x,r),this}}function ti(r,o,d,h){var x=o._milliseconds,D=Fn(o._days),ae=Fn(o._months);r.isValid()&&(h=h??!0,ae&&On(r,Ia(r,"Month")+ae*d),D&&wl(r,"Date",Ia(r,"Date")+D*d),x&&r._d.setTime(r._d.valueOf()+x*d),h&&f.updateOffset(r,D||ae))}var Sd=ei(1,"add"),Dd=ei(-1,"subtract");function Uo(r){return typeof r=="string"||r instanceof String}function Ho(r){return ne(r)||O(r)||Uo(r)||V(r)||ai(r)||qo(r)||r===null||r===void 0}function qo(r){var o=U(r)&&!T(r),d=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],x,D,ae=h.length;for(x=0;x<ae;x+=1)D=h[x],d=d||S(r,D);return o&&d}function ai(r){var o=v(r),d=!1;return o&&(d=r.filter(function(h){return!V(h)&&Uo(r)}).length===0),o&&d}function Za(r){var o=U(r)&&!T(r),d=!1,h=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],x,D;for(x=0;x<h.length;x+=1)D=h[x],d=d||S(r,D);return o&&d}function Fr(r,o){var d=r.diff(o,"days",!0);return d<-6?"sameElse":d<-1?"lastWeek":d<0?"lastDay":d<1?"sameDay":d<2?"nextDay":d<7?"nextWeek":"sameElse"}function Aa(r,o){arguments.length===1&&(arguments[0]?Ho(arguments[0])?(r=arguments[0],o=void 0):Za(arguments[0])&&(o=arguments[0],r=void 0):(r=void 0,o=void 0));var d=r||kt(),h=na(d,this).startOf("day"),x=f.calendarFormat(this,h)||"sameElse",D=o&&(me(o[x])?o[x].call(this,d):o[x]);return this.format(D||this.localeData().calendar(x,this,kt(d)))}function Ul(){return new K(this)}function si(r,o){var d=ne(r)?r:kt(r);return this.isValid()&&d.isValid()?(o=yt(o)||"millisecond",o==="millisecond"?this.valueOf()>d.valueOf():d.valueOf()<this.clone().startOf(o).valueOf()):!1}function Wr(r,o){var d=ne(r)?r:kt(r);return this.isValid()&&d.isValid()?(o=yt(o)||"millisecond",o==="millisecond"?this.valueOf()<d.valueOf():this.clone().endOf(o).valueOf()<d.valueOf()):!1}function Jr(r,o,d,h){var x=ne(r)?r:kt(r),D=ne(o)?o:kt(o);return this.isValid()&&x.isValid()&&D.isValid()?(h=h||"()",(h[0]==="("?this.isAfter(x,d):!this.isBefore(x,d))&&(h[1]===")"?this.isBefore(D,d):!this.isAfter(D,d))):!1}function li(r,o){var d=ne(r)?r:kt(r),h;return this.isValid()&&d.isValid()?(o=yt(o)||"millisecond",o==="millisecond"?this.valueOf()===d.valueOf():(h=d.valueOf(),this.clone().startOf(o).valueOf()<=h&&h<=this.clone().endOf(o).valueOf())):!1}function tl(r,o){return this.isSame(r,o)||this.isAfter(r,o)}function Bo(r,o){return this.isSame(r,o)||this.isBefore(r,o)}function Kr(r,o,d){var h,x,D;if(!this.isValid())return NaN;if(h=na(r,this),!h.isValid())return NaN;switch(x=(h.utcOffset()-this.utcOffset())*6e4,o=yt(o),o){case"year":D=ps(this,h)/12;break;case"month":D=ps(this,h);break;case"quarter":D=ps(this,h)/3;break;case"second":D=(this-h)/1e3;break;case"minute":D=(this-h)/6e4;break;case"hour":D=(this-h)/36e5;break;case"day":D=(this-h-x)/864e5;break;case"week":D=(this-h-x)/6048e5;break;default:D=this-h}return d?D:Qt(D)}function ps(r,o){if(r.date()<o.date())return-ps(o,r);var d=(o.year()-r.year())*12+(o.month()-r.month()),h=r.clone().add(d,"months"),x,D;return o-h<0?(x=r.clone().add(d-1,"months"),D=(o-h)/(h-x)):(x=r.clone().add(d+1,"months"),D=(o-h)/(x-h)),-(d+D)||0}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Md(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ja(r){if(!this.isValid())return null;var o=r!==!0,d=o?this.clone().utc():this;return d.year()<0||d.year()>9999?Be(d,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):me(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Be(d,"Z")):Be(d,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ri(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",o="",d,h,x,D;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),d="["+r+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",x="-MM-DD[T]HH:mm:ss.SSS",D=o+'[")]',this.format(d+h+x+D)}function ys(r){r||(r=this.isUtc()?f.defaultFormatUtc:f.defaultFormat);var o=Be(this,r);return this.localeData().postformat(o)}function Go(r,o){return this.isValid()&&(ne(r)&&r.isValid()||kt(r).isValid())?va({to:this,from:r}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function Ir(r){return this.from(kt(),r)}function al(r,o){return this.isValid()&&(ne(r)&&r.isValid()||kt(r).isValid())?va({from:this,to:r}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function ni(r){return this.to(kt(),r)}function ii(r){var o;return r===void 0?this._locale._abbr:(o=ts(r),o!=null&&(this._locale=o),this)}var Pr=Se("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function oi(){return this._locale}var ia=1e3,Xa=60*ia,bs=60*Xa,gr=(365*400+97)*24*bs;function as(r,o){return(r%o+o)%o}function Na(r,o,d){return r<100&&r>=0?new Date(r+400,o,d)-gr:new Date(r,o,d).valueOf()}function wa(r,o,d){return r<100&&r>=0?Date.UTC(r+400,o,d)-gr:Date.UTC(r,o,d)}function Rs(r){var o,d;if(r=yt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?wa:Na,r){case"year":o=d(this.year(),0,1);break;case"quarter":o=d(this.year(),this.month()-this.month()%3,1);break;case"month":o=d(this.year(),this.month(),1);break;case"week":o=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=d(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=as(o+(this._isUTC?0:this.utcOffset()*Xa),bs);break;case"minute":o=this._d.valueOf(),o-=as(o,Xa);break;case"second":o=this._d.valueOf(),o-=as(o,ia);break}return this._d.setTime(o),f.updateOffset(this,!0),this}function ss(r){var o,d;if(r=yt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?wa:Na,r){case"year":o=d(this.year()+1,0,1)-1;break;case"quarter":o=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=d(this.year(),this.month()+1,1)-1;break;case"week":o=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=bs-as(o+(this._isUTC?0:this.utcOffset()*Xa),bs)-1;break;case"minute":o=this._d.valueOf(),o+=Xa-as(o,Xa)-1;break;case"second":o=this._d.valueOf(),o+=ia-as(o,ia)-1;break}return this._d.setTime(o),f.updateOffset(this,!0),this}function ls(){return this._d.valueOf()-(this._offset||0)*6e4}function vs(){return Math.floor(this.valueOf()/1e3)}function Vo(){return new Date(this.valueOf())}function ci(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function di(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function $o(){return this.isValid()?this.toISOString():null}function aa(){return j(this)}function Dt(){return X({},M(this))}function st(){return M(this).overflow}function Us(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}P("N",0,0,"eraAbbr"),P("NN",0,0,"eraAbbr"),P("NNN",0,0,"eraAbbr"),P("NNNN",0,0,"eraName"),P("NNNNN",0,0,"eraNarrow"),P("y",["y",1],"yo","eraYear"),P("y",["yy",2],0,"eraYear"),P("y",["yyy",3],0,"eraYear"),P("y",["yyyy",4],0,"eraYear"),ve("N",js),ve("NN",js),ve("NNN",js),ve("NNNN",Ns),ve("NNNNN",qs),ut(["N","NN","NNN","NNNN","NNNNN"],function(r,o,d,h){var x=d._locale.erasParse(r,h,d._strict);x?M(d).era=x:M(d).invalidEra=r}),ve("y",wt),ve("yy",wt),ve("yyy",wt),ve("yyyy",wt),ve("yo",ws),ut(["y","yy","yyy","yyyy"],Zt),ut(["yo"],function(r,o,d,h){var x;d._locale._eraYearOrdinalRegex&&(x=r.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?o[Zt]=d._locale.eraYearOrdinalParse(r,x):o[Zt]=parseInt(r,10)});function Ya(r,o){var d,h,x,D=this._eras||ts("en")._eras;for(d=0,h=D.length;d<h;++d){switch(typeof D[d].since){case"string":x=f(D[d].since).startOf("day"),D[d].since=x.valueOf();break}switch(typeof D[d].until){case"undefined":D[d].until=1/0;break;case"string":x=f(D[d].until).startOf("day").valueOf(),D[d].until=x.valueOf();break}}return D}function ui(r,o,d){var h,x,D=this.eras(),ae,De,qe;for(r=r.toUpperCase(),h=0,x=D.length;h<x;++h)if(ae=D[h].name.toUpperCase(),De=D[h].abbr.toUpperCase(),qe=D[h].narrow.toUpperCase(),d)switch(o){case"N":case"NN":case"NNN":if(De===r)return D[h];break;case"NNNN":if(ae===r)return D[h];break;case"NNNNN":if(qe===r)return D[h];break}else if([ae,De,qe].indexOf(r)>=0)return D[h]}function Hs(r,o){var d=r.since<=r.until?1:-1;return o===void 0?f(r.since).year():f(r.since).year()+(o-r.offset)*d}function Qo(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].name;return""}function Zo(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].narrow;return""}function Hl(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].abbr;return""}function sl(){var r,o,d,h,x=this.localeData().eras();for(r=0,o=x.length;r<o;++r)if(d=x[r].since<=x[r].until?1:-1,h=this.clone().startOf("day").valueOf(),x[r].since<=h&&h<=x[r].until||x[r].until<=h&&h<=x[r].since)return(this.year()-f(x[r].since).year())*d+x[r].offset;return this.year()}function hi(r){return S(this,"_erasNameRegex")||pr.call(this),r?this._erasNameRegex:this._erasRegex}function xr(r){return S(this,"_erasAbbrRegex")||pr.call(this),r?this._erasAbbrRegex:this._erasRegex}function fi(r){return S(this,"_erasNarrowRegex")||pr.call(this),r?this._erasNarrowRegex:this._erasRegex}function js(r,o){return o.erasAbbrRegex(r)}function Ns(r,o){return o.erasNameRegex(r)}function qs(r,o){return o.erasNarrowRegex(r)}function ws(r,o){return o._eraYearOrdinalRegex||wt}function pr(){var r=[],o=[],d=[],h=[],x,D,ae,De,qe,tt=this.eras();for(x=0,D=tt.length;x<D;++x)ae=fa(tt[x].name),De=fa(tt[x].abbr),qe=fa(tt[x].narrow),o.push(ae),r.push(De),d.push(qe),h.push(ae),h.push(De),h.push(qe);this._erasRegex=new RegExp("^("+h.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+d.join("|")+")","i")}P(0,["gg",2],0,function(){return this.weekYear()%100}),P(0,["GG",2],0,function(){return this.isoWeekYear()%100});function ql(r,o){P(0,[r,r.length],0,o)}ql("gggg","weekYear"),ql("ggggg","weekYear"),ql("GGGG","isoWeekYear"),ql("GGGGG","isoWeekYear"),ve("G",ge),ve("g",ge),ve("GG",Ve,Ee),ve("gg",Ve,Ee),ve("GGGG",Lt,he),ve("gggg",Lt,he),ve("GGGGG",Ft,it),ve("ggggg",Ft,it),Ta(["gggg","ggggg","GGGG","GGGGG"],function(r,o,d,h){o[h.substr(0,2)]=Ke(r)}),Ta(["gg","GG"],function(r,o,d,h){o[h]=f.parseTwoDigitYear(r)});function Bl(r){return Fo.call(this,r,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function en(r){return Fo.call(this,r,this.isoWeek(),this.isoWeekday(),1,4)}function ll(){return es(this.year(),1,4)}function sa(){return es(this.isoWeekYear(),1,4)}function tn(){var r=this.localeData()._week;return es(this.year(),r.dow,r.doy)}function Xo(){var r=this.localeData()._week;return es(this.weekYear(),r.dow,r.doy)}function Fo(r,o,d,h,x){var D;return r==null?Pa(this,h,x).year:(D=es(r,h,x),o>D&&(o=D),Cd.call(this,r,o,d,h,x))}function Cd(r,o,d,h,x){var D=Hr(r,o,d,h,x),ae=Is(D.year,0,D.dayOfYear);return this.year(ae.getUTCFullYear()),this.month(ae.getUTCMonth()),this.date(ae.getUTCDate()),this}P("Q",0,"Qo","quarter"),ve("Q",we),ut("Q",function(r,o){o[Oa]=(Ke(r)-1)*3});function Td(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}P("D",["DD",2],"Do","date"),ve("D",Ve,Ge),ve("DD",Ve,Ee),ve("Do",function(r,o){return r?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),ut(["D","DD"],At),ut("Do",function(r,o){o[At]=Ke(r.match(Ve)[0])});var Ht=Qa("Date",!0);P("DDD",["DDDD",3],"DDDo","dayOfYear"),ve("DDD",ta),ve("DDDD",ht),ut(["DDD","DDDD"],function(r,o,d){d._dayOfYear=Ke(r)});function mi(r){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?o:this.add(r-o,"d")}P("m",["mm",2],0,"minute"),ve("m",Ve,W),ve("mm",Ve,Ee),ut(["m","mm"],Ot);var yr=Qa("Minutes",!1);P("s",["ss",2],0,"second"),ve("s",Ve,W),ve("ss",Ve,Ee),ut(["s","ss"],ma);var br=Qa("Seconds",!1);P("S",0,0,function(){return~~(this.millisecond()/100)}),P(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),P(0,["SSS",3],0,"millisecond"),P(0,["SSSS",4],0,function(){return this.millisecond()*10}),P(0,["SSSSS",5],0,function(){return this.millisecond()*100}),P(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),P(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),P(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),P(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ve("S",ta,we),ve("SS",ta,Ee),ve("SSS",ta,ht);var rs,rl;for(rs="SSSS";rs.length<=9;rs+="S")ve(rs,wt);function Gl(r,o){o[hs]=Ke(("0."+r)*1e3)}for(rs="S";rs.length<=9;rs+="S")ut(rs,Gl);rl=Qa("Milliseconds",!1),P("z",0,0,"zoneAbbr"),P("zz",0,0,"zoneName");function Od(){return this._isUTC?"UTC":""}function Wo(){return this._isUTC?"Coordinated Universal Time":""}var be=K.prototype;be.add=Sd,be.calendar=Aa,be.clone=Ul,be.diff=Kr,be.endOf=ss,be.format=ys,be.from=Go,be.fromNow=Ir,be.to=al,be.toNow=ni,be.get=kl,be.invalidAt=st,be.isAfter=si,be.isBefore=Wr,be.isBetween=Jr,be.isSame=li,be.isSameOrAfter=tl,be.isSameOrBefore=Bo,be.isValid=aa,be.lang=Pr,be.locale=ii,be.localeData=oi,be.max=ur,be.min=Co,be.parsingFlags=Dt,be.set=Wt,be.startOf=Rs,be.subtract=Dd,be.toArray=ci,be.toObject=di,be.toDate=Vo,be.toISOString=ja,be.inspect=ri,typeof Symbol<"u"&&Symbol.for!=null&&(be[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),be.toJSON=$o,be.toString=Md,be.unix=vs,be.valueOf=ls,be.creationData=Us,be.eraName=Qo,be.eraNarrow=Zo,be.eraAbbr=Hl,be.eraYear=sl,be.year=Nl,be.isLeapYear=Cn,be.weekYear=Bl,be.isoWeekYear=en,be.quarter=be.quarters=Td,be.month=co,be.daysInMonth=En,be.week=be.weeks=go,be.isoWeek=be.isoWeeks=Ln,be.weeksInYear=tn,be.weeksInWeekYear=Xo,be.isoWeeksInYear=ll,be.isoWeeksInISOWeekYear=sa,be.date=Ht,be.day=be.days=nr,be.weekday=Os,be.isoWeekday=Rn,be.dayOfYear=mi,be.hour=be.hours=Un,be.minute=be.minutes=yr,be.second=be.seconds=br,be.millisecond=be.milliseconds=rl,be.utcOffset=Lo,be.utc=Yo,be.local=zo,be.parseZone=Jn,be.hasAlignedHourOffset=_d,be.isDST=zl,be.isLocal=mr,be.isUtcOffset=In,be.isUtc=Pn,be.isUTC=Pn,be.zoneAbbr=Od,be.zoneName=Wo,be.dates=Se("dates accessor is deprecated. Use date instead.",Ht),be.months=Se("months accessor is deprecated. Use month instead",co),be.years=Se("years accessor is deprecated. Use year instead",Nl),be.zone=Se("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ao),be.isDSTShifted=Se("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Kn);function Jo(r){return kt(r*1e3)}function nl(){return kt.apply(null,arguments).parseZone()}function an(r){return r}var lt=q.prototype;lt.calendar=Ae,lt.longDateFormat=te,lt.invalidDate=Ne,lt.ordinal=Je,lt.preparse=an,lt.postformat=an,lt.relativeTime=Bt,lt.pastFuture=Gt,lt.set=ye,lt.eras=Ya,lt.erasParse=ui,lt.erasConvertYear=Hs,lt.erasAbbrRegex=xr,lt.erasNameRegex=hi,lt.erasNarrowRegex=fi,lt.months=zr,lt.monthsShort=Rr,lt.monthsParse=Ea,lt.monthsRegex=Ur,lt.monthsShortRegex=uo,lt.week=fo,lt.firstDayOfYear=mo,lt.firstDayOfWeek=sd,lt.weekdays=Yn,lt.weekdaysMin=rr,lt.weekdaysShort=po,lt.weekdaysParse=zn,lt.weekdaysRegex=Br,lt.weekdaysShortRegex=yo,lt.weekdaysMinRegex=Gr,lt.isPM=or,lt.meridiem=Hn;function vr(r,o,d,h){var x=ts(),D=G().set(h,o);return x[d](D,r)}function il(r,o,d){if(V(r)&&(o=r,r=void 0),r=r||"",o!=null)return vr(r,o,d,"month");var h,x=[];for(h=0;h<12;h++)x[h]=vr(r,h,d,"month");return x}function jr(r,o,d,h){typeof r=="boolean"?(V(o)&&(d=o,o=void 0),o=o||""):(o=r,d=o,r=!1,V(o)&&(d=o,o=void 0),o=o||"");var x=ts(),D=r?x._week.dow:0,ae,De=[];if(d!=null)return vr(o,(d+D)%7,h,"day");for(ae=0;ae<7;ae++)De[ae]=vr(o,(ae+D)%7,h,"day");return De}function sn(r,o){return il(r,o,"months")}function ln(r,o){return il(r,o,"monthsShort")}function Ko(r,o,d){return jr(r,o,d,"weekdays")}function Io(r,o,d){return jr(r,o,d,"weekdaysShort")}function ol(r,o,d){return jr(r,o,d,"weekdaysMin")}Ls("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var o=r%10,d=Ke(r%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return r+d}}),f.lang=Se("moment.lang is deprecated. Use moment.locale instead.",Ls),f.langData=Se("moment.langData is deprecated. Use moment.localeData instead.",ts);var oa=Math.abs;function Po(){var r=this._data;return this._milliseconds=oa(this._milliseconds),this._days=oa(this._days),this._months=oa(this._months),r.milliseconds=oa(r.milliseconds),r.seconds=oa(r.seconds),r.minutes=oa(r.minutes),r.hours=oa(r.hours),r.months=oa(r.months),r.years=oa(r.years),this}function gi(r,o,d,h){var x=va(o,d);return r._milliseconds+=h*x._milliseconds,r._days+=h*x._days,r._months+=h*x._months,r._bubble()}function Vl(r,o){return gi(this,r,o,1)}function Nr(r,o){return gi(this,r,o,-1)}function wr(r){return r<0?Math.floor(r):Math.ceil(r)}function kr(){var r=this._milliseconds,o=this._days,d=this._months,h=this._data,x,D,ae,De,qe;return r>=0&&o>=0&&d>=0||r<=0&&o<=0&&d<=0||(r+=wr(rn(d)+o)*864e5,o=0,d=0),h.milliseconds=r%1e3,x=Qt(r/1e3),h.seconds=x%60,D=Qt(x/60),h.minutes=D%60,ae=Qt(D/60),h.hours=ae%24,o+=Qt(ae/24),qe=Qt(_r(o)),d+=qe,o-=wr(rn(qe)),De=Qt(d/12),d%=12,h.days=o,h.months=d,h.years=De,this}function _r(r){return r*4800/146097}function rn(r){return r*146097/4800}function cl(r){if(!this.isValid())return NaN;var o,d,h=this._milliseconds;if(r=yt(r),r==="month"||r==="quarter"||r==="year")switch(o=this._days+h/864e5,d=this._months+_r(o),r){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(o=this._days+Math.round(rn(this._months)),r){case"week":return o/7+h/6048e5;case"day":return o+h/864e5;case"hour":return o*24+h/36e5;case"minute":return o*1440+h/6e4;case"second":return o*86400+h/1e3;case"millisecond":return Math.floor(o*864e5)+h;default:throw new Error("Unknown unit "+r)}}function ns(r){return function(){return this.as(r)}}var ks=ns("ms"),xi=ns("s"),pi=ns("m"),Bs=ns("h"),Gs=ns("d"),Sr=ns("w"),yi=ns("M"),bi=ns("Q"),Dr=ns("y"),Mr=ks;function ec(){return va(this)}function tc(r){return r=yt(r),this.isValid()?this[r+"s"]():NaN}function za(r){return function(){return this.isValid()?this._data[r]:NaN}}var nn=za("milliseconds"),ac=za("seconds"),vi=za("minutes"),ji=za("hours"),ka=za("days"),Ra=za("months"),Vs=za("years");function Ni(){return Qt(this.days()/7)}var is=Math.round,_a={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Sa(r,o,d,h,x){return x.relativeTime(o||1,!!d,r,h)}function qt(r,o,d,h){var x=va(r).abs(),D=is(x.as("s")),ae=is(x.as("m")),De=is(x.as("h")),qe=is(x.as("d")),tt=is(x.as("M")),ca=is(x.as("w")),Fa=is(x.as("y")),os=D<=d.ss&&["s",D]||D<d.s&&["ss",D]||ae<=1&&["m"]||ae<d.m&&["mm",ae]||De<=1&&["h"]||De<d.h&&["hh",De]||qe<=1&&["d"]||qe<d.d&&["dd",qe];return d.w!=null&&(os=os||ca<=1&&["w"]||ca<d.w&&["ww",ca]),os=os||tt<=1&&["M"]||tt<d.M&&["MM",tt]||Fa<=1&&["y"]||["yy",Fa],os[2]=o,os[3]=+r>0,os[4]=h,Sa.apply(null,os)}function on(r){return r===void 0?is:typeof r=="function"?(is=r,!0):!1}function _s(r,o){return _a[r]===void 0?!1:o===void 0?_a[r]:(_a[r]=o,r==="s"&&(_a.ss=o-1),!0)}function $e(r,o){if(!this.isValid())return this.localeData().invalidDate();var d=!1,h=_a,x,D;return typeof r=="object"&&(o=r,r=!1),typeof r=="boolean"&&(d=r),typeof o=="object"&&(h=Object.assign({},_a,o),o.s!=null&&o.ss==null&&(h.ss=o.s-1)),x=this.localeData(),D=qt(this,!d,h,x),d&&(D=x.pastFuture(+this,D)),x.postformat(D)}var mt=Math.abs;function Mt(r){return(r>0)-(r<0)||+r}function dl(){if(!this.isValid())return this.localeData().invalidDate();var r=mt(this._milliseconds)/1e3,o=mt(this._days),d=mt(this._months),h,x,D,ae,De=this.asSeconds(),qe,tt,ca,Fa;return De?(h=Qt(r/60),x=Qt(h/60),r%=60,h%=60,D=Qt(d/12),d%=12,ae=r?r.toFixed(3).replace(/\.?0+$/,""):"",qe=De<0?"-":"",tt=Mt(this._months)!==Mt(De)?"-":"",ca=Mt(this._days)!==Mt(De)?"-":"",Fa=Mt(this._milliseconds)!==Mt(De)?"-":"",qe+"P"+(D?tt+D+"Y":"")+(d?tt+d+"M":"")+(o?ca+o+"D":"")+(x||h||r?"T":"")+(x?Fa+x+"H":"")+(h?Fa+h+"M":"")+(r?Fa+ae+"S":"")):"P0D"}var Ie=hr.prototype;Ie.isValid=Xn,Ie.abs=Po,Ie.add=Vl,Ie.subtract=Nr,Ie.as=cl,Ie.asMilliseconds=ks,Ie.asSeconds=xi,Ie.asMinutes=pi,Ie.asHours=Bs,Ie.asDays=Gs,Ie.asWeeks=Sr,Ie.asMonths=yi,Ie.asQuarters=bi,Ie.asYears=Dr,Ie.valueOf=Mr,Ie._bubble=kr,Ie.clone=ec,Ie.get=tc,Ie.milliseconds=nn,Ie.seconds=ac,Ie.minutes=vi,Ie.hours=ji,Ie.days=ka,Ie.weeks=Ni,Ie.months=Ra,Ie.years=Vs,Ie.humanize=$e,Ie.toISOString=dl,Ie.toString=dl,Ie.toJSON=dl,Ie.locale=ii,Ie.localeData=oi,Ie.toIsoString=Se("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",dl),Ie.lang=Pr,P("X",0,0,"unix"),P("x",0,0,"valueOf"),ve("x",ge),ve("X",Ze),ut("X",function(r,o,d){d._d=new Date(parseFloat(r)*1e3)}),ut("x",function(r,o,d){d._d=new Date(Ke(r))});//! moment.js
return f.version="2.30.1",g(kt),f.fn=be,f.min=Nd,f.max=Xr,f.now=To,f.utc=G,f.unix=Jo,f.months=sn,f.isDate=O,f.locale=Ls,f.invalid=Y,f.duration=va,f.isMoment=ne,f.weekdays=Ko,f.parseZone=nl,f.localeData=ts,f.isDuration=fr,f.monthsShort=ln,f.weekdaysMin=ol,f.defineLocale=Bn,f.updateLocale=cd,f.locales=dd,f.weekdaysShort=Io,f.normalizeUnits=yt,f.relativeTimeRounding=on,f.relativeTimeThreshold=_s,f.calendarFormat=Fr,f.prototype=be,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f}))})(Kc)),Kc.exports}var Pu,_0;function Dp(){if(_0)return Pu;_0=1,Pu={toJalaali:b,toGregorian:N,isValidJalaaliDate:f,isLeapJalaaliYear:g,jalaaliMonthLength:v,jalCal:S,j2d:T,d2j:_,g2d:V,d2g:O,jalaaliToDateObject:X,jalaaliWeek:J};var c=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function b(M,m,j){return Object.prototype.toString.call(M)==="[object Date]"&&(j=M.getDate(),m=M.getMonth()+1,M=M.getFullYear()),_(V(M,m,j))}function N(M,m,j){return O(T(M,m,j))}function f(M,m,j){return M>=-61&&M<=3177&&m>=1&&m<=12&&j>=1&&j<=v(M,m)}function g(M){return U(M)===0}function v(M,m){return m<=6?31:m<=11||g(M)?30:29}function U(M){var m=c.length,j=c[0],Y,z,ce,pe,K;if(M<j||M>=c[m-1])throw new Error("Invalid Jalaali year "+M);for(K=1;K<m&&(Y=c[K],z=Y-j,!(M<Y));K+=1)j=Y;return pe=M-j,z-pe<6&&(pe=pe-z+G(z+4,33)*33),ce=$($(pe+1,33)-1,4),ce===-1&&(ce=4),ce}function S(M,m){var j=c.length,Y=M+621,z=-14,ce=c[0],pe,K,ne,Ce,Se,de,R;if(M<ce||M>=c[j-1])throw new Error("Invalid Jalaali year "+M);for(R=1;R<j&&(pe=c[R],K=pe-ce,!(M<pe));R+=1)z=z+G(K,33)*8+G($(K,33),4),ce=pe;return de=M-ce,z=z+G(de,33)*8+G($(de,33)+3,4),$(K,33)===4&&K-de===4&&(z+=1),Ce=G(Y,4)-G((G(Y,100)+1)*3,4)-150,Se=20+z-Ce,m?{gy:Y,march:Se}:(K-de<6&&(de=de-K+G(K+4,33)*33),ne=$($(de+1,33)-1,4),ne===-1&&(ne=4),{leap:ne,gy:Y,march:Se})}function T(M,m,j){var Y=S(M,!0);return V(Y.gy,3,Y.march)+(m-1)*31-G(m,7)*(m-7)+j-1}function _(M){var m=O(M).gy,j=m-621,Y=S(j,!1),z=V(m,3,Y.march),ce,pe,K;if(K=M-z,K>=0){if(K<=185)return pe=1+G(K,31),ce=$(K,31)+1,{jy:j,jm:pe,jd:ce};K-=186}else j-=1,K+=179,Y.leap===1&&(K+=1);return pe=7+G(K,30),ce=$(K,30)+1,{jy:j,jm:pe,jd:ce}}function V(M,m,j){var Y=G((M+G(m-8,6)+100100)*1461,4)+G(153*$(m+9,12)+2,5)+j-34840408;return Y=Y-G(G(M+100100+G(m-8,6),100)*3,4)+752,Y}function O(M){var m,j,Y,z,ce;return m=4*M+139361631,m=m+G(G(4*M+183187720,146097)*3,4)*4-3908,j=G($(m,1461),4)*5+308,Y=G($(j,153),5)+1,z=$(G(j,153),12)+1,ce=G(m,1461)-100100+G(8-z,6),{gy:ce,gm:z,gd:Y}}function J(M,m,j){var Y=X(M,m,j).getDay(),z=Y==6?0:-(Y+1),ce=6+z;return{saturday:_(T(M,m,j+z)),friday:_(T(M,m,j+ce))}}function X(M,m,j,Y,z,ce,pe){var K=N(M,m,j);return new Date(K.gy,K.gm-1,K.gd,Y||0,z||0,ce||0,pe||0)}function G(M,m){return~~(M/m)}function $(M,m){return M-~~(M/m)*m}return Pu}var eh,S0;function Mp(){if(S0)return eh;S0=1,eh=F;var c=Sp(),b=Dp(),N=/(\[[^\[]*\])|(\\)?j(Mo|MM?M?M?|Do|DDDo|DD?D?D?|w[o|w]?|YYYYY|YYYY|YY|gg(ggg?)?|)|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,f=/(\[[^\[]*\])|(\\)?(LTS?|LL?L?L?|l{1,4})/g,g=/\d\d?/,v=/\d{1,3}/,U=/\d{3}/,S=/\d{1,4}/,T=/[+\-]?\d{1,6}/,_=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,V=/Z|[\+\-]\d\d:?\d\d/i,O=/T/i,J=/[\+\-]?\d+(\.\d{1,3})?/,X={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},G={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},$={jm:"jmonth",jmonths:"jmonth",jy:"jyear",jyears:"jyear"},M={},m="DDD w M D".split(" "),j="M D w".split(" "),Y={jM:function(){return this.jMonth()+1},jMMM:function(k){return this.localeData().jMonthsShort(this,k)},jMMMM:function(k){return this.localeData().jMonths(this,k)},jD:function(){return this.jDate()},jDDD:function(){return this.jDayOfYear()},jw:function(){return this.jWeek()},jYY:function(){return K(this.jYear()%100,2)},jYYYY:function(){return K(this.jYear(),4)},jYYYYY:function(){return K(this.jYear(),5)},jgg:function(){return K(this.jWeekYear()%100,2)},jgggg:function(){return this.jWeekYear()},jggggg:function(){return K(this.jWeekYear(),5)}};function z(k,E){return function(te){return K(k.call(this,te),E)}}function ce(k,E){return function(te){return this.localeData().ordinal(k.call(this,te),E)}}(function(){for(var k;m.length;)k=m.pop(),Y["j"+k+"o"]=ce(Y["j"+k],k);for(;j.length;)k=j.pop(),Y["j"+k+k]=z(Y["j"+k],2);Y.jDDDD=z(Y.jDDD,3)})();function pe(k,E){var te;for(te in E)E.hasOwnProperty(te)&&(k[te]=E[te]);return k}function K(k,E){for(var te=k+"";te.length<E;)te="0"+te;return te}function ne(k){return Object.prototype.toString.call(k)==="[object Array]"}function Ce(k){if(k){var E=k.toLowerCase();k=$[E]||E}return k}function Se(k,E,te,re){var Ne=k._d;isNaN(E)&&(k._isValid=!1),k._isUTC?k._d=new Date(Date.UTC(E,te,re,Ne.getUTCHours(),Ne.getUTCMinutes(),Ne.getUTCSeconds(),Ne.getUTCMilliseconds())):k._d=new Date(E,te,re,Ne.getHours(),Ne.getMinutes(),Ne.getSeconds(),Ne.getMilliseconds())}function de(k){function E(){}return E.prototype=k,new E}function R(k){return Object.getPrototypeOf?Object.getPrototypeOf(k):"".__proto__?k.__proto__:k.constructor.prototype}pe(R(c.localeData()),{_jMonths:["Farvardin","Ordibehesht","Khordaad","Tir","Amordaad","Shahrivar","Mehr","Aabaan","Aazar","Dey","Bahman","Esfand"],jMonths:function(k){return this._jMonths[k.jMonth()]},_jMonthsShort:["Far","Ord","Kho","Tir","Amo","Sha","Meh","Aab","Aaz","Dey","Bah","Esf"],jMonthsShort:function(k){return this._jMonthsShort[k.jMonth()]},jMonthsParse:function(k){var E,te,re;for(this._jMonthsParse||(this._jMonthsParse=[]),E=0;E<12;E+=1)if(this._jMonthsParse[E]||(te=F([2e3,(2+E)%12,25]),re="^"+this.jMonths(te,"")+"|^"+this.jMonthsShort(te,""),this._jMonthsParse[E]=new RegExp(re.replace(".",""),"i")),this._jMonthsParse[E].test(k))return E}});function me(k){var E=k.match(N),te=E.length,re;for(re=0;re<te;re+=1)Y[E[re]]&&(E[re]=Y[E[re]]);return function(Ne){var Me="";for(re=0;re<te;re+=1)Me+=E[re]instanceof Function?"["+E[re].call(Ne,k)+"]":E[re];return Me}}function ye(k,E){switch(k){case"jDDDD":return U;case"jYYYY":return S;case"jYYYYY":return T;case"jDDD":return v;case"jMMM":case"jMMMM":return _;case"jMM":case"jDD":case"jYY":case"jM":case"jD":return g;case"DDDD":return U;case"YYYY":return S;case"YYYYY":return T;case"S":case"SS":case"SSS":case"DDD":return v;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return _;case"a":case"A":return c.localeData(E._l)._meridiemParse;case"X":return J;case"Z":case"ZZ":return V;case"T":return O;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return g;default:return new RegExp(k.replace("\\",""))}}function fe(k,E,te){var re,Ne=te._a;switch(k){case"jM":case"jMM":Ne[1]=E==null?0:~~E-1;break;case"jMMM":case"jMMMM":re=c.localeData(te._l).jMonthsParse(E),re!=null?Ne[1]=re:te._isValid=!1;break;case"jD":case"jDD":case"jDDD":case"jDDDD":E!=null&&(Ne[2]=~~E);break;case"jYY":Ne[0]=~~E+(~~E>47?1300:1400);break;case"jYYYY":case"jYYYYY":Ne[0]=~~E}E==null&&(te._isValid=!1)}function q(k){var E,te,re=k._a[0],Ne=k._a[1],Me=k._a[2];return re==null&&Ne==null&&Me==null?[0,0,1]:(re=re??0,Ne=Ne??0,Me=Me??1,(Me<1||Me>F.jDaysInMonth(re,Ne)||Ne<0||Ne>11)&&(k._isValid=!1),E=Te(re,Ne,Me),te=P(E.gy,E.gm,E.gd),isNaN(E.gy)&&(k._isValid=!1),k._jDiff=0,~~te.jy!==re&&(k._jDiff+=1),~~te.jm!==Ne&&(k._jDiff+=1),~~te.jd!==Me&&(k._jDiff+=1),[E.gy,E.gm,E.gd])}function ie(k){var E=k._f.match(N),te=k._i+"",re=E.length,Ne,Me,We;for(k._a=[],Ne=0;Ne<re;Ne+=1)Me=E[Ne],We=(ye(Me,k).exec(te)||[])[0],We&&(te=te.slice(te.indexOf(We)+We.length)),Y[Me]&&fe(Me,We,k);return te&&(k._il=te),q(k)}function je(k,E){var te=k._f.length,re,Ne,Me,We,Je,at;if(te===0)return H(new Date(NaN));for(re=0;re<te;re+=1)Ne=k._f[re],Je=0,Me=H(k._i,Ne,k._l,k._strict,E),Me.isValid()&&(Je+=Me._jDiff,Me._il&&(Je+=Me._il.length),(at==null||Je<at)&&(at=Je,We=Me));return We}function Ae(k){var E=k._i+"",te="",re="",Ne=k._f.match(N),Me=Ne.length,We,Je,at;for(We=0;We<Me;We+=1)Je=Ne[We],at=(ye(Je,k).exec(E)||[])[0],at&&(E=E.slice(E.indexOf(at)+at.length)),Y[Je]instanceof Function||(re+=Je,at&&(te+=at));k._i=te,k._f=re}function _e(k,E,te){var re=te-E,Ne=te-k.day(),Me;return Ne>re&&(Ne-=7),Ne<re-7&&(Ne+=7),Me=F(k).add(Ne,"d"),{week:Math.ceil(Me.jDayOfYear()/7),year:Me.jYear()}}var w=57724432199999;function H(k,E,te,re,Ne){typeof te=="boolean"&&(re=te,te=void 0),E&&typeof E=="string"&&(E=xe(E,c));var Me={_i:k,_f:E,_l:te,_strict:re},We,Je,at,Bt=k,Gt=E;if(E){if(ne(E))return je(Me,Ne);We=ie(Me),Ae(Me),E="YYYY-MM-DD-"+Me._f,k=K(We[0],4)+"-"+K(We[1]+1,2)+"-"+K(We[2],2)+"-"+Me._i}return Ne?Je=c.utc(k,E,te,re):Je=c(k,E,te,re),Me._isValid===!1&&(Je._isValid=!1),Je._jDiff=Me._jDiff||0,at=de(F.fn),pe(at,Je),re&&E&&at.isValid()&&(at._isValid=at.format(Gt)===Bt),Je._d.getTime()>w&&(at._isValid=!1),at}function F(k,E,te,re){return H(k,E,te,re,!1)}pe(F,c),F.fn=de(c.fn),F.utc=function(k,E,te,re){return H(k,E,te,re,!0)},F.unix=function(k){return H(k*1e3)};function xe(k,E){for(var te=5,re=function(Ne){return E.localeData().longDateFormat(Ne)||Ne};te>0&&f.test(k);)te-=1,k=k.replace(f,re);return k}F.fn.format=function(k){return k&&(k=xe(k,this),M[k]||(M[k]=me(k)),k=M[k](this)),c.fn.format.call(this,k)},F.fn.jYear=function(k){var E,te,re;return typeof k=="number"?(te=P(this.year(),this.month(),this.date()),E=Math.min(te.jd,F.jDaysInMonth(k,te.jm)),re=Te(k,te.jm,E),Se(this,re.gy,re.gm,re.gd),c.updateOffset(this),this):P(this.year(),this.month(),this.date()).jy},F.fn.jMonth=function(k){var E,te,re;return k!=null?typeof k=="string"&&(k=this.localeData().jMonthsParse(k),typeof k!="number")?this:(te=P(this.year(),this.month(),this.date()),E=Math.min(te.jd,F.jDaysInMonth(te.jy,k)),this.jYear(te.jy+ze(k,12)),k=Be(k,12),k<0&&(k+=12,this.jYear(this.jYear()-1)),re=Te(this.jYear(),k,E),Se(this,re.gy,re.gm,re.gd),c.updateOffset(this),this):P(this.year(),this.month(),this.date()).jm},F.fn.jDate=function(k){var E,te;return typeof k=="number"?(E=P(this.year(),this.month(),this.date()),te=Te(E.jy,E.jm,k),Se(this,te.gy,te.gm,te.gd),c.updateOffset(this),this):P(this.year(),this.month(),this.date()).jd},F.fn.jDayOfYear=function(k){var E=Math.round((F(this).startOf("day")-F(this).startOf("jYear"))/864e5)+1;return k==null?E:this.add(k-E,"d")},F.fn.jWeek=function(k){var E=_e(this,this.localeData()._week.dow,this.localeData()._week.doy).week;return k==null?E:this.add((k-E)*7,"d")},F.fn.jWeekYear=function(k){var E=_e(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return k==null?E:this.add(k-E,"y")},F.fn.add=function(k,E){var te;return E!==null&&!isNaN(+E)&&(te=k,k=E,E=te),E=Ce(E),E==="jyear"?this.jYear(this.jYear()+k):E==="jmonth"?this.jMonth(this.jMonth()+k):(c.fn.add.call(this,k,E),isNaN(this.jYear())&&(this._isValid=!1)),this},F.fn.subtract=function(k,E){var te;return E!==null&&!isNaN(+E)&&(te=k,k=E,E=te),E=Ce(E),E==="jyear"?this.jYear(this.jYear()-k):E==="jmonth"?this.jMonth(this.jMonth()-k):c.fn.subtract.call(this,k,E),this},F.fn.startOf=function(k){return k=Ce(k),k==="jyear"||k==="jmonth"?(k==="jyear"&&this.jMonth(0),this.jDate(1),this.hours(0),this.minutes(0),this.seconds(0),this.milliseconds(0),this):c.fn.startOf.call(this,k)},F.fn.endOf=function(k){return k=Ce(k),k===void 0||k==="milisecond"?this:this.startOf(k).add(1,k==="isoweek"?"week":k).subtract(1,"ms")},F.fn.isSame=function(k,E){return E=Ce(E),E==="jyear"||E==="jmonth"?c.fn.isSame.call(this.startOf(E),k.startOf(E)):c.fn.isSame.call(this,k,E)},F.fn.clone=function(){return F(this)},F.fn.jYears=F.fn.jYear,F.fn.jMonths=F.fn.jMonth,F.fn.jDates=F.fn.jDate,F.fn.jWeeks=F.fn.jWeek,F.jDaysInMonth=function(k,E){return k+=ze(E,12),E=Be(E,12),E<0&&(E+=12,k-=1),E<6?31:E<11||F.jIsLeapYear(k)?30:29},F.jIsLeapYear=b.isLeapJalaaliYear,F.loadPersian=function(k){var E=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,te=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"persian";c.locale("fa"),c.updateLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[te],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(re){return E?re.replace(/[۰-۹]/g,function(Ne){return G[Ne]}).replace(/،/g,","):re},postformat:function(re){return E?re.replace(/\d/g,function(Ne){return X[Ne]}).replace(/,/g,"،"):re},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(re){return re<12?"ق.ظ":"ب.ظ"},jMonths:{persian:"فروردین_اردیبهشت_خرداد_تیر_امرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),"persian-modern":"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")}[te],jMonthsShort:{persian:"فرو_ارد_خرد_تیر_امر_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_"),"persian-modern":"فرو_ارد_خرد_تیر_مرد_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_")}[te]})},F.loadPersian_dari=function(k){var E=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,te=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"persian-dari";c.locale("fa-af"),c.updateLocale("fa-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[te],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(re){return E?re.replace(/[۰-۹]/g,function(Ne){return G[Ne]}).replace(/،/g,","):re},postformat:function(re){return E?re.replace(/\d/g,function(Ne){return X[Ne]}).replace(/,/g,"،"):re},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(re){return re<12?"ق.ظ":"ب.ظ"},jMonths:{"persian-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_")}[te],jMonthsShort:{"persian-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_")}[te]})},F.loadPashto=function(k){var E=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,te=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"pashto";c.locale("ps-af"),c.updateLocale("ps-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysShort:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[te],weekdaysMin:{pashto:"ی_د_س_چ_پ_آ_ش".split("_"),"pashto-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[te],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(re){return E?re.replace(/[۰-۹]/g,function(Ne){return G[Ne]}).replace(/،/g,","):re},postformat:function(re){return E?re.replace(/\d/g,function(Ne){return X[Ne]}).replace(/,/g,"،"):re},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(re){return re<12?"ق.ظ":"ب.ظ"},jMonths:{pashto:"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_"),"pashto-modern":"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_")}[te],jMonthsShort:{pashto:"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_"),"pashto-modern":"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_")}[te]})},F.jConvert={toJalaali:P,toGregorian:Te};function P(k,E,te){try{var re=b.toJalaali(k,E+1,te);return re.jm-=1,re}catch{return{jy:NaN,jm:NaN,jd:NaN}}}function Te(k,E,te){try{var re=b.toGregorian(k,E+1,te);return re.gm-=1,re}catch{return{gy:NaN,gm:NaN,gd:NaN}}}function ze(k,E){return~~(k/E)}function Be(k,E){return k-~~(k/E)*E}return eh}var Cp=Mp();const Pc=ih(Cp);function wn(c){return c?Pc(c,"YYYY-MM-DD").format("jYYYY/jMM/jDD"):""}const D0=c=>c?Pc(c,"jYYYY/jMM/jDD").format("YYYY-MM-DD"):"",Tp=({shipmentId:c,onNavigate:b,showSuccess:N,showError:f,isOwnerView:g=!1})=>{const[v,U]=y.useState(null),[S,T]=y.useState(!0),[_,V]=y.useState(null),[O,J]=y.useState(!1),[X,G]=y.useState(!1),[$,M]=y.useState(!1),[m,j]=y.useState(""),[Y,z]=y.useState(""),[ce,pe]=y.useState(""),[K,ne]=y.useState(""),[Ce,Se]=y.useState(""),[de,R]=y.useState(""),[me,ye]=y.useState(""),[fe,q]=y.useState(""),[ie,je]=y.useState(""),[Ae,_e]=y.useState(""),[w,H]=y.useState("fixed"),[F,xe]=y.useState("IRT"),[P,Te]=y.useState(""),[ze,Be]=y.useState(!1),[k,E]=y.useState(""),[te,re]=y.useState(""),[Ne,Me]=y.useState(""),[We,Je]=y.useState(""),[at,Bt]=y.useState([]),[Gt,Vt]=y.useState([]),[yt,ea]=y.useState({isOpen:!1,field:null}),[ke,se]=y.useState(null),[we,Ee]=y.useState(null),ht=ke?`${ke.lat.toFixed(5)}, ${ke.lng.toFixed(5)}`:"",he=we?`${we.lat.toFixed(5)}, ${we.lng.toFixed(5)}`:"",it=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}];y.useEffect(()=>{if(!c)return;let W=!0;return(async()=>{var ve,Tt,sr,fa,Qt,Ke,Ks,ut;try{T(!0),V(null);const Ta=await It(`https://eino.eifa.site/users-api/public/api/shipments/${c}`);if(!Ta.ok)throw new Error("خطا در دریافت اطلاعات مرسوله");const dt=(await Ta.json()).data;if(!W)return;U(dt);const Zt=dt.departure_date?wn(dt.departure_date):"",Oa=dt.arrival_date?wn(dt.arrival_date):"";if(j(dt.title??""),z(dt.description??""),pe(dt.weight??""),ne(dt.category??""),Se(((ve=dt.origin)==null?void 0:ve.country)??""),R(((Tt=dt.origin)==null?void 0:Tt.city)??""),ye(((sr=dt.origin)==null?void 0:sr.address)??""),q(((fa=dt.destination)==null?void 0:fa.country)??""),je(((Qt=dt.destination)==null?void 0:Qt.city)??""),_e(((Ke=dt.destination)==null?void 0:Ke.address)??""),H(dt.price_type??"fixed"),xe(dt.currency??"IRT"),Te(dt.amount??""),Be(!!dt.show_phone),E(dt.carry_weight_capacity??""),re(Zt),Me(Oa),Je(dt.trip_description??""),Bt(dt.images??[]),(Ks=dt.origin)!=null&&Ks.coordinates){const[At,Xe]=dt.origin.coordinates.split(",").map(Number);!Number.isNaN(At)&&!Number.isNaN(Xe)&&se({lat:At,lng:Xe})}if((ut=dt.destination)!=null&&ut.coordinates){const[At,Xe]=dt.destination.coordinates.split(",").map(Number);!Number.isNaN(At)&&!Number.isNaN(Xe)&&Ee({lat:At,lng:Xe})}}catch(Ta){console.error("خطا در دریافت جزئیات:",Ta),W&&V(Ta.message||"خطا در بارگذاری اطلاعات")}finally{W&&T(!1)}})(),()=>{W=!1}},[c]);const Ve=async()=>{if(!(!c||!window.confirm("آیا از حذف این مرسوله مطمئن هستید؟"))){J(!0);try{if(!(await It(`https://eino.eifa.site/users-api/public/api/shipments/${c}`,{method:"DELETE"})).ok)throw new Error("خطا در حذف مرسوله");N("مرسوله با موفقیت حذف شد"),b("my-shipment-requests")}catch(W){f(W.message||"خطا در حذف مرسوله")}finally{J(!1)}}},Et=W=>{const ft=W.target.files;if(ft){const ve=Array.from(ft).map(Tt=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Tt),file:Tt}));Vt(Tt=>[...Tt,...ve])}},Re=W=>{Vt(ft=>ft.filter(ve=>ve.id!==W))},ta=async W=>{if(window.confirm("آیا از حذف این تصویر مطمئن هستید؟"))try{if(!(await It(`https://eino.eifa.site/users-api/public/api/shipments/${c}/images/${W}`,{method:"DELETE"})).ok)throw new Error("خطا در حذف تصویر");Bt(ve=>ve.filter(Tt=>Tt.id!==W)),N("تصویر حذف شد")}catch(ft){f(ft.message||"خطا در حذف تصویر")}},Lt=y.useCallback(W=>{W.preventDefault(),W.stopPropagation();const ft=W.dataTransfer.files;if(ft&&ft.length>0){const ve=Array.from(ft).filter(Tt=>Tt.type.startsWith("image/")).map(Tt=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Tt),file:Tt}));Vt(Tt=>[...Tt,...ve])}},[]),Ft=W=>{W.preventDefault(),W.stopPropagation()},wt=W=>{ea({isOpen:!0,field:W})},ge=()=>{ea({isOpen:!1,field:null})},et=W=>{yt.field==="origin"?se(W):yt.field==="destination"&&Ee(W),ge()},Ye=async()=>{if(!(!c||!v)){M(!0);try{const W=new FormData;W.append("_method","PUT"),W.append("origin[country]",Ce),W.append("origin[city]",de),W.append("origin[address]",me),W.append("origin[coordinates]",ke?`${ke.lat},${ke.lng}`:""),W.append("destination[country]",fe),W.append("destination[city]",ie),W.append("destination[address]",Ae),W.append("destination[coordinates]",we?`${we.lat},${we.lng}`:""),W.append("price_type",w),W.append("show_phone",ze?"1":"0"),w==="fixed"&&(W.append("currency",F),W.append("amount",P)),v.type==="send"?(W.append("title",m),W.append("description",Y),W.append("weight",ce),W.append("category",K),Gt.forEach((ve,Tt)=>{ve.file&&W.append(`images[${Tt}]`,ve.file)})):(W.append("departure_date",te?D0(te):""),W.append("arrival_date",Ne?D0(Ne):""),W.append("carry_weight_capacity",k),W.append("trip_description",We));const ft=await It(`https://eino.eifa.site/users-api/public/api/shipments/${c}`,{method:"POST",body:W});if(!ft.ok){const ve=await ft.json(),Tt=ve.errors?Object.values(ve.errors)[0]:ve.message;throw new Error(Array.isArray(Tt)?Tt[0]:Tt)}N("تغییرات با موفقیت ذخیره شد"),G(!1),window.location.reload()}catch(W){f(W.message||"خطا در ذخیره تغییرات")}finally{M(!1)}}},Ze=()=>{if(G(!1),Vt([]),v){j(v.title||""),z(v.description||""),pe(v.weight||""),ne(v.category||""),Se(v.origin.country||""),R(v.origin.city||""),ye(v.origin.address||""),q(v.destination.country||""),je(v.destination.city||""),_e(v.destination.address||""),H(v.price_type||"fixed"),xe(v.currency||"IRT"),Te(v.amount||""),Be(v.show_phone||!1);const W=v.departure_date?wn(v.departure_date):"",ft=v.arrival_date?wn(v.arrival_date):"";re(W),Me(ft),E(v.carry_weight_capacity||""),Je(v.trip_description||"")}},zt=()=>{if(!v)return"—";if(v.price_type==="negotiable")return"توافقی";if(v.amount&&v.currency){const W={IRT:"تومان",USD:"دلار",CAD:"دلار کانادا",IQD:"دینار"};return`${parseFloat(v.amount).toLocaleString("fa-IR")} ${W[v.currency]||v.currency}`}return"—"},Ge=W=>({furniture:"مبلمان",electronics:"الکترونیکی",clothing:"پوشاک",food:"غذایی",documents:"اسناد",miscellaneous:"متفرقه",other:"سایر"})[W]||W;return S?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"}),a.jsx("p",{className:"mt-4 text-gray-500 dark:text-gray-400",children:"در حال بارگذاری..."})]}):_||!v?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h2",{className:"text-xl font-bold text-red-600 dark:text-red-400",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-2",children:_||"مرسوله یافت نشد"}),a.jsx("button",{onClick:()=>b(g?"my-shipment-requests":"accept-shipment"),className:"mt-4 text-custom-purple hover:underline",children:"بازگشت به لیست"})]}):a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:X?"ویرایش مرسوله":v.title}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:v.type==="send"?"📦 ارسال مرسوله":"✈️ سفر حمل مرسوله"})]}),a.jsxs("button",{onClick:()=>b(g?"my-shipment-requests":"accept-shipment"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors self-start sm:self-center",children:[a.jsx(uh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت"})]})]}),X?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[v.type==="send"&&a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصاویر فعلی"}),a.jsx("div",{className:"grid grid-cols-2 gap-4",children:at.map(W=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:W.url,alt:"تصویر",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>ta(W.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx($a,{className:"w-4 h-4"})})]},W.id))})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"افزودن تصاویر جدید"}),a.jsxs("label",{htmlFor:"file-upload-edit",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-xl cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:Lt,onDragOver:Ft,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Dn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-edit",type:"file",className:"hidden",multiple:!0,accept:"image/*",onChange:Et})]}),Gt.length>0&&a.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Gt.map(W=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:W.url,alt:"پیش‌نمایش",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Re(W.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx($a,{className:"w-4 h-4"})})]},W.id))})]})]}),a.jsx("div",{className:v.type==="send"?"lg:col-span-2":"lg:col-span-3",children:a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:v.type==="send"?"۱. اطلاعات مرسوله":"۱. اطلاعات سفر"}),a.jsx("div",{className:"space-y-6",children:v.type==="send"?a.jsxs(a.Fragment,{children:[a.jsx(Xs,{icon:eo,id:"title",placeholder:"عنوان مرسوله",label:"عنوان",value:m,onChange:W=>j(W.target.value)}),a.jsx(M0,{icon:us,id:"description",placeholder:"توضیحات مرسوله",label:"توضیحات",value:Y,onChange:W=>z(W.target.value)}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Xs,{icon:Va,id:"weight",placeholder:"وزن به کیلوگرم",label:"وزن",type:"number",value:ce,onChange:W=>pe(W.target.value),step:"0.1",min:"0.1"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"دسته‌بندی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(to,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("select",{value:K,onChange:W=>ne(W.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("option",{value:"",children:"انتخاب کنید"}),a.jsx("option",{value:"documents",children:"مدارک و اسناد"}),a.jsx("option",{value:"electronics",children:"لوازم الکترونیکی"}),a.jsx("option",{value:"clothing",children:"پوشاک"}),a.jsx("option",{value:"furniture",children:"اثاثیه منزل"}),a.jsx("option",{value:"miscellaneous",children:"متفرقه"})]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(C0,{id:"departure_date",label:"تاریخ حرکت",value:te,onChange:re}),a.jsx(C0,{id:"arrival_date",label:"تاریخ رسیدن",value:Ne,onChange:Me})]}),a.jsx(Xs,{icon:Va,id:"carry_weight",placeholder:"ظرفیت حمل به کیلوگرم",label:"ظرفیت حمل",type:"number",value:k,onChange:W=>E(W.target.value),step:"0.1",min:"0.1"}),a.jsx(M0,{icon:us,id:"trip_description",placeholder:"توضیحات سفر",label:"توضیحات",value:We,onChange:W=>Je(W.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. مبدأ و مقصد"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(T0,{onButtonClick:()=>wt("origin"),value:ht,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Xs,{icon:Fe,id:"origin_country",placeholder:"کشور",label:"کشور",value:Ce,onChange:W=>Se(W.target.value)}),a.jsx(Xs,{icon:Fe,id:"origin_city",placeholder:"شهر",label:"شهر",value:de,onChange:W=>R(W.target.value)})]}),a.jsx(Xs,{icon:Ts,id:"origin_address",placeholder:"آدرس",label:"آدرس",value:me,onChange:W=>ye(W.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(T0,{onButtonClick:()=>wt("destination"),value:he,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Xs,{icon:Fe,id:"destination_country",placeholder:"کشور",label:"کشور",value:fe,onChange:W=>q(W.target.value)}),a.jsx(Xs,{icon:Fe,id:"destination_city",placeholder:"شهر",label:"شهر",value:ie,onChange:W=>je(W.target.value)})]}),a.jsx(Xs,{icon:Ts,id:"destination_address",placeholder:"آدرس",label:"آدرس",value:Ae,onChange:W=>_e(W.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نوع قیمت"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>H("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${w==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>H("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${w==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]})]}),w==="fixed"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ya,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{value:F,onChange:W=>xe(W.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:it.map(({value:W,label:ft})=>a.jsx("option",{value:W,children:ft},W))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsx(Xs,{icon:ya,id:"amount",placeholder:"مبلغ",label:"مبلغ",type:"number",value:P,onChange:W=>Te(W.target.value),step:"1000",min:"0"})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(Op,{enabled:ze,setEnabled:Be})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:Ze,disabled:$,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:a.jsx("span",{children:"لغو"})}),a.jsxs("button",{type:"button",onClick:Ye,disabled:$,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[$?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx(G0,{className:"w-5 h-5"}),a.jsx("span",{children:$?"در حال ذخیره...":"ذخیره تغییرات"})]})]})]})})]}):a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[v.images&&v.images.length>0?a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("img",{src:v.images[0].url,alt:v.title,className:"w-full h-auto max-h-96 object-cover rounded-xl",onError:W=>{W.currentTarget.src="https://via.placeholder.com/800x600?text=بدون+تصویر"}}),v.images.length>1&&a.jsx("div",{className:"grid grid-cols-4 gap-2 pt-3",children:v.images.slice(1,5).map(W=>a.jsx("img",{src:W.url,alt:"تصویر مرسوله",className:"w-full h-20 object-cover rounded-lg cursor-pointer hover:opacity-80 transition-opacity",onError:ft=>{ft.currentTarget.style.display="none"}},W.id))})]}):a.jsx("p",{}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b pb-3 border-gray-200 dark:border-gray-700",children:"توضیحات"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line",children:v.description||"توضیحاتی ثبت نشده است."})]})]}),a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4 lg:sticky lg:top-28",children:[a.jsx("h3",{className:"text-lg font-semibold mb-2 pb-3 border-b border-gray-200 dark:border-gray-700",children:"اطلاعات کلی"}),v.category&&a.jsx(Zs,{icon:to,label:"دسته‌بندی",value:Ge(v.category)}),v.type==="send"&&v.weight&&a.jsx(Zs,{icon:Va,label:"وزن",value:`${parseFloat(v.weight).toLocaleString("fa-IR")} کیلوگرم`}),v.type==="carry"&&v.carry_weight_capacity&&a.jsx(Zs,{icon:Va,label:"ظرفیت حمل",value:`${parseFloat(v.carry_weight_capacity).toLocaleString("fa-IR")} کیلوگرم`}),a.jsx(Zs,{icon:Fe,label:"مبدأ",value:`${v.origin.city}, ${v.origin.country}`}),a.jsx(Zs,{icon:Fe,label:"مقصد",value:`${v.destination.city}, ${v.destination.country}`}),v.departure_date&&a.jsx(Zs,{icon:Ar,label:"تاریخ حرکت",value:wn(v.departure_date)}),v.arrival_date&&a.jsx(Zs,{icon:Ar,label:"تاریخ رسیدن",value:wn(v.arrival_date)}),a.jsx(Zs,{icon:ya,label:"هزینه",value:zt(),valueClassName:"text-green-600 dark:text-green-400 font-bold"}),!g&&v.user&&a.jsxs("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:[a.jsx(Zs,{icon:Ca,label:"ثبت‌کننده",value:v.user.name||"بدون نام"}),v.show_phone&&v.user.phone&&a.jsx(Zs,{icon:Js,label:"تماس",value:v.user.phone})]})]}),g&&a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-3",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>G(!0),className:"w-full flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(B0,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:Ve,disabled:O,className:"w-full flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors duration-300 disabled:opacity-50",children:[O?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(xh,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:O?"حذف...":"حذف"})]})]})]})})]})]}),a.jsx(zp,{isOpen:yt.isOpen,onClose:ge,onConfirm:et,field:yt.field})]})},Zs=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-5 h-5 ml-2"}),a.jsx("span",{className:"text-sm",children:b})]}),a.jsx("span",{className:`font-semibold text-sm ${f}`,children:N})]}),Xs=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v,type:U="text",step:S,min:T})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:b,type:U,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,step:S,min:T})]})]}),M0=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3 right-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:b,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition h-24 resize-none",value:g,onChange:v})]})]}),Op=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Ep=c=>[1,5,9,13,17,22,26,30].includes(c%33),Lp=(c,b)=>b<7?31:b<12?30:b===12?Ep(c)?30:29:0,Ap=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N]=c.split("/").map(Number);return{year:b,month:N}},Yp=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],C0=({id:c,label:b,value:N,onChange:f})=>{const v=Ap().year,U=Array.from({length:4},($,M)=>v+M),[S,T,_]=N?N.split("/").map(Number):[void 0,void 0,void 0],V=S&&T?Lp(S,T):31,O=$=>{const m=`${Number($.target.value)}/${T||""}/${_||""}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},J=$=>{const M=Number($.target.value),m=`${S||""}/${M}/${_||""}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},X=$=>{const M=Number($.target.value),m=`${S||""}/${T||""}/${M}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},G="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:_||"",onChange:X,className:G,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:V},($,M)=>M+1).map($=>a.jsx("option",{value:$,children:$},$))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:J,className:G,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),Yp.map(($,M)=>a.jsx("option",{value:M+1,children:$},M))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:S||"",onChange:O,className:G,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),U.map($=>a.jsx("option",{value:$,children:$},$))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},T0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),zp=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),U=y.useRef(null),[S,T]=y.useState(null),[_,V]=y.useState(""),[O,J]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),V("")};if(U.current&&!g.current){const j=L.map(U.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",Y=>{const{lat:z,lng:ce}=Y.latlng;T({lat:z,lng:ce}),v.current?v.current.setLatLng(Y.latlng):v.current=L.marker(Y.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){J(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:Y,lon:z}=j[0],ce=parseFloat(Y),pe=parseFloat(z),K={lat:ce,lng:pe};T(K),g.current&&(g.current.setView(K,15),v.current?v.current.setLatLng(K):v.current=L.marker(K).addTo(g.current))}else console.log("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),console.log("خطایی در جستجوی مکان رخ داد.")}finally{J(!1)}}},G=async()=>{if(!navigator.geolocation){console.log("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){console.log("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:Y}=m.coords,z={lat:j,lng:Y};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}console.log(j)})},$=()=>{S?N(S):console.log("لطفاً یک موقعیت روی نقشه انتخاب کنید.")};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx($a,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ha,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>V(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:G,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:U,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-xl cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:$,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},Rp=c=>[1,5,9,13,17,22,26,30].includes(c%33),Up=(c,b)=>b<7?31:b<12?30:b===12?Rp(c)?30:29:0,Hp=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],kn=c=>c?c.replace(/-/g,"/"):"",Ii=c=>c?c.replace(/\//g,"-"):"",qp=c=>c?new Date(c).toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—",O0=({id:c,label:b,value:N,onChange:f})=>{const g=Pc().locale("fa").format("jYYYY/jMM/jDD"),v=parseInt(g.split("/")[0]),U=Array.from({length:4},(m,j)=>v+j),[S,T,_]=N?N.split("/"):["","",""],V=S?parseInt(S):void 0,O=T?parseInt(T):void 0,J=V&&O?Up(V,O):31,X=m=>{const j=`${m.target.value}/${T||""}/${_||""}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},G=m=>{const j=`${S||""}/${m.target.value}/${_||""}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},$=m=>{const j=`${S||""}/${T||""}/${m.target.value}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},M="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:_||"",onChange:$,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:J},(m,j)=>j+1).map(m=>a.jsx("option",{value:m,children:m},m))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:G,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),Hp.map((m,j)=>a.jsx("option",{value:j+1,children:m},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:S||"",onChange:X,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),U.map(m=>a.jsx("option",{value:m,children:m},m))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(pt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Lr=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v,type:U="text"})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[c&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:b,type:U,placeholder:N,className:`w-full ${c?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,value:g,onChange:v})]})]}),Bp=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3 right-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:b,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",value:g,onChange:v})]})]}),Gp=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",onClick:()=>b(!c),className:`${c?"bg-custom-purple":"bg-gray-300 dark:bg-gray-600"} relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,children:a.jsx("span",{className:`${c?"translate-x-6":"translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform`})}),E0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),nh=[{id:"private_car",name:"ماشین شخصی",icon:ao},{id:"bus",name:"اتوبوس",icon:fh},{id:"train",name:"قطار",icon:mh},{id:"airplane",name:"هواپیما",icon:ba}],L0=c=>{const b=nh.find(N=>N.id===c);return b?b.name:c},Vp=({tripId:c,onNavigate:b,isOwnerView:N=!1,type:f="trip"})=>{var ea;const[g,v]=y.useState(null),[U,S]=y.useState(!0),[T,_]=y.useState(null),[V,O]=y.useState(!1),[J,X]=y.useState(!1),[G,$]=y.useState(!1),[M,m]=y.useState(""),[j,Y]=y.useState(""),[z,ce]=y.useState(""),[pe,K]=y.useState(""),[ne,Ce]=y.useState(""),[Se,de]=y.useState(""),[R,me]=y.useState(""),[ye,fe]=y.useState(""),[q,ie]=y.useState(""),[je,Ae]=y.useState([]),[_e,w]=y.useState(""),[H,F]=y.useState(""),[xe,P]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(!1),[E,te]=y.useState({isOpen:!1,field:null}),[re,Ne]=y.useState(null),[Me,We]=y.useState(null);y.useEffect(()=>{if(!c)return;(async()=>{try{S(!0),_(null);const se=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,we=await It(`https://eino.eifa.site/users-api/public/api/${se}`);if(!we.ok)throw new Error("خطا در دریافت اطلاعات");const Ee=await we.json();v(Ee.data)}catch(se){_(se.message||"خطا در بارگذاری اطلاعات")}finally{S(!1)}})()},[c,f]),y.useEffect(()=>{V&&g&&(m(g.origin_country||""),Y(g.origin_city||""),ce(g.origin_address||""),K(g.origin_coordinates||""),Ne(g.origin_coordinates?{lat:parseFloat(g.origin_coordinates.split(",")[0]),lng:parseFloat(g.origin_coordinates.split(",")[1])}:null),Ce(g.destination_country||""),de(g.destination_city||""),me(g.destination_address||""),fe(g.destination_coordinates||""),We(g.destination_coordinates?{lat:parseFloat(g.destination_coordinates.split(",")[0]),lng:parseFloat(g.destination_coordinates.split(",")[1])}:null),ie(g.vehicle_type||""),Ae(g.vehicle_types||[]),w(g.departure_date?kn(g.departure_date):""),F(g.arrival_date?kn(g.arrival_date):""),P(g.capacity?String(g.capacity):""),ze(g.description||""),k(g.show_phone||!1))},[V,g]);const Je=async()=>{if(!(!c||!window.confirm("آیا از حذف این مورد مطمئن هستید؟"))){$(!0);try{const ke=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,se=await It(`https://eino.eifa.site/users-api/public/api/${ke}`,{method:"DELETE"});if(!se.ok){const we=await se.json();throw new Error(we.message||"خطا در حذف")}b(f==="trip"?"my-trips":"my-companions")}catch(ke){alert(ke.message||"خطا در حذف")}finally{$(!1)}}},at=ke=>te({isOpen:!0,field:ke}),Bt=()=>te({isOpen:!1,field:null}),Gt=ke=>{E.field==="origin"?(Ne(ke),K(`${ke.lat},${ke.lng}`)):E.field==="destination"&&(We(ke),fe(`${ke.lat},${ke.lng}`)),Bt()},Vt=ke=>{Ae(se=>se.includes(ke)?se.filter(we=>we!==ke):[...se,ke])},yt=async ke=>{ke.preventDefault(),X(!0);try{const se=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,we=new FormData;if(we.append("_method","PUT"),we.append("origin[country]",M),we.append("origin[city]",j),we.append("origin[address]",z),we.append("origin[coordinates]",pe),we.append("destination[country]",ne),we.append("destination[city]",Se),we.append("destination[address]",R),we.append("destination[coordinates]",ye),we.append("capacity",xe),we.append("description",Te),we.append("show_phone",Be?"1":"0"),f==="trip")we.append("vehicle_type",q),we.append("departure_date",_e?Ii(_e):""),we.append("arrival_date",H?Ii(H):"");else{if(je.forEach(he=>{we.append("vehicle_types[]",he)}),_e)we.append("available_from",Ii(_e));else{const he=Pc().locale("fa").format("jYYYY/jMM/jDD");we.append("available_from",Ii(he))}we.append("available_to",H?Ii(H):"")}const Ee=await It(`https://eino.eifa.site/users-api/public/api/${se}`,{method:"POST",body:we});if(!Ee.ok){const he=await Ee.json();throw new Error(he.message||"خطا در به‌روزرسانی")}const ht=await Ee.json();v(ht.data),O(!1)}catch(se){alert(se.message||"خطا در به‌روزرسانی")}finally{X(!1)}};return U?a.jsx("div",{className:"text-center py-12",children:"در حال بارگذاری..."}):T?a.jsxs("div",{className:"text-center py-12 text-red-500",children:["خطا: ",T]}):g?V?a.jsxs("form",{onSubmit:yt,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:["ویرایش ",f==="trip"?"سفر":"همسفری"]}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات مبدأ و مقصد"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(E0,{onButtonClick:()=>at("origin"),value:re?`${re.lat.toFixed(5)}, ${re.lng.toFixed(5)}`:"",id:"edit_origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx(Lr,{icon:pa,id:"edit_origin_country",placeholder:"مثال: ایران",label:"کشور",value:M,onChange:ke=>m(ke.target.value)}),a.jsx(Lr,{icon:Fe,id:"edit_origin_city",placeholder:"مثال: تهران",label:"شهر",value:j,onChange:ke=>Y(ke.target.value)}),a.jsx(Lr,{icon:Ts,id:"edit_origin_address",placeholder:"آدرس کامل",label:"آدرس دستی",value:z,onChange:ke=>ce(ke.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(E0,{onButtonClick:()=>at("destination"),value:Me?`${Me.lat.toFixed(5)}, ${Me.lng.toFixed(5)}`:"",id:"edit_destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx(Lr,{icon:pa,id:"edit_destination_country",placeholder:"مثال: کانادا",label:"کشور",value:ne,onChange:ke=>Ce(ke.target.value)}),a.jsx(Lr,{icon:Fe,id:"edit_destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:Se,onChange:ke=>de(ke.target.value)}),a.jsx(Lr,{icon:Ts,id:"edit_destination_address",placeholder:"آدرس کامل",label:"آدرس دستی",value:R,onChange:ke=>me(ke.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:["جزئیات ",f==="trip"?"سفر":"همسفری"]}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(O0,{id:"edit_departure_date",label:f==="trip"?"تاریخ حرکت":"در دسترس از تاریخ",value:_e,onChange:w}),a.jsx(O0,{id:"edit_arrival_date",label:f==="trip"?"تاریخ رسیدن":"در دسترس تا تاریخ",value:H,onChange:F})]}),f==="trip"?a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسیله نقلیه"}),a.jsx("select",{value:q,onChange:ke=>ie(ke.target.value),className:"w-full appearance-none pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:nh.map(ke=>a.jsx("option",{value:ke.id,children:ke.name},ke.id))})]}):a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسایل نقلیه مورد نظر"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:nh.map(ke=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${je.includes(ke.id)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:je.includes(ke.id),onChange:()=>Vt(ke.id),className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${je.includes(ke.id)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:je.includes(ke.id)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx(ke.icon,{className:`w-6 h-6 ml-2 transition-colors ${je.includes(ke.id)?"text-custom-purple":"text-gray-500 dark:text-gray-400"}`}),a.jsx("span",{className:`font-semibold transition-colors ${je.includes(ke.id)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:ke.name})]},ke.id))})]}),a.jsx(Lr,{icon:Va,id:"edit_capacity",label:"ظرفیت حمل",placeholder:"به کیلوگرم",type:"number",value:xe,onChange:ke=>P(ke.target.value),className:"mt-6"}),a.jsx(Bp,{icon:us,id:"edit_description",label:"توضیحات",placeholder:f==="trip"?"توضیحات سفر...":"توضیحات همسفری...",value:Te,onChange:ke=>ze(ke.target.value),className:"mt-6"})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات تماس"}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"آیا شماره شما نمایش داده شود؟"})]})]}),a.jsx(Gp,{enabled:Be,setEnabled:k})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:J,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:J,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[J&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]}),a.jsx(A0,{isOpen:E.isOpen,onClose:Bt,onConfirm:Gt,field:E.field})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:f==="trip"?`سفر از ${g.origin_city} به ${g.destination_city}`:`همسفری از ${g.origin_city} به ${g.destination_city}`}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:f==="trip"?"جزئیات کامل سفر":"جزئیات کامل اعلام آمادگی"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx("button",{onClick:()=>b(f==="trip"?"my-trips":"my-companions"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:"بازگشت"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:f==="trip"?"جزئیات سفر":"جزئیات اعلام آمادگی همسفری"}),a.jsxs("div",{className:"space-y-4",children:[(g.departure_date||g.available_from)&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Ar,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:f==="trip"?"تاریخ حرکت:":"در دسترس از تاریخ:"}),a.jsx("p",{className:"font-medium",children:kn(f==="trip"?g.departure_date:g.available_from)})]})]}),(g.arrival_date||g.available_to)&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Ar,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:f==="trip"?"تاریخ رسیدن:":"در دسترس تا تاریخ:"}),a.jsx("p",{className:"font-medium",children:kn(f==="trip"?g.arrival_date:g.available_to)})]})]}),g.capacity&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Va,{className:"w-5 h-5 text-gray-500"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"ظرفیت حمل:"}),a.jsxs("p",{className:"font-medium",children:[g.capacity," کیلوگرم"]})]})]}),f==="trip"&&g.vehicle_type&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ao,{className:"w-5 h-5 text-gray-500"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"وسیله نقلیه:"}),a.jsx("p",{className:"font-medium",children:L0(g.vehicle_type)})]})]}),f==="companion"&&g.vehicle_types&&g.vehicle_types.length>0&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ao,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"وسایل نقلیه مورد نظر:"}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:g.vehicle_types.map(ke=>a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:L0(ke)},ke))})]})]}),g.description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(us,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:g.description})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"آدرس‌های کامل"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Fe,{className:"w-4 h-4"})," مبدأ"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsxs("span",{className:"font-semibold",children:[g.origin_city,", ",g.origin_country]})}),g.origin_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:g.origin_address}),g.origin_coordinates&&a.jsx("a",{href:`https://www.google.com/maps?q=${g.origin_coordinates}`,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline text-sm mt-1 inline-block",children:"نمایش روی نقشه"})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-red-600 dark:text-red-400 mb-2 flex items-center gap-2",children:[a.jsx(Fe,{className:"w-4 h-4"})," مقصد"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsxs("span",{className:"font-semibold",children:[g.destination_city,", ",g.destination_country]})}),g.destination_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:g.destination_address}),g.destination_coordinates&&a.jsx("a",{href:`https://www.google.com/maps?q=${g.destination_coordinates}`,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline text-sm mt-1 inline-block",children:"نمایش روی نقشه"})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:"وضعیت و اطلاعات"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"وضعیت"}),a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-bold ${g.status==="active"?"bg-green-500/10 text-green-500":g.status==="pending"?"bg-custom-orange/10 text-custom-orange":"bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400"}`,children:g.status==="active"?"فعال":g.status==="pending"?"در انتظار تایید":"انجام شده"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"تاریخ ثبت"}),a.jsx("span",{className:"font-medium",children:qp(g.created_at)})]}),g.show_phone&&((ea=g.user)==null?void 0:ea.phone)&&a.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center gap-2 text-gray-700 dark:text-gray-300",children:[a.jsx(Js,{className:"w-5 h-5 text-gray-500"}),a.jsx("span",{className:"font-medium",children:g.user.phone})]})})]})]})]}),N&&a.jsx("div",{className:"lg:col-span-1 space-y-6",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold pb-3 border-b border-gray-200 dark:border-gray-700",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[a.jsxs("button",{onClick:()=>O(!0),className:"flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors",children:[a.jsx(B0,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:Je,disabled:G,className:"flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[G?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(xh,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:G?"حذف...":"حذف"})]})]})]})})]}),a.jsx(A0,{isOpen:E.isOpen,onClose:Bt,onConfirm:Gt,field:E.field})]}):a.jsx("div",{className:"text-center py-12",children:"اطلاعاتی یافت نشد."})},A0=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),U=y.useRef(null),[S,T]=y.useState(null),[_,V]=y.useState(""),[O,J]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),V("")};if(U.current&&!g.current){const j=L.map(U.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",Y=>{const{lat:z,lng:ce}=Y.latlng;T({lat:z,lng:ce}),v.current?v.current.setLatLng(Y.latlng):v.current=L.marker(Y.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){J(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("جستجو ناموفق بود");const j=await m.json();if(j&&j.length>0){const{lat:Y,lon:z}=j[0],ce={lat:parseFloat(Y),lng:parseFloat(z)};T(ce),g.current&&(g.current.setView(ce,15),v.current?v.current.setLatLng(ce):v.current=L.marker(ce).addTo(g.current))}}catch(m){console.error("Geocoding error:",m)}finally{J(!1)}}},G=async()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(m=>{const{lat:j,lng:Y}=m.coords,z={lat:j,lng:Y};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))},m=>console.error("Geolocation error:",m.message))},$=()=>{S&&N(S)};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx($a,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ha,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>V(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:G,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:U,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-xl cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:$,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:"@keyframes fade-in-scale { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } } .animate-fade-in-scale { animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; } .leaflet-container { font-family: 'Vazirmatn', sans-serif; }"})]})};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $p=c=>c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qp=c=>c.replace(/^([A-Z])|[\s-_]+(\w)/g,(b,N,f)=>f?f.toUpperCase():N.toLowerCase()),Y0=c=>{const b=Qp(c);return b.charAt(0).toUpperCase()+b.slice(1)},$0=(...c)=>c.filter((b,N,f)=>!!b&&b.trim()!==""&&f.indexOf(b)===N).join(" ").trim(),Zp=c=>{for(const b in c)if(b.startsWith("aria-")||b==="role"||b==="title")return!0};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Xp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fp=y.forwardRef(({color:c="currentColor",size:b=24,strokeWidth:N=2,absoluteStrokeWidth:f,className:g="",children:v,iconNode:U,...S},T)=>y.createElement("svg",{ref:T,...Xp,width:b,height:b,stroke:c,strokeWidth:f?Number(N)*24/Number(b):N,className:$0("lucide",g),...!v&&!Zp(S)&&{"aria-hidden":"true"},...S},[...U.map(([_,V])=>y.createElement(_,V)),...Array.isArray(v)?v:[v]]));/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pt=(c,b)=>{const N=y.forwardRef(({className:f,...g},v)=>y.createElement(Fp,{ref:v,iconNode:b,className:$0(`lucide-${$p(Y0(c))}`,`lucide-${c}`,f),...g}));return N.displayName=Y0(c),N};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wp=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Jp=Pt("arrow-left",Wp);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kp=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ip=Pt("chevron-down",Kp);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pp=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],z0=Pt("cloud-upload",Pp);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ey=[["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"}]],_n=Pt("dollar-sign",ey);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ty=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Xc=Pt("globe",ty);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ay=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],sy=Pt("house",ay);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ly=[["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"}]],ry=Pt("image",ly);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ny=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],iy=Pt("info",ny);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oy=[["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"}]],th=Pt("link",oy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cy=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Fc=Pt("list",cy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dy=[["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"}]],Pi=Pt("map-pin",dy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uy=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],hy=Pt("package",uy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fy=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],my=Pt("pencil",fy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gy=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],ah=Pt("phone",gy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xy=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],py=Pt("shopping-bag",xy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yy=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],by=Pt("trash-2",yy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vy=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],jy=Pt("truck",vy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ny=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],sh=Pt("type",Ny);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wy=[["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"}]],ky=Pt("user",wy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _y=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lh=Pt("x",_y),Cs=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:U,min:S,step:T,required:_=!1})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v??"",onChange:U,min:S,step:T,required:_})]})]}),rh=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),Sy=({id:c,icon:b,label:N,children:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,children:f}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(Ip,{className:"w-5 h-5 text-gray-400"})})]})]}),R0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
          relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
          transition-colors duration-200 ease-in-out 
          focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
            pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
            shadow-lg ring-0 transition duration-200 ease-in-out`})}),Wc=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}],U0=[{value:"electronics",label:"الکترونیک"},{value:"fashion",label:"مد و پوشاک"},{value:"books",label:"کتاب و رسانه"},{value:"home",label:"خانه و آشپزخانه"},{value:"beauty",label:"آرایشی و بهداشتی"},{value:"other",label:"سایر"}],Sn=c=>{if(Array.isArray(c))return c;if(typeof c=="string"&&c.trim()!=="")try{return JSON.parse(c)}catch(b){return console.error("Failed to parse JSON field:",c,b),[]}return[]},H0=({purchaseId:c,type:b,onNavigate:N,isOwnerView:f=!1})=>{var ta,Lt,Ft,wt;const[g,v]=y.useState(!0),[U,S]=y.useState(null),[T,_]=y.useState(null),[V,O]=y.useState(!1),[J,X]=y.useState(!1),[G,$]=y.useState(!1),[M,m]=y.useState(""),[j,Y]=y.useState(""),[z,ce]=y.useState(""),[pe,K]=y.useState(null),[ne,Ce]=y.useState(null),[Se,de]=y.useState(""),[R,me]=y.useState(""),[ye,fe]=y.useState(""),[q,ie]=y.useState(""),[je,Ae]=y.useState(""),[_e,w]=y.useState("IRT"),[H,F]=y.useState(!1),[xe,P]=y.useState([]),[Te,ze]=y.useState([]),[Be,k]=y.useState([]),[E,te]=y.useState(""),[re,Ne]=y.useState([]),[Me,We]=y.useState([]),[Je,at]=y.useState(""),[Bt,Gt]=y.useState(""),[Vt,yt]=y.useState(""),[ea,ke]=y.useState(""),[se,we]=y.useState([]),[Ee,ht]=y.useState([]);y.useEffect(()=>{if(!c){S("شناسه نامعتبر است"),v(!1);return}(async()=>{try{v(!0);const et=localStorage.getItem("auth_token"),Ye=b==="request"?`https://eino.eifa.site/users-api/public/api/online-purchase/request/${c}`:`https://eino.eifa.site/users-api/public/api/online-purchase/shopper/${c}`,Ze=await fetch(Ye,{headers:{"X-Auth-Token":et}});if(!Ze.ok)throw new Error("خطا در دریافت اطلاعات");const zt=await Ze.json();if(!zt.success||!zt.data)throw new Error("داده‌ای یافت نشد");const Ge=zt.data;_(Ge),b==="request"?(m(Ge.title||""),Y(Ge.link||""),ce(Ge.description||""),K(Ge.delivery_lat?parseFloat(Ge.delivery_lat):null),Ce(Ge.delivery_lng?parseFloat(Ge.delivery_lng):null),de(Ge.delivery_country||""),me(Ge.delivery_city||""),fe(Ge.delivery_address||""),ie(Ge.item_price?parseFloat(Ge.item_price):""),Ae(Ge.proposed_fee?parseFloat(Ge.proposed_fee):""),w(Ge.currency||"IRT"),F(Ge.show_phone||!1),P(Ge.images||[])):(te(Ge.service_title||""),Ne(Sn(Ge.categories)),We(Sn(Ge.supported_sites)),at(Ge.country||""),Gt(Ge.city||""),yt(Ge.fee_description||""),ke(Ge.capabilities||""),we(Ge.images||[]),F(Ge.show_phone||!1))}catch(et){S(et.message||"خطای ناشناخته")}finally{v(!1)}})()},[c,b]);const he=async()=>{if(confirm("آیا از حذف اطمینان دارید؟")){$(!0);try{const ge=localStorage.getItem("auth_token"),et=b==="request"?`https://eino.eifa.site/users-api/public/api/online-purchase/request/${c}`:`https://eino.eifa.site/users-api/public/api/online-purchase/shopper/${c}`,Ze=await(await fetch(et,{method:"DELETE",headers:{"X-Auth-Token":ge}})).json();if(Ze.success)alert("با موفقیت حذف شد"),N("online-purchase");else throw new Error(Ze.message||"خطا در حذف")}catch(ge){alert(ge.message||"خطا در اتصال")}finally{$(!1)}}},it=(ge,et)=>{if(ge){const Ye=Array.from(ge).map(Ze=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Ze),file:Ze}));et==="request"?k(Ze=>[...Ze,...Ye]):we(Ze=>[...Ze,...Ye])}},Ve=(ge,et)=>{if(et==="request"){const Ye=xe.find(Ze=>Ze.id===ge);Ye&&URL.revokeObjectURL(Ye.url),P(Ze=>Ze.filter(zt=>zt.id!==ge)),ze(Ze=>[...Ze,ge])}else{const Ye=se.findIndex(Ze=>Ze.id===ge);if(Ye>-1){const Ze=se[Ye];Ze.url.startsWith("blob:")&&URL.revokeObjectURL(Ze.url);const zt=[...se];zt.splice(Ye,1),we(zt),ht(Ge=>[...Ge,ge])}}},Et=async ge=>{ge.preventDefault(),X(!0);try{const et=localStorage.getItem("auth_token"),Ye=new FormData;b==="request"?(Ye.append("title",M),j&&Ye.append("link",j),z&&Ye.append("description",z),pe&&Ye.append("delivery_lat",String(pe)),ne&&Ye.append("delivery_lng",String(ne)),Ye.append("delivery_country",Se),Ye.append("delivery_city",R),Ye.append("delivery_address",ye),Ye.append("item_price",String(q)),Ye.append("proposed_fee",String(je)),Ye.append("currency",_e),Ye.append("show_phone",H?"1":"0"),Te.forEach(W=>Ye.append("deleted_images[]",String(W))),Be.forEach(W=>Ye.append("images[]",W.file))):(Ye.append("service_title",E),Ye.append("country",Je),Ye.append("city",Bt),Vt&&Ye.append("fee_description",Vt),ea&&Ye.append("capabilities",ea),Ye.append("show_phone",H?"1":"0"),re.forEach(W=>Ye.append("categories[]",W)),Me.forEach(W=>Ye.append("supported_sites[]",W)),Ee.forEach(W=>Ye.append("deleted_images[]",String(W))),se.filter(W=>W.file).forEach(W=>Ye.append("images[]",W.file))),Ye.append("_method","PUT");const Ze=b==="request"?`https://eino.eifa.site/users-api/public/api/online-purchase/request/${c}`:`https://eino.eifa.site/users-api/public/api/online-purchase/shopper/${c}`,Ge=await(await fetch(Ze,{method:"POST",headers:{"X-Auth-Token":et},body:Ye})).json();if(Ge.success){alert("تغییرات با موفقیت ذخیره شد"),O(!1);const W=Ge.data;_(W),b==="request"?(m(W.title||""),Y(W.link||""),ce(W.description||""),K(W.delivery_lat?parseFloat(W.delivery_lat):null),Ce(W.delivery_lng?parseFloat(W.delivery_lng):null),de(W.delivery_country||""),me(W.delivery_city||""),fe(W.delivery_address||""),ie(W.item_price?parseFloat(W.item_price):""),Ae(W.proposed_fee?parseFloat(W.proposed_fee):""),w(W.currency||"IRT"),F(W.show_phone||!1),P(W.images||[]),k([]),ze([])):(te(W.service_title||""),Ne(Sn(W.categories)),We(Sn(W.supported_sites)),at(W.country||""),Gt(W.city||""),yt(W.fee_description||""),ke(W.capabilities||""),we(W.images||[]),F(W.show_phone||!1),ht([]))}else throw new Error(Ge.message||"خطا در ذخیره")}catch(et){alert(et.message||"خطا در ارسال")}finally{X(!1)}};if(g)return a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx("div",{className:"w-12 h-12 border-4 border-custom-purple border-t-transparent rounded-full animate-spin"})});if(U||!T)return a.jsxs("div",{className:"text-center py-12",children:[a.jsx("p",{className:"text-red-500 mb-4",children:U||"اطلاعات یافت نشد"}),a.jsxs("button",{onClick:()=>N("online-purchase"),className:"flex items-center gap-2 text-custom-purple hover:underline",children:[a.jsx(Jp,{className:"w-4 h-4"})," بازگشت"]})]});const Re=T;return V&&b==="request"?a.jsxs("form",{onSubmit:Et,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ویرایش درخواست خرید"}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصاویر کالا"}),a.jsxs("label",{htmlFor:"file-upload-request",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(z0,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-request",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:ge=>it(ge.target.files,"request")})]})]}),(xe.length>0||Be.length>0)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:["پیش‌نمایش (",xe.length+Be.length," تصویر)"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[xe.map(ge=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:`${ge.url}`,alt:"تصویر",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Ve(ge.id,"request"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(lh,{className:"w-4 h-4"})})]},ge.id)),Be.map((ge,et)=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:ge.url,alt:"جدید",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>k(Ye=>Ye.filter((Ze,zt)=>zt!==et)),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(lh,{className:"w-4 h-4"})})]},`new-${et}`))]})]})]}),a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات کالا"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Cs,{icon:sh,id:"title",placeholder:"مثال: گوشی موبایل سامسونگ",label:"عنوان کالا *",value:M,onChange:ge=>m(ge.target.value),required:!0}),a.jsx(Cs,{icon:th,id:"link",placeholder:"https://example.com/product",label:"لینک خرید (اختیاری)",value:j,onChange:ge=>Y(ge.target.value)}),a.jsx(rh,{icon:Fc,id:"description",placeholder:"جزئیات بیشتر در مورد کالا...",label:"توضیحات (اختیاری)",value:z,onChange:ge=>ce(ge.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. محل تحویل کالا"}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد تحویل"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Cs,{icon:Xc,id:"delivery_country",placeholder:"مثال: ایران",label:"کشور (اختیاری)",value:Se,onChange:ge=>de(ge.target.value)}),a.jsx(Cs,{icon:Pi,id:"delivery_city",placeholder:"مثال: تهران",label:"شهر (اختیاری)",value:R,onChange:ge=>me(ge.target.value)})]}),a.jsx(Cs,{icon:sy,id:"delivery_address",placeholder:"آدرس کامل محل تحویل",label:"آدرس دستی (اختیاری)",value:ye,onChange:ge=>fe(ge.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Cs,{icon:_n,id:"item_price",placeholder:"مثال: 5000000",label:"قیمت کالا *",type:"number",min:"0",step:"1000",value:q,onChange:ge=>ie(ge.target.value),required:!0}),a.jsx(Cs,{icon:_n,id:"proposed_fee",placeholder:"مثال: 200000",label:"هزینه پیشنهادی *",type:"number",min:"0",step:"1000",value:je,onChange:ge=>Ae(ge.target.value),required:!0})]}),a.jsx(Sy,{id:"currency",icon:_n,label:"واحد پولی *",value:_e,onChange:ge=>w(ge.target.value),children:Wc.map(({value:ge,label:et})=>a.jsx("option",{value:ge,children:et},ge))}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(ah,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(R0,{enabled:H,setEnabled:F})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:J,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:J,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-xl transition-colors shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[J&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]})]})]})]}):V&&b==="shopper"?a.jsxs("form",{onSubmit:Et,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ویرایش پروفایل خریدار"}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصویر (اختیاری)"}),a.jsxs("label",{htmlFor:"file-upload-shopper",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(z0,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"آپلود عکس"})," (اختیاری)"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-shopper",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:ge=>it(ge.target.files,"shopper")})]})]}),se.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:["پیش‌نمایش (",se.length," تصویر)"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:se.map((ge,et)=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:ge.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Ve(ge.id||`temp-${et}`,"shopper"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(lh,{className:"w-4 h-4"})})]},typeof ge.id=="number"?ge.id:`temp-${et}`))})]})]}),a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. عنوان خدمات شما"}),a.jsx(Cs,{icon:sh,id:"service_title",label:"عنوان خدمات (اختیاری)",placeholder:"مثال: خرید از آمازون، خرید لپ‌تاپ و موبایل",value:E,onChange:ge=>te(ge.target.value)})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. دسته‌بندی کالاهای قابل خرید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"دسته‌بندی‌هایی که می‌توانید از آن‌ها خرید کنید را انتخاب نمایید:"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:U0.map(ge=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${re.includes(ge.value)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:re.includes(ge.value),onChange:et=>{et.target.checked?Ne(Ye=>[...Ye,ge.value]):Ne(Ye=>Ye.filter(Ze=>Ze!==ge.value))},className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${re.includes(ge.value)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:re.includes(ge.value)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx("span",{className:`font-semibold transition-colors ${re.includes(ge.value)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:ge.label})]},ge.value))})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. سایت‌هایی که می‌توانید از آن‌ها خرید کنید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx(Cs,{icon:th,id:"supported_sites",label:"سایت‌ها (با کاما جدا کنید)",placeholder:"مثال: amazon.com, aliexpress.com, ebay.com",value:Me.join(", "),onChange:ge=>{const Ye=ge.target.value.split(",").map(Ze=>Ze.trim()).filter(Ze=>Ze.length>0);We(Ye)}}),a.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"نام دامنه سایت‌ها را با کاما جدا کنید. (اختیاری)"})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۴. محل فعالیت شما"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Cs,{icon:Xc,id:"shopper_country",placeholder:"مثال: آمریکا",label:"کشور *",value:Je,onChange:ge=>at(ge.target.value),required:!0}),a.jsx(Cs,{icon:Pi,id:"shopper_city",placeholder:"مثال: نیویورک",label:"شهر *",value:Bt,onChange:ge=>Gt(ge.target.value),required:!0})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۵. جزئیات خدمات"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(rh,{icon:_n,id:"fee_description",label:"توضیحات کارمزد (اختیاری)",placeholder:"نحوه محاسبه کارمزد خود را توضیح دهید...",value:Vt,onChange:ge=>yt(ge.target.value)}),a.jsx(rh,{icon:Fc,id:"capabilities",label:"توضیحات بیشتر (اختیاری)",placeholder:"اطلاعات بیشتر در مورد خدماتی که ارائه می‌دهید...",value:ea,onChange:ge=>ke(ge.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۶. اطلاعات تماس"}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(ah,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(R0,{enabled:H,setEnabled:F})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:J,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:J,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-xl transition-colors shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[J&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]})]})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:b==="request"?Re.title:Re.service_title||"پروفایل خریدار"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:b==="request"?"جزئیات درخواست خرید آنلاین":"جزئیات پروفایل خریدار"})]})})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[Re.images&&Re.images.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(ry,{className:"w-5 h-5 text-custom-purple"})," تصاویر"]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Re.images.map(ge=>a.jsx("img",{src:ge.url.startsWith("http")?ge.url:`https://eino.eifa.site/users-api/public${ge.url}`,alt:"تصویر",className:"w-full h-32 object-cover rounded-xl"},ge.id))})]}),b==="request"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(hy,{className:"w-5 h-5 text-custom-purple"})," اطلاعات کالا"]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(sh,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"عنوان:"}),a.jsx("p",{className:"font-medium",children:Re.title})]})]}),Re.link&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(th,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"لینک:"}),a.jsx("a",{href:Re.link,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline block",children:Re.link})]})]}),Re.description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(Fc,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.description})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(_n,{className:"w-5 h-5 text-custom-purple"})," قیمت‌گذاری"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"قیمت کالا:"}),a.jsxs("p",{className:"font-bold text-custom-purple",children:[parseFloat(Re.item_price).toLocaleString()," ",((ta=Wc.find(ge=>ge.value===Re.currency))==null?void 0:ta.label)||Re.currency]})]}),a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"هزینه پیشنهادی:"}),a.jsxs("p",{className:"font-bold text-custom-cyan",children:[parseFloat(Re.proposed_fee).toLocaleString()," ",((Lt=Wc.find(ge=>ge.value===Re.currency))==null?void 0:Lt.label)||Re.currency]})]}),a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"جمع کل:"}),a.jsxs("p",{className:"font-bold text-green-500",children:[(parseFloat(Re.item_price)+parseFloat(Re.proposed_fee)).toLocaleString()," ",((Ft=Wc.find(ge=>ge.value===Re.currency))==null?void 0:Ft.label)||Re.currency]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(jy,{className:"w-5 h-5 text-custom-purple"})," محل تحویل"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Pi,{className:"w-4 h-4"})," مقصد تحویل"]}),Re.delivery_country&&a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.delivery_country})}),Re.delivery_city&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:Re.delivery_city}),Re.delivery_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:Re.delivery_address})]})})]})]}),b==="shopper"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(Pi,{className:"w-5 h-5 text-custom-purple"})," موقعیت مکانی"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Xc,{className:"w-4 h-4"})," کشور"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.country})})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Pi,{className:"w-4 h-4"})," شهر"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.city})})]})]})]}),(()=>{const ge=Sn(Re.categories);return ge.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(py,{className:"w-5 h-5 text-custom-purple"})," دسته‌بندی‌ها"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ge.map(et=>{const Ye=U0.find(Ze=>Ze.value===et);return a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:(Ye==null?void 0:Ye.label)||et},et)})})]})})(),(()=>{const ge=Sn(Re.supported_sites);return ge.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(Xc,{className:"w-5 h-5 text-custom-purple"})," سایت‌های پشتیبانی شده"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ge.map(et=>a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:et},et))})]})})(),(Re.fee_description||Re.capabilities)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(iy,{className:"w-5 h-5 text-custom-purple"})," جزئیات خدمات"]}),a.jsxs("div",{className:"space-y-4",children:[Re.fee_description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(_n,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات کارمزد:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.fee_description})]}),Re.capabilities&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(Fc,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات بیشتر:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.capabilities})]})]})]})]}),Re.show_phone&&((wt=Re.user)==null?void 0:wt.phone)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(ah,{className:"w-5 h-5 text-custom-purple"})," اطلاعات تماس"]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ky,{className:"w-10 h-10 text-gray-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:Re.user.name}),a.jsx("p",{className:"text-custom-purple",children:Re.user.phone})]})]})]})]}),f&&a.jsx("div",{className:"lg:col-span-1 space-y-6",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold pb-3 border-b border-gray-200 dark:border-gray-700",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[a.jsxs("button",{onClick:()=>O(!0),className:"flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors",children:[a.jsx(my,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:he,disabled:G,className:"flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[G?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(by,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:G?"حذف...":"حذف"})]})]})]})})]})]})},Dy=()=>{const[c,b]=y.useState(!1),[N,f]=y.useState("dark"),[g,v]=y.useState("dashboard"),[U,S]=y.useState(null),[T,_]=y.useState(null),[V,O]=y.useState(null),[J,X]=y.useState(null),[G,$]=y.useState(null),[M,m]=y.useState(null),[j,Y]=y.useState(!1),[z,ce]=y.useState(!1),[pe,K]=y.useState("phone"),[ne,Ce]=y.useState(null),Se=w=>{Ce({text:w,type:"error"}),setTimeout(()=>Ce(null),5e3)},de=w=>{Ce({text:w,type:"success"}),setTimeout(()=>Ce(null),5e3)},R=async()=>{const w=localStorage.getItem("auth_token");if(!w){ce(!1),K("phone");return}try{if((await fetch("https://eino.eifa.site/users-api/public/api/auth/check",{headers:{"X-Auth-Token":w,"Content-Type":"application/json"}})).ok)ce(!0);else throw new Error("توکن شما منقضی شده است.")}catch{localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),ce(!1),K("phone"),Se("لطفاً دوباره وارد شوید.")}};y.useEffect(()=>{R()},[]),y.useEffect(()=>{const w=localStorage.getItem("theme");w&&(w==="light"||w==="dark")?f(w):localStorage.setItem("theme","dark")},[]),y.useEffect(()=>{N==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",N)},[N]);const me=()=>{f(w=>w==="dark"?"light":"dark")},ye=()=>{b(!c)},fe=async(w,H,F)=>{if(S(null),_(null),O(null),X(null),$(null),m(null),Y((F==null?void 0:F.isOwnerView)??!1),w==="ticket-detail"&&H?S(H):w==="shipment-detail"&&H?_(H):w==="trip-detail"&&H&&typeof H=="object"?(O(H.tripId),X(H.type||"trip")):w==="purchase-request-detail"&&H?$(H):w==="purchase-shopper-detail"&&H&&m(H),w==="logout"){localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),ce(!1),K("phone"),v("dashboard");return}await R(),z&&(v(w),b(!1))},q=()=>{switch(g){case"dashboard":return a.jsx(c0,{onNavigate:fe});case"register-shipment":return a.jsx(Cx,{showError:Se,showSuccess:de});case"accept-shipment":return a.jsx(Yx,{onNavigate:fe});case"my-shipment-requests":return a.jsx(dp,{showError:Se,showSuccess:de,onNavigate:fe});case"register-trip":return a.jsx(Ux,{showError:Se,showSuccess:de});case"accept-companion":return a.jsx(Fx,{onNavigate:fe});case"my-trips":return a.jsx(hp,{showError:Se,showSuccess:de,onNavigate:fe});case"new-ticket":return a.jsx(Ix,{onNavigate:fe});case"register-online-purchase":return a.jsx(tp,{showError:Se,showSuccess:de});case"accept-online-purchase":return a.jsx(rp,{onNavigate:fe});case"my-purchase-requests":return a.jsx(op,{showError:Se,showSuccess:de,onNavigate:fe});case"messages":return a.jsx(mp,{});case"tickets":return a.jsx(bp,{onNavigate:fe});case"ticket-detail":return a.jsx(vp,{ticketId:U,onNavigate:fe});case"shipment-detail":return a.jsx(Tp,{shipmentId:T,onNavigate:fe,isOwnerView:j});case"trip-detail":return a.jsx(Vp,{tripId:V,type:J,onNavigate:fe,isOwnerView:j});case"purchase-request-detail":return a.jsx(H0,{purchaseId:G,onNavigate:fe,isOwnerView:j,type:"request"});case"purchase-shopper-detail":return a.jsx(H0,{purchaseId:M,onNavigate:fe,isOwnerView:j,type:"shopper"});case"account":return a.jsx(jp,{});default:return a.jsx(c0,{onNavigate:fe})}},ie=async w=>{try{const H=await fetch("https://eino.eifa.site/users-api/public/api/auth/request-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:w})}),F=await H.json();H.ok?(K("code"),localStorage.setItem("auth_phone",w)):Se(F.error||"خطا در ارسال کد")}catch{Se("اتصال به سرور برقرار نشد")}},je=async w=>{const H=localStorage.getItem("auth_phone");if(H)try{const F=await fetch("https://eino.eifa.site/users-api/public/api/auth/verify-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:H,otp:w})}),xe=await F.json();F.ok?(localStorage.setItem("auth_token",xe.token),ce(!0)):Se(xe.error||"کد نامعتبر است")}catch{Se("اتصال به سرور برقرار نشد")}},Ae=async()=>{const w=localStorage.getItem("auth_phone");if(w)try{const H=await fetch("https://eino.eifa.site/users-api/public/api/auth/request-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:w})});if(H.ok)de("کد جدید ارسال شد!");else{const F=await H.json();Se(F.message||"خطا در ارسال مجدد")}}catch{Se("اتصال به سرور برقرار نشد")}};if(!z)return a.jsxs(a.Fragment,{children:[ne&&a.jsx("div",{className:`fixed top-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white font-medium z-50 ${ne.type==="success"?"bg-green-500":"bg-red-500"}`,children:ne.text}),pe==="phone"&&a.jsx(Np,{onLogin:ie,theme:N,toggleTheme:me}),pe==="code"&&a.jsx(wp,{onVerify:je,onResend:Ae,theme:N,toggleTheme:me})]});const _e=g==="messages";return a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue min-h-screen text-gray-800 dark:text-gray-200 font-sans flex relative",children:[ne&&a.jsx("div",{className:`fixed top-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white font-medium z-50 ${ne.type==="success"?"bg-green-500":"bg-red-500"}`,children:ne.text}),a.jsx(_x,{isOpen:c,currentPage:g,onNavigate:fe}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-x-hidden",children:[a.jsx(Sx,{onMenuClick:ye,theme:N,toggleTheme:me,onNavigate:fe}),a.jsx("main",{className:`flex-1 p-4 sm:p-6 lg:p-8 ${_e?"flex flex-col":"overflow-y-auto"}`,children:q()})]}),c&&a.jsx("div",{onClick:()=>b(!1),className:"bg-black/50 fixed inset-0 z-30 lg:hidden","aria-hidden":"true"})]})},It=async(c,b={})=>{const N=localStorage.getItem("auth_token");if(!N)throw localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),window.location.reload(),new Error("Not authenticated");const f=await fetch(c,{...b,headers:{"X-Auth-Token":N,"Content-Type":"application/json",...b.headers}});if(f.status===401)throw localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),window.location.reload(),new Error("Token expired or invalid");if(!f.ok){const g=await f.json().catch(()=>({}));throw new Error(g.error||"خطا در انجام عملیات")}return f},Q0=document.getElementById("root");if(!Q0)throw new Error("Could not find root element to mount to");const My=hx.createRoot(Q0);My.render(a.jsx(lx.StrictMode,{children:a.jsx(Dy,{})}));
