1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="d89c800a-a9e5-4222-9e70-494c3d9840c6",e._sentryDebugIdIdentifier="sentry-dbid-d89c800a-a9e5-4222-9e70-494c3d9840c6")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8705],{17071:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},24338:(e,r,t)=>{"use strict";t.d(r,{CoachDeleteButton:()=>c});var a=t(41282),s=t(79516),l=t(57031),o=t(5962);function c(e){let{coachName:r,action:t}=e,[c,n]=(0,o.useTransition)(),[i,d]=(0,o.useState)(null);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{d(null),window.confirm('\xbfEliminar el coach "'.concat(r,'"? Esta acci\xf3n no se puede deshacer.'))&&n(async()=>{try{await t()}catch(r){let e=r instanceof Error?r.message:"Error al eliminar.";if(e.includes("NEXT_REDIRECT"))return;d(e)}})},disabled:c,className:"inline-flex items-center gap-2 rounded-full bg-rose-600 px-5 py-2.5 text-sm font-semibold text-white hover:bg-rose-700 disabled:opacity-60 disabled:cursor-not-allowed",children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.A,{size:14,className:"animate-spin"}),"Eliminandoâ¦"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.A,{size:14}),"Eliminar coach"]})}
1),i&&(0,a.jsx)("p",{className:"text-xs text-rose-600 dark:text-rose-400",children:i})]})}},27382:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},46597:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(r,{callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}});let a=t(81318),s=t(13394),l=t(44968)},54086:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},54866:(e,r,t)=>{"use strict";t.d(r,{A:()=>c});var a=t(5962);let s=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,a.forwardRef)((e,r)=>{let{color:t="currentColor",size:o=24,strokeWidth:c=2,absoluteStrokeWidth:n,className:i="",children:d,iconNode:u,...x}=e;return(0,a.createElement)("svg",{ref:r,...l,width:o,height:o,stroke:t,strokeWidth:n?24*Number(c)/Number(o):c,className:s("lucide",i),...x},[...u.map(e=>{let[r,t]=e;return(0,a.createElement)(r,t)}),...Array.isArray(d)?d:[d]])}),c=(e,r)=>{let t=(0,a.forwardRef)((t,l)=>{let{className:c,...n}=t;return(0,a.createElement)(o,{ref:l,iconNode:r,className:s("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...n})});return t.displayName="".concat(e),t}},57031:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},62946:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},67816:(e,r,t)=>{"use strict";t.d(r,{CoachAvatarUploader:()=>i});var a=t(41282),s=t(79516),l=t(84187),o=t(54086);let c=(0,t(54866).A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var n=t(5962);function i(e){let{initialUrl:r,name:t="avatarUrl",label:i="Avatar"}
1=e,[d,u]=(0,n.useState)(null!=r?r:""),[x,m]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null),[f,h]=(0,n.useState)(!1),b=(0,n.useRef)(null),g=(0,n.useCallback)(async e=>{if(!e||0===e.length)return;let r=e[0];if(v(null),r.size>0xa00000)return void v("El archivo no puede superar 10 MB.");if(!/^image\/(jpeg|png|webp|gif)$/.test(r.type))return void v("Solo se permiten im\xe1genes JPG, PNG, WebP o GIF.");m(!0);try{let e=new FormData;e.append("file",r);let t=await fetch("/api/admin/coaches/avatar-upload",{method:"POST",body:e}),a=await t.json().catch(()=>({}));if(!t.ok||!a.ok||!a.url)return void v(a.message||a.error||"No se pudo subir la imagen.");u(a.url)}catch(e){console.error("[avatar upload]",e),v("Error de red al subir la imagen.")}finally{m(!1)}},[]),y=(0,n.useCallback)(e=>{e.preventDefault(),h(!1),g(e.dataTransfer.files)},[g]),j=(0,n.useCallback)(()=>{var e;null==(e=b.current)||e.click()},[]),k=(0,n.useCallback)(()=>{u(""),v(null),b.current&&(b.current.value="")},[]);return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-[var(--color-text-muted)] mb-1.5",children:i}),(0,a.jsx)("input",{type:"hidden",name:t,value:d}),d?(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"relative h-28 w-28 rounded-2xl overflow-hidden border border-[var(--color-border)] bg-[var(--color-surface-alt)] flex-shrink-0",children:[(0,a.jsx)("img",{src:d,alt:"Avatar",className:"h-full w-full object-cover"}),x&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center",children:(0,a.jsx)(s.A,{size:20,className:"text-white animate-spin"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-xs text-[var(--color-text-muted)] break-all line-clamp-2",children:d}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:j,disabled:x,className:"inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border)] px-3 py-1.5 text-xs font-medium hover:bg-[var(--color-surface-alt)] disabled:opacity-50",children:[(0,a.jsx)(l.A,{size:12})," Reemplazar"]}),(0,a.jsxs)("button",{type:"button",onClick:k,disabled:x,className:"inline-flex items-center gap-1.5 rounded-full border border-rose-200 dark:border-rose-900/40 text-rose-600 px-3 py-1.5 text-xs font-medium hover:bg-rose-50 dark:hover:bg-rose-900/20 disabled:opacity-50",children:[(0,a.jsx)(o.A,{size:12})," Quitar"]})]})]})]}):(0,a.jsx)("button",{type:"button",onClick:j,onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:y,disabled:x,className:"w-full rounded-2xl border-2 border-dashed transition-colors p-6 flex flex-col items-center justify-center gap-2 text-center ".concat(f?"border-[var(--color-primary)] bg-[var(--color-primary-soft)]/40":"border-[var(--color-border)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-alt)]/50"," disabled:opacity-60 disabled:cursor-not-allowed"),children:x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.A,{size:24,className:"text-[var(--color-primary)] animate-spin"}),(0,a.jsx)("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Subiendoâ¦"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{size:24,className:"text-[var(--color-text-faint)]"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:"Subir foto o GIF animado"}),(0,a.jsx)("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Arrastra o haz click. JPG, PNG, WebP o GIF \xb7 m\xe1x 10 MB"})]})}),(0,a.jsx)("input",{ref:b,type:"file",accept:"image/jpeg,image/png,image/webp,image/gif",className:"sr-only",onChange:e=>g(e.target.files)}
1),p&&(0,a.jsx)("p",{className:"mt-2 text-xs text-rose-600 dark:text-rose-400",children:p})]})}},79516:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},84187:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(54866).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},84315:(e,r,t)=>{Promise.resolve().then(t.bind(t,67816)),Promise.resolve().then(t.bind(t,24338)),Promise.resolve().then(t.bind(t,99630)),Promise.resolve().then(t.t.bind(t,57170,23))},99630:(e,r,t)=>{"use strict";t.d(r,{CoachStreamManager:()=>f});var a=t(41282),s=t(46597);let l=(0,s.createServerReference)("402e4a57d5daa1e7c21cf2ab951f6ddd30383a6c27",s.callServer,void 0,s.findSourceMapURL,"provisionCoachStream"),o=(0,s.createServerReference)("4095dda0474a582aa726efbcfd2345b0f24837f8d9",s.callServer,void 0,s.findSourceMapURL,"rotateCoachStream"),c=(0,s.createServerReference)("60920f295c47a0b0f4cc2a765674def85a40ae1262",s.callServer,void 0,s.findSourceMapURL,"setCoachStreamActive");var n=t(27382),i=t(17071),d=t(54866);let u=(0,d.A)("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var x=t(62946);let m=(0,d.A)("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);var p=t(5962);function v(e){let{value:r}=e,[t,s]=(0,p.useState)(!1);return(0,a.jsxs)("button",{onClick:function(){navigator.clipboard.writeText(r).then(()=>{s(!0),setTimeout(()=>s(!1),2500)})},className:"inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border)] px-3 py-1.5 text-xs font-medium text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] transition-colors",children:[t?(0,a.jsx)(n.A,{size:12,className:"text-green-600"}):(0,a.jsx)(i.A,{size:12}),t?"Copiado":"Copiar"]})}function f(e){let{coachId:r,streamKey:t,streamUrl:s,streamActive:n}=e,[i,d]=(0,p.useTransition)(),[f,h]=(0,p.useState)(null),[b]=(0,p.useState)(t),[g]=(0,p.useState)(s),[y,j]=(0,p.useState)(n),[k,N]=(0,p.useState)(!1),w=!!b;function A(e,r){(!r||window.confirm(r))&&(h(null),d(async()=>{try{await e()}catch(e){h(e instanceof Error?e.message:"Error desconocido")}}))}return(0,a.jsxs)("div",{className:"rounded-2xl border border-[var(--color-border)] bg-[var(--color-surface)] p-6 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u,{size:16,className:"text-[var(--color-text-muted)]"}),(0,a.jsx)("h2",{className:"font-semibold text-[var(--color-text)]",children:"Stream persistente"})]}),w&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ".concat(y?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-[var(--color-surface-alt)] text-[var(--color-text-muted)]"),children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(y?"bg-green-500":"bg-[var(--color-text-faint)]")}),y?"Activo":"Desactivado"]})]}),w?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-[var(--color-text-muted)]",children:"OBS debe configurarse una vez con esta clave. Todas las clases en vivo de este coach la reutilizar\xe1n autom\xe1ticamente."}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--color-text-muted)]",children:"URL del servidor"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 text-xs font-mono text-[var(--color-text)] bg-[var(--color-surface-alt)] rounded-xl px-3 py-2 truncate",children:null!=g?g:"rtmps://global-live.mux.com:443/app"}),(0,a.jsx)(v,{value:null!=g?g:"rtmps://global-live.mux.com:443/app"})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--color-text-muted)]",children:"Clave de transmisi\xf3n"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{onClick:()=>N(!0),className:"flex-1 text-xs font-mono text-[var(--color-text)] bg-[var(--color-surface-alt)] rounded-xl px-3 py-2 truncate cursor-pointer transition-all ".concat(k?""
1:"blur-sm select-none"),children:b}),!k&&(0,a.jsx)("button",{onClick:()=>N(!0),className:"text-xs text-[var(--color-text-faint)] hover:text-[var(--color-text-muted)] shrink-0",children:"Revelar"}),k&&(0,a.jsx)(v,{value:b})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1 border-t border-[var(--color-border)]/60",children:[(0,a.jsxs)("button",{onClick:()=>A(()=>o(r),"\xbfRotar la clave? El coach deber\xe1 actualizar OBS. Las clases futuras se actualizar\xe1n autom\xe1ticamente."),disabled:i,className:"inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border)] px-4 py-2 text-xs font-medium text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-alt)] disabled:opacity-50 transition-colors",children:[(0,a.jsx)(x.A,{size:12}),i?"Rotandoâ¦":"Rotar clave"]}),(0,a.jsxs)("button",{onClick:()=>{let e=!y;A(async()=>{await c(r,e),j(e)},e?"\xbfReactivar el stream? Las nuevas clases volver\xe1n a usarlo.":"\xbfDesactivar el stream? Las nuevas clases crear\xe1n streams propios hasta que lo reactives.")},disabled:i,className:"inline-flex items-center gap-1.5 rounded-full border px-4 py-2 text-xs font-medium disabled:opacity-50 transition-colors ".concat(y?"border-red-200 text-red-600 hover:bg-red-50":"border-green-200 text-green-700 hover:bg-green-50"),children:[(0,a.jsx)(m,{size:12}),y?"Desactivar":"Reactivar"]})]})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Este coach no tiene stream asignado. Al provisionar, se crea un stream permanente en Mux que este coach usar\xe1 en todas sus clases en vivo â sin necesidad de reconfigurar OBS."}),(0,a.jsxs)("button",{onClick:()=>A(()=>l(r)),disabled:i,className:"inline-flex items-center gap-2 rounded-full bg-[var(--color-primary)] px-5 py-2.5 text-sm font-semibold text-white hover:bg-[var(--color-primary-hover)] disabled:opacity-50 transition-colors",children:[(0,a.jsx)(u,{size:14}),i?"Provisionandoâ¦":"Provisionar stream"]})]}),f&&(0,a.jsx)("p",{className:"text-xs text-red-600",children:f})]})}}},e=>{e.O(0,[7170,3268,3235,7015,7358],()=>e(e.s=84315)),_N_E=e.O()}]);
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.