PageSourceSearch

https://app.just-drive.co.uk/build/assets/Index-BHgOAgF_.js

js just-drive.co.uk collected 2026-10-07 19:15:47 UTC 7,673 bytes, 1 lines download raw bytes

1import{d as C,c as f,b as s,f as t,A as I,e as o,a,g as l,h as j,j as $,o as n,F as b,k as N,t as r,v as A,G as D,m as h,r as x,q as k,E as O}from"./app-sd8VBv1R.js";import{B as S,_ as Q,t as V}from"./AppLayout.vue_vue_type_script_setup_true_lang-C4v9ySei.js";import{_ as B,a as L}from"./CardContent.vue_vue_type_script_setup_true_lang-rstirKK-.js";import{_ as Z}from"./CardDescription.vue_vue_type_script_setup_true_lang-CcnnGBId.js";import{_ as G,a as R}from"./CardTitle.vue_vue_type_script_setup_true_lang-PTHCA6Ea.js";import{_ as W,a as z,b as U,c as g,d as H,e as v}from"./TableCell.vue_vue_type_script_setup_true_lang-CE36N82q.js";import{_ as J}from"./Input.vue_vue_type_script_setup_true_lang-COcPKquC.js";import{_ as w}from"./Label.vue_vue_type_script_setup_true_lang-CrYo74KN.js";import{_ as K}from"./index-D0QGlcSI.js";import{_ as M}from"./badge-CO43S6Xf.js";import{L as X}from"./loader-circle-CxpCjwMw.js";import{S as Y}from"./send-CmMeezik.js";import{Z as ee}from"./zap-D3qF63_C.js";import"./utils-B2lt5qvW.js";import"./index-si9efnkZ.js";import"./index-ZcD0KIqG.js";import"./createContext-CFj1MGH7.js";import"./useForwardExpose-DKbTU9JP.js";import"./useForwardPropsEmits-6feIP28W.js";import"./Primitive-DVXJ74Lc.js";import"./Presence-DJO0jkPB.js";import"./x-CQ8ZbEbp.js";import"./createLucideIcon-Cn-UtHnI.js";import"./VisuallyHidden-Cn6wGmVN.js";import"./DialogTitle-BNCVMiwq.js";import"./useId-zkiuwMyo.js";import"./index-CuL38H4B.js";import"./RovingFocusGroup-BVUJ441S.js";import"./AvatarImage.vue_vue_type_script_setup_true_lang-Bu-bWGUS.js";import"./index-Cj8fufvE.js";import"./index-C_SHgnPd.js";import"./SheetTitle.vue_vue_type_script_setup_true_lang-Cg-sjRuU.js";import"./AppLogoIcon-Vr-4Tkxx.js";import"./graduation-cap-CXppB8uS.js";import"./users-Cy6c4gvw.js";import"./mail-BWMa7mfY.js";import"./message-square-D4DJWyu1.js";import"./shield-check-DAFlaOUN.js";import"./user-cog-Bgk4JS--.js";import"./chevron-right-DReW60Ui.js";import"./Toaster.vue_vue_type_script_setup_true_lang-DAFPB0kx.js";import"./use-toast-COTPL0Gg.js";const te={class:"flex flex-col gap-6 p-6"},se={class:"flex flex-col gap-2"},oe={class:"text-3xl font-bold flex items-center gap-3"},ae={class:"flex flex-col gap-2"},ie=["value"],le={class:"flex flex-col gap-2"},re={class:"flex flex-col gap-2"},ne={class:"text-xs text-muted-foreground"},ue={class:"flex items-center gap-3"},de={key:0,class:"rounded-md border border-dashed p-8 text-center"},me={key:1,class:"flex items-center gap-2"},fe={class:"font-medium"},pe={class:"text-muted-foreground"},st=C({__name:"Index",props:{users:{},automatedNotifications:{}},setup(E){const u=E,F={learner:"Learner",instructor:"Instructor",any:"Learner & instructor"},d=x(""),p=x(""),m=x(""),c=x(!1),P=k(()=>u.users.find(_=>_.id===d.value)),y=k(()=>d.value&&p.value.trim()&&m.value.trim()),T=()=>{y.value&&(c.value=!0,O.post("/push-notifications",{user_id:d.value,title:p.value.trim(),body:m.value.trim()},{preserveScroll:!0,onSuccess:()=>{V.success(`Notification queued for ${P.value?.name}`),p.value="",m.value="",d.value=""},onError:_=>{const e=Object.values(_)[0];V.error(typeof e=="string"?e:"Failed to queue notification")},onFinish:()=>{c.value=!1}}))},q=[{title:"Push Notifications"}];return(_,e)=>(n(),f(b,null,[s(t(I),{title:"Push Notifications"}),s(Q,{breadcrumbs:q},{default:o(()=>[a("div",te,[a("div",se,[a("h2",oe,[s(t(S),{class:"h-8 w-8"}),e[3]||(e[3]=l(" Push Notifications ",-1))]),e[4]||(e[4]=a("p",{class:"text-muted-foreground"}," Send a push notification to a user who has registered for push notifications. ",-1))]),s(t(B),{class:"max-w-2xl"},{default:o(()=>[s(t(L),{class:"pt-6"},{default:o(()=>[a("form",{onSubmit:j(T,["prevent"]),class:"flex flex-col gap-5"},[a("div",ae,[s(t(w),{for:"user"},{default:o(()=>[...e[5]||(e[5]=[l("Recipient",-1)])]),_:1}),$(a("select",{id:"user","onUpdate:modelValue":e[0]||(e[0]=i=>d.value=i),class:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"},[e[6]||(e[6]=a("option",{value:"",disabled:""}," Select a user... ",-1)),(n(!0),f(b,null,N(u.users,i=>(n(),f("option",{key:i.id,value:i.id},r(i.name)+" ("+r(i.email)+") ",9,ie))),128))],512),[[A,d.value]]),e[7]||(e[7]=a("p",{class:"text-xs text-muted-foreground"}," Only users who have accepted push notifications are shown. ",-1))]),a("div",le,[s(t(w),{for:"title"},{default:o(()=>[...e[8]||(e[8]=[l("Title",-1)])]),_:1}),s(t(J),{id:"title",modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=i=>p.value=i),placeholder:"Notification title",maxlength:"255"},null,8,["modelValue"])]),a("div",re,[s(t(w),{for:"body"},{default:o(()=>[...e[9]||(e[9]=[l("Message",-1)])]),_:1}),$(a("textarea",{id:"body","onUpdate:modelValue":e[2]||(e[2]=i=>m.value=i),placeholder:"Notification message...",rows:"4",maxlength:"1000",class:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"},null,512),[[D,m.value]]),a("p",ne,r(m.value.length)+" / 1000 characters ",1)]),a("div",ue,[s(t(K),{type:"submit",disabled:!y.value||c.value,class:"cursor-pointer min-w-[160px]"},{default:o(()=>[c.value?(n(),h(t(X),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):(n(),h(t(Y),{key:1,class:"mr-2 h-4 w-4"})),l(" "+r(c.value?"Queuing...":"Queue Notification"),1)]),_:1},8,["disabled"])])],32)]),_:1})]),_:1}),u.users.length===0?(n(),f("div",de,[s(t(S),{class:"mx-auto h-12 w-12 text-muted-foreground
1/50"}),e[10]||(e[10]=a("h3",{class:"mt-4 text-lg font-semibold"}," No users with push tokens ",-1)),e[11]||(e[11]=a("p",{class:"mt-2 text-muted-foreground"}," No users have registered for push notifications yet. Users need to accept push notifications from the mobile app first. ",-1))])):(n(),f("div",me,[s(t(M),{variant:"secondary"},{default:o(()=>[l(r(u.users.length)+" "+r(u.users.length===1?"user":"users"),1)]),_:1}),e[12]||(e[12]=a("span",{class:"text-sm text-muted-foreground"}," registered for push notifications ",-1))])),s(t(B),null,{default:o(()=>[s(t(G),null,{default:o(()=>[s(t(R),{class:"flex items-center gap-2"},{default:o(()=>[s(t(ee),{class:"h-5 w-5"}),e[13]||(e[13]=l(" Automatic notifications ",-1))]),_:1}),s(t(Z),null,{default:o(()=>[...e[14]||(e[14]=[l(" Push notifications the system sends on its own. Values in {braces} are filled in when the notification is sent. These can't be edited here. ",-1)])]),_:1})]),_:1}),s(t(L),null,{default:o(()=>[s(t(W),null,{default:o(()=>[s(t(z),null,{default:o(()=>[s(t(U),null,{default:o(()=>[s(t(g),null,{default:o(()=>[...e[15]||(e[15]=[l("Notification",-1)])]),_:1}),s(t(g),null,{default:o(()=>[...e[16]||(e[16]=[l("Sent to",-1)])]),_:1}),s(t(g),null,{default:o(()=>[...e[17]||(e[17]=[l("Message",-1)])]),_:1}),s(t(g),null,{default:o(()=>[...e[18]||(e[18]=[l("When it's sent",-1)])]),_:1})]),_:1})]),_:1}),s(t(H),null,{default:o(()=>[(n(!0),f(b,null,N(u.automatedNotifications,i=>(n(),h(t(U),{key:i.key},{default:o(()=>[s(t(v),{class:"align-top font-medium"},{default:o(()=>[l(r(i.name),1)]),_:2},1024),s(t(v),{class:"align-top"},{default:o(()=>[s(t(M),{variant:"secondary"},{default:o(()=>[l(r(F[i.audience]),1)]),_:2},1024)]),_:2},1024),s(t(v),{class:"max-w-sm align-top whitespace-normal"},{default:o(()=>[a("p",fe,r(i.title),1),a("p",pe,r(i.body),1)]),_:2},1024),s(t(v),{class:"max-w-sm align-top whitespace-normal text-muted-foreground"},{default:o(()=>[l(r(i.trigger),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1})],64))}});export{st 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.