PageSourceSearch

https://jargon-gym.vercel.app/_next/static/chunks/3hra0h878o07b.js

js jargon-gym.vercel.app collected 2026-10-03 07:09:02 UTC 16,489 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,696718,e=>{"use strict";var t=e.i(10276),s=e.i(330009);e.s(["ConfirmDialog",0,function({isOpen:e,onOpenChange:n,title:a,description:i,confirmLabel:l,onConfirm:r}){return(0,t.jsxs)(s.AlertDialog,{isOpen:e,onOpenChange:n,children:[(0,t.jsxs)(s.AlertDialogHeader,{children:[(0,t.jsx)(s.AlertDialogTitle,{children:a}),(0,t.jsx)(s.AlertDialogDescription,{children:i})]}),(0,t.jsxs)(s.AlertDialogFooter,{children:[(0,t.jsx)(s.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(s.AlertDialogAction,{onPress:r,children:l})]})]})}])},330009,e=>{"use strict";var t=e.i(10276),s=e.i(334900),n=e.i(248992),a=e.i(988676),i=e.i(647163),l=e.i(167881);function r({className:e,children:s,...n}){return(0,t.jsx)(a.ModalOverlay,{"data-slot":"alert-dialog-overlay",className:(0,i.cn)("modal modal-open",e),...n,children:s})}e.s(["AlertDialog",0,function({className:e,children:n,...l}){return(0,t.jsx)(r,{...l,children:(0,t.jsx)(a.Modal,{"data-slot":"alert-dialog-content",className:(0,i.cn)("modal-box max-w-sm",e),children:(0,t.jsx)(s.Dialog,{"data-slot":"alert-dialog",role:"alertdialog",className:"flex flex-col gap-3 outline-none",children:n})})})},"AlertDialogAction",0,function({className:e,...s}){return(0,t.jsx)(l.Button,{slot:"close","data-slot":"alert-dialog-action",className:(0,i.cn)(e),...s})},"AlertDialogCancel",0,function({className:e,variant:s="outline",...n}){return(0,t.jsx)(l.Button,{slot:"close","data-slot":"alert-dialog-cancel",className:(0,i.cn)(e),variant:s,...n})},"AlertDialogDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-description",className:(0,i.cn)("text-sm text-base-content/70",e),...s})},"AlertDialogFooter",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,i.cn)("modal-action flex-col-reverse sm:flex-row sm:justify-end",e),...s})},"AlertDialogHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,i.cn)("flex flex-col gap-1 text-center sm:text-left",e),...s})},"AlertDialogTitle",0,function({className:e,...s}){return(0,t.jsx)(n.Heading,{slot:"title","data-slot":"alert-dialog-title",className:(0,i.cn)("font-heading text-base font-medium",e),...s})}])},555264,e=>{"use strict";async function t(e){try{return await e()}catch(e){return console.error("Admin action call failed:",e),{ok:!1,error:"Couldn't reach the server. Reload the page and try again."}}}e.s(["settleAdminAction",0,t])},897800,e=>{"use strict";var t=e.i(530362),s=e.i(555264),n=e.i(6799);
1e.s(["useAdminAction",0,function(){let[e,a]=(0,t.useState)(null),[i,l]=(0,t.useTransition)(),{toast:r}=(0,n.useToast)();return{run:function(e,t={}){return a(null),new Promise(n=>{l(async()=>{let i=await (0,s.settleAdminAction)(e);if(!i.ok){a(i.error),n(!1);return}t.onSuccess?.(i.data),t.successMessage&&r(t.successMessage),n(!0)})})},isPending:i,error:e,clearError:()=>a(null)}}])},319036,e=>{"use strict";var t=e.i(10276),s=e.i(647163);e.s(["Switch",0,function({className:e,onCheckedChange:n,...a}){return(0,t.jsx)("input",{type:"checkbox","data-slot":"switch",className:(0,s.cn)("toggle",e),onChange:e=>n?.(e.target.checked),...a})}])},342576,e=>{"use strict";var t=e.i(10276),s=e.i(530362),n=e.i(696718),a=e.i(319036),i=e.i(555264),l=e.i(647163);e.s(["AdminSwitch",0,function({value:e,label:r,save:o,disabled:c,busy:d,size:u="md",confirm:m,hideError:x}){let{checked:p,change:h,error:f,isPending:g}=function(e,t){let[n,a]=(0,s.useOptimistic)(e),[l,r]=(0,s.useState)(null),[o,c]=(0,s.useTransition)();return{checked:n,change:function(e){r(null),c(async()=>{a(e);let s=await (0,i.settleAdminAction)(()=>t(e));s.ok||r(s.error)})},error:l,isPending:o}}(e,o),[b,v]=(0,s.useState)(null),j=g||d;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Switch,{className:(0,l.cn)("toggle-primary","sm"===u&&"toggle-sm"),checked:p,disabled:c,"aria-disabled":j||void 0,onCheckedChange:function(e){if(j)return;let t=m?.(e)??null;t?v({next:e,confirmation:t}):h(e)},"aria-label":r}),f&&!x?(0,t.jsx)("p",{role:"alert",className:"m-0 mt-1 text-sm text-error",children:f}):null,b?(0,t.jsx)(n.ConfirmDialog,{isOpen:!0,onOpenChange:e=>!e&&v(null),...b.confirmation,onConfirm:()=>h(b.next)}):null]})}],342576)},972920,679820,e=>{"use strict";var t=e.i(948365);let s=(0,t.createServerReference)("4041d7952df0d5a3317850226e8392da9bd1796ff5",t.callServer,void 0,t.findSourceMapURL,"resetAiCredits");e.s(["resetAiCredits",0,s],972920);let n=(0,t.createServerReference)("40fec82beb9606d8d48e868fb24930901de7c3f136",t.callServer,void 0,t.findSourceMapURL,"grantAiCredits");e.s(["grantAiCredits",0,n],679820)},136934,471665,e=>{"use strict";var t=e.i(948365);let s=(0,t.createServerReference)("40fa6c8b9033e2237ec4b3e6d87bbc315f5c170fd0",t.callServer,void 0,t.findSourceMapURL,"approveWaitlistRequest");e.s(["approveWaitlistRequest",0,s],136934);let n=(0,t.createServerReference)("40ba027ebb05885eef89bbbd45f49ad819e53f2736",t.callServer,void 0,t.findSourceMapURL,"resendInvite");e.s(["resendInvite",0,n],471665)},163873,559308,e=>{"use strict";var t=e.i(948365);let s=(0,t.createServerReference)("40d34e074bb6fdd79ddfe372f5c52455bf088b7e08",t.callServer,void 0,t.findSourceMapURL,"addToNarrationAllowlist");e.s(["addToNarrationAllowlist",0,s],163873);let n=(0,t.createServerReference)("40965915687217099db24912d78b134e2815235001",t.callServer,void 0,t.findSourceMapURL,"removeFromNarrationAllowlist");e.s(["removeFromNarrationAllowlist",0,n],559308)},144269,e=>{"use strict";var t=e.i(10276),s=e.i(163873),n=e.i(559308),a=e.i(136934),i=e.i(471665),l=e.i(342576),r=e.i(6799),o=e.i(897800);function c({person:e}){let{run:s,isPending:n,error:l}=(0,o.useAdminAction)(),{toast:d}=(0,r.useToast)(),{waitlist:u}=e;return u?"pending"===u.status?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)("span",{className:"text-sm text-base-content/65",children:"Waiting for approval."}),(0,t.jsx)("button",{type:"button",className:"btn btn-outline btn-sm",disabled:n,onClick:()=>void s(()=>(0,a.approveWaitlistRequest)(u.id),{onSuccess:({emailSent:e})=>{e||d("Approved, but the email failed. Use Resend.","destructive")},successMessage:"Invite approved."}),children:n?"Approving…":"Approve"}),l?(0,t.jsx)("p",{role:"alert",className:"m-0 w-full text-sm text-error",children:l}):null]}):"invited"===u.status?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)("span",{className:"text-sm text-base-content/65",children:"Invited. They haven't signed up."}),(0,t.jsx)("button",{type:"button",className:"btn btn-outline btn-sm",disabled:n,onClick:()=>void s(()=>(0,i.resendInvite)(u.id),{successMessage:"Sent again."}),children:n?"Sending…":"Resend invite"}),l?(0,t.jsx)("p",{role:"alert",className:"m-0 w-full text-sm text-error",children:l}):null]}):(0,t.jsx)("p",{className:"m-0 text-sm text-base-content/65",children:"Signed up from the waitlist."}):(0,t.jsx)("p",{className:"m-0 text-sm text-base-content/65",children:"No waitlist request for this email."})}e.s(["AccessSection",0,function({person:e}
1){return(0,t.jsxs)("div",{className:"flex flex-col gap-4 rounded-lg border border-base-300 px-4 py-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"m-0 text-sm font-semibold",children:"Waitlist"}),(0,t.jsx)(c,{person:e}),e.referralVerified?null:(0,t.jsx)("p",{className:"m-0 text-sm text-warning",children:"They have an account but haven't finished signing up with a reference code."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"m-0 text-sm font-semibold",children:"Narration"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(l.AdminSwitch,{label:`Narration for ${e.email}`,value:"on"===e.narration,save:t=>t?(0,s.addToNarrationAllowlist)(e.email):(0,n.removeFromNarrationAllowlist)(e.id)}),(0,t.jsx)("span",{className:"text-sm text-base-content/65",children:"partly"===e.narration?"Partly on (only one of terms and stories). Turning it on allows both.":"on"===e.narration?"Can play narration when it is switched on.":"Can't play narration."})]})]})]})}])},795328,e=>{"use strict";var t=e.i(10276),s=e.i(530362),n=e.i(972920),a=e.i(696718),i=e.i(679820),l=e.i(897800);function r({person:e}){let[n,a]=(0,s.useState)("25"),[o,c]=(0,s.useState)(""),{run:d,isPending:u,error:m}=(0,l.useAdminAction)();return(0,t.jsxs)("form",{onSubmit:function(t){t.preventDefault(),d(()=>(0,i.grantAiCredits)({email:e.email,amount:Number(n),note:o}),{onSuccess:()=>c(""),successMessage:"Credits granted."})},className:"flex flex-wrap items-end gap-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-sm",children:"Credits"}),(0,t.jsx)("input",{type:"number",min:1,max:1e4,className:"input input-bordered w-28",value:n,onChange:e=>a(e.target.value)})]}),(0,t.jsxs)("label",{className:"flex min-w-40 flex-1 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-sm",children:"Note (optional)"}),(0,t.jsx)("input",{type:"text",maxLength:200,className:"input input-bordered w-full",placeholder:"Why, for your own records",value:o,onChange:e=>c(e.target.value)})]}),(0,t.jsx)("button",{type:"submit",className:"btn btn-outline",disabled:u||!n,children:u?"Granting…":"Grant credits"}),m?(0,t.jsx)("p",{role:"alert",className:"m-0 w-full text-sm text-error",children:m}):null]})}e.s(["AiSection",0,function({person:e}){let[i,o]=(0,s.useState)(!1),{run:c,isPending:d,error:u}=(0,l.useAdminAction)();
1return(0,t.jsxs)("div",{className:"flex flex-col gap-4 rounded-lg border border-base-300 px-4 py-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h3",{className:"m-0 text-sm font-semibold",children:"Their AI setup"}),(0,t.jsx)("p",{className:"m-0 text-sm text-base-content/65",children:e.key?`Uses their own ${e.key.provider} key, ending in ${e.key.last4}.`:"No key of their own. AI runs on the app's key, spending credits."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"m-0 text-sm font-semibold",children:"AI credits"}),(0,t.jsxs)("p",{className:"m-0 text-sm text-base-content/65",children:[e.credits?`${e.credits.remaining} of ${e.credits.total} left. `:"Couldn't read their balance. ","Grants add to it; a reset gives back the full allowance."]}),(0,t.jsx)(r,{person:e}),(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:"btn btn-outline btn-sm",disabled:d,onClick:()=>o(!0),children:"Reset usage"})}),u?(0,t.jsx)("p",{role:"alert",className:"m-0 text-sm text-error",children:u}):null]}),(0,t.jsx)(a.ConfirmDialog,{isOpen:i,onOpenChange:o,title:"Reset usage?",description:`${e.email} gets their full allowance back, from now on. Their history stays on record, and credits you granted are kept.`,confirmLabel:"Reset usage",onConfirm:()=>void c(()=>(0,n.resetAiCredits)(e.id),{successMessage:"Usage reset."})})]})}],795328)},786955,e=>{"use strict";var t=e.i(10276),s=e.i(597873),n=e.i(530362),a=e.i(948365);let i=(0,a.createServerReference)("40cce8f85c99c8450242f830bc881f6f6849cc0522",a.callServer,void 0,a.findSourceMapURL,"deleteUser"),l=(0,a.createServerReference)("4021140b9ea9f273275ddf89c9c31337711d1a58dd",a.callServer,void 0,a.findSourceMapURL,"removeUserApiKey"),r=(0,a.createServerReference)("40fa554dde14050428974b4b8b5ba5ddc7532acb1d",a.callServer,void 0,a.findSourceMapURL,"setUserSuspended");var o=e.i(330009),c=e.i(167881),d=e.i(897800);function u({title:e,description:s,confirmLabel:a,confirmText:i,onSubmit:l,onSuccess:r,onClose:m}){let[x,p]=(0,n.useState)(""),[h,f]=(0,n.useState)(""),{run:g,isPending:b,error:v}=(0,d.useAdminAction)(),j=void 0===i||h.trim().toLowerCase()===i.toLowerCase(),N=x.trim().length>0&&j&&!b;async function y(e){e.preventDefault(),!N||await g(()=>l({reason:x.trim(),typed:h.trim()}))&&(m(),r?.())}return(0,t.jsxs)(o.AlertDialog,{isOpen:!0,isDismissable:!b,onOpenChange:e=>{e||b||m()},children:[(0,t.jsxs)(o.AlertDialogHeader,{children:[(0,t.jsx)(o.AlertDialogTitle,{children:e}),(0,t.jsx)(o.AlertDialogDescription,{children:s})]}),(0,t.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-3",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-sm",children:"Reason (kept in the audit log)"}),(0,t.jsx)("input",{type:"text",maxLength:200,className:"input input-bordered w-full",value:x,onChange:e=>p(e.target.value),autoFocus:!0})]}),void 0!==i?(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-sm",children:["Type ",(0,t.jsx)("strong",{children:i})," to confirm"]}),(0,t.jsx)("input",{type:"text",className:"input input-bordered w-full",value:h,onChange:e=>f(e.target.value),autoComplete:"off",spellCheck:!1})]}):null,v?(0,t.jsx)("p",{role:"alert",className:"m-0 text-sm text-error",children:v}):null,(0,t.jsxs)(o.AlertDialogFooter,{children:[(0,t.jsx)(o.AlertDialogCancel,{isDisabled:b,children:"Cancel"}),(0,t.jsx)(c.Button,{type:"submit",variant:"destructive",isDisabled:!N,children:b?"Working…":a})]})]})]})}function m({title:e,text:s,children:n}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-48 flex-1",children:[(0,t.jsx)("h3",{className:"m-0 text-sm font-semibold",children:e}),(0,t.jsx)("p",{className:"m-0 text-sm text-base-content/65",children:s})]}),n]})}function x({person:e,asking:n,onClose:a}){let o=(0,s.useRouter)();return(0,t.jsxs)(t.Fragment,{children:["suspend"===n||"reactivate"===n?(0,t.jsx)(u,{title:"suspend"===n?"Suspend this account?":"Reactivate this account?",description:"suspend"===n?`${e.email} is signed out everywhere and can't sign in until you reactivate them.`:`${e.email} can sign in again. They need to log in again.`,confirmLabel:"suspend"===n?"Suspend":"Reactivate",onSubmit:({reason:t})=>r({userId:e.id,suspended:"suspend"===n,reason:t}),onClose:a}):null,"key"===n?(0,t.jsx)(u,{title:"Remove their API key?",description:`${e.email} loses their saved key. They can save a new one in settings.`,confirmLabel:"Remove key",onSubmit:({reason:t})=>l({userId:e.id,reason:t}),onClose:a}):null,"delete"===n?(0,t.jsx)(u,{title:"Delete this account?",description:`This can't be und
1one. It deletes ${e.email}, their progress, settings, key and ${e.ownedCollections} ${1===e.ownedCollections?"collection":"collections"}.`,confirmLabel:"Delete account",confirmText:e.email,onSubmit:({reason:t,typed:s})=>i({userId:e.id,reason:t,confirmEmail:s}),onSuccess:()=>o.push("/admin/people?view=members"),onClose:a}):null]})}e.s(["DangerZone",0,function({person:e}){let[s,a]=(0,n.useState)(null),i=null!==e.suspendedAt,l=e.peopleUsingCollections>0;return(0,t.jsxs)("div",{className:"flex flex-col gap-4 rounded-lg border border-error/40 px-4 py-4",children:[e.banMismatch?(0,t.jsxs)("p",{role:"alert",className:"m-0 text-sm text-warning",children:["Their sign-in ban and suspended flag don't match, which only a manual database edit causes."," ",i?"Suspend again to repair it.":"Reactivate to clear it, or suspend to make it match."]}):null,(0,t.jsx)(m,{title:i?"Reactivate account":"Suspend account",text:i?"They are signed out and can't use the app, Telegram or the widget. Reactivating lets them sign in again.":"Signs them out everywhere and blocks sign-in, Telegram, the widget and AI. Nothing is deleted.",children:(0,t.jsx)("button",{type:"button",className:`btn btn-sm ${i?"btn-outline":"btn-error bt
1n-outline"}`,onClick:()=>a(i?"reactivate":"suspend"),children:i?"Reactivate":"Suspend"})}),(0,t.jsx)(m,{title:"Remove their API key",text:e.key?"They fall back to the app's key and spend credits until they save a key again.":"They have no key saved.",children:(0,t.jsx)("button",{type:"button",className:"btn btn-error btn-outline btn-sm",disabled:!e.key,onClick:()=>a("key"),children:"Remove key"})}),(0,t.jsx)(m,{title:"Delete account",text:l?`Can't delete: ${e.peopleUsingCollections} other ${1===e.peopleUsingCollections?"person uses":"people use"} their collections. Make those collections private first.`:"Permanently deletes the account and everything in it. The waitlist entry stays.",children:(0,t.jsx)("button",{type:"button",className:"btn btn-error btn-sm",disabled:l,onClick:()=>a("delete"),children:"Delete account"})}),(0,t.jsx)(x,{person:e,asking:s,onClose:()=>a(null)})]})}],786955)}]);

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.