PageSourceSearch

https://gg.givingcompass.org/_nuxt/D-TvH3NP.js

js givingcompass.org collected 2026-09-24 09:19:27 UTC 26,965 bytes, 1 lines download raw bytes

1import{P as e}from"./CrK_MUeO.js";import{W as a,u as t,r as l,N as o,V as i,e as n,p as s,ac as r,_ as d}from"#entry";import{u as c}from"./inpFMjNm.js";import{a as u,V as m,b as p,c as v}from"./BiYztEaP.js";import{V as y}from"./B9goy8s8.js";import{V as f}from"./DS5vur34.js";import{V as h}from"./D5gjRk3K.js";import{V as b}from"./7ukZPocg.js";import{V as g}from"./369w539r.js";import{V as x}from"./Ch9sftxZ.js";import{V as k,a as _,b as V,c as w}from"./BWrehKB2.js";import{V as C}from"./CVi8ooJQ.js";import{V as A}from"./Bpq7MrYI.js";import{V as U}from"./BWNBbf6k.js";import{V as P}from"./BzdmcfQK.js";import{V as D}from"./D-JenzQK.js";import{B as T,r as I,c as E,d as S,w as R,x as j,aG as z,ay as N,aw as $,$ as L,i as O,C as M,az as G,R as W,av as F,aq as H,aH as Z}from"./nX7w3--X.js";import"./CzuCJjyz.js";import"./CzdGDBjF.js";import"./CNAuE06t.js";import"./C-u_YpPl.js";import"./CtG27aky.js";import"./m8SgQgoF.js";import"./D7YexoFe.js";import"./DZ6T0PiR.js";import"./BCcckLnV.js";import"./egkXgMqP.js";import"./DeYW9Fiz.js";import"./CnLvr--j.js";import"./DG_9ismW.js";import"./gjBqqy30.js";import"./Bs0o2c6W.js";import"./Boy9wtnx.js";import"./C2U5VtnP.js";import"./CFQTgrnx.js";async function q(e,a={}){try{const{data:l,error:o}=await t(e,a);return o.value?(console.error("Preview admin request error:",o.value),{data:null,error:o.value}):{data:l.value,error:null}}catch(l){return console.error("Preview admin request exception:",l),{data:null,error:l}}}const K={listCohorts:()=>q(a().API_PREVIEW_ADMIN_COHORTS_URL),createCohort:e=>q(a().API_PREVIEW_ADMIN_COHORTS_URL,{method:"POST",body:e}),updateCohort:(e,t)=>q(`${a().API_PREVIEW_ADMIN_COHORTS_URL}/${encodeURIComponent(e)}`,{method:"PATCH",body:t}),deleteCohort:e=>q(`${a().API_PREVIEW_ADMIN_COHORTS_URL}/${encodeURIComponent(e)}`,{method:"DELETE"}),listGrants(e={}){const t={};return e.code&&(t.code=e.code),void 0!==e.active&&(t.active=String(e.active)),q(a().API_PREVIEW_ADMIN_GRANTS_URL,{params:t})},grantAccess:e=>q(a().API_PREVIEW_ADMIN_GRANTS_URL,{method:"POST",body:e}),inviteAccess:e=>q(a().API_PREVIEW_ADMIN_INVITES_URL,{method:"POST",body:e}),extendGrant:e=>q(a().API_PREVIEW_ADMIN_EXTEND_URL,{method:"POST",body:e}),revokeAccess:e=>q(a().API_PREVIEW_ADMIN_REVOKE_URL,{method:"POST",body:{email:e}})},X={class:"page-top"},B={class:"page-intro"},Q={class:"intro-actions"},Y={key:0,class:"loading-state"},J={key:1,class:"error-state"},ee={key:2,class:"empty-state"},ae={key:3,class:"table-content"},te={class:"key-code"},le={class:"muted"},oe={key:0,class:"muted ml-1"},ie={class:"date-text"},ne={class:"actions-cell"},se={class:"page-top"},re={class:"page-intro"},de={class:"filters"},ce={class:"intro-actions"},ue={key:0,class:"loading-state"},me={key:1,class:"error-state"},pe={key:2,class:"empty-state"},ve={key:3,class:"table-content"},ye={class:"name-text"},fe={key:0,class:"key-code"},he={key:1,class:"muted"},be={class:"date-text"},ge={class:"date-text"},xe={class:"actions-cell"},ke={class:"modal-title"},_e={key:1,class:"mb-4"},Ve={class:"key-code"},we={class:"share-url-row"},Ce={class:"share-url"},Ae={class:"muted mt-3"},Ue={class:"key-code"},Pe={key:0},De={class:"modal-title"},Te=d(T({__name:"preview-access",setup(a){const{setSEO:t}=c();t({title:"Admin - Preview Access",description:"Manage preview-access cohorts and participants.",noIndex:!0});const d=K,T=l(),q=o(),Te=I("cohorts");function Ie(e){if(!e)return"—";const a=new Date(e.endsWith("Z")?e:`${e}Z`);return isNaN(a.getTime())?e:a.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC"})+" UTC"}function Ee(e,a){const t=e?.data?.detail;return"string"==typeof t?t:Array.isArray(t)?t.map((e=>{const a=Array.isArray(e.loc)?e.loc.filter((e=>"body"!==e)).join("."):"";return a?`${a}: ${e.msg}`:e.msg})).join("; "):e?.message||a}function Se(e){switch(e.status){case"active":return{label:"Active",color:"success"};case"pending":return{label:"Invited",color:"info"};case"revoked":return{label:"Revoked",color:"grey"};case"expired":return{label:"Expired",color:"warning"}}return e.revokedAt?{label:"Revoked",color:"grey"}:e.active?{label:"Active",color:"success"}:{label:"Expired",color:"warning"}}const Re=I([]),je=I(!0),ze=I(!1),Ne=I(null);async function $e(){je.value=!0,Ne.value=null;const{data:e,error:a}=await d.listCohorts();je.value=!1,ze.value=!0,a?Ne.value=Ee(a,"Failed to load cohorts"):e&&(Re.value=e)}const Le=E((()=>Re.value.map((e=>({title:e.label?`${e.code} — ${e.label}`:e.code,value:e.code}))))),Oe=I(!1),Me=I(null),Ge=I(!1),We=I(null),Fe=S({slug:"",label:"",durationDays:"",maxParticipants:"",validUntil:"",enabled:!0}),He=E((()=>null!==Me.value)),Ze=I(null),qe=I(!1);function Ke(e){return`${q.public.ggUrl||window.location.origin}/trial/preview/${e}`}const Xe=E((()=>Ze.value?Ke(Ze.value.code):""));async function Be(e){const a=Ke(e);try{await navigator.clipboard.writeText(a),T.showSnackbar({message:"Signup link copied.",color:"success",timeout:2e3})}catch{T.showSnackbar({message:a,color:"info",timeout:6e3})}}function Qe(){Me.value=null,Fe.slug="",Fe.label="",Fe.durationDays="30",Fe.maxParticipants="",Fe.validUntil="",Fe.enabled=!0,We.value=null,Oe.value=!0}async function Ye(){We.value=null;const e=parseInt(Fe.durationDays,10);if(isNaN(e)||e<1)return void(We.value="Duration (days) must be a whole number ≥ 1.");let a=null;if(""!==Fe.maxParticipants.trim()&&(a=parseInt(Fe.maxParticipants,10),isNaN(a)||a<1))return void(We.value="Max participants must be a whole number ≥ 1, or left blank for unlimited.");const t=""===Fe.validUntil.trim()?null:Fe.validUntil,l=""===Fe.label.trim()?null:Fe.label.trim();if(Ge.value=!0,He.value){const{error:o}=await d.updateCohort(Me.value.code,{label:l,durationDays:e,maxParticipants:a,validUntil:t,enabled:Fe.enabled});if(Ge.value=!1,o)return void(We.value=Ee(o,"Failed to update cohort."));T.showSnackbar({message:"Cohort updated.",color:"success",timeout:3e3})}else{const o=Fe.slug.trim(),{data:i,error:n}=await d.createCohort({durationDays:e,...o?{slug:o}:{},label:l,maxParticipants:a,validUntil:t,enabled:Fe.enabled});if(Ge.value=!1,n)return void(We.value=Ee(n,"Failed to create cohort."));Ze.value=i,qe.value=!0}Oe.value=!1,await $e()}const Je=I(null),ea=I([]),aa=I(!0),ta=I(!1),la=I(null),oa=I(""),ia=I("all");async function na(){aa.value=!0,la.value=null;const{data:e,error:a}=await d.listGrants({code:oa.value||void 0,active:"all"===ia.value?void 0:"active"===ia.value});aa.value=!1,ta.value=!0,a?la.value=Ee(a,"Failed to load participants"):e&&(ea.value=e)}R([oa,ia],na);const sa=I(!1),ra=I(!1),da=I(null),ca=S({emails:"",grantType:"preview",cohort:"",durationDays:""}),ua=E((()=>[...new Set(ca.emails.split(/[\s,;]+/).map((e=>e.trim().toLowerCase())).filter((e=>e.includes("@"))))]));function ma(){ca.emails="",ca.grantType="preview",ca.cohort=oa.value||"",ca.durationDays="",da.value=null,sa.value=!0}async function pa(){da.value=null;const e=ua.value;if(!e.length)return void(da.value="Enter at least one email address.");const a="vip"===ca.grantType;if(!a&&!ca.cohort)return void(da.value="Choose a cohort.");let t;if(""!==ca.durationDays.trim()&&(t=parseInt(ca.durationDays,10),isNaN(t)||t<1))return void(da.value="Duration (days) must be a whole number ≥ 1.");ra.value=!0;const{data:l,error:o}=await d.inviteAccess({emails:e,grantType:ca.grantType,code:a?void 0:ca.cohort,durationDays:t});if(ra.value=!1,o)return void(da.value=Ee(o,"Failed to grant access."));const i=[];l?.granted&&i.push(`${l.granted} granted`),l?.invited&&i.push(`${l.invited} invited`),l?.skipped&&i.push(`${l.skipped} skipped`),l?.errors&&i.push(`${l.errors} failed`),T.showSnackbar({message:i.length?`${i.join(", ")}.`:"Access granted.",color:l?.errors?"warning":"success",timeout:4e3}),sa.value=!1,await Promise.all([na(),$e()])}const va=I(!1),ya=I(!1),fa=I(null),ha=S({email:"",mode:"days",additionalDays:"",expiresAt:""});async function ba(){fa.value=null;const e={email:ha.email};if("days"===ha.mode){const a=parseInt(ha.additionalDays,10);if(isNaN(a)||0===a)return void(fa.value="Enter a non-zero number of days (negative shortens).");e.additionalDays=a}else{if(!ha.expiresAt)return void(fa.value="Pick a new expiry date/time.");e.expiresAt=ha.expiresAt}ya.value=!0;const{error:a}=await d.extendGrant(e);ya.value=!1,a?fa.value=Ee(a,"Failed to update timespan."):(T.showSnackbar({message:`Updated timespan for ${ha.email}.`,color:"success",timeout:3e3}),va.value=!1,await na())}return j((()=>{$e(),na()})),(a,t)=>($(),z(e,{title:"Admin - Preview Access",subtitle:"Manage preview-access cohorts (codes) and participants"},{default:N((()=>[L(u,{modelValue:M(Te),"onUpdate:modelValue":t[0]||(t[0]=e=>O(Te)?Te.value=e:null),color:"primary",class:"mb-4"},{default:N((()=>[L(m,{value:"cohorts",class:"text-none"},{default:N((()=>[L(i,{icon:"mdi-ticket-confirmation-outline",start:""}),t[30]||(t[30]=G(" Cohorts ",-1))])),_:1}),L(m,{value:"participants",class:"text-none"},{default:N((()=>[L(i,{icon:"mdi-account-multiple-outline",start:""}),t[31]||(t[31]=G(" Participants ",-1))])),_:1})])),_:1},8,["modelValue"]),L(p,{modelValue:M(Te),"onUpdate:modelValue":t[3]||(t[3]=e=>O(Te)?Te.value=e:null)},{default:N((()=>[L(v,{value:"cohorts"},{default:N((()=>[W("div",X,[W("div",B,[t[34]||(t[34]=W("p",{class:"intro-text"}," A cohort is a redeemable code with a duration, optional capacity, and optional deadline. Closing a code stops new redemptions but does not end access for people already enrolled. ",-1)),W("div",Q,[L(n,{icon:"",variant:"text",size:"small",color:"grey",loading:M(je),onClick:$e},{default:N((()=>[L(i,{icon:"mdi-refresh",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[32]||(t[32]=[G("Refresh",-1)])])),_:1})])),_:1},8,["loading"]),L(n,{color:"primary",variant:"flat",size:"small",class:"text-none",onClick:Qe},{default:N((()=>[L(i,{icon:"mdi-plus",size:"18",start:""}),t[33]||(t[33]=G(" New cohort ",-1))])),_:1})])])]),M(je)||!M(ze)?($(),F("div",Y,[L(s,{indeterminate:"",color:"primary",size:"48"}
1),t[35]||(t[35]=W("p",null,"Loading cohorts...",-1))])):M(Ne)?($(),F("div",J,[L(i,{icon:"mdi-alert-circle",size:"48",color:"error"}),t[37]||(t[37]=W("h3",null,"Unable to Load Cohorts",-1)),W("p",null,H(M(Ne)),1),L(n,{onClick:$e,color:"primary",variant:"outlined",class:"text-none"},{default:N((()=>[L(i,{icon:"mdi-refresh",start:""}),t[36]||(t[36]=G(" Try Again ",-1))])),_:1})])):0===M(Re).length?($(),F("div",ee,[L(i,{icon:"mdi-ticket-outline",size:"64",color:"grey"}),t[39]||(t[39]=W("h3",null,"No Cohorts",-1)),t[40]||(t[40]=W("p",null,"Create a cohort to hand out a preview-access signup code.",-1)),L(n,{color:"primary",variant:"flat",class:"text-none",onClick:Qe},{default:N((()=>[L(i,{icon:"mdi-plus",start:""}),t[38]||(t[38]=G(" New cohort ",-1))])),_:1})])):($(),F("div",ae,[L(f,{headers:[{title:"Code",key:"code",sortable:!0},{title:"Label",key:"label",sortable:!0},{title:"Duration",key:"durationDays",sortable:!0},{title:"Capacity",key:"capacity",sortable:!1},{title:"Valid Until",key:"validUntil",sortable:!0},{title:"Enabled",key:"enabled",sortable:!1},{title:"Actions",key:"actions",sortable:!1,align:"end"}],items:M(Re),"items-per-page":25,"item-value":"code",density:"comfortable",class:"admin-table"},{"item.code":N((({item:e})=>[W("code",te,H(e.code),1)])),"item.label":N((({item:e})=>[W("span",le,H(e.label||"—"),1)])),"item.durationDays":N((({item:e})=>[G(H(e.durationDays)+" days ",1)])),"item.capacity":N((({item:e})=>[W("span",null,H(e.enrolled)+" / "+H(null==e.maxParticipants?"∞":e.maxParticipants),1),null!=e.remaining?($(),F("span",oe,"("+H(e.remaining)+" left)",1)):Z("",!0)])),"item.validUntil":N((({item:e})=>[W("span",ie,H(Ie(e.validUntil)),1)])),"item.enabled":N((({item:e})=>[L(h,{"model-value":e.enabled,color:"primary",density:"compact","hide-details":"",loading:M(Je)===e.code,"onUpdate:modelValue":a=>async function(e,a){Je.value=e.code;const t=e.enabled;e.enabled=a;const{error:l}=await d.updateCohort(e.code,{enabled:a});if(Je.value=null,l)return e.enabled=t,void T.showSnackbar({message:Ee(l,"Failed to update cohort."),color:"error",timeout:5e3});T.showSnackbar({message:a?"Cohort opened for new redemptions.":"Cohort closed — existing participants keep access.",color:"success",timeout:3500})}(e,!!a)},null,8,["model-value","loading","onUpdate:modelValue"])])),"item.actions":N((({item:e})=>[W("div",ne,[L(n,{icon:"",variant:"text",size:"x-small",onClick:a=>Be(e.code)},{default:N((()=>[L(i,{icon:"mdi-link-variant",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[41]||(t[41]=[G("Copy signup link",-1)])])),_:1})])),_:1},8,["onClick"]),L(n,{icon:"",variant:"text",size:"x-small",onClick:a=>{return t=e,Me.value=t,Fe.slug="",Fe.label=t.label??"",Fe.durationDays=String(t.durationDays),Fe.maxParticipants=null==t.maxParticipants?"":String(t.maxParticipants),Fe.validUntil=t.validUntil?t.validUntil.slice(0,16):"",Fe.enabled=t.enabled,We.value=null,void(Oe.value=!0);var t}},{default:N((()=>[L(i,{icon:"mdi-pencil-outline",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[42]||(t[42]=[G("Edit",-1)])])),_:1})])),_:1},8,["onClick"]),L(n,{icon:"",variant:"text",size:"x-small",color:"error",onClick:a=>async function(e){const a=e.enrolled>0?` ${e.enrolled} participant${1===e.enrolled?"":"s"} already redeemed this code.`:"";if(!(await T.showModal({title:"Delete cohort?",message:`Permanently delete "${e.code}"? This can't be undone and its signup link will stop working.${a}`,confirmText:"Delete",cancelText:"Cancel"})))return;const{error:t}=await d.deleteCohort(e.code);t?T.showSnackbar({message:Ee(t,"Failed to delete cohort."),color:"error",timeout:5e3}):(T.showSnackbar({message:`Cohort "${e.code}" deleted.`,color:"success",timeout:3e3}),await $e())}(e)},{default:N((()=>[L(i,{icon:"mdi-delete-outline",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[43]||(t[43]=[G("Delete",-1)])])),_:1})])),_:1},8,["onClick"])])])),_:1},8,["items"])]))])),_:1}),L(v,{value:"participants"},{default:N((()=>[W("div",se,[W("div",re,[W("div",de,[L(b,{modelValue:M(oa),"onUpdate:modelValue":t[1]||(t[1]=e=>O(oa)?oa.value=e:null),items:[{title:"All cohorts",value:""},...M(Le)],label:"Cohort",variant:"outlined",density:"compact","hide-details":"",style:{"max-width":"240px"}},null,8,["modelValue","items"]),L(b,{modelValue:M(ia),"onUpdate:modelValue":t[2]||(t[2]=e=>O(ia)?ia.value=e:null),items:[{title:"All",value:"all"},{title:"Active",value:"active"},{title:"Inactive",value:"inactive"}],label:"Status",variant:"outlined",density:"compact","hide-details":"",style:{"max-width":"160px"}},null,8,["modelValue"])]),W("div",ce,[L(n,{icon:"",variant:"text",size:"small",color:"grey",loading:M(aa),onClick:na},{default:N((()=>[L(i,{icon:"mdi-refresh",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[44]||(t[44]=[G("Refresh",-1)])])),_:1})])),_:1},8,["loading"]),L(n,{color:"primary",variant:"flat",size:"small",class:"text-none",onClick:ma},{default:N((()=>[L(i,{icon:"mdi-account-plus-outline",size:"18",start:""}),t[45]||(t[45]=G(" Grant access ",-1))])),_:1})])])]),M(aa)||!M(ta)?($(),F("div",ue,[L(s,{indeterminate:"",color:"primary",size:"48"}
1),t[46]||(t[46]=W("p",null,"Loading participants...",-1))])):M(la)?($(),F("div",me,[L(i,{icon:"mdi-alert-circle",size:"48",color:"error"}),t[48]||(t[48]=W("h3",null,"Unable to Load Participants",-1)),W("p",null,H(M(la)),1),L(n,{onClick:na,color:"primary",variant:"outlined",class:"text-none"},{default:N((()=>[L(i,{icon:"mdi-refresh",start:""}),t[47]||(t[47]=G(" Try Again ",-1))])),_:1})])):0===M(ea).length?($(),F("div",pe,[L(i,{icon:"mdi-account-off-outline",size:"64",color:"grey"}),t[50]||(t[50]=W("h3",null,"No Participants",-1)),t[51]||(t[51]=W("p",null,"No grants match the current filters. Grant access directly, or share a cohort code.",-1)),L(n,{color:"primary",variant:"flat",class:"text-none",onClick:ma},{default:N((()=>[L(i,{icon:"mdi-account-plus-outline",start:""}),t[49]||(t[49]=G(" Grant access ",-1))])),_:1})])):($(),F("div",ve,[L(f,{headers:[{title:"Email",key:"email",sortable:!0},{title:"Cohort",key:"cohortCode",sortable:!0},{title:"Granted",key:"grantedAt",sortable:!0},{title:"Expires",key:"expiresAt",sortable:!0},{title:"Status",key:"status",sortable:!1},{title:"Actions",key:"actions",sortable:!1,align:"end"}],items:M(ea),"items-per-page":25,"item-value":"email",density:"comfortable",class:"admin-table"},{"item.email":N((({item:e})=>[W("span",ye,H(e.email),1)])),"item.cohortCode":N((({item:e})=>["manual"!==e.cohortCode?($(),F("code",fe,H(e.cohortCode),1)):($(),F("span",he,"manual"))])),"item.grantedAt":N((({item:e})=>[W("span",be,H(Ie(e.grantedAt)),1)])),"item.expiresAt":N((({item:e})=>[W("span",ge,H(Ie(e.expiresAt)),1)])),"item.status":N((({item:e})=>[L(g,{color:Se(e).color,size:"x-small",variant:"flat"},{default:N((()=>[G(H(Se(e).label),1)])),_:2},1032,["color"])])),"item.actions":N((({item:e})=>[W("div",xe,[L(n,{icon:"",variant:"text",size:"x-small",onClick:a=>{return t=e,ha.email=t.email,ha.mode="days",ha.additionalDays="",ha.expiresAt=t.expiresAt?t.expiresAt.slice(0,16):"",fa.value=null,void(va.value=!0);var t}},{default:N((()=>[L(i,{icon:"mdi-clock-edit-outline",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[52]||(t[52]=[G("Extend / shorten",-1)])])),_:1})])),_:1},8,["onClick"]),L(n,{icon:"",variant:"text",size:"x-small",color:"error",disabled:!e.active,onClick:a=>async function(e){if(!(await T.showModal({title:"Revoke preview access?",message:`Revoke access for ${e.email} immediately? This strips their preview access. Their account remains; they simply lose Pro-level access.`,confirmText:"Revoke",cancelText:"Cancel"})))return;const{data:a,error:t}=await d.revokeAccess(e.email);t?T.showSnackbar({message:Ee(t,"Failed to revoke access."),color:"error",timeout:5e3}):(T.showSnackbar({message:a?.revoked?`Revoked access for ${e.email}.`:`${e.email} had no active grant.`,color:a?.revoked?"success":"info",timeout:3500}),await Promise.all([na(),$e()]))}(e)},{default:N((()=>[L(i,{icon:"mdi-cancel",size:"20"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[53]||(t[53]=[G("Revoke",-1)])])),_:1})])),_:1},8,["disabled","onClick"])])])),_:1},8,["items"])]))])),_:1})])),_:1},8,["modelValue"]),L(x,{modelValue:M(Oe),"onUpdate:modelValue":t[12]||(t[12]=e=>O(Oe)?Oe.value=e:null),"max-width":"560",persistent:""},{default:N((()=>[L(k,{rounded:"xl"},{default:N((()=>[L(_,{class:"modal-header"},{default:N((()=>[W("span",ke,H(M(He)?"Edit Cohort":"New Cohort"),1),L(n,{icon:"mdi-close",variant:"text",size:"small",onClick:t[4]||(t[4]=e=>Oe.value=!1)})])),_:1}),L(C),L(V,{class:"modal-body"},{default:N((()=>[M(We)?($(),z(A,{key:0,type:"error",variant:"tonal",density:"compact",class:"mb-4"},{default:N((()=>[G(H(M(We)),1)])),_:1})):Z("",!0),M(He)?($(),F("div",_e,[t[54]||(t[54]=W("div",{class:"field-label mb-1"},"Code",-1)),W("code",Ve,H(M(Me)?.code),1)])):($(),z(U,{key:2,modelValue:M(Fe).slug,"onUpdate:modelValue":t[5]||(t[5]=e=>M(Fe).slug=e),label:"Slug (optional)",placeholder:"e.g., fall2026",variant:"outlined",density:"comfortable",class:"mb-3",hint:"A friendly prefix. The server appends a random suffix to form the full code.","persistent-hint":""},null,8,["modelValue"])),L(U,{modelValue:M(Fe).label,"onUpdate:modelValue":t[6]||(t[6]=e=>M(Fe).label=e),label:"Label (optional)",placeholder:"e.g., Fall 2026 cohort",variant:"outlined",density:"comfortable",class:"mb-3","hide-details":""},null,8,["modelValue"]),L(U,{modelValue:M(Fe).durationDays,"onUpdate:modelValue":t[7]||(t[7]=e=>M(Fe).durationDays=e),label:"Duration (days)",type:"number",min:"1",variant:"outlined",density:"comfortable",class:"mb-3",hint:M(He)?"Only affects future redemptions — existing participants keep their expiry (use Extend to change them)":"How long access lasts after a participant redeems","persistent-hint":""},null,8,["modelValue","hint"]),L(U,{modelValue:M(Fe).maxParticipants,"onUpdate:modelValue":t[8]||(t[8]=e=>M(Fe).maxParticipants=e),label:"Max participants (optional)",type:"number",min:"1",variant:"outlined",density:"comfortable",class:"mb-3",hint:"Leave blank for unlimited","persistent-hint":""},null,8,["modelValue"]),L(U,{modelValue:M(Fe).validUntil,"onUpdate:modelValue":t[9]||(t[9]=e=>M(Fe).validUntil=e),label:"Redemption deadline (optional, UTC)",type:"datetime-local",variant:"outlined",density:"comfortable",class:"mb-3",hint:"After this, the code can no longer be redeemed. Leave blank for no deadline.","persistent-hint":""},null,8,["modelValue"]),L(h,{modelValue:M(Fe).enabled,"onUpdate:modelValue":t[10]||(t[10]=e=>M(Fe).enabled=e),label:"Enabled (open for new redemptions)",color:"primary",density:"compact","hide-details":""},null,8,["modelValue"])])),_:1}),L(C),L(w,{class:"modal-actions"},{default:N((()=>[L(P),L(n,{variant:"text",class:"text-none",onClick:t[11]||(t[11]=e=>Oe.value=!1)},{default:N((()=>[...t[55]||(t[55]=[G("Cancel",-1)])])),_:1}),L(n,{color:"primary",variant:"flat",class:"text-none",loading:M(Ge),onClick:Ye},{default:N((()=>[G(H(M(He)?"Save Changes":"Create"),1)])),_:1},8,["loading"])])),_:1})])),_:1})])),_:1},8,["modelValue"]),L(x,{modelValue:M(qe),"onUpdate:modelValue":t[16]||(t[16]=e=>O(qe)?qe.value=e:null),"max-width":"520"},{default:N((()=>[L(k,{rounded:"xl"},{default:N((()=>[L(_,{class:"modal-header"},{default:N((()=>[t[56]||(t[56]=W("span",{class:"modal-title"},"Cohort created",-1)),L(n,{icon:"mdi-close",variant:"text",size:"small",onClick:t[13]||(t[13]=e=>qe.value=!1)})])),_:1}),L(C),L(V,{class:"modal-body"},{default:N((()=>[t[59]||(t[59]=W("p",{class:"mb-2"}
1,"Share this signup link with participants:",-1)),W("div",we,[W("code",Ce,H(M(Xe)),1),L(n,{icon:"",variant:"text",size:"small",onClick:t[14]||(t[14]=e=>Be(M(Ze)?.code??""))},{default:N((()=>[L(i,{icon:"mdi-content-copy",size:"18"}),L(y,{activator:"parent",location:"top"},{default:N((()=>[...t[57]||(t[57]=[G("Copy",-1)])])),_:1})])),_:1})]),W("p",Ae,[t[58]||(t[58]=G(" Code: ",-1)),W("code",Ue,H(M(Ze)?.code),1),M(Ze)?.label?($(),F("span",Pe," · "+H(M(Ze)?.label),1)):Z("",!0)])])),_:1}),L(C),L(w,{class:"modal-actions"},{default:N((()=>[L(P),L(n,{color:"primary",variant:"flat",class:"text-none",onClick:t[15]||(t[15]=e=>qe.value=!1)},{default:N((()=>[...t[60]||(t[60]=[G("Done",-1)])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"]),L(x,{modelValue:M(sa),"onUpdate:modelValue":t[23]||(t[23]=e=>O(sa)?sa.value=e:null),"max-width":"560",persistent:""},{default:N((()=>[L(k,{rounded:"xl"},{default:N((()=>[L(_,{class:"modal-header"},{default:N((()=>[W("span",De,"Grant "+H("vip"===M(ca).grantType?"VIP":"Preview")+" Access",1),L(n,{icon:"mdi-close",variant:"text",size:"small",onClick:t[17]||(t[17]=e=>sa.value=!1)})])),_:1}),L(C),L(V,{class:"modal-body"},{default:N((()=>[M(da)?($(),z(A,{key:0,type:"error",variant:"tonal",density:"compact",class:"mb-4"},{default:N((()=>[G(H(M(da)),1)])),_:1})):Z("",!0),L(r,{modelValue:M(ca).grantType,"onUpdate:modelValue":t[18]||(t[18]=e=>M(ca).grantType=e),mandatory:"",variant:"outlined",density:"comfortable",divided:"",class:"mb-4"},{default:N((()=>[L(n,{value:"preview",size:"small",class:"text-none"},{default:N((()=>[...t[61]||(t[61]=[G("Preview (cohort)",-1)])])),_:1}),L(n,{value:"vip",size:"small",class:"text-none"},{default:N((()=>[...t[62]||(t[62]=[G("VIP",-1)])])),_:1})])),_:1},8,["modelValue"]),L(D,{modelValue:M(ca).emails,"onUpdate:modelValue":t[19]||(t[19]=e=>M(ca).emails=e),label:"Emails",placeholder:"[email protected], [email protected]",variant:"outlined",density:"comfortable",class:"mb-3",rows:"3","auto-grow":"",hint:M(ua).length?`${M(ua).length} email${1===M(ua).length?"":"s"}`:"One or more, separated by commas, spaces, or new lines.","persistent-hint":""},null,8,["modelValue","hint"]),"preview"===M(ca).grantType?($(),z(b,{key:1,modelValue:M(ca).cohort,"onUpdate:modelValue":t[20]||(t[20]=e=>M(ca).cohort=e),items:M(Le),label:"Cohort",placeholder:"Select a cohort",variant:"outlined",density:"comfortable",class:"mb-3","hide-details":""},null,8,["modelValue","items"])):Z("",!0),L(U,{modelValue:M(ca).durationDays,"onUpdate:modelValue":t[21]||(t[21]=e=>M(ca).durationDays=e),label:"Duration (days)",type:"number",min:"1",variant:"outlined",density:"comfortable",hint:"vip"===M(ca).grantType?"Optional — leave blank for indefinite access":"Optional — overrides the cohort duration","persistent-hint":""},null,8,["modelValue","hint"])])),_:1}),L(C),L(w,{class:"modal-actions"},{default:N((()=>[L(P),L(n,{variant:"text",class:"text-none",onClick:t[22]||(t[22]=e=>sa.value=!1)},{default:N((()=>[...t[63]||(t[63]=[G("Cancel",-1)])])),_:1}),L(n,{color:"primary",variant:"flat",class:"text-none",loading:M(ra),onClick:pa},{default:N((()=>[...t[64]||(t[64]=[G(" Grant access ",-1)])])),_:1},8,["loading"])])),_:1})])),_:1})])),_:1},8,["modelValue"]),L(x,{modelValue:M(va),"onUpdate:modelValue":t[29]||(t[29]=e=>O(va)?va.value=e:null),"max-width":"560",persistent:""},{default:N((()=>[L(k,{rounded:"xl"},{default:N((()=>[L(_,{class:"modal-header"},{default:N((()=>[t[65]||(t[65]=W("span",{class:"modal-title"},"Change Timespan",-1)),L(n,{icon:"mdi-close",variant:"text",size:"small",onClick:t[24]||(t[24]=e=>va.value=!1)})])),_:1}),L(C),L(V,{class:"modal-body"},{default:N((()=>[M(fa)?($(),z(A,{key:0,type:"error",variant:"tonal",density:"compact",class:"mb-4"},{default:N((()=>[G(H(M(fa)),1)])),_:1})):Z("",!0),L(U,{"model-value":M(ha).email,label:"Participant",variant:"outlined",density:"comfortable",class:"mb-3",readonly:"","hide-details":""},null,8,["model-value"]),L(r,{modelValue:M(ha).mode,"onUpdate:modelValue":t[25]||(t[25]=e=>M(ha).mode=e),mandatory:"",density:"comfortable",class:"mb-4",color:"primary"},{default:N((()=>[L(n,{value:"days",class:"text-none"},{default:N((()=>[...t[66]||(t[66]=[G("Add / subtract days",-1)])])),_:1}),L(n,{value:"date",class:"text-none"},{default:N((()=>[...t[67]||(t[67]=[G("Set exact expiry",-1)])])),_:1})])),_:1},8,["modelValue"]),"days"===M(ha).mode?($(),z(U,{key:1,modelValue:M(ha).additionalDays,"onUpdate:modelValue":t[26]||(t[26]=e=>M(ha).additionalDays=e),label:"Days to add",type:"number",variant:"outlined",density:"comfortable",hint:"Use a negative number to shorten","persistent-hint":""},null,8,["modelValue"])):($(),z(U,{key:2,modelValue:M(ha).expiresAt,"onUpdate:modelValue":t[27]||(t[27]=e=>
1M(ha).expiresAt=e),label:"New expiry (UTC)",type:"datetime-local",variant:"outlined",density:"comfortable",hint:"Must be in the future","persistent-hint":""},null,8,["modelValue"]))])),_:1}),L(C),L(w,{class:"modal-actions"},{default:N((()=>[L(P),L(n,{variant:"text",class:"text-none",onClick:t[28]||(t[28]=e=>va.value=!1)},{default:N((()=>[...t[68]||(t[68]=[G("Cancel",-1)])])),_:1}),L(n,{color:"primary",variant:"flat",class:"text-none",loading:M(ya),onClick:ba},{default:N((()=>[...t[69]||(t[69]=[G(" Save ",-1)])])),_:1},8,["loading"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1}))}}),[["__scopeId","data-v-dd6dca6c"]]);export{Te 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.