componentes-exagono 0.2.41 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +137 -115
- package/dist/index.umd.js +2 -2
- package/package.json +3 -7
package/dist/index.umd.js
CHANGED
|
@@ -157,7 +157,7 @@ const theme2 = createTheme({ palette: {
|
|
|
157
157
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...t){const n=new this(r);return t.forEach(o=>n.set(o)),n}static accessor(r){const n=(this[Qd]=this[Qd]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=_o(i);n[a]||(Rb(o,i),n[a]=!0)}return z.isArray(r)?r.forEach(s):s(r),this}};Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(Xt.prototype,({value:e},r)=>{let t=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(n){this[t]=n}}}),z.freezeMethods(Xt);function Qa(e,r){const t=this||wo,n=r||t,o=Xt.from(n.headers);let s=n.data;return z.forEach(e,function(a){s=a.call(t,s,o.normalize(),r?r.status:void 0)}),o.normalize(),s}function Xd(e){return!!(e&&e.__CANCEL__)}function Nn(e,r,t){Ne.call(this,e??"canceled",Ne.ERR_CANCELED,r,t),this.name="CanceledError"}z.inherits(Nn,Ne,{__CANCEL__:!0});function Jd(e,r,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?e(t):r(new Ne("Request failed with status code "+t.status,[Ne.ERR_BAD_REQUEST,Ne.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Nb(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function $b(e,r){e=e||10;const t=new Array(e),n=new Array(e);let o=0,s=0,i;return r=r!==void 0?r:1e3,function(c){const u=Date.now(),d=n[s];i||(i=u),t[o]=c,n[o]=u;let f=s,h=0;for(;f!==o;)h+=t[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<r)return;const y=d&&u-d;return y?Math.round(h*1e3/y):void 0}}function Lb(e,r){let t=0,n=1e3/r,o,s;const i=(u,d=Date.now())=>{t=d,o=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=n?i(u,d):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},n-f)))},()=>o&&i(o)]}const ui=(e,r,t=3)=>{let n=0;const o=$b(50,250);return Lb(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-n,u=o(c),d=i<=a;n=i;const f={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[r?"download":"upload"]:!0};e(f)},t)},ef=(e,r)=>{const t=e!=null;return[n=>r[0]({lengthComputable:t,total:e,loaded:n}),r[1]]},tf=e=>(...r)=>z.asap(()=>e(...r)),zb=qt.hasStandardBrowserEnv?((e,r)=>t=>(t=new URL(t,qt.origin),e.protocol===t.protocol&&e.host===t.host&&(r||e.port===t.port)))(new URL(qt.origin),qt.navigator&&/(msie|trident)/i.test(qt.navigator.userAgent)):()=>!0,Bb=qt.hasStandardBrowserEnv?{write(e,r,t,n,o,s){const i=[e+"="+encodeURIComponent(r)];z.isNumber(t)&&i.push("expires="+new Date(t).toGMTString()),z.isString(n)&&i.push("path="+n),z.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const r=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Fb(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vb(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function rf(e,r,t){let n=!Fb(r);return e&&(n||t==!1)?Vb(e,r):r}const nf=e=>e instanceof Xt?{...e}:e;function fn(e,r){r=r||{};const t={};function n(u,d,f,h){return z.isPlainObject(u)&&z.isPlainObject(d)?z.merge.call({caseless:h},u,d):z.isPlainObject(d)?z.merge({},d):z.isArray(d)?d.slice():d}function o(u,d,f,h){if(z.isUndefined(d)){if(!z.isUndefined(u))return n(void 0,u,f,h)}else return n(u,d,f,h)}function s(u,d){if(!z.isUndefined(d))return n(void 0,d)}function i(u,d){if(z.isUndefined(d)){if(!z.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,f){if(f in r)return n(u,d);if(f in e)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,d,f)=>o(nf(u),nf(d),f,!0)};return z.forEach(Object.keys({...e,...r}),function(d){const f=c[d]||o,h=f(e[d],r[d],d);z.isUndefined(h)&&f!==a||(t[d]=h)}),t}const of=e=>{const r=fn({},e);let{data:t,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=r;r.headers=i=Xt.from(i),r.url=qd(rf(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(z.isFormData(t)){if(qt.hasStandardBrowserEnv||qt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((c=i.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...d].join("; "))}}if(qt.hasStandardBrowserEnv&&(n&&z.isFunction(n)&&(n=n(r)),n||n!==!1&&zb(r.url))){const u=o&&s&&Bb.read(s);u&&i.set(o,u)}return r},Ub=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(t,n){const o=of(e);let s=o.data;const i=Xt.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,f,h,y,g;function p(){y&&y(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function _(){if(!b)return;const D=Xt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:D,config:e,request:b};Jd(function(E){t(E),p()},function(E){n(E),p()},w),b=null}"onloadend"in b?b.onloadend=_:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(_)},b.onabort=function(){b&&(n(new Ne("Request aborted",Ne.ECONNABORTED,e,b)),b=null)},b.onerror=function(){n(new Ne("Network Error",Ne.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const w=o.transitional||Gd;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),n(new Ne(C,w.clarifyTimeoutError?Ne.ETIMEDOUT:Ne.ECONNABORTED,e,b)),b=null},s===void 0&&i.setContentType(null),"setRequestHeader"in b&&z.forEach(i.toJSON(),function(C,w){b.setRequestHeader(w,C)}),z.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),a&&a!=="json"&&(b.responseType=o.responseType),u&&([h,g]=ui(u,!0),b.addEventListener("progress",h)),c&&b.upload&&([f,y]=ui(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(d=D=>{b&&(n(!D||D.type?new Nn(null,e,b):D),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const S=Nb(o.url);if(S&&qt.protocols.indexOf(S)===-1){n(new Ne("Unsupported protocol "+S+":",Ne.ERR_BAD_REQUEST,e));return}b.send(s||null)})},Wb=(e,r)=>{const{length:t}=e=e?e.filter(Boolean):[];if(r||t){let n=new AbortController,o;const s=function(u){if(!o){o=!0,a();const d=u instanceof Error?u:this.reason;n.abort(d instanceof Ne?d:new Nn(d instanceof Error?d.message:d))}};let i=r&&setTimeout(()=>{i=null,s(new Ne(`timeout ${r} of ms exceeded`,Ne.ETIMEDOUT))},r);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>z.asap(a),c}},Hb=function*(e,r){let t=e.byteLength;if(t<r){yield e;return}let n=0,o;for(;n<t;)o=n+r,yield e.slice(n,o),n=o},Yb=async function*(e,r){for await(const t of qb(e))yield*Hb(t,r)},qb=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:t,value:n}=await r.read();if(t)break;yield n}}finally{await r.cancel()}},sf=(e,r,t,n)=>{const o=Yb(e,r);let s=0,i,a=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await o.next();if(u){a(),c.close();return}let f=d.byteLength;if(t){let h=s+=f;t(h)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},di=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",af=di&&typeof ReadableStream=="function",Zb=di&&(typeof TextEncoder=="function"?(e=>r=>e.encode(r))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),cf=(e,...r)=>{try{return!!e(...r)}catch{return!1}},Gb=af&&cf(()=>{let e=!1;const r=new Request(qt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!r}),lf=64*1024,Xa=af&&cf(()=>z.isReadableStream(new Response("").body)),fi={stream:Xa&&(e=>e.body)};di&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(r=>{!fi[r]&&(fi[r]=z.isFunction(e[r])?t=>t[r]():(t,n)=>{throw new Ne(`Response type '${r}' is not supported`,Ne.ERR_NOT_SUPPORT,n)})})})(new Response);const Kb=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new Request(qt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e=e+""),z.isString(e))return(await Zb(e)).byteLength},Qb=async(e,r)=>{const t=z.toFiniteNumber(e.getContentLength());return t??Kb(r)},Ja={http:yb,xhr:Ub,fetch:di&&(async e=>{let{url:r,method:t,data:n,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=of(e);u=u?(u+"").toLowerCase():"text";let y=Wb([o,s&&s.toAbortSignal()],i),g;const p=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let b;try{if(c&&Gb&&t!=="get"&&t!=="head"&&(b=await Qb(d,n))!==0){let w=new Request(r,{method:"POST",body:n,duplex:"half"}),F;if(z.isFormData(n)&&(F=w.headers.get("content-type"))&&d.setContentType(F),w.body){const[E,T]=ef(b,ui(tf(c)));n=sf(w.body,lf,E,T)}}z.isString(f)||(f=f?"include":"omit");const _="credentials"in Request.prototype;g=new Request(r,{...h,signal:y,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:_?f:void 0});let S=await fetch(g,h);const D=Xa&&(u==="stream"||u==="response");if(Xa&&(a||D&&p)){const w={};["status","statusText","headers"].forEach(I=>{w[I]=S[I]});const F=z.toFiniteNumber(S.headers.get("content-length")),[E,T]=a&&ef(F,ui(tf(a),!0))||[];S=new Response(sf(S.body,lf,E,()=>{T&&T(),p&&p()}),w)}u=u||"text";let C=await fi[z.findKey(fi,u)||"text"](S,e);return!D&&p&&p(),await new Promise((w,F)=>{Jd(w,F,{data:C,headers:Xt.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:g})})}catch(_){throw p&&p(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new Ne("Network Error",Ne.ERR_NETWORK,e,g),{cause:_.cause||_}):Ne.from(_,_&&_.code,e,g)}})};z.forEach(Ja,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const uf=e=>`- ${e}`,Xb=e=>z.isFunction(e)||e===null||e===!1,df={getAdapter:e=>{e=z.isArray(e)?e:[e];const{length:r}=e;let t,n;const o={};for(let s=0;s<r;s++){t=e[s];let i;if(n=t,!Xb(t)&&(n=Ja[(i=String(t)).toLowerCase()],n===void 0))throw new Ne(`Unknown adapter '${i}'`);if(n)break;o[i||"#"+s]=n}if(!n){const s=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=r?s.length>1?`since :
|
|
158
158
|
`+s.map(uf).join(`
|
|
159
159
|
`):" "+uf(s[0]):"as no adapter specified";throw new Ne("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:Ja};function ec(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nn(null,e)}function ff(e){return ec(e),e.headers=Xt.from(e.headers),e.data=Qa.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),df.getAdapter(e.adapter||wo.adapter)(e).then(function(n){return ec(e),n.data=Qa.call(e,e.transformResponse,n),n.headers=Xt.from(n.headers),n},function(n){return Xd(n)||(ec(e),n&&n.response&&(n.response.data=Qa.call(e,e.transformResponse,n.response),n.response.headers=Xt.from(n.response.headers))),Promise.reject(n)})}const pf="1.11.0",pi={};["object","boolean","number","function","string","symbol"].forEach((e,r)=>{pi[e]=function(n){return typeof n===e||"a"+(r<1?"n ":" ")+e}});const hf={};pi.transitional=function(r,t,n){function o(s,i){return"[Axios v"+pf+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,a)=>{if(r===!1)throw new Ne(o(i," has been removed"+(t?" in "+t:"")),Ne.ERR_DEPRECATED);return t&&!hf[i]&&(hf[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(s,i,a):!0}},pi.spelling=function(r){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${r}`),!0)};function Jb(e,r,t){if(typeof e!="object")throw new Ne("options must be an object",Ne.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=r[s];if(i){const a=e[s],c=a===void 0||i(a,s,e);if(c!==!0)throw new Ne("option "+s+" must be "+c,Ne.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ne("Unknown option "+s,Ne.ERR_BAD_OPTION)}}const hi={assertOptions:Jb,validators:pi},Pr=hi.validators;let pn=class{constructor(r){this.defaults=r||{},this.interceptors={request:new Zd,response:new Zd}}async request(r,t){try{return await this._request(r,t)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
160
|
-
`+s):n.stack=s}catch{}}throw n}}_request(r,t){typeof r=="string"?(t=t||{},t.url=r):t=r||{},t=fn(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:s}=t;n!==void 0&&hi.assertOptions(n,{silentJSONParsing:Pr.transitional(Pr.boolean),forcedJSONParsing:Pr.transitional(Pr.boolean),clarifyTimeoutError:Pr.transitional(Pr.boolean)},!1),o!=null&&(z.isFunction(o)?t.paramsSerializer={serialize:o}:hi.assertOptions(o,{encode:Pr.function,serialize:Pr.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),hi.assertOptions(t,{baseUrl:Pr.spelling("baseURL"),withXsrfToken:Pr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&z.merge(s.common,s[t.method]);s&&z.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),t.headers=Xt.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,f=0,h;if(!c){const g=[ff.bind(this),void 0];for(g.unshift(...a),g.push(...u),h=g.length,d=Promise.resolve(t);f<h;)d=d.then(g[f++],g[f++]);return d}h=a.length;let y=t;for(f=0;f<h;){const g=a[f++],p=a[f++];try{y=g(y)}catch(b){p.call(this,b);break}}try{d=ff.call(this,y)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(r){r=fn(this.defaults,r);const t=rf(r.baseURL,r.url,r.allowAbsoluteUrls);return qd(t,r.params,r.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(r){pn.prototype[r]=function(t,n){return this.request(fn(n||{},{method:r,url:t,data:(n||{}).data}))}}),z.forEach(["post","put","patch"],function(r){function t(n){return function(s,i,a){return this.request(fn(a||{},{method:r,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}pn.prototype[r]=t(),pn.prototype[r+"Form"]=t(!0)});let ex=class Rh{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{n.subscribe(a),s=a}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},r(function(s,i,a){n.reason||(n.reason=new Nn(s,i,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const t=this._listeners.indexOf(r);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const r=new AbortController,t=n=>{r.abort(n)};return this.subscribe(t),r.signal.unsubscribe=()=>this.unsubscribe(t),r.signal}static source(){let r;return{token:new Rh(function(o){r=o}),cancel:r}}};function tx(e){return function(t){return e.apply(null,t)}}function rx(e){return z.isObject(e)&&e.isAxiosError===!0}const tc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tc).forEach(([e,r])=>{tc[r]=e});function mf(e){const r=new pn(e),t=Od(pn.prototype.request,r);return z.extend(t,pn.prototype,r,{allOwnKeys:!0}),z.extend(t,r,null,{allOwnKeys:!0}),t.create=function(o){return mf(fn(e,o))},t}const Ot=mf(wo);Ot.Axios=pn,Ot.CanceledError=Nn,Ot.CancelToken=ex,Ot.isCancel=Xd,Ot.VERSION=pf,Ot.toFormData=ci,Ot.AxiosError=Ne,Ot.Cancel=Ot.CanceledError,Ot.all=function(r){return Promise.all(r)},Ot.spread=tx,Ot.isAxiosError=rx,Ot.mergeConfig=fn,Ot.AxiosHeaders=Xt,Ot.formToJSON=e=>Kd(z.isHTMLForm(e)?new FormData(e):e),Ot.getAdapter=df.getAdapter,Ot.HttpStatusCode=tc,Ot.default=Ot;const{Axios:PA,AxiosError:RA,CanceledError:NA,isCancel:$A,CancelToken:LA,VERSION:zA,all:BA,Cancel:FA,isAxiosError:VA,spread:UA,toFormData:WA,AxiosHeaders:HA,HttpStatusCode:YA,formToJSON:qA,getAdapter:ZA,mergeConfig:GA}=Ot,gf={token:null},nx=e=>{gf.token=e},bt=Ot.create({headers:{"Content-Type":"application/json"}});bt.interceptors.request.use(e=>{const r=gf.token;return r&&(e.headers.Authorization=`Bearer ${r}`),e},e=>Promise.reject(e));const vf=v.createContext(void 0),ox=({config:e,children:r})=>(v.useEffect(()=>{e.getToken&&nx(e.getToken)},[e.getToken]),l.jsx(vf.Provider,{value:e,children:r})),rc=()=>{const e=v.useContext(vf);if(!e)throw new Error("useApiConfig debe ser usado dentro de un ApiProvider");return e},mi=()=>{const{calendarApiUrl:e}=rc();return{getGoogleAuthUrl:async()=>{try{const i=`${e}/api/Calendario/v1/auth-url-Google`;return(await bt.get(i)).data}catch(i){throw console.error("Error al obtener la URL de Google Auth:",i),i}},saveGoogleCredentials:async i=>{try{const a=new URLSearchParams({code:i.code,disID:String(i.disID),usrID:String(i.usrID)}).toString(),c=`${e}/api/Calendario/v1/google-auth/SaveCredential?${a}`;return(await bt.post(c,{})).data}catch(a){throw console.error("Error al guardar credenciales de Google:",a),a}},getGoogleCalendars:async(i,a)=>{try{return(await bt.get(`${e}/api/Calendario/v1/google/ObtenerTiposCalendariosGoogleAsync?usrMail=${encodeURIComponent(i)}&disID=${a}`)).data}catch(c){throw console.error("Error al obtener los calendarios de Google:",c),c}},syncGoogleEvents:async(i,a,c)=>{try{return(await bt.post(`${e}/api/Calendario/v1/google/SincronizarEnviarEventosAsync?usrMail=${encodeURIComponent(i)}&disID=${a}&UsuarioID=${c}`)).data}catch(u){throw console.error("Error al sincronizar eventos con Google Calendar:",u),u}},getGoogleEventsByMonth:async i=>{try{return(await bt.post(`${e}/api/Calendario/v1/google/ObtenerEventosGoogleAsyncXMes`,i)).data}catch(a){throw console.error("Error al obtener eventos de Google Calendar por mes:",a),a}}}},yf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAASFBMVEVChfRHcExDhOAWaNUZfjjkTDf////6/P7b6fu61fj7wCj7vASZv/VuoPBQjvVCr19GifE0qFM4gerrRjMubcQQaucZZ9MYgTpc4mWWAAAABnRSTlP/AFtbW/eMEQaPAAAAfUlEQVR42q3Pyw4CIQyFYVDbigKOl6Pv/6a2ZBYN08TEzL9gcb6waDqkubd1TEsEWkp7Q3e9RuvOrsvV+g0Fi+jaZIKC0sECzMDCDK51C9zR9A2gPhCC6HgOoIFL/KMD1cMfl39GNxc9NVrh7jKgHAPlCGwPgSgbnDYw9vwFKv0VRfpGYZ8AAAAASUVORK5CYII=",sx=({disID:e,usrID:r})=>{const[t,n]=v.useState(null),o=mi(),s=async()=>{localStorage.setItem("temp_auth_disID",String(e)),localStorage.setItem("temp_auth_usrID",String(r)),n(null);try{const{url:i}=await o.getGoogleAuthUrl();window.location.href=i}catch(i){n(i.message||"Fallo al iniciar sesión con Google."),localStorage.removeItem("temp_auth_disID"),localStorage.removeItem("temp_auth_usrID")}finally{}};return l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:ve.syncButton,onClick:s,children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.uncheckedCircle})}),l.jsx("img",{src:yf,width:18}),l.jsx("span",{children:"Google Calendar"})]}),t&&l.jsx("p",{className:"text-red-500 mt-2",children:t})]})},nc=()=>{const{calendarApiUrl:e}=rc();return{getOutlookAuthUrl:async()=>{try{const i=`${e}/api/Calendario/v1/auth-url-Outlook`,a=await bt.get(i);return console.log("api",a),a.data}catch(i){throw console.error("Error al obtener la URL de Outlook Auth:",i),i}},saveOutlookCredentials:async i=>{try{const a=new URLSearchParams({code:i.code,disID:String(i.disID),usrID:String(i.usrID)}).toString(),c=`${e}/api/Calendario/v1/outlook-auth/SaveCredential?${a}`;return(await bt.post(c,{})).data}catch(a){throw console.error("Error al guardar credenciales Outlook:",a),a}},syncOutlookEvents:async(i,a,c)=>{try{return(await bt.post(`${e}/api/Calendario/v1/outlook/SincronizarEnviarEventosAsync?usrMail=${encodeURIComponent(i)}&disID=${a}&UsuarioID=${c}`)).data}catch(u){throw console.error("Error al sincronizar eventos con outlook Calendar:",u),u}},getOutlookCalendars:async(i,a)=>{try{return(await bt.get(`${e}/api/Calendario/v1/outlook/ObtenerTiposCalendariosOutlookAsync?usrMail=${encodeURIComponent(i)}&disID=${a}`)).data}catch(c){throw console.error("Error al obtener los calendarios de Google:",c),c}},getOutlookEventsByMonth:async i=>{try{return(await bt.post(`${e}/api/Calendario/v1/outlook/ObtenerEventosoutlookAsyncXMes`,i)).data}catch(a){throw console.error("Error al obtener eventos de Outlook Calendar por mes:",a),a}}}},bf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAYCAMAAAA8nnbJAAAAflBMVEUAAAAAV34AMFoAID0ATmsAL1oATXcAZZAAIUgANmQArPAAfd0BedoAacQAZbsAkuMActcAa9QAsfMAjfMAUJL///8Ame8Aht4A6v8A2v8Atvguid0AfMIAo+wAWrYA3/+q0/MAQ38ASIjB4PeHwe4AU7JlsekAdcMAXqgApf4WoQK+AAAACnRSTlMATjUWISlCbAuE1QOT9gAAAP1JREFUKM9t0GF7QzAQwPG2xiw5JGlICWVsrX3/L7i7Gyae/l944efinpzW4ktQfPrvorIgiHaW5UHZ29Hu3Dd235uTUkJnMHGj2NKISvh/TmBdX9c1W/pz5SQOOtsFFl0lBfx8YeCH6aHJhEG89X2/2aOchnLSIC1IACWwZjFdfmnwpSeDg/kSJH0AsLPLZgBoam9jsp2p8EylLK2rjDAmb89kALzLoLUaMyx3bs6rajHlh8FnZHzN+VwVxWKI+F5jFgdnW2BsaSUxUBRYYUdXrYaDMfbxydmuEU+32tJ7+5fB7QvUwBrDCcq4Z2AirJX7udCaziUMVHI+hPQLqRAg85aAu30AAAAASUVORK5CYII=",ix=({disID:e,usrID:r})=>{const[t,n]=v.useState(null),o=nc(),s=async()=>{localStorage.setItem("temp_auth_disID",String(e)),localStorage.setItem("temp_auth_usrID",String(r)),n(null);try{const i=await o.getOutlookAuthUrl();window.location.href=i?.authUrl}catch(i){n(i.message||"Fallo al iniciar sesión con Google."),localStorage.removeItem("temp_auth_disID"),localStorage.removeItem("temp_auth_usrID")}finally{}};return l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:ve.syncButton,onClick:s,children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.uncheckedCircle})}),l.jsx("img",{src:bf,width:20}),l.jsx("span",{children:"Outlook"})]}),t&&l.jsx("p",{className:"text-red-500 mt-2",children:t})]})},xf="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='67'%20fill='none'%3e%3cg%20filter='url(%23a)'%20opacity='.7'%3e%3cellipse%20cx='69.302'%20cy='60.952'%20fill='%23D9D9D9'%20rx='12.698'%20ry='2.032'/%3e%3c/g%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M60.034%2011.99c.71.001%201.37.374%201.737.982l-1.74%201.05a270%20270%200%200%201%201.74-1.048l.002.002.002.004.007.011.02.034.063.11q.08.139.21.385c.171.327.403.795.657%201.38a24.6%2024.6%200%200%201%201.527%204.811c.817%203.964.847%209.339-2.499%2014.552a2.033%202.033%200%200%201-3.242.236l1.533-1.333-1.535%201.332v-.003l-.005-.004-.01-.012-.028-.033-.082-.1a10%2010%200%200%201-.26-.34%2014%2014%200%200%201-.798-1.221%2017.3%2017.3%200%200%201-1.828-4.469c-.986-3.873-.934-9.225%202.79-15.35l.072-.11c.38-.542%201-.867%201.667-.866m1.867%2017.26q-.02.064-.042.126.091-.276.172-.552zm-1.626-14.786.004.008z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20d='M59.728%2035.515s-1.736-7.32%206.371-12.183c0%200%20.497%208.29-6.371%2012.183'/%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M79.915%2011.99c.71.001%201.37.374%201.737.982l-1.74%201.05a281%20281%200%200%201%201.74-1.048l.002.002.002.004.007.011.02.034.063.11q.08.139.21.385c.171.327.402.795.657%201.38a24.6%2024.6%200%200%201%201.527%204.811c.817%203.964.847%209.339-2.5%2014.552a2.033%202.033%200%200%201-3.241.236l1.532-1.333-1.534%201.332-.001-.003-.004-.004-.011-.012-.027-.033-.082-.1a10%2010%200%200%201-.26-.34c-.211-.287-.492-.698-.799-1.221a17.3%2017.3%200%200%201-1.827-4.469c-.986-3.873-.934-9.225%202.79-15.35l.072-.11c.38-.542%201-.867%201.667-.866m2.476%209.544q.013.113.027.228-.058-.477-.135-.934z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20fill-rule='evenodd'%20d='M72.733%2022.085c.313-.165.691-.154.996.028l-.522.871c.522-.87.521-.871.522-.87l.004.001.007.004.021.013q.027.016.072.046.091.057.25.165c.212.145.507.357.856.635.697.556%201.62%201.383%202.52%202.474%201.803%202.183%203.562%205.475%203.201%209.764a1.016%201.016%200%200%201-1.376.863h-.002l-.004-.002-.008-.002-.023-.01-.079-.033a9.79%209.79%200%200%201-1.139-.603%2012%2012%200%200%201-2.566-2.14c-1.853-2.044-3.57-5.345-3.271-10.365l.017-.131c.057-.3.249-.563.524-.708M78.04%2034.22l.11.075a11%2011%200%200%201-.394-.282zm-4.516-11.027.334.237q0%200%20.003.002a13%2013%200%200%200-.337-.24'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20fill-rule='evenodd'%20d='M85.456%2022.461a1.017%201.017%200%200%201%201.536.81l-1.014.061%201.014-.06v.002l.001.003v.008l.001.024.004.085q.004.108.004.301c0%20.257-.007.62-.04%201.067-.064.89-.227%202.12-.618%203.482-.781%202.723-2.5%206.038-6.237%208.156a1.018%201.018%200%200%201-1.489-.65l-.002-.006-.002-.009-.005-.025a5%205%200%200%201-.065-.367%2010%2010%200%200%201-.096-.999c-.04-.837%200-2.002.316-3.331.639-2.686%202.388-5.97%206.692-8.552'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M70.232%205.343c.71.002%201.37.374%201.737.982l-1.74%201.05c1.739-1.05%201.74-1.048%201.74-1.048l.002.002q0%20.003.003.004l.008.014.023.04.082.142q.102.18.274.505c.227.432.535%201.053.875%201.834a33%2033%200%200%201%202.036%206.417c1.09%205.284%201.122%2012.4-3.305%2019.3a2.034%202.034%200%200%201-3.242.236l1.532-1.334a223%20223%200%200%201-1.534%201.332l-.002-.002-.004-.005-.012-.013-.033-.04-.102-.124a13%2013%200%200%201-.335-.438%2019%2019%200%200%201-1.048-1.603%2023%2023%200%200%201-2.413-5.902c-1.3-5.104-1.25-12.198%203.719-20.373l.072-.11c.38-.541%201-.867%201.667-.866m1.563%2026.818v-.002l-.003-.002v-.002z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23AAABAD'%20fill-rule='evenodd'%20d='M60.61%2018.704c.315-.166.693-.155.998.027l-.523.871c.489-.815.52-.868.523-.87l.004.001.009.005.027.017a8%208%200%200%201%20.425.279c.282.192.676.476%201.145.85a23%2023%200%200%201%203.383%203.32c2.419%202.929%204.765%207.325%204.284%2013.05a1.017%201.017%200%200%201-1.376.864l.363-.948-.364.947h-.002l-.003-.002q-.005%200-.01-.003l-.03-.012-.1-.041a9%209%200%200%201-.341-.157c-.288-.139-.69-.35-1.164-.642a16%2016%200%200%201-3.42-2.852c-2.465-2.719-4.768-7.125-4.367-13.866l.017-.131c.058-.3.248-.562.523-.708m.436%201.974q.003-.237.011-.477v-.003a24%2024%200%200%200-.01.48'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23AAABAD'%20fill-rule='evenodd'%20d='M78.103%2019.143a1.016%201.016%200%200%201%201.419.871l-1.014.06%201.014-.06.001.002v.013l.002.032.004.11q.005.142.006.399c0%20.341-.01.83-.054%201.428a23.2%2023.2%200%200%201-.829%204.675c-1.05%203.655-3.348%208.076-8.335%2010.904a1.016%201.016%200%200%201-1.49-.65l.989-.233-.988.232-.001-.001-.001-.004-.002-.01-.007-.032q-.01-.038-.022-.104a9%209%200%200%201-.064-.372c-.047-.317-.1-.768-.127-1.326a16%2016%200%200%201%20.423-4.441c.85-3.574%203.18-7.967%208.96-11.433zm-8.499%2015.032c-.007.617.024%201.143.066%201.552q.032.308.065.524c.043.286.08.443.08.443-.003-.017-.23-.99-.21-2.52m.05-1.027q-.023.282-.036.546l.032-.511q.001-.018.004-.035'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23D6D6D6'%20d='M55.804%2031.519h28.238c.815%200%201.476.663%201.476%201.481v15.847c0%206.204-5.019%2011.241-11.2%2011.241h-8.79c-6.182%200-11.2-5.037-11.2-11.24V33c0-.818.66-1.481%201.476-1.481'/%3e%3cpath%20fill='%23E6E8ED'%20d='M68.15%2032.344v17.159c0%205.103%203.6%209.364%208.39%2010.361%205.122-1.034%208.978-5.574%208.978-11.018V33c0-.818-.66-1.481-1.476-1.481h-15.07a.823.823%200%200%200-.822.824z'/%3e%3cg%20filter='url(%23b)'%20opacity='.7'%3e%3cellipse%20cx='33.238'%20cy='60.952'%20fill='%23D9D9D9'%20rx='28.444'%20ry='3.048'/%3e%3c/g%3e%3cpath%20fill='%233856EC'%20d='M6.095%2017.27h54.857V53.84a6.095%206.095%200%200%201-6.095%206.095H12.19a6.095%206.095%200%200%201-6.095-6.095z'/%3e%3cpath%20fill='%23E2EDFB'%20d='M6.195%2050.145a8.127%208.127%200%200%200%208.127%208.127H37.9a6.1%206.1%200%200%200%204.309-1.785l16.98-16.973a6.1%206.1%200%200%200%201.785-4.31V9.586a6.095%206.095%200%200%200-6.095-6.095H12.29a6.095%206.095%200%200%200-6.095%206.095z'/%3e%3cpath%20fill='%233856EC'%20fill-rule='evenodd'%20d='M60.952%209.009a6.014%206.014%200%200%200-6.014-6.014H12.11a6.014%206.014%200%200%200-6.014%206.014v8.284h54.857zM17.77%2012.772a2.794%202.794%200%201%201%20.002-5.589%202.794%202.794%200%200%201-.002%205.59m15.965%200a2.794%202.794%200%201%201%20.001-5.588%202.794%202.794%200%200%201%200%205.588m16.763%200a2.794%202.794%200%201%201%20.001-5.588%202.794%202.794%200%200%201-.001%205.588'%20clip-rule='evenodd'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='34.931'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='46.904'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='34.931'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='46.904'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='44.702'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='44.702'%20fill='%23fff'%20rx='2.032'/%3e%3cpath%20fill='%23597EF7'%20d='M40.52%2057.687a6%206%200%200%200%201.665-1.174l17.027-17.021a6%206%200%200%200%201.313-1.973H48.646a8.127%208.127%200%200%200-8.127%208.127z'/%3e%3crect%20width='3.991'%20height='11.974'%20x='15.773'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3crect%20width='3.991'%20height='11.974'%20x='31.738'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3crect%20width='3.991'%20height='11.974'%20x='48.501'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3cdefs%3e%3cfilter%20id='a'%20width='29.46'%20height='8.127'%20x='54.572'%20y='56.889'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20result='effect1_foregroundBlur_529_4322'%20stdDeviation='1.016'/%3e%3c/filter%3e%3cfilter%20id='b'%20width='60.952'%20height='10.159'%20x='2.762'%20y='55.873'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20result='effect1_foregroundBlur_529_4322'%20stdDeviation='1.016'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e";var So={},wf;function ax(){if(wf)return So;wf=1;var e=ct();Object.defineProperty(So,"__esModule",{value:!0}),So.default=void 0;var r=e(ht()),t=dt();return So.default=(0,r.default)((0,t.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),So}var cx=ax();const lx=at(cx);var Co={},_f;function ux(){if(_f)return Co;_f=1;var e=ct();Object.defineProperty(Co,"__esModule",{value:!0}),Co.default=void 0;var r=e(ht()),t=dt();return Co.default=(0,r.default)((0,t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Co}var dx=ux();const Rr=at(dx);function oc(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}function Eo(e){return(r,t)=>{const n=t?.context?String(t.context):"standalone";let o;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=t?.width?String(t.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=t?.width?String(t.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(r):r;return o[s]}}function Do(e){return(r,t={})=>{const n=t.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=r.match(o);if(!s)return null;const i=s[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?px(a,f=>f.test(i)):fx(a,f=>f.test(i));let u;u=e.valueCallback?e.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const d=r.slice(i.length);return{value:u,rest:d}}}function fx(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function px(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function hx(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const o=n[0],s=r.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const a=r.slice(o.length);return{value:i,rest:a}}}function mx(e,...r){const t=Fa.bind(null,r.find(n=>typeof n=="object"));return r.map(t)}const gx={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},vx=(e,r,t)=>{let n;const o=gx[e];return typeof o=="string"?n=o:r===1?n=o.one:n=o.other.replace("{{count}}",r.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"en "+n:"hace "+n:n},yx={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},bx={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},xx={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wx={date:oc({formats:yx,defaultWidth:"full"}),time:oc({formats:bx,defaultWidth:"full"}),dateTime:oc({formats:xx,defaultWidth:"full"})},_x={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Sx={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Cx=(e,r,t,n)=>r.getHours()!==1?Sx[e]:_x[e],Ex={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},Dx={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},kx={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},Ax={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},Tx={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},Mx={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Ix={ordinalNumber:(e,r)=>Number(e)+"º",era:Eo({values:Ex,defaultWidth:"wide"}),quarter:Eo({values:Dx,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Eo({values:kx,defaultWidth:"wide"}),day:Eo({values:Ax,defaultWidth:"wide"}),dayPeriod:Eo({values:Tx,defaultWidth:"wide",formattingValues:Mx,defaultFormattingWidth:"wide"})},Ox=/^(\d+)(º)?/i,jx=/\d+/i,Px={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},Rx={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Nx={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},Lx={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},zx={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},Bx={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},Fx={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},Vx={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},Ux={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},Wx={ordinalNumber:hx({matchPattern:Ox,parsePattern:jx,valueCallback:function(e){return parseInt(e,10)}}),era:Do({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),quarter:Do({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Do({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),day:Do({matchPatterns:Bx,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any"}),dayPeriod:Do({matchPatterns:Vx,defaultMatchWidth:"any",parsePatterns:Ux,defaultParseWidth:"any"})},Hx={code:"es",formatDistance:vx,formatLong:wx,formatRelative:Cx,localize:Ix,match:Wx,options:{weekStartsOn:1,firstWeekContainsDate:1}},Sf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAACpQTFRFR3BMcHCAcHBwaGx4ZWp6aG14aG54Zm14aW15aG55aG15aW55aW56aW5591zvEAAAAA10Uk5TABAQIDBBYHCAnr7g7wYb6DAAAACqSURBVHjahZJLDgMhDEM9UL7Ju/91q8KgQhcdb5D8rFiJ0JNC6Qbeczzt6izV8PWjAbiNB4uH35IkpbaRYGBpT9mcVlemtnCTOiLA8BPk+/VPIkPTR/kGalAkdUgnSNAlOegEckwS2C8wOAEWN2D4BC8HH3Xge/naYJUXaJq6Wo+S2iy7HJKW1sbHSc6B0mU7SeOIf8++CJg5nHOvypLXoF0xdwfrJTx9mzdxpgqGKfcyxQAAAABJRU5ErkJggg==",Yx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAMAAABZu7juAAAAPFBMVEUAAABobHhobnhpbnlobnhobXhpbnlpbnpobXhwcHNobHhlanlpbnlobnhobnpobXhmbXlocHhpbHZpbnlt0ET4AAAAE3RSTlMAIGDggL/f76AQQDDPsLCQcEBQZL6CzQAAALVJREFUSMft1MsOgyAQhWEGHQa82/P+71rDojhJ6dCNi9ZvZcivQUjGXWeTQHqFJvS1mgDMemkGQJV8AMB6iQHsb9K0RZ4ACCsCYOLoSccrDPH0AgWYAqm6vY9owuVAmgzq46aY84BGknM0S/nqm9Ef5tIZROXeGfyd3/lP5Kk9T+4gAGYrj68pxjiMn2sqI9iX6V0zhtOO8zO4r1k5B8F9NeBH9dsWr/ZmCLs+10VQ1S0Pd4UnLwhFRUE6UNsAAAAASUVORK5CYII=",qx=({notificacion:e,onAccept:r})=>{const{evento:t,tipo:n,leida:o}=e,s=n==="EventoCreado"||n==="EventoModificado",a={EventoCreado:{frase:"te ha invitado a:",colorTitulo:"#3c4043"},EventoModificado:{frase:"ha modificado el evento",colorTitulo:"#3c4043"},EventoCancelado:{frase:"ha cancelado el evento",colorTitulo:"#d32f2f"}}[n]||{frase:"te ha notificado sobre",colorTitulo:"#3c4043"},c=t?.fechaInicio?new Date(t.fechaInicio):new Date,u=t?.fechaFin?new Date(t.fechaFin):null,d=t?.nombreAnfitrion||"Usuario",f=t?.titulo||"Sin título",h=y=>y.split(" ").filter(g=>g).map(g=>g[0]).join("").toUpperCase().substring(0,2);return l.jsxs(m.Box,{sx:{p:2,mb:1,bgcolor:"white",borderRadius:"8px",border:"1px solid #e0e0e0",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",position:"relative",overflow:"hidden"},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:1},children:[l.jsx(m.Avatar,{sx:{bgcolor:"#F5A623",width:34,height:34,fontSize:"14px",mr:1.5,fontWeight:"bold"},children:h(d)}),l.jsxs(m.Box,{children:[l.jsxs(m.Typography,{sx:{fontSize:"14px",color:"#5f6368",lineHeight:1.2},children:[d," ",a.frase]}),l.jsx(m.Typography,{sx:{fontSize:"14px",fontWeight:700,color:a.colorTitulo},children:f})]})]}),l.jsx(m.Divider,{sx:{mx:-2,my:1.5,backgroundColor:"#000"}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:0},children:[l.jsx("img",{src:Yx,width:20,alt:"cal",style:{marginRight:15,color:"black"}}),l.jsx(m.Typography,{sx:{fontSize:"14px",color:"#3c4043",textTransform:"capitalize"},children:x.format(c,"EEEE, dd 'de' MMMM",{locale:Hx})})]}),l.jsx(m.Divider,{sx:{mx:-2,my:1.5,backgroundColor:"#000"}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:s&&!o?2:0},children:[l.jsx("img",{src:Sf,width:20,alt:"watch",style:{marginRight:15}}),l.jsxs(m.Typography,{sx:{fontSize:"14px",color:"#3c4043"},children:[x.format(c,"h:mm a").toLowerCase(),u?` - ${x.format(u,"h:mm a").toLowerCase()}`:""]})]}),s&&!o&&l.jsxs(m.Grid,{container:!0,spacing:1,sx:{mt:1},children:[l.jsx(m.Grid,{item:!0,xs:6,children:l.jsx(m.Button,{fullWidth:!0,variant:"outlined",size:"small",startIcon:l.jsx(lx,{sx:{fontSize:"16px !important",mr:-.5}}),onClick:()=>r?.(e,"CONFIRMADA"),sx:{borderRadius:"8px",textTransform:"none",fontWeight:700,fontSize:"12px",color:"#1976D2",borderColor:"#1976D2",py:.8,px:1,whiteSpace:"nowrap"},children:"Asistiré"})}),l.jsx(m.Grid,{item:!0,xs:6,children:l.jsx(m.Button,{fullWidth:!0,variant:"outlined",size:"small",startIcon:l.jsx(Rr,{sx:{fontSize:"16px !important",mr:-.5}}),onClick:()=>r?.(e,"RECHAZADA"),sx:{borderRadius:"8px",textTransform:"none",fontWeight:700,fontSize:"12px",color:"#D32F2F",borderColor:"#D32F2F",py:.8,px:1,whiteSpace:"nowrap"},children:"Rechazar"})})]})]})},Zx=({userId:e,notifications:r,onAceppInvitacion:t})=>{const[n,o]=v.useState(r),[s,i]=v.useState(null);return console.log("notifications",r),v.useEffect(()=>{o(r)},[r]),l.jsx(m.Box,{sx:{width:"100%",maxHeight:"600px",overflowY:"auto"},children:l.jsx(m.List,{disablePadding:!0,children:n.length===0?l.jsxs("div",{className:ve.emptyStateContainer,children:[l.jsx("img",{src:xf,alt:"Todo en orden",className:ve.emptyStateImage}),l.jsx("h4",{className:ve.emptyStateTitle,children:"Todo en orden aquí"}),l.jsx("p",{className:ve.emptyStateText,children:"Por el momento no tienes invitaciones pendientes."})]}):n.map(a=>l.jsx(qx,{notificacion:a,onAccept:t}))})})},Gx=({onEventClick:e,upcomingEvents:r,leads30Days:t,leads90Days:n,disID:o,usrID:s,onAddEvent:i,googleCalendars:a,outlookCalendars:c,isLoadingCalendars:u,onToggleGoogle:d,onToggleOutlook:f,notifications:h,unreadCount:y,onAceppInvitacion:g})=>{const{session:p,sessionoutlook:b}=Ua(),{enqueueSnackbar:_}=ss.useSnackbar(),S=$=>{const ie=new Date,ue={start:x.startOfDay(ie),end:x.endOfDay(ie)},N={start:$.fechaInicio,end:$.fechaFin};return xd(ue,N)?"Hoy":x.isTomorrow($.fechaInicio)?"Mañana":new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long"}).format($.fechaInicio)},D={};r.forEach($=>{const ie=S($);D[ie]||(D[ie]=[]),D[ie].push($)});const[C,w]=v.useState(!1),F=()=>{w(!C)},E=mi(),T=nc(),I=async()=>{if(!p?.userEmail||!o||!s){console.error("Faltan datos (email, disID o usrID) para sincronizar eventos.");return}try{await E.syncGoogleEvents(p?.userEmail,o,s),_("Eventos sincronizados con Google Calendar con éxito.",{variant:"success"})}catch{_("Error al sincronizar eventos con Google Calendar.",{variant:"error"})}finally{}},M=async()=>{if(!b?.userEmail||!o||!s){console.error("Faltan datos (email, disID o usrID) para sincronizar eventos.");return}try{await T.syncOutlookEvents(b?.userEmail,o,s),_("Eventos sincronizados con Outlook Calendar con éxito.",{variant:"success"})}catch{_("Error al sincronizar eventos con Outlook Calendar.",{variant:"error"})}finally{}},[U,q]=v.useState("events"),V=$=>{q($)},[H,re]=v.useState(!0),W=()=>{re($=>!$)};return l.jsxs("div",{className:ve.sidebarContainer,children:[l.jsxs("div",{className:ve.leadsSection,children:[l.jsxs("div",{className:ve.leadCard,children:[l.jsx("div",{className:ve.leadIcon,children:l.jsx("img",{src:Td})}),l.jsxs("div",{className:ve.leadText,children:[l.jsx("div",{className:ve.leadDays,children:"+30 días sin atender"}),l.jsxs("div",{className:ve.leadCount,children:[t," ",l.jsx("span",{style:{fontSize:10,fontWeight:"normal"},children:"leads"})]})]})]}),l.jsxs("div",{className:ve.leadCard,children:[l.jsx("div",{className:ve.leadIcon,children:l.jsx("img",{src:Td})}),l.jsxs("div",{className:ve.leadText,children:[l.jsx("div",{className:ve.leadDays,children:"+90 días sin atender"}),l.jsxs("div",{className:ve.leadCount,children:[n," ",l.jsx("span",{style:{fontSize:10,fontWeight:"normal"},children:"leads"})]})]})]})]}),l.jsxs("div",{className:ve.eventsSection,children:[l.jsxs("div",{className:ve.tabsContainer,children:[l.jsx("button",{className:`${ve.tabButton} ${U==="events"?ve.activeTab:""}`,onClick:()=>V("events"),children:"Eventos"}),l.jsxs("button",{className:`${ve.tabButton} ${U==="alerts"?ve.activeTab:""}`,onClick:()=>V("alerts"),children:["Alertas",y>0&&l.jsx("span",{className:ve.alertBadge,children:y>99?"99+":y})]})]}),l.jsxs("div",{className:ve.eventsContainer,children:[U==="events"&&l.jsx(l.Fragment,{children:Object.keys(D).length>0?Object.entries(D).map(([$,ie])=>l.jsxs("div",{className:`${ve.eventGroup}`,children:[l.jsxs("div",{className:ve.eventGroupDate,children:[l.jsx("img",{src:I1,width:15})," ",$]}),ie.map(ue=>{const N=Ce(ue.color||"#ffcc00"),ee=N.toString(),xe=N.clone().darken(15).toString(),_e=new Intl.DateTimeFormat("es-ES",{hour:"numeric",minute:"2-digit",hour12:!0});return l.jsxs("div",{className:ve.eventItem,style:{backgroundColor:ee,borderLeft:`4px solid ${xe}`,display:"flex",alignItems:"center",padding:"10px",marginBottom:"8px",borderRadius:"4px",cursor:"pointer"},onClick:()=>e(ue),children:[l.jsxs("div",{className:ve.eventDetails,style:{flex:1},children:[l.jsx("div",{className:ve.eventTitle,style:{fontWeight:"500",fontSize:"12px",color:"#333"},children:ue.titulo.length>32?`${ue.titulo.substring(0,32)}...`:ue.titulo}),ue.nombreAnfitrion&&l.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"4px",color:"#555"},children:[l.jsx("img",{src:Md,width:16,style:{marginRight:"6px",opacity:.7}}),l.jsx("span",{style:{fontSize:"13px"},children:ue.nombreAnfitrion})]}),l.jsx("div",{className:ve.eventTime,style:{fontSize:"12px",marginTop:"4px",opacity:.7},children:`${_e.format(ue.fechaInicio).toLowerCase()} - ${_e.format(ue.fechaFin).toLowerCase()}`})]}),ue.link&&l.jsx("a",{onClick:fe=>fe.stopPropagation(),href:ue.link,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",padding:"4px"},children:l.jsx("img",{src:O1,alt:"Video",width:20,style:{opacity:.8}})})]},ue.eventoID)})]},$)):l.jsxs("div",{className:ve.emptyStateContainer,children:[l.jsx("img",{src:xf,alt:"Todo en orden",className:ve.emptyStateImage}),l.jsx("h4",{className:ve.emptyStateTitle,children:"Tu agenda está despejada"}),l.jsx("p",{className:ve.emptyStateText,children:"Parece que no tienes ningún evento en tu calendario. ¿Te gustaría añadir uno? "}),l.jsxs("button",{className:ve.addEventButton,onClick:i,children:[l.jsx("img",{src:gd}),"Agregar evento"]})]})}),U==="alerts"&&l.jsx(m.Box,{children:l.jsx(Zx,{userId:s,notifications:h,onAceppInvitacion:g})})]})]}),l.jsxs("div",{className:ve.calendarsSection,children:[l.jsxs("button",{onClick:F,className:ve.collapsibleHeader,children:[l.jsxs("div",{className:ve.headerTitle,children:[l.jsx("span",{style:{fontSize:"14px"},children:"Calendarios"}),l.jsx("span",{className:ve.calendarCount,children:"1"})]}),l.jsx(s1,{className:`${ve.chevronIcon} ${C?ve.collapsed:""}`})]}),l.jsxs("div",{className:`${ve.collapsibleContent} ${C?ve.hidden:""}`,children:[l.jsxs("button",{className:`${ve.calendarSelectButton} ${H?ve.calendarSelected:""}`,onClick:W,style:{"--calendar-color":"#1976D2"},children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})})}),l.jsx(o1,{size:16,className:ve.calendarIcon}),l.jsx("span",{className:ve.calendarItemText,children:"Mi calendario"})]}),b.userEmail?l.jsxs("div",{className:ve.syncButton,onClick:M,children:[l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})}),l.jsx("img",{src:bf,width:20}),l.jsx("span",{style:{fontSize:"14px"},children:"Sincronizar Outlook"})]}):l.jsx(ix,{disID:o,usrID:s}),p?.userEmail?l.jsxs("div",{className:ve.syncButton,onClick:I,children:[l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})}),l.jsx("img",{src:yf,width:18}),l.jsx("span",{style:{fontSize:"14px"},children:"Sincronizar Google"})]}):l.jsx(sx,{disID:o,usrID:s}),b?.userEmail&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:ve.currentUserCalendarTitle,style:{marginTop:"10px"},children:b?.userEmail}),u?l.jsx(m.CircularProgress,{size:24}):c.length>0?l.jsx(m.List,{dense:!0,className:ve.calendarsList,children:c.map($=>l.jsx(m.ListItem,{secondaryAction:l.jsx(m.Checkbox,{edge:"end",onChange:()=>f($.id),checked:$.selected||!1,sx:{color:$.backgroundColor,"&.Mui-checked":{color:$.backgroundColor}}}),disablePadding:!0,children:l.jsx(m.ListItemText,{primary:$.summary.length>25?`${$.summary.substring(0,25)}...`:$.summary,className:ve.calendarItemText})},$.id))}):l.jsx("p",{style:{fontSize:"12px"},children:"No se encontraron calendarios."})]}),p?.userEmail&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:ve.currentUserCalendarTitle,style:{marginTop:"10px"},children:p?.userEmail}),u?l.jsx(m.CircularProgress,{size:24}):a.length>0?l.jsx(m.List,{dense:!0,className:ve.calendarsList,children:a.map($=>l.jsx(m.ListItem,{secondaryAction:l.jsx(m.Checkbox,{edge:"end",onChange:()=>d($.id),checked:$.selected||!1,sx:{color:$.backgroundColor,"&.Mui-checked":{color:$.backgroundColor}}}),disablePadding:!0,children:l.jsx(m.ListItemText,{primary:$.summary.length>25?`${$.summary.substring(0,25)}...`:$.summary,className:ve.calendarItemText})},$.id))}):l.jsx("p",{style:{fontSize:"12px"},children:"No se encontraron calendarios."})]})]})]})]})},hn={dayCell:"_dayCell_xweup_1",dayCellContainer:"_dayCellContainer_xweup_23",dayNumber:"_dayNumber_xweup_55",dayNumberToday:"_dayNumberToday_xweup_69",notCurrentMonth:"_notCurrentMonth_xweup_91",CurrentDay:"_CurrentDay_xweup_129",eventsList:"_eventsList_xweup_137"};var ko={},Cf;function Kx(){if(Cf)return ko;Cf=1;var e=ct();Object.defineProperty(ko,"__esModule",{value:!0}),ko.default=void 0,o(v);var r=e(ht()),t=dt();function n(s){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(n=function(c){return c?a:i})(s)}function o(s,i){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=n(i);if(a&&a.has(s))return a.get(s);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var f=u?Object.getOwnPropertyDescriptor(s,d):null;f&&(f.get||f.set)?Object.defineProperty(c,d,f):c[d]=s[d]}return c.default=s,a&&a.set(s,c),c}return ko.default=(0,r.default)((0,t.jsx)("path",{d:"M12.545,10.239v3.821h5.445c-0.712,2.315-2.647,3.972-5.445,3.972c-3.332,0-6.033-2.701-6.033-6.032s2.701-6.032,6.033-6.032c1.498,0,2.866,0.549,3.921,1.453l2.814-2.814C17.503,2.988,15.139,2,12.545,2C7.021,2,2.543,6.477,2.543,12s4.478,10,10.002,10c8.396,0,10.249-7.85,9.426-11.748L12.545,10.239z"}),"Google"),ko}var Qx=Kx();const Xx=at(Qx);var Ao={},Ef;function Jx(){if(Ef)return Ao;Ef=1;var e=ct();Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=void 0;var r=e(ht()),t=dt();return Ao.default=(0,r.default)((0,t.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline"),Ao}var ew=Jx();const tw=at(ew),Df=46,rw=22,nw=({dayNumber:e,date:r,events:t,isToday:n,isCurrentMonth:o,onDayClick:s,onEventClick:i,onSeeMoreClick:a})=>{const c=[hn.dayCell,o?"":hn.notCurrentMonth,hn.CurrentDay].join(" ").trim(),u=v.useRef(null),[d,f]=v.useState(t.length),h=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});v.useLayoutEffect(()=>{const p=()=>{if(u.current){const b=u.current.clientHeight;let _=Math.floor(b/(Df+4));if(_<t.length){const S=Math.floor((b-rw)/(Df+4));_=Math.max(0,S)}f(_)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[t.length]);const y=t.slice(0,d===0?1:d),g=t.length-(d===0?1:d);return l.jsxs("div",{className:`${c} ${hn.dayCellContainer}`,onClick:()=>s?.(r),style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[l.jsx("div",{className:n?hn.dayNumber:hn.dayNumberToday,children:e}),l.jsxs("div",{className:hn.eventsList,ref:u,style:{flex:1,display:"flex",flexDirection:"column",gap:"4px",padding:"0 4px 4px 4px",marginTop:"4px",overflow:"hidden"},children:[y.map(p=>{const b=p.color||"#D7EBFB",_=p.isGoogleEvent||p.isOutlookEvent;return l.jsxs(m.Box,{onClick:S=>{S.stopPropagation(),i?.(p)},sx:{backgroundColor:_?"#ffffff":p?.color,padding:"4px 8px",borderRadius:"6px",cursor:"pointer",display:"flex",flexDirection:"column",minHeight:"40px",maxHeight:"48px",position:"relative",overflow:"hidden",border:_?`1px solid ${Ce(b).setAlpha(.4).toRgbString()}`:"none","&:hover":{filter:"brightness(0.95)",boxShadow:"0px 2px 4px rgba(0,0,0,0.08)"}},children:[p.isGoogleEvent&&l.jsx(Xx,{sx:{position:"absolute",top:4,right:4,fontSize:12,color:"#4285F4"}}),p.isOutlookEvent&&l.jsx(tw,{sx:{position:"absolute",top:4,right:4,fontSize:12,color:"#0078D4"}}),l.jsx(m.Typography,{sx:{fontSize:"10px",lineHeight:"1",color:"#3C4043",pr:_?2:0,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word"},children:p.titulo}),l.jsx(m.Typography,{sx:{fontSize:"9px",color:"#70757a",mt:"auto",fontWeight:400},children:`${h.format(p.fechaInicio).toLowerCase()} - ${h.format(p.fechaFin).toLowerCase()}`})]},p.eventoID)}),g>0&&l.jsxs(m.Typography,{sx:{fontSize:"10px",fontWeight:"bold",color:"#1976D2",textAlign:"left",ml:1,mt:.5,cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:p=>{p.stopPropagation(),a(t,r)},children:["+",g," más"]})]})]})},kf={weekDaysContainer:"_weekDaysContainer_5h5ol_1",weekDay:"_weekDay_5h5ol_1"},ow=()=>{const e=["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"];return l.jsx("div",{className:kf.weekDaysContainer,children:e.map(r=>l.jsx("div",{className:kf.weekDay,children:r},r))})},gi={calendarGridContainer:"_calendarGridContainer_1expw_1",daysContainer:"_daysContainer_1expw_23",rows5:"_rows5_1expw_37",rows6:"_rows6_1expw_45"};function sw(e,r){const[t,n]=mx(e,r.start,r.end);return{start:t,end:n}}function iw(e,r){const{start:t,end:n}=sw(r?.in,e);let o=+t>+n;const s=o?+t:+n,i=o?n:t;i.setHours(0,0,0,0);let a=1;const c=[];for(;+i<=s;)c.push(Fa(t,i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return o?c.reverse():c}function aw(e,r){const t=r?.weekStartsOn,n=Xr(e,r?.in),o=n.getDay(),s=(o<t?-7:0)+6-(o-t);return n.setDate(n.getDate()+s),n.setHours(23,59,59,999),n}function cw(e,r,t){const n=+Xr(e,t?.in),[o,s]=[+Xr(r.start,t?.in),+Xr(r.end,t?.in)].sort((i,a)=>i-a);return n>=o&&n<=s}const lw=({currentDate:e,events:r,onDayClick:t,onEventClick:n,onSeeMoreClick:o})=>{const s=x.startOfMonth(e),i=x.endOfMonth(e),a=x.startOfWeek(s,{weekStartsOn:1}),c=aw(i,{weekStartsOn:1}),u=iw({start:a,end:c}),d={},f=u.length/7,h=`${gi.daysContainer} ${f===5?gi.rows5:gi.rows6}`;return r.forEach(y=>{const g=x.format(y.fechaInicio,"yyyy-MM-dd");d[g]||(d[g]=[]),d[g].push(y)}),l.jsxs("div",{className:gi.calendarGridContainer,children:[l.jsx(ow,{}),l.jsx("div",{className:h,children:u.map(y=>{const g=r.filter(p=>cw(y,{start:x.startOfDay(p.fechaInicio),end:x.endOfDay(p.fechaFin)}));return l.jsx(nw,{dayNumber:y.getDate(),date:y,events:g,isToday:x.isToday(y),isCurrentMonth:x.isSameMonth(y,e),onDayClick:t,onEventClick:n,onSeeMoreClick:o},y.toISOString())})})]})},sc=()=>{const{calendarApiUrl:e}=rc(),r=async g=>{try{return(await bt.get(`${e}/api/Calendario/v1/local/ListarEventosXUsuario/${g}`)).data.map(b=>{const _=new Date(b.fechaInicio),S=new Date(b.fechaFin),D=b.solicitudRelacionada?.[0]?.nombreCliente??null;return{...b,fechaInicio:_,fechaFin:S,client:D}})}catch(p){return console.error("Error events:",p),[]}},t=async(g,p)=>{try{const b=await bt.post(`${e}/api/Calendario/v1/local/InsertarEvento/${p}`,g);return{...b.data,fechaInicio:new Date(b.data.fechaInicio),fechaFin:new Date(b.data.fechaFin)}}catch(b){throw console.log("Error creating event:",b),b}},n=async g=>{try{const p=await bt.post(`${e}/api/Calendario/v1/local/ActualizarEvento/${g.eventoID}`,g);return{eventoID:p.data.eventoID,titulo:p.data.titulo,descripcion:p.data.descripcion,fechaInicio:new Date(p.data.fechaInicio),fechaFin:new Date(p.data.fechaFin),todoElDia:p.data.todoElDia,color:p.data.color,repetir:p.data.repetir,link:p.data.link,solID:p.data.solID,disID:p.data.disID,client:p.data.client,esOrganizador:p.data.esOrganizador}}catch(p){throw console.log("Error updating event:",p),p}},o=async g=>{try{const p=await bt.get(`${e}/api/Calendario/v1/local/ObtenerEvento/${g}`),b=p.data[0].solicitudRelacionada?.[0]?.nombreCliente||null;return{...p.data[0],fechaInicio:p.data[0].fechaInicio,fechaFin:p.data[0].fechaFin,client:b}}catch(p){throw console.error(`Error fetching event with ID ${g}:`,p),p}},s=async g=>{try{await bt.post(`${e}/api/Calendario/v1/local/EliminarEvento/${g}`)}catch(p){throw console.log(`Error ID ${g}:`,p),p}},i=v.useCallback(async(g,p,b,_)=>{try{const S={masNombreBD:b,usrID:_,disID:p,nombreCliente:g},C=(await bt.post(`${e}/api/Calendario/v1/local/ConsultaClientesXUsuariologgeado/`,S)).data?.data;return Array.isArray(C)?C.map(w=>({clienteID:w.clienteID,solID:w.solID,marca:w?.marca,modelo:w?.modelo,nombreCliente:w?.nombreCliente})):[]}catch(S){return console.error("Error clientes:",S),[]}},[e]),a=v.useCallback(async(g,p)=>{try{const b={disID:g,usrMail:p},S=(await bt.post(`${e}/api/Calendario/v1/Consulta_UsuariosInvitados/`,b)).data?.data;return Array.isArray(S)?S.map(D=>({usrID:D.usrID,usrNombre:D.usrNombre,usrMail:D?.usrMail,disID:D?.disID})):[]}catch(b){return console.error("Error usuarios:",b),[]}},[e]),c=async(g,p,b,_,S)=>{const D={tieneConflicto:!1,usrMail:""};try{const C={disID:g,usrMail:p,startDate:b,horaInicio:_,horaFin:S};return(await bt.post(`${e}/api/Calendario/v1/local/ConsultaConflictoInvitados`,C)).data?.data}catch(C){return console.error("Error al verificar conflicto:",C),D}},u=v.useCallback(async(g,p,b,_)=>{try{const S={disID:g,usrMail:p,startDate:b,DuracionEvento:_},C=(await bt.post(`${e}/api/Calendario/v1/local/ConsultaDisponibilidadUsuario`,S)).data?.data;return Array.isArray(C)?C.map(w=>({Fecha:w.fecha,HoraInicio:w.horaInicio,HoraFin:w.horaFin})):[]}catch(S){return console.error("Error usuarios:",S),[]}},[e]),d=v.useCallback(async(g,p=!1)=>{try{const b=await bt.post(`${e}/api/Notificaciones/v1/local/ObtenerNotificacionesPorUsuarioAsync/${g}?soloNoLeidas=${p}`);return console.log("response.data",b.data),b.data}catch(b){return console.error("Error usuarios:",b),[]}},[e]);return{getEventsByUser:r,createEvent:t,updateEvent:n,getEventById:o,deleteEvent:s,getClients:i,getUsuariosInvitados:a,VerificarConflicto:c,getDisponibilidadUsuario:u,getNotificacionesXUsuario:d,UpdateStatusEvento:async(g,p,b)=>{try{const _={EventoID:g,UsuarioID:p,status:b};return(await bt.post(`${e}/api/Calendario/v1/local/ActualizarEstadoInvitacionAsync/`,_)).data}catch(_){return console.error("Error Actualizar estatus:",_),{}}},MarcarLeido:async(g,p)=>{try{return(await bt.post(`${e}/api/Notificaciones/v1/local/MarcarComoLeidaAsync/${g}?usuarioId=${p}&marcarComoLeida=true`)).data?.data}catch(b){return console.error("Error Actualizar estatus:",b),{}}},ReenviarNotificacion:async(g,p)=>{try{const b=await bt.post(`${e}/api/Calendario/v1/local/ReenviarNotificacion/${p}/${g}`);return console.log("reenviar",b),b.data?.data}catch(b){return console.error("Error Actualizar estatus:",b),{}}}}};var To={},Af;function uw(){if(Af)return To;Af=1;var e=ct();Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var r=e(ht()),t=dt();return To.default=(0,r.default)([(0,t.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,t.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),To}var dw=uw();const ic=at(dw);var Mo=e=>e.type==="checkbox",mn=e=>e instanceof Date,Gt=e=>e==null;const Tf=e=>typeof e=="object";var jt=e=>!Gt(e)&&!Array.isArray(e)&&Tf(e)&&!mn(e),Mf=e=>jt(e)&&e.target?Mo(e.target)?e.target.checked:e.target.value:e,fw=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,If=(e,r)=>e.has(fw(r)),pw=e=>{const r=e.constructor&&e.constructor.prototype;return jt(r)&&r.hasOwnProperty("isPrototypeOf")},ac=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Bt(e){let r;const t=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(ac&&(e instanceof Blob||n))&&(t||jt(e)))if(r=t?[]:Object.create(Object.getPrototypeOf(e)),!t&&!pw(e))r=e;else for(const o in e)e.hasOwnProperty(o)&&(r[o]=Bt(e[o]));else return e;return r}var vi=e=>/^\w*$/.test(e),Pt=e=>e===void 0,cc=e=>Array.isArray(e)?e.filter(Boolean):[],lc=e=>cc(e.replace(/["|']|\]/g,"").split(/\.|\[/)),pe=(e,r,t)=>{if(!r||!jt(e))return t;const n=(vi(r)?[r]:lc(r)).reduce((o,s)=>Gt(o)?o:o[s],e);return Pt(n)||n===e?Pt(e[r])?t:e[r]:n},sr=e=>typeof e=="boolean",st=(e,r,t)=>{let n=-1;const o=vi(r)?[r]:lc(r),s=o.length,i=s-1;for(;++n<s;){const a=o[n];let c=t;if(n!==i){const u=e[a];c=jt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const yi={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Vr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},uc=v.createContext(null);uc.displayName="HookFormContext";const dc=()=>v.useContext(uc),hw=e=>{const{children:r,...t}=e;return v.createElement(uc.Provider,{value:t},r)};var Of=(e,r,t,n=!0)=>{const o={defaultValues:r._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return r._proxyFormState[i]!==xr.all&&(r._proxyFormState[i]=!n||xr.all),t&&(t[i]=!0),e[i]}});return o};const fc=typeof window<"u"?v.useLayoutEffect:v.useEffect;function mw(e){const r=dc(),{control:t=r.control,disabled:n,name:o,exact:s}=e||{},[i,a]=v.useState(t._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return fc(()=>t._subscribe({name:o,formState:c.current,exact:s,callback:u=>{!n&&a({...t._formState,...u})}}),[o,n,s]),v.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>Of(i,t,c.current,!1),[i,t])}var Nr=e=>typeof e=="string",jf=(e,r,t,n,o)=>Nr(e)?(n&&r.watch.add(e),pe(t,e,o)):Array.isArray(e)?e.map(s=>(n&&r.watch.add(s),pe(t,s))):(n&&(r.watchAll=!0),t),pc=e=>Gt(e)||!Tf(e);function Ur(e,r,t=new WeakSet){if(pc(e)||pc(r))return e===r;if(mn(e)&&mn(r))return e.getTime()===r.getTime();const n=Object.keys(e),o=Object.keys(r);if(n.length!==o.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const s of n){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=r[s];if(mn(i)&&mn(a)||jt(i)&&jt(a)||Array.isArray(i)&&Array.isArray(a)?!Ur(i,a,t):i!==a)return!1}}return!0}function Pf(e){const r=dc(),{control:t=r.control,name:n,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=v.useRef(o),u=v.useRef(a),d=v.useRef(void 0);u.current=a;const f=v.useMemo(()=>t._getWatch(n,c.current),[t,n]),[h,y]=v.useState(u.current?u.current(f):f);return fc(()=>t._subscribe({name:n,formState:{values:!0},exact:i,callback:g=>{if(!s){const p=jf(n,t._names,g.values||t._formValues,!1,c.current);if(u.current){const b=u.current(p);Ur(b,d.current)||(y(b),d.current=b)}else y(p)}}}),[t,s,n,i]),v.useEffect(()=>t._removeUnmounted()),h}function gw(e){const r=dc(),{name:t,disabled:n,control:o=r.control,shouldUnregister:s,defaultValue:i}=e,a=If(o._names.array,t),c=v.useMemo(()=>pe(o._formValues,t,pe(o._defaultValues,t,i)),[o,t,i]),u=Pf({control:o,name:t,defaultValue:c,exact:!0}),d=mw({control:o,name:t,exact:!0}),f=v.useRef(e),h=v.useRef(o.register(t,{...e.rules,value:u,...sr(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const y=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!pe(d.errors,t)},isDirty:{enumerable:!0,get:()=>!!pe(d.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!pe(d.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!pe(d.validatingFields,t)},error:{enumerable:!0,get:()=>pe(d.errors,t)}}),[d,t]),g=v.useCallback(S=>h.current.onChange({target:{value:Mf(S),name:t},type:yi.CHANGE}),[t]),p=v.useCallback(()=>h.current.onBlur({target:{value:pe(o._formValues,t),name:t},type:yi.BLUR}),[t,o._formValues]),b=v.useCallback(S=>{const D=pe(o._fields,t);D&&S&&(D._f.ref={focus:()=>S.focus&&S.focus(),select:()=>S.select&&S.select(),setCustomValidity:C=>S.setCustomValidity(C),reportValidity:()=>S.reportValidity()})},[o._fields,t]),_=v.useMemo(()=>({name:t,value:u,...sr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:g,onBlur:p,ref:b}),[t,n,d.disabled,g,p,b,u]);return v.useEffect(()=>{const S=o._options.shouldUnregister||s;o.register(t,{...f.current.rules,...sr(f.current.disabled)?{disabled:f.current.disabled}:{}});const D=(C,w)=>{const F=pe(o._fields,C);F&&F._f&&(F._f.mount=w)};if(D(t,!0),S){const C=Bt(pe(o._options.defaultValues,t));st(o._defaultValues,t,C),Pt(pe(o._formValues,t))&&st(o._formValues,t,C)}return!a&&o.register(t),()=>{(a?S&&!o._state.action:S)?o.unregister(t):D(t,!1)}},[t,o,a,s]),v.useEffect(()=>{o._setDisabledField({disabled:n,name:t})},[n,t,o]),v.useMemo(()=>({field:_,formState:d,fieldState:y}),[_,d,y])}const ir=e=>e.render(gw(e));var hc=(e,r,t,n,o)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[n]:o||!0}}:{},Io=e=>Array.isArray(e)?e:[e],Rf=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},Jt=e=>jt(e)&&!Object.keys(e).length,mc=e=>e.type==="file",wr=e=>typeof e=="function",bi=e=>{if(!ac)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Nf=e=>e.type==="select-multiple",gc=e=>e.type==="radio",vw=e=>gc(e)||Mo(e),vc=e=>bi(e)&&e.isConnected;function yw(e,r){const t=r.slice(0,-1).length;let n=0;for(;n<t;)e=Pt(e)?n++:e[r[n++]];return e}function bw(e){for(const r in e)if(e.hasOwnProperty(r)&&!Pt(e[r]))return!1;return!0}function zt(e,r){const t=Array.isArray(r)?r:vi(r)?[r]:lc(r),n=t.length===1?e:yw(e,t),o=t.length-1,s=t[o];return n&&delete n[s],o!==0&&(jt(n)&&Jt(n)||Array.isArray(n)&&bw(n))&&zt(e,t.slice(0,-1)),e}var $f=e=>{for(const r in e)if(wr(e[r]))return!0;return!1};function xi(e,r={}){const t=Array.isArray(e);if(jt(e)||t)for(const n in e)Array.isArray(e[n])||jt(e[n])&&!$f(e[n])?(r[n]=Array.isArray(e[n])?[]:{},xi(e[n],r[n])):Gt(e[n])||(r[n]=!0);return r}function Lf(e,r,t){const n=Array.isArray(e);if(jt(e)||n)for(const o in e)Array.isArray(e[o])||jt(e[o])&&!$f(e[o])?Pt(r)||pc(t[o])?t[o]=Array.isArray(e[o])?xi(e[o],[]):{...xi(e[o])}:Lf(e[o],Gt(r)?{}:r[o],t[o]):t[o]=!Ur(e[o],r[o]);return t}var Oo=(e,r)=>Lf(e,r,xi(r));const zf={value:!1,isValid:!1},Bf={value:!0,isValid:!0};var Ff=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Pt(e[0].attributes.value)?Pt(e[0].value)||e[0].value===""?Bf:{value:e[0].value,isValid:!0}:Bf:zf}return zf},Vf=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:n})=>Pt(e)?e:r?e===""?NaN:e&&+e:t&&Nr(e)?new Date(e):n?n(e):e;const Uf={isValid:!1,value:null};var Wf=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Uf):Uf;function Hf(e){const r=e.ref;return mc(r)?r.files:gc(r)?Wf(e.refs).value:Nf(r)?[...r.selectedOptions].map(({value:t})=>t):Mo(r)?Ff(e.refs).value:Vf(Pt(r.value)?e.ref.value:r.value,e)}var xw=(e,r,t,n)=>{const o={};for(const s of e){const i=pe(r,s);i&&st(o,s,i._f)}return{criteriaMode:t,names:[...e],fields:o,shouldUseNativeValidation:n}},wi=e=>e instanceof RegExp,jo=e=>Pt(e)?e:wi(e)?e.source:jt(e)?wi(e.value)?e.value.source:e.value:e,Yf=e=>({isOnSubmit:!e||e===xr.onSubmit,isOnBlur:e===xr.onBlur,isOnChange:e===xr.onChange,isOnAll:e===xr.all,isOnTouch:e===xr.onTouched});const qf="AsyncFunction";var ww=e=>!!e&&!!e.validate&&!!(wr(e.validate)&&e.validate.constructor.name===qf||jt(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===qf)),_w=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Zf=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Po=(e,r,t,n)=>{for(const o of t||Object.keys(e)){const s=pe(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&r(i.refs[0],o)&&!n)return!0;if(i.ref&&r(i.ref,i.name)&&!n)return!0;if(Po(a,r))break}else if(jt(a)&&Po(a,r))break}}};function Gf(e,r,t){const n=pe(e,t);if(n||vi(t))return{error:n,name:t};const o=t.split(".");for(;o.length;){const s=o.join("."),i=pe(r,s),a=pe(e,s);if(i&&!Array.isArray(i)&&t!==s)return{name:t};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:t}}var Sw=(e,r,t,n)=>{t(e);const{name:o,...s}=e;return Jt(s)||Object.keys(s).length>=Object.keys(r).length||Object.keys(s).find(i=>r[i]===(!n||xr.all))},Cw=(e,r,t)=>!e||!r||e===r||Io(e).some(n=>n&&(t?n===r:n.startsWith(r)||r.startsWith(n))),Ew=(e,r,t,n,o)=>o.isOnAll?!1:!t&&o.isOnTouch?!(r||e):(t?n.isOnBlur:o.isOnBlur)?!e:(t?n.isOnChange:o.isOnChange)?e:!0,Dw=(e,r)=>!cc(pe(e,r)).length&&zt(e,r),kw=(e,r,t)=>{const n=Io(pe(e,t));return st(n,"root",r[t]),st(e,t,n),e},_i=e=>Nr(e);function Kf(e,r,t="validate"){if(_i(e)||Array.isArray(e)&&e.every(_i)||sr(e)&&!e)return{type:t,message:_i(e)?e:"",ref:r}}var $n=e=>jt(e)&&!wi(e)?e:{value:e,message:""},Qf=async(e,r,t,n,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:y,validate:g,name:p,valueAsNumber:b,mount:_}=e._f,S=pe(t,p);if(!_||r.has(p))return{};const D=a?a[0]:i,C=q=>{o&&D.reportValidity&&(D.setCustomValidity(sr(q)?"":q||""),D.reportValidity())},w={},F=gc(i),E=Mo(i),T=F||E,I=(b||mc(i))&&Pt(i.value)&&Pt(S)||bi(i)&&i.value===""||S===""||Array.isArray(S)&&!S.length,M=hc.bind(null,p,n,w),U=(q,V,H,re=Vr.maxLength,W=Vr.minLength)=>{const $=q?V:H;w[p]={type:q?re:W,message:$,ref:i,...M(q?re:W,$)}};if(s?!Array.isArray(S)||!S.length:c&&(!T&&(I||Gt(S))||sr(S)&&!S||E&&!Ff(a).isValid||F&&!Wf(a).isValid)){const{value:q,message:V}=_i(c)?{value:!!c,message:c}:$n(c);if(q&&(w[p]={type:Vr.required,message:V,ref:D,...M(Vr.required,V)},!n))return C(V),w}if(!I&&(!Gt(f)||!Gt(h))){let q,V;const H=$n(h),re=$n(f);if(!Gt(S)&&!isNaN(S)){const W=i.valueAsNumber||S&&+S;Gt(H.value)||(q=W>H.value),Gt(re.value)||(V=W<re.value)}else{const W=i.valueAsDate||new Date(S),$=N=>new Date(new Date().toDateString()+" "+N),ie=i.type=="time",ue=i.type=="week";Nr(H.value)&&S&&(q=ie?$(S)>$(H.value):ue?S>H.value:W>new Date(H.value)),Nr(re.value)&&S&&(V=ie?$(S)<$(re.value):ue?S<re.value:W<new Date(re.value))}if((q||V)&&(U(!!q,H.message,re.message,Vr.max,Vr.min),!n))return C(w[p].message),w}if((u||d)&&!I&&(Nr(S)||s&&Array.isArray(S))){const q=$n(u),V=$n(d),H=!Gt(q.value)&&S.length>+q.value,re=!Gt(V.value)&&S.length<+V.value;if((H||re)&&(U(H,q.message,V.message),!n))return C(w[p].message),w}if(y&&!I&&Nr(S)){const{value:q,message:V}=$n(y);if(wi(q)&&!S.match(q)&&(w[p]={type:Vr.pattern,message:V,ref:i,...M(Vr.pattern,V)},!n))return C(V),w}if(g){if(wr(g)){const q=await g(S,t),V=Kf(q,D);if(V&&(w[p]={...V,...M(Vr.validate,V.message)},!n))return C(V.message),w}else if(jt(g)){let q={};for(const V in g){if(!Jt(q)&&!n)break;const H=Kf(await g[V](S,t),D,V);H&&(q={...H,...M(V,H.message)},C(H.message),n&&(w[p]=q))}if(!Jt(q)&&(w[p]={ref:D,...q},!n))return w}}return C(!0),w};const Aw={mode:xr.onSubmit,reValidateMode:xr.onChange,shouldFocusError:!0};function Tw(e={}){let r={...Aw,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:wr(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},n={},o=jt(r.defaultValues)||jt(r.values)?Bt(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:Bt(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:Rf(),state:Rf()},y=r.criteriaMode===xr.all,g=k=>O=>{clearTimeout(u),u=setTimeout(k,O)},p=async k=>{if(!r.disabled&&(d.isValid||f.isValid||k)){const O=r.resolver?Jt((await E()).errors):await I(n,!0);O!==t.isValid&&h.state.next({isValid:O})}},b=(k,O)=>{!r.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((k||Array.from(a.mount)).forEach(B=>{B&&(O?st(t.validatingFields,B,O):zt(t.validatingFields,B))}),h.state.next({validatingFields:t.validatingFields,isValidating:!Jt(t.validatingFields)}))},_=(k,O=[],B,ce,se=!0,j=!0)=>{if(ce&&B&&!r.disabled){if(i.action=!0,j&&Array.isArray(pe(n,k))){const oe=B(pe(n,k),ce.argA,ce.argB);se&&st(n,k,oe)}if(j&&Array.isArray(pe(t.errors,k))){const oe=B(pe(t.errors,k),ce.argA,ce.argB);se&&st(t.errors,k,oe),Dw(t.errors,k)}if((d.touchedFields||f.touchedFields)&&j&&Array.isArray(pe(t.touchedFields,k))){const oe=B(pe(t.touchedFields,k),ce.argA,ce.argB);se&&st(t.touchedFields,k,oe)}(d.dirtyFields||f.dirtyFields)&&(t.dirtyFields=Oo(o,s)),h.state.next({name:k,isDirty:U(k,O),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else st(s,k,O)},S=(k,O)=>{st(t.errors,k,O),h.state.next({errors:t.errors})},D=k=>{t.errors=k,h.state.next({errors:t.errors,isValid:!1})},C=(k,O,B,ce)=>{const se=pe(n,k);if(se){const j=pe(s,k,Pt(B)?pe(o,k):B);Pt(j)||ce&&ce.defaultChecked||O?st(s,k,O?j:Hf(se._f)):H(k,j),i.mount&&p()}},w=(k,O,B,ce,se)=>{let j=!1,oe=!1;const Se={name:k};if(!r.disabled){if(!B||ce){(d.isDirty||f.isDirty)&&(oe=t.isDirty,t.isDirty=Se.isDirty=U(),j=oe!==Se.isDirty);const je=Ur(pe(o,k),O);oe=!!pe(t.dirtyFields,k),je?zt(t.dirtyFields,k):st(t.dirtyFields,k,!0),Se.dirtyFields=t.dirtyFields,j=j||(d.dirtyFields||f.dirtyFields)&&oe!==!je}if(B){const je=pe(t.touchedFields,k);je||(st(t.touchedFields,k,B),Se.touchedFields=t.touchedFields,j=j||(d.touchedFields||f.touchedFields)&&je!==B)}j&&se&&h.state.next(Se)}return j?Se:{}},F=(k,O,B,ce)=>{const se=pe(t.errors,k),j=(d.isValid||f.isValid)&&sr(O)&&t.isValid!==O;if(r.delayError&&B?(c=g(()=>S(k,B)),c(r.delayError)):(clearTimeout(u),c=null,B?st(t.errors,k,B):zt(t.errors,k)),(B?!Ur(se,B):se)||!Jt(ce)||j){const oe={...ce,...j&&sr(O)?{isValid:O}:{},errors:t.errors,name:k};t={...t,...oe},h.state.next(oe)}},E=async k=>{b(k,!0);const O=await r.resolver(s,r.context,xw(k||a.mount,n,r.criteriaMode,r.shouldUseNativeValidation));return b(k),O},T=async k=>{const{errors:O}=await E(k);if(k)for(const B of k){const ce=pe(O,B);ce?st(t.errors,B,ce):zt(t.errors,B)}else t.errors=O;return O},I=async(k,O,B={valid:!0})=>{for(const ce in k){const se=k[ce];if(se){const{_f:j,...oe}=se;if(j){const Se=a.array.has(j.name),je=se._f&&ww(se._f);je&&d.validatingFields&&b([ce],!0);const R=await Qf(se,a.disabled,s,y,r.shouldUseNativeValidation&&!O,Se);if(je&&d.validatingFields&&b([ce]),R[j.name]&&(B.valid=!1,O))break;!O&&(pe(R,j.name)?Se?kw(t.errors,R,j.name):st(t.errors,j.name,R[j.name]):zt(t.errors,j.name))}!Jt(oe)&&await I(oe,O,B)}}return B.valid},M=()=>{for(const k of a.unMount){const O=pe(n,k);O&&(O._f.refs?O._f.refs.every(B=>!vc(B)):!vc(O._f.ref))&&X(k)}a.unMount=new Set},U=(k,O)=>!r.disabled&&(k&&O&&st(s,k,O),!Ur(N(),o)),q=(k,O,B)=>jf(k,a,{...i.mount?s:Pt(O)?o:Nr(k)?{[k]:O}:O},B,O),V=k=>cc(pe(i.mount?s:o,k,r.shouldUnregister?pe(o,k,[]):[])),H=(k,O,B={})=>{const ce=pe(n,k);let se=O;if(ce){const j=ce._f;j&&(!j.disabled&&st(s,k,Vf(O,j)),se=bi(j.ref)&&Gt(O)?"":O,Nf(j.ref)?[...j.ref.options].forEach(oe=>oe.selected=se.includes(oe.value)):j.refs?Mo(j.ref)?j.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(se)?oe.checked=!!se.find(Se=>Se===oe.value):oe.checked=se===oe.value||!!se)}):j.refs.forEach(oe=>oe.checked=oe.value===se):mc(j.ref)?j.ref.value="":(j.ref.value=se,j.ref.type||h.state.next({name:k,values:Bt(s)})))}(B.shouldDirty||B.shouldTouch)&&w(k,se,B.shouldTouch,B.shouldDirty,!0),B.shouldValidate&&ue(k)},re=(k,O,B)=>{for(const ce in O){if(!O.hasOwnProperty(ce))return;const se=O[ce],j=k+"."+ce,oe=pe(n,j);(a.array.has(k)||jt(se)||oe&&!oe._f)&&!mn(se)?re(j,se,B):H(j,se,B)}},W=(k,O,B={})=>{const ce=pe(n,k),se=a.array.has(k),j=Bt(O);st(s,k,j),se?(h.array.next({name:k,values:Bt(s)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&B.shouldDirty&&h.state.next({name:k,dirtyFields:Oo(o,s),isDirty:U(k,j)})):ce&&!ce._f&&!Gt(j)?re(k,j,B):H(k,j,B),Zf(k,a)&&h.state.next({...t,name:k}),h.state.next({name:i.mount?k:void 0,values:Bt(s)})},$=async k=>{i.mount=!0;const O=k.target;let B=O.name,ce=!0;const se=pe(n,B),j=je=>{ce=Number.isNaN(je)||mn(je)&&isNaN(je.getTime())||Ur(je,pe(s,B,je))},oe=Yf(r.mode),Se=Yf(r.reValidateMode);if(se){let je,R;const te=O.type?Hf(se._f):Mf(k),be=k.type===yi.BLUR||k.type===yi.FOCUS_OUT,qe=!_w(se._f)&&!r.resolver&&!pe(t.errors,B)&&!se._f.deps||Ew(be,pe(t.touchedFields,B),t.isSubmitted,Se,oe),Ct=Zf(B,a,be);st(s,B,te),be?(!O||!O.readOnly)&&(se._f.onBlur&&se._f.onBlur(k),c&&c(0)):se._f.onChange&&se._f.onChange(k);const Z=w(B,te,be),de=!Jt(Z)||Ct;if(!be&&h.state.next({name:B,type:k.type,values:Bt(s)}),qe)return(d.isValid||f.isValid)&&(r.mode==="onBlur"?be&&p():be||p()),de&&h.state.next({name:B,...Ct?{}:Z});if(!be&&Ct&&h.state.next({...t}),r.resolver){const{errors:De}=await E([B]);if(j(te),ce){const Me=Gf(t.errors,n,B),Pe=Gf(De,n,Me.name||B);je=Pe.error,B=Pe.name,R=Jt(De)}}else b([B],!0),je=(await Qf(se,a.disabled,s,y,r.shouldUseNativeValidation))[B],b([B]),j(te),ce&&(je?R=!1:(d.isValid||f.isValid)&&(R=await I(n,!0)));ce&&(se._f.deps&&ue(se._f.deps),F(B,R,je,Z))}},ie=(k,O)=>{if(pe(t.errors,O)&&k.focus)return k.focus(),1},ue=async(k,O={})=>{let B,ce;const se=Io(k);if(r.resolver){const j=await T(Pt(k)?k:se);B=Jt(j),ce=k?!se.some(oe=>pe(j,oe)):B}else k?(ce=(await Promise.all(se.map(async j=>{const oe=pe(n,j);return await I(oe&&oe._f?{[j]:oe}:oe)}))).every(Boolean),!(!ce&&!t.isValid)&&p()):ce=B=await I(n);return h.state.next({...!Nr(k)||(d.isValid||f.isValid)&&B!==t.isValid?{}:{name:k},...r.resolver||!k?{isValid:B}:{},errors:t.errors}),O.shouldFocus&&!ce&&Po(n,ie,k?se:a.mount),ce},N=k=>{const O={...i.mount?s:o};return Pt(k)?O:Nr(k)?pe(O,k):k.map(B=>pe(O,B))},ee=(k,O)=>({invalid:!!pe((O||t).errors,k),isDirty:!!pe((O||t).dirtyFields,k),error:pe((O||t).errors,k),isValidating:!!pe(t.validatingFields,k),isTouched:!!pe((O||t).touchedFields,k)}),xe=k=>{k&&Io(k).forEach(O=>zt(t.errors,O)),h.state.next({errors:k?t.errors:{}})},_e=(k,O,B)=>{const ce=(pe(n,k,{_f:{}})._f||{}).ref,se=pe(t.errors,k)||{},{ref:j,message:oe,type:Se,...je}=se;st(t.errors,k,{...je,...O,ref:ce}),h.state.next({name:k,errors:t.errors,isValid:!1}),B&&B.shouldFocus&&ce&&ce.focus&&ce.focus()},fe=(k,O)=>wr(k)?h.state.subscribe({next:B=>"values"in B&&k(q(void 0,O),B)}):q(k,O,!0),ae=k=>h.state.subscribe({next:O=>{Cw(k.name,O.name,k.exact)&&Sw(O,k.formState||d,We,k.reRenderRoot)&&k.callback({values:{...s},...t,...O,defaultValues:o})}}).unsubscribe,le=k=>(i.mount=!0,f={...f,...k.formState},ae({...k,formState:f})),X=(k,O={})=>{for(const B of k?Io(k):a.mount)a.mount.delete(B),a.array.delete(B),O.keepValue||(zt(n,B),zt(s,B)),!O.keepError&&zt(t.errors,B),!O.keepDirty&&zt(t.dirtyFields,B),!O.keepTouched&&zt(t.touchedFields,B),!O.keepIsValidating&&zt(t.validatingFields,B),!r.shouldUnregister&&!O.keepDefaultValue&&zt(o,B);h.state.next({values:Bt(s)}),h.state.next({...t,...O.keepDirty?{isDirty:U()}:{}}),!O.keepIsValid&&p()},we=({disabled:k,name:O})=>{(sr(k)&&i.mount||k||a.disabled.has(O))&&(k?a.disabled.add(O):a.disabled.delete(O))},ye=(k,O={})=>{let B=pe(n,k);const ce=sr(O.disabled)||sr(r.disabled);return st(n,k,{...B||{},_f:{...B&&B._f?B._f:{ref:{name:k}},name:k,mount:!0,...O}}),a.mount.add(k),B?we({disabled:sr(O.disabled)?O.disabled:r.disabled,name:k}):C(k,!0,O.value),{...ce?{disabled:O.disabled||r.disabled}:{},...r.progressive?{required:!!O.required,min:jo(O.min),max:jo(O.max),minLength:jo(O.minLength),maxLength:jo(O.maxLength),pattern:jo(O.pattern)}:{},name:k,onChange:$,onBlur:$,ref:se=>{if(se){ye(k,O),B=pe(n,k);const j=Pt(se.value)&&se.querySelectorAll&&se.querySelectorAll("input,select,textarea")[0]||se,oe=vw(j),Se=B._f.refs||[];if(oe?Se.find(je=>je===j):j===B._f.ref)return;st(n,k,{_f:{...B._f,...oe?{refs:[...Se.filter(vc),j,...Array.isArray(pe(o,k))?[{}]:[]],ref:{type:j.type,name:k}}:{ref:j}}}),C(k,!1,void 0,j)}else B=pe(n,k,{}),B._f&&(B._f.mount=!1),(r.shouldUnregister||O.shouldUnregister)&&!(If(a.array,k)&&i.action)&&a.unMount.add(k)}}},K=()=>r.shouldFocusError&&Po(n,ie,a.mount),Ie=k=>{sr(k)&&(h.state.next({disabled:k}),Po(n,(O,B)=>{const ce=pe(n,B);ce&&(O.disabled=ce._f.disabled||k,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(se=>{se.disabled=ce._f.disabled||k}))},0,!1))},P=(k,O)=>async B=>{let ce;B&&(B.preventDefault&&B.preventDefault(),B.persist&&B.persist());let se=Bt(s);if(h.state.next({isSubmitting:!0}),r.resolver){const{errors:j,values:oe}=await E();t.errors=j,se=Bt(oe)}else await I(n);if(a.disabled.size)for(const j of a.disabled)zt(se,j);if(zt(t.errors,"root"),Jt(t.errors)){h.state.next({errors:{}});try{await k(se,B)}catch(j){ce=j}}else O&&await O({...t.errors},B),K(),setTimeout(K);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jt(t.errors)&&!ce,submitCount:t.submitCount+1,errors:t.errors}),ce)throw ce},Be=(k,O={})=>{pe(n,k)&&(Pt(O.defaultValue)?W(k,Bt(pe(o,k))):(W(k,O.defaultValue),st(o,k,Bt(O.defaultValue))),O.keepTouched||zt(t.touchedFields,k),O.keepDirty||(zt(t.dirtyFields,k),t.isDirty=O.defaultValue?U(k,Bt(pe(o,k))):U()),O.keepError||(zt(t.errors,k),d.isValid&&p()),h.state.next({...t}))},Qe=(k,O={})=>{const B=k?Bt(k):o,ce=Bt(B),se=Jt(k),j=se?o:ce;if(O.keepDefaultValues||(o=B),!O.keepValues){if(O.keepDirtyValues){const oe=new Set([...a.mount,...Object.keys(Oo(o,s))]);for(const Se of Array.from(oe))pe(t.dirtyFields,Se)?st(j,Se,pe(s,Se)):W(Se,pe(j,Se))}else{if(ac&&Pt(k))for(const oe of a.mount){const Se=pe(n,oe);if(Se&&Se._f){const je=Array.isArray(Se._f.refs)?Se._f.refs[0]:Se._f.ref;if(bi(je)){const R=je.closest("form");if(R){R.reset();break}}}}if(O.keepFieldsRef)for(const oe of a.mount)W(oe,pe(j,oe));else n={}}s=r.shouldUnregister?O.keepDefaultValues?Bt(o):{}:Bt(j),h.array.next({values:{...j}}),h.state.next({values:{...j}})}a={mount:O.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!O.keepIsValid||!!O.keepDirtyValues,i.watch=!!r.shouldUnregister,h.state.next({submitCount:O.keepSubmitCount?t.submitCount:0,isDirty:se?!1:O.keepDirty?t.isDirty:!!(O.keepDefaultValues&&!Ur(k,o)),isSubmitted:O.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:se?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Oo(o,s):t.dirtyFields:O.keepDefaultValues&&k?Oo(o,k):O.keepDirty?t.dirtyFields:{},touchedFields:O.keepTouched?t.touchedFields:{},errors:O.keepErrors?t.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Fe=(k,O)=>Qe(wr(k)?k(s):k,O),Le=(k,O={})=>{const B=pe(n,k),ce=B&&B._f;if(ce){const se=ce.refs?ce.refs[0]:ce.ref;se.focus&&(se.focus(),O.shouldSelect&&wr(se.select)&&se.select())}},We=k=>{t={...t,...k}},ft={control:{register:ye,unregister:X,getFieldState:ee,handleSubmit:P,setError:_e,_subscribe:ae,_runSchema:E,_focusError:K,_getWatch:q,_getDirty:U,_setValid:p,_setFieldArray:_,_setDisabledField:we,_setErrors:D,_getFieldArray:V,_reset:Qe,_resetDefaultValues:()=>wr(r.defaultValues)&&r.defaultValues().then(k=>{Fe(k,r.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:M,_disableForm:Ie,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(k){i=k},get _defaultValues(){return o},get _names(){return a},set _names(k){a=k},get _formState(){return t},get _options(){return r},set _options(k){r={...r,...k}}},subscribe:le,trigger:ue,register:ye,handleSubmit:P,watch:fe,setValue:W,getValues:N,reset:Fe,resetField:Be,clearErrors:xe,unregister:X,setError:_e,setFocus:Le,getFieldState:ee};return{...ft,formControl:ft}}function Xf(e={}){const r=v.useRef(void 0),t=v.useRef(void 0),[n,o]=v.useState({isDirty:!1,isValidating:!1,isLoading:wr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:wr(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:n},e.defaultValues&&!wr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=Tw(e);r.current={...a,formState:n}}const s=r.current.control;return s._options=e,fc(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),v.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),v.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),v.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),v.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==n.isDirty&&s._subjects.state.next({isDirty:i})}},[s,n.isDirty]),v.useEffect(()=>{e.values&&!Ur(e.values,t.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),t.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[s,e.values]),v.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),r.current.formState=Of(n,s),r.current}const Jf=(e,r,t)=>{if(e&&"reportValidity"in e){const n=pe(t,r);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},yc=(e,r)=>{for(const t in r.fields){const n=r.fields[t];n&&n.ref&&"reportValidity"in n.ref?Jf(n.ref,t,e):n&&n.refs&&n.refs.forEach(o=>Jf(o,t,e))}},ep=(e,r)=>{r.shouldUseNativeValidation&&yc(e,r);const t={};for(const n in e){const o=pe(r.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(Mw(r.names||Object.keys(e),n)){const i=Object.assign({},pe(t,n));st(i,"root",s),st(t,n,i)}else st(t,n,s)}return t},Mw=(e,r)=>{const t=tp(r);return e.some(n=>tp(n).match(`^${t}\\.\\d+`))};function tp(e){return e.replace(/\]|\[/g,"")}function Y(e,r,t){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),r(a,c);for(const d in i.prototype)d in a||Object.defineProperty(a,d,{value:i.prototype[d].bind(a)});a._zod.constr=i,a._zod.def=c}const o=t?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=t?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>t?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Ln extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const np={};function gn(e){return np}function Iw(e){const r=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>r.indexOf(+n)===-1).map(([n,o])=>o)}function bc(e,r){return typeof r=="bigint"?r.toString():r}function xc(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function wc(e){return e==null}function _c(e){const r=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(r,t)}function Ow(e,r){const t=(e.toString().split(".")[1]||"").length,n=r.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=t>o?t:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(r.toFixed(s).replace(".",""));return i%a/10**s}const op=Symbol("evaluating");function mt(e,r,t){let n;Object.defineProperty(e,r,{get(){if(n!==op)return n===void 0&&(n=op,n=t()),n},set(o){Object.defineProperty(e,r,{value:o})},configurable:!0})}function jw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Jr(e,r,t){Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})}function zn(...e){const r={};for(const t of e){const n=Object.getOwnPropertyDescriptors(t);Object.assign(r,n)}return Object.defineProperties({},r)}function sp(e){return JSON.stringify(e)}const ip="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Si(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Pw=xc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ro(e){if(Si(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const t=r.prototype;return!(Si(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function ap(e){return Ro(e)?{...e}:e}const Rw=new Set(["string","number","symbol"]);function Bn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(e,r,t){const n=new e._zod.constr(r??e._zod.def);return(!r||t?.parent)&&(n._zod.parent=e),n}function Ae(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Nw(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const $w={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Lw(e,r){const t=e._zod.def,n=zn(e._zod.def,{get shape(){const o={};for(const s in r){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t.shape[s])}return Jr(this,"shape",o),o},checks:[]});return en(e,n)}function zw(e,r){const t=e._zod.def,n=zn(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in r){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete o[s]}return Jr(this,"shape",o),o},checks:[]});return en(e,n)}function Bw(e,r){if(!Ro(r))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=zn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r};return Jr(this,"shape",s),s},checks:[]});return en(e,o)}function Fw(e,r){if(!Ro(r))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const n={...e._zod.def.shape,...r};return Jr(this,"shape",n),n},checks:e._zod.def.checks};return en(e,t)}function Vw(e,r){const t=zn(e._zod.def,{get shape(){const n={...e._zod.def.shape,...r._zod.def.shape};return Jr(this,"shape",n),n},get catchall(){return r._zod.def.catchall},checks:[]});return en(e,t)}function Uw(e,r,t){const n=zn(r._zod.def,{get shape(){const o=r._zod.def.shape,s={...o};if(t)for(const i in t){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(const i in o)s[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Jr(this,"shape",s),s},checks:[]});return en(r,n)}function Ww(e,r,t){const n=zn(r._zod.def,{get shape(){const o=r._zod.def.shape,s={...o};if(t)for(const i in t){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Jr(this,"shape",s),s},checks:[]});return en(r,n)}function Fn(e,r=0){if(e.aborted===!0)return!0;for(let t=r;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function cp(e,r){return r.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ci(e){return typeof e=="string"?e:e?.message}function vn(e,r,t){const n={...e,path:e.path??[]};if(!e.message){const o=Ci(e.inst?._zod.def?.error?.(e))??Ci(r?.error?.(e))??Ci(t.customError?.(e))??Ci(t.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,r?.reportInput||delete n.input,n}function Sc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function No(...e){const[r,t,n]=e;return typeof r=="string"?{message:r,code:"custom",input:t,inst:n}:{...r}}const lp=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,bc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cc=Y("$ZodError",lp),Ei=Y("$ZodError",lp,{Parent:Error});function Hw(e,r=t=>t.message){const t={},n=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(r(o))):n.push(r(o));return{formErrors:n,fieldErrors:t}}function Yw(e,r){const t=r||function(s){return s.message},n={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let a=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}const Di=e=>(r,t,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=r._zod.run({value:t,issues:[]},s);if(i instanceof Promise)throw new Ln;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vn(c,s,gn())));throw ip(a,o?.callee),a}return i.value},qw=Di(Ei),ki=e=>async(r,t,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=r._zod.run({value:t,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vn(c,s,gn())));throw ip(a,o?.callee),a}return i.value},Zw=ki(Ei),Ai=e=>(r,t,n)=>{const o=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new Ln;return s.issues.length?{success:!1,error:new(e??Cc)(s.issues.map(i=>vn(i,o,gn())))}:{success:!0,data:s.value}},Gw=Ai(Ei),Ti=e=>async(r,t,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=r._zod.run({value:t,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>vn(i,o,gn())))}:{success:!0,data:s.value}},Kw=Ti(Ei),Qw=e=>(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Di(e)(r,t,o)},Xw=e=>(r,t,n)=>Di(e)(r,t,n),Jw=e=>async(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ki(e)(r,t,o)},e_=e=>async(r,t,n)=>ki(e)(r,t,n),t_=e=>(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ai(e)(r,t,o)},r_=e=>(r,t,n)=>Ai(e)(r,t,n),n_=e=>async(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ti(e)(r,t,o)},o_=e=>async(r,t,n)=>Ti(e)(r,t,n),s_=/^[cC][^\s-]{8,}$/,i_=/^[0-9a-z]+$/,a_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,c_=/^[0-9a-vA-V]{20}$/,l_=/^[A-Za-z0-9]{27}$/,u_=/^[a-zA-Z0-9_-]{21}$/,d_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,f_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,up=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,p_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,h_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function m_(){return new RegExp(h_,"u")}const g_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,y_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,b_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,x_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dp=/^[A-Za-z0-9_-]*$/,w_=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,__=/^\+(?:[0-9]){6,14}[0-9]$/,fp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",S_=new RegExp(`^${fp}$`);function pp(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C_(e){return new RegExp(`^${pp(e)}$`)}function E_(e){const r=pp({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${r}(?:${t.join("|")})`;return new RegExp(`^${fp}T(?:${n})$`)}const D_=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},k_=/^\d+$/,A_=/^-?\d+(?:\.\d+)?/i,T_=/true|false/i,M_=/^[^A-Z]*$/,I_=/^[^a-z]*$/,er=Y("$ZodCheck",(e,r)=>{var t;e._zod??(e._zod={}),e._zod.def=r,(t=e._zod).onattach??(t.onattach=[])}),hp={number:"number",bigint:"bigint",object:"date"},mp=Y("$ZodCheckLessThan",(e,r)=>{er.init(e,r);const t=hp[typeof r.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(r.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<s&&(r.inclusive?o.maximum=r.value:o.exclusiveMaximum=r.value)}),e._zod.check=n=>{(r.inclusive?n.value<=r.value:n.value<r.value)||n.issues.push({origin:t,code:"too_big",maximum:r.value,input:n.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),gp=Y("$ZodCheckGreaterThan",(e,r)=>{er.init(e,r);const t=hp[typeof r.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(r.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>s&&(r.inclusive?o.minimum=r.value:o.exclusiveMinimum=r.value)}),e._zod.check=n=>{(r.inclusive?n.value>=r.value:n.value>r.value)||n.issues.push({origin:t,code:"too_small",minimum:r.value,input:n.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),O_=Y("$ZodCheckMultipleOf",(e,r)=>{er.init(e,r),e._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=r.value)}),e._zod.check=t=>{if(typeof t.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%r.value===BigInt(0):Ow(t.value,r.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:r.value,input:t.value,inst:e,continue:!r.abort})}}),j_=Y("$ZodCheckNumberFormat",(e,r)=>{er.init(e,r),r.format=r.format||"float64";const t=r.format?.includes("int"),n=t?"int":"number",[o,s]=$w[r.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=r.format,a.minimum=o,a.maximum=s,t&&(a.pattern=k_)}),e._zod.check=i=>{const a=i.value;if(t){if(!Number.isInteger(a)){i.issues.push({expected:n,format:r.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!r.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!r.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!r.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),P_=Y("$ZodCheckMaxLength",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<o&&(n._zod.bag.maximum=r.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=r.maximum)return;const i=Sc(o);n.issues.push({origin:i,code:"too_big",maximum:r.maximum,inclusive:!0,input:o,inst:e,continue:!r.abort})}}),R_=Y("$ZodCheckMinLength",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>o&&(n._zod.bag.minimum=r.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=r.minimum)return;const i=Sc(o);n.issues.push({origin:i,code:"too_small",minimum:r.minimum,inclusive:!0,input:o,inst:e,continue:!r.abort})}}),N_=Y("$ZodCheckLengthEquals",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=r.length,o.maximum=r.length,o.length=r.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===r.length)return;const i=Sc(o),a=s>r.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!r.abort})}}),Mi=Y("$ZodCheckStringFormat",(e,r)=>{var t,n;er.init(e,r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=r.format,r.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(r.pattern))}),r.pattern?(t=e._zod).check??(t.check=o=>{r.pattern.lastIndex=0,!r.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:r.format,input:o.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(n=e._zod).check??(n.check=()=>{})}),$_=Y("$ZodCheckRegex",(e,r)=>{Mi.init(e,r),e._zod.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),L_=Y("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=M_),Mi.init(e,r)}),z_=Y("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=I_),Mi.init(e,r)}),B_=Y("$ZodCheckIncludes",(e,r)=>{er.init(e,r);const t=Bn(r.includes),n=new RegExp(typeof r.position=="number"?`^.{${r.position}}${t}`:t);r.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(r.includes,r.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:o.value,inst:e,continue:!r.abort})}}),F_=Y("$ZodCheckStartsWith",(e,r)=>{er.init(e,r);const t=new RegExp(`^${Bn(r.prefix)}.*`);r.pattern??(r.pattern=t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=n=>{n.value.startsWith(r.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:n.value,inst:e,continue:!r.abort})}}),V_=Y("$ZodCheckEndsWith",(e,r)=>{er.init(e,r);const t=new RegExp(`.*${Bn(r.suffix)}$`);r.pattern??(r.pattern=t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=n=>{n.value.endsWith(r.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:n.value,inst:e,continue:!r.abort})}}),U_=Y("$ZodCheckOverwrite",(e,r)=>{er.init(e,r),e._zod.check=t=>{t.value=r.tx(t.value)}});class W_{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const n=r.split(`
|
|
160
|
+
`+s):n.stack=s}catch{}}throw n}}_request(r,t){typeof r=="string"?(t=t||{},t.url=r):t=r||{},t=fn(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:s}=t;n!==void 0&&hi.assertOptions(n,{silentJSONParsing:Pr.transitional(Pr.boolean),forcedJSONParsing:Pr.transitional(Pr.boolean),clarifyTimeoutError:Pr.transitional(Pr.boolean)},!1),o!=null&&(z.isFunction(o)?t.paramsSerializer={serialize:o}:hi.assertOptions(o,{encode:Pr.function,serialize:Pr.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),hi.assertOptions(t,{baseUrl:Pr.spelling("baseURL"),withXsrfToken:Pr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&z.merge(s.common,s[t.method]);s&&z.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),t.headers=Xt.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,f=0,h;if(!c){const g=[ff.bind(this),void 0];for(g.unshift(...a),g.push(...u),h=g.length,d=Promise.resolve(t);f<h;)d=d.then(g[f++],g[f++]);return d}h=a.length;let y=t;for(f=0;f<h;){const g=a[f++],p=a[f++];try{y=g(y)}catch(b){p.call(this,b);break}}try{d=ff.call(this,y)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(r){r=fn(this.defaults,r);const t=rf(r.baseURL,r.url,r.allowAbsoluteUrls);return qd(t,r.params,r.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(r){pn.prototype[r]=function(t,n){return this.request(fn(n||{},{method:r,url:t,data:(n||{}).data}))}}),z.forEach(["post","put","patch"],function(r){function t(n){return function(s,i,a){return this.request(fn(a||{},{method:r,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}pn.prototype[r]=t(),pn.prototype[r+"Form"]=t(!0)});let ex=class Rh{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{n.subscribe(a),s=a}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},r(function(s,i,a){n.reason||(n.reason=new Nn(s,i,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const t=this._listeners.indexOf(r);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const r=new AbortController,t=n=>{r.abort(n)};return this.subscribe(t),r.signal.unsubscribe=()=>this.unsubscribe(t),r.signal}static source(){let r;return{token:new Rh(function(o){r=o}),cancel:r}}};function tx(e){return function(t){return e.apply(null,t)}}function rx(e){return z.isObject(e)&&e.isAxiosError===!0}const tc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tc).forEach(([e,r])=>{tc[r]=e});function mf(e){const r=new pn(e),t=Od(pn.prototype.request,r);return z.extend(t,pn.prototype,r,{allOwnKeys:!0}),z.extend(t,r,null,{allOwnKeys:!0}),t.create=function(o){return mf(fn(e,o))},t}const Ot=mf(wo);Ot.Axios=pn,Ot.CanceledError=Nn,Ot.CancelToken=ex,Ot.isCancel=Xd,Ot.VERSION=pf,Ot.toFormData=ci,Ot.AxiosError=Ne,Ot.Cancel=Ot.CanceledError,Ot.all=function(r){return Promise.all(r)},Ot.spread=tx,Ot.isAxiosError=rx,Ot.mergeConfig=fn,Ot.AxiosHeaders=Xt,Ot.formToJSON=e=>Kd(z.isHTMLForm(e)?new FormData(e):e),Ot.getAdapter=df.getAdapter,Ot.HttpStatusCode=tc,Ot.default=Ot;const{Axios:PA,AxiosError:RA,CanceledError:NA,isCancel:$A,CancelToken:LA,VERSION:zA,all:BA,Cancel:FA,isAxiosError:VA,spread:UA,toFormData:WA,AxiosHeaders:HA,HttpStatusCode:YA,formToJSON:qA,getAdapter:ZA,mergeConfig:GA}=Ot,gf={token:null},nx=e=>{gf.token=e},bt=Ot.create({headers:{"Content-Type":"application/json"}});bt.interceptors.request.use(e=>{const r=gf.token;return r&&(e.headers.Authorization=`Bearer ${r}`),e},e=>Promise.reject(e));const vf=v.createContext(void 0),ox=({config:e,children:r})=>(v.useEffect(()=>{e.getToken&&nx(e.getToken)},[e.getToken]),l.jsx(vf.Provider,{value:e,children:r})),rc=()=>{const e=v.useContext(vf);if(!e)throw new Error("useApiConfig debe ser usado dentro de un ApiProvider");return e},mi=()=>{const{calendarApiUrl:e}=rc();return{getGoogleAuthUrl:async()=>{try{const i=`${e}/api/Calendario/v1/auth-url-Google`;return(await bt.get(i)).data}catch(i){throw console.error("Error al obtener la URL de Google Auth:",i),i}},saveGoogleCredentials:async i=>{try{const a=new URLSearchParams({code:i.code,disID:String(i.disID),usrID:String(i.usrID)}).toString(),c=`${e}/api/Calendario/v1/google-auth/SaveCredential?${a}`;return(await bt.post(c,{})).data}catch(a){throw console.error("Error al guardar credenciales de Google:",a),a}},getGoogleCalendars:async(i,a)=>{try{return(await bt.get(`${e}/api/Calendario/v1/google/ObtenerTiposCalendariosGoogleAsync?usrMail=${encodeURIComponent(i)}&disID=${a}`)).data}catch(c){throw console.error("Error al obtener los calendarios de Google:",c),c}},syncGoogleEvents:async(i,a,c)=>{try{return(await bt.post(`${e}/api/Calendario/v1/google/SincronizarEnviarEventosAsync?usrMail=${encodeURIComponent(i)}&disID=${a}&UsuarioID=${c}`)).data}catch(u){throw console.error("Error al sincronizar eventos con Google Calendar:",u),u}},getGoogleEventsByMonth:async i=>{try{return(await bt.post(`${e}/api/Calendario/v1/google/ObtenerEventosGoogleAsyncXMes`,i)).data}catch(a){throw console.error("Error al obtener eventos de Google Calendar por mes:",a),a}}}},yf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAASFBMVEVChfRHcExDhOAWaNUZfjjkTDf////6/P7b6fu61fj7wCj7vASZv/VuoPBQjvVCr19GifE0qFM4gerrRjMubcQQaucZZ9MYgTpc4mWWAAAABnRSTlP/AFtbW/eMEQaPAAAAfUlEQVR42q3Pyw4CIQyFYVDbigKOl6Pv/6a2ZBYN08TEzL9gcb6waDqkubd1TEsEWkp7Q3e9RuvOrsvV+g0Fi+jaZIKC0sECzMDCDK51C9zR9A2gPhCC6HgOoIFL/KMD1cMfl39GNxc9NVrh7jKgHAPlCGwPgSgbnDYw9vwFKv0VRfpGYZ8AAAAASUVORK5CYII=",sx=({disID:e,usrID:r})=>{const[t,n]=v.useState(null),o=mi(),s=async()=>{localStorage.setItem("temp_auth_disID",String(e)),localStorage.setItem("temp_auth_usrID",String(r)),n(null);try{const{url:i}=await o.getGoogleAuthUrl();window.location.href=i}catch(i){n(i.message||"Fallo al iniciar sesión con Google."),localStorage.removeItem("temp_auth_disID"),localStorage.removeItem("temp_auth_usrID")}finally{}};return l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:ve.syncButton,onClick:s,children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.uncheckedCircle})}),l.jsx("img",{src:yf,width:18}),l.jsx("span",{children:"Google Calendar"})]}),t&&l.jsx("p",{className:"text-red-500 mt-2",children:t})]})},nc=()=>{const{calendarApiUrl:e}=rc();return{getOutlookAuthUrl:async()=>{try{const i=`${e}/api/Calendario/v1/auth-url-Outlook`,a=await bt.get(i);return console.log("api",a),a.data}catch(i){throw console.error("Error al obtener la URL de Outlook Auth:",i),i}},saveOutlookCredentials:async i=>{try{const a=new URLSearchParams({code:i.code,disID:String(i.disID),usrID:String(i.usrID)}).toString(),c=`${e}/api/Calendario/v1/outlook-auth/SaveCredential?${a}`;return(await bt.post(c,{})).data}catch(a){throw console.error("Error al guardar credenciales Outlook:",a),a}},syncOutlookEvents:async(i,a,c)=>{try{return(await bt.post(`${e}/api/Calendario/v1/outlook/SincronizarEnviarEventosAsync?usrMail=${encodeURIComponent(i)}&disID=${a}&UsuarioID=${c}`)).data}catch(u){throw console.error("Error al sincronizar eventos con outlook Calendar:",u),u}},getOutlookCalendars:async(i,a)=>{try{return(await bt.get(`${e}/api/Calendario/v1/outlook/ObtenerTiposCalendariosOutlookAsync?usrMail=${encodeURIComponent(i)}&disID=${a}`)).data}catch(c){throw console.error("Error al obtener los calendarios de Google:",c),c}},getOutlookEventsByMonth:async i=>{try{return(await bt.post(`${e}/api/Calendario/v1/outlook/ObtenerEventosoutlookAsyncXMes`,i)).data}catch(a){throw console.error("Error al obtener eventos de Outlook Calendar por mes:",a),a}}}},bf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAYCAMAAAA8nnbJAAAAflBMVEUAAAAAV34AMFoAID0ATmsAL1oATXcAZZAAIUgANmQArPAAfd0BedoAacQAZbsAkuMActcAa9QAsfMAjfMAUJL///8Ame8Aht4A6v8A2v8Atvguid0AfMIAo+wAWrYA3/+q0/MAQ38ASIjB4PeHwe4AU7JlsekAdcMAXqgApf4WoQK+AAAACnRSTlMATjUWISlCbAuE1QOT9gAAAP1JREFUKM9t0GF7QzAQwPG2xiw5JGlICWVsrX3/L7i7Gyae/l944efinpzW4ktQfPrvorIgiHaW5UHZ29Hu3Dd235uTUkJnMHGj2NKISvh/TmBdX9c1W/pz5SQOOtsFFl0lBfx8YeCH6aHJhEG89X2/2aOchnLSIC1IACWwZjFdfmnwpSeDg/kSJH0AsLPLZgBoam9jsp2p8EylLK2rjDAmb89kALzLoLUaMyx3bs6rajHlh8FnZHzN+VwVxWKI+F5jFgdnW2BsaSUxUBRYYUdXrYaDMfbxydmuEU+32tJ7+5fB7QvUwBrDCcq4Z2AirJX7udCaziUMVHI+hPQLqRAg85aAu30AAAAASUVORK5CYII=",ix=({disID:e,usrID:r})=>{const[t,n]=v.useState(null),o=nc(),s=async()=>{localStorage.setItem("temp_auth_disID",String(e)),localStorage.setItem("temp_auth_usrID",String(r)),n(null);try{const i=await o.getOutlookAuthUrl();window.location.href=i?.authUrl}catch(i){n(i.message||"Fallo al iniciar sesión con Google."),localStorage.removeItem("temp_auth_disID"),localStorage.removeItem("temp_auth_usrID")}finally{}};return l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:ve.syncButton,onClick:s,children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.uncheckedCircle})}),l.jsx("img",{src:bf,width:20}),l.jsx("span",{children:"Outlook"})]}),t&&l.jsx("p",{className:"text-red-500 mt-2",children:t})]})},xf="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='67'%20fill='none'%3e%3cg%20filter='url(%23a)'%20opacity='.7'%3e%3cellipse%20cx='69.302'%20cy='60.952'%20fill='%23D9D9D9'%20rx='12.698'%20ry='2.032'/%3e%3c/g%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M60.034%2011.99c.71.001%201.37.374%201.737.982l-1.74%201.05a270%20270%200%200%201%201.74-1.048l.002.002.002.004.007.011.02.034.063.11q.08.139.21.385c.171.327.403.795.657%201.38a24.6%2024.6%200%200%201%201.527%204.811c.817%203.964.847%209.339-2.499%2014.552a2.033%202.033%200%200%201-3.242.236l1.533-1.333-1.535%201.332v-.003l-.005-.004-.01-.012-.028-.033-.082-.1a10%2010%200%200%201-.26-.34%2014%2014%200%200%201-.798-1.221%2017.3%2017.3%200%200%201-1.828-4.469c-.986-3.873-.934-9.225%202.79-15.35l.072-.11c.38-.542%201-.867%201.667-.866m1.867%2017.26q-.02.064-.042.126.091-.276.172-.552zm-1.626-14.786.004.008z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20d='M59.728%2035.515s-1.736-7.32%206.371-12.183c0%200%20.497%208.29-6.371%2012.183'/%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M79.915%2011.99c.71.001%201.37.374%201.737.982l-1.74%201.05a281%20281%200%200%201%201.74-1.048l.002.002.002.004.007.011.02.034.063.11q.08.139.21.385c.171.327.402.795.657%201.38a24.6%2024.6%200%200%201%201.527%204.811c.817%203.964.847%209.339-2.5%2014.552a2.033%202.033%200%200%201-3.241.236l1.532-1.333-1.534%201.332-.001-.003-.004-.004-.011-.012-.027-.033-.082-.1a10%2010%200%200%201-.26-.34c-.211-.287-.492-.698-.799-1.221a17.3%2017.3%200%200%201-1.827-4.469c-.986-3.873-.934-9.225%202.79-15.35l.072-.11c.38-.542%201-.867%201.667-.866m2.476%209.544q.013.113.027.228-.058-.477-.135-.934z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20fill-rule='evenodd'%20d='M72.733%2022.085c.313-.165.691-.154.996.028l-.522.871c.522-.87.521-.871.522-.87l.004.001.007.004.021.013q.027.016.072.046.091.057.25.165c.212.145.507.357.856.635.697.556%201.62%201.383%202.52%202.474%201.803%202.183%203.562%205.475%203.201%209.764a1.016%201.016%200%200%201-1.376.863h-.002l-.004-.002-.008-.002-.023-.01-.079-.033a9.79%209.79%200%200%201-1.139-.603%2012%2012%200%200%201-2.566-2.14c-1.853-2.044-3.57-5.345-3.271-10.365l.017-.131c.057-.3.249-.563.524-.708M78.04%2034.22l.11.075a11%2011%200%200%201-.394-.282zm-4.516-11.027.334.237q0%200%20.003.002a13%2013%200%200%200-.337-.24'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23C2C3CC'%20fill-rule='evenodd'%20d='M85.456%2022.461a1.017%201.017%200%200%201%201.536.81l-1.014.061%201.014-.06v.002l.001.003v.008l.001.024.004.085q.004.108.004.301c0%20.257-.007.62-.04%201.067-.064.89-.227%202.12-.618%203.482-.781%202.723-2.5%206.038-6.237%208.156a1.018%201.018%200%200%201-1.489-.65l-.002-.006-.002-.009-.005-.025a5%205%200%200%201-.065-.367%2010%2010%200%200%201-.096-.999c-.04-.837%200-2.002.316-3.331.639-2.686%202.388-5.97%206.692-8.552'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23D6D6D6'%20fill-rule='evenodd'%20d='M70.232%205.343c.71.002%201.37.374%201.737.982l-1.74%201.05c1.739-1.05%201.74-1.048%201.74-1.048l.002.002q0%20.003.003.004l.008.014.023.04.082.142q.102.18.274.505c.227.432.535%201.053.875%201.834a33%2033%200%200%201%202.036%206.417c1.09%205.284%201.122%2012.4-3.305%2019.3a2.034%202.034%200%200%201-3.242.236l1.532-1.334a223%20223%200%200%201-1.534%201.332l-.002-.002-.004-.005-.012-.013-.033-.04-.102-.124a13%2013%200%200%201-.335-.438%2019%2019%200%200%201-1.048-1.603%2023%2023%200%200%201-2.413-5.902c-1.3-5.104-1.25-12.198%203.719-20.373l.072-.11c.38-.541%201-.867%201.667-.866m1.563%2026.818v-.002l-.003-.002v-.002z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23AAABAD'%20fill-rule='evenodd'%20d='M60.61%2018.704c.315-.166.693-.155.998.027l-.523.871c.489-.815.52-.868.523-.87l.004.001.009.005.027.017a8%208%200%200%201%20.425.279c.282.192.676.476%201.145.85a23%2023%200%200%201%203.383%203.32c2.419%202.929%204.765%207.325%204.284%2013.05a1.017%201.017%200%200%201-1.376.864l.363-.948-.364.947h-.002l-.003-.002q-.005%200-.01-.003l-.03-.012-.1-.041a9%209%200%200%201-.341-.157c-.288-.139-.69-.35-1.164-.642a16%2016%200%200%201-3.42-2.852c-2.465-2.719-4.768-7.125-4.367-13.866l.017-.131c.058-.3.248-.562.523-.708m.436%201.974q.003-.237.011-.477v-.003a24%2024%200%200%200-.01.48'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23AAABAD'%20fill-rule='evenodd'%20d='M78.103%2019.143a1.016%201.016%200%200%201%201.419.871l-1.014.06%201.014-.06.001.002v.013l.002.032.004.11q.005.142.006.399c0%20.341-.01.83-.054%201.428a23.2%2023.2%200%200%201-.829%204.675c-1.05%203.655-3.348%208.076-8.335%2010.904a1.016%201.016%200%200%201-1.49-.65l.989-.233-.988.232-.001-.001-.001-.004-.002-.01-.007-.032q-.01-.038-.022-.104a9%209%200%200%201-.064-.372c-.047-.317-.1-.768-.127-1.326a16%2016%200%200%201%20.423-4.441c.85-3.574%203.18-7.967%208.96-11.433zm-8.499%2015.032c-.007.617.024%201.143.066%201.552q.032.308.065.524c.043.286.08.443.08.443-.003-.017-.23-.99-.21-2.52m.05-1.027q-.023.282-.036.546l.032-.511q.001-.018.004-.035'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23D6D6D6'%20d='M55.804%2031.519h28.238c.815%200%201.476.663%201.476%201.481v15.847c0%206.204-5.019%2011.241-11.2%2011.241h-8.79c-6.182%200-11.2-5.037-11.2-11.24V33c0-.818.66-1.481%201.476-1.481'/%3e%3cpath%20fill='%23E6E8ED'%20d='M68.15%2032.344v17.159c0%205.103%203.6%209.364%208.39%2010.361%205.122-1.034%208.978-5.574%208.978-11.018V33c0-.818-.66-1.481-1.476-1.481h-15.07a.823.823%200%200%200-.822.824z'/%3e%3cg%20filter='url(%23b)'%20opacity='.7'%3e%3cellipse%20cx='33.238'%20cy='60.952'%20fill='%23D9D9D9'%20rx='28.444'%20ry='3.048'/%3e%3c/g%3e%3cpath%20fill='%233856EC'%20d='M6.095%2017.27h54.857V53.84a6.095%206.095%200%200%201-6.095%206.095H12.19a6.095%206.095%200%200%201-6.095-6.095z'/%3e%3cpath%20fill='%23E2EDFB'%20d='M6.195%2050.145a8.127%208.127%200%200%200%208.127%208.127H37.9a6.1%206.1%200%200%200%204.309-1.785l16.98-16.973a6.1%206.1%200%200%200%201.785-4.31V9.586a6.095%206.095%200%200%200-6.095-6.095H12.29a6.095%206.095%200%200%200-6.095%206.095z'/%3e%3cpath%20fill='%233856EC'%20fill-rule='evenodd'%20d='M60.952%209.009a6.014%206.014%200%200%200-6.014-6.014H12.11a6.014%206.014%200%200%200-6.014%206.014v8.284h54.857zM17.77%2012.772a2.794%202.794%200%201%201%20.002-5.589%202.794%202.794%200%200%201-.002%205.59m15.965%200a2.794%202.794%200%201%201%20.001-5.588%202.794%202.794%200%200%201%200%205.588m16.763%200a2.794%202.794%200%201%201%20.001-5.588%202.794%202.794%200%200%201-.001%205.588'%20clip-rule='evenodd'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='34.931'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='46.904'%20y='22.351'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='34.931'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='46.904'%20y='33.526'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='11.783'%20y='44.702'%20fill='%23fff'%20rx='2.032'/%3e%3crect%20width='7.982'%20height='7.982'%20x='23.756'%20y='44.702'%20fill='%23fff'%20rx='2.032'/%3e%3cpath%20fill='%23597EF7'%20d='M40.52%2057.687a6%206%200%200%200%201.665-1.174l17.027-17.021a6%206%200%200%200%201.313-1.973H48.646a8.127%208.127%200%200%200-8.127%208.127z'/%3e%3crect%20width='3.991'%20height='11.974'%20x='15.773'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3crect%20width='3.991'%20height='11.974'%20x='31.738'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3crect%20width='3.991'%20height='11.974'%20x='48.501'%20fill='%23D9D9D9'%20rx='1.996'/%3e%3cdefs%3e%3cfilter%20id='a'%20width='29.46'%20height='8.127'%20x='54.572'%20y='56.889'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20result='effect1_foregroundBlur_529_4322'%20stdDeviation='1.016'/%3e%3c/filter%3e%3cfilter%20id='b'%20width='60.952'%20height='10.159'%20x='2.762'%20y='55.873'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20result='effect1_foregroundBlur_529_4322'%20stdDeviation='1.016'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e";var So={},wf;function ax(){if(wf)return So;wf=1;var e=ct();Object.defineProperty(So,"__esModule",{value:!0}),So.default=void 0;var r=e(ht()),t=dt();return So.default=(0,r.default)((0,t.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),So}var cx=ax();const lx=at(cx);var Co={},_f;function ux(){if(_f)return Co;_f=1;var e=ct();Object.defineProperty(Co,"__esModule",{value:!0}),Co.default=void 0;var r=e(ht()),t=dt();return Co.default=(0,r.default)((0,t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Co}var dx=ux();const Rr=at(dx);function oc(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}function Eo(e){return(r,t)=>{const n=t?.context?String(t.context):"standalone";let o;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=t?.width?String(t.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=t?.width?String(t.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(r):r;return o[s]}}function Do(e){return(r,t={})=>{const n=t.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=r.match(o);if(!s)return null;const i=s[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?px(a,f=>f.test(i)):fx(a,f=>f.test(i));let u;u=e.valueCallback?e.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const d=r.slice(i.length);return{value:u,rest:d}}}function fx(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function px(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function hx(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const o=n[0],s=r.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const a=r.slice(o.length);return{value:i,rest:a}}}function mx(e,...r){const t=Fa.bind(null,r.find(n=>typeof n=="object"));return r.map(t)}const gx={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},vx=(e,r,t)=>{let n;const o=gx[e];return typeof o=="string"?n=o:r===1?n=o.one:n=o.other.replace("{{count}}",r.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"en "+n:"hace "+n:n},yx={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},bx={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},xx={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wx={date:oc({formats:yx,defaultWidth:"full"}),time:oc({formats:bx,defaultWidth:"full"}),dateTime:oc({formats:xx,defaultWidth:"full"})},_x={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Sx={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Cx=(e,r,t,n)=>r.getHours()!==1?Sx[e]:_x[e],Ex={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},Dx={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},kx={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},Ax={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},Tx={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},Mx={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Ix={ordinalNumber:(e,r)=>Number(e)+"º",era:Eo({values:Ex,defaultWidth:"wide"}),quarter:Eo({values:Dx,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Eo({values:kx,defaultWidth:"wide"}),day:Eo({values:Ax,defaultWidth:"wide"}),dayPeriod:Eo({values:Tx,defaultWidth:"wide",formattingValues:Mx,defaultFormattingWidth:"wide"})},Ox=/^(\d+)(º)?/i,jx=/\d+/i,Px={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},Rx={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Nx={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},Lx={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},zx={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},Bx={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},Fx={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},Vx={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},Ux={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},Wx={ordinalNumber:hx({matchPattern:Ox,parsePattern:jx,valueCallback:function(e){return parseInt(e,10)}}),era:Do({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),quarter:Do({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Do({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),day:Do({matchPatterns:Bx,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any"}),dayPeriod:Do({matchPatterns:Vx,defaultMatchWidth:"any",parsePatterns:Ux,defaultParseWidth:"any"})},Hx={code:"es",formatDistance:vx,formatLong:wx,formatRelative:Cx,localize:Ix,match:Wx,options:{weekStartsOn:1,firstWeekContainsDate:1}},Sf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAACpQTFRFR3BMcHCAcHBwaGx4ZWp6aG14aG54Zm14aW15aG55aG15aW55aW56aW5591zvEAAAAA10Uk5TABAQIDBBYHCAnr7g7wYb6DAAAACqSURBVHjahZJLDgMhDEM9UL7Ju/91q8KgQhcdb5D8rFiJ0JNC6Qbeczzt6izV8PWjAbiNB4uH35IkpbaRYGBpT9mcVlemtnCTOiLA8BPk+/VPIkPTR/kGalAkdUgnSNAlOegEckwS2C8wOAEWN2D4BC8HH3Xge/naYJUXaJq6Wo+S2iy7HJKW1sbHSc6B0mU7SeOIf8++CJg5nHOvypLXoF0xdwfrJTx9mzdxpgqGKfcyxQAAAABJRU5ErkJggg==",Yx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAMAAABZu7juAAAAPFBMVEUAAABobHhobnhpbnlobnhobXhpbnlpbnpobXhwcHNobHhlanlpbnlobnhobnpobXhmbXlocHhpbHZpbnlt0ET4AAAAE3RSTlMAIGDggL/f76AQQDDPsLCQcEBQZL6CzQAAALVJREFUSMft1MsOgyAQhWEGHQa82/P+71rDojhJ6dCNi9ZvZcivQUjGXWeTQHqFJvS1mgDMemkGQJV8AMB6iQHsb9K0RZ4ACCsCYOLoSccrDPH0AgWYAqm6vY9owuVAmgzq46aY84BGknM0S/nqm9Ef5tIZROXeGfyd3/lP5Kk9T+4gAGYrj68pxjiMn2sqI9iX6V0zhtOO8zO4r1k5B8F9NeBH9dsWr/ZmCLs+10VQ1S0Pd4UnLwhFRUE6UNsAAAAASUVORK5CYII=",qx=({notificacion:e,onAccept:r})=>{const{evento:t,tipo:n,leida:o}=e,s=n==="EventoCreado"||n==="EventoModificado",a={EventoCreado:{frase:"te ha invitado a:",colorTitulo:"#3c4043"},EventoModificado:{frase:"ha modificado el evento",colorTitulo:"#3c4043"},EventoCancelado:{frase:"ha cancelado el evento",colorTitulo:"#d32f2f"}}[n]||{frase:"te ha notificado sobre",colorTitulo:"#3c4043"},c=t?.fechaInicio?new Date(t.fechaInicio):new Date,u=t?.fechaFin?new Date(t.fechaFin):null,d=t?.nombreAnfitrion||"Usuario",f=t?.titulo||"Sin título",h=y=>y.split(" ").filter(g=>g).map(g=>g[0]).join("").toUpperCase().substring(0,2);return l.jsxs(m.Box,{sx:{p:2,mb:1,bgcolor:"white",borderRadius:"8px",border:"1px solid #e0e0e0",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",position:"relative",overflow:"hidden"},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:1},children:[l.jsx(m.Avatar,{sx:{bgcolor:"#F5A623",width:34,height:34,fontSize:"14px",mr:1.5,fontWeight:"bold"},children:h(d)}),l.jsxs(m.Box,{children:[l.jsxs(m.Typography,{sx:{fontSize:"14px",color:"#5f6368",lineHeight:1.2},children:[d," ",a.frase]}),l.jsx(m.Typography,{sx:{fontSize:"14px",fontWeight:700,color:a.colorTitulo},children:f})]})]}),l.jsx(m.Divider,{sx:{mx:-2,my:1.5,backgroundColor:"#000"}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:0},children:[l.jsx("img",{src:Yx,width:20,alt:"cal",style:{marginRight:15,color:"black"}}),l.jsx(m.Typography,{sx:{fontSize:"14px",color:"#3c4043",textTransform:"capitalize"},children:x.format(c,"EEEE, dd 'de' MMMM",{locale:Hx})})]}),l.jsx(m.Divider,{sx:{mx:-2,my:1.5,backgroundColor:"#000"}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mb:s&&!o?2:0},children:[l.jsx("img",{src:Sf,width:20,alt:"watch",style:{marginRight:15}}),l.jsxs(m.Typography,{sx:{fontSize:"14px",color:"#3c4043"},children:[x.format(c,"h:mm a").toLowerCase(),u?` - ${x.format(u,"h:mm a").toLowerCase()}`:""]})]}),s&&!o&&l.jsxs(m.Grid,{container:!0,spacing:1,sx:{mt:1},children:[l.jsx(m.Grid,{item:!0,xs:6,children:l.jsx(m.Button,{fullWidth:!0,variant:"outlined",size:"small",startIcon:l.jsx(lx,{sx:{fontSize:"16px !important",mr:-.5}}),onClick:()=>r?.(e,"CONFIRMADA"),sx:{borderRadius:"8px",textTransform:"none",fontWeight:700,fontSize:"12px",color:"#1976D2",borderColor:"#1976D2",py:.8,px:1,whiteSpace:"nowrap"},children:"Asistiré"})}),l.jsx(m.Grid,{item:!0,xs:6,children:l.jsx(m.Button,{fullWidth:!0,variant:"outlined",size:"small",startIcon:l.jsx(Rr,{sx:{fontSize:"16px !important",mr:-.5}}),onClick:()=>r?.(e,"RECHAZADA"),sx:{borderRadius:"8px",textTransform:"none",fontWeight:700,fontSize:"12px",color:"#D32F2F",borderColor:"#D32F2F",py:.8,px:1,whiteSpace:"nowrap"},children:"Rechazar"})})]})]})},Zx=({userId:e,notifications:r,onAceppInvitacion:t})=>{const[n,o]=v.useState(r),[s,i]=v.useState(null);return console.log("notifications",r),v.useEffect(()=>{o(r)},[r]),l.jsx(m.Box,{sx:{width:"100%",maxHeight:"600px",overflowY:"auto"},children:l.jsx(m.List,{disablePadding:!0,children:n.length===0?l.jsxs("div",{className:ve.emptyStateContainer,children:[l.jsx("img",{src:xf,alt:"Todo en orden",className:ve.emptyStateImage}),l.jsx("h4",{className:ve.emptyStateTitle,children:"Todo en orden aquí"}),l.jsx("p",{className:ve.emptyStateText,children:"Por el momento no tienes invitaciones pendientes."})]}):n.map(a=>l.jsx(qx,{notificacion:a,onAccept:t}))})})},Gx=({onEventClick:e,upcomingEvents:r,leads30Days:t,leads90Days:n,disID:o,usrID:s,onAddEvent:i,googleCalendars:a,outlookCalendars:c,isLoadingCalendars:u,onToggleGoogle:d,onToggleOutlook:f,notifications:h,unreadCount:y,onAceppInvitacion:g})=>{const{session:p,sessionoutlook:b}=Ua(),{enqueueSnackbar:_}=ss.useSnackbar(),S=$=>{const ie=new Date,ue={start:x.startOfDay(ie),end:x.endOfDay(ie)},N={start:$.fechaInicio,end:$.fechaFin};return xd(ue,N)?"Hoy":x.isTomorrow($.fechaInicio)?"Mañana":new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long"}).format($.fechaInicio)},D={};r.forEach($=>{const ie=S($);D[ie]||(D[ie]=[]),D[ie].push($)});const[C,w]=v.useState(!1),F=()=>{w(!C)},E=mi(),T=nc(),I=async()=>{if(!p?.userEmail||!o||!s){console.error("Faltan datos (email, disID o usrID) para sincronizar eventos.");return}try{await E.syncGoogleEvents(p?.userEmail,o,s),_("Eventos sincronizados con Google Calendar con éxito.",{variant:"success"})}catch{_("Error al sincronizar eventos con Google Calendar.",{variant:"error"})}finally{}},M=async()=>{if(!b?.userEmail||!o||!s){console.error("Faltan datos (email, disID o usrID) para sincronizar eventos.");return}try{await T.syncOutlookEvents(b?.userEmail,o,s),_("Eventos sincronizados con Outlook Calendar con éxito.",{variant:"success"})}catch{_("Error al sincronizar eventos con Outlook Calendar.",{variant:"error"})}finally{}},[U,q]=v.useState("events"),V=$=>{q($)},[H,re]=v.useState(!0),W=()=>{re($=>!$)};return l.jsxs("div",{className:ve.sidebarContainer,children:[l.jsxs("div",{className:ve.leadsSection,children:[l.jsxs("div",{className:ve.leadCard,children:[l.jsx("div",{className:ve.leadIcon,children:l.jsx("img",{src:Td})}),l.jsxs("div",{className:ve.leadText,children:[l.jsx("div",{className:ve.leadDays,children:"+30 días sin atender"}),l.jsxs("div",{className:ve.leadCount,children:[t," ",l.jsx("span",{style:{fontSize:10,fontWeight:"normal"},children:"leads"})]})]})]}),l.jsxs("div",{className:ve.leadCard,children:[l.jsx("div",{className:ve.leadIcon,children:l.jsx("img",{src:Td})}),l.jsxs("div",{className:ve.leadText,children:[l.jsx("div",{className:ve.leadDays,children:"+90 días sin atender"}),l.jsxs("div",{className:ve.leadCount,children:[n," ",l.jsx("span",{style:{fontSize:10,fontWeight:"normal"},children:"leads"})]})]})]})]}),l.jsxs("div",{className:ve.eventsSection,children:[l.jsxs("div",{className:ve.tabsContainer,children:[l.jsx("button",{className:`${ve.tabButton} ${U==="events"?ve.activeTab:""}`,onClick:()=>V("events"),children:"Eventos"}),l.jsxs("button",{className:`${ve.tabButton} ${U==="alerts"?ve.activeTab:""}`,onClick:()=>V("alerts"),children:["Alertas",y>0&&l.jsx("span",{className:ve.alertBadge,children:y>99?"99+":y})]})]}),l.jsxs("div",{className:ve.eventsContainer,children:[U==="events"&&l.jsx(l.Fragment,{children:Object.keys(D).length>0?Object.entries(D).map(([$,ie])=>l.jsxs("div",{className:`${ve.eventGroup}`,children:[l.jsxs("div",{className:ve.eventGroupDate,children:[l.jsx("img",{src:I1,width:15})," ",$]}),ie.map(ue=>{const N=Ce(ue.color||"#ffcc00"),ee=N.toString(),xe=N.clone().darken(15).toString(),_e=new Intl.DateTimeFormat("es-ES",{hour:"numeric",minute:"2-digit",hour12:!0});return l.jsxs("div",{className:ve.eventItem,style:{backgroundColor:ee,borderLeft:`4px solid ${xe}`,display:"flex",alignItems:"center",padding:"10px",marginBottom:"8px",borderRadius:"4px",cursor:"pointer"},onClick:()=>e(ue),children:[l.jsxs("div",{className:ve.eventDetails,style:{flex:1},children:[l.jsx("div",{className:ve.eventTitle,style:{fontWeight:"500",fontSize:"12px",color:"#333"},children:ue.titulo.length>32?`${ue.titulo.substring(0,32)}...`:ue.titulo}),ue.nombreAnfitrion&&l.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"4px",color:"#555"},children:[l.jsx("img",{src:Md,width:16,style:{marginRight:"6px",opacity:.7}}),l.jsx("span",{style:{fontSize:"13px"},children:ue.nombreAnfitrion})]}),l.jsx("div",{className:ve.eventTime,style:{fontSize:"12px",marginTop:"4px",opacity:.7},children:`${_e.format(ue.fechaInicio).toLowerCase()} - ${_e.format(ue.fechaFin).toLowerCase()}`})]}),ue.link&&l.jsx("a",{onClick:fe=>fe.stopPropagation(),href:ue.link,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",padding:"4px"},children:l.jsx("img",{src:O1,alt:"Video",width:20,style:{opacity:.8}})})]},ue.eventoID)})]},$)):l.jsxs("div",{className:ve.emptyStateContainer,children:[l.jsx("img",{src:xf,alt:"Todo en orden",className:ve.emptyStateImage}),l.jsx("h4",{className:ve.emptyStateTitle,children:"Tu agenda está despejada"}),l.jsx("p",{className:ve.emptyStateText,children:"Parece que no tienes ningún evento en tu calendario. ¿Te gustaría añadir uno? "}),l.jsxs("button",{className:ve.addEventButton,onClick:i,children:[l.jsx("img",{src:gd}),"Agregar evento"]})]})}),U==="alerts"&&l.jsx(m.Box,{children:l.jsx(Zx,{userId:s,notifications:h,onAceppInvitacion:g})})]})]}),l.jsxs("div",{className:ve.calendarsSection,children:[l.jsxs("button",{onClick:F,className:ve.collapsibleHeader,children:[l.jsxs("div",{className:ve.headerTitle,children:[l.jsx("span",{style:{fontSize:"14px"},children:"Calendarios"}),l.jsx("span",{className:ve.calendarCount,children:"1"})]}),l.jsx(s1,{className:`${ve.chevronIcon} ${C?ve.collapsed:""}`})]}),l.jsxs("div",{className:`${ve.collapsibleContent} ${C?ve.hidden:""}`,children:[l.jsxs("button",{className:`${ve.calendarSelectButton} ${H?ve.calendarSelected:""}`,onClick:W,style:{"--calendar-color":"#1976D2"},children:[l.jsx("div",{className:ve.customCheckIcon,children:l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})})}),l.jsx(o1,{size:16,className:ve.calendarIcon}),l.jsx("span",{className:ve.calendarItemText,children:"Mi calendario"})]}),b.userEmail?l.jsxs("div",{className:ve.syncButton,onClick:M,children:[l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})}),l.jsx("img",{src:bf,width:20}),l.jsx("span",{style:{fontSize:"14px"},children:"Sincronizar Outlook"})]}):l.jsx(ix,{disID:o,usrID:s}),p?.userEmail?l.jsxs("div",{className:ve.syncButton,onClick:I,children:[l.jsx("div",{className:ve.circularCheckbox,children:l.jsx(Ba,{size:16,className:ve.checkedIcon})}),l.jsx("img",{src:yf,width:18}),l.jsx("span",{style:{fontSize:"14px"},children:"Sincronizar Google"})]}):l.jsx(sx,{disID:o,usrID:s}),b?.userEmail&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:ve.currentUserCalendarTitle,style:{marginTop:"10px"},children:b?.userEmail}),u?l.jsx(m.CircularProgress,{size:24}):c.length>0?l.jsx(m.List,{dense:!0,className:ve.calendarsList,children:c.map($=>l.jsx(m.ListItem,{secondaryAction:l.jsx(m.Checkbox,{edge:"end",onChange:()=>f($.id),checked:$.selected||!1,sx:{color:$.backgroundColor,"&.Mui-checked":{color:$.backgroundColor}}}),disablePadding:!0,children:l.jsx(m.ListItemText,{primary:$.summary.length>25?`${$.summary.substring(0,25)}...`:$.summary,className:ve.calendarItemText})},$.id))}):l.jsx("p",{style:{fontSize:"12px"},children:"No se encontraron calendarios."})]}),p?.userEmail&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:ve.currentUserCalendarTitle,style:{marginTop:"10px"},children:p?.userEmail}),u?l.jsx(m.CircularProgress,{size:24}):a.length>0?l.jsx(m.List,{dense:!0,className:ve.calendarsList,children:a.map($=>l.jsx(m.ListItem,{secondaryAction:l.jsx(m.Checkbox,{edge:"end",onChange:()=>d($.id),checked:$.selected||!1,sx:{color:$.backgroundColor,"&.Mui-checked":{color:$.backgroundColor}}}),disablePadding:!0,children:l.jsx(m.ListItemText,{primary:$.summary.length>25?`${$.summary.substring(0,25)}...`:$.summary,className:ve.calendarItemText})},$.id))}):l.jsx("p",{style:{fontSize:"12px"},children:"No se encontraron calendarios."})]})]})]})]})},hn={dayCell:"_dayCell_xweup_1",dayCellContainer:"_dayCellContainer_xweup_23",dayNumber:"_dayNumber_xweup_55",dayNumberToday:"_dayNumberToday_xweup_69",notCurrentMonth:"_notCurrentMonth_xweup_91",CurrentDay:"_CurrentDay_xweup_129",eventsList:"_eventsList_xweup_137"};var ko={},Cf;function Kx(){if(Cf)return ko;Cf=1;var e=ct();Object.defineProperty(ko,"__esModule",{value:!0}),ko.default=void 0,o(v);var r=e(ht()),t=dt();function n(s){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(n=function(c){return c?a:i})(s)}function o(s,i){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=n(i);if(a&&a.has(s))return a.get(s);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var f=u?Object.getOwnPropertyDescriptor(s,d):null;f&&(f.get||f.set)?Object.defineProperty(c,d,f):c[d]=s[d]}return c.default=s,a&&a.set(s,c),c}return ko.default=(0,r.default)((0,t.jsx)("path",{d:"M12.545,10.239v3.821h5.445c-0.712,2.315-2.647,3.972-5.445,3.972c-3.332,0-6.033-2.701-6.033-6.032s2.701-6.032,6.033-6.032c1.498,0,2.866,0.549,3.921,1.453l2.814-2.814C17.503,2.988,15.139,2,12.545,2C7.021,2,2.543,6.477,2.543,12s4.478,10,10.002,10c8.396,0,10.249-7.85,9.426-11.748L12.545,10.239z"}),"Google"),ko}var Qx=Kx();const Xx=at(Qx);var Ao={},Ef;function Jx(){if(Ef)return Ao;Ef=1;var e=ct();Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=void 0;var r=e(ht()),t=dt();return Ao.default=(0,r.default)((0,t.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline"),Ao}var ew=Jx();const tw=at(ew),Df=46,rw=22,nw=({dayNumber:e,date:r,events:t,isToday:n,isCurrentMonth:o,onDayClick:s,onEventClick:i,onSeeMoreClick:a})=>{const c=[hn.dayCell,o?"":hn.notCurrentMonth,hn.CurrentDay].join(" ").trim(),u=v.useRef(null),[d,f]=v.useState(t.length),h=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});v.useLayoutEffect(()=>{const p=()=>{if(u.current){const b=u.current.clientHeight;let _=Math.floor(b/(Df+4));if(_<t.length){const S=Math.floor((b-rw)/(Df+4));_=Math.max(0,S)}f(_)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[t.length]);const y=t.slice(0,d===0?1:d),g=t.length-(d===0?1:d);return l.jsxs("div",{className:`${c} ${hn.dayCellContainer}`,onClick:()=>s?.(r),style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[l.jsx("div",{className:n?hn.dayNumber:hn.dayNumberToday,children:e}),l.jsxs("div",{className:hn.eventsList,ref:u,style:{flex:1,display:"flex",flexDirection:"column",gap:"4px",padding:"0 4px 4px 4px",marginTop:"4px",overflow:"hidden"},children:[y.map(p=>{const b=p.color||"#D7EBFB",_=p.isGoogleEvent||p.isOutlookEvent;return l.jsxs(m.Box,{onClick:S=>{S.stopPropagation(),i?.(p)},sx:{backgroundColor:_?"#ffffff":p?.color,padding:"4px 8px",borderRadius:"6px",cursor:"pointer",display:"flex",flexDirection:"column",minHeight:"40px",maxHeight:"48px",position:"relative",overflow:"hidden",border:_?`1px solid ${Ce(b).setAlpha(.4).toRgbString()}`:"none","&:hover":{filter:"brightness(0.95)",boxShadow:"0px 2px 4px rgba(0,0,0,0.08)"}},children:[p.isGoogleEvent&&l.jsx(Xx,{sx:{position:"absolute",top:4,right:4,fontSize:12,color:"#4285F4"}}),p.isOutlookEvent&&l.jsx(tw,{sx:{position:"absolute",top:4,right:4,fontSize:12,color:"#0078D4"}}),l.jsx(m.Typography,{sx:{fontSize:"10px",lineHeight:"1",color:"#3C4043",pr:_?2:0,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word"},children:p.titulo}),l.jsx(m.Typography,{sx:{fontSize:"9px",color:"#70757a",mt:"auto",fontWeight:400},children:`${h.format(p.fechaInicio).toLowerCase()} - ${h.format(p.fechaFin).toLowerCase()}`})]},p.eventoID)}),g>0&&l.jsxs(m.Typography,{sx:{fontSize:"10px",fontWeight:"bold",color:"#1976D2",textAlign:"left",ml:1,mt:.5,cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:p=>{p.stopPropagation(),a(t,r)},children:["+",g," más"]})]})]})},kf={weekDaysContainer:"_weekDaysContainer_5h5ol_1",weekDay:"_weekDay_5h5ol_1"},ow=()=>{const e=["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"];return l.jsx("div",{className:kf.weekDaysContainer,children:e.map(r=>l.jsx("div",{className:kf.weekDay,children:r},r))})},gi={calendarGridContainer:"_calendarGridContainer_1expw_1",daysContainer:"_daysContainer_1expw_23",rows5:"_rows5_1expw_37",rows6:"_rows6_1expw_45"};function sw(e,r){const[t,n]=mx(e,r.start,r.end);return{start:t,end:n}}function iw(e,r){const{start:t,end:n}=sw(r?.in,e);let o=+t>+n;const s=o?+t:+n,i=o?n:t;i.setHours(0,0,0,0);let a=1;const c=[];for(;+i<=s;)c.push(Fa(t,i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return o?c.reverse():c}function aw(e,r){const t=r?.weekStartsOn,n=Xr(e,r?.in),o=n.getDay(),s=(o<t?-7:0)+6-(o-t);return n.setDate(n.getDate()+s),n.setHours(23,59,59,999),n}function cw(e,r,t){const n=+Xr(e,t?.in),[o,s]=[+Xr(r.start,t?.in),+Xr(r.end,t?.in)].sort((i,a)=>i-a);return n>=o&&n<=s}const lw=({currentDate:e,events:r,onDayClick:t,onEventClick:n,onSeeMoreClick:o})=>{const s=x.startOfMonth(e),i=x.endOfMonth(e),a=x.startOfWeek(s,{weekStartsOn:1}),c=aw(i,{weekStartsOn:1}),u=iw({start:a,end:c}),d={},f=u.length/7,h=`${gi.daysContainer} ${f===5?gi.rows5:gi.rows6}`;return r.forEach(y=>{const g=x.format(y.fechaInicio,"yyyy-MM-dd");d[g]||(d[g]=[]),d[g].push(y)}),l.jsxs("div",{className:gi.calendarGridContainer,children:[l.jsx(ow,{}),l.jsx("div",{className:h,children:u.map(y=>{const g=r.filter(p=>cw(y,{start:x.startOfDay(p.fechaInicio),end:x.endOfDay(p.fechaFin)}));return l.jsx(nw,{dayNumber:y.getDate(),date:y,events:g,isToday:x.isToday(y),isCurrentMonth:x.isSameMonth(y,e),onDayClick:t,onEventClick:n,onSeeMoreClick:o},y.toISOString())})})]})},sc=()=>{const{calendarApiUrl:e}=rc(),r=async g=>{try{return(await bt.get(`${e}/api/Calendario/v1/local/ListarEventosXUsuario/${g}`)).data.map(b=>{const _=new Date(b.fechaInicio),S=new Date(b.fechaFin),D=b.solicitudRelacionada?.[0]?.nombreCliente??null;return{...b,fechaInicio:_,fechaFin:S,client:D}})}catch(p){return console.error("Error events:",p),[]}},t=async(g,p)=>{try{const b=await bt.post(`${e}/api/Calendario/v1/local/InsertarEvento/${p}`,g);return{...b.data,fechaInicio:new Date(b.data.fechaInicio),fechaFin:new Date(b.data.fechaFin)}}catch(b){throw console.log("Error creating event:",b),b}},n=async g=>{try{const p=await bt.post(`${e}/api/Calendario/v1/local/ActualizarEvento/${g.eventoID}`,g);return{eventoID:p.data.eventoID,titulo:p.data.titulo,descripcion:p.data.descripcion,fechaInicio:new Date(p.data.fechaInicio),fechaFin:new Date(p.data.fechaFin),todoElDia:p.data.todoElDia,color:p.data.color,repetir:p.data.repetir,link:p.data.link,solID:p.data.solID,disID:p.data.disID,client:p.data.client,esOrganizador:p.data.esOrganizador}}catch(p){throw console.log("Error updating event:",p),p}},o=async g=>{try{const p=await bt.get(`${e}/api/Calendario/v1/local/ObtenerEvento/${g}`),b=p.data[0].solicitudRelacionada?.[0]?.nombreCliente||null;return{...p.data[0],fechaInicio:p.data[0].fechaInicio,fechaFin:p.data[0].fechaFin,client:b}}catch(p){throw console.error(`Error fetching event with ID ${g}:`,p),p}},s=async g=>{try{await bt.post(`${e}/api/Calendario/v1/local/EliminarEvento/${g}`)}catch(p){throw console.log(`Error ID ${g}:`,p),p}},i=v.useCallback(async(g,p,b,_)=>{try{const S={masNombreBD:b,usrID:_,disID:p,nombreCliente:g},C=(await bt.post(`${e}/api/Calendario/v1/local/ConsultaClientesXUsuariologgeado/`,S)).data?.data;return Array.isArray(C)?C.map(w=>({clienteID:w.clienteID,solID:w.solID,marca:w?.marca,modelo:w?.modelo,nombreCliente:w?.nombreCliente})):[]}catch(S){return console.error("Error clientes:",S),[]}},[e]),a=v.useCallback(async(g,p)=>{try{const b={disID:g,usrMail:p},S=(await bt.post(`${e}/api/Calendario/v1/Consulta_UsuariosInvitados/`,b)).data?.data;return console.log("users",S),Array.isArray(S)?S.map(D=>({usrID:D.usrID,usrNombre:D.usrNombre,usrMail:D?.usrMail,disID:D?.disID})):[]}catch(b){return console.error("Error usuarios:",b),[]}},[e]),c=async(g,p,b,_,S)=>{const D={tieneConflicto:!1,usrMail:""};try{const C={disID:g,usrMail:p,startDate:b,horaInicio:_,horaFin:S};return(await bt.post(`${e}/api/Calendario/v1/local/ConsultaConflictoInvitados`,C)).data?.data}catch(C){return console.error("Error al verificar conflicto:",C),D}},u=v.useCallback(async(g,p,b,_)=>{try{const S={disID:g,usrMail:p,startDate:b,DuracionEvento:_},C=(await bt.post(`${e}/api/Calendario/v1/local/ConsultaDisponibilidadUsuario`,S)).data?.data;return Array.isArray(C)?C.map(w=>({Fecha:w.fecha,HoraInicio:w.horaInicio,HoraFin:w.horaFin})):[]}catch(S){return console.error("Error usuarios:",S),[]}},[e]),d=v.useCallback(async(g,p=!1)=>{try{return(await bt.post(`${e}/api/Notificaciones/v1/local/ObtenerNotificacionesPorUsuarioAsync/${g}?soloNoLeidas=${p}`)).data}catch(b){return console.error("Error usuarios:",b),[]}},[e]);return{getEventsByUser:r,createEvent:t,updateEvent:n,getEventById:o,deleteEvent:s,getClients:i,getUsuariosInvitados:a,VerificarConflicto:c,getDisponibilidadUsuario:u,getNotificacionesXUsuario:d,UpdateStatusEvento:async(g,p,b)=>{try{const _={EventoID:g,UsuarioID:p,status:b};return(await bt.post(`${e}/api/Calendario/v1/local/ActualizarEstadoInvitacionAsync/`,_)).data}catch(_){return console.error("Error Actualizar estatus:",_),{}}},MarcarLeido:async(g,p)=>{try{return(await bt.post(`${e}/api/Notificaciones/v1/local/MarcarComoLeidaAsync/${g}?usuarioId=${p}&marcarComoLeida=true`)).data?.data}catch(b){return console.error("Error Actualizar estatus:",b),{}}},ReenviarNotificacion:async(g,p)=>{try{return(await bt.post(`${e}/api/Calendario/v1/local/ReenviarNotificacion/${p}/${g}`)).data?.data}catch(b){return console.error("Error Actualizar estatus:",b),{}}}}};var To={},Af;function uw(){if(Af)return To;Af=1;var e=ct();Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var r=e(ht()),t=dt();return To.default=(0,r.default)([(0,t.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,t.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),To}var dw=uw();const ic=at(dw);var Mo=e=>e.type==="checkbox",mn=e=>e instanceof Date,Gt=e=>e==null;const Tf=e=>typeof e=="object";var jt=e=>!Gt(e)&&!Array.isArray(e)&&Tf(e)&&!mn(e),Mf=e=>jt(e)&&e.target?Mo(e.target)?e.target.checked:e.target.value:e,fw=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,If=(e,r)=>e.has(fw(r)),pw=e=>{const r=e.constructor&&e.constructor.prototype;return jt(r)&&r.hasOwnProperty("isPrototypeOf")},ac=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Bt(e){let r;const t=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(ac&&(e instanceof Blob||n))&&(t||jt(e)))if(r=t?[]:Object.create(Object.getPrototypeOf(e)),!t&&!pw(e))r=e;else for(const o in e)e.hasOwnProperty(o)&&(r[o]=Bt(e[o]));else return e;return r}var vi=e=>/^\w*$/.test(e),Pt=e=>e===void 0,cc=e=>Array.isArray(e)?e.filter(Boolean):[],lc=e=>cc(e.replace(/["|']|\]/g,"").split(/\.|\[/)),pe=(e,r,t)=>{if(!r||!jt(e))return t;const n=(vi(r)?[r]:lc(r)).reduce((o,s)=>Gt(o)?o:o[s],e);return Pt(n)||n===e?Pt(e[r])?t:e[r]:n},sr=e=>typeof e=="boolean",st=(e,r,t)=>{let n=-1;const o=vi(r)?[r]:lc(r),s=o.length,i=s-1;for(;++n<s;){const a=o[n];let c=t;if(n!==i){const u=e[a];c=jt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const yi={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Vr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},uc=v.createContext(null);uc.displayName="HookFormContext";const dc=()=>v.useContext(uc),hw=e=>{const{children:r,...t}=e;return v.createElement(uc.Provider,{value:t},r)};var Of=(e,r,t,n=!0)=>{const o={defaultValues:r._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return r._proxyFormState[i]!==xr.all&&(r._proxyFormState[i]=!n||xr.all),t&&(t[i]=!0),e[i]}});return o};const fc=typeof window<"u"?v.useLayoutEffect:v.useEffect;function mw(e){const r=dc(),{control:t=r.control,disabled:n,name:o,exact:s}=e||{},[i,a]=v.useState(t._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return fc(()=>t._subscribe({name:o,formState:c.current,exact:s,callback:u=>{!n&&a({...t._formState,...u})}}),[o,n,s]),v.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>Of(i,t,c.current,!1),[i,t])}var Nr=e=>typeof e=="string",jf=(e,r,t,n,o)=>Nr(e)?(n&&r.watch.add(e),pe(t,e,o)):Array.isArray(e)?e.map(s=>(n&&r.watch.add(s),pe(t,s))):(n&&(r.watchAll=!0),t),pc=e=>Gt(e)||!Tf(e);function Ur(e,r,t=new WeakSet){if(pc(e)||pc(r))return e===r;if(mn(e)&&mn(r))return e.getTime()===r.getTime();const n=Object.keys(e),o=Object.keys(r);if(n.length!==o.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const s of n){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=r[s];if(mn(i)&&mn(a)||jt(i)&&jt(a)||Array.isArray(i)&&Array.isArray(a)?!Ur(i,a,t):i!==a)return!1}}return!0}function Pf(e){const r=dc(),{control:t=r.control,name:n,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=v.useRef(o),u=v.useRef(a),d=v.useRef(void 0);u.current=a;const f=v.useMemo(()=>t._getWatch(n,c.current),[t,n]),[h,y]=v.useState(u.current?u.current(f):f);return fc(()=>t._subscribe({name:n,formState:{values:!0},exact:i,callback:g=>{if(!s){const p=jf(n,t._names,g.values||t._formValues,!1,c.current);if(u.current){const b=u.current(p);Ur(b,d.current)||(y(b),d.current=b)}else y(p)}}}),[t,s,n,i]),v.useEffect(()=>t._removeUnmounted()),h}function gw(e){const r=dc(),{name:t,disabled:n,control:o=r.control,shouldUnregister:s,defaultValue:i}=e,a=If(o._names.array,t),c=v.useMemo(()=>pe(o._formValues,t,pe(o._defaultValues,t,i)),[o,t,i]),u=Pf({control:o,name:t,defaultValue:c,exact:!0}),d=mw({control:o,name:t,exact:!0}),f=v.useRef(e),h=v.useRef(o.register(t,{...e.rules,value:u,...sr(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const y=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!pe(d.errors,t)},isDirty:{enumerable:!0,get:()=>!!pe(d.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!pe(d.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!pe(d.validatingFields,t)},error:{enumerable:!0,get:()=>pe(d.errors,t)}}),[d,t]),g=v.useCallback(S=>h.current.onChange({target:{value:Mf(S),name:t},type:yi.CHANGE}),[t]),p=v.useCallback(()=>h.current.onBlur({target:{value:pe(o._formValues,t),name:t},type:yi.BLUR}),[t,o._formValues]),b=v.useCallback(S=>{const D=pe(o._fields,t);D&&S&&(D._f.ref={focus:()=>S.focus&&S.focus(),select:()=>S.select&&S.select(),setCustomValidity:C=>S.setCustomValidity(C),reportValidity:()=>S.reportValidity()})},[o._fields,t]),_=v.useMemo(()=>({name:t,value:u,...sr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:g,onBlur:p,ref:b}),[t,n,d.disabled,g,p,b,u]);return v.useEffect(()=>{const S=o._options.shouldUnregister||s;o.register(t,{...f.current.rules,...sr(f.current.disabled)?{disabled:f.current.disabled}:{}});const D=(C,w)=>{const F=pe(o._fields,C);F&&F._f&&(F._f.mount=w)};if(D(t,!0),S){const C=Bt(pe(o._options.defaultValues,t));st(o._defaultValues,t,C),Pt(pe(o._formValues,t))&&st(o._formValues,t,C)}return!a&&o.register(t),()=>{(a?S&&!o._state.action:S)?o.unregister(t):D(t,!1)}},[t,o,a,s]),v.useEffect(()=>{o._setDisabledField({disabled:n,name:t})},[n,t,o]),v.useMemo(()=>({field:_,formState:d,fieldState:y}),[_,d,y])}const ir=e=>e.render(gw(e));var hc=(e,r,t,n,o)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[n]:o||!0}}:{},Io=e=>Array.isArray(e)?e:[e],Rf=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},Jt=e=>jt(e)&&!Object.keys(e).length,mc=e=>e.type==="file",wr=e=>typeof e=="function",bi=e=>{if(!ac)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Nf=e=>e.type==="select-multiple",gc=e=>e.type==="radio",vw=e=>gc(e)||Mo(e),vc=e=>bi(e)&&e.isConnected;function yw(e,r){const t=r.slice(0,-1).length;let n=0;for(;n<t;)e=Pt(e)?n++:e[r[n++]];return e}function bw(e){for(const r in e)if(e.hasOwnProperty(r)&&!Pt(e[r]))return!1;return!0}function zt(e,r){const t=Array.isArray(r)?r:vi(r)?[r]:lc(r),n=t.length===1?e:yw(e,t),o=t.length-1,s=t[o];return n&&delete n[s],o!==0&&(jt(n)&&Jt(n)||Array.isArray(n)&&bw(n))&&zt(e,t.slice(0,-1)),e}var $f=e=>{for(const r in e)if(wr(e[r]))return!0;return!1};function xi(e,r={}){const t=Array.isArray(e);if(jt(e)||t)for(const n in e)Array.isArray(e[n])||jt(e[n])&&!$f(e[n])?(r[n]=Array.isArray(e[n])?[]:{},xi(e[n],r[n])):Gt(e[n])||(r[n]=!0);return r}function Lf(e,r,t){const n=Array.isArray(e);if(jt(e)||n)for(const o in e)Array.isArray(e[o])||jt(e[o])&&!$f(e[o])?Pt(r)||pc(t[o])?t[o]=Array.isArray(e[o])?xi(e[o],[]):{...xi(e[o])}:Lf(e[o],Gt(r)?{}:r[o],t[o]):t[o]=!Ur(e[o],r[o]);return t}var Oo=(e,r)=>Lf(e,r,xi(r));const zf={value:!1,isValid:!1},Bf={value:!0,isValid:!0};var Ff=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Pt(e[0].attributes.value)?Pt(e[0].value)||e[0].value===""?Bf:{value:e[0].value,isValid:!0}:Bf:zf}return zf},Vf=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:n})=>Pt(e)?e:r?e===""?NaN:e&&+e:t&&Nr(e)?new Date(e):n?n(e):e;const Uf={isValid:!1,value:null};var Wf=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Uf):Uf;function Hf(e){const r=e.ref;return mc(r)?r.files:gc(r)?Wf(e.refs).value:Nf(r)?[...r.selectedOptions].map(({value:t})=>t):Mo(r)?Ff(e.refs).value:Vf(Pt(r.value)?e.ref.value:r.value,e)}var xw=(e,r,t,n)=>{const o={};for(const s of e){const i=pe(r,s);i&&st(o,s,i._f)}return{criteriaMode:t,names:[...e],fields:o,shouldUseNativeValidation:n}},wi=e=>e instanceof RegExp,jo=e=>Pt(e)?e:wi(e)?e.source:jt(e)?wi(e.value)?e.value.source:e.value:e,Yf=e=>({isOnSubmit:!e||e===xr.onSubmit,isOnBlur:e===xr.onBlur,isOnChange:e===xr.onChange,isOnAll:e===xr.all,isOnTouch:e===xr.onTouched});const qf="AsyncFunction";var ww=e=>!!e&&!!e.validate&&!!(wr(e.validate)&&e.validate.constructor.name===qf||jt(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===qf)),_w=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Zf=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Po=(e,r,t,n)=>{for(const o of t||Object.keys(e)){const s=pe(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&r(i.refs[0],o)&&!n)return!0;if(i.ref&&r(i.ref,i.name)&&!n)return!0;if(Po(a,r))break}else if(jt(a)&&Po(a,r))break}}};function Gf(e,r,t){const n=pe(e,t);if(n||vi(t))return{error:n,name:t};const o=t.split(".");for(;o.length;){const s=o.join("."),i=pe(r,s),a=pe(e,s);if(i&&!Array.isArray(i)&&t!==s)return{name:t};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:t}}var Sw=(e,r,t,n)=>{t(e);const{name:o,...s}=e;return Jt(s)||Object.keys(s).length>=Object.keys(r).length||Object.keys(s).find(i=>r[i]===(!n||xr.all))},Cw=(e,r,t)=>!e||!r||e===r||Io(e).some(n=>n&&(t?n===r:n.startsWith(r)||r.startsWith(n))),Ew=(e,r,t,n,o)=>o.isOnAll?!1:!t&&o.isOnTouch?!(r||e):(t?n.isOnBlur:o.isOnBlur)?!e:(t?n.isOnChange:o.isOnChange)?e:!0,Dw=(e,r)=>!cc(pe(e,r)).length&&zt(e,r),kw=(e,r,t)=>{const n=Io(pe(e,t));return st(n,"root",r[t]),st(e,t,n),e},_i=e=>Nr(e);function Kf(e,r,t="validate"){if(_i(e)||Array.isArray(e)&&e.every(_i)||sr(e)&&!e)return{type:t,message:_i(e)?e:"",ref:r}}var $n=e=>jt(e)&&!wi(e)?e:{value:e,message:""},Qf=async(e,r,t,n,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:y,validate:g,name:p,valueAsNumber:b,mount:_}=e._f,S=pe(t,p);if(!_||r.has(p))return{};const D=a?a[0]:i,C=q=>{o&&D.reportValidity&&(D.setCustomValidity(sr(q)?"":q||""),D.reportValidity())},w={},F=gc(i),E=Mo(i),T=F||E,I=(b||mc(i))&&Pt(i.value)&&Pt(S)||bi(i)&&i.value===""||S===""||Array.isArray(S)&&!S.length,M=hc.bind(null,p,n,w),U=(q,V,H,re=Vr.maxLength,W=Vr.minLength)=>{const $=q?V:H;w[p]={type:q?re:W,message:$,ref:i,...M(q?re:W,$)}};if(s?!Array.isArray(S)||!S.length:c&&(!T&&(I||Gt(S))||sr(S)&&!S||E&&!Ff(a).isValid||F&&!Wf(a).isValid)){const{value:q,message:V}=_i(c)?{value:!!c,message:c}:$n(c);if(q&&(w[p]={type:Vr.required,message:V,ref:D,...M(Vr.required,V)},!n))return C(V),w}if(!I&&(!Gt(f)||!Gt(h))){let q,V;const H=$n(h),re=$n(f);if(!Gt(S)&&!isNaN(S)){const W=i.valueAsNumber||S&&+S;Gt(H.value)||(q=W>H.value),Gt(re.value)||(V=W<re.value)}else{const W=i.valueAsDate||new Date(S),$=N=>new Date(new Date().toDateString()+" "+N),ie=i.type=="time",ue=i.type=="week";Nr(H.value)&&S&&(q=ie?$(S)>$(H.value):ue?S>H.value:W>new Date(H.value)),Nr(re.value)&&S&&(V=ie?$(S)<$(re.value):ue?S<re.value:W<new Date(re.value))}if((q||V)&&(U(!!q,H.message,re.message,Vr.max,Vr.min),!n))return C(w[p].message),w}if((u||d)&&!I&&(Nr(S)||s&&Array.isArray(S))){const q=$n(u),V=$n(d),H=!Gt(q.value)&&S.length>+q.value,re=!Gt(V.value)&&S.length<+V.value;if((H||re)&&(U(H,q.message,V.message),!n))return C(w[p].message),w}if(y&&!I&&Nr(S)){const{value:q,message:V}=$n(y);if(wi(q)&&!S.match(q)&&(w[p]={type:Vr.pattern,message:V,ref:i,...M(Vr.pattern,V)},!n))return C(V),w}if(g){if(wr(g)){const q=await g(S,t),V=Kf(q,D);if(V&&(w[p]={...V,...M(Vr.validate,V.message)},!n))return C(V.message),w}else if(jt(g)){let q={};for(const V in g){if(!Jt(q)&&!n)break;const H=Kf(await g[V](S,t),D,V);H&&(q={...H,...M(V,H.message)},C(H.message),n&&(w[p]=q))}if(!Jt(q)&&(w[p]={ref:D,...q},!n))return w}}return C(!0),w};const Aw={mode:xr.onSubmit,reValidateMode:xr.onChange,shouldFocusError:!0};function Tw(e={}){let r={...Aw,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:wr(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},n={},o=jt(r.defaultValues)||jt(r.values)?Bt(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:Bt(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:Rf(),state:Rf()},y=r.criteriaMode===xr.all,g=k=>O=>{clearTimeout(u),u=setTimeout(k,O)},p=async k=>{if(!r.disabled&&(d.isValid||f.isValid||k)){const O=r.resolver?Jt((await E()).errors):await I(n,!0);O!==t.isValid&&h.state.next({isValid:O})}},b=(k,O)=>{!r.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((k||Array.from(a.mount)).forEach(B=>{B&&(O?st(t.validatingFields,B,O):zt(t.validatingFields,B))}),h.state.next({validatingFields:t.validatingFields,isValidating:!Jt(t.validatingFields)}))},_=(k,O=[],B,ce,se=!0,j=!0)=>{if(ce&&B&&!r.disabled){if(i.action=!0,j&&Array.isArray(pe(n,k))){const oe=B(pe(n,k),ce.argA,ce.argB);se&&st(n,k,oe)}if(j&&Array.isArray(pe(t.errors,k))){const oe=B(pe(t.errors,k),ce.argA,ce.argB);se&&st(t.errors,k,oe),Dw(t.errors,k)}if((d.touchedFields||f.touchedFields)&&j&&Array.isArray(pe(t.touchedFields,k))){const oe=B(pe(t.touchedFields,k),ce.argA,ce.argB);se&&st(t.touchedFields,k,oe)}(d.dirtyFields||f.dirtyFields)&&(t.dirtyFields=Oo(o,s)),h.state.next({name:k,isDirty:U(k,O),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else st(s,k,O)},S=(k,O)=>{st(t.errors,k,O),h.state.next({errors:t.errors})},D=k=>{t.errors=k,h.state.next({errors:t.errors,isValid:!1})},C=(k,O,B,ce)=>{const se=pe(n,k);if(se){const j=pe(s,k,Pt(B)?pe(o,k):B);Pt(j)||ce&&ce.defaultChecked||O?st(s,k,O?j:Hf(se._f)):H(k,j),i.mount&&p()}},w=(k,O,B,ce,se)=>{let j=!1,oe=!1;const Se={name:k};if(!r.disabled){if(!B||ce){(d.isDirty||f.isDirty)&&(oe=t.isDirty,t.isDirty=Se.isDirty=U(),j=oe!==Se.isDirty);const je=Ur(pe(o,k),O);oe=!!pe(t.dirtyFields,k),je?zt(t.dirtyFields,k):st(t.dirtyFields,k,!0),Se.dirtyFields=t.dirtyFields,j=j||(d.dirtyFields||f.dirtyFields)&&oe!==!je}if(B){const je=pe(t.touchedFields,k);je||(st(t.touchedFields,k,B),Se.touchedFields=t.touchedFields,j=j||(d.touchedFields||f.touchedFields)&&je!==B)}j&&se&&h.state.next(Se)}return j?Se:{}},F=(k,O,B,ce)=>{const se=pe(t.errors,k),j=(d.isValid||f.isValid)&&sr(O)&&t.isValid!==O;if(r.delayError&&B?(c=g(()=>S(k,B)),c(r.delayError)):(clearTimeout(u),c=null,B?st(t.errors,k,B):zt(t.errors,k)),(B?!Ur(se,B):se)||!Jt(ce)||j){const oe={...ce,...j&&sr(O)?{isValid:O}:{},errors:t.errors,name:k};t={...t,...oe},h.state.next(oe)}},E=async k=>{b(k,!0);const O=await r.resolver(s,r.context,xw(k||a.mount,n,r.criteriaMode,r.shouldUseNativeValidation));return b(k),O},T=async k=>{const{errors:O}=await E(k);if(k)for(const B of k){const ce=pe(O,B);ce?st(t.errors,B,ce):zt(t.errors,B)}else t.errors=O;return O},I=async(k,O,B={valid:!0})=>{for(const ce in k){const se=k[ce];if(se){const{_f:j,...oe}=se;if(j){const Se=a.array.has(j.name),je=se._f&&ww(se._f);je&&d.validatingFields&&b([ce],!0);const R=await Qf(se,a.disabled,s,y,r.shouldUseNativeValidation&&!O,Se);if(je&&d.validatingFields&&b([ce]),R[j.name]&&(B.valid=!1,O))break;!O&&(pe(R,j.name)?Se?kw(t.errors,R,j.name):st(t.errors,j.name,R[j.name]):zt(t.errors,j.name))}!Jt(oe)&&await I(oe,O,B)}}return B.valid},M=()=>{for(const k of a.unMount){const O=pe(n,k);O&&(O._f.refs?O._f.refs.every(B=>!vc(B)):!vc(O._f.ref))&&X(k)}a.unMount=new Set},U=(k,O)=>!r.disabled&&(k&&O&&st(s,k,O),!Ur(N(),o)),q=(k,O,B)=>jf(k,a,{...i.mount?s:Pt(O)?o:Nr(k)?{[k]:O}:O},B,O),V=k=>cc(pe(i.mount?s:o,k,r.shouldUnregister?pe(o,k,[]):[])),H=(k,O,B={})=>{const ce=pe(n,k);let se=O;if(ce){const j=ce._f;j&&(!j.disabled&&st(s,k,Vf(O,j)),se=bi(j.ref)&&Gt(O)?"":O,Nf(j.ref)?[...j.ref.options].forEach(oe=>oe.selected=se.includes(oe.value)):j.refs?Mo(j.ref)?j.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(se)?oe.checked=!!se.find(Se=>Se===oe.value):oe.checked=se===oe.value||!!se)}):j.refs.forEach(oe=>oe.checked=oe.value===se):mc(j.ref)?j.ref.value="":(j.ref.value=se,j.ref.type||h.state.next({name:k,values:Bt(s)})))}(B.shouldDirty||B.shouldTouch)&&w(k,se,B.shouldTouch,B.shouldDirty,!0),B.shouldValidate&&ue(k)},re=(k,O,B)=>{for(const ce in O){if(!O.hasOwnProperty(ce))return;const se=O[ce],j=k+"."+ce,oe=pe(n,j);(a.array.has(k)||jt(se)||oe&&!oe._f)&&!mn(se)?re(j,se,B):H(j,se,B)}},W=(k,O,B={})=>{const ce=pe(n,k),se=a.array.has(k),j=Bt(O);st(s,k,j),se?(h.array.next({name:k,values:Bt(s)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&B.shouldDirty&&h.state.next({name:k,dirtyFields:Oo(o,s),isDirty:U(k,j)})):ce&&!ce._f&&!Gt(j)?re(k,j,B):H(k,j,B),Zf(k,a)&&h.state.next({...t,name:k}),h.state.next({name:i.mount?k:void 0,values:Bt(s)})},$=async k=>{i.mount=!0;const O=k.target;let B=O.name,ce=!0;const se=pe(n,B),j=je=>{ce=Number.isNaN(je)||mn(je)&&isNaN(je.getTime())||Ur(je,pe(s,B,je))},oe=Yf(r.mode),Se=Yf(r.reValidateMode);if(se){let je,R;const te=O.type?Hf(se._f):Mf(k),be=k.type===yi.BLUR||k.type===yi.FOCUS_OUT,qe=!_w(se._f)&&!r.resolver&&!pe(t.errors,B)&&!se._f.deps||Ew(be,pe(t.touchedFields,B),t.isSubmitted,Se,oe),Ct=Zf(B,a,be);st(s,B,te),be?(!O||!O.readOnly)&&(se._f.onBlur&&se._f.onBlur(k),c&&c(0)):se._f.onChange&&se._f.onChange(k);const Z=w(B,te,be),de=!Jt(Z)||Ct;if(!be&&h.state.next({name:B,type:k.type,values:Bt(s)}),qe)return(d.isValid||f.isValid)&&(r.mode==="onBlur"?be&&p():be||p()),de&&h.state.next({name:B,...Ct?{}:Z});if(!be&&Ct&&h.state.next({...t}),r.resolver){const{errors:De}=await E([B]);if(j(te),ce){const Me=Gf(t.errors,n,B),Pe=Gf(De,n,Me.name||B);je=Pe.error,B=Pe.name,R=Jt(De)}}else b([B],!0),je=(await Qf(se,a.disabled,s,y,r.shouldUseNativeValidation))[B],b([B]),j(te),ce&&(je?R=!1:(d.isValid||f.isValid)&&(R=await I(n,!0)));ce&&(se._f.deps&&ue(se._f.deps),F(B,R,je,Z))}},ie=(k,O)=>{if(pe(t.errors,O)&&k.focus)return k.focus(),1},ue=async(k,O={})=>{let B,ce;const se=Io(k);if(r.resolver){const j=await T(Pt(k)?k:se);B=Jt(j),ce=k?!se.some(oe=>pe(j,oe)):B}else k?(ce=(await Promise.all(se.map(async j=>{const oe=pe(n,j);return await I(oe&&oe._f?{[j]:oe}:oe)}))).every(Boolean),!(!ce&&!t.isValid)&&p()):ce=B=await I(n);return h.state.next({...!Nr(k)||(d.isValid||f.isValid)&&B!==t.isValid?{}:{name:k},...r.resolver||!k?{isValid:B}:{},errors:t.errors}),O.shouldFocus&&!ce&&Po(n,ie,k?se:a.mount),ce},N=k=>{const O={...i.mount?s:o};return Pt(k)?O:Nr(k)?pe(O,k):k.map(B=>pe(O,B))},ee=(k,O)=>({invalid:!!pe((O||t).errors,k),isDirty:!!pe((O||t).dirtyFields,k),error:pe((O||t).errors,k),isValidating:!!pe(t.validatingFields,k),isTouched:!!pe((O||t).touchedFields,k)}),xe=k=>{k&&Io(k).forEach(O=>zt(t.errors,O)),h.state.next({errors:k?t.errors:{}})},_e=(k,O,B)=>{const ce=(pe(n,k,{_f:{}})._f||{}).ref,se=pe(t.errors,k)||{},{ref:j,message:oe,type:Se,...je}=se;st(t.errors,k,{...je,...O,ref:ce}),h.state.next({name:k,errors:t.errors,isValid:!1}),B&&B.shouldFocus&&ce&&ce.focus&&ce.focus()},fe=(k,O)=>wr(k)?h.state.subscribe({next:B=>"values"in B&&k(q(void 0,O),B)}):q(k,O,!0),ae=k=>h.state.subscribe({next:O=>{Cw(k.name,O.name,k.exact)&&Sw(O,k.formState||d,We,k.reRenderRoot)&&k.callback({values:{...s},...t,...O,defaultValues:o})}}).unsubscribe,le=k=>(i.mount=!0,f={...f,...k.formState},ae({...k,formState:f})),X=(k,O={})=>{for(const B of k?Io(k):a.mount)a.mount.delete(B),a.array.delete(B),O.keepValue||(zt(n,B),zt(s,B)),!O.keepError&&zt(t.errors,B),!O.keepDirty&&zt(t.dirtyFields,B),!O.keepTouched&&zt(t.touchedFields,B),!O.keepIsValidating&&zt(t.validatingFields,B),!r.shouldUnregister&&!O.keepDefaultValue&&zt(o,B);h.state.next({values:Bt(s)}),h.state.next({...t,...O.keepDirty?{isDirty:U()}:{}}),!O.keepIsValid&&p()},we=({disabled:k,name:O})=>{(sr(k)&&i.mount||k||a.disabled.has(O))&&(k?a.disabled.add(O):a.disabled.delete(O))},ye=(k,O={})=>{let B=pe(n,k);const ce=sr(O.disabled)||sr(r.disabled);return st(n,k,{...B||{},_f:{...B&&B._f?B._f:{ref:{name:k}},name:k,mount:!0,...O}}),a.mount.add(k),B?we({disabled:sr(O.disabled)?O.disabled:r.disabled,name:k}):C(k,!0,O.value),{...ce?{disabled:O.disabled||r.disabled}:{},...r.progressive?{required:!!O.required,min:jo(O.min),max:jo(O.max),minLength:jo(O.minLength),maxLength:jo(O.maxLength),pattern:jo(O.pattern)}:{},name:k,onChange:$,onBlur:$,ref:se=>{if(se){ye(k,O),B=pe(n,k);const j=Pt(se.value)&&se.querySelectorAll&&se.querySelectorAll("input,select,textarea")[0]||se,oe=vw(j),Se=B._f.refs||[];if(oe?Se.find(je=>je===j):j===B._f.ref)return;st(n,k,{_f:{...B._f,...oe?{refs:[...Se.filter(vc),j,...Array.isArray(pe(o,k))?[{}]:[]],ref:{type:j.type,name:k}}:{ref:j}}}),C(k,!1,void 0,j)}else B=pe(n,k,{}),B._f&&(B._f.mount=!1),(r.shouldUnregister||O.shouldUnregister)&&!(If(a.array,k)&&i.action)&&a.unMount.add(k)}}},K=()=>r.shouldFocusError&&Po(n,ie,a.mount),Ie=k=>{sr(k)&&(h.state.next({disabled:k}),Po(n,(O,B)=>{const ce=pe(n,B);ce&&(O.disabled=ce._f.disabled||k,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(se=>{se.disabled=ce._f.disabled||k}))},0,!1))},P=(k,O)=>async B=>{let ce;B&&(B.preventDefault&&B.preventDefault(),B.persist&&B.persist());let se=Bt(s);if(h.state.next({isSubmitting:!0}),r.resolver){const{errors:j,values:oe}=await E();t.errors=j,se=Bt(oe)}else await I(n);if(a.disabled.size)for(const j of a.disabled)zt(se,j);if(zt(t.errors,"root"),Jt(t.errors)){h.state.next({errors:{}});try{await k(se,B)}catch(j){ce=j}}else O&&await O({...t.errors},B),K(),setTimeout(K);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jt(t.errors)&&!ce,submitCount:t.submitCount+1,errors:t.errors}),ce)throw ce},Be=(k,O={})=>{pe(n,k)&&(Pt(O.defaultValue)?W(k,Bt(pe(o,k))):(W(k,O.defaultValue),st(o,k,Bt(O.defaultValue))),O.keepTouched||zt(t.touchedFields,k),O.keepDirty||(zt(t.dirtyFields,k),t.isDirty=O.defaultValue?U(k,Bt(pe(o,k))):U()),O.keepError||(zt(t.errors,k),d.isValid&&p()),h.state.next({...t}))},Qe=(k,O={})=>{const B=k?Bt(k):o,ce=Bt(B),se=Jt(k),j=se?o:ce;if(O.keepDefaultValues||(o=B),!O.keepValues){if(O.keepDirtyValues){const oe=new Set([...a.mount,...Object.keys(Oo(o,s))]);for(const Se of Array.from(oe))pe(t.dirtyFields,Se)?st(j,Se,pe(s,Se)):W(Se,pe(j,Se))}else{if(ac&&Pt(k))for(const oe of a.mount){const Se=pe(n,oe);if(Se&&Se._f){const je=Array.isArray(Se._f.refs)?Se._f.refs[0]:Se._f.ref;if(bi(je)){const R=je.closest("form");if(R){R.reset();break}}}}if(O.keepFieldsRef)for(const oe of a.mount)W(oe,pe(j,oe));else n={}}s=r.shouldUnregister?O.keepDefaultValues?Bt(o):{}:Bt(j),h.array.next({values:{...j}}),h.state.next({values:{...j}})}a={mount:O.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!O.keepIsValid||!!O.keepDirtyValues,i.watch=!!r.shouldUnregister,h.state.next({submitCount:O.keepSubmitCount?t.submitCount:0,isDirty:se?!1:O.keepDirty?t.isDirty:!!(O.keepDefaultValues&&!Ur(k,o)),isSubmitted:O.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:se?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Oo(o,s):t.dirtyFields:O.keepDefaultValues&&k?Oo(o,k):O.keepDirty?t.dirtyFields:{},touchedFields:O.keepTouched?t.touchedFields:{},errors:O.keepErrors?t.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Fe=(k,O)=>Qe(wr(k)?k(s):k,O),Le=(k,O={})=>{const B=pe(n,k),ce=B&&B._f;if(ce){const se=ce.refs?ce.refs[0]:ce.ref;se.focus&&(se.focus(),O.shouldSelect&&wr(se.select)&&se.select())}},We=k=>{t={...t,...k}},ft={control:{register:ye,unregister:X,getFieldState:ee,handleSubmit:P,setError:_e,_subscribe:ae,_runSchema:E,_focusError:K,_getWatch:q,_getDirty:U,_setValid:p,_setFieldArray:_,_setDisabledField:we,_setErrors:D,_getFieldArray:V,_reset:Qe,_resetDefaultValues:()=>wr(r.defaultValues)&&r.defaultValues().then(k=>{Fe(k,r.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:M,_disableForm:Ie,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(k){i=k},get _defaultValues(){return o},get _names(){return a},set _names(k){a=k},get _formState(){return t},get _options(){return r},set _options(k){r={...r,...k}}},subscribe:le,trigger:ue,register:ye,handleSubmit:P,watch:fe,setValue:W,getValues:N,reset:Fe,resetField:Be,clearErrors:xe,unregister:X,setError:_e,setFocus:Le,getFieldState:ee};return{...ft,formControl:ft}}function Xf(e={}){const r=v.useRef(void 0),t=v.useRef(void 0),[n,o]=v.useState({isDirty:!1,isValidating:!1,isLoading:wr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:wr(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:n},e.defaultValues&&!wr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=Tw(e);r.current={...a,formState:n}}const s=r.current.control;return s._options=e,fc(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),v.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),v.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),v.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),v.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==n.isDirty&&s._subjects.state.next({isDirty:i})}},[s,n.isDirty]),v.useEffect(()=>{e.values&&!Ur(e.values,t.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),t.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[s,e.values]),v.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),r.current.formState=Of(n,s),r.current}const Jf=(e,r,t)=>{if(e&&"reportValidity"in e){const n=pe(t,r);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},yc=(e,r)=>{for(const t in r.fields){const n=r.fields[t];n&&n.ref&&"reportValidity"in n.ref?Jf(n.ref,t,e):n&&n.refs&&n.refs.forEach(o=>Jf(o,t,e))}},ep=(e,r)=>{r.shouldUseNativeValidation&&yc(e,r);const t={};for(const n in e){const o=pe(r.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(Mw(r.names||Object.keys(e),n)){const i=Object.assign({},pe(t,n));st(i,"root",s),st(t,n,i)}else st(t,n,s)}return t},Mw=(e,r)=>{const t=tp(r);return e.some(n=>tp(n).match(`^${t}\\.\\d+`))};function tp(e){return e.replace(/\]|\[/g,"")}function Y(e,r,t){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),r(a,c);for(const d in i.prototype)d in a||Object.defineProperty(a,d,{value:i.prototype[d].bind(a)});a._zod.constr=i,a._zod.def=c}const o=t?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=t?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>t?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Ln extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const np={};function gn(e){return np}function Iw(e){const r=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>r.indexOf(+n)===-1).map(([n,o])=>o)}function bc(e,r){return typeof r=="bigint"?r.toString():r}function xc(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function wc(e){return e==null}function _c(e){const r=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(r,t)}function Ow(e,r){const t=(e.toString().split(".")[1]||"").length,n=r.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=t>o?t:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(r.toFixed(s).replace(".",""));return i%a/10**s}const op=Symbol("evaluating");function mt(e,r,t){let n;Object.defineProperty(e,r,{get(){if(n!==op)return n===void 0&&(n=op,n=t()),n},set(o){Object.defineProperty(e,r,{value:o})},configurable:!0})}function jw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Jr(e,r,t){Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})}function zn(...e){const r={};for(const t of e){const n=Object.getOwnPropertyDescriptors(t);Object.assign(r,n)}return Object.defineProperties({},r)}function sp(e){return JSON.stringify(e)}const ip="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Si(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Pw=xc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ro(e){if(Si(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const t=r.prototype;return!(Si(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function ap(e){return Ro(e)?{...e}:e}const Rw=new Set(["string","number","symbol"]);function Bn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(e,r,t){const n=new e._zod.constr(r??e._zod.def);return(!r||t?.parent)&&(n._zod.parent=e),n}function Ae(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Nw(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const $w={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Lw(e,r){const t=e._zod.def,n=zn(e._zod.def,{get shape(){const o={};for(const s in r){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t.shape[s])}return Jr(this,"shape",o),o},checks:[]});return en(e,n)}function zw(e,r){const t=e._zod.def,n=zn(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in r){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete o[s]}return Jr(this,"shape",o),o},checks:[]});return en(e,n)}function Bw(e,r){if(!Ro(r))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=zn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r};return Jr(this,"shape",s),s},checks:[]});return en(e,o)}function Fw(e,r){if(!Ro(r))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const n={...e._zod.def.shape,...r};return Jr(this,"shape",n),n},checks:e._zod.def.checks};return en(e,t)}function Vw(e,r){const t=zn(e._zod.def,{get shape(){const n={...e._zod.def.shape,...r._zod.def.shape};return Jr(this,"shape",n),n},get catchall(){return r._zod.def.catchall},checks:[]});return en(e,t)}function Uw(e,r,t){const n=zn(r._zod.def,{get shape(){const o=r._zod.def.shape,s={...o};if(t)for(const i in t){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(const i in o)s[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Jr(this,"shape",s),s},checks:[]});return en(r,n)}function Ww(e,r,t){const n=zn(r._zod.def,{get shape(){const o=r._zod.def.shape,s={...o};if(t)for(const i in t){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Jr(this,"shape",s),s},checks:[]});return en(r,n)}function Fn(e,r=0){if(e.aborted===!0)return!0;for(let t=r;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function cp(e,r){return r.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ci(e){return typeof e=="string"?e:e?.message}function vn(e,r,t){const n={...e,path:e.path??[]};if(!e.message){const o=Ci(e.inst?._zod.def?.error?.(e))??Ci(r?.error?.(e))??Ci(t.customError?.(e))??Ci(t.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,r?.reportInput||delete n.input,n}function Sc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function No(...e){const[r,t,n]=e;return typeof r=="string"?{message:r,code:"custom",input:t,inst:n}:{...r}}const lp=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,bc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cc=Y("$ZodError",lp),Ei=Y("$ZodError",lp,{Parent:Error});function Hw(e,r=t=>t.message){const t={},n=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(r(o))):n.push(r(o));return{formErrors:n,fieldErrors:t}}function Yw(e,r){const t=r||function(s){return s.message},n={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let a=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}const Di=e=>(r,t,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=r._zod.run({value:t,issues:[]},s);if(i instanceof Promise)throw new Ln;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vn(c,s,gn())));throw ip(a,o?.callee),a}return i.value},qw=Di(Ei),ki=e=>async(r,t,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=r._zod.run({value:t,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vn(c,s,gn())));throw ip(a,o?.callee),a}return i.value},Zw=ki(Ei),Ai=e=>(r,t,n)=>{const o=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new Ln;return s.issues.length?{success:!1,error:new(e??Cc)(s.issues.map(i=>vn(i,o,gn())))}:{success:!0,data:s.value}},Gw=Ai(Ei),Ti=e=>async(r,t,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=r._zod.run({value:t,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>vn(i,o,gn())))}:{success:!0,data:s.value}},Kw=Ti(Ei),Qw=e=>(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Di(e)(r,t,o)},Xw=e=>(r,t,n)=>Di(e)(r,t,n),Jw=e=>async(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ki(e)(r,t,o)},e_=e=>async(r,t,n)=>ki(e)(r,t,n),t_=e=>(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ai(e)(r,t,o)},r_=e=>(r,t,n)=>Ai(e)(r,t,n),n_=e=>async(r,t,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ti(e)(r,t,o)},o_=e=>async(r,t,n)=>Ti(e)(r,t,n),s_=/^[cC][^\s-]{8,}$/,i_=/^[0-9a-z]+$/,a_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,c_=/^[0-9a-vA-V]{20}$/,l_=/^[A-Za-z0-9]{27}$/,u_=/^[a-zA-Z0-9_-]{21}$/,d_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,f_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,up=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,p_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,h_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function m_(){return new RegExp(h_,"u")}const g_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,y_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,b_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,x_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dp=/^[A-Za-z0-9_-]*$/,w_=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,__=/^\+(?:[0-9]){6,14}[0-9]$/,fp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",S_=new RegExp(`^${fp}$`);function pp(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C_(e){return new RegExp(`^${pp(e)}$`)}function E_(e){const r=pp({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${r}(?:${t.join("|")})`;return new RegExp(`^${fp}T(?:${n})$`)}const D_=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},k_=/^\d+$/,A_=/^-?\d+(?:\.\d+)?/i,T_=/true|false/i,M_=/^[^A-Z]*$/,I_=/^[^a-z]*$/,er=Y("$ZodCheck",(e,r)=>{var t;e._zod??(e._zod={}),e._zod.def=r,(t=e._zod).onattach??(t.onattach=[])}),hp={number:"number",bigint:"bigint",object:"date"},mp=Y("$ZodCheckLessThan",(e,r)=>{er.init(e,r);const t=hp[typeof r.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(r.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<s&&(r.inclusive?o.maximum=r.value:o.exclusiveMaximum=r.value)}),e._zod.check=n=>{(r.inclusive?n.value<=r.value:n.value<r.value)||n.issues.push({origin:t,code:"too_big",maximum:r.value,input:n.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),gp=Y("$ZodCheckGreaterThan",(e,r)=>{er.init(e,r);const t=hp[typeof r.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(r.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>s&&(r.inclusive?o.minimum=r.value:o.exclusiveMinimum=r.value)}),e._zod.check=n=>{(r.inclusive?n.value>=r.value:n.value>r.value)||n.issues.push({origin:t,code:"too_small",minimum:r.value,input:n.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),O_=Y("$ZodCheckMultipleOf",(e,r)=>{er.init(e,r),e._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=r.value)}),e._zod.check=t=>{if(typeof t.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%r.value===BigInt(0):Ow(t.value,r.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:r.value,input:t.value,inst:e,continue:!r.abort})}}),j_=Y("$ZodCheckNumberFormat",(e,r)=>{er.init(e,r),r.format=r.format||"float64";const t=r.format?.includes("int"),n=t?"int":"number",[o,s]=$w[r.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=r.format,a.minimum=o,a.maximum=s,t&&(a.pattern=k_)}),e._zod.check=i=>{const a=i.value;if(t){if(!Number.isInteger(a)){i.issues.push({expected:n,format:r.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!r.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!r.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!r.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),P_=Y("$ZodCheckMaxLength",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<o&&(n._zod.bag.maximum=r.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=r.maximum)return;const i=Sc(o);n.issues.push({origin:i,code:"too_big",maximum:r.maximum,inclusive:!0,input:o,inst:e,continue:!r.abort})}}),R_=Y("$ZodCheckMinLength",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>o&&(n._zod.bag.minimum=r.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=r.minimum)return;const i=Sc(o);n.issues.push({origin:i,code:"too_small",minimum:r.minimum,inclusive:!0,input:o,inst:e,continue:!r.abort})}}),N_=Y("$ZodCheckLengthEquals",(e,r)=>{var t;er.init(e,r),(t=e._zod.def).when??(t.when=n=>{const o=n.value;return!wc(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=r.length,o.maximum=r.length,o.length=r.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===r.length)return;const i=Sc(o),a=s>r.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!r.abort})}}),Mi=Y("$ZodCheckStringFormat",(e,r)=>{var t,n;er.init(e,r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=r.format,r.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(r.pattern))}),r.pattern?(t=e._zod).check??(t.check=o=>{r.pattern.lastIndex=0,!r.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:r.format,input:o.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(n=e._zod).check??(n.check=()=>{})}),$_=Y("$ZodCheckRegex",(e,r)=>{Mi.init(e,r),e._zod.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),L_=Y("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=M_),Mi.init(e,r)}),z_=Y("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=I_),Mi.init(e,r)}),B_=Y("$ZodCheckIncludes",(e,r)=>{er.init(e,r);const t=Bn(r.includes),n=new RegExp(typeof r.position=="number"?`^.{${r.position}}${t}`:t);r.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(r.includes,r.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:o.value,inst:e,continue:!r.abort})}}),F_=Y("$ZodCheckStartsWith",(e,r)=>{er.init(e,r);const t=new RegExp(`^${Bn(r.prefix)}.*`);r.pattern??(r.pattern=t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=n=>{n.value.startsWith(r.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:n.value,inst:e,continue:!r.abort})}}),V_=Y("$ZodCheckEndsWith",(e,r)=>{er.init(e,r);const t=new RegExp(`.*${Bn(r.suffix)}$`);r.pattern??(r.pattern=t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=n=>{n.value.endsWith(r.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:n.value,inst:e,continue:!r.abort})}}),U_=Y("$ZodCheckOverwrite",(e,r)=>{er.init(e,r),e._zod.check=t=>{t.value=r.tx(t.value)}});class W_{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const n=r.split(`
|
|
161
161
|
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const r=Function,t=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new r(...t,o.join(`
|
|
162
162
|
`))}}const H_={major:4,minor:1,patch:5},At=Y("$ZodType",(e,r)=>{var t;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=H_;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=Fn(i),d;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const h=i.issues.length,y=f._zod.check(i);if(y instanceof Promise&&c?.async===!1)throw new Ln;if(d||y instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await y,i.issues.length!==h&&(u||(u=Fn(i,h)))});else{if(i.issues.length===h)continue;u||(u=Fn(i,h))}}return d?d.then(()=>i):i},s=(i,a,c)=>{if(Fn(i))return i.aborted=!0,i;const u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Ln;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Ln;return c.then(u=>o(u,n,a))}return o(c,n,a)}}e["~standard"]={validate:o=>{try{const s=Gw(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Kw(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Ec=Y("$ZodString",(e,r)=>{At.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??D_(e._zod.bag),e._zod.parse=(t,n)=>{if(r.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:e}),t}}),xt=Y("$ZodStringFormat",(e,r)=>{Mi.init(e,r),Ec.init(e,r)}),Y_=Y("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=f_),xt.init(e,r)}),q_=Y("$ZodUUID",(e,r)=>{if(r.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(n===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=up(n))}else r.pattern??(r.pattern=up());xt.init(e,r)}),Z_=Y("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=p_),xt.init(e,r)}),G_=Y("$ZodURL",(e,r)=>{xt.init(e,r),e._zod.check=t=>{try{const n=t.value.trim(),o=new URL(n);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w_.source,input:t.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:t.value,inst:e,continue:!r.abort})),r.normalize?t.value=o.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:e,continue:!r.abort})}}}),K_=Y("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=m_()),xt.init(e,r)}),Q_=Y("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=u_),xt.init(e,r)}),X_=Y("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=s_),xt.init(e,r)}),J_=Y("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=i_),xt.init(e,r)}),eS=Y("$ZodULID",(e,r)=>{r.pattern??(r.pattern=a_),xt.init(e,r)}),tS=Y("$ZodXID",(e,r)=>{r.pattern??(r.pattern=c_),xt.init(e,r)}),rS=Y("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=l_),xt.init(e,r)}),nS=Y("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=E_(r)),xt.init(e,r)}),oS=Y("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=S_),xt.init(e,r)}),sS=Y("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=C_(r)),xt.init(e,r)}),iS=Y("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=d_),xt.init(e,r)}),aS=Y("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=g_),xt.init(e,r),e._zod.onattach.push(t=>{const n=t._zod.bag;n.format="ipv4"})}),cS=Y("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=v_),xt.init(e,r),e._zod.onattach.push(t=>{const n=t._zod.bag;n.format="ipv6"}),e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e,continue:!r.abort})}}}),lS=Y("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=y_),xt.init(e,r)}),uS=Y("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=b_),xt.init(e,r),e._zod.check=t=>{const[n,o]=t.value.split("/");try{if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e,continue:!r.abort})}}});function vp(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dS=Y("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=x_),xt.init(e,r),e._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64"}),e._zod.check=t=>{vp(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e,continue:!r.abort})}});function fS(e){if(!dp.test(e))return!1;const r=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=r.padEnd(Math.ceil(r.length/4)*4,"=");return vp(t)}const pS=Y("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=dp),xt.init(e,r),e._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64url"}),e._zod.check=t=>{fS(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e,continue:!r.abort})}}),hS=Y("$ZodE164",(e,r)=>{r.pattern??(r.pattern=__),xt.init(e,r)});function mS(e,r=null){try{const t=e.split(".");if(t.length!==3)return!1;const[n]=t;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||r&&(!("alg"in o)||o.alg!==r))}catch{return!1}}const gS=Y("$ZodJWT",(e,r)=>{xt.init(e,r),e._zod.check=t=>{mS(t.value,r.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:e,continue:!r.abort})}}),yp=Y("$ZodNumber",(e,r)=>{At.init(e,r),e._zod.pattern=e._zod.bag.pattern??A_,e._zod.parse=(t,n)=>{if(r.coerce)try{t.value=Number(t.value)}catch{}const o=t.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return t;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),t}}),vS=Y("$ZodNumber",(e,r)=>{j_.init(e,r),yp.init(e,r)}),yS=Y("$ZodBoolean",(e,r)=>{At.init(e,r),e._zod.pattern=T_,e._zod.parse=(t,n)=>{if(r.coerce)try{t.value=!!t.value}catch{}const o=t.value;return typeof o=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),t}}),bS=Y("$ZodUnknown",(e,r)=>{At.init(e,r),e._zod.parse=t=>t}),xS=Y("$ZodNever",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function bp(e,r,t){e.issues.length&&r.issues.push(...cp(t,e.issues)),r.value[t]=e.value}const wS=Y("$ZodArray",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),t;t.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=r.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>bp(u,t,i))):bp(c,t,i)}return s.length?Promise.all(s).then(()=>t):t}});function Ii(e,r,t,n){e.issues.length&&r.issues.push(...cp(t,e.issues)),e.value===void 0?t in n&&(r.value[t]=void 0):r.value[t]=e.value}function xp(e){const r=Object.keys(e.shape);for(const n of r)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const t=Nw(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(t)}}function wp(e,r,t,n,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const d of Object.keys(r)){if(a.has(d))continue;if(u==="never"){i.push(d);continue}const f=c.run({value:r[d],issues:[]},n);f instanceof Promise?e.push(f.then(h=>Ii(h,t,d,r))):Ii(f,t,d,r)}return i.length&&t.issues.push({code:"unrecognized_keys",keys:i,input:r,inst:s}),e.length?Promise.all(e).then(()=>t):t}const _S=Y("$ZodObject",(e,r)=>{At.init(e,r);const t=xc(()=>xp(r));mt(e._zod,"propValues",()=>{const i=r.shape,a={};for(const c in i){const u=i[c]._zod;if(u.values){a[c]??(a[c]=new Set);for(const d of u.values)a[c].add(d)}}return a});const n=Si,o=r.catchall;let s;e._zod.parse=(i,a)=>{s??(s=t.value);const c=i.value;if(!n(c))return i.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),i;i.value={};const u=[],d=s.shape;for(const f of s.keys){const y=d[f]._zod.run({value:c[f],issues:[]},a);y instanceof Promise?u.push(y.then(g=>Ii(g,i,f,c))):Ii(y,i,f,c)}return o?wp(u,c,i,a,t.value,e):u.length?Promise.all(u).then(()=>i):i}}),SS=Y("$ZodObjectJIT",(e,r)=>{_S.init(e,r);const t=e._zod.parse,n=xc(()=>xp(r)),o=h=>{const y=new W_(["shape","payload","ctx"]),g=n.value,p=D=>{const C=sp(D);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};y.write("const input = payload.value;");const b=Object.create(null);let _=0;for(const D of g.keys)b[D]=`key_${_++}`;y.write("const newResult = {}");for(const D of g.keys){const C=b[D],w=sp(D);y.write(`const ${C} = ${p(D)};`),y.write(`
|
|
163
163
|
if (${C}.issues.length) {
|
|
@@ -174,7 +174,7 @@ const theme2 = createTheme({ palette: {
|
|
|
174
174
|
} else {
|
|
175
175
|
newResult[${w}] = ${C}.value;
|
|
176
176
|
}
|
|
177
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");const S=y.compile();return(D,C)=>S(h,D,C)};let s;const i=Si,a=!np.jitless,u=a&&Pw.value,d=r.catchall;let f;e._zod.parse=(h,y)=>{f??(f=n.value);const g=h.value;return i(g)?a&&u&&y?.async===!1&&y.jitless!==!0?(s||(s=o(r.shape)),h=s(h,y),d?wp([],g,h,y,f,e):h):t(h,y):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function _p(e,r,t,n){for(const s of e)if(s.issues.length===0)return r.value=s.value,r;const o=e.filter(s=>!Fn(s));return o.length===1?(r.value=o[0].value,o[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:t,errors:e.map(s=>s.issues.map(i=>vn(i,n,gn())))}),r)}const CS=Y("$ZodUnion",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.options.some(o=>o._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>r.options.some(o=>o._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(r.options.every(o=>o._zod.values))return new Set(r.options.flatMap(o=>Array.from(o._zod.values)))}),mt(e._zod,"pattern",()=>{if(r.options.every(o=>o._zod.pattern)){const o=r.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>_c(s.source)).join("|")})$`)}});const t=r.options.length===1,n=r.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return n(o,s);let i=!1;const a=[];for(const c of r.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>_p(c,o,e,s)):_p(a,o,e,s)}}),ES=Y("$ZodIntersection",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>{const o=t.value,s=r.left._zod.run({value:o,issues:[]},n),i=r.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Sp(t,c,u)):Sp(t,s,i)}});function Dc(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Ro(e)&&Ro(r)){const t=Object.keys(r),n=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...r};for(const s of n){const i=Dc(e[s],r[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=r[n],i=Dc(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};t.push(i.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Sp(e,r,t){if(r.issues.length&&e.issues.push(...r.issues),t.issues.length&&e.issues.push(...t.issues),Fn(e))return e;const n=Dc(r.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const DS=Y("$ZodEnum",(e,r)=>{At.init(e,r);const t=Iw(r.entries),n=new Set(t);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.filter(o=>Rw.has(typeof o)).map(o=>typeof o=="string"?Bn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t,input:i,inst:e}),o}}),kS=Y("$ZodLiteral",(e,r)=>{if(At.init(e,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(r.values),e._zod.pattern=new RegExp(`^(${r.values.map(t=>typeof t=="string"?Bn(t):t?Bn(t.toString()):String(t)).join("|")})$`),e._zod.parse=(t,n)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:r.values,input:o,inst:e}),t}}),AS=Y("$ZodTransform",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>{if(n.direction==="backward")throw new rp(e.constructor.name);const o=r.transform(t.value,t);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(t.value=i,t));if(o instanceof Promise)throw new Ln;return t.value=o,t}});function Cp(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const TS=Y("$ZodOptional",(e,r)=>{At.init(e,r),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const t=r.innerType._zod.pattern;return t?new RegExp(`^(${_c(t.source)})?$`):void 0}),e._zod.parse=(t,n)=>{if(r.innerType._zod.optin==="optional"){const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Cp(s,t.value)):Cp(o,t.value)}return t.value===void 0?t:r.innerType._zod.run(t,n)}}),MS=Y("$ZodNullable",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),mt(e._zod,"pattern",()=>{const t=r.innerType._zod.pattern;return t?new RegExp(`^(${_c(t.source)}|null)$`):void 0}),mt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(t,n)=>t.value===null?t:r.innerType._zod.run(t,n)}),IS=Y("$ZodDefault",(e,r)=>{At.init(e,r),e._zod.optin="optional",mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);if(t.value===void 0)return t.value=r.defaultValue,t;const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Ep(s,r)):Ep(o,r)}});function Ep(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const OS=Y("$ZodPrefault",(e,r)=>{At.init(e,r),e._zod.optin="optional",mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=r.defaultValue),r.innerType._zod.run(t,n))}),jS=Y("$ZodNonOptional",(e,r)=>{At.init(e,r),mt(e._zod,"values",()=>{const t=r.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),e._zod.parse=(t,n)=>{const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Dp(s,e)):Dp(o,e)}});function Dp(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const PS=Y("$ZodCatch",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=r.catchValue({...t,error:{issues:s.issues.map(i=>vn(i,n,gn()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=r.catchValue({...t,error:{issues:o.issues.map(s=>vn(s,n,gn()))},input:t.value}),t.issues=[]),t)}}),RS=Y("$ZodPipe",(e,r)=>{At.init(e,r),mt(e._zod,"values",()=>r.in._zod.values),mt(e._zod,"optin",()=>r.in._zod.optin),mt(e._zod,"optout",()=>r.out._zod.optout),mt(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(t,n)=>{if(n.direction==="backward"){const s=r.out._zod.run(t,n);return s instanceof Promise?s.then(i=>Oi(i,r.in,n)):Oi(s,r.in,n)}const o=r.in._zod.run(t,n);return o instanceof Promise?o.then(s=>Oi(s,r.out,n)):Oi(o,r.out,n)}});function Oi(e,r,t){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},t)}const NS=Y("$ZodReadonly",(e,r)=>{At.init(e,r),mt(e._zod,"propValues",()=>r.innerType._zod.propValues),mt(e._zod,"values",()=>r.innerType._zod.values),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(kp):kp(o)}});function kp(e){return e.value=Object.freeze(e.value),e}const $S=Y("$ZodCustom",(e,r)=>{er.init(e,r),At.init(e,r),e._zod.parse=(t,n)=>t,e._zod.check=t=>{const n=t.value,o=r.fn(n);if(o instanceof Promise)return o.then(s=>Ap(s,t,n,e));Ap(o,t,n,e)}});function Ap(e,r,t,n){if(!e){const o={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),r.issues.push(No(o))}}class LS{constructor(){this._map=new Map,this._idmap=new Map}add(r,...t){const n=t[0];if(this._map.set(r,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,r)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(r){const t=this._map.get(r);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(r),this}get(r){const t=r._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const o={...n,...this._map.get(r)};return Object.keys(o).length?o:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function zS(){return new LS}const ji=zS();function BS(e,r){return new e({type:"string",...Ae(r)})}function FS(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(r)})}function Tp(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(r)})}function VS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(r)})}function US(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(r)})}function WS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(r)})}function HS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(r)})}function YS(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(r)})}function qS(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(r)})}function ZS(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(r)})}function GS(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(r)})}function KS(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(r)})}function QS(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(r)})}function XS(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(r)})}function JS(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(r)})}function eC(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(r)})}function tC(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(r)})}function rC(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(r)})}function nC(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(r)})}function oC(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(r)})}function sC(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(r)})}function iC(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(r)})}function aC(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(r)})}function cC(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(r)})}function lC(e,r){return new e({type:"string",format:"date",check:"string_format",...Ae(r)})}function uC(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(r)})}function dC(e,r){return new e({type:"string",format:"duration",check:"string_format",...Ae(r)})}function fC(e,r){return new e({type:"number",checks:[],...Ae(r)})}function pC(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(r)})}function hC(e,r){return new e({type:"boolean",...Ae(r)})}function mC(e){return new e({type:"unknown"})}function gC(e,r){return new e({type:"never",...Ae(r)})}function Mp(e,r){return new mp({check:"less_than",...Ae(r),value:e,inclusive:!1})}function kc(e,r){return new mp({check:"less_than",...Ae(r),value:e,inclusive:!0})}function Ip(e,r){return new gp({check:"greater_than",...Ae(r),value:e,inclusive:!1})}function Ac(e,r){return new gp({check:"greater_than",...Ae(r),value:e,inclusive:!0})}function Op(e,r){return new O_({check:"multiple_of",...Ae(r),value:e})}function jp(e,r){return new P_({check:"max_length",...Ae(r),maximum:e})}function Pi(e,r){return new R_({check:"min_length",...Ae(r),minimum:e})}function Pp(e,r){return new N_({check:"length_equals",...Ae(r),length:e})}function vC(e,r){return new $_({check:"string_format",format:"regex",...Ae(r),pattern:e})}function yC(e){return new L_({check:"string_format",format:"lowercase",...Ae(e)})}function bC(e){return new z_({check:"string_format",format:"uppercase",...Ae(e)})}function xC(e,r){return new B_({check:"string_format",format:"includes",...Ae(r),includes:e})}function wC(e,r){return new F_({check:"string_format",format:"starts_with",...Ae(r),prefix:e})}function _C(e,r){return new V_({check:"string_format",format:"ends_with",...Ae(r),suffix:e})}function $o(e){return new U_({check:"overwrite",tx:e})}function SC(e){return $o(r=>r.normalize(e))}function CC(){return $o(e=>e.trim())}function EC(){return $o(e=>e.toLowerCase())}function DC(){return $o(e=>e.toUpperCase())}function kC(e,r,t){return new e({type:"array",element:r,...Ae(t)})}function AC(e,r,t){return new e({type:"custom",check:"custom",fn:r,...Ae(t)})}function TC(e){const r=MC(t=>(t.addIssue=n=>{if(typeof n=="string")t.issues.push(No(n,t.value,r._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),t.issues.push(No(o))}},e(t.value,t)));return r}function MC(e,r){const t=new er({check:"custom",...Ae(r)});return t._zod.check=e,t}function Rp(e,r){try{var t=e()}catch(n){return r(n)}return t&&t.then?t.then(void 0,r):t}function IC(e,r){for(var t={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!t[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),r){var c=t[i].types,u=c&&c[n.code];t[i]=hc(i,r,t,o,u?[].concat(u,n.message):n.message)}e.shift()}return t}function OC(e,r){for(var t={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!t[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(f){return e.push(f)})}),r){var c=t[i].types,u=c&&c[n.code];t[i]=hc(i,r,t,o,u?[].concat(u,n.message):n.message)}e.shift()}return t}function jC(e,r,t){if(t===void 0&&(t={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,s){try{return Promise.resolve(Rp(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](n,r)).then(function(i){return s.shouldUseNativeValidation&&yc({},s),{errors:{},values:t.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ep(IC(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,s){try{return Promise.resolve(Rp(function(){return Promise.resolve((t.mode==="sync"?qw:Zw)(e,n,r)).then(function(i){return s.shouldUseNativeValidation&&yc({},s),{errors:{},values:t.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof Cc})(i))return{values:{},errors:ep(OC(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const PC=Y("ZodISODateTime",(e,r)=>{nS.init(e,r),St.init(e,r)});function RC(e){return cC(PC,e)}const NC=Y("ZodISODate",(e,r)=>{oS.init(e,r),St.init(e,r)});function $C(e){return lC(NC,e)}const LC=Y("ZodISOTime",(e,r)=>{sS.init(e,r),St.init(e,r)});function zC(e){return uC(LC,e)}const BC=Y("ZodISODuration",(e,r)=>{iS.init(e,r),St.init(e,r)});function FC(e){return dC(BC,e)}const pr=Y("ZodError",(e,r)=>{Cc.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Yw(e,t)},flatten:{value:t=>Hw(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,bc,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,bc,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),VC=Di(pr),UC=ki(pr),WC=Ai(pr),HC=Ti(pr),YC=Qw(pr),qC=Xw(pr),ZC=Jw(pr),GC=e_(pr),KC=t_(pr),QC=r_(pr),XC=n_(pr),JC=o_(pr),Rt=Y("ZodType",(e,r)=>(At.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...t)=>e.clone({...r,checks:[...r.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(t,n)=>en(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>VC(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>WC(e,t,n),e.parseAsync=async(t,n)=>UC(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>HC(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>YC(e,t,n),e.decode=(t,n)=>qC(e,t,n),e.encodeAsync=async(t,n)=>ZC(e,t,n),e.decodeAsync=async(t,n)=>GC(e,t,n),e.safeEncode=(t,n)=>KC(e,t,n),e.safeDecode=(t,n)=>QC(e,t,n),e.safeEncodeAsync=async(t,n)=>XC(e,t,n),e.safeDecodeAsync=async(t,n)=>JC(e,t,n),e.refine=(t,n)=>e.check(HE(t,n)),e.superRefine=t=>e.check(YE(t)),e.overwrite=t=>e.check($o(t)),e.optional=()=>Hp(e),e.nullable=()=>Yp(e),e.nullish=()=>Hp(Yp(e)),e.nonoptional=t=>LE(e,t),e.array=()=>Fp(e),e.or=t=>DE([e,t]),e.and=t=>AE(e,t),e.transform=t=>Zp(e,OE(t)),e.default=t=>RE(e,t),e.prefault=t=>$E(e,t),e.catch=t=>BE(e,t),e.pipe=t=>Zp(e,t),e.readonly=()=>UE(e),e.describe=t=>{const n=e.clone();return ji.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return ji.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ji.get(e);const n=e.clone();return ji.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Np=Y("_ZodString",(e,r)=>{Ec.init(e,r),Rt.init(e,r);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...n)=>e.check(vC(...n)),e.includes=(...n)=>e.check(xC(...n)),e.startsWith=(...n)=>e.check(wC(...n)),e.endsWith=(...n)=>e.check(_C(...n)),e.min=(...n)=>e.check(Pi(...n)),e.max=(...n)=>e.check(jp(...n)),e.length=(...n)=>e.check(Pp(...n)),e.nonempty=(...n)=>e.check(Pi(1,...n)),e.lowercase=n=>e.check(yC(n)),e.uppercase=n=>e.check(bC(n)),e.trim=()=>e.check(CC()),e.normalize=(...n)=>e.check(SC(...n)),e.toLowerCase=()=>e.check(EC()),e.toUpperCase=()=>e.check(DC())}),eE=Y("ZodString",(e,r)=>{Ec.init(e,r),Np.init(e,r),e.email=t=>e.check(FS(tE,t)),e.url=t=>e.check(YS(rE,t)),e.jwt=t=>e.check(aC(vE,t)),e.emoji=t=>e.check(qS(nE,t)),e.guid=t=>e.check(Tp($p,t)),e.uuid=t=>e.check(VS(Ri,t)),e.uuidv4=t=>e.check(US(Ri,t)),e.uuidv6=t=>e.check(WS(Ri,t)),e.uuidv7=t=>e.check(HS(Ri,t)),e.nanoid=t=>e.check(ZS(oE,t)),e.guid=t=>e.check(Tp($p,t)),e.cuid=t=>e.check(GS(sE,t)),e.cuid2=t=>e.check(KS(iE,t)),e.ulid=t=>e.check(QS(aE,t)),e.base64=t=>e.check(oC(hE,t)),e.base64url=t=>e.check(sC(mE,t)),e.xid=t=>e.check(XS(cE,t)),e.ksuid=t=>e.check(JS(lE,t)),e.ipv4=t=>e.check(eC(uE,t)),e.ipv6=t=>e.check(tC(dE,t)),e.cidrv4=t=>e.check(rC(fE,t)),e.cidrv6=t=>e.check(nC(pE,t)),e.e164=t=>e.check(iC(gE,t)),e.datetime=t=>e.check(RC(t)),e.date=t=>e.check($C(t)),e.time=t=>e.check(zC(t)),e.duration=t=>e.check(FC(t))});function hr(e){return BS(eE,e)}const St=Y("ZodStringFormat",(e,r)=>{xt.init(e,r),Np.init(e,r)}),tE=Y("ZodEmail",(e,r)=>{Z_.init(e,r),St.init(e,r)}),$p=Y("ZodGUID",(e,r)=>{Y_.init(e,r),St.init(e,r)}),Ri=Y("ZodUUID",(e,r)=>{q_.init(e,r),St.init(e,r)}),rE=Y("ZodURL",(e,r)=>{G_.init(e,r),St.init(e,r)}),nE=Y("ZodEmoji",(e,r)=>{K_.init(e,r),St.init(e,r)}),oE=Y("ZodNanoID",(e,r)=>{Q_.init(e,r),St.init(e,r)}),sE=Y("ZodCUID",(e,r)=>{X_.init(e,r),St.init(e,r)}),iE=Y("ZodCUID2",(e,r)=>{J_.init(e,r),St.init(e,r)}),aE=Y("ZodULID",(e,r)=>{eS.init(e,r),St.init(e,r)}),cE=Y("ZodXID",(e,r)=>{tS.init(e,r),St.init(e,r)}),lE=Y("ZodKSUID",(e,r)=>{rS.init(e,r),St.init(e,r)}),uE=Y("ZodIPv4",(e,r)=>{aS.init(e,r),St.init(e,r)}),dE=Y("ZodIPv6",(e,r)=>{cS.init(e,r),St.init(e,r)}),fE=Y("ZodCIDRv4",(e,r)=>{lS.init(e,r),St.init(e,r)}),pE=Y("ZodCIDRv6",(e,r)=>{uS.init(e,r),St.init(e,r)}),hE=Y("ZodBase64",(e,r)=>{dS.init(e,r),St.init(e,r)}),mE=Y("ZodBase64URL",(e,r)=>{pS.init(e,r),St.init(e,r)}),gE=Y("ZodE164",(e,r)=>{hS.init(e,r),St.init(e,r)}),vE=Y("ZodJWT",(e,r)=>{gS.init(e,r),St.init(e,r)}),Lp=Y("ZodNumber",(e,r)=>{yp.init(e,r),Rt.init(e,r),e.gt=(n,o)=>e.check(Ip(n,o)),e.gte=(n,o)=>e.check(Ac(n,o)),e.min=(n,o)=>e.check(Ac(n,o)),e.lt=(n,o)=>e.check(Mp(n,o)),e.lte=(n,o)=>e.check(kc(n,o)),e.max=(n,o)=>e.check(kc(n,o)),e.int=n=>e.check(zp(n)),e.safe=n=>e.check(zp(n)),e.positive=n=>e.check(Ip(0,n)),e.nonnegative=n=>e.check(Ac(0,n)),e.negative=n=>e.check(Mp(0,n)),e.nonpositive=n=>e.check(kc(0,n)),e.multipleOf=(n,o)=>e.check(Op(n,o)),e.step=(n,o)=>e.check(Op(n,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Ni(e){return fC(Lp,e)}const yE=Y("ZodNumberFormat",(e,r)=>{vS.init(e,r),Lp.init(e,r)});function zp(e){return pC(yE,e)}const bE=Y("ZodBoolean",(e,r)=>{yS.init(e,r),Rt.init(e,r)});function $i(e){return hC(bE,e)}const xE=Y("ZodUnknown",(e,r)=>{bS.init(e,r),Rt.init(e,r)});function Bp(){return mC(xE)}const wE=Y("ZodNever",(e,r)=>{xS.init(e,r),Rt.init(e,r)});function _E(e){return gC(wE,e)}const SE=Y("ZodArray",(e,r)=>{wS.init(e,r),Rt.init(e,r),e.element=r.element,e.min=(t,n)=>e.check(Pi(t,n)),e.nonempty=t=>e.check(Pi(1,t)),e.max=(t,n)=>e.check(jp(t,n)),e.length=(t,n)=>e.check(Pp(t,n)),e.unwrap=()=>e.element});function Fp(e,r){return kC(SE,e,r)}const CE=Y("ZodObject",(e,r)=>{SS.init(e,r),Rt.init(e,r),mt(e,"shape",()=>r.shape),e.keyof=()=>Up(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Bp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Bp()}),e.strict=()=>e.clone({...e._zod.def,catchall:_E()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Bw(e,t),e.safeExtend=t=>Fw(e,t),e.merge=t=>Vw(e,t),e.pick=t=>Lw(e,t),e.omit=t=>zw(e,t),e.partial=(...t)=>Uw(Wp,e,t[0]),e.required=(...t)=>Ww(qp,e,t[0])});function Vp(e,r){const t={type:"object",get shape(){return Jr(this,"shape",e?jw(e):{}),this.shape},...Ae(r)};return new CE(t)}const EE=Y("ZodUnion",(e,r)=>{CS.init(e,r),Rt.init(e,r),e.options=r.options});function DE(e,r){return new EE({type:"union",options:e,...Ae(r)})}const kE=Y("ZodIntersection",(e,r)=>{ES.init(e,r),Rt.init(e,r)});function AE(e,r){return new kE({type:"intersection",left:e,right:r})}const Tc=Y("ZodEnum",(e,r)=>{DS.init(e,r),Rt.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);const t=new Set(Object.keys(r.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(t.has(i))s[i]=r.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Tc({...r,checks:[],...Ae(o),entries:s})},e.exclude=(n,o)=>{const s={...r.entries};for(const i of n)if(t.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Tc({...r,checks:[],...Ae(o),entries:s})}});function Up(e,r){const t=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Tc({type:"enum",entries:t,...Ae(r)})}const TE=Y("ZodLiteral",(e,r)=>{kS.init(e,r),Rt.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function ME(e,r){return new TE({type:"literal",values:Array.isArray(e)?e:[e],...Ae(r)})}const IE=Y("ZodTransform",(e,r)=>{AS.init(e,r),Rt.init(e,r),e._zod.parse=(t,n)=>{if(n.direction==="backward")throw new rp(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(No(s,t.value,r));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),t.issues.push(No(i))}};const o=r.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function OE(e){return new IE({type:"transform",transform:e})}const Wp=Y("ZodOptional",(e,r)=>{TS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Hp(e){return new Wp({type:"optional",innerType:e})}const jE=Y("ZodNullable",(e,r)=>{MS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Yp(e){return new jE({type:"nullable",innerType:e})}const PE=Y("ZodDefault",(e,r)=>{IS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RE(e,r){return new PE({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():ap(r)}})}const NE=Y("ZodPrefault",(e,r)=>{OS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function $E(e,r){return new NE({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():ap(r)}})}const qp=Y("ZodNonOptional",(e,r)=>{jS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function LE(e,r){return new qp({type:"nonoptional",innerType:e,...Ae(r)})}const zE=Y("ZodCatch",(e,r)=>{PS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BE(e,r){return new zE({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const FE=Y("ZodPipe",(e,r)=>{RS.init(e,r),Rt.init(e,r),e.in=r.in,e.out=r.out});function Zp(e,r){return new FE({type:"pipe",in:e,out:r})}const VE=Y("ZodReadonly",(e,r)=>{NS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function UE(e){return new VE({type:"readonly",innerType:e})}const WE=Y("ZodCustom",(e,r)=>{$S.init(e,r),Rt.init(e,r)});function HE(e,r={}){return AC(WE,e,r)}function YE(e){return TC(e)}const Gp=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,Kp=(e,r)=>{if(!e||!r)return null;const t=e.split("-");if(t.length!==3)return null;const n=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=r.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),u=new Date(n,o,s,a,c);return isNaN(u.getTime())||!x.isValid(u)?null:u},qE=Vp({UsuarioID:Ni().nullable().optional(),disID:Ni().nullable().optional(),EsOrganizador:$i().default(!1),Correo:hr().email("Formato de correo inválido"),StatusInvitacion:Up(["PENDIENTE","CONFIRMADA","RECHAZADA"]).default("PENDIENTE")}),ZE=Vp({titulo:hr().min(1,"El campo Título es requerido.").refine(e=>!e.startsWith(" "),{message:"El título no puede empezar con un espacio en blanco"}),fechaInicio:hr().min(1,"El campo fecha inicio es requerido."),horaInicio:hr().min(1,"La hora de inicio es requerida.").regex(Gp,{message:"Formato inválido"}),horaFin:hr().min(1,"La hora fin es requerida.").regex(Gp,{message:"Formato inválido"}),todoElDia:$i(),fechaFin:hr().optional(),showEndDate:$i().optional(),horaInicio2:hr().optional(),TodoElDia2:$i().optional(),client:hr().nullable().optional(),repetir:hr().optional(),link:hr().trim().url("Debe ser una URL válida. Ejemplo https://meet.google.com/").or(ME("")).optional().refine(e=>e===void 0?!0:!/\s/.test(e),{message:"El enlace no puede contener espacios en blanco"}),descripcion:hr().optional(),invitados:Fp(qE).optional().default([]),color:hr().optional(),solID:Ni().nullable().optional(),disID:Ni().nullable().optional()}).refine(e=>e.showEndDate?e.fechaFin&&e.fechaFin.length>0:!0,{message:"La fecha de fin es requerida.",path:["fechaFin"]}).refine(e=>e.fechaFin!==void 0?!!e.fechaFin&&!!e.horaInicio2:!0,{message:"La hora de fin son requeridas.",path:["horaInicio2"]}).refine(e=>{if(e.todoElDia||!e.fechaInicio||!e.horaInicio||!e.fechaFin||!e.horaInicio2)return!0;const r=Kp(e.fechaInicio,e.horaInicio),t=Kp(e.fechaFin,e.horaFin);return!r||!t||!x.isValid(r)||!x.isValid(t)?!0:!(x.isBefore(t,r)&&!x.isSameDay(t,r)||x.isSameDay(r,t)&&x.isBefore(t,r))},{message:"",path:["horaFin"]}),Qp=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("path",{fill:"#333",d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12"}),G.createElement("path",{fill:"#fff",d:"M16.703 7.275c.52.52.541 1.345.046 1.84l-2.874 2.874 2.874 2.873c.495.496.475 1.32-.046 1.841-.52.52-1.344.54-1.84.045l-2.873-2.873-2.874 2.873c-.496.496-1.32.475-1.84-.045-.521-.521-.541-1.345-.046-1.84l2.874-2.874L7.23 9.116c-.495-.496-.475-1.32.045-1.84.521-.521 1.345-.542 1.841-.046l2.874 2.873 2.873-2.873c.496-.496 1.32-.476 1.84.045"})),GE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M7.288%2022.986h-.147a6.2%206.2%200%200%201-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28%2011a1.228%201.228%200%201%201%201.739%201.739L4.44%2014.317c-1.356%201.357-1.282%203.626.16%205.068a3.82%203.82%200%200%200%202.602%201.135c.95%200%201.825-.32%202.479-.974l1.578-1.579a1.23%201.23%200%200%201%201.739%200c.48.481.48%201.258%200%201.739l-1.579%201.578c-1.097%201.098-2.552%201.69-4.13%201.69zM17.98%2012.998a1.23%201.23%200%200%201%200-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78%203.78%200%200%200-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75%206.03c-.48.48-1.258.48-1.739%200a1.23%201.23%200%200%201%200-1.739l1.579-1.578c2.318-2.319%206.153-2.245%208.558.16a6.23%206.23%200%200%201%201.85%204.279%205.84%205.84%200%200%201-1.69%204.279l-1.578%201.578c-.481.481-1.258.481-1.74%200z'/%3e%3cpath%20d='M14.172%208.11%208.07%2014.214a1.233%201.233%200%200%200%201.743%201.744l6.104-6.104a1.233%201.233%200%201%200-1.744-1.744'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",KE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{fill:"#404756",d:"M21.24 5.72a2.98 2.98 0 0 0-2.97-2.96l-5.19-.06c-1.06-.03-2.12.41-2.87 1.17l-7.49 7.49c-.66.66-1.03 1.54-1.03 2.47s.36 1.81 1.03 2.47l4.97 4.97a3.5 3.5 0 0 0 2.47 1.02c.89 0 1.79-.34 2.47-1.02l7.49-7.49c.76-.76 1.18-1.81 1.17-2.88l-.06-5.19zm-4.2 4.43c-.44.44-1.02.66-1.6.66a2.256 2.256 0 1 1 0-4.51 2.256 2.256 0 0 1 1.6 3.85"})),G.createElement("defs",null,G.createElement("clipPath",{id:"a"},G.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),Xp="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",QE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},G.createElement("path",{d:"M13.085 7.331a1.096 1.096 0 1 0-2.192 0v9.316a1.096 1.096 0 0 0 2.192 0z"}),G.createElement("path",{d:"M16.647 10.893H7.33a1.096 1.096 0 1 0 0 2.192h9.316a1.096 1.096 0 0 0 0-2.192"}),G.createElement("path",{d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12m0-21.808c-5.414 0-9.808 4.394-9.808 9.808S6.586 21.808 12 21.808s9.808-4.394 9.808-9.808S17.403 2.192 12 2.192"})),G.createElement("defs",null,G.createElement("clipPath",{id:"a"},G.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),XE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M13.789%2017H3.21C2.542%2017%202%2017.56%202%2018.25s.542%201.25%201.211%201.25H13.79c.669%200%201.211-.56%201.211-1.25S14.458%2017%2013.789%2017M20.718%204H3.282C2.574%204%202%204.56%202%205.25S2.574%206.5%203.282%206.5h17.436C21.426%206.5%2022%205.94%2022%205.25S21.426%204%2020.718%204M20.718%2010.5H3.282C2.574%2010.5%202%2011.06%202%2011.75S2.574%2013%203.282%2013h17.436c.708%200%201.282-.56%201.282-1.25s-.574-1.25-1.282-1.25'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",JE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("path",{fill:"#2571D6",fillRule:"evenodd",d:"M17.333 11a6.34 6.34 0 0 1 6.334 6.333 6.34 6.34 0 0 1-6.334 6.334c-3.493 0-6.333-2.846-6.333-6.334A6.343 6.343 0 0 1 17.333 11m-.005 2.37c-.437 0-.79.338-.79.754v2.412h-2.414c-.416 0-.754.355-.754.792s.338.792.754.792h2.413v2.412c0 .416.354.754.791.754s.792-.338.792-.754V18.12h2.413c.416 0 .754-.355.754-.792s-.338-.792-.754-.792H18.12v-2.412c0-.416-.355-.754-.792-.754",clipRule:"evenodd"}),G.createElement("path",{fill:"#2571D6",d:"M11.12 12.297a7.97 7.97 0 0 0-1.787 5.036c0 1.763.571 3.392 1.537 4.714H3.044c-.84 0-1.523-.682-1.523-1.523 0-4.544 3.683-8.227 8.217-8.227zM10.995.139c2.925 0 5.3 2.376 5.3 5.3s-2.376 5.3-5.3 5.3v-.01a5.303 5.303 0 0 1-5.3-5.3 5.295 5.295 0 0 1 5.3-5.29"}));var Lo={},Jp;function eD(){if(Jp)return Lo;Jp=1;var e=ct();Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=void 0;var r=e(ht()),t=dt();return Lo.default=(0,r.default)((0,t.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Lo}var tD=eD();const eh=at(tD);var zo={},th;function rD(){if(th)return zo;th=1;var e=ct();Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var r=e(ht()),t=dt();return zo.default=(0,r.default)((0,t.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),zo}var nD=rD();const oD=at(nD),rh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAElBMVEUAAABpbXlpbXlobXhpbnppbnkdzkEGAAAABXRSTlMAgJ5Y75poDcUAAAA3SURBVBjTYyANiBog2IyhSBzRQGQJASSJIGQJBSIkTBESCA5CGcIAoqUEGDAdiukFBhE4hzAAAK+MB7AghHQFAAAAAElFTkSuQmCC",nh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAADlQTFRFR3BMIHDPJHDUJHDVJXHWJHDVJHHWJHDUI3DUJXHWJXDUJHHUJXHW////c6Tlr8vwiLLp1eT3Nn3ZZnh0KAAAAAx0Uk5TABBAgN+bxCBc7zBwfOSOGgAAAKJJREFUeNp1klsOxSAIREerohb72v9iryFXsSQ9P+BMwiQgJpQ4ZBjIOwrcySAHZetS4Y6UOK3Mb7ZhRGOkYSRjFAg+sSXlNcDGBH5xnI9UB6O3dkhDSEY/pQmAl+Y6n1XnDJA0rd2P6Boex4z7mnrHQ6evOu8oNneE7Dyci5VAQA5sKZF0iSt+rt1AH4cKWC9VNKFiQvX/GTbU6vCGIpddnz/knxPCFgg8/wAAAABJRU5ErkJggg==",sD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAGFBMVEUAAAAAfFQAflYAfVYAfVUAfFQAcFAAfVbb6xt6AAAAB3RSTlMAIN98m0wQyLlfvgAAAE1JREFUGNNjoAgwmiJxhMoDEBLq5QZIEkUCSBKKeCXYYBJgMQeEBHN5CUIHa3m5A8Io8/ISiAREHRAAJWBSSHYwgyXgUjAJsIGGpPkcAJCLE29yhAT7AAAAAElFTkSuQmCC",iD=e=>{const r=["#A17B4B","#7B5BE4","#F9A825","#4A90E2","#5CC85C","#FDD835","#E53935","#B0BEC5"],t=e.charCodeAt(0)%r.length;return r[t]},aD=(e,r,t,n,o)=>{if(r)return l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#1976D2"},children:[l.jsx("img",{src:nh,width:15,style:{marginRight:"5px"}}),l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold"},children:"Anfitrión"})]});switch(e){case"PENDIENTE":return l.jsx(m.Typography,{variant:"caption",sx:{color:"#999",fontStyle:"italic",fontWeight:600},children:"Pendiente"});case"RECHAZADA":return l.jsx(m.Button,{onClick:()=>{n(t),o()},variant:"outlined",size:"small",sx:{fontWeight:600,borderRadius:"8px",textTransform:"none",fontSize:"11px",px:1,py:0},children:"Reenviar"});case"CONFIRMADA":return l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#00A86B"},children:[l.jsx("img",{src:sD,width:15,style:{marginRight:"5px"}}),l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold"},children:"Asistiré"})]});default:return null}};function cD({open:e,handleClose:r,guests:t,onReenviar:n}){const o=t.filter(u=>u.estatus==="CONFIRMADA"||u.isHost),s=t.filter(u=>u.estatus==="PENDIENTE"&&!u.isHost),i=t.filter(u=>u.estatus==="RECHAZADA"&&!u.isHost),a=u=>l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",py:1},children:[l.jsxs(m.Box,{sx:{position:"relative",mr:2},children:[l.jsx(m.Avatar,{sx:{bgcolor:iD(u.iniciales),width:32,height:32,fontSize:"12px",color:"#fff"},children:u.iniciales}),u.estatus==="PENDIENTE"&&l.jsx(m.Box,{sx:{position:"absolute",bottom:-2,right:-4,bgcolor:"#fff",borderRadius:"50%",display:"flex"},children:l.jsx(ic,{sx:{fontSize:14,color:"#546E7A"}})})]}),l.jsx(m.Typography,{variant:"body2",sx:{flexGrow:1,fontWeight:500,color:"#333"},children:u.nombre}),aD(u.estatus,u.isHost,u.usrID,n,r)]},u.nombre),c=({title:u,count:d,badgeColor:f})=>l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mt:2,mb:1},children:[l.jsx(m.Typography,{variant:"subtitle2",sx:{fontWeight:800,color:"#333",fontSize:"13px"},children:u}),f&&l.jsx(m.Box,{sx:{ml:1,bgcolor:f,color:"#fff",borderRadius:"50%",width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px"},children:d})]});return l.jsxs(m.Dialog,{open:e,onClose:r,fullWidth:!0,maxWidth:"xs",PaperProps:{sx:{border:"solid 0.1 px",height:"100%"}},children:[l.jsxs(m.Box,{sx:{p:"16px 8px"},children:[l.jsx(m.Typography,{variant:"subtitle1",sx:{fontWeight:800,ml:1,color:"#333333"},children:"Lista de invitados"}),l.jsx(m.Button,{onClick:r,startIcon:l.jsx("img",{src:rh,width:20}),sx:{textTransform:"none",color:"#666",fontSize:"16px",p:0,minWidth:0,ml:.5,"&:hover":{bgcolor:"transparent"}},children:"Volver al evento"}),l.jsx(m.IconButton,{onClick:r,sx:{position:"absolute",right:8,top:12},children:l.jsx(Rr,{})})]}),l.jsx(m.Divider,{sx:{backgroundColor:"black"}}),l.jsxs(m.DialogContent,{sx:{p:2},children:[s.length>0&&l.jsxs(m.Box,{sx:{mb:3},children:[l.jsx(c,{title:"Invitados",count:s.length}),s.map(a)]}),o.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(m.Divider,{sx:{my:1,backgroundColor:"black"}}),l.jsxs(m.Box,{sx:{mb:3},children:[l.jsx(c,{title:"Confirmados",count:o.length,badgeColor:"#1976D2"}),o.map(a)]})]}),i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(m.Divider,{sx:{my:1,backgroundColor:"black"}}),l.jsxs(m.Box,{children:[l.jsx(c,{title:"No asistirán",count:i.length,badgeColor:"#1976D2"}),i.map(a)]})]})]})]})}const lD=e=>{const r=["#8D6E63","#9C27B0","#FF9800","#2196F3","#4CAF50","#FFEB3B","#F44336","#9E9E9E"],t=e.charCodeAt(0)%r.length;return r[t]};function uD({guests:e,onReenviar:r}){const[t,n]=v.useState(!1),o=()=>n(!0),s=()=>n(!1);return l.jsxs(l.Fragment,{children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",py:1,borderBottom:"1px solid #eee",width:"100%"},children:[l.jsx(m.AvatarGroup,{max:6,sx:{"& .MuiAvatar-root":{width:32,height:32,fontSize:13,fontWeight:"bold",border:"2px solid #fff",marginLeft:"-8px !important"},"& .MuiBadge-root":{borderRadius:"50%"}},children:e.map((i,a)=>l.jsx(m.Tooltip,{title:i.nombre,arrow:!0,placement:"top",children:l.jsx(m.Box,{children:l.jsx(m.Badge,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},invisible:i.estatus!=="PENDIENTE",sx:{backgroundColor:"white"},badgeContent:l.jsx(m.Box,{sx:{bgcolor:"white",borderRadius:"50%",width:16,height:16,display:"flex",justifyContent:"center",border:"1px solid white",boxShadow:"none"},children:l.jsx("img",{src:Sf})}),children:l.jsx(m.Avatar,{sx:{bgcolor:lD(i.iniciales)},children:i.iniciales})})})},a))}),l.jsx(m.Box,{sx:{flexGrow:1}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",cursor:"pointer",color:"#1976D2",transition:"opacity 0.2s","&:hover":{opacity:.7}},onClick:o,children:[l.jsx(m.Typography,{variant:"body2",sx:{fontWeight:"bold",fontSize:"14px"},children:"Ver invitados"}),l.jsx(oD,{sx:{fontSize:18,ml:.5}})]})]}),l.jsx(cD,{open:t,handleClose:s,guests:e,onReenviar:r})]})}var Bo={},oh;function dD(){if(oh)return Bo;oh=1;var e=ct();Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.default=void 0;var r=e(ht()),t=dt();return Bo.default=(0,r.default)((0,t.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline"),Bo}var fD=dD();const pD=at(fD),hD=e=>new Date(e+"T00:00:00").toLocaleDateString("es-ES",{day:"numeric",month:"short"}).replace(".",""),sh=e=>{const[r,t]=e.split(":"),n=parseInt(r),o=n>=12?"pm":"am";return`${n%12||12}:${t} ${o}`},ih=e=>e.split(":").slice(0,2).join(":"),mD=({slot:e,onClick:r})=>l.jsxs(m.Box,{onClick:r,sx:{cursor:"pointer",borderRadius:"12px",overflow:"hidden",border:"1px solid #000000",textAlign:"center",transition:"0.2s",backgroundColor:"#fff","&:hover":{transform:"translateY(-3px)",boxShadow:"0px 4px 12px rgba(0,0,0,0.1)",borderColor:"#1976d2"}},children:[l.jsx(m.Box,{sx:{bgcolor:"#333",color:"white",py:.5},children:l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold",textTransform:"capitalize"},children:hD(e.Fecha)})}),l.jsxs(m.Box,{sx:{py:1.5},children:[l.jsx(m.Typography,{sx:{fontSize:"12px"},children:sh(e.HoraInicio)}),l.jsxs(m.Typography,{sx:{fontSize:"12px"},children:["a ",sh(e.HoraFin)]})]})]});function gD({open:e,handleClose:r,suggestions:t,onSelectSlot:n}){const[o,s]=v.useState(16),a=t.slice(0,o).reduce((d,f)=>{const h=f.Fecha;return d[h]||(d[h]=[]),d[h].push(f),d},{}),c=Object.keys(a),u=d=>{const f={...d,HoraInicio:ih(d.HoraInicio),HoraFin:ih(d.HoraFin)};n(f),r()};return l.jsxs(m.Dialog,{open:e,onClose:r,fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{borderRadius:"16px"}},children:[l.jsxs(m.Box,{sx:{p:2.5,display:"flex",flexDirection:"column",gap:.5},children:[l.jsx(m.Typography,{variant:"h6",sx:{fontWeight:800,fontSize:"1.1rem"},children:"Selecciona un nuevo horario"}),l.jsx(m.Box,{children:l.jsx(m.Button,{startIcon:l.jsx("img",{src:rh,width:20}),onClick:r,sx:{textTransform:"none",color:"text.secondary",p:0,fontSize:"1rem","&:hover":{backgroundColor:"transparent",color:"#000"}},children:"Volver al evento"})})]}),l.jsx(m.Divider,{}),l.jsx(m.DialogContent,{sx:{px:3,py:3,backgroundColor:"#f9f9f9"},children:c.length===0?l.jsx(m.Typography,{variant:"body2",color:"text.secondary",align:"center",children:"No hay horarios alternativos disponibles en este momento."}):l.jsxs(l.Fragment,{children:[c.map((d,f)=>l.jsxs(m.Box,{sx:{mb:3},children:[l.jsxs(m.Typography,{variant:"subtitle2",sx:{fontWeight:"bold",mb:2,display:"flex",alignItems:"center",color:f===0?"#1976d2":"text.primary",fontSize:"0.9rem"},children:[f===0?"Mismo día ":"Próximas fechas",f===0&&l.jsx("img",{src:nh,width:15,style:{marginLeft:5}})]}),l.jsx(m.Grid,{container:!0,spacing:2,children:a[d].map((h,y)=>l.jsx(m.Grid,{item:!0,xs:6,sm:3,children:l.jsx(mD,{slot:h,onClick:()=>u(h)})},`${d}-${y}`))})]},d)),t.length>o&&l.jsx(m.Box,{sx:{display:"flex",justifyContent:"center",mt:2},children:l.jsx(m.Button,{onClick:()=>s(d=>d+12),startIcon:l.jsx(pD,{}),sx:{textTransform:"none",fontWeight:"bold",color:"#1976d2","&:hover":{backgroundColor:"transparent",textDecoration:"underline"}},children:"Mostrar más horarios disponibles"})})]})})]})}const vD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAIVBMVEVHcExAR1ZAR1NARlVAR1VARlVAR1VARlVARlRARlRAR1ZiwDFVAAAACnRSTlMA5BvHaqI5kH9QLGWfKwAAAQlJREFUeNrd1luqwzAMBNDRw7I7+1/whd4mFa6tBPrX82uJGYMJwc+JLqQ1xU2dLx23NB5EgWjPtAe2Rp4Py8tLmuddeBK/KuRQMgusvDsAwkPRKgU4J14uBIwTw4K8G/GDFncQ6L0FrxYCn1TKhIU4D4UTwZIf8Z2ThjW1/9OoG2XqvTvmiI5LxsRwTRtPTbER3eTJHOcDN8fGkNxagfAxPLChxkyaohTCxEJRU2EeBxDe21NftsrzDuiQup+nwzivn41tQECNC5ZDHrmPCpdEVx+YluaLDONB0bnVcZAUwELgJQUYCzZXMihLOr0Lh7PkmBlLbbFQEsx44fsFY8kwU2PB9Ef+Lv4AL2kmcGZOH2MAAAAASUVORK5CYII=",yD=e=>{const r=["brown","purple","orange","blue","green","yellow","red","grey"],t=e.charCodeAt(0)%r.length;return r[t]};function bD({onSelectGuest:e,availableSuggestions:r,onInputTextChange:t}){const[n,o]=v.useState(null),[s,i]=v.useState(""),a=(u,d)=>{d?(e(d),o(null),i("")):(o(null),i(""))},c=(u,d)=>{i(d),t(d)};return l.jsx(m.Autocomplete,{options:r,value:n,inputValue:s,getOptionLabel:u=>u.correo,onChange:a,onInputChange:c,isOptionEqualToValue:(u,d)=>u.correo===d.correo,disablePortal:!0,noOptionsText:"Sin resultados",renderInput:u=>l.jsx(m.TextField,{...u,placeholder:"Agregar invitados...",variant:"outlined",size:"small",InputProps:{...u.InputProps,startAdornment:l.jsx(m.Box,{sx:{ml:1,display:"flex",alignItems:"center"},children:l.jsx("img",{src:vD,color:"action",width:20})}),disableUnderline:!0}}),renderOption:(u,d)=>v.createElement(m.Box,{component:"li",...u,key:d.correo,sx:{py:1,"& > img":{mr:2,flexShrink:0}}},l.jsx(m.Avatar,{sx:{bgcolor:yD(d.iniciales),mr:2,width:32,height:32,fontSize:14},children:d.iniciales}),l.jsx(m.Typography,{children:d.nombre}))},"guest-autocomplete-field")}var Fo={},ah;function xD(){if(ah)return Fo;ah=1;var e=ct();Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=void 0;var r=e(ht()),t=dt();return Fo.default=(0,r.default)((0,t.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),Fo}var wD=xD();const _D=at(wD);var Vo={},ch;function SD(){if(ch)return Vo;ch=1;var e=ct();Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.default=void 0;var r=e(ht()),t=dt();return Vo.default=(0,r.default)((0,t.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),Vo}var CD=SD();const Mc=at(CD),ED=e=>e.tieneConflicto?{icon:l.jsx(Mc,{sx:{fontSize:18,color:"#d32f2f"}}),fillColor:"#FFF5F5",iconColor:"#d32f2f",textColor:"#333333",variant:"filled"}:{icon:l.jsx(_D,{sx:{fontSize:20,color:"#1a73e8"}}),fillColor:"#eaedf2",iconColor:"#1a73e8",textColor:"#000000",variant:"filled"},DD=e=>{const r=["#8D6E63","#9C27B0","#FF9800","#2196F3","#4CAF50","#FDD835","#F44336","#9E9E9E"],t=e.charCodeAt(0)%r.length;return r[t]};function kD({guests:e,conflictCount:r,onViewSuggestions:t,onDeleteGuest:n}){const o=i=>a=>{a.stopPropagation(),n(i)},s=i=>i?i.trim().split(/\s+/).slice(0,2).join(" "):"";return l.jsxs(m.Box,{sx:{p:1},children:[l.jsx(m.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:e.map((i,a)=>{const c=ED(i),u=DD(i.iniciales);return l.jsx(m.Chip,{label:l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[l.jsx(m.Typography,{variant:"body2",sx:{color:c.textColor,ml:.5,mr:1,fontSize:"13px",fontWeight:400},children:s(i?.nombre)}),l.jsx(m.Box,{className:"status-icon-wrapper",sx:{display:"flex",alignItems:"center",ml:"auto",margin:"5px"},children:c.icon})]}),avatar:l.jsx(m.Avatar,{sx:{bgcolor:u,width:24,height:24,fontSize:"10px",fontWeight:"bold",color:"#ffffff !important",ml:"4px !important"},children:i.iniciales}),sx:{backgroundColor:c.fillColor,height:"32px",borderRadius:"100px",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.2s ease-in-out",cursor:"pointer","&:hover":{backgroundColor:c.fillColor,filter:"brightness(0.97)","& .status-icon-wrapper":{display:"none"},"& .MuiChip-deleteIcon":{display:"inline-block"}},"& .MuiChip-label":{paddingLeft:"4px",paddingRight:"8px",width:"100%",display:"flex"},"& .MuiChip-deleteIcon":{display:"none",fontSize:"18px",color:"#000000",ml:"auto",mr:"4px","&:hover":{color:"#000000"}}},onClick:()=>console.log(`Ver perfil de ${i.nombre}`),onDelete:o(i.nombre)},a)})}),r>0&&l.jsxs(m.Box,{sx:{mt:2,display:"flex",flexDirection:"column",gap:.5},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#E53935"},children:[l.jsx(Mc,{sx:{mr:1,fontSize:22}}),l.jsxs(m.Typography,{sx:{fontSize:"15px",fontWeight:500,color:"#E53935"},children:["Se detectó un conflicto de agenda con ",l.jsxs("strong",{children:[r," invitado"]}),r!==1?"s":""]})]}),l.jsx(m.Link,{component:"button",type:"button",variant:"body2",onClick:i=>{i.preventDefault(),i.stopPropagation(),t()},sx:{ml:4,textAlign:"left",textDecoration:"underline",fontWeight:700,fontSize:"15px",color:"#1976D2",border:"none",background:"none",padding:0,cursor:"pointer","&:hover":{color:"#1565C0"}},children:"Ver sugerencias de horario"})]})]})}function AD(e,r){const[t,n]=v.useState(e);return v.useEffect(()=>{const o=setTimeout(()=>{n(e)},r);return()=>{clearTimeout(o)}},[e,r]),t}const TD={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:450,md:500},bgcolor:"background.paper",boxShadow:24,p:{xs:2,sm:3},borderRadius:2,maxHeight:"90vh",overflowY:"auto"},lh=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],MD=()=>{const e=[];for(let r=0;r<24;r++)for(let t=0;t<60;t+=15){const n=r.toString().padStart(2,"0"),o=t.toString().padStart(2,"0");e.push(`${n}:${o}`)}return e},uh=[],Vn=MD(),Uo=(e,r)=>{if(!e||!r)return null;const t=e.split("-");if(t.length!==3)return null;const n=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=r.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),u=new Date(s,o,n,a,c);return isNaN(u.getTime())||!x.isValid(u)?null:u},ID=({isVisible:e,onClose:r,onSave:t,onDelete:n,selectedDate:o,initialEvent:s,userId:i,masNombreBD:a,disId:c,onReenviar:u})=>{const[d,f]=v.useState(!1),[h,y]=v.useState(!1),g=x.format(new Date,"yyyy-MM-dd"),[p,b]=v.useState(""),[_,S]=v.useState([]),[D,C]=v.useState(!1),w=sc(),[F,E]=v.useState([]),[T,I]=v.useState(""),[M,U]=v.useState(uh),[q,V]=v.useState(!1),[H,re]=v.useState(""),[W,$]=v.useState(!1),[ie,ue]=v.useState([]),[N,ee]=v.useState([]),xe=AD(H,300),_e=M.filter(Z=>Z.tieneConflicto).length,{control:fe,handleSubmit:ae,reset:le,formState:{errors:X,isValid:we},watch:ye,setValue:K}=Xf({resolver:jC(ZE),defaultValues:{titulo:s?.titulo||"",fechaInicio:x.format(new Date,"yyyy-MM-dd"),horaInicio:x.format(new Date,"HH:mm"),horaFin:x.format(x.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:s?.client||null,repetir:"No repetir",link:s?.link||"",descripcion:s?.descripcion||"",solID:s?.solID??null,invitados:[]},mode:"onChange"}),Ie=ye("fechaInicio"),P=ye("fechaFin"),Be=ye("todoElDia");v.useEffect(()=>{if(p.trim()===""||!i||!c||!a){S([]),E([]),K("solID",null),C(!1),I("");return}C(!0);const Z=setTimeout(()=>{w.getClients(p,c,a,i).then(de=>{if(C(!1),de){const Me=de.map(Pe=>Pe.solID);E([...new Set(Me)])}else E([]);const De=Array.from(new Map(de.map(Me=>[Me.nombreCliente,Me])).values());if(De.length>0)S(De),I("");else if(s?.client&&s.solID!==null){const Me=[{solID:s.solID,nombreCliente:s.client}];S(Me),I("Sin resultados")}else S([]),I("Sin resultados")}).catch(de=>{console.error("Error al buscar clientes:",de),C(!1)})},500);return()=>clearTimeout(Z)},[p,i,c,a]),v.useEffect(()=>{if(Ie&&P){const Z=new Date(Ie),de=new Date(P);(Z===de||Z>de)&&K("fechaFin",Ie)}},[Ie,P,K]),v.useEffect(()=>{Ie&&K("fechaFin",Ie)},[Ie]),v.useEffect(()=>{K("showEndDate",d)},[d,K]),v.useEffect(()=>{if(console.log("initialEvent",s),s){const Z=x.format(s.fechaInicio,"yyyy-MM-dd")===x.format(s.fechaFin,"yyyy-MM-dd");if(f(!Z),K("titulo",s?.titulo),K("fechaInicio",x.format(s.fechaInicio,"yyyy-MM-dd")),K("fechaFin",x.format(s.fechaFin,"yyyy-MM-dd")),K("horaInicio",x.format(s.fechaInicio,"HH:mm")),K("horaFin",x.format(s.fechaFin,"HH:mm")),K("horaInicio2",x.format(s.fechaFin,"HH:mm")),K("descripcion",s.descripcion),K("link",s.link),K("repetir","false"),K("color",s.color),K("todoElDia",s.todoElDia),K("solID",s.solID),K("client",s.client),s.invitados&&s.invitados.length>0){const de=(s?.invitados||[]).map(Pe=>{const Nt=Pe.usrNombre?.trim()||"",Q=Nt.split(/\s+/),ke=Q.length>1?(Q[0][0]+Q[1][0]).toUpperCase():Nt.substring(0,2).toUpperCase();return{nombre:Pe.usrNombre||"Sin nombre",correo:Pe.correo||"",iniciales:ke||"--",usrID:Pe.usuarioID??null,isHost:Pe.esOrganizador||!1,estatus:Pe.statusInvitacion,tieneConflicto:!1,disID:Pe.disID}}),De=localStorage.getItem("nombreAnfitrion")||"Anfitrión",Me={nombre:De,correo:"",iniciales:De.substring(0,2).toUpperCase(),usrID:i??0,isHost:!0,estatus:"CONFIRMADA",tieneConflicto:!1};U([Me,...de])}else U(uh);s.solID?y(!0):y(!1)}else{const Z=o||new Date,de=new Date,De=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate(),de.getHours(),de.getMinutes()),Me=x.addHours(De,1);le({titulo:"",fechaInicio:x.format(De,"yyyy-MM-dd"),horaInicio:x.format(De,"HH:mm"),fechaFin:x.format(Me,"yyyy-MM-dd"),horaFin:x.format(Me,"HH:mm"),horaInicio2:x.format(Me,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:lh[0],solID:null}),f(!1),y(!1)}},[s,e,o]);const Qe=Z=>({UsuarioID:Z.usrID??null,Correo:Z.correo,EsOrganizador:Z.usrID==i,StatusInvitacion:Z.estatus,disID:c??null}),Fe=ae(Z=>{const de=M.map(Me=>Qe(Me)),De={...Z,invitados:de};t(De,s?.eventoID),r(),le(),f(!1)},Z=>{console.log("Errores de validación:",Z)});v.useEffect(()=>{Be&&(K("horaInicio","00:00"),K("horaFin","23:59"))},[Be,K,ye]);const Le=()=>{const Z=ye("fechaInicio");if(Z){const de=new Date(`${Z}T00:00:00`),De=x.addDays(de,1);K("fechaFin",x.format(De,"yyyy-MM-dd"))}f(!0)},We=ye("fechaInicio"),Xe=ye("horaInicio"),ft=ye("fechaFin"),k=ye("horaFin"),[O,B]=v.useState(null),[ce,se]=v.useState(null);v.useEffect(()=>{(O===null||O!==Xe)&&B(Xe)},[Xe,O]),v.useEffect(()=>{(ce===null||ce!==k)&&se(k??"")},[k,ce]);const j=ye("todoElDia");v.useEffect(()=>{if(j||!Xe||!k||!We||!ft)return;const Z=Uo(We,Xe),de=Uo(ft,k);if(!Z||!de||!x.isValid(Z)||!x.isValid(de))return;const De=x.isSameDay(Z,de),Me=De&&(x.isAfter(Z,de)||Z.getTime()===de.getTime()),Pe=x.isBefore(de,Z)&&!De;(Me||Pe)&&(K("horaFin",""),se(""))},[Xe,We]);const oe=v.useMemo(()=>{if(!Xe||!We)return Vn;const Z=Uo(We,Xe),de=Uo(ft,"00:00");return!Z||!de||!x.isValid(Z)||!x.isValid(de)||x.isBefore(de,Z)&&!x.isSameDay(de,Z)?Vn:x.isSameDay(Z,de)?Vn.filter(De=>{const Me=Uo(ft,De);return Me&&x.isAfter(Me,Z)}):(x.isAfter(de,Z),Vn)},[Xe,We,ft]),Se=v.useMemo(()=>Vn,[]),je=async Z=>{const de=M.some($t=>$t.correo===Z.correo);if($(!0),de)return;const De=c,Me=Z.correo,Pe=Z.usrID,Nt=We,Q=Xe,ke=k;if(!De||!Me||!Nt||!Q||!ke){U($t=>[...$t,{...Z,status:"pending",isHost:!1,hasConflict:!1,usrID:Pe,name:Z.nombre}]);return}let Ee;try{Ee=await w.VerificarConflicto(De,Me,Nt,Q+":00",ke+":00")}catch{Ee={tieneConflicto:!1,usrMail:Z.correo}}const Re=Array.isArray(Ee)?Ee[0]:Ee,Sr={...Z,estatus:"PENDIENTE",isHost:!1,tieneConflicto:String(Re.tieneConflicto).toLowerCase()==="true"};if(Sr.tieneConflicto){const $t=await w.getDisponibilidadUsuario(c,Me,Nt,"60");ue($t)}U($t=>[...$t,Sr])},R=Z=>{U(de=>de.filter(De=>De.nombre!==Z))},te=()=>{V(!1)},be=Z=>{const Me=(Z.usrNombre??"").split(" ").map(Pe=>Pe.charAt(0)).join("").toUpperCase().substring(0,2);return{nombre:Z.usrNombre??"",correo:Z.usrMail??"",iniciales:Me,usrID:Z.usrID??0,estatus:"PENDIENTE",tieneConflicto:!1,isHost:!1}};v.useEffect(()=>{xe.length>2&&c?(async()=>{const De=(await w.getUsuariosInvitados(c,xe)).map(be).filter(Me=>Me.usrID!==i&&!M.some(Pe=>Pe.correo===Me.correo));ee(De)})():ee([])},[xe,M]);const qe=Z=>{re(Z)},Ct=Z=>{const{Fecha:de,HoraInicio:De,HoraFin:Me}=Z,Pe=Nt=>Nt.split(":").slice(0,2).join(":");K("fechaInicio",de),K("fechaFin",de),K("horaInicio",Pe(De)),K("horaFin",Pe(Me)),f(!1),te(),console.log("Formulario actualizado con sugerencia:",{Fecha:de,HoraInicio:De,HoraFin:Me})};return l.jsx(l.Fragment,{children:l.jsx(m.Modal,{open:e,onClose:r,children:l.jsx("form",{onSubmit:Fe,children:l.jsxs(m.Box,{sx:TD,children:[l.jsx(m.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:12},children:l.jsx(Rr,{})}),l.jsx(m.Typography,{variant:"h6",mb:2,children:s?.isGoogleEvent||s?.isOutlookEvent||!s?.esOrganizador?l.jsx(l.Fragment,{children:s?.titulo||"Evento de Google"}):s?"Editar evento":"Agregar evento"}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"titulo",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!X.titulo,helperText:X.titulo?.message,inputProps:{maxLength:100},sx:{"& .MuiInputLabel-root.Mui-focused":{color:"black"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"black"},"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}})})})}),l.jsxs("div",{className:`row g-2 ${d?"mb-1":"mb-2"}`,children:[l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"fechaInicio",control:fe,render:({field:Z})=>l.jsx(m.TextField,{fullWidth:!0,...Z,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!X.fechaInicio,helperText:X.fechaInicio?.message})})}),d?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"col-md-3 d-none d-md-block"}),l.jsx("div",{className:"col-10 col-md-4",children:l.jsx(ir,{name:"fechaFin",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,type:"date",placeholder:"Fecha de fin",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:Ie||g},error:!!X.fechaFin,helperText:X.fechaFin?.message})})}),!s&&l.jsx("div",{className:"col-2 col-md-1 d-flex align-items-start",children:l.jsx(m.IconButton,{onClick:()=>f(!1),sx:{fontSize:18},children:l.jsx(Qp,{})})})]}):l.jsx("div",{className:"col-md-8"})]}),d&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12 d-flex justify-content-center",children:l.jsx(eh,{sx:{color:"#757575",my:1}})})}),l.jsxs("div",{className:"row g-2 mb-2",children:[l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"horaInicio",control:fe,render:({field:{onChange:Z,value:de,...De}})=>l.jsx(m.Autocomplete,{freeSolo:!0,options:Se,value:de||"",onChange:(Me,Pe)=>Z(Pe||""),onInputChange:(Me,Pe)=>Z(Pe),renderInput:Me=>l.jsx(m.TextField,{...Me,...De,size:"small",error:!!X.horaInicio,helperText:X.horaInicio?.message,InputProps:{...Me.InputProps,endAdornment:l.jsx(m.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:l.jsx(ic,{})})}}),disabled:j})})}),!d&&l.jsx("div",{className:"col-1 d-flex align-items-center justify-content-center",style:{marginTop:X.horaInicio?"5px":"0px"},children:l.jsx(eh,{sx:{color:"#757575"}})}),d&&l.jsx("div",{className:"col-md-3 d-none d-md-block"}),l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"horaFin",control:fe,render:({field:{onChange:Z,value:de,...De}})=>l.jsx(m.Autocomplete,{freeSolo:!0,options:oe,value:de||"",onChange:(Me,Pe)=>Z(Pe||""),onInputChange:(Me,Pe)=>Z(Pe),renderInput:Me=>l.jsx(m.TextField,{...Me,...De,size:"small",error:!!X.horaFin,helperText:X.horaFin?.message,InputProps:{...Me.InputProps,endAdornment:l.jsx(m.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:l.jsx(ic,{})})}}),disabled:j})})}),!d&&l.jsx("div",{className:"col-12 col-md-2 d-flex align-items-center",children:l.jsx(ir,{name:"todoElDia",control:fe,render:({field:Z})=>l.jsx(m.FormControlLabel,{control:l.jsx(m.Checkbox,{checked:Z.value,onChange:de=>Z.onChange(de.target.checked)}),label:l.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"}),sx:{whiteSpace:"nowrap"}})})})]}),(!s?.isGoogleEvent||s?.isOutlookEvent)&&!d&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsxs(m.Button,{onClick:Le,size:"small",sx:{textTransform:"none",fontSize:16},children:[l.jsx(QE,{})," Agregar fecha final"]})})}),(!s?.isGoogleEvent||s?.isOutlookEvent)&&l.jsx("div",{className:"row mb-2",children:l.jsxs("div",{className:"col-12",children:[!h&&l.jsxs(m.Button,{onClick:()=>y(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[l.jsx(JE,{})," Vincular cliente"]}),h&&l.jsxs("div",{className:"row g-2",children:[l.jsx("div",{className:"col-10 col-md-5",children:l.jsx(ir,{name:"client",control:fe,render:({field:Z})=>l.jsx(m.Autocomplete,{options:_,loading:D,loadingText:"Buscando coincidencias...",getOptionLabel:de=>de.nombreCliente?.trim()||"",value:_.find(de=>de.nombreCliente===Z.value)||(Z.value&&typeof Z.value=="string"?{solID:-1,nombreCliente:Z.value}:null),noOptionsText:T,onInputChange:(de,De)=>{b(De)},onChange:(de,De)=>{Z.onChange(De?De.nombreCliente:"")},renderInput:de=>l.jsx(m.TextField,{...de,placeholder:"Buscar cliente...",size:"small",InputProps:{...de.InputProps,startAdornment:l.jsx("img",{src:Md,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"5px"}}),endAdornment:l.jsxs(l.Fragment,{children:[D?l.jsx(m.CircularProgress,{color:"inherit",size:20}):null,de.InputProps.endAdornment]})}})})})}),l.jsx("div",{className:"col-10 col-md-5",children:l.jsx(ir,{name:"solID",control:fe,render:({field:Z})=>l.jsx(m.Autocomplete,{options:F,noOptionsText:"Sin resultados",getOptionLabel:de=>de.toString(),value:Z.value??null,onChange:(de,De)=>Z.onChange(De),renderInput:de=>l.jsx(m.TextField,{...de,label:"#Registro",variant:"outlined",size:"small",sx:{"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}}),disabled:!_.length})})}),l.jsx("div",{className:"col-2 d-flex align-items-center",children:l.jsx(m.IconButton,{onClick:()=>y(!1),sx:{fontSize:18},children:l.jsx(Qp,{})})})]})]})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"link",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!X.link,helperText:X.link?.message,InputProps:{startAdornment:l.jsx("img",{src:GE,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"8px"}})}})})})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"descripcion",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,inputProps:{maxLength:500},variant:"outlined",size:"small",InputProps:{startAdornment:l.jsx("img",{src:XE,width:20,style:{alignSelf:"flex-start",marginRight:"8px"}})}})})})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(bD,{onSelectGuest:je,availableSuggestions:N,onInputTextChange:qe})})}),W&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(kD,{guests:M,conflictCount:_e,onViewSuggestions:()=>V(!0),onDeleteGuest:R})})}),s?.invitados&&s?.invitados?.length>0&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(m.Box,{children:l.jsx(uD,{guests:M,onReenviar:u})})})}),l.jsx(gD,{open:q,handleClose:te,suggestions:ie,onSelectSlot:Ct}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[l.jsx(KE,{}),lh.map(Z=>l.jsx(ir,{name:"color",control:fe,render:({field:de})=>l.jsx(m.IconButton,{onClick:()=>de.onChange(Z),sx:{width:24,height:24,borderRadius:"50%",bgcolor:Z,border:de.value===Z?"2px solid":"none",borderColor:de.value===Z?"primary.main":"transparent"}})},Z))]})})}),l.jsx("div",{className:"row",children:l.jsxs("div",{className:"col-12 d-flex gap-2",style:{width:"100%",marginTop:"20px"},children:[s&&!s?.isGoogleEvent&&!s?.isOutlookEvent&&l.jsx(m.Button,{onClick:n,variant:"outlined",startIcon:l.jsx("img",{src:Xp,width:15}),hidden:s?s?.esOrganizador!=!0:!1,sx:{flex:1,textTransform:"none",backgroundColor:"#FFF5F5",color:"#d32f2f",borderColor:"red",borderRadius:"8px",fontWeight:700,fontSize:"14px",padding:"8px 0","&:hover":{backgroundColor:"#FEE2E2",borderColor:"red"}},children:"Eliminar"}),l.jsx(m.Button,{onClick:r,variant:"outlined",sx:{flex:1,textTransform:"none",fontWeight:700,fontSize:"14px",borderRadius:"8px",color:"#1976D2",borderColor:"#1976D2","&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)",borderColor:"#115293"}},children:"Cancelar"}),l.jsx(m.Button,{onClick:Fe,variant:"contained",disabled:!we,hidden:s?s?.esOrganizador!=!0:!1,sx:{flex:1,textTransform:"none",fontWeight:700,fontSize:"14px",borderRadius:"8px",backgroundColor:"#1976D2",boxShadow:"none","&:hover":{backgroundColor:"#115293",boxShadow:"0px 2px 4px rgba(0,0,0,0.2)"}},children:"Guardar"})]})})]})})})})},OD={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:450,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2,maxHeight:"80vh",overflowY:"auto"},jD=({isOpen:e,onClose:r,events:t,date:n,onEventClick:o})=>{if(!n)return null;const s=a=>{o(a),r()},i=a=>a.isGoogleEvent?{label:"G",borderColor:"#4285F4"}:a.isOutlookEvent?{label:"O",borderColor:"#0078d9"}:{label:"-",borderColor:"#CCC"};return l.jsx(m.Modal,{open:e,onClose:r,children:l.jsxs(m.Box,{sx:OD,children:[l.jsxs(m.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[l.jsxs(m.Typography,{sx:{fontSize:"18px",fontWeight:"bold"},component:"h2",children:["Eventos del"," ",n.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),l.jsx(m.IconButton,{onClick:r,size:"small",children:l.jsx(Rr,{})})]}),l.jsx(m.Divider,{}),l.jsx(m.List,{sx:{mt:1},children:t.map(a=>{const c=i(a);return l.jsx(m.ListItem,{disablePadding:!0,sx:{mb:1},children:l.jsx(m.ListItemButton,{onClick:()=>s(a),sx:{py:1,borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.02)",borderLeft:`5px solid ${c?.borderColor}`,"&:hover":{backgroundColor:"rgba(0,0,0,0.04)"}},children:l.jsxs(m.Box,{sx:{flexGrow:1},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[l.jsx(m.Typography,{sx:{fontSize:"10px",fontWeight:"bold",px:.5,borderRadius:"3px",backgroundColor:c?.borderColor,color:"white",textTransform:"uppercase"},children:c?.label}),l.jsx(m.Typography,{sx:{fontSize:"14px",fontWeight:600,lineHeight:1.2,color:"#333"},children:a.titulo})]}),l.jsx(m.Typography,{sx:{fontSize:"12px",color:"#666"},children:a.todoElDia?"Todo el día":`${x.format(a.fechaInicio,"HH:mm")} - ${x.format(a.fechaFin,"HH:mm")}`})]})})},a.eventoID)})})]})})};var Wo={},dh;function PD(){if(dh)return Wo;dh=1;var e=ct();Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.default=void 0;var r=e(ht()),t=dt();return Wo.default=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),Wo}var RD=PD();const ND=at(RD);var Ho={},fh;function $D(){if(fh)return Ho;fh=1;var e=ct();Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=void 0;var r=e(ht()),t=dt();return Ho.default=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),Ho}var LD=$D();const zD=at(LD),BD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M19.378%204.405a1.813%201.813%200%201%201%202.565%202.565L9.571%2019.342a1.813%201.813%200%200%201-2.565%200l-4.949-4.949a1.814%201.814%200%200%201%202.428-2.69l.137.126%203.666%203.666z'/%3e%3c/svg%3e",FD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAALVBMVEVHcEzfEBfjCxzkChvkChvkChzkCxvlChv////96uv60dT1o6ryho/mGyvkCxypwAsrAAAACHRSTlMAECtdiKDJ5DEbuTIAAAHoSURBVHjatdlbjsMgDAVQ87JJKHf/y51pf9CIp+vJ/SzSkUloAZc2cSEkFgEAYU7RO/o+zkdBF07hO9QnwSzJq4uLgmUkGDgzGTrORHrGcZLXlmcvMkKZaJxuH/YLTwB9ZCo6AUyivb4m7uuziwxDeLtezKsnwJiwfCH2x5hgDi8mbJ+0APaI6wo0Ju4KrIBqQNyqwFqufL3qYOD1O1DqqkQZeVd+567dwJ3fuUai0Cceg5Scm9h5v3lhED9fgzk3ceTlC4Ok+YxzLzbvk+lrCRjl6sTmzSuEn80Yr9yJzZs+Q6Tp72C9/4jdRwXDCJEDTsQzD3DkcSaeeQgUcSZuvAYmnIlnHhIxVqLWAxNjKSo9CAl0YsEGBFRiwSYEhdh5dvCuBrB5GlH3UvaikOw8ncjbha0UeffV04qJwplX7jMxUjjzUM9ET+7Mw6HoiOTIOxR5ehYunXe8SfndNlpwvo2G2XWidl4nYhQ3PYpczVMfRfxqoy9QHZbWx7nm9eK9OM5RnB84h8VPTqJA6G55toj5WtYX+K8lypMXH2KYkx64PD55vbVfwJ9pEZgfo70tYm/c2FtLds/eTHu23WdvSG7jk2a6zzV17aRER4oEUXDm1r0kT18lJB5o5n8sErN8JOEUtv9U/ACrTv/qOzhclQAAAABJRU5ErkJggg==",Ic=v.forwardRef(({id:e,message:r,variant:t},n)=>{const{closeSnackbar:o}=ss.useSnackbar(),s={success:{color:"#fff",icon:l.jsx("img",{width:25,src:BD,style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"12px",padding:3}})},error:{color:"#f44336",icon:l.jsx(ND,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:l.jsx(zD,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:l.jsx("img",{src:Xp,width:25,style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})},rechazar:{color:"#fff",icon:l.jsx("img",{src:FD,width:30,style:{borderRadius:"50%",color:"red",fontSize:"16px",padding:3}})}},i=s[t]||s.info;return l.jsx(ss.SnackbarContent,{ref:n,children:l.jsxs(m.Box,{sx:{backgroundColor:"white",color:"#333",padding:"8px 16px",borderRadius:"8px",boxShadow:"0 3px 10px rgba(0,0,0,0.2)",display:"flex",alignItems:"center",width:{xs:"90%",sm:"auto"},minWidth:"300px",borderLeft:`5px solid ${i.color}`},children:[l.jsx(m.Box,{sx:{mr:1.5},children:i.icon}),l.jsx(m.Typography,{variant:"body2",sx:{flexGrow:1},children:r}),l.jsx(m.IconButton,{size:"small",onClick:()=>o(e),children:l.jsx(Rr,{fontSize:"small"})})]})})}),ph=v.createContext(void 0),VD=({children:e})=>{const[r,t]=v.useState([]),[n,o]=v.useState([]),[s,i]=v.useState(!1);return l.jsx(ph.Provider,{value:{googleEvents:r,setGoogleEvents:t,outlookEvents:n,setOutlookEvents:o,isLoadingGoogleEvents:s,setIsLoadingGoogleEvents:i},children:e})},UD=()=>{const e=v.useContext(ph);if(e===void 0)throw new Error("useEvents must be used within an EventsProvider");return e},WD=(e,r,t)=>{const n=(i,a)=>a?new Date(a):i?new Date(i.replace(/-/g,"/")):new Date,o=n(e.start.date,e.start.dateTime);let s=n(e.end.date,e.end.dateTime);return e.end.date&&!e.end.dateTime&&s.setDate(s.getDate()-1),{eventoID:Math.abs(HD(e.id)),titulo:e.summary||"(Sin título)",descripcion:e.description,fechaInicio:o,fechaFin:s,todoElDia:!!(e.start.date&&!e.start.dateTime),color:"#4285F4C",hasVideoCall:!!e.conferenceData,link:e.htmlLink,repetir:void 0,solID:null,disID:r,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!0}};function HD(e){let r=0;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);r=(r<<5)-r+n,r|=0}return r}function YD(e){let r=0;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);r=(r<<5)-r+n,r|=0}return r}const qD=(e,r,t)=>{const n=new Date(e.start.dateTime);let o=new Date(e.end.dateTime);return e.isAllDay&&o.setDate(o.getDate()-1),{eventoID:Math.abs(YD(e.id)),titulo:e?.summary||"(Sin título)",descripcion:e.body?.content||"",fechaInicio:n,fechaFin:o,todoElDia:e.isAllDay,color:"#0078D4",hasVideoCall:!!e.onlineMeetingUrl,link:e.webLink,repetir:void 0,solID:null,disID:r,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!1,isOutlookEvent:!0}},hh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='49'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M34.559%2048.077c-7.413%200-13.44-6.039-13.44-13.44s6.027-13.44%2013.44-13.44%2013.44%206.027%2013.44%2013.44c0%207.414-6.027%2013.44-13.44%2013.44'/%3e%3cpath%20fill='%23fff'%20d='M39.827%2029.346c.583.583.605%201.505.05%202.06l-3.218%203.219%203.219%203.218c.555.556.532%201.48-.051%202.062-.584.583-1.506.605-2.062.05l-3.218-3.218-3.218%203.218c-.556.555-1.478.533-2.061-.05s-.606-1.506-.05-2.062l3.217-3.218-3.218-3.218c-.555-.555-.533-1.478.05-2.061.583-.584%201.507-.606%202.063-.05l3.217%203.217%203.218-3.218c.556-.555%201.478-.533%202.062.05'/%3e%3cpath%20fill='%23404756'%20d='M30.367.078c1.112%200%202.001.868%202.001%201.954v1.195h.979c4.913%200%208.892%203.887%208.892%208.686v9.237a15.4%2015.4%200%200%200-4.424-1.691v-1.312H4.468V33.63c0%202.389%202%204.343%204.446%204.343H19.4a15.4%2015.4%200%200%200%201.676%204.343H8.892C3.979%2042.317%200%2038.43%200%2033.631V11.913c0-4.8%203.979-8.686%208.892-8.686h1V2.032c0-1.086.89-1.954%202.002-1.954s2%20.868%202%201.954v1.195h14.473V2.032c0-1.085.889-1.954%202-1.954'/%3e%3c/svg%3e",ZD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",GD=({open:e,onClose:r,onConfirm:t,title:n,description:o,icon:s,confirmText:i,confirmColor:a="#d32f2f",loading:c=!1})=>l.jsxs(m.Dialog,{open:e,onClose:r,PaperProps:{sx:{borderRadius:"15px",p:1,maxWidth:"400px"}},children:[l.jsx(m.Box,{sx:{display:"flex",justifyContent:"flex-end"},children:l.jsx(m.IconButton,{onClick:r,size:"small",children:l.jsx(Rr,{fontSize:"small"})})}),l.jsxs(m.DialogContent,{sx:{textAlign:"center",pt:0},children:[l.jsx(m.Box,{sx:{mb:2,display:"flex",justifyContent:"center"},children:s}),l.jsx(m.Typography,{variant:"h6",sx:{fontWeight:"bold",mb:2},children:n}),l.jsx(m.Typography,{variant:"body2",sx:{color:"#555",mb:4,px:2},children:o}),l.jsxs(m.Box,{sx:{display:"flex",gap:2,justifyContent:"center",mb:2},children:[l.jsx(m.Button,{variant:"outlined",onClick:r,sx:{textTransform:"none",borderRadius:"8px",px:4,borderColor:"#1976D2",color:"#1976D2"},children:"Regresar"}),l.jsxs(m.Button,{variant:"contained",onClick:t,disabled:c,sx:{textTransform:"none",borderRadius:"8px",px:4,bgcolor:a,"&:hover":{bgcolor:"#b71c1c"}},children:[i=="Eliminar"&&l.jsx("img",{src:ZD,width:15,style:{marginRight:6,marginBottom:2}}),c?"Procesando...":i]})]})]})]}),KD=({userId:e,leads30Days:r,leads90Days:t,disId:n,masNombreBD:o,usrNombre:s})=>{const[i,a]=v.useState(new Date),[c,u]=v.useState([]),[d,f]=v.useState(!1),[h,y]=v.useState(null),[g,p]=v.useState(!1),[b,_]=v.useState(null),[S,D]=v.useState([]),{enqueueSnackbar:C}=ss.useSnackbar(),w=sc(),F=mi(),E=nc(),[T,I]=v.useState(!1),[M,U]=v.useState([]),[q,V]=v.useState(null),{session:H,sessionoutlook:re}=Ua(),{googleEvents:W,setGoogleEvents:$,outlookEvents:ie,setOutlookEvents:ue}=UD(),[N,ee]=v.useState([]),[xe,_e]=v.useState([]),[fe,ae]=v.useState([]),[le,X]=v.useState(!1),[we,ye]=v.useState([]),[K,Ie]=v.useState(),P=(Q,ke)=>{U(Q),V(ke),I(!0)},Be=async()=>{if(e===void 0)return;const Q=await w.getNotificacionesXUsuario(e,!1);s?localStorage.setItem("nombreAnfitrion",s):localStorage.setItem("nombreAnfitrion","Anfitrion"),ye(Q)};v.useEffect(()=>{const Q=new Date,ke=x.startOfDay(Q),Ee=x.endOfDay(x.addDays(ke,6)),Re={start:ke,end:Ee},Sr=c.filter($t=>{const Wr={start:$t.fechaInicio,end:$t.fechaFin};return xd(Wr,Re)}).sort(($t,Wr)=>$t.fechaInicio.getTime()-Wr.fechaInicio.getTime());D(Sr)},[c]),v.useEffect(()=>{const Q=async()=>{try{if(e){const Ee=await w.getEventsByUser(e);Be(),u(Ee)}}catch(Ee){console.log("Error al cargar eventos locales:",Ee)}};Q();const ke=setInterval(Q,4e3);return()=>clearInterval(ke)},[e]),v.useEffect(()=>{if(!n||!e)return;const Q=[...c];if(W.length>0&&H?.userEmail){const ke=W.map(Ee=>WD(Ee,n,e));Q.push(...ke)}if(ie.length>0&&re?.userEmail){const ke=ie.map(Ee=>qD(Ee,n,e));Q.push(...ke)}ee(Q)},[c,W,ie,n,e,H?.userEmail,re?.userEmail]);const Qe=async Q=>{try{if(Q?.isGoogleEvent||Q.isOutlookEvent)y(Q),f(!0);else{const ke=await w.getEventById(Q.eventoID);y(ke),f(!0)}}catch(ke){console.error(ke)}},Fe=()=>{f(!1),y(null)},Le=async(Q,ke)=>{let Ee,Re;Q.todoElDia?(Ee=new Date(`${Q.fechaInicio}T${Q.horaInicio}`),Re=new Date(`${Q.fechaInicio}T${Q.horaFin}`)):(Ee=new Date(`${Q.fechaInicio}T${Q.horaInicio}`),Re=Q.fechaFin&&Q.horaFin?new Date(`${Q.fechaFin}T${Q.horaFin}`):new Date(`${Q.fechaInicio}T${Q.horaFin}`));const Sr=x.format(Ee,"yyyy-MM-dd HH:mm:ss.SSS"),$t=x.format(Re,"yyyy-MM-dd HH:mm:ss.SSS");if(ke){const ar={...Q,eventoID:ke,fechaInicio:Sr,fechaFin:$t,solID:Q.solID??null,disID:n??null,client:Q.client,invitados:Q.invitados.map(He=>({usrNombre:He.nombre||He.usrNombre,Correo:He.correo||He.Correo,EsOrganizador:He.isHost||He.EsOrganizador,StatusInvitacion:He.StatusInvitacion,UsuarioID:He.usrID||He.UsuarioID,disID:He.disID||n}))};try{const He=await w.updateEvent(ar);var Wr=c.map(Hr=>Hr.eventoID===He.eventoID?He:Hr);u(Wr),C("El evento se ha actualizado correctamente.",{variant:"success"}),Fe()}catch{C("Error al actualizar Evento",{variant:"error"})}}else{const ar={...Q,fechaInicio:Sr,fechaFin:$t,todoElDia:Q.todoElDia,solID:Q.solID??null,disID:n??null,client:Q.client,invitados:Q.invitados.map(He=>({usrNombre:He.nombre||He.usrNombre,Correo:He.correo||He.Correo,EsOrganizador:He.isHost||He.EsOrganizador,StatusInvitacion:He.StatusInvitacion,UsuarioID:He.usrID||He.UsuarioID,disID:He.disID||n}))};try{const He=await w.createEvent(ar,e);u(Hr=>[...Hr,He]),C("El evento se ha creado con éxito",{variant:"success"}),Fe()}catch{C("Error al guardar Evento",{variant:"error"})}}if(e){const ar=await w.getEventsByUser(e);u(ar)}},We=()=>{a(Q=>new Date(Q.getFullYear(),Q.getMonth()-1,1))},Xe=()=>{a(Q=>new Date(Q.getFullYear(),Q.getMonth()+1,1))},ft=()=>{De("ELIMINAR")},k=()=>{De("RECHAZAR")},O=()=>{_(new Date),f(!0)},B=Q=>{Q&&a(Q)},ce=Q=>{_(Q),f(!0),y(null)},se=async()=>{if(h)try{await w.deleteEvent(h.eventoID),u(c.filter(Q=>Q.eventoID!==h.eventoID)),C("El evento se ha eliminado de tu calendario",{content:(Q,ke)=>l.jsx(Ic,{id:Q,message:String(ke),variant:"delete"})})}catch{C("Error al eliminar Evento",{variant:"error"})}finally{Fe(),Me()}},j=async()=>{if(!(!H?.userEmail||!n)){X(!0);try{const ke=(await F.getGoogleCalendars(H.userEmail,n)).map(Re=>({...Re,selected:!0}));_e(ke);const Ee=ke.map(Re=>Re.id);R(Ee)}catch(Q){console.error("Error Google Cals:",Q)}finally{X(!1)}}},oe=async Q=>{const ke=xe.map(Re=>Re.id===Q?{...Re,selected:!Re.selected}:Re);_e(ke);const Ee=ke.filter(Re=>Re.selected).map(Re=>Re.id);R(Ee)},Se=async()=>{if(!(!re?.userEmail||!n)){X(!0);try{const ke=(await E.getOutlookCalendars(re.userEmail,n)).map(Re=>({...Re,selected:!0}));ae(ke);const Ee=ke.map(Re=>Re.id);te(Ee)}catch(Q){console.error("Error Outlook Cals:",Q)}finally{X(!1)}}},je=async Q=>{const ke=fe.map(Re=>Re.id===Q?{...Re,selected:!Re.selected}:Re);ae(ke);const Ee=ke.filter(Re=>Re.selected).map(Re=>Re.id);te(Ee)};v.useEffect(()=>{j()},[H?.userEmail,n]),v.useEffect(()=>{Se()},[re?.userEmail,n]);const R=async Q=>{if(!H?.userEmail||!n)return;const ke=Q||xe.filter(Ee=>Ee.selected).map(Ee=>Ee.id);try{const Ee={disID:n,year:i.getFullYear(),month:i.getMonth()+1,usrMail:H.userEmail,calendarIds:ke},Re=await F.getGoogleEventsByMonth(Ee);$(Re)}catch(Ee){console.error("Error al obtener eventos de Google:",Ee)}},te=async Q=>{if(!re?.userEmail||!n)return;const ke=Q||fe.filter(Ee=>Ee.selected).map(Ee=>Ee.id);try{const Ee={disID:n,year:i.getFullYear(),month:i.getMonth()+1,usrMail:re.userEmail,calendarIds:ke},Re=await E.getOutlookEventsByMonth(Ee);ue(Re)}catch(Ee){console.error("Error al obtener eventos de Outlook:",Ee)}};if(n===void 0||e===void 0)return l.jsx("div",{children:"Cargando configuración de usuario..."});const be=async(Q,ke)=>{await w.UpdateStatusEvento(Q.evento.eventoID,e,ke)&&(await w.MarcarLeido(Q.notificacionID,e),C(Q?.evento?.titulo+" fue agregado a tu calendario",{variant:"success"}))},qe=async()=>{K&&w.UpdateStatusEvento(K.evento.eventoID,e,"RECHAZADA")&&(await w.MarcarLeido(K.notificacionID,e),await w.MarcarLeido(K.notificacionID,e),C("Haz rechazado la Invitación a "+K?.evento?.titulo,{content:(ke,Ee)=>l.jsx(Ic,{id:ke,message:String(Ee),variant:"rechazar"})}),Me())},Ct=async(Q,ke)=>{try{if(!e)return;Ie(Q),ke=="RECHAZADA"?(k(),console.log("noti",Q)):be(Q,ke)}catch{C("Error al procesar la invitación",{variant:"error"})}},Z=async Q=>{try{if(!h)return;await w.ReenviarNotificacion(h?.eventoID,Q),C("Invitación enviada con éxito",{variant:"success"})}catch(ke){console.error("Error al conectar con la API",ke)}},[de,De]=v.useState(null),Me=()=>De(null),Pe={RECHAZAR:{title:"Rechazar invitación",confirmText:"Rechazar evento",description:l.jsxs(l.Fragment,{children:["Estás a punto de declinar la invitación de ",l.jsx("strong",{children:K?.evento?.nombreAnfitrion})," a ",l.jsx("strong",{children:K?.evento?.titulo})]}),icon:l.jsx("img",{src:hh}),action:()=>K&&qe()},ELIMINAR:{title:"Eliminar evento",confirmText:"Eliminar",description:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer.",icon:l.jsx("img",{src:hh}),action:()=>se()},DESVINCULAR:{title:"Desvincular Outlook",confirmText:"Desvincular",description:"Si desvinculas tu cuenta, perderás acceso a todos los eventos sincronizados.",icon:"",action:()=>se}},Nt=de?Pe[de]:null;return l.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[l.jsx(jv,{header:l.jsx(X2,{currentDate:i,onPrevMonth:We,onNextMonth:Xe,onAddEvent:O,onDateChange:B}),sidebar:l.jsx(Gx,{onEventClick:Qe,upcomingEvents:S,leads30Days:r,leads90Days:t,disID:n,usrID:e,onAddEvent:O,googleCalendars:xe,outlookCalendars:fe,isLoadingCalendars:le,onToggleGoogle:oe,onToggleOutlook:je,notifications:we,unreadCount:we?.filter(Q=>!Q.leida).length,onAceppInvitacion:Ct}),mainContent:l.jsx(lw,{onSeeMoreClick:P,currentDate:i,events:N,onDayClick:ce,onEventClick:Qe})}),d&&l.jsx(ID,{isVisible:d,onClose:Fe,onSave:Le,onDelete:ft,selectedDate:b,initialEvent:h,userId:e,masNombreBD:o,disId:n,onReenviar:Z}),l.jsx(jD,{isOpen:T,onClose:()=>I(!1),events:M,date:q,onEventClick:Qe}),Nt&&l.jsx(GD,{open:!!de,onClose:Me,onConfirm:()=>{Nt.action()},title:Nt.title,description:Nt.description,icon:Nt.icon,confirmText:Nt.confirmText})]})},QD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20fill='%23070c10'%20d='M18.575%203.172A10.829%2010.829%200%200%200%201.564%2016.284l-.028-.051L0%2021.843l5.739-1.506a10.7%2010.7%200%200%200%205.173%201.318%2010.83%2010.83%200%200%200%207.663-18.483m-7.658%2016.655a8.94%208.94%200%200%201-4.62-1.277l.041.023-.329-.194-3.405.894.908-3.321-.214-.34a8.9%208.9%200%200%201-1.376-4.782%209%209%200%201%201%209%209Zm4.935-6.736c-.27-.135-1.6-.789-1.848-.88s-.429-.135-.61.136-.7.879-.856%201.06-.316.2-.586.068a7.5%207.5%200%200%201-2.183-1.349l.007.007a8.2%208.2%200%200%201-1.483-1.842l-.02-.038c-.157-.27-.017-.417.118-.551s.271-.316.406-.473a1.9%201.9%200%200%200%20.267-.44v-.012a.5.5%200%200%200%20.05-.216.5.5%200%200%200-.074-.26c-.068-.135-.609-1.467-.834-2.009s-.444-.455-.609-.464-.338-.009-.519-.009a.99.99%200%200%200-.72.337%203.03%203.03%200%200%200-.947%202.2v.058a5.27%205.27%200%200%200%201.114%202.815v-.011a12.16%2012.16%200%200%200%204.553%204.053l.068.031a14%2014%200%200%200%201.434.539l.109.03a3.6%203.6%200%200%200%201.077.161%203.7%203.7%200%200%200%20.648-.057h-.023a2.8%202.8%200%200%200%201.819-1.274l.007-.012a2.2%202.2%200%200%200%20.19-.9%202.3%202.3%200%200%200-.034-.395v.014c-.067-.113-.248-.18-.519-.316Z'/%3e%3c/svg%3e",XD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='25.085'%20height='18.5'%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='none'%20d='M0%200h25.085v18.5H0z'%20data-name='Rectángulo%204598'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23a)'%20data-name='Grupo%207946'%3e%3cpath%20d='M23.12%205.809V3.226a3.2%203.2%200%200%200-.068-.656l-3.141%202.21a7.8%207.8%200%200%201%203.209%201.032'%20data-name='Trazado%2013329'/%3e%3cpath%20d='M11.847%209.791c-.1.009-.2.023-.308.023a3.78%203.78%200%200%201-2.18-.688L.067%202.58A3.2%203.2%200%200%200%200%203.227V13.98a3.23%203.23%200%200%200%203.226%203.226h9.611a7.86%207.86%200%200%201-.99-7.414'%20data-name='Trazado%2013330'/%3e%3cpath%20d='M12.478%207.369%2021.92.737A3.2%203.2%200%200%200%2019.894%200H3.226a3.2%203.2%200%200%200-2.031.74l9.4%206.628a1.64%201.64%200%200%200%201.881%200'%20data-name='Trazado%2013331'/%3e%3cpath%20d='M23.356%208.407a5.914%205.914%200%201%200%200%208.364%205.92%205.92%200%200%200%200-8.364m-1.833%204.842a.54.54%200%200%201-1.081%200v-1.164l-2.513%202.516a.54.54%200%200%201-.765-.763l2.515-2.515h-1.167a.54.54%200%201%201%200-1.081h2.471a.54.54%200%200%201%20.54.54Z'%20data-name='Trazado%2013332'/%3e%3c/g%3e%3c/svg%3e";function Oc(e,r,t){return e.accessor?e.accessor(r,t):e.field?r?.[e.field]:r?.[e?.key||""]}function JD(e,r){const t=e??"",n=r??"";return t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():typeof t=="number"&&typeof n=="number"?t-n:typeof t=="boolean"&&typeof n=="boolean"?Number(t)-Number(n):String(t).localeCompare(String(n),void 0,{numeric:!0,sensitivity:"base"})}function jc(e,r,t=!0){return typeof e=="function"?e(r):e??t}function e3(e){return e.replace(/[^\d]/g,"")}function t3(e,r){return r}var Yo={},mh;function r3(){if(mh)return Yo;mh=1;var e=ct();Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var r=e(ht()),t=dt();return Yo.default=(0,r.default)((0,t.jsx)("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt"),Yo}var n3=r3();const o3=at(n3);var qo={},gh;function s3(){if(gh)return qo;gh=1;var e=ct();Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var r=e(ht()),t=dt();return qo.default=(0,r.default)((0,t.jsx)("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchRounded"),qo}var i3=s3();const a3=at(i3);var Zo={},vh;function c3(){if(vh)return Zo;vh=1;var e=ct();Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var r=e(ht()),t=dt();return Zo.default=(0,r.default)((0,t.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),Zo}var l3=c3();const u3=at(l3);var Go={},yh;function d3(){if(yh)return Go;yh=1;var e=ct();Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=void 0;var r=e(ht()),t=dt();return Go.default=(0,r.default)((0,t.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),Go}var f3=d3();const p3=at(f3);function bh(e){return e==="right"?"end":e==="center"?"center":"start"}function xh(e){const r=e.filter(t=>!t.width).length||1;return e.map(t=>typeof t.width=="number"?`${t.width}px`:typeof t.width=="string"?t.width:`minmax(0, ${1/r}fr)`).join(" ")}const h3=1060,Pc=(e,r)=>e.metrics.find(t=>String(t.label).toLowerCase()===r.toLowerCase())?.value??"";function m3({sections:e,detailColumns:r,summaryWidths:t=["1fr",120,120,150],minWidth:n=h3,getDetailColumns:o,onRowClick:s}){function c(d){if(typeof d=="number")return d;if(!d)return 0;const f=/^(\d+)\s*px$/.exec(d.trim());return f?Number(f[1]):/fr$/i.test(d)?160:0}function u(d){const f=d.reduce((g,p)=>g+c(p.width),0),h=Math.max(d.length-1,0)*16;return f+h+32}return l.jsx(m.Box,{sx:{border:"1px solid rgba(0,0,0,0.15)",overflow:"hidden",bgcolor:"background.paper",width:"100%"},children:l.jsxs(m.Box,{children:[l.jsx(m.Box,{sx:{display:"grid",gridTemplateColumns:t.map(d=>typeof d=="number"?`${d}px`:d).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"#1E5BCE",color:"#fff",boxSizing:"border-box"},children:["Tipo","En Proceso","Finalizadas","Último seg."].map(d=>l.jsx(m.Typography,{sx:{fontSize:13,fontWeight:800},children:d},d))}),e.map((d,f)=>{const[h,y]=G.useState(!!d.initiallyOpen),g=f%2===1,p=o?o(d):r,b=Math.max(n,u(p));return l.jsxs(m.Box,{children:[l.jsxs(m.Box,{sx:{display:"grid",gridTemplateColumns:t.map(_=>typeof _=="number"?`${_}px`:_).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:g?"rgba(30,91,206,0.06)":"background.paper",borderTop:"1px solid rgba(0,0,0,0.08)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>y(_=>!_),children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[l.jsx(m.IconButton,{size:"small",disableRipple:!0,children:h?l.jsx(p3,{}):l.jsx(u3,{})}),l.jsx(m.Typography,{sx:{fontWeight:700,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(d.title),children:d.title})]}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"En Proceso")}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"Finalizadas")}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"Último seg.")})]}),l.jsx(m.Collapse,{in:h,unmountOnExit:!0,children:l.jsxs(m.Box,{sx:{overflowX:"auto","&::-webkit-scrollbar":{height:"5px"}},children:[l.jsx(m.Box,{sx:{minWidth:b,display:"grid",gridTemplateColumns:xh(p),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"rgba(30,91,206,0.18)",color:"#1a1a1a",borderTop:"1px solid rgba(0,0,0,0.12)",boxSizing:"border-box"},children:p.map(_=>l.jsx(m.Typography,{sx:{justifySelf:bh(_.align),textAlign:_.align??"left",fontSize:12.5,fontWeight:800,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:_.header},_.key))}),(d.rows??[]).map((_,S)=>l.jsx(m.Box,{sx:{minWidth:b,display:"grid",gridTemplateColumns:xh(p),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:S%2===0?"background.paper":"rgba(30,91,206,0.06)",borderTop:"1px solid rgba(0,0,0,0.06)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>s?.(_,d),children:p.map((D,C)=>{const w=D.accessor?D.accessor(_,S):D.field?_[D.field]:null;return l.jsx(m.Box,{sx:{justifySelf:bh(D.align),textAlign:D.align??"left",minWidth:0,overflow:"hidden",maxWidth:"100%"},children:typeof w=="string"||typeof w=="number"?l.jsx(m.Typography,{sx:{fontSize:13,fontWeight:/^(estatus|seg|avance|nivel|asesor|fecha)$/i.test(D.key)?700:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(w),children:w}):w},D.key??C)})},_.id??S))]})})]},d.id)})]})})}var Ko={},wh;function g3(){if(wh)return Ko;wh=1;var e=ct();Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var r=e(ht()),t=dt();return Ko.default=(0,r.default)((0,t.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m3.3 14.71L11 12.41V7h2v4.59l3.71 3.71z"}),"AccessTimeFilled"),Ko}var v3=g3();const y3=at(v3),b3=e=>e?new Date(e).toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}).replace(".",""):"",x3=e=>{const r=`${e?.Nombre??""} ${e?.Apellido??""}`.trim();return r||(e?.IdAsesor?e?.Correo??"Usuario":"Sin asesor asignado")},w3=e=>{const r=(e||"").split(" ").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(e?.[0]??"?").toUpperCase()};var Qo={},_h;function _3(){if(_h)return Qo;_h=1;var e=ct();Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var r=e(ht()),t=dt();return Qo.default=(0,r.default)((0,t.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),Qo}var S3=_3();const C3=at(S3),Rc=({current:e=0,total:r=0,color:t="#4caf50"})=>l.jsx("div",{style:{display:"flex",gap:"1px",width:"100%",height:"100%",justifyContent:"center",overflow:"hidden",minWidth:0},children:Array.from({length:r}).map((n,o)=>l.jsx("div",{style:{width:"7px",height:"7px",borderRadius:"2px",backgroundColor:o<e?t:"#e0e0e0",display:"flex"}},o))});var Xo={},Sh;function E3(){if(Sh)return Xo;Sh=1;var e=ct();Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var r=e(ht()),t=dt();return Xo.default=(0,r.default)((0,t.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Xo}var D3=E3();const Ch=at(D3);var Jo={},Eh;function k3(){if(Eh)return Jo;Eh=1;var e=ct();Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var r=e(ht()),t=dt();return Jo.default=(0,r.default)((0,t.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),Jo}var A3=k3();const T3=at(A3),M3=e=>{const r=String(e??"").toLowerCase().trim();return r==="muy interesado"?{bg:"#E53935",color:"#FFFFFF"}:r==="interesado"?{bg:"#FB8C00",color:"#FFFFFF"}:r==="venta definitiva"?{bg:"#2E7D32",color:"#FFFFFF"}:r==="no sé"||r==="no se"?{bg:"#9E9E9E",color:"#FFFFFF"}:r==="algo interesado"?{bg:"#FFEB3B",color:"#000000"}:{bg:"transparent",color:"#2c2c2c"}},I3=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por Asignar";case 2:return"Solicitud Asignada";case 3:return"Solicitud asignada en proceso";case 4:return"Finalizadas sin Venta";case 5:return"Finalizadas con Venta";case 6:return"Rechazadas";case 7:return"Finalizada por sistema";case 8:return"";case 9:return"";case 10:return"Prospección";case 11:return"Interés Real";case 12:return"Proceso de Compra";case 13:return"";case 14:return"En espera de Unidad";case 15:return"Auto Facturado";case 16:return"";case 17:return"";case 18:return"Compró otra Marca";case 19:return"No comprará";default:return null}},O3=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por asignar";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 6:return"Rechazada";case 7:return"Finalizada sin enviar a Ventas";case 8:return"Finalizada enviado a Ventas";default:return null}},j3=e=>{switch(parseInt(String(e??""),10)){case 0:return"Sin asignar";case 1:return"Confirmado";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 4:return"Confirmado";case 5:return"Finalizada";case 6:return"Rechazada";case 10:return"Reagendado";case 20:return"Seguimiento [Cita Finalizada]";case 30:return"Reenvio";case 40:return"Seguimiento [Mecanico]";case 50:return"Seguimiento";default:return null}};function P3(e){const r=new Date(e),t=r.toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}),n=r.toLocaleTimeString("es-MX",{hour:"2-digit",minute:"2-digit"});return`${t.replace(".","")} • ${n}`}function R3(e){return e.replace(/<br\s*\/?>/gi,`
|
|
177
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");const S=y.compile();return(D,C)=>S(h,D,C)};let s;const i=Si,a=!np.jitless,u=a&&Pw.value,d=r.catchall;let f;e._zod.parse=(h,y)=>{f??(f=n.value);const g=h.value;return i(g)?a&&u&&y?.async===!1&&y.jitless!==!0?(s||(s=o(r.shape)),h=s(h,y),d?wp([],g,h,y,f,e):h):t(h,y):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function _p(e,r,t,n){for(const s of e)if(s.issues.length===0)return r.value=s.value,r;const o=e.filter(s=>!Fn(s));return o.length===1?(r.value=o[0].value,o[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:t,errors:e.map(s=>s.issues.map(i=>vn(i,n,gn())))}),r)}const CS=Y("$ZodUnion",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.options.some(o=>o._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>r.options.some(o=>o._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(r.options.every(o=>o._zod.values))return new Set(r.options.flatMap(o=>Array.from(o._zod.values)))}),mt(e._zod,"pattern",()=>{if(r.options.every(o=>o._zod.pattern)){const o=r.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>_c(s.source)).join("|")})$`)}});const t=r.options.length===1,n=r.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return n(o,s);let i=!1;const a=[];for(const c of r.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>_p(c,o,e,s)):_p(a,o,e,s)}}),ES=Y("$ZodIntersection",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>{const o=t.value,s=r.left._zod.run({value:o,issues:[]},n),i=r.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Sp(t,c,u)):Sp(t,s,i)}});function Dc(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Ro(e)&&Ro(r)){const t=Object.keys(r),n=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...r};for(const s of n){const i=Dc(e[s],r[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=r[n],i=Dc(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};t.push(i.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Sp(e,r,t){if(r.issues.length&&e.issues.push(...r.issues),t.issues.length&&e.issues.push(...t.issues),Fn(e))return e;const n=Dc(r.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const DS=Y("$ZodEnum",(e,r)=>{At.init(e,r);const t=Iw(r.entries),n=new Set(t);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.filter(o=>Rw.has(typeof o)).map(o=>typeof o=="string"?Bn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t,input:i,inst:e}),o}}),kS=Y("$ZodLiteral",(e,r)=>{if(At.init(e,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(r.values),e._zod.pattern=new RegExp(`^(${r.values.map(t=>typeof t=="string"?Bn(t):t?Bn(t.toString()):String(t)).join("|")})$`),e._zod.parse=(t,n)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:r.values,input:o,inst:e}),t}}),AS=Y("$ZodTransform",(e,r)=>{At.init(e,r),e._zod.parse=(t,n)=>{if(n.direction==="backward")throw new rp(e.constructor.name);const o=r.transform(t.value,t);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(t.value=i,t));if(o instanceof Promise)throw new Ln;return t.value=o,t}});function Cp(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const TS=Y("$ZodOptional",(e,r)=>{At.init(e,r),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const t=r.innerType._zod.pattern;return t?new RegExp(`^(${_c(t.source)})?$`):void 0}),e._zod.parse=(t,n)=>{if(r.innerType._zod.optin==="optional"){const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Cp(s,t.value)):Cp(o,t.value)}return t.value===void 0?t:r.innerType._zod.run(t,n)}}),MS=Y("$ZodNullable",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),mt(e._zod,"pattern",()=>{const t=r.innerType._zod.pattern;return t?new RegExp(`^(${_c(t.source)}|null)$`):void 0}),mt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(t,n)=>t.value===null?t:r.innerType._zod.run(t,n)}),IS=Y("$ZodDefault",(e,r)=>{At.init(e,r),e._zod.optin="optional",mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);if(t.value===void 0)return t.value=r.defaultValue,t;const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Ep(s,r)):Ep(o,r)}});function Ep(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const OS=Y("$ZodPrefault",(e,r)=>{At.init(e,r),e._zod.optin="optional",mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=r.defaultValue),r.innerType._zod.run(t,n))}),jS=Y("$ZodNonOptional",(e,r)=>{At.init(e,r),mt(e._zod,"values",()=>{const t=r.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),e._zod.parse=(t,n)=>{const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>Dp(s,e)):Dp(o,e)}});function Dp(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const PS=Y("$ZodCatch",(e,r)=>{At.init(e,r),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),mt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=r.catchValue({...t,error:{issues:s.issues.map(i=>vn(i,n,gn()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=r.catchValue({...t,error:{issues:o.issues.map(s=>vn(s,n,gn()))},input:t.value}),t.issues=[]),t)}}),RS=Y("$ZodPipe",(e,r)=>{At.init(e,r),mt(e._zod,"values",()=>r.in._zod.values),mt(e._zod,"optin",()=>r.in._zod.optin),mt(e._zod,"optout",()=>r.out._zod.optout),mt(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(t,n)=>{if(n.direction==="backward"){const s=r.out._zod.run(t,n);return s instanceof Promise?s.then(i=>Oi(i,r.in,n)):Oi(s,r.in,n)}const o=r.in._zod.run(t,n);return o instanceof Promise?o.then(s=>Oi(s,r.out,n)):Oi(o,r.out,n)}});function Oi(e,r,t){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},t)}const NS=Y("$ZodReadonly",(e,r)=>{At.init(e,r),mt(e._zod,"propValues",()=>r.innerType._zod.propValues),mt(e._zod,"values",()=>r.innerType._zod.values),mt(e._zod,"optin",()=>r.innerType._zod.optin),mt(e._zod,"optout",()=>r.innerType._zod.optout),e._zod.parse=(t,n)=>{if(n.direction==="backward")return r.innerType._zod.run(t,n);const o=r.innerType._zod.run(t,n);return o instanceof Promise?o.then(kp):kp(o)}});function kp(e){return e.value=Object.freeze(e.value),e}const $S=Y("$ZodCustom",(e,r)=>{er.init(e,r),At.init(e,r),e._zod.parse=(t,n)=>t,e._zod.check=t=>{const n=t.value,o=r.fn(n);if(o instanceof Promise)return o.then(s=>Ap(s,t,n,e));Ap(o,t,n,e)}});function Ap(e,r,t,n){if(!e){const o={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),r.issues.push(No(o))}}class LS{constructor(){this._map=new Map,this._idmap=new Map}add(r,...t){const n=t[0];if(this._map.set(r,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,r)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(r){const t=this._map.get(r);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(r),this}get(r){const t=r._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const o={...n,...this._map.get(r)};return Object.keys(o).length?o:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function zS(){return new LS}const ji=zS();function BS(e,r){return new e({type:"string",...Ae(r)})}function FS(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(r)})}function Tp(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(r)})}function VS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(r)})}function US(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(r)})}function WS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(r)})}function HS(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(r)})}function YS(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(r)})}function qS(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(r)})}function ZS(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(r)})}function GS(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(r)})}function KS(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(r)})}function QS(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(r)})}function XS(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(r)})}function JS(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(r)})}function eC(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(r)})}function tC(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(r)})}function rC(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(r)})}function nC(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(r)})}function oC(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(r)})}function sC(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(r)})}function iC(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(r)})}function aC(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(r)})}function cC(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(r)})}function lC(e,r){return new e({type:"string",format:"date",check:"string_format",...Ae(r)})}function uC(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(r)})}function dC(e,r){return new e({type:"string",format:"duration",check:"string_format",...Ae(r)})}function fC(e,r){return new e({type:"number",checks:[],...Ae(r)})}function pC(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(r)})}function hC(e,r){return new e({type:"boolean",...Ae(r)})}function mC(e){return new e({type:"unknown"})}function gC(e,r){return new e({type:"never",...Ae(r)})}function Mp(e,r){return new mp({check:"less_than",...Ae(r),value:e,inclusive:!1})}function kc(e,r){return new mp({check:"less_than",...Ae(r),value:e,inclusive:!0})}function Ip(e,r){return new gp({check:"greater_than",...Ae(r),value:e,inclusive:!1})}function Ac(e,r){return new gp({check:"greater_than",...Ae(r),value:e,inclusive:!0})}function Op(e,r){return new O_({check:"multiple_of",...Ae(r),value:e})}function jp(e,r){return new P_({check:"max_length",...Ae(r),maximum:e})}function Pi(e,r){return new R_({check:"min_length",...Ae(r),minimum:e})}function Pp(e,r){return new N_({check:"length_equals",...Ae(r),length:e})}function vC(e,r){return new $_({check:"string_format",format:"regex",...Ae(r),pattern:e})}function yC(e){return new L_({check:"string_format",format:"lowercase",...Ae(e)})}function bC(e){return new z_({check:"string_format",format:"uppercase",...Ae(e)})}function xC(e,r){return new B_({check:"string_format",format:"includes",...Ae(r),includes:e})}function wC(e,r){return new F_({check:"string_format",format:"starts_with",...Ae(r),prefix:e})}function _C(e,r){return new V_({check:"string_format",format:"ends_with",...Ae(r),suffix:e})}function $o(e){return new U_({check:"overwrite",tx:e})}function SC(e){return $o(r=>r.normalize(e))}function CC(){return $o(e=>e.trim())}function EC(){return $o(e=>e.toLowerCase())}function DC(){return $o(e=>e.toUpperCase())}function kC(e,r,t){return new e({type:"array",element:r,...Ae(t)})}function AC(e,r,t){return new e({type:"custom",check:"custom",fn:r,...Ae(t)})}function TC(e){const r=MC(t=>(t.addIssue=n=>{if(typeof n=="string")t.issues.push(No(n,t.value,r._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),t.issues.push(No(o))}},e(t.value,t)));return r}function MC(e,r){const t=new er({check:"custom",...Ae(r)});return t._zod.check=e,t}function Rp(e,r){try{var t=e()}catch(n){return r(n)}return t&&t.then?t.then(void 0,r):t}function IC(e,r){for(var t={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!t[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),r){var c=t[i].types,u=c&&c[n.code];t[i]=hc(i,r,t,o,u?[].concat(u,n.message):n.message)}e.shift()}return t}function OC(e,r){for(var t={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!t[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(f){return e.push(f)})}),r){var c=t[i].types,u=c&&c[n.code];t[i]=hc(i,r,t,o,u?[].concat(u,n.message):n.message)}e.shift()}return t}function jC(e,r,t){if(t===void 0&&(t={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,s){try{return Promise.resolve(Rp(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](n,r)).then(function(i){return s.shouldUseNativeValidation&&yc({},s),{errors:{},values:t.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ep(IC(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,s){try{return Promise.resolve(Rp(function(){return Promise.resolve((t.mode==="sync"?qw:Zw)(e,n,r)).then(function(i){return s.shouldUseNativeValidation&&yc({},s),{errors:{},values:t.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof Cc})(i))return{values:{},errors:ep(OC(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const PC=Y("ZodISODateTime",(e,r)=>{nS.init(e,r),St.init(e,r)});function RC(e){return cC(PC,e)}const NC=Y("ZodISODate",(e,r)=>{oS.init(e,r),St.init(e,r)});function $C(e){return lC(NC,e)}const LC=Y("ZodISOTime",(e,r)=>{sS.init(e,r),St.init(e,r)});function zC(e){return uC(LC,e)}const BC=Y("ZodISODuration",(e,r)=>{iS.init(e,r),St.init(e,r)});function FC(e){return dC(BC,e)}const pr=Y("ZodError",(e,r)=>{Cc.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Yw(e,t)},flatten:{value:t=>Hw(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,bc,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,bc,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),VC=Di(pr),UC=ki(pr),WC=Ai(pr),HC=Ti(pr),YC=Qw(pr),qC=Xw(pr),ZC=Jw(pr),GC=e_(pr),KC=t_(pr),QC=r_(pr),XC=n_(pr),JC=o_(pr),Rt=Y("ZodType",(e,r)=>(At.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...t)=>e.clone({...r,checks:[...r.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(t,n)=>en(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>VC(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>WC(e,t,n),e.parseAsync=async(t,n)=>UC(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>HC(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>YC(e,t,n),e.decode=(t,n)=>qC(e,t,n),e.encodeAsync=async(t,n)=>ZC(e,t,n),e.decodeAsync=async(t,n)=>GC(e,t,n),e.safeEncode=(t,n)=>KC(e,t,n),e.safeDecode=(t,n)=>QC(e,t,n),e.safeEncodeAsync=async(t,n)=>XC(e,t,n),e.safeDecodeAsync=async(t,n)=>JC(e,t,n),e.refine=(t,n)=>e.check(HE(t,n)),e.superRefine=t=>e.check(YE(t)),e.overwrite=t=>e.check($o(t)),e.optional=()=>Hp(e),e.nullable=()=>Yp(e),e.nullish=()=>Hp(Yp(e)),e.nonoptional=t=>LE(e,t),e.array=()=>Fp(e),e.or=t=>DE([e,t]),e.and=t=>AE(e,t),e.transform=t=>Zp(e,OE(t)),e.default=t=>RE(e,t),e.prefault=t=>$E(e,t),e.catch=t=>BE(e,t),e.pipe=t=>Zp(e,t),e.readonly=()=>UE(e),e.describe=t=>{const n=e.clone();return ji.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return ji.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ji.get(e);const n=e.clone();return ji.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Np=Y("_ZodString",(e,r)=>{Ec.init(e,r),Rt.init(e,r);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...n)=>e.check(vC(...n)),e.includes=(...n)=>e.check(xC(...n)),e.startsWith=(...n)=>e.check(wC(...n)),e.endsWith=(...n)=>e.check(_C(...n)),e.min=(...n)=>e.check(Pi(...n)),e.max=(...n)=>e.check(jp(...n)),e.length=(...n)=>e.check(Pp(...n)),e.nonempty=(...n)=>e.check(Pi(1,...n)),e.lowercase=n=>e.check(yC(n)),e.uppercase=n=>e.check(bC(n)),e.trim=()=>e.check(CC()),e.normalize=(...n)=>e.check(SC(...n)),e.toLowerCase=()=>e.check(EC()),e.toUpperCase=()=>e.check(DC())}),eE=Y("ZodString",(e,r)=>{Ec.init(e,r),Np.init(e,r),e.email=t=>e.check(FS(tE,t)),e.url=t=>e.check(YS(rE,t)),e.jwt=t=>e.check(aC(vE,t)),e.emoji=t=>e.check(qS(nE,t)),e.guid=t=>e.check(Tp($p,t)),e.uuid=t=>e.check(VS(Ri,t)),e.uuidv4=t=>e.check(US(Ri,t)),e.uuidv6=t=>e.check(WS(Ri,t)),e.uuidv7=t=>e.check(HS(Ri,t)),e.nanoid=t=>e.check(ZS(oE,t)),e.guid=t=>e.check(Tp($p,t)),e.cuid=t=>e.check(GS(sE,t)),e.cuid2=t=>e.check(KS(iE,t)),e.ulid=t=>e.check(QS(aE,t)),e.base64=t=>e.check(oC(hE,t)),e.base64url=t=>e.check(sC(mE,t)),e.xid=t=>e.check(XS(cE,t)),e.ksuid=t=>e.check(JS(lE,t)),e.ipv4=t=>e.check(eC(uE,t)),e.ipv6=t=>e.check(tC(dE,t)),e.cidrv4=t=>e.check(rC(fE,t)),e.cidrv6=t=>e.check(nC(pE,t)),e.e164=t=>e.check(iC(gE,t)),e.datetime=t=>e.check(RC(t)),e.date=t=>e.check($C(t)),e.time=t=>e.check(zC(t)),e.duration=t=>e.check(FC(t))});function hr(e){return BS(eE,e)}const St=Y("ZodStringFormat",(e,r)=>{xt.init(e,r),Np.init(e,r)}),tE=Y("ZodEmail",(e,r)=>{Z_.init(e,r),St.init(e,r)}),$p=Y("ZodGUID",(e,r)=>{Y_.init(e,r),St.init(e,r)}),Ri=Y("ZodUUID",(e,r)=>{q_.init(e,r),St.init(e,r)}),rE=Y("ZodURL",(e,r)=>{G_.init(e,r),St.init(e,r)}),nE=Y("ZodEmoji",(e,r)=>{K_.init(e,r),St.init(e,r)}),oE=Y("ZodNanoID",(e,r)=>{Q_.init(e,r),St.init(e,r)}),sE=Y("ZodCUID",(e,r)=>{X_.init(e,r),St.init(e,r)}),iE=Y("ZodCUID2",(e,r)=>{J_.init(e,r),St.init(e,r)}),aE=Y("ZodULID",(e,r)=>{eS.init(e,r),St.init(e,r)}),cE=Y("ZodXID",(e,r)=>{tS.init(e,r),St.init(e,r)}),lE=Y("ZodKSUID",(e,r)=>{rS.init(e,r),St.init(e,r)}),uE=Y("ZodIPv4",(e,r)=>{aS.init(e,r),St.init(e,r)}),dE=Y("ZodIPv6",(e,r)=>{cS.init(e,r),St.init(e,r)}),fE=Y("ZodCIDRv4",(e,r)=>{lS.init(e,r),St.init(e,r)}),pE=Y("ZodCIDRv6",(e,r)=>{uS.init(e,r),St.init(e,r)}),hE=Y("ZodBase64",(e,r)=>{dS.init(e,r),St.init(e,r)}),mE=Y("ZodBase64URL",(e,r)=>{pS.init(e,r),St.init(e,r)}),gE=Y("ZodE164",(e,r)=>{hS.init(e,r),St.init(e,r)}),vE=Y("ZodJWT",(e,r)=>{gS.init(e,r),St.init(e,r)}),Lp=Y("ZodNumber",(e,r)=>{yp.init(e,r),Rt.init(e,r),e.gt=(n,o)=>e.check(Ip(n,o)),e.gte=(n,o)=>e.check(Ac(n,o)),e.min=(n,o)=>e.check(Ac(n,o)),e.lt=(n,o)=>e.check(Mp(n,o)),e.lte=(n,o)=>e.check(kc(n,o)),e.max=(n,o)=>e.check(kc(n,o)),e.int=n=>e.check(zp(n)),e.safe=n=>e.check(zp(n)),e.positive=n=>e.check(Ip(0,n)),e.nonnegative=n=>e.check(Ac(0,n)),e.negative=n=>e.check(Mp(0,n)),e.nonpositive=n=>e.check(kc(0,n)),e.multipleOf=(n,o)=>e.check(Op(n,o)),e.step=(n,o)=>e.check(Op(n,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Ni(e){return fC(Lp,e)}const yE=Y("ZodNumberFormat",(e,r)=>{vS.init(e,r),Lp.init(e,r)});function zp(e){return pC(yE,e)}const bE=Y("ZodBoolean",(e,r)=>{yS.init(e,r),Rt.init(e,r)});function $i(e){return hC(bE,e)}const xE=Y("ZodUnknown",(e,r)=>{bS.init(e,r),Rt.init(e,r)});function Bp(){return mC(xE)}const wE=Y("ZodNever",(e,r)=>{xS.init(e,r),Rt.init(e,r)});function _E(e){return gC(wE,e)}const SE=Y("ZodArray",(e,r)=>{wS.init(e,r),Rt.init(e,r),e.element=r.element,e.min=(t,n)=>e.check(Pi(t,n)),e.nonempty=t=>e.check(Pi(1,t)),e.max=(t,n)=>e.check(jp(t,n)),e.length=(t,n)=>e.check(Pp(t,n)),e.unwrap=()=>e.element});function Fp(e,r){return kC(SE,e,r)}const CE=Y("ZodObject",(e,r)=>{SS.init(e,r),Rt.init(e,r),mt(e,"shape",()=>r.shape),e.keyof=()=>Up(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Bp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Bp()}),e.strict=()=>e.clone({...e._zod.def,catchall:_E()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Bw(e,t),e.safeExtend=t=>Fw(e,t),e.merge=t=>Vw(e,t),e.pick=t=>Lw(e,t),e.omit=t=>zw(e,t),e.partial=(...t)=>Uw(Wp,e,t[0]),e.required=(...t)=>Ww(qp,e,t[0])});function Vp(e,r){const t={type:"object",get shape(){return Jr(this,"shape",e?jw(e):{}),this.shape},...Ae(r)};return new CE(t)}const EE=Y("ZodUnion",(e,r)=>{CS.init(e,r),Rt.init(e,r),e.options=r.options});function DE(e,r){return new EE({type:"union",options:e,...Ae(r)})}const kE=Y("ZodIntersection",(e,r)=>{ES.init(e,r),Rt.init(e,r)});function AE(e,r){return new kE({type:"intersection",left:e,right:r})}const Tc=Y("ZodEnum",(e,r)=>{DS.init(e,r),Rt.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);const t=new Set(Object.keys(r.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(t.has(i))s[i]=r.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Tc({...r,checks:[],...Ae(o),entries:s})},e.exclude=(n,o)=>{const s={...r.entries};for(const i of n)if(t.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Tc({...r,checks:[],...Ae(o),entries:s})}});function Up(e,r){const t=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Tc({type:"enum",entries:t,...Ae(r)})}const TE=Y("ZodLiteral",(e,r)=>{kS.init(e,r),Rt.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function ME(e,r){return new TE({type:"literal",values:Array.isArray(e)?e:[e],...Ae(r)})}const IE=Y("ZodTransform",(e,r)=>{AS.init(e,r),Rt.init(e,r),e._zod.parse=(t,n)=>{if(n.direction==="backward")throw new rp(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(No(s,t.value,r));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),t.issues.push(No(i))}};const o=r.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function OE(e){return new IE({type:"transform",transform:e})}const Wp=Y("ZodOptional",(e,r)=>{TS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Hp(e){return new Wp({type:"optional",innerType:e})}const jE=Y("ZodNullable",(e,r)=>{MS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Yp(e){return new jE({type:"nullable",innerType:e})}const PE=Y("ZodDefault",(e,r)=>{IS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RE(e,r){return new PE({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():ap(r)}})}const NE=Y("ZodPrefault",(e,r)=>{OS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function $E(e,r){return new NE({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():ap(r)}})}const qp=Y("ZodNonOptional",(e,r)=>{jS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function LE(e,r){return new qp({type:"nonoptional",innerType:e,...Ae(r)})}const zE=Y("ZodCatch",(e,r)=>{PS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BE(e,r){return new zE({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const FE=Y("ZodPipe",(e,r)=>{RS.init(e,r),Rt.init(e,r),e.in=r.in,e.out=r.out});function Zp(e,r){return new FE({type:"pipe",in:e,out:r})}const VE=Y("ZodReadonly",(e,r)=>{NS.init(e,r),Rt.init(e,r),e.unwrap=()=>e._zod.def.innerType});function UE(e){return new VE({type:"readonly",innerType:e})}const WE=Y("ZodCustom",(e,r)=>{$S.init(e,r),Rt.init(e,r)});function HE(e,r={}){return AC(WE,e,r)}function YE(e){return TC(e)}const Gp=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,Kp=(e,r)=>{if(!e||!r)return null;const t=e.split("-");if(t.length!==3)return null;const n=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=r.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),u=new Date(n,o,s,a,c);return isNaN(u.getTime())||!x.isValid(u)?null:u},qE=Vp({UsuarioID:Ni().nullable().optional(),disID:Ni().nullable().optional(),EsOrganizador:$i().default(!1),Correo:hr().email("Formato de correo inválido"),StatusInvitacion:Up(["PENDIENTE","CONFIRMADA","RECHAZADA"]).default("PENDIENTE")}),ZE=Vp({titulo:hr().min(1,"El campo Título es requerido.").refine(e=>!e.startsWith(" "),{message:"El título no puede empezar con un espacio en blanco"}),fechaInicio:hr().min(1,"El campo fecha inicio es requerido."),horaInicio:hr().min(1,"La hora de inicio es requerida.").regex(Gp,{message:"Formato inválido"}),horaFin:hr().min(1,"La hora fin es requerida.").regex(Gp,{message:"Formato inválido"}),todoElDia:$i(),fechaFin:hr().optional(),showEndDate:$i().optional(),horaInicio2:hr().optional(),TodoElDia2:$i().optional(),client:hr().nullable().optional(),repetir:hr().optional(),link:hr().trim().url("Debe ser una URL válida. Ejemplo https://meet.google.com/").or(ME("")).optional().refine(e=>e===void 0?!0:!/\s/.test(e),{message:"El enlace no puede contener espacios en blanco"}),descripcion:hr().optional(),invitados:Fp(qE).optional().default([]),color:hr().optional(),solID:Ni().nullable().optional(),disID:Ni().nullable().optional()}).refine(e=>e.showEndDate?e.fechaFin&&e.fechaFin.length>0:!0,{message:"La fecha de fin es requerida.",path:["fechaFin"]}).refine(e=>e.fechaFin!==void 0?!!e.fechaFin&&!!e.horaInicio2:!0,{message:"La hora de fin son requeridas.",path:["horaInicio2"]}).refine(e=>{if(e.todoElDia||!e.fechaInicio||!e.horaInicio||!e.fechaFin||!e.horaInicio2)return!0;const r=Kp(e.fechaInicio,e.horaInicio),t=Kp(e.fechaFin,e.horaFin);return!r||!t||!x.isValid(r)||!x.isValid(t)?!0:!(x.isBefore(t,r)&&!x.isSameDay(t,r)||x.isSameDay(r,t)&&x.isBefore(t,r))},{message:"",path:["horaFin"]}),Qp=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("path",{fill:"#333",d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12"}),G.createElement("path",{fill:"#fff",d:"M16.703 7.275c.52.52.541 1.345.046 1.84l-2.874 2.874 2.874 2.873c.495.496.475 1.32-.046 1.841-.52.52-1.344.54-1.84.045l-2.873-2.873-2.874 2.873c-.496.496-1.32.475-1.84-.045-.521-.521-.541-1.345-.046-1.84l2.874-2.874L7.23 9.116c-.495-.496-.475-1.32.045-1.84.521-.521 1.345-.542 1.841-.046l2.874 2.873 2.873-2.873c.496-.496 1.32-.476 1.84.045"})),GE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M7.288%2022.986h-.147a6.2%206.2%200%200%201-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28%2011a1.228%201.228%200%201%201%201.739%201.739L4.44%2014.317c-1.356%201.357-1.282%203.626.16%205.068a3.82%203.82%200%200%200%202.602%201.135c.95%200%201.825-.32%202.479-.974l1.578-1.579a1.23%201.23%200%200%201%201.739%200c.48.481.48%201.258%200%201.739l-1.579%201.578c-1.097%201.098-2.552%201.69-4.13%201.69zM17.98%2012.998a1.23%201.23%200%200%201%200-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78%203.78%200%200%200-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75%206.03c-.48.48-1.258.48-1.739%200a1.23%201.23%200%200%201%200-1.739l1.579-1.578c2.318-2.319%206.153-2.245%208.558.16a6.23%206.23%200%200%201%201.85%204.279%205.84%205.84%200%200%201-1.69%204.279l-1.578%201.578c-.481.481-1.258.481-1.74%200z'/%3e%3cpath%20d='M14.172%208.11%208.07%2014.214a1.233%201.233%200%200%200%201.743%201.744l6.104-6.104a1.233%201.233%200%201%200-1.744-1.744'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",KE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{fill:"#404756",d:"M21.24 5.72a2.98 2.98 0 0 0-2.97-2.96l-5.19-.06c-1.06-.03-2.12.41-2.87 1.17l-7.49 7.49c-.66.66-1.03 1.54-1.03 2.47s.36 1.81 1.03 2.47l4.97 4.97a3.5 3.5 0 0 0 2.47 1.02c.89 0 1.79-.34 2.47-1.02l7.49-7.49c.76-.76 1.18-1.81 1.17-2.88l-.06-5.19zm-4.2 4.43c-.44.44-1.02.66-1.6.66a2.256 2.256 0 1 1 0-4.51 2.256 2.256 0 0 1 1.6 3.85"})),G.createElement("defs",null,G.createElement("clipPath",{id:"a"},G.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),Xp="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",QE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},G.createElement("path",{d:"M13.085 7.331a1.096 1.096 0 1 0-2.192 0v9.316a1.096 1.096 0 0 0 2.192 0z"}),G.createElement("path",{d:"M16.647 10.893H7.33a1.096 1.096 0 1 0 0 2.192h9.316a1.096 1.096 0 0 0 0-2.192"}),G.createElement("path",{d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12m0-21.808c-5.414 0-9.808 4.394-9.808 9.808S6.586 21.808 12 21.808s9.808-4.394 9.808-9.808S17.403 2.192 12 2.192"})),G.createElement("defs",null,G.createElement("clipPath",{id:"a"},G.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),XE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M13.789%2017H3.21C2.542%2017%202%2017.56%202%2018.25s.542%201.25%201.211%201.25H13.79c.669%200%201.211-.56%201.211-1.25S14.458%2017%2013.789%2017M20.718%204H3.282C2.574%204%202%204.56%202%205.25S2.574%206.5%203.282%206.5h17.436C21.426%206.5%2022%205.94%2022%205.25S21.426%204%2020.718%204M20.718%2010.5H3.282C2.574%2010.5%202%2011.06%202%2011.75S2.574%2013%203.282%2013h17.436c.708%200%201.282-.56%201.282-1.25s-.574-1.25-1.282-1.25'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",JE=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},G.createElement("path",{fill:"#2571D6",fillRule:"evenodd",d:"M17.333 11a6.34 6.34 0 0 1 6.334 6.333 6.34 6.34 0 0 1-6.334 6.334c-3.493 0-6.333-2.846-6.333-6.334A6.343 6.343 0 0 1 17.333 11m-.005 2.37c-.437 0-.79.338-.79.754v2.412h-2.414c-.416 0-.754.355-.754.792s.338.792.754.792h2.413v2.412c0 .416.354.754.791.754s.792-.338.792-.754V18.12h2.413c.416 0 .754-.355.754-.792s-.338-.792-.754-.792H18.12v-2.412c0-.416-.355-.754-.792-.754",clipRule:"evenodd"}),G.createElement("path",{fill:"#2571D6",d:"M11.12 12.297a7.97 7.97 0 0 0-1.787 5.036c0 1.763.571 3.392 1.537 4.714H3.044c-.84 0-1.523-.682-1.523-1.523 0-4.544 3.683-8.227 8.217-8.227zM10.995.139c2.925 0 5.3 2.376 5.3 5.3s-2.376 5.3-5.3 5.3v-.01a5.303 5.303 0 0 1-5.3-5.3 5.295 5.295 0 0 1 5.3-5.29"}));var Lo={},Jp;function eD(){if(Jp)return Lo;Jp=1;var e=ct();Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=void 0;var r=e(ht()),t=dt();return Lo.default=(0,r.default)((0,t.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Lo}var tD=eD();const eh=at(tD);var zo={},th;function rD(){if(th)return zo;th=1;var e=ct();Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var r=e(ht()),t=dt();return zo.default=(0,r.default)((0,t.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),zo}var nD=rD();const oD=at(nD),rh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAElBMVEUAAABpbXlpbXlobXhpbnppbnkdzkEGAAAABXRSTlMAgJ5Y75poDcUAAAA3SURBVBjTYyANiBog2IyhSBzRQGQJASSJIGQJBSIkTBESCA5CGcIAoqUEGDAdiukFBhE4hzAAAK+MB7AghHQFAAAAAElFTkSuQmCC",nh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAADlQTFRFR3BMIHDPJHDUJHDVJXHWJHDVJHHWJHDUI3DUJXHWJXDUJHHUJXHW////c6Tlr8vwiLLp1eT3Nn3ZZnh0KAAAAAx0Uk5TABBAgN+bxCBc7zBwfOSOGgAAAKJJREFUeNp1klsOxSAIREerohb72v9iryFXsSQ9P+BMwiQgJpQ4ZBjIOwrcySAHZetS4Y6UOK3Mb7ZhRGOkYSRjFAg+sSXlNcDGBH5xnI9UB6O3dkhDSEY/pQmAl+Y6n1XnDJA0rd2P6Boex4z7mnrHQ6evOu8oNneE7Dyci5VAQA5sKZF0iSt+rt1AH4cKWC9VNKFiQvX/GTbU6vCGIpddnz/knxPCFgg8/wAAAABJRU5ErkJggg==",sD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAGFBMVEUAAAAAfFQAflYAfVYAfVUAfFQAcFAAfVbb6xt6AAAAB3RSTlMAIN98m0wQyLlfvgAAAE1JREFUGNNjoAgwmiJxhMoDEBLq5QZIEkUCSBKKeCXYYBJgMQeEBHN5CUIHa3m5A8Io8/ISiAREHRAAJWBSSHYwgyXgUjAJsIGGpPkcAJCLE29yhAT7AAAAAElFTkSuQmCC",iD=e=>{const r=["#A17B4B","#7B5BE4","#F9A825","#4A90E2","#5CC85C","#FDD835","#E53935","#B0BEC5"],t=e.charCodeAt(0)%r.length;return r[t]},aD=(e,r,t,n,o)=>{if(r)return l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#1976D2"},children:[l.jsx("img",{src:nh,width:15,style:{marginRight:"5px"}}),l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold"},children:"Anfitrión"})]});switch(e){case"PENDIENTE":return l.jsx(m.Typography,{variant:"caption",sx:{color:"#999",fontStyle:"italic",fontWeight:600},children:"Pendiente"});case"RECHAZADA":return l.jsx(m.Button,{onClick:()=>{n(t),o()},variant:"outlined",size:"small",sx:{fontWeight:600,borderRadius:"8px",textTransform:"none",fontSize:"11px",px:1,py:0},children:"Reenviar"});case"CONFIRMADA":return l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#00A86B"},children:[l.jsx("img",{src:sD,width:15,style:{marginRight:"5px"}}),l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold"},children:"Asistiré"})]});default:return null}};function cD({open:e,handleClose:r,guests:t,onReenviar:n}){const o=t.filter(u=>u.estatus==="CONFIRMADA"||u.isHost),s=t.filter(u=>u.estatus==="PENDIENTE"&&!u.isHost),i=t.filter(u=>u.estatus==="RECHAZADA"&&!u.isHost),a=u=>l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",py:1},children:[l.jsxs(m.Box,{sx:{position:"relative",mr:2},children:[l.jsx(m.Avatar,{sx:{bgcolor:iD(u.iniciales),width:32,height:32,fontSize:"12px",color:"#fff"},children:u.iniciales}),u.estatus==="PENDIENTE"&&l.jsx(m.Box,{sx:{position:"absolute",bottom:-2,right:-4,bgcolor:"#fff",borderRadius:"50%",display:"flex"},children:l.jsx(ic,{sx:{fontSize:14,color:"#546E7A"}})})]}),l.jsx(m.Typography,{variant:"body2",sx:{flexGrow:1,fontWeight:500,color:"#333"},children:u.nombre}),aD(u.estatus,u.isHost,u.usrID,n,r)]},u.nombre),c=({title:u,count:d,badgeColor:f})=>l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",mt:2,mb:1},children:[l.jsx(m.Typography,{variant:"subtitle2",sx:{fontWeight:800,color:"#333",fontSize:"13px"},children:u}),f&&l.jsx(m.Box,{sx:{ml:1,bgcolor:f,color:"#fff",borderRadius:"50%",width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px"},children:d})]});return l.jsxs(m.Dialog,{open:e,onClose:r,fullWidth:!0,maxWidth:"xs",PaperProps:{sx:{border:"solid 0.1 px",height:"100%"}},children:[l.jsxs(m.Box,{sx:{p:"16px 8px"},children:[l.jsx(m.Typography,{variant:"subtitle1",sx:{fontWeight:800,ml:1,color:"#333333"},children:"Lista de invitados"}),l.jsx(m.Button,{onClick:r,startIcon:l.jsx("img",{src:rh,width:20}),sx:{textTransform:"none",color:"#666",fontSize:"16px",p:0,minWidth:0,ml:.5,"&:hover":{bgcolor:"transparent"}},children:"Volver al evento"}),l.jsx(m.IconButton,{onClick:r,sx:{position:"absolute",right:8,top:12},children:l.jsx(Rr,{})})]}),l.jsx(m.Divider,{sx:{backgroundColor:"black"}}),l.jsxs(m.DialogContent,{sx:{p:2},children:[s.length>0&&l.jsxs(m.Box,{sx:{mb:3},children:[l.jsx(c,{title:"Invitados",count:s.length}),s.map(a)]}),o.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(m.Divider,{sx:{my:1,backgroundColor:"black"}}),l.jsxs(m.Box,{sx:{mb:3},children:[l.jsx(c,{title:"Confirmados",count:o.length,badgeColor:"#1976D2"}),o.map(a)]})]}),i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(m.Divider,{sx:{my:1,backgroundColor:"black"}}),l.jsxs(m.Box,{children:[l.jsx(c,{title:"No asistirán",count:i.length,badgeColor:"#1976D2"}),i.map(a)]})]})]})]})}const lD=e=>{const r=["#8D6E63","#9C27B0","#FF9800","#2196F3","#4CAF50","#FFEB3B","#F44336","#9E9E9E"],t=e.charCodeAt(0)%r.length;return r[t]};function uD({guests:e,onReenviar:r}){const[t,n]=v.useState(!1),o=()=>n(!0),s=()=>n(!1);return l.jsxs(l.Fragment,{children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",py:1,borderBottom:"1px solid #eee",width:"100%"},children:[l.jsx(m.AvatarGroup,{max:6,sx:{"& .MuiAvatar-root":{width:32,height:32,fontSize:13,fontWeight:"bold",border:"2px solid #fff",marginLeft:"-8px !important"},"& .MuiBadge-root":{borderRadius:"50%"}},children:e.map((i,a)=>l.jsx(m.Tooltip,{title:i.nombre,arrow:!0,placement:"top",children:l.jsx(m.Box,{children:l.jsx(m.Badge,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},invisible:i.estatus!=="PENDIENTE",sx:{backgroundColor:"white"},badgeContent:l.jsx(m.Box,{sx:{bgcolor:"white",borderRadius:"50%",width:16,height:16,display:"flex",justifyContent:"center",border:"1px solid white",boxShadow:"none"},children:l.jsx("img",{src:Sf})}),children:l.jsx(m.Avatar,{sx:{bgcolor:lD(i.iniciales)},children:i.iniciales})})})},a))}),l.jsx(m.Box,{sx:{flexGrow:1}}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",cursor:"pointer",color:"#1976D2",transition:"opacity 0.2s","&:hover":{opacity:.7}},onClick:o,children:[l.jsx(m.Typography,{variant:"body2",sx:{fontWeight:"bold",fontSize:"14px"},children:"Ver invitados"}),l.jsx(oD,{sx:{fontSize:18,ml:.5}})]})]}),l.jsx(cD,{open:t,handleClose:s,guests:e,onReenviar:r})]})}var Bo={},oh;function dD(){if(oh)return Bo;oh=1;var e=ct();Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.default=void 0;var r=e(ht()),t=dt();return Bo.default=(0,r.default)((0,t.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline"),Bo}var fD=dD();const pD=at(fD),hD=e=>new Date(e+"T00:00:00").toLocaleDateString("es-ES",{day:"numeric",month:"short"}).replace(".",""),sh=e=>{const[r,t]=e.split(":"),n=parseInt(r),o=n>=12?"pm":"am";return`${n%12||12}:${t} ${o}`},ih=e=>e.split(":").slice(0,2).join(":"),mD=({slot:e,onClick:r})=>l.jsxs(m.Box,{onClick:r,sx:{cursor:"pointer",borderRadius:"12px",overflow:"hidden",border:"1px solid #000000",textAlign:"center",transition:"0.2s",backgroundColor:"#fff","&:hover":{transform:"translateY(-3px)",boxShadow:"0px 4px 12px rgba(0,0,0,0.1)",borderColor:"#1976d2"}},children:[l.jsx(m.Box,{sx:{bgcolor:"#333",color:"white",py:.5},children:l.jsx(m.Typography,{variant:"caption",sx:{fontWeight:"bold",textTransform:"capitalize"},children:hD(e.Fecha)})}),l.jsxs(m.Box,{sx:{py:1.5},children:[l.jsx(m.Typography,{sx:{fontSize:"12px"},children:sh(e.HoraInicio)}),l.jsxs(m.Typography,{sx:{fontSize:"12px"},children:["a ",sh(e.HoraFin)]})]})]});function gD({open:e,handleClose:r,suggestions:t,onSelectSlot:n}){const[o,s]=v.useState(16),a=t.slice(0,o).reduce((d,f)=>{const h=f.Fecha;return d[h]||(d[h]=[]),d[h].push(f),d},{}),c=Object.keys(a),u=d=>{const f={...d,HoraInicio:ih(d.HoraInicio),HoraFin:ih(d.HoraFin)};n(f),r()};return v.useEffect(()=>{s(16)},[e]),l.jsxs(m.Dialog,{open:e,onClose:r,fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{borderRadius:"16px"}},children:[l.jsxs(m.Box,{sx:{p:2.5,display:"flex",flexDirection:"column",gap:.5},children:[l.jsx(m.Typography,{variant:"h6",sx:{fontWeight:800,fontSize:"1.1rem"},children:"Selecciona un nuevo horario"}),l.jsx(m.Box,{children:l.jsx(m.Button,{startIcon:l.jsx("img",{src:rh,width:20}),onClick:r,sx:{textTransform:"none",color:"text.secondary",p:0,fontSize:"1rem","&:hover":{backgroundColor:"transparent",color:"#000"}},children:"Volver al evento"})})]}),l.jsx(m.Divider,{}),l.jsx(m.DialogContent,{sx:{px:3,py:3,backgroundColor:"#f9f9f9"},children:c.length===0?l.jsx(m.Typography,{variant:"body2",color:"text.secondary",align:"center",children:"No hay horarios alternativos disponibles en este momento."}):l.jsxs(l.Fragment,{children:[c.map((d,f)=>l.jsxs(m.Box,{sx:{mb:3},children:[l.jsxs(m.Typography,{variant:"subtitle2",sx:{fontWeight:"bold",mb:2,display:"flex",alignItems:"center",color:f===0?"#1976d2":"text.primary",fontSize:"0.9rem"},children:[f===0?"Mismo día ":"Próximas fechas",f===0&&l.jsx("img",{src:nh,width:15,style:{marginLeft:5}})]}),l.jsx(m.Grid,{container:!0,spacing:2,children:a[d].map((h,y)=>l.jsx(m.Grid,{item:!0,xs:6,sm:3,children:l.jsx(mD,{slot:h,onClick:()=>u(h)})},`${d}-${y}`))})]},d)),t.length>o&&l.jsx(m.Box,{sx:{display:"flex",justifyContent:"center",mt:2},children:l.jsx(m.Button,{onClick:()=>s(d=>d+12),startIcon:l.jsx(pD,{}),sx:{textTransform:"none",fontWeight:"bold",color:"#1976d2","&:hover":{backgroundColor:"transparent",textDecoration:"underline"}},children:"Mostrar más horarios disponibles"})})]})})]})}const vD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAIVBMVEVHcExAR1ZAR1NARlVAR1VARlVAR1VARlVARlRARlRAR1ZiwDFVAAAACnRSTlMA5BvHaqI5kH9QLGWfKwAAAQlJREFUeNrd1luqwzAMBNDRw7I7+1/whd4mFa6tBPrX82uJGYMJwc+JLqQ1xU2dLx23NB5EgWjPtAe2Rp4Py8tLmuddeBK/KuRQMgusvDsAwkPRKgU4J14uBIwTw4K8G/GDFncQ6L0FrxYCn1TKhIU4D4UTwZIf8Z2ThjW1/9OoG2XqvTvmiI5LxsRwTRtPTbER3eTJHOcDN8fGkNxagfAxPLChxkyaohTCxEJRU2EeBxDe21NftsrzDuiQup+nwzivn41tQECNC5ZDHrmPCpdEVx+YluaLDONB0bnVcZAUwELgJQUYCzZXMihLOr0Lh7PkmBlLbbFQEsx44fsFY8kwU2PB9Ef+Lv4AL2kmcGZOH2MAAAAASUVORK5CYII=",yD=e=>{const r=["brown","purple","orange","blue","green","yellow","red","grey"],t=e.charCodeAt(0)%r.length;return r[t]};function bD({onSelectGuest:e,availableSuggestions:r,onInputTextChange:t}){const[n,o]=v.useState(null),[s,i]=v.useState(""),a=(u,d)=>{d?(e(d),o(null),i("")):(o(null),i(""))},c=(u,d)=>{i(d),t(d)};return l.jsx(m.Autocomplete,{options:r,value:n,inputValue:s,getOptionLabel:u=>u.correo,onChange:a,onInputChange:c,isOptionEqualToValue:(u,d)=>u.correo===d.correo,disablePortal:!0,noOptionsText:"Sin resultados",renderInput:u=>l.jsx(m.TextField,{...u,placeholder:"Agregar invitados...",variant:"outlined",size:"small",InputProps:{...u.InputProps,startAdornment:l.jsx(m.Box,{sx:{ml:1,display:"flex",alignItems:"center"},children:l.jsx("img",{src:vD,color:"action",width:20})}),disableUnderline:!0}}),renderOption:(u,d)=>v.createElement(m.Box,{component:"li",...u,key:d.correo,sx:{py:1,"& > img":{mr:2,flexShrink:0}}},l.jsx(m.Avatar,{sx:{bgcolor:yD(d.iniciales),mr:2,width:32,height:32,fontSize:14},children:d.iniciales}),l.jsx(m.Typography,{children:d.nombre}))},"guest-autocomplete-field")}var Fo={},ah;function xD(){if(ah)return Fo;ah=1;var e=ct();Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=void 0;var r=e(ht()),t=dt();return Fo.default=(0,r.default)((0,t.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),Fo}var wD=xD();const _D=at(wD);var Vo={},ch;function SD(){if(ch)return Vo;ch=1;var e=ct();Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.default=void 0;var r=e(ht()),t=dt();return Vo.default=(0,r.default)((0,t.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),Vo}var CD=SD();const Mc=at(CD),ED=e=>e.tieneConflicto?{icon:l.jsx(Mc,{sx:{fontSize:18,color:"#d32f2f"}}),fillColor:"#FFF5F5",iconColor:"#d32f2f",textColor:"#333333",variant:"filled"}:{icon:l.jsx(_D,{sx:{fontSize:20,color:"#1a73e8"}}),fillColor:"#eaedf2",iconColor:"#1a73e8",textColor:"#000000",variant:"filled"},DD=e=>{const r=["#8D6E63","#9C27B0","#FF9800","#2196F3","#4CAF50","#FDD835","#F44336","#9E9E9E"],t=e.charCodeAt(0)%r.length;return r[t]};function kD({guests:e,conflictCount:r,onViewSuggestions:t,onDeleteGuest:n}){const o=i=>a=>{a.stopPropagation(),n(i)},s=i=>i?i.trim().split(/\s+/).slice(0,2).join(" "):"";return l.jsxs(m.Box,{sx:{p:1},children:[l.jsx(m.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:e.map((i,a)=>{const c=ED(i),u=DD(i.iniciales);return l.jsx(m.Chip,{label:l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[l.jsx(m.Typography,{variant:"body2",sx:{color:c.textColor,ml:.5,mr:1,fontSize:"13px",fontWeight:400},children:s(i?.nombre)}),l.jsx(m.Box,{className:"status-icon-wrapper",sx:{display:"flex",alignItems:"center",ml:"auto",margin:"5px"},children:c.icon})]}),avatar:l.jsx(m.Avatar,{sx:{bgcolor:u,width:24,height:24,fontSize:"10px",fontWeight:"bold",color:"#ffffff !important",ml:"4px !important"},children:i.iniciales}),sx:{backgroundColor:c.fillColor,height:"32px",borderRadius:"100px",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.2s ease-in-out",cursor:"pointer","&:hover":{backgroundColor:c.fillColor,filter:"brightness(0.97)","& .status-icon-wrapper":{display:"none"},"& .MuiChip-deleteIcon":{display:"inline-block"}},"& .MuiChip-label":{paddingLeft:"4px",paddingRight:"8px",width:"100%",display:"flex"},"& .MuiChip-deleteIcon":{display:"none",fontSize:"18px",color:"#000000",ml:"auto",mr:"4px","&:hover":{color:"#000000"}}},onClick:()=>console.log(`Ver perfil de ${i.nombre}`),onDelete:o(i.nombre)},a)})}),r>0&&l.jsxs(m.Box,{sx:{mt:2,display:"flex",flexDirection:"column",gap:.5},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",color:"#E53935"},children:[l.jsx(Mc,{sx:{mr:1,fontSize:22}}),l.jsxs(m.Typography,{sx:{fontSize:"15px",fontWeight:500,color:"#E53935"},children:["Se detectó un conflicto de agenda con ",l.jsxs("strong",{children:[r," invitado"]}),r!==1?"s":""]})]}),l.jsx(m.Link,{component:"button",type:"button",variant:"body2",onClick:i=>{i.preventDefault(),i.stopPropagation(),t()},sx:{ml:4,textAlign:"left",textDecoration:"underline",fontWeight:700,fontSize:"15px",color:"#1976D2",border:"none",background:"none",padding:0,cursor:"pointer","&:hover":{color:"#1565C0"}},children:"Ver sugerencias de horario"})]})]})}function AD(e,r){const[t,n]=v.useState(e);return v.useEffect(()=>{const o=setTimeout(()=>{n(e)},r);return()=>{clearTimeout(o)}},[e,r]),t}const TD={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:450,md:500},bgcolor:"background.paper",boxShadow:24,p:{xs:2,sm:3},borderRadius:2,maxHeight:"90vh",overflowY:"auto"},lh=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],MD=()=>{const e=[];for(let r=0;r<24;r++)for(let t=0;t<60;t+=15){const n=r.toString().padStart(2,"0"),o=t.toString().padStart(2,"0");e.push(`${n}:${o}`)}return e},uh=[],Vn=MD(),Uo=(e,r)=>{if(!e||!r)return null;const t=e.split("-");if(t.length!==3)return null;const n=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=r.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),u=new Date(s,o,n,a,c);return isNaN(u.getTime())||!x.isValid(u)?null:u},ID=({isVisible:e,onClose:r,onSave:t,onDelete:n,selectedDate:o,initialEvent:s,userId:i,masNombreBD:a,disId:c,onReenviar:u})=>{const[d,f]=v.useState(!1),[h,y]=v.useState(!1),g=x.format(new Date,"yyyy-MM-dd"),[p,b]=v.useState(""),[_,S]=v.useState([]),[D,C]=v.useState(!1),w=sc(),[F,E]=v.useState([]),[T,I]=v.useState(""),[M,U]=v.useState(uh),[q,V]=v.useState(!1),[H,re]=v.useState(""),[W,$]=v.useState(!1),[ie,ue]=v.useState([]),[N,ee]=v.useState([]),xe=AD(H,300),_e=M.filter(Z=>Z.tieneConflicto).length,{control:fe,handleSubmit:ae,reset:le,formState:{errors:X,isValid:we},watch:ye,setValue:K}=Xf({resolver:jC(ZE),defaultValues:{titulo:s?.titulo||"",fechaInicio:x.format(new Date,"yyyy-MM-dd"),horaInicio:x.format(new Date,"HH:mm"),horaFin:x.format(x.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:s?.client||null,repetir:"No repetir",link:s?.link||"",descripcion:s?.descripcion||"",solID:s?.solID??null,invitados:[]},mode:"onChange"}),Ie=ye("fechaInicio"),P=ye("fechaFin"),Be=ye("todoElDia");v.useEffect(()=>{if(p.trim()===""||!i||!c||!a){S([]),E([]),K("solID",null),C(!1),I("");return}C(!0);const Z=setTimeout(()=>{w.getClients(p,c,a,i).then(de=>{if(C(!1),de){const Me=de.map(Pe=>Pe.solID);E([...new Set(Me)])}else E([]);const De=Array.from(new Map(de.map(Me=>[Me.nombreCliente,Me])).values());if(De.length>0)S(De),I("");else if(s?.client&&s.solID!==null){const Me=[{solID:s.solID,nombreCliente:s.client}];S(Me),I("Sin resultados")}else S([]),I("Sin resultados")}).catch(de=>{console.error("Error al buscar clientes:",de),C(!1)})},500);return()=>clearTimeout(Z)},[p,i,c,a]),v.useEffect(()=>{if(Ie&&P){const Z=new Date(Ie),de=new Date(P);(Z===de||Z>de)&&K("fechaFin",Ie)}},[Ie,P,K]),v.useEffect(()=>{Ie&&K("fechaFin",Ie)},[Ie]),v.useEffect(()=>{K("showEndDate",d)},[d,K]),v.useEffect(()=>{if(console.log("initialEvent",s),s){const Z=x.format(s.fechaInicio,"yyyy-MM-dd")===x.format(s.fechaFin,"yyyy-MM-dd");if(f(!Z),K("titulo",s?.titulo),K("fechaInicio",x.format(s.fechaInicio,"yyyy-MM-dd")),K("fechaFin",x.format(s.fechaFin,"yyyy-MM-dd")),K("horaInicio",x.format(s.fechaInicio,"HH:mm")),K("horaFin",x.format(s.fechaFin,"HH:mm")),K("horaInicio2",x.format(s.fechaFin,"HH:mm")),K("descripcion",s.descripcion),K("link",s.link),K("repetir","false"),K("color",s.color),K("todoElDia",s.todoElDia),K("solID",s.solID),K("client",s.client),s.invitados&&s.invitados.length>0){const de=(s?.invitados||[]).map(Pe=>{const Nt=Pe.usrNombre?.trim()||"",Q=Nt.split(/\s+/),ke=Q.length>1?(Q[0][0]+Q[1][0]).toUpperCase():Nt.substring(0,2).toUpperCase();return{nombre:Pe.usrNombre||"Sin nombre",correo:Pe.correo||"",iniciales:ke||"--",usrID:Pe.usuarioID??null,isHost:Pe.esOrganizador||!1,estatus:Pe.statusInvitacion,tieneConflicto:!1,disID:Pe.disID}}),De=localStorage.getItem("nombreAnfitrion")||"Anfitrión",Me={nombre:De,correo:"",iniciales:De.substring(0,2).toUpperCase(),usrID:i??0,isHost:!0,estatus:"CONFIRMADA",tieneConflicto:!1};U([Me,...de])}else U(uh);s.solID?y(!0):y(!1)}else{const Z=o||new Date,de=new Date,De=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate(),de.getHours(),de.getMinutes()),Me=x.addHours(De,1);le({titulo:"",fechaInicio:x.format(De,"yyyy-MM-dd"),horaInicio:x.format(De,"HH:mm"),fechaFin:x.format(Me,"yyyy-MM-dd"),horaFin:x.format(Me,"HH:mm"),horaInicio2:x.format(Me,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:lh[0],solID:null}),f(!1),y(!1)}},[s,e,o]);const Qe=Z=>({UsuarioID:Z.usrID??null,Correo:Z.correo,EsOrganizador:Z.usrID==i,StatusInvitacion:Z.estatus,disID:c??null}),Fe=ae(Z=>{const de=M.map(Me=>Qe(Me)),De={...Z,invitados:de};t(De,s?.eventoID),r(),le(),f(!1)},Z=>{console.log("Errores de validación:",Z)});v.useEffect(()=>{Be&&(K("horaInicio","00:00"),K("horaFin","23:59"))},[Be,K,ye]);const Le=()=>{const Z=ye("fechaInicio");if(Z){const de=new Date(`${Z}T00:00:00`),De=x.addDays(de,1);K("fechaFin",x.format(De,"yyyy-MM-dd"))}f(!0)},We=ye("fechaInicio"),Xe=ye("horaInicio"),ft=ye("fechaFin"),k=ye("horaFin"),[O,B]=v.useState(null),[ce,se]=v.useState(null);v.useEffect(()=>{(O===null||O!==Xe)&&B(Xe)},[Xe,O]),v.useEffect(()=>{(ce===null||ce!==k)&&se(k??"")},[k,ce]);const j=ye("todoElDia");v.useEffect(()=>{if(j||!Xe||!k||!We||!ft)return;const Z=Uo(We,Xe),de=Uo(ft,k);if(!Z||!de||!x.isValid(Z)||!x.isValid(de))return;const De=x.isSameDay(Z,de),Me=De&&(x.isAfter(Z,de)||Z.getTime()===de.getTime()),Pe=x.isBefore(de,Z)&&!De;(Me||Pe)&&(K("horaFin",""),se(""))},[Xe,We]);const oe=v.useMemo(()=>{if(!Xe||!We)return Vn;const Z=Uo(We,Xe),de=Uo(ft,"00:00");return!Z||!de||!x.isValid(Z)||!x.isValid(de)||x.isBefore(de,Z)&&!x.isSameDay(de,Z)?Vn:x.isSameDay(Z,de)?Vn.filter(De=>{const Me=Uo(ft,De);return Me&&x.isAfter(Me,Z)}):(x.isAfter(de,Z),Vn)},[Xe,We,ft]),Se=v.useMemo(()=>Vn,[]),je=async Z=>{const de=M.some($t=>$t.correo===Z.correo);if($(!0),de)return;const De=c,Me=Z.correo,Pe=Z.usrID,Nt=We,Q=Xe,ke=k;if(!De||!Me||!Nt||!Q||!ke){U($t=>[...$t,{...Z,status:"pending",isHost:!1,hasConflict:!1,usrID:Pe,name:Z.nombre}]);return}let Ee;try{Ee=await w.VerificarConflicto(De,Me,Nt,Q+":00",ke+":00")}catch{Ee={tieneConflicto:!1,usrMail:Z.correo}}const Re=Array.isArray(Ee)?Ee[0]:Ee,Sr={...Z,estatus:"PENDIENTE",isHost:!1,tieneConflicto:String(Re.tieneConflicto).toLowerCase()==="true"};if(Sr.tieneConflicto){const $t=await w.getDisponibilidadUsuario(c,Me,Nt,"60");ue($t)}U($t=>[...$t,Sr])},R=Z=>{U(de=>de.filter(De=>De.nombre!==Z))},te=()=>{V(!1)},be=Z=>{const Me=(Z.usrNombre??"").split(" ").map(Pe=>Pe.charAt(0)).join("").toUpperCase().substring(0,2);return{nombre:Z.usrNombre??"",correo:Z.usrMail??"",iniciales:Me,usrID:Z.usrID??0,estatus:"PENDIENTE",tieneConflicto:!1,isHost:!1}};v.useEffect(()=>{xe.length>2&&c?(async()=>{const De=(await w.getUsuariosInvitados(c,xe)).map(be).filter(Me=>Me.usrID!==i&&!M.some(Pe=>Pe.correo===Me.correo));ee(De)})():ee([])},[xe,M]);const qe=Z=>{re(Z)},Ct=Z=>{const{Fecha:de,HoraInicio:De,HoraFin:Me}=Z,Pe=Nt=>Nt.split(":").slice(0,2).join(":");K("fechaInicio",de),K("fechaFin",de),K("horaInicio",Pe(De)),K("horaFin",Pe(Me)),f(!1),te(),console.log("Formulario actualizado con sugerencia:",{Fecha:de,HoraInicio:De,HoraFin:Me})};return l.jsx(l.Fragment,{children:l.jsx(m.Modal,{open:e,onClose:r,children:l.jsx("form",{onSubmit:Fe,children:l.jsxs(m.Box,{sx:TD,children:[l.jsx(m.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:12},children:l.jsx(Rr,{})}),l.jsx(m.Typography,{variant:"h6",mb:2,children:s?.isGoogleEvent||s?.isOutlookEvent||!s?.esOrganizador?l.jsx(l.Fragment,{children:s?.titulo||"Evento de Google"}):s?"Editar evento":"Agregar evento"}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"titulo",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!X.titulo,helperText:X.titulo?.message,inputProps:{maxLength:100},sx:{"& .MuiInputLabel-root.Mui-focused":{color:"black"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"black"},"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}})})})}),l.jsxs("div",{className:`row g-2 ${d?"mb-1":"mb-2"}`,children:[l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"fechaInicio",control:fe,render:({field:Z})=>l.jsx(m.TextField,{fullWidth:!0,...Z,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!X.fechaInicio,helperText:X.fechaInicio?.message})})}),d?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"col-md-3 d-none d-md-block"}),l.jsx("div",{className:"col-10 col-md-4",children:l.jsx(ir,{name:"fechaFin",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,type:"date",placeholder:"Fecha de fin",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:Ie||g},error:!!X.fechaFin,helperText:X.fechaFin?.message})})}),!s&&l.jsx("div",{className:"col-2 col-md-1 d-flex align-items-start",children:l.jsx(m.IconButton,{onClick:()=>f(!1),sx:{fontSize:18},children:l.jsx(Qp,{})})})]}):l.jsx("div",{className:"col-md-8"})]}),d&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12 d-flex justify-content-center",children:l.jsx(eh,{sx:{color:"#757575",my:1}})})}),l.jsxs("div",{className:"row g-2 mb-2",children:[l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"horaInicio",control:fe,render:({field:{onChange:Z,value:de,...De}})=>l.jsx(m.Autocomplete,{freeSolo:!0,options:Se,value:de||"",onChange:(Me,Pe)=>Z(Pe||""),onInputChange:(Me,Pe)=>Z(Pe),renderInput:Me=>l.jsx(m.TextField,{...Me,...De,size:"small",error:!!X.horaInicio,helperText:X.horaInicio?.message,InputProps:{...Me.InputProps,endAdornment:l.jsx(m.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:l.jsx(ic,{})})}}),disabled:j})})}),!d&&l.jsx("div",{className:"col-1 d-flex align-items-center justify-content-center",style:{marginTop:X.horaInicio?"5px":"0px"},children:l.jsx(eh,{sx:{color:"#757575"}})}),d&&l.jsx("div",{className:"col-md-3 d-none d-md-block"}),l.jsx("div",{className:"col-12 col-md-4",children:l.jsx(ir,{name:"horaFin",control:fe,render:({field:{onChange:Z,value:de,...De}})=>l.jsx(m.Autocomplete,{freeSolo:!0,options:oe,value:de||"",onChange:(Me,Pe)=>Z(Pe||""),onInputChange:(Me,Pe)=>Z(Pe),renderInput:Me=>l.jsx(m.TextField,{...Me,...De,size:"small",error:!!X.horaFin,helperText:X.horaFin?.message,InputProps:{...Me.InputProps,endAdornment:l.jsx(m.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:l.jsx(ic,{})})}}),disabled:j})})}),!d&&l.jsx("div",{className:"col-12 col-md-2 d-flex align-items-center",children:l.jsx(ir,{name:"todoElDia",control:fe,render:({field:Z})=>l.jsx(m.FormControlLabel,{control:l.jsx(m.Checkbox,{checked:Z.value,onChange:de=>Z.onChange(de.target.checked)}),label:l.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"}),sx:{whiteSpace:"nowrap"}})})})]}),(!s?.isGoogleEvent||s?.isOutlookEvent)&&!d&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsxs(m.Button,{onClick:Le,size:"small",sx:{textTransform:"none",fontSize:16},children:[l.jsx(QE,{})," Agregar fecha final"]})})}),(!s?.isGoogleEvent||s?.isOutlookEvent)&&l.jsx("div",{className:"row mb-2",children:l.jsxs("div",{className:"col-12",children:[!h&&l.jsxs(m.Button,{onClick:()=>y(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[l.jsx(JE,{})," Vincular cliente"]}),h&&l.jsxs("div",{className:"row g-2",children:[l.jsx("div",{className:"col-10 col-md-5",children:l.jsx(ir,{name:"client",control:fe,render:({field:Z})=>l.jsx(m.Autocomplete,{options:_,loading:D,loadingText:"Buscando coincidencias...",getOptionLabel:de=>de.nombreCliente?.trim()||"",value:_.find(de=>de.nombreCliente===Z.value)||(Z.value&&typeof Z.value=="string"?{solID:-1,nombreCliente:Z.value}:null),noOptionsText:T,onInputChange:(de,De)=>{b(De)},onChange:(de,De)=>{Z.onChange(De?De.nombreCliente:"")},renderInput:de=>l.jsx(m.TextField,{...de,placeholder:"Buscar cliente...",size:"small",InputProps:{...de.InputProps,startAdornment:l.jsx("img",{src:Md,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"5px"}}),endAdornment:l.jsxs(l.Fragment,{children:[D?l.jsx(m.CircularProgress,{color:"inherit",size:20}):null,de.InputProps.endAdornment]})}})})})}),l.jsx("div",{className:"col-10 col-md-5",children:l.jsx(ir,{name:"solID",control:fe,render:({field:Z})=>l.jsx(m.Autocomplete,{options:F,noOptionsText:"Sin resultados",getOptionLabel:de=>de.toString(),value:Z.value??null,onChange:(de,De)=>Z.onChange(De),renderInput:de=>l.jsx(m.TextField,{...de,label:"#Registro",variant:"outlined",size:"small",sx:{"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}}),disabled:!_.length})})}),l.jsx("div",{className:"col-2 d-flex align-items-center",children:l.jsx(m.IconButton,{onClick:()=>y(!1),sx:{fontSize:18},children:l.jsx(Qp,{})})})]})]})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"link",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!X.link,helperText:X.link?.message,InputProps:{startAdornment:l.jsx("img",{src:GE,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"8px"}})}})})})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(ir,{name:"descripcion",control:fe,render:({field:Z})=>l.jsx(m.TextField,{...Z,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,inputProps:{maxLength:500},variant:"outlined",size:"small",InputProps:{startAdornment:l.jsx("img",{src:XE,width:20,style:{alignSelf:"flex-start",marginRight:"8px"}})}})})})}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(bD,{onSelectGuest:je,availableSuggestions:N,onInputTextChange:qe})})}),W&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(kD,{guests:M,conflictCount:_e,onViewSuggestions:()=>V(!0),onDeleteGuest:R})})}),s?.invitados&&s?.invitados?.length>0&&l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsx(m.Box,{children:l.jsx(uD,{guests:M,onReenviar:u})})})}),l.jsx(gD,{open:q,handleClose:te,suggestions:ie,onSelectSlot:Ct}),l.jsx("div",{className:"row mb-2",children:l.jsx("div",{className:"col-12",children:l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[l.jsx(KE,{}),lh.map(Z=>l.jsx(ir,{name:"color",control:fe,render:({field:de})=>l.jsx(m.IconButton,{onClick:()=>de.onChange(Z),sx:{width:24,height:24,borderRadius:"50%",bgcolor:Z,border:de.value===Z?"2px solid":"none",borderColor:de.value===Z?"primary.main":"transparent"}})},Z))]})})}),l.jsx("div",{className:"row",children:l.jsxs("div",{className:"col-12 d-flex gap-2",style:{width:"100%",marginTop:"20px"},children:[s&&!s?.isGoogleEvent&&!s?.isOutlookEvent&&l.jsx(m.Button,{onClick:n,variant:"outlined",startIcon:l.jsx("img",{src:Xp,width:15}),hidden:s?s?.esOrganizador!=!0:!1,sx:{flex:1,textTransform:"none",backgroundColor:"#FFF5F5",color:"#d32f2f",borderColor:"red",borderRadius:"8px",fontWeight:700,fontSize:"14px",padding:"8px 0","&:hover":{backgroundColor:"#FEE2E2",borderColor:"red"}},children:"Eliminar"}),l.jsx(m.Button,{onClick:r,variant:"outlined",sx:{flex:1,textTransform:"none",fontWeight:700,fontSize:"14px",borderRadius:"8px",color:"#1976D2",borderColor:"#1976D2","&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)",borderColor:"#115293"}},children:"Cancelar"}),l.jsx(m.Button,{onClick:Fe,variant:"contained",disabled:!we,hidden:s?s?.esOrganizador!=!0:!1,sx:{flex:1,textTransform:"none",fontWeight:700,fontSize:"14px",borderRadius:"8px",backgroundColor:"#1976D2",boxShadow:"none","&:hover":{backgroundColor:"#115293",boxShadow:"0px 2px 4px rgba(0,0,0,0.2)"}},children:"Guardar"})]})})]})})})})},OD={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:450,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2,maxHeight:"80vh",overflowY:"auto"},jD=({isOpen:e,onClose:r,events:t,date:n,onEventClick:o})=>{if(!n)return null;const s=a=>{o(a),r()},i=a=>a.isGoogleEvent?{label:"G",borderColor:"#4285F4"}:a.isOutlookEvent?{label:"O",borderColor:"#0078d9"}:{label:"-",borderColor:"#CCC"};return l.jsx(m.Modal,{open:e,onClose:r,children:l.jsxs(m.Box,{sx:OD,children:[l.jsxs(m.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[l.jsxs(m.Typography,{sx:{fontSize:"18px",fontWeight:"bold"},component:"h2",children:["Eventos del"," ",n.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),l.jsx(m.IconButton,{onClick:r,size:"small",children:l.jsx(Rr,{})})]}),l.jsx(m.Divider,{}),l.jsx(m.List,{sx:{mt:1},children:t.map(a=>{const c=i(a);return l.jsx(m.ListItem,{disablePadding:!0,sx:{mb:1},children:l.jsx(m.ListItemButton,{onClick:()=>s(a),sx:{py:1,borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.02)",borderLeft:`5px solid ${c?.borderColor}`,"&:hover":{backgroundColor:"rgba(0,0,0,0.04)"}},children:l.jsxs(m.Box,{sx:{flexGrow:1},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[l.jsx(m.Typography,{sx:{fontSize:"10px",fontWeight:"bold",px:.5,borderRadius:"3px",backgroundColor:c?.borderColor,color:"white",textTransform:"uppercase"},children:c?.label}),l.jsx(m.Typography,{sx:{fontSize:"14px",fontWeight:600,lineHeight:1.2,color:"#333"},children:a.titulo})]}),l.jsx(m.Typography,{sx:{fontSize:"12px",color:"#666"},children:a.todoElDia?"Todo el día":`${x.format(a.fechaInicio,"hh:mm aa").toLowerCase()} - ${x.format(a.fechaFin,"hh:mm aa").toLowerCase()}`})]})})},a.eventoID)})})]})})};var Wo={},dh;function PD(){if(dh)return Wo;dh=1;var e=ct();Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.default=void 0;var r=e(ht()),t=dt();return Wo.default=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),Wo}var RD=PD();const ND=at(RD);var Ho={},fh;function $D(){if(fh)return Ho;fh=1;var e=ct();Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=void 0;var r=e(ht()),t=dt();return Ho.default=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),Ho}var LD=$D();const zD=at(LD),BD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M19.378%204.405a1.813%201.813%200%201%201%202.565%202.565L9.571%2019.342a1.813%201.813%200%200%201-2.565%200l-4.949-4.949a1.814%201.814%200%200%201%202.428-2.69l.137.126%203.666%203.666z'/%3e%3c/svg%3e",FD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAALVBMVEVHcEzfEBfjCxzkChvkChvkChzkCxvlChv////96uv60dT1o6ryho/mGyvkCxypwAsrAAAACHRSTlMAECtdiKDJ5DEbuTIAAAHoSURBVHjatdlbjsMgDAVQ87JJKHf/y51pf9CIp+vJ/SzSkUloAZc2cSEkFgEAYU7RO/o+zkdBF07hO9QnwSzJq4uLgmUkGDgzGTrORHrGcZLXlmcvMkKZaJxuH/YLTwB9ZCo6AUyivb4m7uuziwxDeLtezKsnwJiwfCH2x5hgDi8mbJ+0APaI6wo0Ju4KrIBqQNyqwFqufL3qYOD1O1DqqkQZeVd+567dwJ3fuUai0Cceg5Scm9h5v3lhED9fgzk3ceTlC4Ok+YxzLzbvk+lrCRjl6sTmzSuEn80Yr9yJzZs+Q6Tp72C9/4jdRwXDCJEDTsQzD3DkcSaeeQgUcSZuvAYmnIlnHhIxVqLWAxNjKSo9CAl0YsEGBFRiwSYEhdh5dvCuBrB5GlH3UvaikOw8ncjbha0UeffV04qJwplX7jMxUjjzUM9ET+7Mw6HoiOTIOxR5ehYunXe8SfndNlpwvo2G2XWidl4nYhQ3PYpczVMfRfxqoy9QHZbWx7nm9eK9OM5RnB84h8VPTqJA6G55toj5WtYX+K8lypMXH2KYkx64PD55vbVfwJ9pEZgfo70tYm/c2FtLds/eTHu23WdvSG7jk2a6zzV17aRER4oEUXDm1r0kT18lJB5o5n8sErN8JOEUtv9U/ACrTv/qOzhclQAAAABJRU5ErkJggg==",Ic=v.forwardRef(({id:e,message:r,variant:t},n)=>{const{closeSnackbar:o}=ss.useSnackbar(),s={success:{color:"#fff",icon:l.jsx("img",{width:25,src:BD,style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"12px",padding:3}})},error:{color:"#f44336",icon:l.jsx(ND,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:l.jsx(zD,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:l.jsx("img",{src:Xp,width:25,style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})},rechazar:{color:"#fff",icon:l.jsx("img",{src:FD,width:30,style:{borderRadius:"50%",color:"red",fontSize:"16px",padding:3}})}},i=s[t]||s.info;return l.jsx(ss.SnackbarContent,{ref:n,children:l.jsxs(m.Box,{sx:{backgroundColor:"white",color:"#333",padding:"8px 16px",borderRadius:"8px",boxShadow:"0 3px 10px rgba(0,0,0,0.2)",display:"flex",alignItems:"center",width:{xs:"90%",sm:"auto"},minWidth:"300px",borderLeft:`5px solid ${i.color}`},children:[l.jsx(m.Box,{sx:{mr:1.5},children:i.icon}),l.jsx(m.Typography,{variant:"body2",sx:{flexGrow:1},children:r}),l.jsx(m.IconButton,{size:"small",onClick:()=>o(e),children:l.jsx(Rr,{fontSize:"small"})})]})})}),ph=v.createContext(void 0),VD=({children:e})=>{const[r,t]=v.useState([]),[n,o]=v.useState([]),[s,i]=v.useState(!1);return l.jsx(ph.Provider,{value:{googleEvents:r,setGoogleEvents:t,outlookEvents:n,setOutlookEvents:o,isLoadingGoogleEvents:s,setIsLoadingGoogleEvents:i},children:e})},UD=()=>{const e=v.useContext(ph);if(e===void 0)throw new Error("useEvents must be used within an EventsProvider");return e},WD=(e,r,t)=>{const n=(i,a)=>a?new Date(a):i?new Date(i.replace(/-/g,"/")):new Date,o=n(e.start.date,e.start.dateTime);let s=n(e.end.date,e.end.dateTime);return e.end.date&&!e.end.dateTime&&s.setDate(s.getDate()-1),{eventoID:Math.abs(HD(e.id)),titulo:e.summary||"(Sin título)",descripcion:e.description,fechaInicio:o,fechaFin:s,todoElDia:!!(e.start.date&&!e.start.dateTime),color:"#4285F4C",hasVideoCall:!!e.conferenceData,link:e.htmlLink,repetir:void 0,solID:null,disID:r,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!0}};function HD(e){let r=0;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);r=(r<<5)-r+n,r|=0}return r}function YD(e){let r=0;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);r=(r<<5)-r+n,r|=0}return r}const qD=(e,r,t)=>{const n=new Date(e.start.dateTime);let o=new Date(e.end.dateTime);return e.isAllDay&&o.setDate(o.getDate()-1),{eventoID:Math.abs(YD(e.id)),titulo:e?.summary||"(Sin título)",descripcion:e.body?.content||"",fechaInicio:n,fechaFin:o,todoElDia:e.isAllDay,color:"#0078D4",hasVideoCall:!!e.onlineMeetingUrl,link:e.webLink,repetir:void 0,solID:null,disID:r,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!1,isOutlookEvent:!0}},hh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='49'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M34.559%2048.077c-7.413%200-13.44-6.039-13.44-13.44s6.027-13.44%2013.44-13.44%2013.44%206.027%2013.44%2013.44c0%207.414-6.027%2013.44-13.44%2013.44'/%3e%3cpath%20fill='%23fff'%20d='M39.827%2029.346c.583.583.605%201.505.05%202.06l-3.218%203.219%203.219%203.218c.555.556.532%201.48-.051%202.062-.584.583-1.506.605-2.062.05l-3.218-3.218-3.218%203.218c-.556.555-1.478.533-2.061-.05s-.606-1.506-.05-2.062l3.217-3.218-3.218-3.218c-.555-.555-.533-1.478.05-2.061.583-.584%201.507-.606%202.063-.05l3.217%203.217%203.218-3.218c.556-.555%201.478-.533%202.062.05'/%3e%3cpath%20fill='%23404756'%20d='M30.367.078c1.112%200%202.001.868%202.001%201.954v1.195h.979c4.913%200%208.892%203.887%208.892%208.686v9.237a15.4%2015.4%200%200%200-4.424-1.691v-1.312H4.468V33.63c0%202.389%202%204.343%204.446%204.343H19.4a15.4%2015.4%200%200%200%201.676%204.343H8.892C3.979%2042.317%200%2038.43%200%2033.631V11.913c0-4.8%203.979-8.686%208.892-8.686h1V2.032c0-1.086.89-1.954%202.002-1.954s2%20.868%202%201.954v1.195h14.473V2.032c0-1.085.889-1.954%202-1.954'/%3e%3c/svg%3e",ZD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",GD=({open:e,onClose:r,onConfirm:t,title:n,description:o,icon:s,confirmText:i,confirmColor:a="#d32f2f",loading:c=!1})=>l.jsxs(m.Dialog,{open:e,onClose:r,PaperProps:{sx:{borderRadius:"15px",p:1,maxWidth:"400px"}},children:[l.jsx(m.Box,{sx:{display:"flex",justifyContent:"flex-end"},children:l.jsx(m.IconButton,{onClick:r,size:"small",children:l.jsx(Rr,{fontSize:"small"})})}),l.jsxs(m.DialogContent,{sx:{textAlign:"center",pt:0},children:[l.jsx(m.Box,{sx:{mb:2,display:"flex",justifyContent:"center"},children:s}),l.jsx(m.Typography,{variant:"h6",sx:{fontWeight:"bold",mb:2},children:n}),l.jsx(m.Typography,{variant:"body2",sx:{color:"#555",mb:4,px:2},children:o}),l.jsxs(m.Box,{sx:{display:"flex",gap:2,justifyContent:"center",mb:2},children:[l.jsx(m.Button,{variant:"outlined",onClick:r,sx:{textTransform:"none",borderRadius:"8px",px:4,borderColor:"#1976D2",color:"#1976D2"},children:"Regresar"}),l.jsxs(m.Button,{variant:"contained",onClick:t,disabled:c,sx:{textTransform:"none",borderRadius:"8px",px:4,bgcolor:a,"&:hover":{bgcolor:"#b71c1c"}},children:[i=="Eliminar"&&l.jsx("img",{src:ZD,width:15,style:{marginRight:6,marginBottom:2}}),c?"Procesando...":i]})]})]})]}),KD=({userId:e,leads30Days:r,leads90Days:t,disId:n,masNombreBD:o,usrNombre:s})=>{const[i,a]=v.useState(new Date),[c,u]=v.useState([]),[d,f]=v.useState(!1),[h,y]=v.useState(null),[g,p]=v.useState(!1),[b,_]=v.useState(null),[S,D]=v.useState([]),{enqueueSnackbar:C}=ss.useSnackbar(),w=sc(),F=mi(),E=nc(),[T,I]=v.useState(!1),[M,U]=v.useState([]),[q,V]=v.useState(null),{session:H,sessionoutlook:re}=Ua(),{googleEvents:W,setGoogleEvents:$,outlookEvents:ie,setOutlookEvents:ue}=UD(),[N,ee]=v.useState([]),[xe,_e]=v.useState([]),[fe,ae]=v.useState([]),[le,X]=v.useState(!1),[we,ye]=v.useState([]),[K,Ie]=v.useState(),P=(Q,ke)=>{U(Q),V(ke),I(!0)},Be=async()=>{if(e===void 0)return;const Q=await w.getNotificacionesXUsuario(e,!1);s?localStorage.setItem("nombreAnfitrion",s):localStorage.setItem("nombreAnfitrion","Anfitrion"),ye(Q)};v.useEffect(()=>{const Q=new Date,ke=x.startOfDay(Q),Ee=x.endOfDay(x.addDays(ke,6)),Re={start:ke,end:Ee},Sr=c.filter($t=>{const Wr={start:$t.fechaInicio,end:$t.fechaFin};return xd(Wr,Re)}).sort(($t,Wr)=>$t.fechaInicio.getTime()-Wr.fechaInicio.getTime());D(Sr)},[c]),v.useEffect(()=>{const Q=async()=>{try{if(e){const Ee=await w.getEventsByUser(e);Be(),u(Ee)}}catch(Ee){console.log("Error al cargar eventos locales:",Ee)}};Q();const ke=setInterval(Q,4e3);return()=>clearInterval(ke)},[e]),v.useEffect(()=>{if(!n||!e)return;const Q=[...c];if(W.length>0&&H?.userEmail){const ke=W.map(Ee=>WD(Ee,n,e));Q.push(...ke)}if(ie.length>0&&re?.userEmail){const ke=ie.map(Ee=>qD(Ee,n,e));Q.push(...ke)}ee(Q)},[c,W,ie,n,e,H?.userEmail,re?.userEmail]);const Qe=async Q=>{try{if(Q?.isGoogleEvent||Q.isOutlookEvent)y(Q),f(!0);else{const ke=await w.getEventById(Q.eventoID);y(ke),f(!0)}}catch(ke){console.error(ke)}},Fe=()=>{f(!1),y(null)},Le=async(Q,ke)=>{let Ee,Re;Q.todoElDia?(Ee=new Date(`${Q.fechaInicio}T${Q.horaInicio}`),Re=new Date(`${Q.fechaInicio}T${Q.horaFin}`)):(Ee=new Date(`${Q.fechaInicio}T${Q.horaInicio}`),Re=Q.fechaFin&&Q.horaFin?new Date(`${Q.fechaFin}T${Q.horaFin}`):new Date(`${Q.fechaInicio}T${Q.horaFin}`));const Sr=x.format(Ee,"yyyy-MM-dd HH:mm:ss.SSS"),$t=x.format(Re,"yyyy-MM-dd HH:mm:ss.SSS");if(ke){const ar={...Q,eventoID:ke,fechaInicio:Sr,fechaFin:$t,solID:Q.solID??null,disID:n??null,client:Q.client,invitados:Q.invitados.map(He=>({usrNombre:He.nombre||He.usrNombre,Correo:He.correo||He.Correo,EsOrganizador:He.isHost||He.EsOrganizador,StatusInvitacion:He.StatusInvitacion,UsuarioID:He.usrID||He.UsuarioID,disID:He.disID||n}))};try{const He=await w.updateEvent(ar);var Wr=c.map(Hr=>Hr.eventoID===He.eventoID?He:Hr);u(Wr),C("El evento se ha actualizado correctamente.",{variant:"success"}),Fe()}catch{C("Error al actualizar Evento",{variant:"error"})}}else{const ar={...Q,fechaInicio:Sr,fechaFin:$t,todoElDia:Q.todoElDia,solID:Q.solID??null,disID:n??null,client:Q.client,invitados:Q.invitados.map(He=>({usrNombre:He.nombre||He.usrNombre,Correo:He.correo||He.Correo,EsOrganizador:He.isHost||He.EsOrganizador,StatusInvitacion:He.StatusInvitacion,UsuarioID:He.usrID||He.UsuarioID,disID:He.disID||n}))};try{const He=await w.createEvent(ar,e);u(Hr=>[...Hr,He]),C("El evento se ha creado con éxito",{variant:"success"}),Fe()}catch{C("Error al guardar Evento",{variant:"error"})}}if(e){const ar=await w.getEventsByUser(e);u(ar)}},We=()=>{a(Q=>new Date(Q.getFullYear(),Q.getMonth()-1,1))},Xe=()=>{a(Q=>new Date(Q.getFullYear(),Q.getMonth()+1,1))},ft=()=>{De("ELIMINAR")},k=()=>{De("RECHAZAR")},O=()=>{_(new Date),f(!0)},B=Q=>{Q&&a(Q)},ce=Q=>{_(Q),f(!0),y(null)},se=async()=>{if(h)try{await w.deleteEvent(h.eventoID),u(c.filter(Q=>Q.eventoID!==h.eventoID)),C("El evento se ha eliminado de tu calendario",{content:(Q,ke)=>l.jsx(Ic,{id:Q,message:String(ke),variant:"delete"})})}catch{C("Error al eliminar Evento",{variant:"error"})}finally{Fe(),Me()}},j=async()=>{if(!(!H?.userEmail||!n)){X(!0);try{const ke=(await F.getGoogleCalendars(H.userEmail,n)).map(Re=>({...Re,selected:!0}));_e(ke);const Ee=ke.map(Re=>Re.id);R(Ee)}catch(Q){console.error("Error Google Cals:",Q)}finally{X(!1)}}},oe=async Q=>{const ke=xe.map(Re=>Re.id===Q?{...Re,selected:!Re.selected}:Re);_e(ke);const Ee=ke.filter(Re=>Re.selected).map(Re=>Re.id);R(Ee)},Se=async()=>{if(!(!re?.userEmail||!n)){X(!0);try{const ke=(await E.getOutlookCalendars(re.userEmail,n)).map(Re=>({...Re,selected:!0}));ae(ke);const Ee=ke.map(Re=>Re.id);te(Ee)}catch(Q){console.error("Error Outlook Cals:",Q)}finally{X(!1)}}},je=async Q=>{const ke=fe.map(Re=>Re.id===Q?{...Re,selected:!Re.selected}:Re);ae(ke);const Ee=ke.filter(Re=>Re.selected).map(Re=>Re.id);te(Ee)};v.useEffect(()=>{j()},[H?.userEmail,n]),v.useEffect(()=>{Se()},[re?.userEmail,n]);const R=async Q=>{if(!H?.userEmail||!n)return;const ke=Q||xe.filter(Ee=>Ee.selected).map(Ee=>Ee.id);try{const Ee={disID:n,year:i.getFullYear(),month:i.getMonth()+1,usrMail:H.userEmail,calendarIds:ke},Re=await F.getGoogleEventsByMonth(Ee);$(Re)}catch(Ee){console.error("Error al obtener eventos de Google:",Ee)}},te=async Q=>{if(!re?.userEmail||!n)return;const ke=Q||fe.filter(Ee=>Ee.selected).map(Ee=>Ee.id);try{const Ee={disID:n,year:i.getFullYear(),month:i.getMonth()+1,usrMail:re.userEmail,calendarIds:ke},Re=await E.getOutlookEventsByMonth(Ee);ue(Re)}catch(Ee){console.error("Error al obtener eventos de Outlook:",Ee)}};if(n===void 0||e===void 0)return l.jsx("div",{children:"Cargando configuración de usuario..."});const be=async(Q,ke)=>{await w.UpdateStatusEvento(Q.evento.eventoID,e,ke)&&(await w.MarcarLeido(Q.notificacionID,e),C(Q?.evento?.titulo+" fue agregado a tu calendario",{variant:"success"}))},qe=async()=>{K&&w.UpdateStatusEvento(K.evento.eventoID,e,"RECHAZADA")&&(await w.MarcarLeido(K.notificacionID,e),await w.MarcarLeido(K.notificacionID,e),C("Haz rechazado la Invitación a "+K?.evento?.titulo,{content:(ke,Ee)=>l.jsx(Ic,{id:ke,message:String(Ee),variant:"rechazar"})}),Me())},Ct=async(Q,ke)=>{try{if(!e)return;Ie(Q),ke=="RECHAZADA"?(k(),console.log("noti",Q)):be(Q,ke)}catch{C("Error al procesar la invitación",{variant:"error"})}},Z=async Q=>{try{if(!h)return;await w.ReenviarNotificacion(h?.eventoID,Q),C("Invitación enviada con éxito",{variant:"success"})}catch(ke){console.error("Error al conectar con la API",ke)}},[de,De]=v.useState(null),Me=()=>De(null),Pe={RECHAZAR:{title:"Rechazar invitación",confirmText:"Rechazar evento",description:l.jsxs(l.Fragment,{children:["Estás a punto de declinar la invitación de ",l.jsx("strong",{children:K?.evento?.nombreAnfitrion})," a ",l.jsx("strong",{children:K?.evento?.titulo})]}),icon:l.jsx("img",{src:hh}),action:()=>K&&qe()},ELIMINAR:{title:"Eliminar evento",confirmText:"Eliminar",description:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer.",icon:l.jsx("img",{src:hh}),action:()=>se()},DESVINCULAR:{title:"Desvincular Outlook",confirmText:"Desvincular",description:"Si desvinculas tu cuenta, perderás acceso a todos los eventos sincronizados.",icon:"",action:()=>se}},Nt=de?Pe[de]:null;return l.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[l.jsx(jv,{header:l.jsx(X2,{currentDate:i,onPrevMonth:We,onNextMonth:Xe,onAddEvent:O,onDateChange:B}),sidebar:l.jsx(Gx,{onEventClick:Qe,upcomingEvents:S,leads30Days:r,leads90Days:t,disID:n,usrID:e,onAddEvent:O,googleCalendars:xe,outlookCalendars:fe,isLoadingCalendars:le,onToggleGoogle:oe,onToggleOutlook:je,notifications:we,unreadCount:we?.filter(Q=>!Q.leida).length,onAceppInvitacion:Ct}),mainContent:l.jsx(lw,{onSeeMoreClick:P,currentDate:i,events:N,onDayClick:ce,onEventClick:Qe})}),d&&l.jsx(ID,{isVisible:d,onClose:Fe,onSave:Le,onDelete:ft,selectedDate:b,initialEvent:h,userId:e,masNombreBD:o,disId:n,onReenviar:Z}),l.jsx(jD,{isOpen:T,onClose:()=>I(!1),events:M,date:q,onEventClick:Qe}),Nt&&l.jsx(GD,{open:!!de,onClose:Me,onConfirm:()=>{Nt.action()},title:Nt.title,description:Nt.description,icon:Nt.icon,confirmText:Nt.confirmText})]})},QD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20fill='%23070c10'%20d='M18.575%203.172A10.829%2010.829%200%200%200%201.564%2016.284l-.028-.051L0%2021.843l5.739-1.506a10.7%2010.7%200%200%200%205.173%201.318%2010.83%2010.83%200%200%200%207.663-18.483m-7.658%2016.655a8.94%208.94%200%200%201-4.62-1.277l.041.023-.329-.194-3.405.894.908-3.321-.214-.34a8.9%208.9%200%200%201-1.376-4.782%209%209%200%201%201%209%209Zm4.935-6.736c-.27-.135-1.6-.789-1.848-.88s-.429-.135-.61.136-.7.879-.856%201.06-.316.2-.586.068a7.5%207.5%200%200%201-2.183-1.349l.007.007a8.2%208.2%200%200%201-1.483-1.842l-.02-.038c-.157-.27-.017-.417.118-.551s.271-.316.406-.473a1.9%201.9%200%200%200%20.267-.44v-.012a.5.5%200%200%200%20.05-.216.5.5%200%200%200-.074-.26c-.068-.135-.609-1.467-.834-2.009s-.444-.455-.609-.464-.338-.009-.519-.009a.99.99%200%200%200-.72.337%203.03%203.03%200%200%200-.947%202.2v.058a5.27%205.27%200%200%200%201.114%202.815v-.011a12.16%2012.16%200%200%200%204.553%204.053l.068.031a14%2014%200%200%200%201.434.539l.109.03a3.6%203.6%200%200%200%201.077.161%203.7%203.7%200%200%200%20.648-.057h-.023a2.8%202.8%200%200%200%201.819-1.274l.007-.012a2.2%202.2%200%200%200%20.19-.9%202.3%202.3%200%200%200-.034-.395v.014c-.067-.113-.248-.18-.519-.316Z'/%3e%3c/svg%3e",XD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='25.085'%20height='18.5'%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='none'%20d='M0%200h25.085v18.5H0z'%20data-name='Rectángulo%204598'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23a)'%20data-name='Grupo%207946'%3e%3cpath%20d='M23.12%205.809V3.226a3.2%203.2%200%200%200-.068-.656l-3.141%202.21a7.8%207.8%200%200%201%203.209%201.032'%20data-name='Trazado%2013329'/%3e%3cpath%20d='M11.847%209.791c-.1.009-.2.023-.308.023a3.78%203.78%200%200%201-2.18-.688L.067%202.58A3.2%203.2%200%200%200%200%203.227V13.98a3.23%203.23%200%200%200%203.226%203.226h9.611a7.86%207.86%200%200%201-.99-7.414'%20data-name='Trazado%2013330'/%3e%3cpath%20d='M12.478%207.369%2021.92.737A3.2%203.2%200%200%200%2019.894%200H3.226a3.2%203.2%200%200%200-2.031.74l9.4%206.628a1.64%201.64%200%200%200%201.881%200'%20data-name='Trazado%2013331'/%3e%3cpath%20d='M23.356%208.407a5.914%205.914%200%201%200%200%208.364%205.92%205.92%200%200%200%200-8.364m-1.833%204.842a.54.54%200%200%201-1.081%200v-1.164l-2.513%202.516a.54.54%200%200%201-.765-.763l2.515-2.515h-1.167a.54.54%200%201%201%200-1.081h2.471a.54.54%200%200%201%20.54.54Z'%20data-name='Trazado%2013332'/%3e%3c/g%3e%3c/svg%3e";function Oc(e,r,t){return e.accessor?e.accessor(r,t):e.field?r?.[e.field]:r?.[e?.key||""]}function JD(e,r){const t=e??"",n=r??"";return t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():typeof t=="number"&&typeof n=="number"?t-n:typeof t=="boolean"&&typeof n=="boolean"?Number(t)-Number(n):String(t).localeCompare(String(n),void 0,{numeric:!0,sensitivity:"base"})}function jc(e,r,t=!0){return typeof e=="function"?e(r):e??t}function e3(e){return e.replace(/[^\d]/g,"")}function t3(e,r){return r}var Yo={},mh;function r3(){if(mh)return Yo;mh=1;var e=ct();Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var r=e(ht()),t=dt();return Yo.default=(0,r.default)((0,t.jsx)("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt"),Yo}var n3=r3();const o3=at(n3);var qo={},gh;function s3(){if(gh)return qo;gh=1;var e=ct();Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var r=e(ht()),t=dt();return qo.default=(0,r.default)((0,t.jsx)("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchRounded"),qo}var i3=s3();const a3=at(i3);var Zo={},vh;function c3(){if(vh)return Zo;vh=1;var e=ct();Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var r=e(ht()),t=dt();return Zo.default=(0,r.default)((0,t.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),Zo}var l3=c3();const u3=at(l3);var Go={},yh;function d3(){if(yh)return Go;yh=1;var e=ct();Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=void 0;var r=e(ht()),t=dt();return Go.default=(0,r.default)((0,t.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),Go}var f3=d3();const p3=at(f3);function bh(e){return e==="right"?"end":e==="center"?"center":"start"}function xh(e){const r=e.filter(t=>!t.width).length||1;return e.map(t=>typeof t.width=="number"?`${t.width}px`:typeof t.width=="string"?t.width:`minmax(0, ${1/r}fr)`).join(" ")}const h3=1060,Pc=(e,r)=>e.metrics.find(t=>String(t.label).toLowerCase()===r.toLowerCase())?.value??"";function m3({sections:e,detailColumns:r,summaryWidths:t=["1fr",120,120,150],minWidth:n=h3,getDetailColumns:o,onRowClick:s}){function c(d){if(typeof d=="number")return d;if(!d)return 0;const f=/^(\d+)\s*px$/.exec(d.trim());return f?Number(f[1]):/fr$/i.test(d)?160:0}function u(d){const f=d.reduce((g,p)=>g+c(p.width),0),h=Math.max(d.length-1,0)*16;return f+h+32}return l.jsx(m.Box,{sx:{border:"1px solid rgba(0,0,0,0.15)",overflow:"hidden",bgcolor:"background.paper",width:"100%"},children:l.jsxs(m.Box,{children:[l.jsx(m.Box,{sx:{display:"grid",gridTemplateColumns:t.map(d=>typeof d=="number"?`${d}px`:d).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"#1E5BCE",color:"#fff",boxSizing:"border-box"},children:["Tipo","En Proceso","Finalizadas","Último seg."].map(d=>l.jsx(m.Typography,{sx:{fontSize:13,fontWeight:800},children:d},d))}),e.map((d,f)=>{const[h,y]=G.useState(!!d.initiallyOpen),g=f%2===1,p=o?o(d):r,b=Math.max(n,u(p));return l.jsxs(m.Box,{children:[l.jsxs(m.Box,{sx:{display:"grid",gridTemplateColumns:t.map(_=>typeof _=="number"?`${_}px`:_).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:g?"rgba(30,91,206,0.06)":"background.paper",borderTop:"1px solid rgba(0,0,0,0.08)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>y(_=>!_),children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[l.jsx(m.IconButton,{size:"small",disableRipple:!0,children:h?l.jsx(p3,{}):l.jsx(u3,{})}),l.jsx(m.Typography,{sx:{fontWeight:700,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(d.title),children:d.title})]}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"En Proceso")}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"Finalizadas")}),l.jsx(m.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Pc(d,"Último seg.")})]}),l.jsx(m.Collapse,{in:h,unmountOnExit:!0,children:l.jsxs(m.Box,{sx:{overflowX:"auto","&::-webkit-scrollbar":{height:"5px"}},children:[l.jsx(m.Box,{sx:{minWidth:b,display:"grid",gridTemplateColumns:xh(p),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"rgba(30,91,206,0.18)",color:"#1a1a1a",borderTop:"1px solid rgba(0,0,0,0.12)",boxSizing:"border-box"},children:p.map(_=>l.jsx(m.Typography,{sx:{justifySelf:bh(_.align),textAlign:_.align??"left",fontSize:12.5,fontWeight:800,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:_.header},_.key))}),(d.rows??[]).map((_,S)=>l.jsx(m.Box,{sx:{minWidth:b,display:"grid",gridTemplateColumns:xh(p),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:S%2===0?"background.paper":"rgba(30,91,206,0.06)",borderTop:"1px solid rgba(0,0,0,0.06)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>s?.(_,d),children:p.map((D,C)=>{const w=D.accessor?D.accessor(_,S):D.field?_[D.field]:null;return l.jsx(m.Box,{sx:{justifySelf:bh(D.align),textAlign:D.align??"left",minWidth:0,overflow:"hidden",maxWidth:"100%"},children:typeof w=="string"||typeof w=="number"?l.jsx(m.Typography,{sx:{fontSize:13,fontWeight:/^(estatus|seg|avance|nivel|asesor|fecha)$/i.test(D.key)?700:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(w),children:w}):w},D.key??C)})},_.id??S))]})})]},d.id)})]})})}var Ko={},wh;function g3(){if(wh)return Ko;wh=1;var e=ct();Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var r=e(ht()),t=dt();return Ko.default=(0,r.default)((0,t.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m3.3 14.71L11 12.41V7h2v4.59l3.71 3.71z"}),"AccessTimeFilled"),Ko}var v3=g3();const y3=at(v3),b3=e=>e?new Date(e).toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}).replace(".",""):"",x3=e=>{const r=`${e?.Nombre??""} ${e?.Apellido??""}`.trim();return r||(e?.IdAsesor?e?.Correo??"Usuario":"Sin asesor asignado")},w3=e=>{const r=(e||"").split(" ").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(e?.[0]??"?").toUpperCase()};var Qo={},_h;function _3(){if(_h)return Qo;_h=1;var e=ct();Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var r=e(ht()),t=dt();return Qo.default=(0,r.default)((0,t.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),Qo}var S3=_3();const C3=at(S3),Rc=({current:e=0,total:r=0,color:t="#4caf50"})=>l.jsx("div",{style:{display:"flex",gap:"1px",width:"100%",height:"100%",justifyContent:"center",overflow:"hidden",minWidth:0},children:Array.from({length:r}).map((n,o)=>l.jsx("div",{style:{width:"7px",height:"7px",borderRadius:"2px",backgroundColor:o<e?t:"#e0e0e0",display:"flex"}},o))});var Xo={},Sh;function E3(){if(Sh)return Xo;Sh=1;var e=ct();Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var r=e(ht()),t=dt();return Xo.default=(0,r.default)((0,t.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Xo}var D3=E3();const Ch=at(D3);var Jo={},Eh;function k3(){if(Eh)return Jo;Eh=1;var e=ct();Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var r=e(ht()),t=dt();return Jo.default=(0,r.default)((0,t.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),Jo}var A3=k3();const T3=at(A3),M3=e=>{const r=String(e??"").toLowerCase().trim();return r==="muy interesado"?{bg:"#E53935",color:"#FFFFFF"}:r==="interesado"?{bg:"#FB8C00",color:"#FFFFFF"}:r==="venta definitiva"?{bg:"#2E7D32",color:"#FFFFFF"}:r==="no sé"||r==="no se"?{bg:"#9E9E9E",color:"#FFFFFF"}:r==="algo interesado"?{bg:"#FFEB3B",color:"#000000"}:{bg:"transparent",color:"#2c2c2c"}},I3=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por Asignar";case 2:return"Solicitud Asignada";case 3:return"Solicitud asignada en proceso";case 4:return"Finalizadas sin Venta";case 5:return"Finalizadas con Venta";case 6:return"Rechazadas";case 7:return"Finalizada por sistema";case 8:return"";case 9:return"";case 10:return"Prospección";case 11:return"Interés Real";case 12:return"Proceso de Compra";case 13:return"";case 14:return"En espera de Unidad";case 15:return"Auto Facturado";case 16:return"";case 17:return"";case 18:return"Compró otra Marca";case 19:return"No comprará";default:return null}},O3=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por asignar";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 6:return"Rechazada";case 7:return"Finalizada sin enviar a Ventas";case 8:return"Finalizada enviado a Ventas";default:return null}},j3=e=>{switch(parseInt(String(e??""),10)){case 0:return"Sin asignar";case 1:return"Confirmado";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 4:return"Confirmado";case 5:return"Finalizada";case 6:return"Rechazada";case 10:return"Reagendado";case 20:return"Seguimiento [Cita Finalizada]";case 30:return"Reenvio";case 40:return"Seguimiento [Mecanico]";case 50:return"Seguimiento";default:return null}};function P3(e){const r=new Date(e),t=r.toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}),n=r.toLocaleTimeString("es-MX",{hour:"2-digit",minute:"2-digit"});return`${t.replace(".","")} • ${n}`}function R3(e){return e.replace(/<br\s*\/?>/gi,`
|
|
178
178
|
`).replace(/\r\n/g,`
|
|
179
179
|
`).replace(/\r/g,`
|
|
180
180
|
`)}const N3={Todos:[],"Sin Asignar":["Sin Asignar"],"En prospección":["Prospección"],"Proceso de Compra":["Proceso de Compra"],"En espera de Unidad":["En Espera de Unidad"],"Auto Facturado":["Auto Facturado"],Rechazadas:["Rechazada","Rechazadas"],"Finalizadas sin Venta":["Sin Venta"],"Finalizadas con Venta":["Con Venta"],"En Proceso":["Asignada","Prospección","Sin Asignar","Proceso de Compra","En Espera de Unidad","Auto Facturado","Sin Atender"]},$3={Todos:[],"Selección y presentación de vehículos":["Selección y presentación de vehículos"],"Prueba de Manejo":["Prueba de Manejo"],"Valoración del Auto a cuenta y/o enganche":["Valoración del Auto a cuenta y/o enganche"],"Entrega de vehículo":["Entrega de vehículo"],"Negociación y Cierre":["Negociación y Cierre"]},L3={Todos:[],"Algo interesado":["Algo interesado"],Interesado:["Interesado"],"Muy interesado":["Muy interesado"],"Venta definitiva":["Venta definitiva"],"No sé":["No sé"]};function z3(e,r){switch(e){case"pruebas":return O3(r)??"—";case"servicio":return j3(r)??"—";case"nuevos":case"seminuevos":default:return I3(r)??"—"}}function B3({open:e,onClose:r,customer:t,fields:n=[],header:o,extraSections:s,normalTable:i,normalTableColumns:a=[],history:c=[],advisorHistory:u=[],onRequestEdit:d,searchFilter:f,urlsQA:h,solicitudesNuevos:y=[],solicitudesPrueba:g=[],solicitudesServicio:p=[],solicitudesSeminuevos:b=[],onCreateSolicitud:_,isCrmMode:S=!1,onSolicitudBaseUrl:D,onIframeClose:C,reloadInfo:w,idAdminSistemas:F}){if(!t)return null;const E=3,[T,I]=v.useState(null),M=!!T,[U,q]=v.useState(!1),[V,H]=v.useState(null),[re,W]=v.useState(c??[]),[$,ie]=v.useState(null),ue=v.useMemo(()=>[...u].sort((L,J)=>new Date(J.FechaAsignacion).getTime()-new Date(L.FechaAsignacion).getTime()),[u]);v.useEffect(()=>{c&&c.length&&W(c)},[c]);const N=c?.length?c:re,ee=o?.title??(L=>L?.Nombre||L?.name||"Sin título"),xe=o?.infoItems??[],_e=L=>L.nombreAsesor?.trim()||(L.Email?L.Email:"Sistema"),fe=L=>{const J=L||"",ge=J.split(" ").filter(Boolean);return ge.length>=2?(ge[0][0]+ge[1][0]).toUpperCase():(J[0]||"?").toUpperCase()},ae=L=>L?.SolID??L?.solID??L?.SolId??L?.SOLID??null,le=v.useMemo(()=>{const L=N??[];return Array.isArray(L?.[0])?L.flat():L},[N]),X=v.useMemo(()=>{const L=le;return!$||V==null?L:L.filter(J=>{const ge=ae(J);return ge!=null&&String(ge)===String(V)})},[le,$,V]),we=v.useMemo(()=>[...X].sort((L,J)=>new Date(J.fecAlta).getTime()-new Date(L.fecAlta).getTime()),[X]),[ye,K]=v.useState(!1),Ie=v.useMemo(()=>ye?we:we.slice(0,E),[ye,we]),P=Math.max(we.length-E,0),Be=L=>String(L??"").normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim(),Qe=(L,J)=>Be(JSON.stringify(L)).includes(Be(J)),Fe=(L,J)=>f?f(L,J):Qe(L,J),Le=(L,J)=>{const ge=Be(J).split(/\s+/).filter(Boolean);return ge.length?ge.every(Te=>Fe(L,Te)):!0},[We,Xe]=v.useState(""),[ft,k]=v.useState([]);v.useMemo(()=>i??[],[i]),v.useMemo(()=>{const L=We.trim();return L?(i??[]).filter(J=>Le(J,L)):i??[]},[i,We]);const O=m.useTheme(),B=m.useMediaQuery(O.breakpoints.down("md")),[ce,se]=v.useState(""),[j,oe]=v.useState(!0),[Se,je]=v.useState(!1),R=new Date().toISOString().slice(0,10),te=new Date(Date.now()-720*3600*1e3).toISOString().slice(0,10),[be,qe]=v.useState(te),[Ct,Z]=v.useState(R),[de,De]=v.useState(null),Me=!!de,[Pe,Nt]=v.useState("En Proceso"),[Q,ke]=v.useState("Todos"),[Ee,Re]=v.useState("Todos"),Sr=["Algo interesado","Interesado","Muy interesado","Venta definitiva","No sé"],$t=["Selección y presentación de vehículos","Prueba de Manejo","Valoración del Auto a cuenta y/o enganche","Entrega de vehículo","Negociación y Cierre"],Wr=()=>{se(""),oe(!1),je(!1),qe(te),Z(R),Nt("Todos"),ke("Todos"),Re("Todos")},ar=v.useMemo(()=>(ce??"").trim()!==""||Pe!=="Todos"||Q!=="Todos"||j||Se||Ee!=="Todos",[ce,Pe,Q,j,Se,Ee]);function He(L){if(!L)return"";const J=new Date(L);if(isNaN(J.getTime()))return"";const ge=String(J.getDate()).padStart(2,"0"),Te=String(J.getMonth()+1).padStart(2,"0"),Et=String(J.getFullYear()).slice(-2);return`${ge}/${Te}/${Et}`}function Hr(L){const J=L?new Date(L):null;return J&&!isNaN(J.getTime())?J:null}function zc(L,J){let ge=null;for(const Te of L){const Et=Hr(J(Te));if(Et){const wt=Et.getTime();(ge===null||wt>ge)&&(ge=wt)}}return ge?new Date(ge):null}function ns(L){const J=zc(L,ge=>ge.UltimoSeguimiento||ge.FechaCita);return J?He(J.toISOString()):"—"}function os(L){const J=(L??"").toLowerCase().trim();return J==="sin venta"||J==="con venta"||J==="rechazada"||J==="rechazadas"}function zi(L){return L.filter(J=>os(J.EstatusDescripcion)).length}function Bi(L){return L.filter(J=>!os(J.EstatusDescripcion)).length}const Bc=({progress:L,color:J})=>{if(!L)return l.jsx(Rc,{current:0,total:0,color:J});const ge=L.split("/").map(Number);if(ge.length!==2||ge.some(wt=>Number.isNaN(wt)))return l.jsx(Rc,{current:0,total:0,color:J});const[Te,Et]=ge;return l.jsx(Rc,{current:Te,total:Et,color:J})};function Fi(L){return[{key:"fecha",header:"Fecha",accessor:J=>He(J.Fecha),width:110},{key:"vehiculo",header:"Vehículo",accessor:J=>l.jsx(m.Tooltip,{title:J.Vehiculo??"",placement:"top",arrow:!0,children:l.jsx(m.Typography,{component:"span",sx:{fontSize:13,fontWeight:500,display:"block",maxWidth:260,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:"default"},children:J.Vehiculo??"—"})}),width:260},{key:"estatus",header:"Estatus",accessor:J=>l.jsx(m.Typography,{sx:{fontWeight:800,fontSize:13},children:z3(L,J.IdEstatus)}),width:170},{key:"nivel",header:"Nivel de Interés",accessor:J=>{const{bg:ge,color:Te}=M3(J.NivelInteres);return l.jsx(m.Box,{sx:{display:"inline-block",px:1,py:.25,borderRadius:9999,bgcolor:ge,color:Te,fontSize:12,fontWeight:J.NivelInteres?800:500},children:J.NivelInteres??"—"})},width:150},{key:"asesor",header:"Asesor",accessor:J=>{const ge=(J.Asesor??"").trim(),Te=Fc=>{if(!Fc)return"";const uk=Fc[0]?.toUpperCase()??"",dk=Fc[1]?.toLowerCase()??"";return`${uk}${dk}`};if(!ge)return l.jsx(m.Tooltip,{title:"",placement:"top",children:l.jsx(m.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:"—"})});const Et=ge.split(/\s+/),wt=Et[0]??"",Cr=Et[1]??"",mr=Te(wt),yn=Te(Cr),lk=`${mr}${yn}`||"—";return l.jsx(m.Tooltip,{title:ge,placement:"top",children:l.jsx(m.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:lk})})},width:120,align:"center"},{key:"origen",header:"Origen",accessor:J=>J.Origen??"—",width:120,align:"center"},{key:"actividad",header:"Actividad",accessor:J=>l.jsx(m.Tooltip,{title:J.Actividad??"",placement:"top",arrow:!0,children:l.jsxs(m.Box,{sx:{maxWidth:160,overflow:"hidden",display:"flex",gap:.5,alignItems:"center"},children:[J.Icon&&l.jsx("span",{style:{color:"#fff",backgroundColor:J.Color,borderRadius:100,alignItems:"center",justifyContent:"center",display:"flex",padding:3},children:l.jsx("i",{className:J.Icon})}),l.jsx(m.Typography,{component:"span",noWrap:!0,sx:{fontSize:13,fontWeight:500,display:"block",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:(J.Actividad??"").length?"default":"inherit"},children:J.Actividad??"—"})]})}),width:180},{key:"avance",header:"Avance",accessor:J=>l.jsx(Bc,{progress:J.Avance,color:J.Color}),width:200,align:"left"}]}function A(L){const ge=Fi(L).slice(1);return[{key:"fecha",header:"Fecha",accessor:Te=>He(Te.Fecha),width:110},{key:"fechaCita",header:"Fecha Cita",accessor:Te=>He(Te.FechaCita),width:120},{key:"horaCita",header:"Hora Cita",accessor:Te=>Te.HoraCita??"—",width:110},...ge]}function ne(L){const J=L.kind;switch(J){case"pruebas":case"servicio":return A(J);case"nuevos":case"seminuevos":default:return Fi(J)}}function me(L,J,ge,Te){return{id:L,kind:ge,title:J,metrics:[{label:"En Proceso",value:Bi(Te)},{label:"Finalizadas",value:zi(Te)},{label:"Último seg.",value:ns(Te)}],rows:Te,initiallyOpen:!1}}const Oe=[me("n-1","Cotización de nuevos","nuevos",y),me("p-1","Prueba de Manejo","pruebas",g),me("s-1","Cita de Servicio","servicio",p),me("sn-1","Cotización para Seminuevos","seminuevos",b)],Ze=v.useMemo(()=>{const L=(ce??"").trim().toLowerCase(),J=(ge,Te)=>{if(L&&!(ge.Vehiculo??"").toLowerCase().includes(L))return!1;const Et=Se?ge.FechaCita:ge.Fecha;if(j&&Et){const wt=Hr(Et??"");if(!wt)return!1;const Cr=be?new Date(`${be}T00:00:00`):null,mr=Ct?new Date(`${Ct}T00:00:00`):null;if(mr&&mr.setDate(mr.getDate()+1),Cr&&wt<Cr||mr&&wt>=mr)return!1}if(Pe!=="Todos"){const wt=(ge.EstatusDescripcion??"").toLowerCase();if(!(N3[Pe]??[]).some(yn=>wt===yn.toLowerCase()))return!1}if(Q!=="Todos"){const wt=(ge.Actividad??"").toLowerCase();if(!($3[Q]??[]).some(yn=>wt===yn.toLowerCase()))return!1}if(Ee!=="Todos"){const wt=(ge.NivelInteres??"").toLowerCase();if(!(L3[Ee]??[]).some(yn=>wt===yn.toLowerCase()))return!1}return!0};return Oe.map(ge=>{const Te=(ge.rows??[]).filter(wt=>J(wt,ge.kind)),Et=[{label:"En Proceso",value:Bi(Te)},{label:"Finalizadas",value:zi(Te)},{label:"Último seg.",value:ns(Te)}];return{...ge,rows:Te,metrics:Et}})},[Oe,ce,j,be,Ct,Se,Pe,Q,Ee]),it={nuevos:"cotizaciones",pruebas:"pruebademanejo",servicio:"citasservicio",seminuevos:"seminuevos"},Ye=(L,J)=>{const ge=L.SolID;if(!ge)return;const Te=J.kind,Et=it[Te]??"cotizaciones",wt=h?`https://qa2.crm.netcar.com.mx/netcar/${Et}/${ge}`:`https://crmxs.netcar.com.mx/netcar/${Et}/${ge}`,Cr=D?.({row:L,section:J,slug:Et,solId:ge,baseUrl:wt});if(!S){const mr=Cr??wt;H(ge),ie(mr),q(!0)}},ze=()=>{C?.(t),H(null),ie(null),q(!1)},Ft=v.useRef(!1),pt=v.useRef(null),Tt=v.useCallback(()=>{if(!Ft.current){Ft.current=!0;return}pt.current&&window.clearTimeout(pt.current),pt.current=window.setTimeout(()=>{w?.(t)},500)},[w,t]);return v.useEffect(()=>{Ft.current=!1,pt.current&&window.clearTimeout(pt.current)},[$,V]),l.jsx(m.Dialog,{open:e,onClose:r,fullWidth:!0,fullScreen:B,PaperProps:{sx:{height:{xs:"100dvh",md:"90vh"},maxWidth:{xs:"100vw",md:"92vw"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:l.jsxs(m.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},height:"100%",minHeight:0,overflow:"auto",position:"relative"},children:[l.jsxs(m.Box,{sx:{width:{xs:"100%",md:405},maxWidth:{xs:"100%",md:405},bgcolor:{xs:"transparent",md:"#40404024"},display:"flex",flexDirection:"column",height:{xs:"auto",md:"100%"},borderRight:{xs:"none",md:"1px solid #EBEEF0"}},children:[l.jsxs(m.Box,{children:[l.jsx(m.Stack,{direction:"row",spacing:2,alignItems:"center",mb:1,sx:{px:2.5,pt:2.5},children:l.jsxs(m.Box,{display:"flex",flexDirection:"column",gap:1,width:"100%",children:[l.jsx(m.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:l.jsx(m.Box,{sx:{flex:1,minWidth:0,pr:1},children:l.jsxs(m.Typography,{component:"span",fontWeight:700,sx:{display:"inline",lineHeight:1.2,wordBreak:"break-word",pr:.5},children:[ee(t)," ",l.jsx(m.IconButton,{component:"span",size:"small",disableRipple:!0,onClick:()=>{r?.(),t&&d?.(t)},sx:{p:0,ml:.5,verticalAlign:"text-bottom",color:"#336BE1","&:hover":{bgcolor:"transparent"},"&:focus-visible":{outline:"none"}},"aria-label":"Editar nombre",children:l.jsx(C3,{sx:{fontSize:"1em"}})})]})})}),xe.map((L,J)=>l.jsxs(m.Box,{sx:{display:"flex",gap:1.2,alignItems:"center",cursor:L.onClick?"pointer":"default"},onClick:()=>{L.onClick&&L.onClick(t)},children:[L.icon,l.jsx(m.Typography,{variant:"body2",sx:{color:L.inLink?"#336BE1":"#070C10"},style:{},children:L.value(t)})]},J))]})}),l.jsx(m.Stack,{mb:2,sx:{px:2.5,pt:0,gap:2},children:n.map((L,J)=>{const ge=L.label?.toLowerCase().startsWith("asesor");return l.jsxs(m.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[l.jsx(m.Box,{sx:{width:"50%"},children:l.jsx(m.Typography,{variant:"body2",color:"text.secondary",sx:{color:"#5C6372"},children:L.label})}),l.jsxs(m.Box,{sx:{width:"50%",display:"flex",alignItems:"center",gap:1},children:[l.jsx("div",{children:L?.avatar?L.avatar(t):null}),l.jsx(m.Typography,{variant:"body2",color:"textPrimary",children:L?.value(t)}),ge&&!F&&l.jsx(m.Tooltip,{title:"Historial asesores",placement:"top",arrow:!0,children:l.jsx(m.IconButton,{size:"small",onClick:Te=>I(Te.currentTarget),sx:{ml:.5},disableRipple:!0,children:l.jsx(y3,{fontSize:"small",sx:{color:"#5C6372"}})})})]})]},J)})}),l.jsx(m.Divider,{sx:{my:2}})]}),l.jsx(m.Box,{px:2.5,pb:.5,children:l.jsxs(m.Typography,{children:[l.jsx("span",{style:{fontWeight:800},children:"Última actividad"}),!$&&" por solicitud",":"]})}),l.jsxs(m.Box,{sx:{px:2.5,pt:0,gap:2,flex:1,overflowY:"auto",display:"flex",flexDirection:"column",pb:6,maxHeight:{xs:"140px",md:"100%"}},children:[Ie.length===0&&l.jsx(m.Typography,{variant:"body2",color:"text.secondary",children:"Sin actividad registrada."}),l.jsxs(m.Box,{children:[Ie?.map((L,J)=>{const ge=_e(L),Te=R3(L.comentario||"");return l.jsxs(m.Box,{sx:{pb:1.5},children:[l.jsxs(m.Stack,{direction:"row",spacing:1,alignItems:"center",justifyContent:"space-between",sx:{mb:.75},children:[l.jsx(m.Typography,{variant:"subtitle2",sx:{color:"#5C6372"},children:L.tipo||"Evento"}),l.jsx(m.Chip,{size:"small",label:L.auto!=null?`${L.auto}`:"—",sx:{bgcolor:"#336be1",color:"#fff",height:20}})]}),Te?l.jsx(m.Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.5,mb:.75},children:Te}):null,l.jsxs(m.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[L?.ImgAsesor!=null?l.jsx(m.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},alt:fe(ge),src:L?.ImgAsesor}):l.jsx(m.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},children:fe(ge)}),l.jsxs(m.Stack,{spacing:0,children:[l.jsx(m.Typography,{variant:"body2",fontWeight:600,children:ge}),l.jsx(m.Typography,{variant:"caption",color:"text.secondary",children:P3(L.fecAlta)})]})]}),J<Ie.length-1&&l.jsx(m.Divider,{sx:{mt:1.25}})]},L.segID??J)}),we.length>E&&l.jsx(m.Box,{sx:{mt:1},children:l.jsx(m.Button,{onClick:()=>K(L=>!L),size:"small",sx:{textTransform:"none",px:0,color:"#336BE1","&:hover":{background:"transparent",textDecoration:"underline"}},children:ye?"Ver menos":`Ver más (${P})`})})]})]}),l.jsx(m.Menu,{anchorEl:T,open:M,onClose:()=>I(null),TransitionComponent:m.Fade,MenuListProps:{disablePadding:!0},PaperProps:{sx:{width:320,p:0,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:l.jsxs(m.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[l.jsx(m.Box,{sx:{position:"sticky",top:0,zIndex:1,px:1.5,py:1,fontWeight:700,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:"Historial asesores"}),l.jsxs(m.Box,{sx:{overflowY:"auto",py:.5,maxHeight:200},children:[ue.length===0&&l.jsx(m.Box,{sx:{px:1.5,py:1},children:l.jsx(m.Typography,{variant:"body2",color:"text.secondary",children:"Sin registros"})}),ue.map((L,J)=>{const ge=x3(L),Te=b3(L.FechaBaja??L.FechaAsignacion);return l.jsx(m.Box,{sx:{px:1,py:.75},children:l.jsxs(m.Stack,{direction:"row",alignItems:"center",spacing:1,children:[l.jsx(m.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},src:L?.ImgAsesor??void 0,children:w3(ge)}),l.jsx(m.Box,{sx:{flex:1,minWidth:0},children:l.jsx(m.Typography,{variant:"body2",noWrap:!0,children:ge})}),l.jsx(m.Typography,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:Te})]})},J)})]})]})})]}),U?l.jsxs(m.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",position:"relative"},children:[l.jsx(m.Box,{sx:{position:"absolute",top:18,left:24,zIndex:10,pointerEvents:"auto"},children:l.jsx(m.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:l.jsx(m.Button,{onClick:ze,sx:{backgroundColor:"#2571d6",minWidth:36,minHeight:36,p:.5,borderRadius:"8px",color:"#fff",boxShadow:3,"&:hover":{backgroundColor:"#2074e3"}},children:l.jsx(T3,{fontSize:"medium"})})})}),$&&l.jsx("iframe",{src:$,width:"100%",height:"100%",onLoad:Tt,style:{border:0}})]}):l.jsxs(m.Box,{sx:{width:"100%",minHeight:0,overflowY:"auto"},children:[l.jsx(m.Box,{sx:{mt:{xs:1.5,md:3}},children:l.jsxs(m.Box,{sx:{mt:3,display:"flex",flexDirection:"column",gap:4,padding:"0 20px 0 20px"},children:[l.jsx(m.Typography,{variant:"h4",sx:{fontWeight:800,textAlign:"center",mb:1,letterSpacing:.2},children:"Solicitudes"}),l.jsxs(m.Stack,{direction:{xs:"column",md:"column"},spacing:1.5,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",sx:{mb:1.5},children:[l.jsxs(m.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",sx:{flexWrap:"wrap"},children:[l.jsx(m.TextField,{size:"small",placeholder:"Buscar por vehículo",value:ce,onChange:L=>se(L.target.value),InputProps:{endAdornment:l.jsx(a3,{fontSize:"small",sx:{color:"#b6afaf"}})},sx:{minWidth:220}}),l.jsxs(m.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,position:"relative"},children:[l.jsxs(m.Stack,{direction:"row",spacing:1.1,position:"absolute",bottom:48,left:0,alignItems:"center",children:[l.jsx(m.FormControlLabel,{label:l.jsx(m.Typography,{sx:{fontSize:15,fontWeight:600,marginLeft:0},children:"Por fecha"}),labelPlacement:"start",control:l.jsx(m.Checkbox,{checked:j,onChange:L=>oe(L.target.checked),size:"small",sx:{p:.3,"& .MuiSvgIcon-root":{fontSize:19},color:"#bab4b4"}}),sx:{ml:0,"& .MuiFormControlLabel-label":{marginRight:0}}}),l.jsx(m.Typography,{sx:{fontSize:15,paddingLeft:.4},children:"De cita"})]}),l.jsxs(m.Stack,{direction:"row",spacing:1,children:[l.jsx(m.TextField,{size:"small",type:"date",label:"Desde",InputLabelProps:{shrink:!0},value:be,onChange:L=>qe(L.target.value),disabled:!j,sx:{width:170}}),l.jsx(m.TextField,{size:"small",type:"date",label:"Hasta",InputLabelProps:{shrink:!0},value:Ct,onChange:L=>Z(L.target.value),disabled:!j,sx:{width:170}})]})]}),l.jsx(m.IconButton,{onClick:L=>De(L.currentTarget),disableRipple:!0,sx:{border:"1px solid #d4d7de",borderRadius:2,width:40,height:40,mt:2},children:l.jsx(o3,{})}),ar&&l.jsx(m.Button,{variant:"outlined",onClick:Wr,disableRipple:!0,sx:{height:40,textTransform:"none",borderColor:"#d4d7de",color:"#333",mt:2},children:"Limpiar filtros"}),l.jsx(m.Tooltip,{title:ar&&"Crear Solicitud",arrow:!0,placement:"top",disableHoverListener:!ar,children:l.jsx("span",{children:l.jsxs(m.Button,{variant:"outlined",sx:{height:40,textTransform:"none",borderColor:"none",color:"#fff",backgroundColor:"#1e5bce","&:hover":{backgroundColor:"#1e5bce",boxShadow:"none"}},onClick:()=>{_?.(t)},disableRipple:!0,children:[l.jsx(Ch,{sx:{color:"#fff",fontSize:24,paddingRight:.6}}),!ar&&"Crear Solicitud"]})})})]}),l.jsx(m3,{sections:Ze,detailColumns:[],getDetailColumns:ne,onRowClick:Ye})]})]})}),l.jsx(m.Menu,{anchorEl:de,open:Me,onClose:()=>De(null),TransitionComponent:m.Fade,PaperProps:{sx:{p:1.5,width:260,borderRadius:2,boxShadow:3}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:l.jsxs(m.Stack,{spacing:1.5,paddingX:1.5,paddingY:1,children:[l.jsx(m.Typography,{variant:"subtitle2",sx:{fontWeight:700,color:"#070C10"},children:"Filtro"}),l.jsxs(m.Box,{children:[l.jsx(m.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Estatus"}),l.jsx(m.RadioGroup,{value:Pe,onChange:L=>Nt(L.target.value),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos","Sin Asignar","En prospección","Proceso de Compra","En espera de Unidad","Auto Facturado","Rechazadas","Finalizadas sin Venta","Finalizadas con Venta","En Proceso"].map(L=>l.jsx(m.FormControlLabel,{value:L,control:l.jsx(m.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:L},L))})]}),l.jsxs(m.Box,{children:[l.jsx(m.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Actividades"}),l.jsx(m.RadioGroup,{value:Q,onChange:(L,J)=>ke(J),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...$t].map(L=>l.jsx(m.FormControlLabel,{value:L,sx:{alignItems:"start"},control:l.jsx(m.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:L},L))})]}),l.jsxs(m.Box,{children:[l.jsx(m.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Nivel de interés"}),l.jsx(m.RadioGroup,{value:Ee,onChange:(L,J)=>Re(J),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...Sr].map(L=>l.jsx(m.FormControlLabel,{value:L,control:l.jsx(m.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:L},L))})]})]})})]})]})})}const Dh={tableClientes:"_tableClientes_acwe7_1",tableResponsive:"_tableResponsive_acwe7_1"};function kh(e,r,t){const{fields:n,order:o=["nombreCliente","email","acciones"],header:s={},cells:i={},hide:a={},actions:c}=r,u=c??{},d=u.show??{},f=u.handlers??{},h=u.accessors??{},y=u.icons??{},g=u.className??"d-flex flex-row gap-2 align-items-center ",p=u.tooltip??{},b=y.view??l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",style:{fill:"#070c10"},children:[l.jsx("path",{d:"M18.6,6.3c-3.9-3-9.3-3-13.2,0-1.9,1.5-3.2,3.5-3.9,5.7.7,2.3,2,4.3,3.9,5.7,1.9,1.5,4.2,2.3,6.6,2.3,2.4,0,4.7-.8,6.6-2.3,1.9-1.5,3.2-3.5,3.9-5.7-.7-2.3-2-4.3-3.9-5.7ZM17.2,12.1c0,2.9-2.5,5.3-5.4,5.2-2.9,0-5.3-2.5-5.2-5.4,0-2.9,2.5-5.3,5.4-5.2,2.9,0,5.3,2.4,5.2,5.3,0,0,0,0,0,0Z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),_={nombreCliente:{key:"nombreCliente",header:s.nombreCliente??"Cliente",accessor:M=>M[n.nombreCliente],cell:i.nombreCliente,width:190},email:{key:"email",header:s.email??"Correo",accessor:M=>M[n.email],cell:i.email??(M=>{const U=String(M[n.email]??"");return U?l.jsx("a",{href:`mailto:${U}`,children:U}):l.jsx("span",{className:"text-muted",children:"—"})}),width:230},acciones:a.acciones?void 0:{key:"acciones",header:"",cell:i.acciones??(M=>{const U=jc(d.whatsapp,M,!0),q=jc(d.email,M,!0),V=jc(d.view,M,!0),H=h.phone?.(M),re=h.email?.(M),W=ue=>{if(ue.stopPropagation(),f.onWhatsApp)return f.onWhatsApp(M);if(!H)return;const N=h.countryCode??"52",ee=e3(String(H));typeof window<"u"&&window.open(`https://wa.me/${N}${ee}`,"_blank")},$=ue=>{if(ue.stopPropagation(),f.onEmail)return f.onEmail(M);re&&typeof window<"u"&&(window.location.href=`mailto:${re}`)},ie=ue=>{ue.stopPropagation(),f.onView&&f.onView(M)};return l.jsxs("div",{className:g,children:[U&&l.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:p.whatsapp??"WhatsApp",onClick:W,style:{width:24,height:24},children:l.jsx("img",{src:QD,alt:"WhatsApp"})}),q&&l.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:p.email??"Email",onClick:$,style:{width:24,height:24},children:l.jsx("img",{src:XD,alt:"Email"})}),V&&l.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:p.view??"Ver detalle",onClick:ie,style:{width:24,height:24},children:b})]})}),width:120}},S=Object.values(_).filter(M=>!!M),D=(e??[]).filter(M=>!!M?.key),C=new Map;for(const M of S)C.set(String(M.key),M);for(const M of D)C.set(String(M.key),M);const w=[...S.map(M=>String(M.key)),...D.map(M=>String(M.key))],F=Array.from(new Set(o.map(M=>String(M)).filter(M=>C.has(M)))),E=w.filter(M=>!F.includes(M)),T=[...F,...E],I="acciones";if(C.has(I)){const M=T.filter(U=>U!==I);T.splice(0,T.length,...M,I)}return T.map(M=>C.get(M))}function F3(e){const{rows:r,columns:t,clientSort:n=!0,urlsQA:o=!0,defaultSort:s,minWidth:i=1100,rowKey:a=t3,haveOpenDetailFor:c=!0,defaults:u,detailConfig:d,normalTable:f,onRowClick:h,activityHistory:y,advisorHistory:g,forceOpenDetailFor:p,closeDetailFor:b,onRequestEdit:_,searchFilter:S,solicitudesNuevos:D,solicitudesPrueba:C,solicitudesServicio:w,solicitudesSeminuevos:F,onCreateSolicitud:E,isCrmMode:T,onSolicitudBaseUrl:I,onIframeClose:M,reloadInfo:U,idAdminSistemas:q=!1}=e,[V,H]=v.useState(s??null),[re,W]=v.useState({open:!1,customer:null}),[$,ie]=v.useState([]),ue=ae=>{W({open:!0,customer:ae})},N=ae=>{c&&(h?.(ae),W({open:!0,customer:ae}))},ee=()=>{W({open:!1,customer:null}),b?.()},xe=v.useMemo(()=>u?kh(t??[],u):kh(t??[],{fields:{},order:[]}),[t,u]),_e=v.useMemo(()=>{if(!n||!V)return r;const ae=xe.find(X=>X.key===V.key);if(!ae)return r;const le=[...r];return le.sort((X,we)=>{const ye=Oc(ae,X,0),K=Oc(ae,we,0),Ie=JD(ye,K);return V.direction==="asc"?Ie:-Ie}),le},[r,xe,V,n]),fe=v.useMemo(()=>{const ae=d?.getCustomerId;return le=>{const X=ae?.(le)??le?.Id_cliente??le?.CliID??le?.id??le?.ID??le?.Id??"";return String(X)}},[d]);return v.useEffect(()=>{if(!re.open||!re.customer)return;const ae=fe(re.customer);if(!ae)return;const le=(r??[]).find(X=>fe(X)===ae);le&&le!==re.customer&&W(X=>({...X,customer:le}))},[r,re.open,re.customer,fe]),v.useEffect(()=>{p&&ue(p)},[p]),l.jsxs("div",{children:[l.jsx("div",{className:`${Dh.tableClientes} back-white rounded-3 shadow-main mt-4 mb-4`,children:l.jsx("div",{className:`${Dh.tableResponsive} table-responsive`,children:l.jsxs("table",{className:"table table-hover align-middle mb-0",children:[l.jsx("thead",{children:l.jsx("tr",{children:xe.map(ae=>l.jsx("th",{style:{fontWeight:600,width:ae.width,paddingTop:"20px",paddingBottom:"20px",textAlign:ae.align??"left"},children:ae.header},ae.key))})}),l.jsx("tbody",{children:_e.map((ae,le)=>l.jsx("tr",{onClick:()=>N?.(ae),role:"button",tabIndex:0,onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&N?.(ae)},style:{cursor:"pointer"},children:xe.map((X,we)=>{const ye=X.Component?l.jsx(X.Component,{row:ae,index:le}):X.cell?X.cell(ae,le):(()=>{const K=Oc(X,ae,le);return K==null||K===""?"":String(K)})();return l.jsx("td",{style:{paddingTop:"20px",paddingBottom:"20px",textAlign:X.align??"left"},children:ye},`${String(X.key)}-${we}`)})},a(ae,le)))})]})})}),re.open&&l.jsx(B3,{open:re.open,onClose:ee,customer:re.customer,fields:d?.dynamicFields,header:d?.header,normalTable:f,history:y,advisorHistory:g,urlsQA:o,onRequestEdit:ae=>{ee(),_?.(ae)},searchFilter:S,solicitudesNuevos:D,solicitudesPrueba:C,solicitudesServicio:w,solicitudesSeminuevos:F,onCreateSolicitud:E,isCrmMode:T,onSolicitudBaseUrl:I,onIframeClose:M,reloadInfo:U,idAdminSistemas:q})]})}const Ah=G.forwardRef(({sx:e,...r},t)=>l.jsx(m.InputBase,{inputRef:t,...r,sx:{height:48,px:1.5,width:"100%",maxWidth:"none",bgcolor:"#EBEEF0",borderRadius:2,border:"1px solid transparent","&:hover":{borderColor:"transparent"},"& .MuiInputBase-input::placeholder":{opacity:.7},...e}}));Ah.displayName="SoftInput";function V3({message:e}){return e?l.jsxs(m.Box,{role:"alert",sx:{mt:1,display:"flex",alignItems:"center",gap:1,bgcolor:"#fdeaea",border:"1px solid rgb(253, 237, 237)",color:"#842029",borderRadius:1,px:2,py:1.25},children:[l.jsx(Mc,{fontSize:"small",sx:{color:"rgb(211, 47, 47)"}}),l.jsx("span",{style:{color:"rgb(95, 33, 32)",fontSize:14,fontWeight:"500"},children:e})]}):null}function U3(e){if(e.required)return e.required===!0?"El campo es obligatorio.":e.required}function Nc(e,r){const t=U3(e);return t?r?.isArray?{required:t,validate:n=>Array.isArray(n)&&n.length>0||t}:{required:t,validate:n=>n!==""&&n!==null&&n!==void 0||t}:{}}const Th={"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},width:"100%"},W3={mb:1,fontWeight:600,color:"#1C1C1D","&.Mui-focused":{color:"#1C1C1D !important"},"&.Mui-error":{color:"#1C1C1D !important"}};function $c({label:e,errorMsg:r,helperText:t,children:n,sx:o}){return l.jsxs(m.FormControl,{fullWidth:!0,error:!!r,sx:o,className:"1- FieldWrapper",children:[l.jsx(m.FormLabel,{sx:W3,children:e}),n,l.jsx(V3,{message:r||t})]})}function H3(e,r){const{register:t,formState:{errors:n}}=r,o={...Nc(e)};e.minLength&&(o.minLength={value:e.minLength,message:`El campo espera minimo ${e.minLength} caracteres`}),e.maxLength&&(o.maxLength={value:e.maxLength,message:`El campo espera maximo ${e.maxLength} caracteres`}),e.pattern&&(o.pattern={value:e.pattern,message:"Formato inválido"});const s=e.type==="email";s&&!o.pattern&&(o.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Correo electrónico inválido"});const i=/[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]/g,a=/[0-9]/g,c=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Home","End","Escape","Enter"]),u=C=>e.onlyNumbers?(C.match(a)??[]).join(""):e.onlyLetters?(C.match(i)??[]).join(""):C,d=(C,w)=>c.has(C)||w?!0:e.onlyNumbers?/^[0-9]$/.test(C):e.onlyLetters?/^[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]$/.test(C):!0,f=n[e.name]?.message,h=t(e.name,o),y=(e.inputProps&&typeof e.inputProps.maxLength=="number"?e.inputProps.maxLength:void 0)??e.maxLength,g=C=>{d(C.key,C.ctrlKey||C.metaKey)||C.preventDefault()},p=C=>{const w=C.data??null;w!=null&&(e.onlyNumbers&&/[^0-9]/.test(w)&&C.preventDefault(),e.onlyLetters&&/[^A-Za-zÁÉÍÓÚÜÑáéíóúüñ ]/.test(w)&&C.preventDefault())},b=C=>{const w=C.clipboardData.getData("text"),F=u(w);if(F!==w){C.preventDefault();const E=C.target,T=E.selectionStart??E.value.length,I=E.selectionEnd??E.value.length;E.setRangeText(F,T,I,"end"),E.dispatchEvent(new Event("input",{bubbles:!0}))}},_=C=>{const w=u(C.target.value);w!==C.target.value&&(C.target.value=w),y&&C.target.value.length>y&&(C.target.value=C.target.value.slice(0,y)),h.onChange(C)},S={...e.inputProps,...s?{inputMode:"email",autoComplete:"email"}:{},maxLength:y,onKeyDown:g,onBeforeInput:p,onPaste:b,onInvalid:C=>C.preventDefault()},D=e.onlyNumbers||s?"text":e.type??"text";return l.jsx($c,{label:e.label,errorMsg:f,helperText:e.helperText,sx:Th,children:l.jsx(Ah,{placeholder:e.placeholder,type:D,inputProps:S,...h,onChange:_,sx:{width:"100%",maxWidth:"none"},className:"SoftInputData"})})}function Y3(e,r){const{control:t}=r,n=!!e.multiple;return l.jsx(ir,{name:e.name,control:t,rules:Nc(e,{isArray:n}),render:({field:o,fieldState:s})=>l.jsx($c,{label:e.label,errorMsg:s.error?.message,helperText:e.helperText,sx:Th,children:l.jsxs(m.Select,{...o,multiple:n,displayEmpty:!0,sx:{height:48,backgroundColor:"#EBEEF0","& .MuiSelect-select":{display:"flex",alignItems:"center",py:0}},className:"2-SoftInputData",children:[!n&&l.jsx(m.MenuItem,{value:"",disabled:!0,children:"Selecciona…"}),e.options.map(i=>l.jsx(m.MenuItem,{value:i.value,children:i.label},String(i.value)))]})})})}function q3(e,r){return l.jsx(ir,{name:e.name,control:r.control,rules:Nc(e),render:({field:t,fieldState:n})=>l.jsx($c,{label:e.label,errorMsg:n.error?.message,helperText:e.helperText,children:l.jsx(m.RadioGroup,{row:!0,...t,className:"3-RadioFieldRender",children:e.options.map(o=>l.jsx(m.FormControlLabel,{value:o.value,control:l.jsx(m.Radio,{}),label:o.label},String(o.value)))})})})}function Mh(e,r){if(e.render)return e.render(r);switch(e.kind){case"text":return H3(e,r);case"select":return Y3(e,r);case"radio":return q3(e,r);default:return null}}function Z3(e,{initialPerPage:r=25,perPageOptions:t=[10,25,50,100,"Todos"],onPageChange:n,onPerPageChange:o,scrollTop:s,deps:i=[]}={}){const a=Array.isArray(e)?e:[],[c,u]=v.useState(1),[d,f]=v.useState(r),{currentItems:h,totalPages:y,showingFrom:g,showingTo:p,totalItems:b}=v.useMemo(()=>{const D=a.length,C=d==="Todos"?1/0:Number(d),w=C===1/0?1:Math.max(1,Math.ceil(D/C)),F=Math.min(c,w),E=C===1/0?D:F*C,T=C===1/0?0:E-C;return{currentItems:C===1/0?a:a.slice(T,E),totalPages:w,showingFrom:D===0?0:T+1,showingTo:C===1/0?D:Math.min(E,D),totalItems:D}},[a,c,d]),_=D=>{const C=Math.max(1,Math.min(D,y||1));u(C),n?.(C),s?.()};return{currentItems:h,totalPages:y,showingFrom:g,showingTo:p,totalItems:b,currentPage:c,itemsPerPage:d,perPageOptions:t,goTo:_,next:()=>_(c+1),prev:()=>_(c-1),setItemsPerPage:D=>{f(D),o?.(D),u(1),s?.()},setCurrentPage:_}}var es={},Ih;function G3(){if(Ih)return es;Ih=1;var e=ct();Object.defineProperty(es,"__esModule",{value:!0}),es.default=void 0;var r=e(ht()),t=dt();return es.default=(0,r.default)((0,t.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),es}var K3=G3();const Q3=at(K3);var ts={},Oh;function X3(){if(Oh)return ts;Oh=1;var e=ct();Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0;var r=e(ht()),t=dt();return ts.default=(0,r.default)((0,t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),ts}var J3=X3();const ek=at(J3),tk=({currentPage:e,totalPages:r,onPageChange:t,itemsPerPage:n,onItemsPerPageChange:o,itemsPerPageOptions:s,showingFrom:i,showingTo:a,totalItems:c})=>{const u=m.useTheme(),d=m.useMediaQuery(u.breakpoints.down("sm")),f=()=>{if(r<=1)return[1];const g=d?0:2,p=[],b=1,_=r,S=Math.max(b+1,e-g),D=Math.min(_-1,e+g);p.push(b),S>b+1&&p.push("...");for(let C=S;C<=D;C++)C>=b+1&&C<=_-1&&p.push(C);return D<_-1&&p.push("..."),p.push(_),p},h=g=>{const p=g.target.value;o(p)},y=Math.max(1,r);return l.jsxs(m.Box,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:"center",justifyContent:{xs:"center",sm:"space-between"},gap:2,my:0,py:2,borderTop:"#D3D4D5 1px solid",px:3},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"center"},children:[l.jsx(m.IconButton,{onClick:()=>t(e-1),disabled:e<=1,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página anterior",children:l.jsx(Q3,{fontSize:"large"})}),f().map((g,p)=>g==="..."?l.jsx(m.Box,{sx:{px:1,display:"flex",alignItems:"center",fontSize:"1.1rem"},children:". . ."},`dots-${p}`):l.jsx(m.Button,{onClick:()=>t(g),size:"small",sx:{minWidth:36,height:36,fontSize:"1.05rem",p:1,borderRadius:"10px",backgroundColor:e===g?"primary.main":"transparent",fontWeight:e===g?700:400,color:e===g?"#fff":"#5C6372","&:hover":{backgroundColor:e===g?"primary.dark":"action.hover"},boxShadow:"none",border:"none",mx:.5},children:g},`p-${g}`)),l.jsx(m.IconButton,{onClick:()=>t(e+1),disabled:e>=y,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página siguiente",children:l.jsx(ek,{fontSize:"large"})})]}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1.25,justifyContent:{xs:"center",sm:"flex-start"},mt:{xs:1,sm:0}},children:[l.jsx(m.Typography,{variant:"body2",children:"Mostrar"}),l.jsx(m.FormControl,{size:"small",sx:{minWidth:72},children:l.jsx(m.Select,{value:n,onChange:h,renderValue:g=>g==="Todos"?"Todos":String(g),children:s.map(g=>l.jsx(m.MenuItem,{value:g,children:g==="Todos"?"Todos":g},String(g)))})}),l.jsx(m.Typography,{variant:"body2",children:"por página"})]})]})};function rk(e){const{open:r,dataAdd:t,fields:n,onSubmit:o,onCancel:s,defaultValues:i,txtBtnGuardar:a,haveId:c=!1,itemsTable:u,filter:d,getId:f,renderRow:h,selectedIds:y,onSelectedChange:g,onSubmitAddData:p,initialSelectedIds:b=[],showAutosPanel:_}=e,S=Xf({mode:"onSubmit",reValidateMode:"onChange",criteriaMode:"all",shouldUnregister:!1,defaultValues:i});v.useEffect(()=>{i&&S.reset(i)},[i,S]);const[D,C]=v.useState(""),[w,F]=v.useState(b),E=Array.isArray(y)&&!!g,T=E?y:w,I=j=>{const oe=typeof j=="function"?j(T):j;E?g(oe):F(oe)},M=v.useCallback(j=>f?f(j):j?.IdAuto,[f]),U=v.useMemo(()=>{const j=new Map;return(u??[]).forEach((oe,Se)=>j.set(M(oe),Se)),j},[u,M]),q=v.useRef(new Set),V=v.useMemo(()=>{const j=new Map;return(u??[]).forEach(oe=>j.set(f?f(oe):oe?.IdAuto,oe)),j},[u,f]),H=v.useMemo(()=>(n??[]).filter(j=>!!j.required).map(j=>j.name),[n]),re=Pf({control:S.control,name:H}),W=j=>j==null?!1:typeof j=="string"?j.trim().length>0:Array.isArray(j)?j.length>0:typeof j=="number"?!Number.isNaN(j):typeof j=="object"?Object.keys(j).length>0:!0,$=v.useMemo(()=>H.length?re?.every(W)??!1:!0,[re,H]),{handleSubmit:ie,formState:{isSubmitting:ue,isDirty:N,isValid:ee}}=S,xe=d??((j,oe)=>JSON.stringify(j).toLowerCase().includes(oe.toLowerCase())),_e=v.useMemo(()=>D.trim()?u?.filter(j=>xe(j,D)):u,[u,D,xe]),fe=v.useMemo(()=>{if(!_e)return _e;const j=q.current,oe=[..._e];return oe.sort((Se,je)=>{const R=j.has(M(Se))?0:1,te=j.has(M(je))?0:1;if(R!==te)return R-te;const be=U.get(M(Se))??0,qe=U.get(M(je))??0;return be-qe}),oe},[_e,U,M]),{currentItems:ae,totalPages:le,showingFrom:X,showingTo:we,totalItems:ye,currentPage:K,itemsPerPage:Ie,perPageOptions:P,goTo:Be,setItemsPerPage:Qe}=Z3(fe,{initialPerPage:25,perPageOptions:[10,25,50,100,"Todos"],deps:[D],scrollTop:()=>{}}),Fe=j=>{const oe=V.get(j)??null;I([j]),p?.({items:oe})},Le=j=>T.includes(j),We=async j=>{try{await o?.(j),S.reset(S.getValues())}catch(oe){console.error("Error al enviar AddCliente:",oe)}},Xe=v.useMemo(()=>{const j=new Map;return(n??[]).forEach(oe=>j.set(String(oe.name),oe)),j},[n]),ft=(j,oe)=>{const Se=Xe.get(String(j));if(!Se)return null;const je={xs:12,...Se.grid,...oe||{}};return l.jsx(m.Grid,{item:!0,...je,children:Se.render?Se.render(S):Mh(Se,S)},`fld-${String(j)}`)},k=_??(e.haveId?"edit":"new"),O=k!=="onlyCars",B=k==="new"||k==="onlyCars",ce=T?.length>0,se=k==="onlyCars"?ce:e.haveId?$&&N||ce:$&&ce;return l.jsx(m.Dialog,{open:r,onClose:s,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:{xs:"100dvh",md:B?"90vw":"auto"},maxWidth:{xs:"100vw",md:B?"98vw":"50%"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:l.jsx(hw,{...S,children:l.jsxs(m.Box,{component:"form",noValidate:!0,onSubmit:ie(We),display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%",height:"100%",minHeight:0,overflow:"hidden",position:"relative",children:[O&&l.jsxs(m.Box,{sx:{width:{xs:"100%",md:c?"100%":394},maxWidth:{xs:"100%",md:c?"100%":394},boxShadow:{xs:"none",md:c?"none":"2px 0px 8px #40404024"},borderRight:{xs:"none",md:c?"none":"1px solid #EBEEF0"},bgcolor:"background.paper",paddingBottom:3,mx:{xs:0,md:c?"auto":0},position:"relative"},children:[l.jsxs(m.Box,{p:{xs:2,md:2},height:"100%",width:"100%",children:[l.jsx(m.Typography,{fontWeight:700,fontSize:20,children:t.title}),l.jsxs(m.Box,{sx:{flex:1,height:"100%",overflowY:"auto",paddingBottom:10},children:[l.jsx(m.Typography,{fontSize:"18px",mt:2.5,fontWeight:500,children:t.subTitle}),l.jsx(m.Box,{mt:2,display:"flex",flexDirection:"column",width:"100%",gap:2,children:Array.isArray(e.formLayout)&&c?e.formLayout.map((j,oe)=>l.jsx(m.Grid,{container:!0,spacing:2,alignItems:"flex-start",wrap:"wrap",width:"100%",children:j.map((Se,je)=>{const R=typeof Se=="string"?{name:Se}:Se;return R.hidden?.(S)?null:ft(R.name,R.grid)})},`row-${oe}`)):l.jsx(m.Grid,{container:!0,spacing:2,width:"100%",children:n?.map((j,oe)=>{const Se=j.grid??{xs:12,md:12};return l.jsx(m.Grid,{item:!0,...Se,children:j.render?j.render(S):Mh(j,S)},`${String(j.name)}-${oe}`)})})})]})]}),l.jsx(m.Box,{sx:{position:"absolute",zIndex:j=>j.zIndex.modal+1,bottom:0,width:"100%",borderRadius:2,boxShadow:{xs:"0",md:"0 -8px 8px -6px #0003"},p:1,backgroundColor:"#fff"},children:l.jsx(m.Box,{display:"flex",alignItems:"center",children:l.jsx(m.Box,{display:"flex",gap:1.5,width:"100%",justifyContent:c?"flex-end":"center",children:l.jsx(m.Button,{type:"submit",variant:"contained",disabled:ue||!se,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:c?"160px":"100%"},children:a})})})})]}),B&&l.jsx(m.Box,{flex:1,display:"flex",flexDirection:"column",minWidth:0,sx:{height:"100%"},children:l.jsx(m.Box,{mt:1,sx:{flex:1,display:"flex",flexDirection:"column",height:"100%"},children:l.jsxs(m.Box,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[l.jsxs(m.Box,{p:3,sx:{borderBottom:1,borderBottomColor:"#D3D4D5",position:"sticky",top:0,zIndex:1,bgcolor:"#fff",flexDirection:{sm:"row",xs:"column"}},display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:4,children:[l.jsx(m.TextField,{value:D,onChange:j=>C(j.target.value),placeholder:"Buscar marca, modelo, vin...",InputProps:{endAdornment:l.jsx(m.InputAdornment,{position:"start",children:l.jsx(i1,{})}),disableUnderline:!0},variant:"standard",sx:{maxWidth:360,width:"100%",backgroundColor:"#EBEEF0",paddingX:"16px",paddingY:"10px"}}),l.jsx(m.Box,{display:"flex",gap:2,alignItems:"center",sx:{marginTop:{sm:0,xs:2}},children:l.jsx(m.Box,{onClick:s,sx:{cursor:"pointer",position:"absolute",top:0,right:10},display:{xs:"none",md:"block"},children:l.jsx(Rr,{sx:{color:"#070C10",fontSize:24}})})}),_=="onlyCars"&&l.jsx(m.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:l.jsx(m.Box,{display:"flex",gap:1.5,width:"100%",children:l.jsxs(m.Button,{type:"submit",variant:"contained",disabled:ue||!se,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:"100%"},children:[l.jsx(Ch,{sx:{color:ue||!se?"gray":"#fff",fontSize:26,paddingRight:.6}}),"Crear Solicitud"]})})})]}),l.jsx(m.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",padding:0,height:"100%","&::-webkit-scrollbar:horizontal":{display:"none"},"&::-webkit-scrollbar:vertical":{width:8}},children:l.jsx(m.Box,{sx:{minWidth:1150,width:"max(1150px, 100%)",paddingBottom:10},children:l.jsxs(m.List,{disablePadding:!0,sx:{borderColor:"transparent",padding:0},children:[ae?.map((j,oe)=>{const Se=f?f(j):oe,je=Le(Se);return l.jsx(m.Box,{sx:{borderBottom:"1px solid #D3D4D5",padding:0},children:l.jsx(m.ListItem,{disableGutters:!0,sx:{paddingTop:0,padding:0,m:0},children:l.jsx(m.ListItemButton,{onClick:()=>Fe(Se),disableRipple:!0,sx:{padding:0},children:l.jsx(m.ListItemText,{disableTypography:!0,primary:h?h({item:j,selected:je,toggle:()=>Fe(Se),index:oe}):null})})})},`${String(Se)}`)}),!ae?.length&&l.jsx(m.Box,{p:3,children:l.jsxs(m.Typography,{fontSize:14,color:"#5C6372",children:["Sin resultados para “",D,"”."]})})]})})}),l.jsx(m.Box,{sx:{position:"sticky",bottom:0,bgcolor:"#fff"},children:l.jsx(tk,{currentPage:K,totalPages:le,onPageChange:Be,itemsPerPage:Ie,onItemsPerPageChange:Qe,itemsPerPageOptions:P,showingFrom:X,showingTo:we,totalItems:ye})})]})})})]})})})}var rs={},jh;function nk(){if(jh)return rs;jh=1;var e=ct();Object.defineProperty(rs,"__esModule",{value:!0}),rs.default=void 0;var r=e(ht()),t=dt();return rs.default=(0,r.default)((0,t.jsx)("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),rs}var ok=nk();const sk=at(ok),Lc=/^[^\s@]+@[^\s@]+\.[^\s@]+$/i,Li=/[,\s;]+/g,tn=e=>e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase(),rn=(e,r)=>Array.from(new Set([...e,...r.map(t=>t.trim()).filter(Boolean)])),Ph=(e,r)=>r?e.filter(t=>tn(t)!==tn(r)):e,ik=(e,r)=>e.filter(t=>!r.some(n=>tn(n)===tn(t)));function _r(e,r,t){if(t)return typeof t=="function"?t(e,r):e[t]}function ak(e,r){if(r)return!e||/^https?:\/\//i.test(r)?r:e+r}function ck({open:e,onClose:r,value:t,onChange:n,onRequestSend:o,customer:s,itemsSelects:i,renderItem:a,filterFields:c=[],multiSelectAutos:u=!0,imgCorreoSrc:d,baseURLImages:f,itemProps:h,defaultItemImageSrc:y}){const g=v.useRef(null),[p,b]=v.useState("idle"),_=v.useRef(e);v.useEffect(()=>{const R=_.current;e&&!R&&b("entering"),!e&&R&&b("exiting"),_.current=e},[e]),v.useEffect(()=>{if(p==="entering"){const be=setTimeout(()=>b("idle"),320);return()=>clearTimeout(be)}if(p==="exiting"){const be=setTimeout(()=>b("idle"),220);return()=>clearTimeout(be)}},[p]);const[S,D]=v.useState(""),[C,w]=v.useState(!1),[F,E]=v.useState(!1),[T,I]=v.useState(!1),[M,U]=v.useState(""),[q,V]=v.useState([]),H=T?q:t.selectedIds,re=()=>{V([...t.selectedIds]),U(""),I(!0)},W=()=>{I(!1),V([])},$=()=>{const R=new Set(Xe.map((be,qe)=>String(_r(be,qe,h.id)))),te=q.filter(be=>R.has(String(be)));n({...t,selectedIds:te}),I(!1)},ie=(R,te)=>tn(R??"")===tn(te??"");function ue(R,te,be,qe,Ct){const Z=te?R.some(De=>ie(De,te)):!1,de=be.length>0?be.some(De=>R.some(Me=>ie(Me,De))):!1;qe(Z),Ct(de)}const N=R=>{const te=typeof R=="function"?R(t.recipients):R;n({...t,recipients:te}),ue(te,ae,X,w,E)},ee=R=>n({...t,message:R}),xe=R=>n({...t,attachments:[...t.attachments,...R]}),_e=R=>n({...t,attachments:t.attachments.filter(te=>te.name!==R)}),fe=R=>{if(T)if(u){const te=new Set(q);te.has(R)?te.delete(R):te.add(R),V(Array.from(te))}else{const te=q.includes(R);V(te?[]:[R])}else if(u){const te=new Set(t.selectedIds);te.has(R)?te.delete(R):te.add(R),n({...t,selectedIds:Array.from(te)})}else{const te=t.selectedIds.includes(R);n({...t,selectedIds:te?[]:[R]})}},ae=v.useMemo(()=>(s?.Correo??"").trim(),[s]),le=v.useMemo(()=>Array.isArray(s?.Asesores)?s.Asesores.filter(R=>R?.EmailAsesor&&R?.Activo):[],[s]),X=v.useMemo(()=>le.map(R=>(R.EmailAsesor??"").trim()).filter(Boolean),[le]),we=v.useRef(!1);v.useEffect(()=>{if(e&&!we.current){let R=[];C&&ae&&(R=rn(R,[ae])),F&&X.length&&(R=rn(R,X)),N(te=>rn(te,R)),ue(t.recipients,ae,X,w,E),D(""),we.current=!0}e||(we.current=!1)},[e,C,F,ae,X]);const ye=R=>{const te=le.find(be=>tn(be.EmailAsesor??"")===tn(R));if(te){if(te.ImgAsesor)return l.jsx(m.Avatar,{src:te.ImgAsesor,alt:te.NombreAsesor});const be=(te.NombreAsesor||"").trim(),qe=(te.ApellidosAsesor||"").trim();return l.jsx(m.Avatar,{children:`${be[0]??""}${qe[0]??""}`.toUpperCase()})}return l.jsx(m.Avatar,{children:R[0]?.toUpperCase()})},K=()=>{const R=S.trim();if(!R)return;const be=R.split(Li).filter(Boolean).filter(qe=>Lc.test(qe));be.length>0&&N(qe=>rn(qe,be)),D("")},Ie=R=>{w(R),N(te=>R&&ae?rn(te,[ae]):Ph(te,ae))},P=R=>{E(R),N(te=>R?rn(te,X):ik(te,X))},Be=R=>{const te=Array.from(R.target.files||[]);xe(te.map(be=>({name:be.name,size:be.size,file:be}))),R.target.value=""},Qe=H[0],Fe=v.useMemo(()=>!i||Qe===void 0?void 0:i.find((te,be)=>String(_r(te,be,h.id))===String(Qe)),[i,Qe,h.id]),Le=v.useMemo(()=>{if(!(!Fe||!h.distributorId))return _r(Fe,0,h.distributorId)},[Fe,h.distributorId]);console.log("lockedDisId",Le);const We=v.useMemo(()=>Fe?(h.distributorTitle?_r(Fe,0,h.distributorTitle):void 0)??(Le!=null?String(Le):void 0):void 0,[Fe,h.distributorTitle,Le]),Xe=v.useMemo(()=>{const R=i??[];return Le==null||!h.distributorId?R:R.filter((te,be)=>_r(te,be,h.distributorId)==Le)},[i,Le,h.distributorId]),ft=v.useMemo(()=>{if(!M.trim())return Xe;const R=M.toLowerCase();return Xe.filter(te=>(c??[]).some(be=>String(te?.[be]??"").toLowerCase().includes(R)))},[Xe,M,c]),k=v.useMemo(()=>{if(!i||!t.selectedIds.length)return[];const R=new Map;return i.forEach((te,be)=>{R.set(String(_r(te,be,h.id)),te)}),t.selectedIds.map(te=>R.get(String(te))).filter(Boolean)},[i,t.selectedIds,h.id]),O=R=>n({...t,selectedIds:t.selectedIds.filter(te=>String(te)!==String(R))}),B=()=>{let R=t.recipients;if(S.trim()){const Z=S.split(Li).filter(de=>Lc.test(de));R=rn(R,Z),N(R),D("")}const te=C?ae:"",be=le.find(Z=>Z?.Activo&&Z?.EmailAsesor)?.EmailAsesor?.trim()??"";o?.({recipients:R,toClient:C,toAdvisor:F,tipoInt:C&&F?2:1,correoCliente:te,correoAsesor:F?be:"",disIdLocked:Le}),r?.()},ce=v.useMemo(()=>{const te=S.split(Li).filter(Boolean).some(be=>Lc.test(be));return t.recipients.length>0||te},[t.recipients,S]),se=(t.selectedIds?.length??0)>0,j=t.message.trim().length>0,oe=ce&&se&&j,Se=m.useTheme(),je=m.useMediaQuery(Se.breakpoints.down("sm"));return l.jsxs(m.Drawer,{anchor:je?"bottom":"right",open:e,onClose:r,ModalProps:{keepMounted:!0,BackdropProps:{invisible:!je}},transitionDuration:{enter:320,exit:220},SlideProps:{direction:je?"up":"left",timeout:{enter:320,exit:220},easing:{enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 1, 1)"}},PaperProps:{sx:{width:{xs:"100vw",sm:420},height:{xs:"85vh",sm:"auto"},maxHeight:{xs:"85vh",sm:"calc(100vh - 32px)"},left:{xs:0,sm:"auto"},right:{xs:0,sm:16},bottom:{xs:0,sm:16},top:{xs:"auto",sm:"auto"},borderRadius:{xs:"12px 12px 0 0",sm:2},boxShadow:6,overflow:"hidden"}},children:[l.jsxs(m.Box,{sx:{display:"flex",flexDirection:"column",height:{xs:"100%",sm:"auto"},position:"relative",overflow:"auto"},children:[l.jsxs(m.Box,{sx:{p:2,pb:1,position:"sticky",top:0,zIndex:1,bgcolor:"#fff",borderBottom:"1px solid #E5E7EB"},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[d?l.jsx("img",{src:d,alt:"Correo",style:{width:24,height:18}}):null,l.jsxs(m.Typography,{fontWeight:700,children:["Mensaje a"," ",s?`${s.Nombre??""} ${s.ApellidoP??""} ${s.ApellidoM??""}`.trim():"—"]})]}),l.jsx(m.IconButton,{onClick:r,size:"small",children:l.jsx(Rr,{})})]}),l.jsx("div",{children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 10px",backgroundColor:"#EBEEF0",border:"1px solid #E5E7EB",borderRadius:8,flexWrap:"wrap"},children:[l.jsx("label",{style:{fontSize:14,fontWeight:600,marginRight:4},children:"Para:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:[t.recipients.map(R=>l.jsx(m.Chip,{avatar:ye(R),label:R,onDelete:()=>N(te=>Ph(te,R)),size:"small",variant:"outlined",sx:{borderRadius:999,height:28}},R)),l.jsx("input",{type:"text",value:S,onChange:R=>D(R.target.value),onKeyDown:R=>{const te=R.key;te==="Enter"||te===","||te===";"||te===" "||te==="Tab"?(R.preventDefault(),K()):te==="Backspace"&&!S&&t.recipients.length&&N(qe=>qe.slice(0,-1))},onBlur:K,onPaste:R=>{const be=R.clipboardData.getData("text").split(Li).filter(Boolean);be.length>1&&(R.preventDefault(),N(qe=>rn(qe,be)),D(""))},placeholder:t.recipients.length?"":"correo@ejemplo.com",style:{flex:1,minWidth:140,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#111827",padding:"4px 0"}})]})]})}),l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:1.5},children:[l.jsx(m.FormControlLabel,{control:l.jsx(m.Checkbox,{checked:C,onChange:R=>Ie(R.target.checked),size:"small"}),label:"Cliente"}),le.length!==0&&l.jsx(m.FormControlLabel,{control:l.jsx(m.Checkbox,{checked:F,onChange:R=>P(R.target.checked),size:"small"}),label:`Asesor${le.length>1?"es":""}`})]})]}),l.jsx(m.Divider,{}),l.jsxs(m.Box,{p:2,children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1},onClick:re,children:[l.jsx(m.Typography,{fontSize:12,fontWeight:600,sx:{textDecorationLine:"underline",cursor:"pointer"},children:"Selecciona el auto de seguimiento"}),We!=null&&l.jsx(m.Chip,{size:"small",label:`Distribuidora: ${We}`})]}),k.length>0?l.jsx(m.Box,{sx:{mt:1.5,display:"flex",gap:1,flexWrap:"wrap"},children:k.map((R,te)=>{const be=_r(R,te,h.id),qe=_r(R,te,h.title)??"",Ct=_r(R,te,h.image),Z=ak(f,Ct);return l.jsx(m.Chip,{onDelete:()=>O(be),label:l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(m.Box,{sx:{width:28,height:20,borderRadius:.8,bgcolor:"#e5e6e8",overflow:"hidden",flex:"0 0 auto"},children:Z?l.jsx("img",{src:Z,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}}):l.jsx("img",{src:y,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}})}),l.jsx("span",{style:{fontSize:12},children:l.jsx("b",{children:qe})})]}),sx:{pl:.5,pr:.3,py:.2,borderRadius:2,".MuiChip-deleteIcon":{fontSize:18}},variant:"outlined"},String(be))})}):l.jsx(m.Typography,{fontSize:13,color:"#5C6372",sx:{mt:.5},children:"Aún no has seleccionado autos."})]}),l.jsx(m.Divider,{}),l.jsxs(m.Box,{sx:{p:2},children:[l.jsx(m.TextField,{placeholder:"Escribe aquí tu mensaje...",value:t.message,onChange:R=>ee(R.target.value),multiline:!0,minRows:6,fullWidth:!0,sx:{mb:1.5}}),t.attachments.length>0&&l.jsx(m.List,{dense:!0,sx:{display:"flex",flexDirection:"column",gap:2,border:"none"},children:t.attachments.map(R=>l.jsxs(m.ListItem,{sx:{px:0,background:"#EAEBF2",borderRadius:2,paddingX:1},children:[l.jsx(m.ListItemText,{style:{gap:10,fontSize:15,color:"#5285F7",display:"flex",flexWrap:"wrap",flex:"none"},primary:R.name,secondary:R.size<1024?`${R.size} b`:R.size<1024*1024?`${(R.size/1024).toFixed(0)} kb`:`${(R.size/(1024*1024)).toFixed(1)} MB`,secondaryTypographyProps:{sx:{fontSize:12,color:"#64748B",fontWeight:500,mt:.25}},primaryTypographyProps:{noWrap:!0,width:"auto"}}),l.jsx(m.Tooltip,{title:"Quitar",children:l.jsx(m.IconButton,{edge:"end",onClick:()=>_e(R.name),size:"small",children:l.jsx(Rr,{fontSize:"small"})})})]},R.name))})]}),l.jsxs(m.Box,{sx:{position:{xs:"sticky",sm:"sticky"},bottom:0,bgcolor:"#fff",borderTop:"1px solid #E5E7EB",p:2,display:"flex",alignItems:"center",gap:2},children:[l.jsx("input",{ref:g,hidden:!0,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.mp4,.pdf,.xlsx,.csv,.docx,.pptx,.txt",onChange:Be}),l.jsx(m.Button,{startIcon:l.jsx(sk,{}),variant:"text",onClick:()=>g.current?.click(),sx:{color:"#5C6372"},children:"Adjuntar archivo"}),l.jsx(m.Box,{sx:{flex:1}}),l.jsx(m.Button,{variant:"contained",onClick:B,disabled:!oe,sx:{maxWidth:146,width:"100%",height:53,backgroundColor:"#336BE1"},children:"Enviar"})]})]}),l.jsxs(m.Dialog,{fullWidth:!0,maxWidth:"sm",fullScreen:je,open:T,onClose:W,children:[l.jsxs(m.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:["Selecciona tu auto de seguimiento",l.jsx(m.IconButton,{onClick:W,size:"small",children:l.jsx(Rr,{})})]}),l.jsxs(m.DialogContent,{children:[l.jsxs(m.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(m.TextField,{placeholder:"Buscar...",fullWidth:!0,size:"small",value:M,onChange:R=>U(R.target.value),sx:{mb:2}}),We!=null&&l.jsx(m.Chip,{size:"small",label:`Distribuidora: ${We}`})]}),l.jsxs(m.Typography,{variant:"caption",fontWeight:600,children:["RESULTADOS (",ft.length,")"]}),l.jsxs(m.List,{sx:{p:0},children:[ft.map((R,te)=>{const be=_r(R,te,h.id),qe=H.includes(String(be))||H.includes(be),Ct=Le==null||_r(R,te,h.distributorId)==Le;return l.jsx(m.ListItem,{disableGutters:!0,sx:{p:0,opacity:Ct?1:.5},children:l.jsx(m.Box,{onClick:()=>Ct&&fe(be),sx:{cursor:Ct?"pointer":"not-allowed",p:.5,backgroundColor:qe?"#e5f0ff":"transparent",width:"100%",borderBottom:"solid 1px #D3D4D5"},children:a?a(R,te):l.jsx("pre",{style:{margin:0},children:JSON.stringify(R,null,2)})})},String(be))}),ft.length===0&&l.jsx(m.Box,{p:2,children:l.jsx(m.Typography,{children:"Tu búsqueda no generó resultados"})})]})]}),l.jsxs(m.DialogActions,{sx:{px:3,pb:2},children:[l.jsx(m.Button,{variant:"text",onClick:W,sx:{color:"#5C6372"},children:"Cancelar"}),l.jsx(m.Button,{variant:"contained",onClick:$,sx:{backgroundColor:"#336BE1"},children:"Guardar selección"})]})]})]})}Mt.AddCliente=rk,Mt.ApiProvider=ox,Mt.AuthProvider=j1,Mt.Clientes=F3,Mt.CustomSnackbar=Ic,Mt.EventsProvider=VD,Mt.ModalCorreo=ck,Mt.MyCalendar=KD,Mt.useAuth=Ua,Mt.useAuthRepository=mi,Mt.useEventRepository=sc,Object.defineProperty(Mt,Symbol.toStringTag,{value:"Module"})}));
|