PageSourceSearch

https://revby.co/_nuxt/HskGV-B8.js

js revby.co collected 2026-09-25 18:18:49 UTC 9,018 bytes, 1 lines download raw bytes

1import{l as de,e as ue,m as me,c as h,a as l,b as s,N as B,j as w,w as i,k as o,t as _,_ as fe,g as n,o as p,i as pe,Y as _e,s as ve,z as y,h as xe,d as k,n as ge}from"./Cny-jMUR.js";import{_ as be}from"./B-5qM8bm.js";import{_ as he,a as we}from"./BYSF8i36.js";import{_ as ye}from"./CSHkLFmR.js";import{_ as ke}from"./DmDz5m4l.js";import{_ as Ce}from"./tJRDHKHm.js";import{_ as Ue}from"./BwAl2rRS.js";import{u as je}from"./Bhcf4Zif.js";import{u as Ve}from"./YF0e3wke.js";import{u as ze}from"./DdRwPrpw.js";import{u as Oe}from"./CnWiBKLW.js";import"./DgxW0n38.js";import"./YoF-LljS.js";import"./BesTg-G_.js";import"./DRbcCXkf.js";import"./CUX1A6tG.js";import"./D548Katv.js";import"./DbKi9FIK.js";import"./COjSgi5K.js";import"./CXDzCsr7.js";import"./Deq16PoT.js";import"./B5rxJs06.js";import"./BcOQZI7O.js";import"./BRdsWsvc.js";import"./CAIa7X-A.js";import"./DlAUqK2U.js";import"./B7NayylV.js";import"./BGx-vc2c.js";import"./irfCLHM0.js";import"./CRt-pR_f.js";import"./Dkp9_4T-.js";import"./C9RKA-P2.js";const Se={class:"bg-gray-50"},$e={class:"max-w-7xl mx-auto p-4 pb-20"},Ne={class:"flex flex-row items-center gap-2 text-brand"},De={key:0,class:"flex justify-center py-12"},Ee={key:2},Be={class:"text-3xl font-bold text-neutral-950"},Fe={class:"text-xl font-bold"},Me={class:"flex flex-col gap-4 lg:flex-row mt-8"},Ie={class:"w-full lg:w-1/3"},We={class:"grid gap-4 max-w-xl mx-auto"},Re={class:"flex flex-row gap-4 items-center"},qe={class:"flex flex-row gap-4 items-center"},Ae={class:"flex flex-row gap-2 mt-8 items-center"},Le={class:"text-xl"},Pe={key:0,class:"mt-8"},Qe={class:"flex flex-row gap-2 mt-4"},Te={class:"flex flex-row gap-4 items-center"},Ye={class:"flex flex-row gap-4 items-center mt-2"},Ge={class:"text-xl"},He={class:"mt-4 flex flex-col gap-2"},Je={class:"flex items-center gap-2 mb-2"},Ke={class:"flex flex-row gap-4 mt-8 items-center"},Xe={class:"font-thin text-lg"},Ze={class:"flex flex-col gap-4"},et={class:"w-full lg:w-2/3 flex flex-col gap-4"},tt={class:"flex flex-row gap-2 items-center mb-8"},Bt={__name:"[id]",setup(lt){const P=de(),F=je(),{formatDate:Q}=Ve(),{setObjectiveForPlan:T,fetchCoachProfile:Y,coachProfile:G,updateCoachingPlan:M}=ze(),{fetchRevbyStaff:H,revbyStaff:I}=Oe(),x=n(!1),C=n(!1),U=n(!1),u=n(""),a=n(null),W=n(!0),j=n(null),m=n(""),J=n(!1),V=n(!1),z=n(!1),f=n(""),v=n(""),O=n(!1),S=n([]),R=n(null),$=async()=>{try{const{data:t,error:e}=await F.from("coaching_plans").select("*, coachName:profiles!coach(full_name), client:profiles!user_id(full_name)").eq("id",P.params.id).single();if(e)throw e;a.value=t,u.value=t==null?void 0:t.coach,f.value=t!=null&&t.onboarding_meeting?new Date(t.onboarding_meeting).toISOString().slice(0,16):"",v.value=(t==null?void 0:t.onboarding_meeting_url)||""}catch(t){j.value=t.message||"Failed to load coaching plan"}finally{W.value=!1}},K=async()=>{var t;if(!(!u.value||u.value===((t=a.value)==null?void 0:t.coach))){z.value=!0;try{await M(a.value.id,{coach:u.value},{bypassUser:!0}),await $(),x.value=!1}catch(e){console.error("Failed to update coach:",e)}finally{z.value=!1}}},N=t=>{t==="coach"?x.value=!x.value:t==="onboarding"?C.value=!C.value:t==="objective"&&(U.value=!U.value)},X=ve(()=>I.value?I.value.map(t=>({label:t.full_name||t.email,value:t.id})):[]),Z=async()=>{if(m.value.trim()){V.value=!0;try{await T(a.value.id,m.value),a.value.objective=m.value,J.value=!1,m.value=""}catch(t){console.error("Failed to update objective:",t)}finally{V.value=!1}}},ee=async()=>{if(f.value){O.value=!0;try{await M(a.value.id,{onboarding_meeting:new Date(f.value).toISOString(),onboarding_meeting_url:v.value||null},{bypassUser:!0}),await $()}catch(t){console.error("Failed to schedule onboarding meeting:",t)}finally{O.value=!1}}},te=async t=>{const{data:e,error:r}=await F.from("coaching_weeks").select("id, week_num").eq("plan_id",t).order("week_num",{ascending:!0});if(r)throw r;S.value=(e||[]).map(g=>({label:`Week ${g.week_num}`,value:g.id})),!R.value&&S.value.length&&(R.value=S.value[0].value)},le=async()=>{await Promise.all([$(),H()])};return ue(()=>{le()}),me(a,t=>{t&&(Y(t==null?void 0:t.coach),te(t==null?void 0:t.id))}),(t,e)=>{var q;
1const r=pe,g=fe,oe=be,se=he,c=ye,ae=_e,ne=ke,b=xe,D=Ce,ie=Ue,re=we;return p(),h("div",Se,[l("div",$e,[s(g,{to:"/admin/coaching"},{default:i(()=>[l("div",Ne,[s(r,{name:"i-lucide-arrow-left"}),e[7]||(e[7]=l("p",{class:"my-8"},"Back to coaching",-1))])]),_:1}),o(W)?(p(),h("div",De,[s(r,{name:"i-heroicons-arrow-path-20-solid",class:"animate-spin size-6"})])):o(j)?(p(),B(oe,{key:1,color:"error",variant:"soft",title:o(j),class:"mb-6"},null,8,["title"])):o(a)?(p(),h("div",Ee,[l("h2",Be,_((q=o(a).client)==null?void 0:q.full_name),1),l("p",Fe,"Plan: "+_(o(a).plan),1),l("div",Me,[l("div",Ie,[l("div",We,[s(c,{class:"w-full max-w-full mx-auto"},{default:i(()=>[l("div",Re,[s(r,{name:"i-lucide-calendar",class:"size-8"}),e[8]||(e[8]=l("h3",{class:"text-2xl font-semibold"},"Dates",-1))]),s(se,{start:o(a).start_date,end:o(a).end_date,plan:o(a)},null,8,["start","end","plan"])]),_:1}),s(c,{class:"w-full max-w-full"},{default:i(()=>{var d,A,L;return[l("div",qe,[s(r,{name:"i-lucide-user-circle",class:"size-8"}),e[9]||(e[9]=l("h3",{class:"text-2xl font-semibold"},"Coach",-1))]),l("div",Ae,[s(ae,{src:(A=(d=o(G))==null?void 0:d[o(a).coach])==null?void 0:A.avatar_url,size:"xl"},null,8,["src"]),l("p",Le,_((L=o(a).coachName)==null?void 0:L.full_name),1),s(r,{name:"i-lucide-pencil",class:"text-blue-500 size-4",onClick:e[0]||(e[0]=E=>N("coach"))})]),o(x)?(p(),h("div",Pe,[s(c,{class:"w-full max-w-full"},{default:i(()=>{var E;return[e[11]||(e[11]=l("p",{class:"text-xl font-semibold"},"Assign new coach:",-1)),l("div",Qe,[s(ne,{modelValue:o(u),"onUpdate:modelValue":e[1]||(e[1]=ce=>y(u)?u.value=ce:null),items:o(X),class:"w-1/2"},null,8,["modelValue","items"]),s(b,{class:"rounded-full",disabled:!o(u)||o(u)==((E=o(a))==null?void 0:E.coach),onClick:K,loading:o(z)},{default:i(()=>[...e[10]||(e[10]=[k(" Change coach ",-1)])]),_:1},8,["disabled","loading"])])]}),_:1})])):w("",!0)]}),_:1}),s(c,{class:"w-full max-w-full overflow-hidden"},{default:i(()=>[l("div",Te,[s(r,{name:"i-lucide-phone",class:"size-8"}),e[12]||(e[12]=l("h3",{class:"text-2xl font-semibold"},"Onboarding meeting",-1))]),e[15]||(e[15]=l("p",{class:"font-semibold text-md mt-8"},"Date and time",-1)),l("div",Ye,[l("p",Ge,_(o(Q)(o(a).onboarding_meeting,"full")||"Not yet scheduled"),1),s(r,{name:"i-lucide-pencil",class:"text-blue-500 size-4",onClick:e[2]||(e[2]=d=>N("onboarding"))})]),e[16]||(e[16]=l("p",{class:"font-semibold text-md mt-8"},"Meeting URL",-1)),l("p",{class:ge(["text-xl mt-2 break-words overflow-hidden",[o(a).onboarding_meeting_url?"":"text-error"]])},_(o(a).onboarding_meeting_url||"No meeting link"),3),o(C)?(p(),B(c,{key:0,class:"mt-8 w-full max-w-full"},{default:i(()=>[e[14]||(e[14]=l("h3",{class:"text-2xl font-semibold"},"Update onboarding call",-1)),l("div",He,[s(D,{modelValue:o(f),"onUpdate:modelValue":e[3]||(e[3]=d=>y(f)?f.value=d:null),type:"datetime-local"},null,8,["modelValue"]),s(D,{modelValue:o(v),"onUpdate:modelValue":e[4]||(e[4]=d=>y(v)?v.value=d:null),placeholder:"Onboarding meeting link (optional)"},null,8,["modelValue"]),s(b,{class:"rounded-full mt-2 self-start px-6",disabled:!o(f),loading:o(O),onClick:ee},{default:i(()=>[...e[13]||(e[13]=[k(" Update onboarding call ",-1)])]),_:1},8,["disabled","loading"])])]),_:1})):w("",!0)]),_:1}),s(c,{class:"w-full max-w-full"},{default:i(()=>[l("div",null,[l("div",Je,[s(r,{name:"i-lucide-target",class:"size-6"}),e[17]||(e[17]=l("h3",{class:"text-2xl font-semibold"},"Plan objective",-1))]),l("div",Ke,[l("p",Xe,_(o(a).objective||"Not yet set"),1),s(r,{name:"i-lucide-pencil",class:"text-blue-500 size-4",onClick:e[5]||(e[5]=d=>N("objective"))})]),o(U)?(p(),B(c,{key:0,class:"mt-8"},{default:i(()=>[e[19]||(e[19]=l("h3",{class:"text-2xl font-semibold"},"Update plan objective",-1)),l("div",Ze,[s(D,{class:"mt-8",modelValue:o(m),"onUpdate:modelValue":e[6]||(e[6]=d=>y(m)?m.value=d:null),placeholder:"Set objective for this plan"},null,8,["modelValue"]),s(b,{class:"rounded-full self-start px-6",onClick:Z,loading:o(V)},{default:i(()=>[...e[18]||(e[18]=[k(" Save Objective ",-1)])]),_:1},8,["loading"])])]),_:1})):w("",!0)])]),_:1}),s(c,null,{default:i(()=>[e[21]||(e[21]=l("h3",{class:"text-2xl font-semibold text-neutral-950"},"Quiz answers",-1)),s(b,{to:`/admin/surveys/quiz/${o(a).user_id}`,class:"rounded-full mt-4"},{default:i(()=>[...e[20]||(e[20]=[k("View answers",-1)])]),_:1},8,["to"])]),_:1})])]),l("div",et,[s(c,null,{default:i(()=>[l("div",tt,[s(r,{name:"i-lucide-mail",class:"size-7"}),e[22]||(e[22]=l("h3",{class:"text-neutral-950 text-2xl font-semibold"}," Messages ",-1))]),s(ie,{"conversation-id":o(a).conversation_id,class:"max-h-[400px]"},null,8,["conversation-id"])]),_:1}),s(c,null,{default:i(()=>[e[23]||(e[23]=l("h3",{class:"font-semibold text-neutral-950 text-2xl mb-8"},"Weekly plans",-1)),s(re,{plan:o(a).id,"user-id":o(a).user_id},null,8,["plan","user-id"])]),_:1})])])])):w("",!0)])])}}};export{Bt as default};

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.