PageSourceSearch

https://www.innera.ai/_next/static/chunks/pages/journals/prompted/inbox-5e5d5e3bbe9a8c52.js

js innera.ai collected 2026-10-05 13:58:16 UTC 10,671 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[803],{10054:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var a=s(37876),r=s(14232),l=s(14e3),n=s(71493);function d(e){let{children:t}=e,{user:s,isLoading:d}=(0,n.A)(),i=(0,l.useRouter)();return((0,r.useEffect)(()=>{if(!d&&!s)return void i.replace("/login")},[d,s,i]),d||!s)?(0,a.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,a.jsx)("span",{className:"text-gray-500",children:"loading..."})}):(0,a.jsx)(a.Fragment,{children:t})}},22716:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>v,default:()=>y});var a=s(37876),r=s(14232),l=s(89099),n=s(77328),d=s.n(n),i=s(10054),o=s(90434),c=s(79247),x=s(17963);let u=(0,x.A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var m=s(73884),h=s(72502);let p=(0,x.A)("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);var f=s(9641),b=s(470),g=s(82963),w=s(45634);function j(){let e=(0,l.useRouter)(),{settings:t}=(0,b.t0)(),[s,n]=(0,r.useState)([]),[i,x]=(0,r.useState)(!0),[j,v]=(0,r.useState)(null),[y,N]=(0,r.useState)("active");(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{x(!0),v(null);let t=await (0,f.He$)({limit:50});if(t.some(e=>"delivered"===e.status||"pending"===e.status)&&w.i.getState().maybeGeneratePrompt(),!e)return;let s=[...t].sort((e,t)=>{let s=new Date(e.created_at).getTime();return new Date(t.created_at).getTime()-s});n(s)}catch(t){if(!e)return;v((null==t?void 0:t.message)||"Something went wrong while loading your prompts.")}finally{e&&x(!1)}})(),()=>{e=!1}},[]);let k=(0,r.useMemo)(()=>"all"===y?s:"done"===y?s.filter(e=>"done"===e.status):s.filter(e=>{var t;return"done"!==(t=e.status)&&"expired"!==t&&"failed"!==t}),[s,y]);async function _(t){try{if("delivered"===t.status||"pending"===t.status){let e=await (0,f.GkE)(t.id);n(s=>s.map(s=>s.id===t.id?e:s)),t=e}e.push("/journals/write?text=".concat(encodeURIComponent(t.prompt_text),"&pid=").concat(t.id))}catch(s){e.push("/journals/write?text=".concat(encodeURIComponent(t.prompt_text),"&pid=").concat(t.id))}}async function A(e){try{let t=await (0,f.Dhg)(e);n(s=>s.map(s=>s.id===e?t:s))}catch(e){}}async function C(e){try{let t=await (0,f.SWA)(e);n(s=>s.map(s=>s.id===e?t:s).sort((e,t)=>{let s=new Date(e.created_at).getTime();return new Date(t.created_at).getTime()-s}))}catch(e){}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d(),{children:(0,a.jsx)("title",{children:"Prompt Inbox \xb7 Innera"})}),(0,a.jsx)("main",{className:"min-h-screen px-4 py-8",children:(0,a.jsxs)("div",{className:"mx-auto max-w-5xl space-y-8",children:[(0,a.jsxs)("header",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/80 px-3 py-1 text-[11px] font-medium text-slate-600 dark:text-slate-300 shadow-sm border border-white/70",children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5 text-violet-500"}),(0,a.jsx)("span",{children:"Prompted \xb7 Inbox"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl md:text-3xl font-bold tracking-tight text-[color:var(--innera-text)]",children:"Prompt nudges & history"}),(0,a.jsx)("p",{className:"mt-1 text-xs md:text-sm max-w-xl text-[color:var(--innera-subtext)]",children:"All the prompts Innera has gently dropped for you — see what arrived, what you finished, and what you want to revisit."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>e.push("/journals/prompted/schedules"),className:"inline-flex items-center gap-2 rounded-full bg-slate-900 text-white px-4 py-2 text-xs font-semibold shadow-md hover:shadow-lg",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),"Manage schedules"]})]}),(0,a.jsxs)("section",{className:"dash-surface rounded-3xl shadow-lg p-5 md:p-7 space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[color:var(--innera-subtext)]",children:[(0,a.jsx)(u,{className:"h-4 w-4 text-violet-500"}),(0,a.jsx)("span",{children:"Prompt history"})]}),(0,a.jsx)("div",{className:"inline-flex items-center gap-1 rounded-full bg-white/60 dark:bg-white/10 p-1 border border-white/40 dark:border-white/10",children:["active","done","all"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>N(e),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition ".concat(y===e?"bg-white/80 dark:bg-white/15 text-[color:var(--innera-text)] shadow-sm":"text-[color:var(--innera-subtext)] opacity-80"),children:"active"===e?"Active":"done"===e?"Completed":"All"},e))})]}),i?(0,a.jsx)("p",{className:"text-xs ui-muted",children:"Loading your prompts…"}):j?(0,a.jsx)("div",{className:"rounded-2xl border border-rose-100 bg-rose-50/70 px-4 py-3 text-xs text-rose-700 dark:text-rose-300",children:j}):0===k.length?(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-slate-200 bg-slate-50/70 px-4 py-6 text-center space-y-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-slate-800 dark:text-slate-200",children:"No prompts here yet."}),(0,a.jsx)("p",{className:"text-xs ui-muted max-w-sm mx-auto",children:"Once your Prompted schedules start firing, new nudges will land here — and you can finish, revisit, or clear them anytime."}),(0,a.jsxs)("button",{type:"button",onClick:()=>e.push("/journals/prompted/schedules"),className:"inline-flex items-center gap-2 rounded-full bg-gradient-to-r from-[#7B5CFF] to-[#FF6AD5] text-white px-4 py-2 text-xs font-semibold shadow-md hover:shadow-lg",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),"Create a schedule"]})]}):(0,a.jsx)("div",{className:"space-y-3",children:k.map(e=>{var s,r,l,n,d,i,o,x,u;let f="done"===e.status,b="expired"===e.status||"failed"===e.status,w=(null==(s=e.meta)?void 0:s.schedule_label)||(null==(r=e.meta)?void 0:r.from_schedule_label)||null;return(0,a.jsxs)("article",{className:"group dash-surface rounded-2xl p-4 flex flex-col gap-3 transition-all hover:-translate-y-[1px]",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>_(e),className:"h-9 w-9 flex-shrink-0 rounded-2xl bg-gradient-to-br from-violet-500 to-sky-500 text-white grid place-items-center shadow-sm",children:(0,a.jsx)(m.A,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,a.jsx)("p",{className:"text-[13px] md:text-sm font-medium leading-snug text-[color:var(--innera-text)]",children:e.prompt_text})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-[color:var(--innera-subtext)]",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border px-2 py-0.5 ".concat(function(e){switch(e){case"done":return"bg-emerald-50 text-emerald-700 dark:text-emerald-300 border-emerald-100";case"opened":return"bg-sky-50 text-sky-700 dark:text-sky-300 border-sky-100";case"delivered":return"bg-violet-50 text-violet-700 dark:text-violet-300 border-violet-100";
1case"expired":return"bg-slate-50 text-slate-600 dark:text-slate-300 border-slate-200";case"failed":return"bg-rose-50 text-rose-700 dark:text-rose-300 border-rose-100";default:return"bg-amber-50 text-amber-700 border-amber-100"}}(e.status)),children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-current/70"}),(0,a.jsx)("span",{children:function(e){switch(e){case"pending":return"Pending";case"delivered":return"Delivered";case"opened":return"Opened";case"done":return"Done";case"expired":return"Expired";case"failed":return"Failed";default:return e}}(e.status)})]}),w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"h-0.5 w-3 rounded-full bg-white/40 dark:bg-white/10"}),(0,a.jsx)("span",{children:w})]}),(0,a.jsx)("span",{className:"h-0.5 w-3 rounded-full bg-white/40 dark:bg-white/10"}),(0,a.jsx)("span",{children:(l=e.delivered_at||e.created_at,(0,g.kV)(null!=l?l:void 0,{locale:null!=(o=null==t||null==(n=t.language)?void 0:n.locale)?o:"en",timeZone:null!=(x=null==t||null==(d=t.language)?void 0:d.timeZone)?x:g.GI,time24:!!(null==(u=null==t||null==(i=t.language)?void 0:i.timeFormat24h)||u)}))})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-[color:var(--innera-subtext)]",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 ui-muted"}),(0,a.jsx)("span",{children:e.timezone?"Delivered in ".concat(e.timezone):"Delivered"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[!f&&(0,a.jsxs)("button",{type:"button",onClick:()=>_(e),className:"inline-flex items-center gap-1.5 rounded-full bg-slate-900 text-white px-3 py-1.5 text-[11px] font-semibold shadow-sm hover:shadow-md",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Write now"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>A(e.id),className:"inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[11px] font-medium ".concat(f?"bg-emerald-50 text-emerald-700 dark:text-emerald-300 border-emerald-100":"bg-white/80 ui-subtext border-slate-200 hover:bg-slate-50"),children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:f?"Marked done":"Mark as done"})]}),b&&(0,a.jsxs)("button",{type:"button",onClick:()=>C(e.id),className:"inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white/80 px-3 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-50",children:[(0,a.jsx)(p,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Resend"})]})]})]})]},e.id)})})]}),(0,a.jsxs)("section",{className:"pb-6 text-[11px] ui-muted flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{children:"Phase 6 \xb7 Prompted delivery"}),(0,a.jsx)("span",{className:"h-0.5 w-3 rounded-full bg-slate-300"}),(0,a.jsx)("span",{children:"Next up: richer push settings & deeper analytics."})]})]})})]})}var v=!0;function y(){return(0,a.jsx)(i.A,{children:(0,a.jsx)(j,{})})}},33204:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/journals/prompted/inbox",function(){return s(22716)}])},77328:(e,t,s)=>{e.exports=s(29269)}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=33204)),_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.