componentes-exagono 0.1.5 → 0.1.7
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 +2 -9
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -19449,20 +19449,13 @@ const Nd = /^([01][0-9]|2[0-3]):[0-5][0-9]$/, vO = qT({
|
|
|
19449
19449
|
top: "50%",
|
|
19450
19450
|
left: "50%",
|
|
19451
19451
|
transform: "translate(-50%, -50%)",
|
|
19452
|
-
|
|
19453
|
-
width: { xs: "90%", sm: 450 },
|
|
19454
|
-
// Ancho responsivo
|
|
19455
|
-
// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
|
|
19452
|
+
width: { xs: "90%", sm: 450, md: 500 },
|
|
19456
19453
|
bgcolor: "background.paper",
|
|
19457
19454
|
boxShadow: 24,
|
|
19458
19455
|
p: { xs: 2, sm: 3 },
|
|
19459
|
-
// Padding también puede ser responsivo
|
|
19460
19456
|
borderRadius: 2,
|
|
19461
|
-
// --- BUENAS PRÁCTICAS PARA MÓVIL ---
|
|
19462
19457
|
maxHeight: "90vh",
|
|
19463
|
-
// Evita que el modal sea más alto que la pantalla
|
|
19464
19458
|
overflowY: "auto"
|
|
19465
|
-
// Permite scroll DENTRO del modal si el contenido es largo
|
|
19466
19459
|
}, Cs = ["#dbe3fe", "#fcebc7", "#d9f1d2", "#fdf5d1", "#ebe3d7", "#e1d6fb", "#f7c7cc", "#f9e7fb", "#eaedf2", "#d5d8dd"], EO = () => {
|
|
19467
19460
|
const e = [];
|
|
19468
19461
|
for (let t = 0; t < 24; t++)
|
|
@@ -19703,7 +19696,7 @@ const Nd = /^([01][0-9]|2[0-3]):[0-5][0-9]$/, vO = qT({
|
|
|
19703
19696
|
{
|
|
19704
19697
|
name: "todoElDia",
|
|
19705
19698
|
control: p,
|
|
19706
|
-
render: ({ field: N }) => /* @__PURE__ */ v.jsx(Ah, { control: /* @__PURE__ */ v.jsx(Ih, { checked: N.value, onChange: (z) => N.onChange(z.target.checked) }), label: /* @__PURE__ */ v.jsx("label", { style: { fontSize: "0.7rem", fontWeight: "normal" }, children: "Todo el día" }) })
|
|
19699
|
+
render: ({ field: N }) => /* @__PURE__ */ v.jsx(Ah, { control: /* @__PURE__ */ v.jsx(Ih, { checked: N.value, onChange: (z) => N.onChange(z.target.checked) }), label: /* @__PURE__ */ v.jsx("label", { style: { fontSize: "0.7rem", fontWeight: "normal" }, children: "Todo el día" }), sx: { whiteSpace: "nowrap" } })
|
|
19707
19700
|
}
|
|
19708
19701
|
) }),
|
|
19709
19702
|
/* @__PURE__ */ v.jsx(Ye, { size: { xs: 12, md: 12 }, children: !c && /* @__PURE__ */ v.jsx(v.Fragment, { children: /* @__PURE__ */ v.jsxs(cn, { onClick: W, size: "small", sx: { textTransform: "none", fontSize: 16 }, children: [
|
package/dist/index.umd.js
CHANGED
|
@@ -172,4 +172,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
172
172
|
} else {
|
|
173
173
|
newResult[${S}] = ${E}.value;
|
|
174
174
|
}
|
|
175
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const _=h.compile();return(C,E)=>_(f,C,E)};let a;const i=Ua,s=!hf.jitless,l=s&&Bx.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=n.value);const m=f.value;return i(m)?s&&l&&h?.async===!1&&h.jitless!==!0?(a||(a=o(t.shape)),f=a(f,h),u?Af([],m,f,h,d,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function If(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!An(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>Jr(i,n,Xr())))}),t)}const AD=$("$ZodUnion",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Be(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Be(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Be(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Ns(a.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let i=!1;const s=[];for(const c of t.options){const l=c._zod.run({value:o.value,issues:[]},a);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(c=>If(c,o,e,a)):If(s,o,e,a)}}),ID=$("$ZodIntersection",(e,t)=>{Je.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,a=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,l])=>Nf(r,c,l)):Nf(r,a,i)}});function js(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_o(e)&&_o(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(const a of n){const i=js(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],a=t[n],i=js(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Nf(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),An(e))return e;const n=js(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const ND=$("$ZodEnum",(e,t)=>{Je.init(e,t);const r=Yx(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Wx.has(typeof o)).map(o=>typeof o=="string"?Pn(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),RD=$("$ZodLiteral",(e,t)=>{if(Je.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Pn(r):r?Pn(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),$D=$("$ZodTransform",(e,t)=>{Je.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pf(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Mn;return r.value=o,r}});function Rf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const LD=$("$ZodOptional",(e,t)=>{Je.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Rf(a,r.value)):Rf(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),jD=$("$ZodNullable",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)}|null)$`):void 0}),Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),YD=$("$ZodDefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>$f(a,t)):$f(o,t)}});function $f(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zD=$("$ZodPrefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),FD=$("$ZodNonOptional",(e,t)=>{Je.init(e,t),Be(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Lf(a,e)):Lf(o,e)}});function Lf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const BD=$("$ZodCatch",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>Jr(i,n,Xr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Jr(a,n,Xr()))},input:r.value}),r.issues=[]),r)}}),WD=$("$ZodPipe",(e,t)=>{Je.init(e,t),Be(e._zod,"values",()=>t.in._zod.values),Be(e._zod,"optin",()=>t.in._zod.optin),Be(e._zod,"optout",()=>t.out._zod.optout),Be(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>ti(i,t.in,n)):ti(a,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>ti(a,t.out,n)):ti(o,t.out,n)}});function ti(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const HD=$("$ZodReadonly",(e,t)=>{Je.init(e,t),Be(e._zod,"propValues",()=>t.innerType._zod.propValues),Be(e._zod,"values",()=>t.innerType._zod.values),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(jf):jf(o)}});function jf(e){return e.value=Object.freeze(e.value),e}const VD=$("$ZodCustom",(e,t)=>{Tt.init(e,t),Je.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>Yf(a,r,n,e));Yf(o,r,n,e)}});function Yf(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(xo(o))}}class UD{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,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,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ZD(){return new UD}const ri=ZD();function qD(e,t){return new e({type:"string",...ce(t)})}function GD(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function zf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function KD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function QD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function XD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function JD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function eS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function tS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function rS(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function nS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function oS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function aS(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function iS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function sS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function cS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function lS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function uS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function dS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function fS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function pS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function hS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function mS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}function gS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function yS(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function vS(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function bS(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function wS(e,t){return new e({type:"number",checks:[],...ce(t)})}function _S(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function xS(e,t){return new e({type:"boolean",...ce(t)})}function kS(e){return new e({type:"unknown"})}function DS(e,t){return new e({type:"never",...ce(t)})}function Ff(e,t){return new Ef({check:"less_than",...ce(t),value:e,inclusive:!1})}function Ys(e,t){return new Ef({check:"less_than",...ce(t),value:e,inclusive:!0})}function Bf(e,t){return new Cf({check:"greater_than",...ce(t),value:e,inclusive:!1})}function zs(e,t){return new Cf({check:"greater_than",...ce(t),value:e,inclusive:!0})}function Wf(e,t){return new zk({check:"multiple_of",...ce(t),value:e})}function Hf(e,t){return new Bk({check:"max_length",...ce(t),maximum:e})}function ni(e,t){return new Wk({check:"min_length",...ce(t),minimum:e})}function Vf(e,t){return new Hk({check:"length_equals",...ce(t),length:e})}function SS(e,t){return new Vk({check:"string_format",format:"regex",...ce(t),pattern:e})}function ES(e){return new Uk({check:"string_format",format:"lowercase",...ce(e)})}function CS(e){return new Zk({check:"string_format",format:"uppercase",...ce(e)})}function TS(e,t){return new qk({check:"string_format",format:"includes",...ce(t),includes:e})}function MS(e,t){return new Gk({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function OS(e,t){return new Kk({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function ko(e){return new Qk({check:"overwrite",tx:e})}function PS(e){return ko(t=>t.normalize(e))}function AS(){return ko(e=>e.trim())}function IS(){return ko(e=>e.toLowerCase())}function NS(){return ko(e=>e.toUpperCase())}function RS(e,t,r){return new e({type:"array",element:t,...ce(r)})}function $S(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function LS(e){const t=jS(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(xo(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(xo(o))}},e(r.value,r)));return t}function jS(e,t){const r=new Tt({check:"custom",...ce(t)});return r._zod.check=e,r}function Uf(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function YS(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Es(i,t,r,o,l?[].concat(l,n.message):n.message)}e.shift()}return r}function zS(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var s=n.errors[0][0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(u){return u.forEach(function(d){return e.push(d)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Es(i,t,r,o,l?[].concat(l,n.message):n.message)}e.shift()}return r}function FS(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,a){try{return Promise.resolve(Uf(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return a.shouldUseNativeValidation&&Os({},a),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(s){return Array.isArray(s?.issues)})(i))return{values:{},errors:df(YS(i.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,a){try{return Promise.resolve(Uf(function(){return Promise.resolve((r.mode==="sync"?tk:rk)(e,n,t)).then(function(i){return a.shouldUseNativeValidation&&Os({},a),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(s){return s instanceof $s})(i))return{values:{},errors:df(zS(i.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const BS=$("ZodISODateTime",(e,t)=>{dD.init(e,t),Ge.init(e,t)});function WS(e){return gS(BS,e)}const HS=$("ZodISODate",(e,t)=>{fD.init(e,t),Ge.init(e,t)});function VS(e){return yS(HS,e)}const US=$("ZodISOTime",(e,t)=>{pD.init(e,t),Ge.init(e,t)});function ZS(e){return vS(US,e)}const qS=$("ZodISODuration",(e,t)=>{hD.init(e,t),Ge.init(e,t)});function GS(e){return bS(qS,e)}const Wt=$("ZodError",(e,t)=>{$s.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ek(e,r)},flatten:{value:r=>Jx(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ps,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ps,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),KS=Ga(Wt),QS=Ka(Wt),XS=Qa(Wt),JS=Xa(Wt),eE=ak(Wt),tE=ik(Wt),rE=sk(Wt),nE=ck(Wt),oE=lk(Wt),aE=uk(Wt),iE=dk(Wt),sE=fk(Wt),it=$("ZodType",(e,t)=>(Je.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Nr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>KS(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>XS(e,r,n),e.parseAsync=async(r,n)=>QS(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>JS(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>eE(e,r,n),e.decode=(r,n)=>tE(e,r,n),e.encodeAsync=async(r,n)=>rE(e,r,n),e.decodeAsync=async(r,n)=>nE(e,r,n),e.safeEncode=(r,n)=>oE(e,r,n),e.safeDecode=(r,n)=>aE(e,r,n),e.safeEncodeAsync=async(r,n)=>iE(e,r,n),e.safeDecodeAsync=async(r,n)=>sE(e,r,n),e.refine=(r,n)=>e.check(nC(r,n)),e.superRefine=r=>e.check(oC(r)),e.overwrite=r=>e.check(ko(r)),e.optional=()=>Jf(e),e.nullable=()=>ep(e),e.nullish=()=>Jf(ep(e)),e.nonoptional=r=>KE(e,r),e.array=()=>IE(e),e.or=r=>LE([e,r]),e.and=r=>YE(e,r),e.transform=r=>rp(e,HE(r)),e.default=r=>ZE(e,r),e.prefault=r=>GE(e,r),e.catch=r=>XE(e,r),e.pipe=r=>rp(e,r),e.readonly=()=>tC(e),e.describe=r=>{const n=e.clone();return ri.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ri.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ri.get(e);const n=e.clone();return ri.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zf=$("_ZodString",(e,t)=>{Ls.init(e,t),it.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(SS(...n)),e.includes=(...n)=>e.check(TS(...n)),e.startsWith=(...n)=>e.check(MS(...n)),e.endsWith=(...n)=>e.check(OS(...n)),e.min=(...n)=>e.check(ni(...n)),e.max=(...n)=>e.check(Hf(...n)),e.length=(...n)=>e.check(Vf(...n)),e.nonempty=(...n)=>e.check(ni(1,...n)),e.lowercase=n=>e.check(ES(n)),e.uppercase=n=>e.check(CS(n)),e.trim=()=>e.check(AS()),e.normalize=(...n)=>e.check(PS(...n)),e.toLowerCase=()=>e.check(IS()),e.toUpperCase=()=>e.check(NS())}),cE=$("ZodString",(e,t)=>{Ls.init(e,t),Zf.init(e,t),e.email=r=>e.check(GD(lE,r)),e.url=r=>e.check(eS(uE,r)),e.jwt=r=>e.check(mS(SE,r)),e.emoji=r=>e.check(tS(dE,r)),e.guid=r=>e.check(zf(qf,r)),e.uuid=r=>e.check(KD(oi,r)),e.uuidv4=r=>e.check(QD(oi,r)),e.uuidv6=r=>e.check(XD(oi,r)),e.uuidv7=r=>e.check(JD(oi,r)),e.nanoid=r=>e.check(rS(fE,r)),e.guid=r=>e.check(zf(qf,r)),e.cuid=r=>e.check(nS(pE,r)),e.cuid2=r=>e.check(oS(hE,r)),e.ulid=r=>e.check(aS(mE,r)),e.base64=r=>e.check(fS(xE,r)),e.base64url=r=>e.check(pS(kE,r)),e.xid=r=>e.check(iS(gE,r)),e.ksuid=r=>e.check(sS(yE,r)),e.ipv4=r=>e.check(cS(vE,r)),e.ipv6=r=>e.check(lS(bE,r)),e.cidrv4=r=>e.check(uS(wE,r)),e.cidrv6=r=>e.check(dS(_E,r)),e.e164=r=>e.check(hS(DE,r)),e.datetime=r=>e.check(WS(r)),e.date=r=>e.check(VS(r)),e.time=r=>e.check(ZS(r)),e.duration=r=>e.check(GS(r))});function Jt(e){return qD(cE,e)}const Ge=$("ZodStringFormat",(e,t)=>{Ze.init(e,t),Zf.init(e,t)}),lE=$("ZodEmail",(e,t)=>{rD.init(e,t),Ge.init(e,t)}),qf=$("ZodGUID",(e,t)=>{eD.init(e,t),Ge.init(e,t)}),oi=$("ZodUUID",(e,t)=>{tD.init(e,t),Ge.init(e,t)}),uE=$("ZodURL",(e,t)=>{nD.init(e,t),Ge.init(e,t)}),dE=$("ZodEmoji",(e,t)=>{oD.init(e,t),Ge.init(e,t)}),fE=$("ZodNanoID",(e,t)=>{aD.init(e,t),Ge.init(e,t)}),pE=$("ZodCUID",(e,t)=>{iD.init(e,t),Ge.init(e,t)}),hE=$("ZodCUID2",(e,t)=>{sD.init(e,t),Ge.init(e,t)}),mE=$("ZodULID",(e,t)=>{cD.init(e,t),Ge.init(e,t)}),gE=$("ZodXID",(e,t)=>{lD.init(e,t),Ge.init(e,t)}),yE=$("ZodKSUID",(e,t)=>{uD.init(e,t),Ge.init(e,t)}),vE=$("ZodIPv4",(e,t)=>{mD.init(e,t),Ge.init(e,t)}),bE=$("ZodIPv6",(e,t)=>{gD.init(e,t),Ge.init(e,t)}),wE=$("ZodCIDRv4",(e,t)=>{yD.init(e,t),Ge.init(e,t)}),_E=$("ZodCIDRv6",(e,t)=>{vD.init(e,t),Ge.init(e,t)}),xE=$("ZodBase64",(e,t)=>{bD.init(e,t),Ge.init(e,t)}),kE=$("ZodBase64URL",(e,t)=>{_D.init(e,t),Ge.init(e,t)}),DE=$("ZodE164",(e,t)=>{xD.init(e,t),Ge.init(e,t)}),SE=$("ZodJWT",(e,t)=>{DD.init(e,t),Ge.init(e,t)}),Gf=$("ZodNumber",(e,t)=>{Mf.init(e,t),it.init(e,t),e.gt=(n,o)=>e.check(Bf(n,o)),e.gte=(n,o)=>e.check(zs(n,o)),e.min=(n,o)=>e.check(zs(n,o)),e.lt=(n,o)=>e.check(Ff(n,o)),e.lte=(n,o)=>e.check(Ys(n,o)),e.max=(n,o)=>e.check(Ys(n,o)),e.int=n=>e.check(Kf(n)),e.safe=n=>e.check(Kf(n)),e.positive=n=>e.check(Bf(0,n)),e.nonnegative=n=>e.check(zs(0,n)),e.negative=n=>e.check(Ff(0,n)),e.nonpositive=n=>e.check(Ys(0,n)),e.multipleOf=(n,o)=>e.check(Wf(n,o)),e.step=(n,o)=>e.check(Wf(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function EE(e){return wS(Gf,e)}const CE=$("ZodNumberFormat",(e,t)=>{SD.init(e,t),Gf.init(e,t)});function Kf(e){return _S(CE,e)}const TE=$("ZodBoolean",(e,t)=>{ED.init(e,t),it.init(e,t)});function Fs(e){return xS(TE,e)}const ME=$("ZodUnknown",(e,t)=>{CD.init(e,t),it.init(e,t)});function Qf(){return kS(ME)}const OE=$("ZodNever",(e,t)=>{TD.init(e,t),it.init(e,t)});function PE(e){return DS(OE,e)}const AE=$("ZodArray",(e,t)=>{MD.init(e,t),it.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ni(r,n)),e.nonempty=r=>e.check(ni(1,r)),e.max=(r,n)=>e.check(Hf(r,n)),e.length=(r,n)=>e.check(Vf(r,n)),e.unwrap=()=>e.element});function IE(e,t){return RS(AE,e,t)}const NE=$("ZodObject",(e,t)=>{PD.init(e,t),it.init(e,t),Be(e,"shape",()=>t.shape),e.keyof=()=>zE(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qf()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qf()}),e.strict=()=>e.clone({...e._zod.def,catchall:PE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>qx(e,r),e.safeExtend=r=>Gx(e,r),e.merge=r=>Kx(e,r),e.pick=r=>Ux(e,r),e.omit=r=>Zx(e,r),e.partial=(...r)=>Qx(Xf,e,r[0]),e.required=(...r)=>Xx(tp,e,r[0])});function RE(e,t){const r={type:"object",get shape(){return Ir(this,"shape",e?Fx(e):{}),this.shape},...ce(t)};return new NE(r)}const $E=$("ZodUnion",(e,t)=>{AD.init(e,t),it.init(e,t),e.options=t.options});function LE(e,t){return new $E({type:"union",options:e,...ce(t)})}const jE=$("ZodIntersection",(e,t)=>{ID.init(e,t),it.init(e,t)});function YE(e,t){return new jE({type:"intersection",left:e,right:t})}const Bs=$("ZodEnum",(e,t)=>{ND.init(e,t),it.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const a={};for(const i of n)if(r.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Bs({...t,checks:[],...ce(o),entries:a})},e.exclude=(n,o)=>{const a={...t.entries};for(const i of n)if(r.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Bs({...t,checks:[],...ce(o),entries:a})}});function zE(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Bs({type:"enum",entries:r,...ce(t)})}const FE=$("ZodLiteral",(e,t)=>{RD.init(e,t),it.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function BE(e,t){return new FE({type:"literal",values:Array.isArray(e)?e:[e],...ce(t)})}const WE=$("ZodTransform",(e,t)=>{$D.init(e,t),it.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pf(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(xo(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(xo(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r)):(r.value=o,r)}});function HE(e){return new WE({type:"transform",transform:e})}const Xf=$("ZodOptional",(e,t)=>{LD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jf(e){return new Xf({type:"optional",innerType:e})}const VE=$("ZodNullable",(e,t)=>{jD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ep(e){return new VE({type:"nullable",innerType:e})}const UE=$("ZodDefault",(e,t)=>{YD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZE(e,t){return new UE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vf(t)}})}const qE=$("ZodPrefault",(e,t)=>{zD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function GE(e,t){return new qE({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vf(t)}})}const tp=$("ZodNonOptional",(e,t)=>{FD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function KE(e,t){return new tp({type:"nonoptional",innerType:e,...ce(t)})}const QE=$("ZodCatch",(e,t)=>{BD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XE(e,t){return new QE({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JE=$("ZodPipe",(e,t)=>{WD.init(e,t),it.init(e,t),e.in=t.in,e.out=t.out});function rp(e,t){return new JE({type:"pipe",in:e,out:t})}const eC=$("ZodReadonly",(e,t)=>{HD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tC(e){return new eC({type:"readonly",innerType:e})}const rC=$("ZodCustom",(e,t)=>{VD.init(e,t),it.init(e,t)});function nC(e,t={}){return $S(rC,e,t)}function oC(e){return LS(e)}const np=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,aC=RE({titulo:Jt().min(1,"El campo Título es requerido."),fechaInicio:Jt().min(1,"El campo fecha inicio es requerido."),horaInicio:Jt().min(1,"La hora de inicio es requerida.").regex(np,{message:"Formato inválido"}),horaFin:Jt().min(1,"La hora fin es requerida.").regex(np,{message:"Formato inválido"}),todoElDia:Fs(),fechaFin:Jt().optional(),showEndDate:Fs().optional(),horaInicio2:Jt().optional(),TodoElDia2:Fs().optional(),client:Jt().optional(),repetir:Jt().optional(),link:Jt().url("Debe ser una URL válida ejemplo https://www.google.com.").or(BE("")).optional(),descripcion:Jt().optional(),color:Jt().optional(),solID:EE().optional().nullable()}).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"]}),op=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.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"}),j.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"})),iC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#404756",clipPath:"url(#a)"},j.createElement("path",{d:"M7.288 22.986h-.147a6.2 6.2 0 0 1-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28 11a1.228 1.228 0 1 1 1.739 1.739L4.44 14.317c-1.356 1.357-1.282 3.626.16 5.068a3.82 3.82 0 0 0 2.602 1.135c.95 0 1.825-.32 2.479-.974l1.578-1.579a1.23 1.23 0 0 1 1.739 0c.48.481.48 1.258 0 1.739l-1.579 1.578c-1.097 1.098-2.552 1.69-4.13 1.69zM17.98 12.998a1.23 1.23 0 0 1 0-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78 3.78 0 0 0-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75 6.03c-.48.48-1.258.48-1.739 0a1.23 1.23 0 0 1 0-1.739l1.579-1.578c2.318-2.319 6.153-2.245 8.558.16a6.23 6.23 0 0 1 1.85 4.279 5.84 5.84 0 0 1-1.69 4.279l-1.578 1.578c-.481.481-1.258.481-1.74 0z"}),j.createElement("path",{d:"M14.172 8.11 8.07 14.214a1.233 1.233 0 0 0 1.743 1.744l6.104-6.104a1.233 1.233 0 1 0-1.744-1.744"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),sC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{clipPath:"url(#a)"},j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),cC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("path",{fill:"#404756",d:"M13.17 13.68c2.06 0 4 .8 5.46 2.27a7.7 7.7 0 0 1 2.26 5.47c0 .79-.64 1.43-1.43 1.43l.01-.01H4.53c-.79 0-1.43-.64-1.43-1.43 0-4.27 3.46-7.73 7.72-7.73zM12 1.9c2.82 0 5.11 2.29 5.11 5.11s-2.29 5.11-5.11 5.11v-.01c-2.82 0-5.11-2.29-5.11-5.11S9.18 1.9 12 1.9"})),lC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},j.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"}),j.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"}),j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),uC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#404756",clipPath:"url(#a)"},j.createElement("path",{d:"M13.789 17H3.21C2.542 17 2 17.56 2 18.25s.542 1.25 1.211 1.25H13.79c.669 0 1.211-.56 1.211-1.25S14.458 17 13.789 17M20.718 4H3.282C2.574 4 2 4.56 2 5.25S2.574 6.5 3.282 6.5h17.436C21.426 6.5 22 5.94 22 5.25S21.426 4 20.718 4M20.718 10.5H3.282C2.574 10.5 2 11.06 2 11.75S2.574 13 3.282 13h17.436c.708 0 1.282-.56 1.282-1.25s-.574-1.25-1.282-1.25"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),dC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.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"}),j.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"})),ap=Yr(w.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Ws=Yr(w.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"),fC={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:450},bgcolor:"background.paper",boxShadow:24,p:{xs:2,sm:3},borderRadius:2,maxHeight:"90vh",overflowY:"auto"},Hs=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],ip=(()=>{const e=[];for(let t=0;t<24;t++)for(let r=0;r<60;r+=15){const n=t.toString().padStart(2,"0"),o=r.toString().padStart(2,"0");e.push(`${n}:${o}`)}return e})(),pC=({isVisible:e,onClose:t,onSave:r,onDelete:n,selectedDate:o,initialEvent:a,clients:i,clientSolicitudes:s})=>{const[c,l]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(null),m=v.format(new Date,"yyyy-MM-dd"),{control:p,handleSubmit:g,reset:x,formState:{errors:_},watch:C,setValue:E}=Lx({resolver:FS(aC),defaultValues:{titulo:"",fechaInicio:v.format(new Date,"yyyy-MM-dd"),horaInicio:v.format(new Date,"HH:mm"),horaFin:v.format(v.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Hs[5],solID:null}}),S=C("fechaInicio"),P=C("fechaFin"),I=C("todoElDia");b.useEffect(()=>{if(S&&P){const L=new Date(S),F=new Date(P);(L===F||L>F)&&E("fechaFin",S)}},[S,P,E]),b.useEffect(()=>{E("showEndDate",c)},[c,E]),b.useEffect(()=>{if(a){const L=v.format(a.fechaInicio,"yyyy-MM-dd")===v.format(a.fechaFin,"yyyy-MM-dd");l(!L),E("titulo",a?.titulo),E("fechaInicio",v.format(a.fechaInicio,"yyyy-MM-dd")),E("fechaFin",v.format(a.fechaFin,"yyyy-MM-dd")),E("horaInicio",v.format(a.fechaInicio,"HH:mm")),E("horaFin",v.format(a.fechaFin,"HH:mm")),E("horaInicio2",v.format(a.fechaFin,"HH:mm")),E("descripcion",a.descripcion),E("link",a.link),E("repetir",a.repetir),E("color",a.color),E("todoElDia",a.todoElDia)}else{const L=o||new Date,F=new Date,y=new Date(L.getFullYear(),L.getMonth(),L.getDate(),F.getHours(),F.getMinutes()),O=v.addHours(y,1);x({titulo:"",fechaInicio:v.format(y,"yyyy-MM-dd"),horaInicio:v.format(y,"HH:mm"),fechaFin:v.format(O,"yyyy-MM-dd"),horaFin:v.format(O,"HH:mm"),horaInicio2:v.format(O,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Hs[5],solID:null}),l(!1)}},[a,e,o]);const K=g(L=>{r(L,a?.eventoID),t(),x(),l(!1)},L=>{console.log("Errores de validación:",L)});b.useEffect(()=>{I&&(E("horaInicio","00:00"),E("horaFin","23:59"))},[I,E,C]);const H=()=>{const L=C("fechaInicio");if(L){const F=new Date(`${L}T00:00:00`),y=v.addDays(F,1);E("fechaFin",v.format(y,"yyyy-MM-dd"))}l(!0)};return w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:fC,children:[w.jsx(U.IconButton,{"aria-label":"close",onClick:t,sx:{position:"absolute",right:8,top:12},children:w.jsx(Ws,{})}),w.jsx(U.Typography,{variant:"h6",mb:2,children:a?"Editar evento":"Agregar evento"}),w.jsxs(U.Grid,{container:!0,spacing:1,marginBottom:c?0:1,children:[w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"titulo",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!_.titulo,helperText:_.titulo?.message,sx:{"& .MuiInputLabel-root, & .MuiInputLabel-shrink":{color:"black"}}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"fechaInicio",control:p,render:({field:L})=>w.jsx(U.TextField,{fullWidth:!0,...L,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!_.fechaInicio,helperText:_.fechaInicio?.message})})}),c?w.jsxs(w.Fragment,{children:[w.jsx(U.Grid,{size:{xs:1,md:3},sx:{display:{xs:"none",sm:"block"}}}),w.jsx(U.Grid,{size:{xs:11,md:4},children:w.jsx(Qt,{name:"fechaFin",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,type:"date",placeholder:"Fecha de fin",fullWidth:!!c,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:S||m},error:!!_.fechaFin,helperText:_.fechaFin?.message})})}),!a&&w.jsx(U.Grid,{size:{xs:1,md:1},children:w.jsx(U.IconButton,{onClick:()=>l(!1),sx:{fontSize:18},children:w.jsx(op,{})})})]}):w.jsx(U.Grid,{size:{xs:12,md:7}})]}),c&&w.jsx(w.Fragment,{children:w.jsxs(U.Grid,{container:!0,spacing:0,sx:{margin:0,padding:0,width:"100%"},children:[w.jsx(U.Grid,{size:{xs:6,md:5}}),w.jsx(U.Grid,{size:{xs:12,md:6},sx:{margin:0,padding:0,width:"100%",display:{xs:"none",sm:"block"}},children:w.jsx(ap,{sx:{color:"#757575",margin:0,padding:0}})})]})}),w.jsxs(U.Grid,{container:!0,spacing:1,marginBottom:1,marginTop:1,children:[w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"horaInicio",control:p,render:({field:{onChange:L,value:F,...y}})=>w.jsx(U.Autocomplete,{freeSolo:!0,options:ip,value:F||"",onChange:(O,M)=>L(M||""),onInputChange:(O,M)=>L(M),renderInput:O=>w.jsx(U.TextField,{...O,...y,size:"small",error:!!_.horaInicio,helperText:_.horaInicio?.message,InputProps:{...O.InputProps,endAdornment:w.jsx(U.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:w.jsx(Yd,{})})}}),disabled:C("todoElDia")})})}),w.jsx(U.Grid,{size:{xs:1,md:1},sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:!c&&w.jsx(ap,{sx:{color:"#757575"}})}),c&&w.jsx(U.Grid,{size:{xs:2,md:2}}),w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"horaFin",control:p,render:({field:{onChange:L,value:F,...y}})=>w.jsx(U.Autocomplete,{freeSolo:!0,options:ip,value:F||"",onChange:(O,M)=>L(M||""),onInputChange:(O,M)=>L(M),renderInput:O=>w.jsx(U.TextField,{...O,...y,size:"small",error:!!_.horaFin,helperText:_.horaFin?.message,InputProps:{...O.InputProps,endAdornment:w.jsx(U.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:w.jsx(Yd,{})})}}),disabled:C("todoElDia")})})}),w.jsx(U.Grid,{size:{xs:12,md:3},hidden:c,children:w.jsx(Qt,{name:"todoElDia",control:p,render:({field:L})=>w.jsx(U.FormControlLabel,{control:w.jsx(U.Checkbox,{checked:L.value,onChange:F=>L.onChange(F.target.checked)}),label:w.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"})})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:!c&&w.jsx(w.Fragment,{children:w.jsxs(U.Button,{onClick:H,size:"small",sx:{textTransform:"none",fontSize:16},children:[w.jsx(lC,{})," Agregar fecha final"]})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:!u&&w.jsxs(U.Button,{onClick:()=>d(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[w.jsx(dC,{})," Vincular cliente"]})}),u&&w.jsxs(w.Fragment,{children:[w.jsx(U.Grid,{size:{xs:12,md:7},children:w.jsx(Qt,{name:"client",control:p,render:({field:L})=>w.jsx(U.Autocomplete,{...L,options:i,onChange:(F,y)=>{h(y),E("client",y||""),E("solID",void 0)},renderInput:F=>w.jsx(U.TextField,{...F,placeholder:"Buscar cliente...",variant:"outlined",size:"small",InputProps:{...F.InputProps,startAdornment:w.jsxs(w.Fragment,{children:[w.jsx(cC,{}),F.InputProps.startAdornment]})}})})})}),w.jsx(U.Grid,{size:{xs:11,md:4},children:w.jsx(Qt,{name:"solID",control:p,render:({field:L})=>w.jsx(U.Autocomplete,{options:f?s.get(f)||[]:[],getOptionLabel:F=>F.toString(),value:L.value??null,onChange:(F,y)=>L.onChange(y),renderInput:F=>w.jsx(U.TextField,{...F,label:"#Registro",variant:"outlined",size:"small"}),disabled:!f})})}),w.jsx(U.Grid,{size:{xs:1,md:1},children:w.jsx(U.IconButton,{onClick:()=>d(!1),sx:{fontSize:18},children:w.jsx(op,{})})})]}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"link",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!_.link,helperText:_.link?.message,InputProps:{startAdornment:w.jsx(iC,{})}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"descripcion",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,variant:"outlined",size:"small",InputProps:{startAdornment:w.jsx(uC,{style:{alignSelf:"flex-start",marginRight:"8px"}})}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsxs(U.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[w.jsx(sC,{}),Hs.map(L=>w.jsx(Qt,{name:"color",control:p,render:({field:F})=>w.jsx(U.IconButton,{onClick:()=>F.onChange(L),sx:{width:24,height:24,borderRadius:"50%",bgcolor:L,border:F.value===L?"2px solid":"none",borderColor:F.value===L?"primary.main":"transparent"}})},L))]})})]}),w.jsxs(U.Box,{sx:{display:"flex",justifyContent:"flex-end",mt:3,gap:2},children:[a&&w.jsx(U.Button,{onClick:n,variant:"outlined",color:"error",children:"Eliminar"}),w.jsx(U.Button,{onClick:t,variant:"outlined",sx:{textTransform:"none"},children:"Cancelar"}),w.jsx(U.Button,{onClick:K,variant:"contained",sx:{textTransform:"none"},children:"Guardar"})]})]})})},hC=Yr(w.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),mC={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2,textAlign:"center"},gC=({isOpen:e,onClose:t,onConfirm:r,title:n,message:o})=>w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:mC,children:[w.jsx(hC,{sx:{fontSize:60,color:"red"}}),w.jsx(U.Typography,{variant:"h6",component:"h2",sx:{mt:2},children:n}),w.jsx(U.Typography,{sx:{mt:2},children:o}),w.jsxs(U.Box,{sx:{mt:4,display:"flex",justifyContent:"center",gap:2},children:[w.jsx(U.Button,{variant:"outlined",onClick:t,sx:{textTransform:"none"},children:"Regresar"}),w.jsxs(U.Button,{variant:"contained",color:"error",onClick:r,sx:{textTransform:"none"},children:[w.jsx("span",{className:"icon-eliminar",children:" "})," Eliminar"]})]})]})}),yC={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2},vC=({isOpen:e,onClose:t,events:r,date:n,onEventClick:o})=>{if(!n)return null;const a=i=>{o(i),t()};return w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:yC,children:[w.jsxs(U.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[w.jsxs(U.Typography,{variant:"h6",component:"h2",children:["Eventos del ",n.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),w.jsx(U.IconButton,{onClick:t,children:w.jsx(Ws,{})})]}),w.jsx(U.Divider,{}),w.jsx(U.List,{children:r.map(i=>w.jsx(U.ListItem,{disablePadding:!0,children:w.jsxs(U.ListItemButton,{onClick:()=>a(i),sx:{py:.5},children:[w.jsx(U.Box,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:i.color||"#ccc",mr:2}}),w.jsx(U.ListItemText,{primary:i.titulo,secondary:`${v.format(i.fechaInicio,"HH:mm")} - ${v.format(i.fechaFin,"HH:mm")}`,sx:{my:0}})]})},i.eventoID))})]})})},bC=Yr(w.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"),wC=Yr(w.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"),_C=b.forwardRef(({id:e,message:t,variant:r},n)=>{const{closeSnackbar:o}=si.useSnackbar(),a={success:{color:"#fff",icon:w.jsx("span",{className:"icon-Check-ic",style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"16px",padding:3}})},error:{color:"#f44336",icon:w.jsx(bC,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:w.jsx(wC,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:w.jsx("span",{className:"icon-eliminar",style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})}},i=a[r]||a.info;return w.jsx(si.SnackbarContent,{ref:n,children:w.jsxs(U.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:[w.jsx(U.Box,{sx:{mr:1.5},children:i.icon}),w.jsx(U.Typography,{variant:"body2",sx:{flexGrow:1},children:t}),w.jsx(U.IconButton,{size:"small",onClick:()=>o(e),children:w.jsx(Ws,{fontSize:"small"})})]})})}),en=new vx,xC=({user:e,pass:t,masID:r})=>{const[n,o]=b.useState(new Date),[a,i]=b.useState([]),[s,c]=b.useState(!1),[l,u]=b.useState(null),[d,f]=b.useState(!1),[h,m]=b.useState(null),[p,g]=b.useState([]),[x,_]=b.useState(new Map),[C,E]=b.useState([]),[S]=b.useState(120),[P]=b.useState(179),{enqueueSnackbar:I}=si.useSnackbar(),[K,H]=b.useState(!1),[L,F]=b.useState([]),[y,O]=b.useState(null),M=(Z,oe)=>{F(Z),O(oe),H(!0)};b.useEffect(()=>{(async()=>{try{await en.login({usrMail:e,usrpass:t,masID:r});const oe=sessionStorage.getItem("usrID");if(oe){const ue=parseInt(oe,10),le=await en.getEventsByUser(ue);i(le)}}catch{console.log("No se pudieron cargar los eventos. Revisa la consola para más detalles.")}finally{console.log("Eventos han sido cargados")}})()},[n]),b.useEffect(()=>{const Z=new Date,oe=v.startOfDay(Z),ue=v.endOfDay(v.addDays(oe,6)),le={start:oe,end:ue},Le=a.filter(G=>{const ut={start:G.fechaInicio,end:G.fechaFin};return Wu(ut,le)}).sort((G,ut)=>G.fechaInicio.getTime()-ut.fechaInicio.getTime());E(Le)},[a]),b.useEffect(()=>{(async()=>{try{const oe=await en.getClients(),ue=new Set,le=new Map;oe.forEach(Le=>{ue.add(Le.nombreCliente),le.has(Le.nombreCliente)||le.set(Le.nombreCliente,[]),le.get(Le.nombreCliente).push(Le.solID)}),g(Array.from(ue)),_(le)}catch(oe){console.error("Failed to fetch clients",oe)}})()},[]);const B=async Z=>{try{const oe=await en.getEventById(Z.eventoID);u(oe),c(!0)}catch(oe){console.error(oe)}},z=()=>{c(!1),u(null)},ee=async(Z,oe)=>{let ue,le;Z.todoElDia?(ue=new Date(`${Z.fechaInicio}T${Z.horaInicio}`),le=new Date(`${Z.fechaInicio}T${Z.horaFin}`)):(ue=new Date(`${Z.fechaInicio}T${Z.horaInicio}`),le=Z.fechaFin&&Z.horaInicio2?new Date(`${Z.fechaFin}T${Z.horaInicio2}`):new Date(ue.getTime()+3600*1e3));const Le=v.format(ue,"yyyy-MM-dd HH:mm:ss.SSS"),G=v.format(le,"yyyy-MM-dd HH:mm:ss.SSS");if(oe){const Mt={...Z,eventoID:oe,fechaInicio:Le,fechaFin:G};try{const ht=await en.updateEvent(Mt);var ut=a.map(Ht=>Ht.eventoID===ht.eventoID?ht:Ht);i(ut),I("El evento se ha actualizado correctamente.",{variant:"success"}),z()}catch{I("Error al eliactualizar Evento",{variant:"error"})}}else{const Mt={...Z,fechaInicio:Le,fechaFin:G,todoElDia:Z.todoElDia};try{console.log("newEventData",Mt);const ht=await en.createEvent(Mt);console.log("createdEvent",ht),i(Ht=>[...Ht,ht]),I("El evento se ha creado con éxito",{variant:"success"}),z()}catch{I("Error al guardar Evento",{variant:"error"})}}},ne=()=>{o(Z=>new Date(Z.getFullYear(),Z.getMonth()-1,1))},xe=()=>{o(Z=>new Date(Z.getFullYear(),Z.getMonth()+1,1))},Y=()=>{f(!0)},q=()=>{m(new Date),c(!0)},ge=()=>alert("Sincronizar con Google Calendar"),he=()=>alert("Sincronizar con Outlook Calendar"),de=Z=>{Z&&o(Z)},ye=Z=>{m(Z),c(!0),u(null)},pe=async()=>{if(l)try{await en.deleteEvent(l.eventoID),i(a.filter(Z=>Z.eventoID!==l.eventoID)),I("El evento se ha eliminado de tu calendario",{content:(Z,oe)=>w.jsx(_C,{id:Z,message:String(oe),variant:"delete"})})}catch{I("Error al eliminar Evento",{variant:"error"})}finally{z(),f(!1)}};return w.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[w.jsx(Fg,{header:w.jsx(i_,{currentDate:n,onPrevMonth:ne,onNextMonth:xe,onAddEvent:q,onDateChange:de}),sidebar:w.jsx(B_,{onEventClick:B,upcomingEvents:C,onSyncGoogle:ge,onSyncOutlook:he,leads30Days:S,leads90Days:P}),mainContent:w.jsx(q_,{onSeeMoreClick:M,currentDate:n,events:a,onDayClick:ye,onEventClick:B})}),w.jsx(pC,{isVisible:s,onClose:z,onSave:ee,onDelete:Y,selectedDate:h,initialEvent:l,clients:p,clientSolicitudes:x}),w.jsx(gC,{isOpen:d,onClose:()=>f(!1),onConfirm:pe,title:"Eliminar evento",message:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer."}),w.jsx(vC,{isOpen:K,onClose:()=>H(!1),events:L,date:y,onEventClick:B})]})},kC={page:"_page_ok84c_1"},DC=()=>w.jsx("div",{className:kC.page,children:w.jsx("h1",{children:"Page Clientes"})});Pt.Clientes=DC,Pt.MyCalendar=xC,Object.defineProperty(Pt,Symbol.toStringTag,{value:"Module"})}));
|
|
175
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const _=h.compile();return(C,E)=>_(f,C,E)};let a;const i=Ua,s=!hf.jitless,l=s&&Bx.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=n.value);const m=f.value;return i(m)?s&&l&&h?.async===!1&&h.jitless!==!0?(a||(a=o(t.shape)),f=a(f,h),u?Af([],m,f,h,d,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function If(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!An(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>Jr(i,n,Xr())))}),t)}const AD=$("$ZodUnion",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Be(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Be(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Be(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Ns(a.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let i=!1;const s=[];for(const c of t.options){const l=c._zod.run({value:o.value,issues:[]},a);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(c=>If(c,o,e,a)):If(s,o,e,a)}}),ID=$("$ZodIntersection",(e,t)=>{Je.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,a=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,l])=>Nf(r,c,l)):Nf(r,a,i)}});function js(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_o(e)&&_o(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(const a of n){const i=js(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],a=t[n],i=js(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Nf(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),An(e))return e;const n=js(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const ND=$("$ZodEnum",(e,t)=>{Je.init(e,t);const r=Yx(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Wx.has(typeof o)).map(o=>typeof o=="string"?Pn(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),RD=$("$ZodLiteral",(e,t)=>{if(Je.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Pn(r):r?Pn(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),$D=$("$ZodTransform",(e,t)=>{Je.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pf(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Mn;return r.value=o,r}});function Rf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const LD=$("$ZodOptional",(e,t)=>{Je.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Rf(a,r.value)):Rf(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),jD=$("$ZodNullable",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)}|null)$`):void 0}),Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),YD=$("$ZodDefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>$f(a,t)):$f(o,t)}});function $f(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zD=$("$ZodPrefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),FD=$("$ZodNonOptional",(e,t)=>{Je.init(e,t),Be(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Lf(a,e)):Lf(o,e)}});function Lf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const BD=$("$ZodCatch",(e,t)=>{Je.init(e,t),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>Jr(i,n,Xr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Jr(a,n,Xr()))},input:r.value}),r.issues=[]),r)}}),WD=$("$ZodPipe",(e,t)=>{Je.init(e,t),Be(e._zod,"values",()=>t.in._zod.values),Be(e._zod,"optin",()=>t.in._zod.optin),Be(e._zod,"optout",()=>t.out._zod.optout),Be(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>ti(i,t.in,n)):ti(a,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>ti(a,t.out,n)):ti(o,t.out,n)}});function ti(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const HD=$("$ZodReadonly",(e,t)=>{Je.init(e,t),Be(e._zod,"propValues",()=>t.innerType._zod.propValues),Be(e._zod,"values",()=>t.innerType._zod.values),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(jf):jf(o)}});function jf(e){return e.value=Object.freeze(e.value),e}const VD=$("$ZodCustom",(e,t)=>{Tt.init(e,t),Je.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>Yf(a,r,n,e));Yf(o,r,n,e)}});function Yf(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(xo(o))}}class UD{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,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,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ZD(){return new UD}const ri=ZD();function qD(e,t){return new e({type:"string",...ce(t)})}function GD(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function zf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function KD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function QD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function XD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function JD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function eS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function tS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function rS(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function nS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function oS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function aS(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function iS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function sS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function cS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function lS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function uS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function dS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function fS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function pS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function hS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function mS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}function gS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function yS(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function vS(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function bS(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function wS(e,t){return new e({type:"number",checks:[],...ce(t)})}function _S(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function xS(e,t){return new e({type:"boolean",...ce(t)})}function kS(e){return new e({type:"unknown"})}function DS(e,t){return new e({type:"never",...ce(t)})}function Ff(e,t){return new Ef({check:"less_than",...ce(t),value:e,inclusive:!1})}function Ys(e,t){return new Ef({check:"less_than",...ce(t),value:e,inclusive:!0})}function Bf(e,t){return new Cf({check:"greater_than",...ce(t),value:e,inclusive:!1})}function zs(e,t){return new Cf({check:"greater_than",...ce(t),value:e,inclusive:!0})}function Wf(e,t){return new zk({check:"multiple_of",...ce(t),value:e})}function Hf(e,t){return new Bk({check:"max_length",...ce(t),maximum:e})}function ni(e,t){return new Wk({check:"min_length",...ce(t),minimum:e})}function Vf(e,t){return new Hk({check:"length_equals",...ce(t),length:e})}function SS(e,t){return new Vk({check:"string_format",format:"regex",...ce(t),pattern:e})}function ES(e){return new Uk({check:"string_format",format:"lowercase",...ce(e)})}function CS(e){return new Zk({check:"string_format",format:"uppercase",...ce(e)})}function TS(e,t){return new qk({check:"string_format",format:"includes",...ce(t),includes:e})}function MS(e,t){return new Gk({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function OS(e,t){return new Kk({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function ko(e){return new Qk({check:"overwrite",tx:e})}function PS(e){return ko(t=>t.normalize(e))}function AS(){return ko(e=>e.trim())}function IS(){return ko(e=>e.toLowerCase())}function NS(){return ko(e=>e.toUpperCase())}function RS(e,t,r){return new e({type:"array",element:t,...ce(r)})}function $S(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function LS(e){const t=jS(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(xo(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(xo(o))}},e(r.value,r)));return t}function jS(e,t){const r=new Tt({check:"custom",...ce(t)});return r._zod.check=e,r}function Uf(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function YS(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Es(i,t,r,o,l?[].concat(l,n.message):n.message)}e.shift()}return r}function zS(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var s=n.errors[0][0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(u){return u.forEach(function(d){return e.push(d)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Es(i,t,r,o,l?[].concat(l,n.message):n.message)}e.shift()}return r}function FS(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,a){try{return Promise.resolve(Uf(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return a.shouldUseNativeValidation&&Os({},a),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(s){return Array.isArray(s?.issues)})(i))return{values:{},errors:df(YS(i.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,a){try{return Promise.resolve(Uf(function(){return Promise.resolve((r.mode==="sync"?tk:rk)(e,n,t)).then(function(i){return a.shouldUseNativeValidation&&Os({},a),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(s){return s instanceof $s})(i))return{values:{},errors:df(zS(i.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const BS=$("ZodISODateTime",(e,t)=>{dD.init(e,t),Ge.init(e,t)});function WS(e){return gS(BS,e)}const HS=$("ZodISODate",(e,t)=>{fD.init(e,t),Ge.init(e,t)});function VS(e){return yS(HS,e)}const US=$("ZodISOTime",(e,t)=>{pD.init(e,t),Ge.init(e,t)});function ZS(e){return vS(US,e)}const qS=$("ZodISODuration",(e,t)=>{hD.init(e,t),Ge.init(e,t)});function GS(e){return bS(qS,e)}const Wt=$("ZodError",(e,t)=>{$s.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ek(e,r)},flatten:{value:r=>Jx(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ps,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ps,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),KS=Ga(Wt),QS=Ka(Wt),XS=Qa(Wt),JS=Xa(Wt),eE=ak(Wt),tE=ik(Wt),rE=sk(Wt),nE=ck(Wt),oE=lk(Wt),aE=uk(Wt),iE=dk(Wt),sE=fk(Wt),it=$("ZodType",(e,t)=>(Je.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>Nr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>KS(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>XS(e,r,n),e.parseAsync=async(r,n)=>QS(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>JS(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>eE(e,r,n),e.decode=(r,n)=>tE(e,r,n),e.encodeAsync=async(r,n)=>rE(e,r,n),e.decodeAsync=async(r,n)=>nE(e,r,n),e.safeEncode=(r,n)=>oE(e,r,n),e.safeDecode=(r,n)=>aE(e,r,n),e.safeEncodeAsync=async(r,n)=>iE(e,r,n),e.safeDecodeAsync=async(r,n)=>sE(e,r,n),e.refine=(r,n)=>e.check(nC(r,n)),e.superRefine=r=>e.check(oC(r)),e.overwrite=r=>e.check(ko(r)),e.optional=()=>Jf(e),e.nullable=()=>ep(e),e.nullish=()=>Jf(ep(e)),e.nonoptional=r=>KE(e,r),e.array=()=>IE(e),e.or=r=>LE([e,r]),e.and=r=>YE(e,r),e.transform=r=>rp(e,HE(r)),e.default=r=>ZE(e,r),e.prefault=r=>GE(e,r),e.catch=r=>XE(e,r),e.pipe=r=>rp(e,r),e.readonly=()=>tC(e),e.describe=r=>{const n=e.clone();return ri.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ri.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ri.get(e);const n=e.clone();return ri.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zf=$("_ZodString",(e,t)=>{Ls.init(e,t),it.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(SS(...n)),e.includes=(...n)=>e.check(TS(...n)),e.startsWith=(...n)=>e.check(MS(...n)),e.endsWith=(...n)=>e.check(OS(...n)),e.min=(...n)=>e.check(ni(...n)),e.max=(...n)=>e.check(Hf(...n)),e.length=(...n)=>e.check(Vf(...n)),e.nonempty=(...n)=>e.check(ni(1,...n)),e.lowercase=n=>e.check(ES(n)),e.uppercase=n=>e.check(CS(n)),e.trim=()=>e.check(AS()),e.normalize=(...n)=>e.check(PS(...n)),e.toLowerCase=()=>e.check(IS()),e.toUpperCase=()=>e.check(NS())}),cE=$("ZodString",(e,t)=>{Ls.init(e,t),Zf.init(e,t),e.email=r=>e.check(GD(lE,r)),e.url=r=>e.check(eS(uE,r)),e.jwt=r=>e.check(mS(SE,r)),e.emoji=r=>e.check(tS(dE,r)),e.guid=r=>e.check(zf(qf,r)),e.uuid=r=>e.check(KD(oi,r)),e.uuidv4=r=>e.check(QD(oi,r)),e.uuidv6=r=>e.check(XD(oi,r)),e.uuidv7=r=>e.check(JD(oi,r)),e.nanoid=r=>e.check(rS(fE,r)),e.guid=r=>e.check(zf(qf,r)),e.cuid=r=>e.check(nS(pE,r)),e.cuid2=r=>e.check(oS(hE,r)),e.ulid=r=>e.check(aS(mE,r)),e.base64=r=>e.check(fS(xE,r)),e.base64url=r=>e.check(pS(kE,r)),e.xid=r=>e.check(iS(gE,r)),e.ksuid=r=>e.check(sS(yE,r)),e.ipv4=r=>e.check(cS(vE,r)),e.ipv6=r=>e.check(lS(bE,r)),e.cidrv4=r=>e.check(uS(wE,r)),e.cidrv6=r=>e.check(dS(_E,r)),e.e164=r=>e.check(hS(DE,r)),e.datetime=r=>e.check(WS(r)),e.date=r=>e.check(VS(r)),e.time=r=>e.check(ZS(r)),e.duration=r=>e.check(GS(r))});function Jt(e){return qD(cE,e)}const Ge=$("ZodStringFormat",(e,t)=>{Ze.init(e,t),Zf.init(e,t)}),lE=$("ZodEmail",(e,t)=>{rD.init(e,t),Ge.init(e,t)}),qf=$("ZodGUID",(e,t)=>{eD.init(e,t),Ge.init(e,t)}),oi=$("ZodUUID",(e,t)=>{tD.init(e,t),Ge.init(e,t)}),uE=$("ZodURL",(e,t)=>{nD.init(e,t),Ge.init(e,t)}),dE=$("ZodEmoji",(e,t)=>{oD.init(e,t),Ge.init(e,t)}),fE=$("ZodNanoID",(e,t)=>{aD.init(e,t),Ge.init(e,t)}),pE=$("ZodCUID",(e,t)=>{iD.init(e,t),Ge.init(e,t)}),hE=$("ZodCUID2",(e,t)=>{sD.init(e,t),Ge.init(e,t)}),mE=$("ZodULID",(e,t)=>{cD.init(e,t),Ge.init(e,t)}),gE=$("ZodXID",(e,t)=>{lD.init(e,t),Ge.init(e,t)}),yE=$("ZodKSUID",(e,t)=>{uD.init(e,t),Ge.init(e,t)}),vE=$("ZodIPv4",(e,t)=>{mD.init(e,t),Ge.init(e,t)}),bE=$("ZodIPv6",(e,t)=>{gD.init(e,t),Ge.init(e,t)}),wE=$("ZodCIDRv4",(e,t)=>{yD.init(e,t),Ge.init(e,t)}),_E=$("ZodCIDRv6",(e,t)=>{vD.init(e,t),Ge.init(e,t)}),xE=$("ZodBase64",(e,t)=>{bD.init(e,t),Ge.init(e,t)}),kE=$("ZodBase64URL",(e,t)=>{_D.init(e,t),Ge.init(e,t)}),DE=$("ZodE164",(e,t)=>{xD.init(e,t),Ge.init(e,t)}),SE=$("ZodJWT",(e,t)=>{DD.init(e,t),Ge.init(e,t)}),Gf=$("ZodNumber",(e,t)=>{Mf.init(e,t),it.init(e,t),e.gt=(n,o)=>e.check(Bf(n,o)),e.gte=(n,o)=>e.check(zs(n,o)),e.min=(n,o)=>e.check(zs(n,o)),e.lt=(n,o)=>e.check(Ff(n,o)),e.lte=(n,o)=>e.check(Ys(n,o)),e.max=(n,o)=>e.check(Ys(n,o)),e.int=n=>e.check(Kf(n)),e.safe=n=>e.check(Kf(n)),e.positive=n=>e.check(Bf(0,n)),e.nonnegative=n=>e.check(zs(0,n)),e.negative=n=>e.check(Ff(0,n)),e.nonpositive=n=>e.check(Ys(0,n)),e.multipleOf=(n,o)=>e.check(Wf(n,o)),e.step=(n,o)=>e.check(Wf(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function EE(e){return wS(Gf,e)}const CE=$("ZodNumberFormat",(e,t)=>{SD.init(e,t),Gf.init(e,t)});function Kf(e){return _S(CE,e)}const TE=$("ZodBoolean",(e,t)=>{ED.init(e,t),it.init(e,t)});function Fs(e){return xS(TE,e)}const ME=$("ZodUnknown",(e,t)=>{CD.init(e,t),it.init(e,t)});function Qf(){return kS(ME)}const OE=$("ZodNever",(e,t)=>{TD.init(e,t),it.init(e,t)});function PE(e){return DS(OE,e)}const AE=$("ZodArray",(e,t)=>{MD.init(e,t),it.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ni(r,n)),e.nonempty=r=>e.check(ni(1,r)),e.max=(r,n)=>e.check(Hf(r,n)),e.length=(r,n)=>e.check(Vf(r,n)),e.unwrap=()=>e.element});function IE(e,t){return RS(AE,e,t)}const NE=$("ZodObject",(e,t)=>{PD.init(e,t),it.init(e,t),Be(e,"shape",()=>t.shape),e.keyof=()=>zE(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qf()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qf()}),e.strict=()=>e.clone({...e._zod.def,catchall:PE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>qx(e,r),e.safeExtend=r=>Gx(e,r),e.merge=r=>Kx(e,r),e.pick=r=>Ux(e,r),e.omit=r=>Zx(e,r),e.partial=(...r)=>Qx(Xf,e,r[0]),e.required=(...r)=>Xx(tp,e,r[0])});function RE(e,t){const r={type:"object",get shape(){return Ir(this,"shape",e?Fx(e):{}),this.shape},...ce(t)};return new NE(r)}const $E=$("ZodUnion",(e,t)=>{AD.init(e,t),it.init(e,t),e.options=t.options});function LE(e,t){return new $E({type:"union",options:e,...ce(t)})}const jE=$("ZodIntersection",(e,t)=>{ID.init(e,t),it.init(e,t)});function YE(e,t){return new jE({type:"intersection",left:e,right:t})}const Bs=$("ZodEnum",(e,t)=>{ND.init(e,t),it.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const a={};for(const i of n)if(r.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Bs({...t,checks:[],...ce(o),entries:a})},e.exclude=(n,o)=>{const a={...t.entries};for(const i of n)if(r.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Bs({...t,checks:[],...ce(o),entries:a})}});function zE(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Bs({type:"enum",entries:r,...ce(t)})}const FE=$("ZodLiteral",(e,t)=>{RD.init(e,t),it.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function BE(e,t){return new FE({type:"literal",values:Array.isArray(e)?e:[e],...ce(t)})}const WE=$("ZodTransform",(e,t)=>{$D.init(e,t),it.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pf(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(xo(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(xo(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r)):(r.value=o,r)}});function HE(e){return new WE({type:"transform",transform:e})}const Xf=$("ZodOptional",(e,t)=>{LD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jf(e){return new Xf({type:"optional",innerType:e})}const VE=$("ZodNullable",(e,t)=>{jD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ep(e){return new VE({type:"nullable",innerType:e})}const UE=$("ZodDefault",(e,t)=>{YD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZE(e,t){return new UE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vf(t)}})}const qE=$("ZodPrefault",(e,t)=>{zD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function GE(e,t){return new qE({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vf(t)}})}const tp=$("ZodNonOptional",(e,t)=>{FD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function KE(e,t){return new tp({type:"nonoptional",innerType:e,...ce(t)})}const QE=$("ZodCatch",(e,t)=>{BD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XE(e,t){return new QE({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JE=$("ZodPipe",(e,t)=>{WD.init(e,t),it.init(e,t),e.in=t.in,e.out=t.out});function rp(e,t){return new JE({type:"pipe",in:e,out:t})}const eC=$("ZodReadonly",(e,t)=>{HD.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tC(e){return new eC({type:"readonly",innerType:e})}const rC=$("ZodCustom",(e,t)=>{VD.init(e,t),it.init(e,t)});function nC(e,t={}){return $S(rC,e,t)}function oC(e){return LS(e)}const np=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,aC=RE({titulo:Jt().min(1,"El campo Título es requerido."),fechaInicio:Jt().min(1,"El campo fecha inicio es requerido."),horaInicio:Jt().min(1,"La hora de inicio es requerida.").regex(np,{message:"Formato inválido"}),horaFin:Jt().min(1,"La hora fin es requerida.").regex(np,{message:"Formato inválido"}),todoElDia:Fs(),fechaFin:Jt().optional(),showEndDate:Fs().optional(),horaInicio2:Jt().optional(),TodoElDia2:Fs().optional(),client:Jt().optional(),repetir:Jt().optional(),link:Jt().url("Debe ser una URL válida ejemplo https://www.google.com.").or(BE("")).optional(),descripcion:Jt().optional(),color:Jt().optional(),solID:EE().optional().nullable()}).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"]}),op=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.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"}),j.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"})),iC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#404756",clipPath:"url(#a)"},j.createElement("path",{d:"M7.288 22.986h-.147a6.2 6.2 0 0 1-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28 11a1.228 1.228 0 1 1 1.739 1.739L4.44 14.317c-1.356 1.357-1.282 3.626.16 5.068a3.82 3.82 0 0 0 2.602 1.135c.95 0 1.825-.32 2.479-.974l1.578-1.579a1.23 1.23 0 0 1 1.739 0c.48.481.48 1.258 0 1.739l-1.579 1.578c-1.097 1.098-2.552 1.69-4.13 1.69zM17.98 12.998a1.23 1.23 0 0 1 0-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78 3.78 0 0 0-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75 6.03c-.48.48-1.258.48-1.739 0a1.23 1.23 0 0 1 0-1.739l1.579-1.578c2.318-2.319 6.153-2.245 8.558.16a6.23 6.23 0 0 1 1.85 4.279 5.84 5.84 0 0 1-1.69 4.279l-1.578 1.578c-.481.481-1.258.481-1.74 0z"}),j.createElement("path",{d:"M14.172 8.11 8.07 14.214a1.233 1.233 0 0 0 1.743 1.744l6.104-6.104a1.233 1.233 0 1 0-1.744-1.744"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),sC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{clipPath:"url(#a)"},j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),cC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("path",{fill:"#404756",d:"M13.17 13.68c2.06 0 4 .8 5.46 2.27a7.7 7.7 0 0 1 2.26 5.47c0 .79-.64 1.43-1.43 1.43l.01-.01H4.53c-.79 0-1.43-.64-1.43-1.43 0-4.27 3.46-7.73 7.72-7.73zM12 1.9c2.82 0 5.11 2.29 5.11 5.11s-2.29 5.11-5.11 5.11v-.01c-2.82 0-5.11-2.29-5.11-5.11S9.18 1.9 12 1.9"})),lC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},j.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"}),j.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"}),j.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"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),uC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.createElement("g",{fill:"#404756",clipPath:"url(#a)"},j.createElement("path",{d:"M13.789 17H3.21C2.542 17 2 17.56 2 18.25s.542 1.25 1.211 1.25H13.79c.669 0 1.211-.56 1.211-1.25S14.458 17 13.789 17M20.718 4H3.282C2.574 4 2 4.56 2 5.25S2.574 6.5 3.282 6.5h17.436C21.426 6.5 22 5.94 22 5.25S21.426 4 20.718 4M20.718 10.5H3.282C2.574 10.5 2 11.06 2 11.75S2.574 13 3.282 13h17.436c.708 0 1.282-.56 1.282-1.25s-.574-1.25-1.282-1.25"})),j.createElement("defs",null,j.createElement("clipPath",{id:"a"},j.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),dC=e=>j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},j.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"}),j.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"})),ap=Yr(w.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Ws=Yr(w.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"),fC={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"},Hs=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],ip=(()=>{const e=[];for(let t=0;t<24;t++)for(let r=0;r<60;r+=15){const n=t.toString().padStart(2,"0"),o=r.toString().padStart(2,"0");e.push(`${n}:${o}`)}return e})(),pC=({isVisible:e,onClose:t,onSave:r,onDelete:n,selectedDate:o,initialEvent:a,clients:i,clientSolicitudes:s})=>{const[c,l]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(null),m=v.format(new Date,"yyyy-MM-dd"),{control:p,handleSubmit:g,reset:x,formState:{errors:_},watch:C,setValue:E}=Lx({resolver:FS(aC),defaultValues:{titulo:"",fechaInicio:v.format(new Date,"yyyy-MM-dd"),horaInicio:v.format(new Date,"HH:mm"),horaFin:v.format(v.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Hs[5],solID:null}}),S=C("fechaInicio"),P=C("fechaFin"),I=C("todoElDia");b.useEffect(()=>{if(S&&P){const L=new Date(S),F=new Date(P);(L===F||L>F)&&E("fechaFin",S)}},[S,P,E]),b.useEffect(()=>{E("showEndDate",c)},[c,E]),b.useEffect(()=>{if(a){const L=v.format(a.fechaInicio,"yyyy-MM-dd")===v.format(a.fechaFin,"yyyy-MM-dd");l(!L),E("titulo",a?.titulo),E("fechaInicio",v.format(a.fechaInicio,"yyyy-MM-dd")),E("fechaFin",v.format(a.fechaFin,"yyyy-MM-dd")),E("horaInicio",v.format(a.fechaInicio,"HH:mm")),E("horaFin",v.format(a.fechaFin,"HH:mm")),E("horaInicio2",v.format(a.fechaFin,"HH:mm")),E("descripcion",a.descripcion),E("link",a.link),E("repetir",a.repetir),E("color",a.color),E("todoElDia",a.todoElDia)}else{const L=o||new Date,F=new Date,y=new Date(L.getFullYear(),L.getMonth(),L.getDate(),F.getHours(),F.getMinutes()),O=v.addHours(y,1);x({titulo:"",fechaInicio:v.format(y,"yyyy-MM-dd"),horaInicio:v.format(y,"HH:mm"),fechaFin:v.format(O,"yyyy-MM-dd"),horaFin:v.format(O,"HH:mm"),horaInicio2:v.format(O,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Hs[5],solID:null}),l(!1)}},[a,e,o]);const K=g(L=>{r(L,a?.eventoID),t(),x(),l(!1)},L=>{console.log("Errores de validación:",L)});b.useEffect(()=>{I&&(E("horaInicio","00:00"),E("horaFin","23:59"))},[I,E,C]);const H=()=>{const L=C("fechaInicio");if(L){const F=new Date(`${L}T00:00:00`),y=v.addDays(F,1);E("fechaFin",v.format(y,"yyyy-MM-dd"))}l(!0)};return w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:fC,children:[w.jsx(U.IconButton,{"aria-label":"close",onClick:t,sx:{position:"absolute",right:8,top:12},children:w.jsx(Ws,{})}),w.jsx(U.Typography,{variant:"h6",mb:2,children:a?"Editar evento":"Agregar evento"}),w.jsxs(U.Grid,{container:!0,spacing:1,marginBottom:c?0:1,children:[w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"titulo",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!_.titulo,helperText:_.titulo?.message,sx:{"& .MuiInputLabel-root, & .MuiInputLabel-shrink":{color:"black"}}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"fechaInicio",control:p,render:({field:L})=>w.jsx(U.TextField,{fullWidth:!0,...L,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!_.fechaInicio,helperText:_.fechaInicio?.message})})}),c?w.jsxs(w.Fragment,{children:[w.jsx(U.Grid,{size:{xs:1,md:3},sx:{display:{xs:"none",sm:"block"}}}),w.jsx(U.Grid,{size:{xs:11,md:4},children:w.jsx(Qt,{name:"fechaFin",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,type:"date",placeholder:"Fecha de fin",fullWidth:!!c,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:S||m},error:!!_.fechaFin,helperText:_.fechaFin?.message})})}),!a&&w.jsx(U.Grid,{size:{xs:1,md:1},children:w.jsx(U.IconButton,{onClick:()=>l(!1),sx:{fontSize:18},children:w.jsx(op,{})})})]}):w.jsx(U.Grid,{size:{xs:12,md:7}})]}),c&&w.jsx(w.Fragment,{children:w.jsxs(U.Grid,{container:!0,spacing:0,sx:{margin:0,padding:0,width:"100%"},children:[w.jsx(U.Grid,{size:{xs:6,md:5}}),w.jsx(U.Grid,{size:{xs:12,md:6},sx:{margin:0,padding:0,width:"100%",display:{xs:"none",sm:"block"}},children:w.jsx(ap,{sx:{color:"#757575",margin:0,padding:0}})})]})}),w.jsxs(U.Grid,{container:!0,spacing:1,marginBottom:1,marginTop:1,children:[w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"horaInicio",control:p,render:({field:{onChange:L,value:F,...y}})=>w.jsx(U.Autocomplete,{freeSolo:!0,options:ip,value:F||"",onChange:(O,M)=>L(M||""),onInputChange:(O,M)=>L(M),renderInput:O=>w.jsx(U.TextField,{...O,...y,size:"small",error:!!_.horaInicio,helperText:_.horaInicio?.message,InputProps:{...O.InputProps,endAdornment:w.jsx(U.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:w.jsx(Yd,{})})}}),disabled:C("todoElDia")})})}),w.jsx(U.Grid,{size:{xs:1,md:1},sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:!c&&w.jsx(ap,{sx:{color:"#757575"}})}),c&&w.jsx(U.Grid,{size:{xs:2,md:2}}),w.jsx(U.Grid,{size:{xs:12,md:4},children:w.jsx(Qt,{name:"horaFin",control:p,render:({field:{onChange:L,value:F,...y}})=>w.jsx(U.Autocomplete,{freeSolo:!0,options:ip,value:F||"",onChange:(O,M)=>L(M||""),onInputChange:(O,M)=>L(M),renderInput:O=>w.jsx(U.TextField,{...O,...y,size:"small",error:!!_.horaFin,helperText:_.horaFin?.message,InputProps:{...O.InputProps,endAdornment:w.jsx(U.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:w.jsx(Yd,{})})}}),disabled:C("todoElDia")})})}),w.jsx(U.Grid,{size:{xs:12,md:3},hidden:c,children:w.jsx(Qt,{name:"todoElDia",control:p,render:({field:L})=>w.jsx(U.FormControlLabel,{control:w.jsx(U.Checkbox,{checked:L.value,onChange:F=>L.onChange(F.target.checked)}),label:w.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"}),sx:{whiteSpace:"nowrap"}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:!c&&w.jsx(w.Fragment,{children:w.jsxs(U.Button,{onClick:H,size:"small",sx:{textTransform:"none",fontSize:16},children:[w.jsx(lC,{})," Agregar fecha final"]})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:!u&&w.jsxs(U.Button,{onClick:()=>d(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[w.jsx(dC,{})," Vincular cliente"]})}),u&&w.jsxs(w.Fragment,{children:[w.jsx(U.Grid,{size:{xs:12,md:7},children:w.jsx(Qt,{name:"client",control:p,render:({field:L})=>w.jsx(U.Autocomplete,{...L,options:i,onChange:(F,y)=>{h(y),E("client",y||""),E("solID",void 0)},renderInput:F=>w.jsx(U.TextField,{...F,placeholder:"Buscar cliente...",variant:"outlined",size:"small",InputProps:{...F.InputProps,startAdornment:w.jsxs(w.Fragment,{children:[w.jsx(cC,{}),F.InputProps.startAdornment]})}})})})}),w.jsx(U.Grid,{size:{xs:11,md:4},children:w.jsx(Qt,{name:"solID",control:p,render:({field:L})=>w.jsx(U.Autocomplete,{options:f?s.get(f)||[]:[],getOptionLabel:F=>F.toString(),value:L.value??null,onChange:(F,y)=>L.onChange(y),renderInput:F=>w.jsx(U.TextField,{...F,label:"#Registro",variant:"outlined",size:"small"}),disabled:!f})})}),w.jsx(U.Grid,{size:{xs:1,md:1},children:w.jsx(U.IconButton,{onClick:()=>d(!1),sx:{fontSize:18},children:w.jsx(op,{})})})]}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(U.Divider,{})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"link",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!_.link,helperText:_.link?.message,InputProps:{startAdornment:w.jsx(iC,{})}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsx(Qt,{name:"descripcion",control:p,render:({field:L})=>w.jsx(U.TextField,{...L,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,variant:"outlined",size:"small",InputProps:{startAdornment:w.jsx(uC,{style:{alignSelf:"flex-start",marginRight:"8px"}})}})})}),w.jsx(U.Grid,{size:{xs:12,md:12},children:w.jsxs(U.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[w.jsx(sC,{}),Hs.map(L=>w.jsx(Qt,{name:"color",control:p,render:({field:F})=>w.jsx(U.IconButton,{onClick:()=>F.onChange(L),sx:{width:24,height:24,borderRadius:"50%",bgcolor:L,border:F.value===L?"2px solid":"none",borderColor:F.value===L?"primary.main":"transparent"}})},L))]})})]}),w.jsxs(U.Box,{sx:{display:"flex",justifyContent:"flex-end",mt:3,gap:2},children:[a&&w.jsx(U.Button,{onClick:n,variant:"outlined",color:"error",children:"Eliminar"}),w.jsx(U.Button,{onClick:t,variant:"outlined",sx:{textTransform:"none"},children:"Cancelar"}),w.jsx(U.Button,{onClick:K,variant:"contained",sx:{textTransform:"none"},children:"Guardar"})]})]})})},hC=Yr(w.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),mC={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2,textAlign:"center"},gC=({isOpen:e,onClose:t,onConfirm:r,title:n,message:o})=>w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:mC,children:[w.jsx(hC,{sx:{fontSize:60,color:"red"}}),w.jsx(U.Typography,{variant:"h6",component:"h2",sx:{mt:2},children:n}),w.jsx(U.Typography,{sx:{mt:2},children:o}),w.jsxs(U.Box,{sx:{mt:4,display:"flex",justifyContent:"center",gap:2},children:[w.jsx(U.Button,{variant:"outlined",onClick:t,sx:{textTransform:"none"},children:"Regresar"}),w.jsxs(U.Button,{variant:"contained",color:"error",onClick:r,sx:{textTransform:"none"},children:[w.jsx("span",{className:"icon-eliminar",children:" "})," Eliminar"]})]})]})}),yC={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2},vC=({isOpen:e,onClose:t,events:r,date:n,onEventClick:o})=>{if(!n)return null;const a=i=>{o(i),t()};return w.jsx(U.Modal,{open:e,onClose:t,children:w.jsxs(U.Box,{sx:yC,children:[w.jsxs(U.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[w.jsxs(U.Typography,{variant:"h6",component:"h2",children:["Eventos del ",n.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),w.jsx(U.IconButton,{onClick:t,children:w.jsx(Ws,{})})]}),w.jsx(U.Divider,{}),w.jsx(U.List,{children:r.map(i=>w.jsx(U.ListItem,{disablePadding:!0,children:w.jsxs(U.ListItemButton,{onClick:()=>a(i),sx:{py:.5},children:[w.jsx(U.Box,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:i.color||"#ccc",mr:2}}),w.jsx(U.ListItemText,{primary:i.titulo,secondary:`${v.format(i.fechaInicio,"HH:mm")} - ${v.format(i.fechaFin,"HH:mm")}`,sx:{my:0}})]})},i.eventoID))})]})})},bC=Yr(w.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"),wC=Yr(w.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"),_C=b.forwardRef(({id:e,message:t,variant:r},n)=>{const{closeSnackbar:o}=si.useSnackbar(),a={success:{color:"#fff",icon:w.jsx("span",{className:"icon-Check-ic",style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"16px",padding:3}})},error:{color:"#f44336",icon:w.jsx(bC,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:w.jsx(wC,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:w.jsx("span",{className:"icon-eliminar",style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})}},i=a[r]||a.info;return w.jsx(si.SnackbarContent,{ref:n,children:w.jsxs(U.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:[w.jsx(U.Box,{sx:{mr:1.5},children:i.icon}),w.jsx(U.Typography,{variant:"body2",sx:{flexGrow:1},children:t}),w.jsx(U.IconButton,{size:"small",onClick:()=>o(e),children:w.jsx(Ws,{fontSize:"small"})})]})})}),en=new vx,xC=({user:e,pass:t,masID:r})=>{const[n,o]=b.useState(new Date),[a,i]=b.useState([]),[s,c]=b.useState(!1),[l,u]=b.useState(null),[d,f]=b.useState(!1),[h,m]=b.useState(null),[p,g]=b.useState([]),[x,_]=b.useState(new Map),[C,E]=b.useState([]),[S]=b.useState(120),[P]=b.useState(179),{enqueueSnackbar:I}=si.useSnackbar(),[K,H]=b.useState(!1),[L,F]=b.useState([]),[y,O]=b.useState(null),M=(Z,oe)=>{F(Z),O(oe),H(!0)};b.useEffect(()=>{(async()=>{try{await en.login({usrMail:e,usrpass:t,masID:r});const oe=sessionStorage.getItem("usrID");if(oe){const ue=parseInt(oe,10),le=await en.getEventsByUser(ue);i(le)}}catch{console.log("No se pudieron cargar los eventos. Revisa la consola para más detalles.")}finally{console.log("Eventos han sido cargados")}})()},[n]),b.useEffect(()=>{const Z=new Date,oe=v.startOfDay(Z),ue=v.endOfDay(v.addDays(oe,6)),le={start:oe,end:ue},Le=a.filter(G=>{const ut={start:G.fechaInicio,end:G.fechaFin};return Wu(ut,le)}).sort((G,ut)=>G.fechaInicio.getTime()-ut.fechaInicio.getTime());E(Le)},[a]),b.useEffect(()=>{(async()=>{try{const oe=await en.getClients(),ue=new Set,le=new Map;oe.forEach(Le=>{ue.add(Le.nombreCliente),le.has(Le.nombreCliente)||le.set(Le.nombreCliente,[]),le.get(Le.nombreCliente).push(Le.solID)}),g(Array.from(ue)),_(le)}catch(oe){console.error("Failed to fetch clients",oe)}})()},[]);const B=async Z=>{try{const oe=await en.getEventById(Z.eventoID);u(oe),c(!0)}catch(oe){console.error(oe)}},z=()=>{c(!1),u(null)},ee=async(Z,oe)=>{let ue,le;Z.todoElDia?(ue=new Date(`${Z.fechaInicio}T${Z.horaInicio}`),le=new Date(`${Z.fechaInicio}T${Z.horaFin}`)):(ue=new Date(`${Z.fechaInicio}T${Z.horaInicio}`),le=Z.fechaFin&&Z.horaInicio2?new Date(`${Z.fechaFin}T${Z.horaInicio2}`):new Date(ue.getTime()+3600*1e3));const Le=v.format(ue,"yyyy-MM-dd HH:mm:ss.SSS"),G=v.format(le,"yyyy-MM-dd HH:mm:ss.SSS");if(oe){const Mt={...Z,eventoID:oe,fechaInicio:Le,fechaFin:G};try{const ht=await en.updateEvent(Mt);var ut=a.map(Ht=>Ht.eventoID===ht.eventoID?ht:Ht);i(ut),I("El evento se ha actualizado correctamente.",{variant:"success"}),z()}catch{I("Error al eliactualizar Evento",{variant:"error"})}}else{const Mt={...Z,fechaInicio:Le,fechaFin:G,todoElDia:Z.todoElDia};try{console.log("newEventData",Mt);const ht=await en.createEvent(Mt);console.log("createdEvent",ht),i(Ht=>[...Ht,ht]),I("El evento se ha creado con éxito",{variant:"success"}),z()}catch{I("Error al guardar Evento",{variant:"error"})}}},ne=()=>{o(Z=>new Date(Z.getFullYear(),Z.getMonth()-1,1))},xe=()=>{o(Z=>new Date(Z.getFullYear(),Z.getMonth()+1,1))},Y=()=>{f(!0)},q=()=>{m(new Date),c(!0)},ge=()=>alert("Sincronizar con Google Calendar"),he=()=>alert("Sincronizar con Outlook Calendar"),de=Z=>{Z&&o(Z)},ye=Z=>{m(Z),c(!0),u(null)},pe=async()=>{if(l)try{await en.deleteEvent(l.eventoID),i(a.filter(Z=>Z.eventoID!==l.eventoID)),I("El evento se ha eliminado de tu calendario",{content:(Z,oe)=>w.jsx(_C,{id:Z,message:String(oe),variant:"delete"})})}catch{I("Error al eliminar Evento",{variant:"error"})}finally{z(),f(!1)}};return w.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[w.jsx(Fg,{header:w.jsx(i_,{currentDate:n,onPrevMonth:ne,onNextMonth:xe,onAddEvent:q,onDateChange:de}),sidebar:w.jsx(B_,{onEventClick:B,upcomingEvents:C,onSyncGoogle:ge,onSyncOutlook:he,leads30Days:S,leads90Days:P}),mainContent:w.jsx(q_,{onSeeMoreClick:M,currentDate:n,events:a,onDayClick:ye,onEventClick:B})}),w.jsx(pC,{isVisible:s,onClose:z,onSave:ee,onDelete:Y,selectedDate:h,initialEvent:l,clients:p,clientSolicitudes:x}),w.jsx(gC,{isOpen:d,onClose:()=>f(!1),onConfirm:pe,title:"Eliminar evento",message:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer."}),w.jsx(vC,{isOpen:K,onClose:()=>H(!1),events:L,date:y,onEventClick:B})]})},kC={page:"_page_ok84c_1"},DC=()=>w.jsx("div",{className:kC.page,children:w.jsx("h1",{children:"Page Clientes"})});Pt.Clientes=DC,Pt.MyCalendar=xC,Object.defineProperty(Pt,Symbol.toStringTag,{value:"Module"})}));
|