PageSourceSearch

https://www.guaybo.com/_next/static/chunks/708.49f3138a671d53e6.js

js guaybo.com collected 2026-09-29 01:29:32 UTC 8,768 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5f738545-0535-4e29-94e2-0a018d9b46be",e._sentryDebugIdIdentifier="sentry-dbid-5f738545-0535-4e29-94e2-0a018d9b46be")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[708],{708:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>C});var a=l(54568),n=l(76619),i=l(19350),r=l(25703),s=l(73932),d=l(79295),o=l(11408),c=l(61145),u=l(95997),m=l(58089),h=l(10016),f=l(40344),x=l(11744),g=l(34935),v=l(16734),b=l.n(v);l(490);var p=l(55195),w=l(7620),y=l(53210),j=l.n(y),N=l(44576);let D=e=>{let{date:t,selectedSlot:l,times:n,onSelectSlot:i,appearance:s="light"}=e,d="dark"===s,[o,c]=(0,w.useState)(null),u={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},m=(0,w.useRef)(null);return(0,w.useEffect)(()=>{var e;if(!l)return;let t=null==(e=m.current)?void 0:e.querySelector('[data-timeslot="'.concat(l,'"]'));t&&t.scrollIntoView({behavior:"smooth",block:"center"})},[l,n]),(0,a.jsx)("div",{className:"flex h-full flex-col pr-2",children:(0,a.jsx)(p.P.div,{variants:{hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},initial:"hidden",animate:"show",className:"flex flex-col gap-2",ref:m,children:n.map(e=>(0,a.jsxs)(p.P.button,{"data-timeslot":e,variants:u,onClick:()=>{i(e),window.navigator.vibrate&&window.navigator.vibrate(50)},onMouseEnter:()=>c(e),onMouseLeave:()=>c(null),className:(0,r.cn)("group relative flex items-center gap-3 rounded-lg border px-4 py-2 text-left transition-all duration-200 md:px-5 lg:py-4",l===e?d?"border-white/40 bg-white/10 shadow-sm":"border-theme-primary bg-theme-primary/10 shadow-sm":o===e?d?"border-white/25 bg-white/5":"border-theme-primary/30 bg-theme-primary/5":d?"border-white/15 bg-white/[0.06] hover:border-white/25 hover:bg-white/10":"border-gray-200 hover:border-theme-primary/30 hover:bg-theme-primary/5"),children:[(0,a.jsx)(N.TbClock,{size:18,className:"transition-colors ".concat(l===e?"text-fg":"text-muted group-hover:text-fg")}),(0,a.jsx)("span",{className:"text-sm font-medium ".concat(l===e?"text-fg":"text-muted group-hover:text-fg"),children:e})]},e))})})};b().locale("es");let k=e=>{if(!e)return null;let t=b()(e);return t.isValid()?t.toDate():null},M=e=>e?b()(e).format("YYYY-MM-DD"):"",C=function(e){let{handleOnClose:t,onSessionSelected:l,product:v,selectedSession:y,appearance:N="light"}=e,C="dark"===N,[_,{isLoading:S}]=(0,d.k3)(),{listingProduct:I}=(0,s.G)(e=>e.products),P=null!=v?v:I,T=null==P?void 0:P.recordId,z=null==P?void 0:P.dates,[A,E]=(0,w.useState)(null),[R,Y]=(0,w.useState)(null),F=(0,w.useRef)(null),[H,V]=(0,w.useState)(0),[Z,G]=(0,w.useState)([]),[L,O]=(0,w.useState)(null),q=A?M(A):"",B=(null==P?void 0:P.timezone)||Intl.DateTimeFormat().resolvedOptions().timeZone,W=(0,w.useRef)(null),$=(0,w.useCallback)(async e=>{var t,l,a,n,i,r,s,d,o;let c=M((0,f.w)(e)),u=M(function(e,t){let l=(0,x.a)(e,void 0),a=l.getMonth();return l.setFullYear(l.getFullYear(),a+1,0),l.setHours(23,59,59,999),l}((0,g.P)(e,2)));if(!T)return;let m=[];O(null);try{let e=await _({body:{startDate:c,endDate:u,timezone:B},productId:T}).unwrap();m=null!=(t=null==e?void 0:e.days)?t:[]}catch(e){if((null==e||null==(a=e.data)||null==(l=a.error)?void 0:l.message)==="InvalidDateRange"||(null==e||null==(n=e.data)?void 0:n.message)==="InvalidDateRange"||(null==e||null==(r=e.data)||null==(i=r.error)?void 0:i.code)==="InvalidDateRange"||(null==e||null==(s=e.data)?void 0:s.code)==="InvalidDateRange"||(null==e?void 0:e.message)==="InvalidDateRange"){let e=null==z||null==(d=z[0])?void 0:d.endDate;e?O("La agenda del mentor cerr\xf3 el ".concat(e.split("T")[0],".")):O("No se pudo cargar la disponibilidad.")}else O("No se pudo cargar la disponibilidad.");return}if(G(m),m.length>0){let e=null==y?void 0:y.date,t=m.some(t=>t.date===e),l=m[0].date,a=k(t?e:l);E(null!=a?a:b()(l).toDate())}else E(null);if(m.length>0){let e=null==y?void 0:y.date,t=m.some(t=>t.date===e),l=m[0].date,a=t?e:l,n=(null==y?void 0:y.time)||null,i=null==(o=m.find(e=>e.date===a))?void 0:o.times;n&&(null==i?void 0:i.includes(n))?Y(n):Y(null)}else Y(null)},[_,T,B,y,z]);(0,w.useEffect)(()=>
1{if(!T)return;let e=k(null==y?void 0:y.date);$(e?(0,f.w)(e):(0,f.w)(new Date))},[T,$,null==y?void 0:y.date]);let J=(0,w.useMemo)(()=>{var e,t;return null!=(t=null==Z||null==(e=Z.find(e=>e.date===q))?void 0:e.times)?t:[]},[q,Z]);(0,w.useEffect)(()=>{F.current&&V(F.current.offsetHeight)},[]);let K=(0,w.useMemo)(()=>new Set((null==Z?void 0:Z.map(e=>e.date))||[]),[Z]);return(0,a.jsxs)("div",{className:(0,r.cn)("relative",C&&"text-fg"),children:[S&&(0,a.jsx)("div",{className:(0,r.cn)("absolute left-0 top-0 z-20 flex h-full w-full items-center justify-center",C?"bg-black/35 backdrop-blur-[2px]":"bg-white/90"),children:C?(0,a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-white/25 border-t-white",role:"status","aria-label":"Cargando"}):(0,a.jsx)(n.A,{})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2",children:[(0,a.jsxs)("div",{ref:F,className:(0,r.cn)("h-fit lg:border-r",C?"border-white/10":"border-gray-200"),children:[(0,a.jsx)(i.A,{size:"sm",weight:"medium",className:(0,r.cn)("text-center lg:text-start",C&&"!text-fg"),children:"Selecciona una fecha"}),(0,a.jsx)(c.y,{withGlobalClasses:!0,forceColorScheme:C?"dark":"light",children:(0,a.jsx)(u.n2,{settings:{locale:"es"},children:(0,a.jsx)("div",{className:(0,r.cn)("flex items-center justify-center pt-4",C?j().darkCalendar:j().lightCalendar),
1children:(0,a.jsx)(m.l,{value:A,onChange:E,locale:"es",firstDayOfWeek:1,excludeDate:e=>{let t=M(e);return!K.has(t)},onMonthSelect:$,onNextMonth:$,onPreviousMonth:$,weekendDays:[]})})})})]}),(0,a.jsxs)("div",{style:{height:"".concat(H,"px")},className:"mt-6 flex max-h-56 flex-col px-4 md:mt-0 lg:max-h-none",children:[(0,a.jsx)("div",{className:"flex flex-row gap-x-2",children:(0,a.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-between",children:[(0,a.jsx)(i.A,{size:"sm",weight:"medium",className:C?"!text-fg":void 0,children:"Horas disponibles"}),(0,a.jsx)(i.A,{size:"xs",textTone:"medium",className:C?"!text-muted":void 0,children:B})]}),(0,a.jsx)(p.P.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:(0,r.cn)("mb-4 block text-start text-xs font-medium lg:hidden","text-muted"),children:A&&(0,o.Z)(b()(A).format("dddd, D MMMM"))})]})}),(0,a.jsx)(p.P.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:(0,r.cn)("mb-4 hidden text-start text-xs font-medium lg:block","text-muted"),children:A&&(0,o.Z)(b()(A).format("dddd, D MMMM"))}),(0,a.jsx)("div",{className:"flex-1 overflow-y-scroll",ref:W,children:L?(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-4 text-center",children:(0,a.jsx)(i.A,{size:"sm",textTone:"medium",className:C?"!text-muted":void 0,children:L})}):A?(0,a.jsx)(D,{date:A,times:J,selectedSlot:R,onSelectSlot:Y,appearance:N}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsx)(i.A,{size:"sm",textTone:"medium",className:C?"!text-muted":void 0,children:"No hay fechas disponibles"})})})]})]}),(0,a.jsx)("div",{className:"grid w-full grid-cols-4 pt-4",children:(0,a.jsx)(h.$,{className:(0,r.cn)("col-span-4 lg:col-span-2 lg:col-start-3",C&&"!bg-white !text-black hover:!bg-white/90"),disabled:S,variant:"plain",onClick:()=>{if(!A||!R)return;let e=M(A);null==l||l({time:R,timezone:B,date:e}),null==t||t()},children:"Confirmar"})})]})}},11744:(e,t,l)=>{"use strict";l.d(t,{a:()=>n});var a=l(66286);function n(e,t){return(0,a.w)(t||e,e)}},34935:(e,t,l)=>{"use strict";l.d(t,{P:()=>i});var a=l(66286),n=l(11744);function i(e,t,l){let i=(0,n.a)(e,null==l?void 0:l.in);if(isNaN(t))return(0,a.w)((null==l?void 0:l.in)||e,NaN);if(!t)return i;let r=i.getDate(),s=(0,a.w)((null==l?void 0:l.in)||e,i.getTime());return(s.setMonth(i.getMonth()+t+1,0),r>=s.getDate())?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}},40344:(e,t,l)=>{"use strict";l.d(t,{w:()=>n});var a=l(11744);function n(e,t){let l=(0,a.a)(e,null==t?void 0:t.in);return l.setDate(1),l.setHours(0,0,0,0),l}},41310:(e,t,l)=>{"use strict";l.d(t,{Cg:()=>i,_P:()=>s,my:()=>a,s0:()=>r,w4:()=>n});let a=6048e5,n=864e5,i=6e4,r=36e5,s=Symbol.for("constructDateFrom")},53210:e=>{e.exports={darkCalendar:"scheduleAvailability_darkCalendar__VlmBb",lightCalendar:"scheduleAvailability_lightCalendar__1l0Eh"}},66286:(e,t,l)=>{"use strict";l.d(t,{w:()=>n});var a=l(41310);function n(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&a._P in e?e[a._P](t):e instanceof Date?new e.constructor(t):new Date(t)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.