1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="387f130a-beda-4b66-8e75-9c76bfbdce0c",e._sentryDebugIdIdentifier="sentry-dbid-387f130a-beda-4b66-8e75-9c76bfbdce0c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5274],{79933:function(e,t,a){a.r(t),a.d(t,{default:function(){return E}});var n=a(57437),r=a(2265),s=a(72791),i=a(660);let l=e=>e.startsWith("["),o=e=>/^\[{1,2}\.\.\./.test(e),c=e=>e.replace(/-/g," ");var u=a(99376);function d(e){let{children:t}=e;return(0,n.jsx)("div",{className:"flex min-h-visible-viewport w-full text-dream-text-primary",children:t})}var h=a(27648),m=a(49710),p=a(52004),f=a(39170),x=a(43347);let b={moon:(0,n.jsx)("path",{d:"M20 15a8 8 0 11-11-11 6 6 0 0011 11z"}),book:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M4 4h10a4 4 0 014 4v12H8a4 4 0 01-4-4V4z"}),(0,n.jsx)("path",{d:"M4 4v12a4 4 0 014-4h10"})]}),search:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,n.jsx)("path",{d:"M20 20l-4-4"})]}),star:(0,n.jsx)("path",{d:"M12 3l2.6 6 6.4.6-4.9 4.3 1.5 6.3L12 17l-5.6 3.2 1.5-6.3L3 9.6 9.4 9z"}),user:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("circle",{cx:"12",cy:"8",r:"4"}),(0,n.jsx)("path",{d:"M4 21a8 8 0 0116 0"})]}),card:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("rect",{x:"3",y:"6",width:"18",height:"13",rx:"2"}),(0,n.jsx)("path",{d:"M3 10h18"})]}),bell:(0,n.jsx)("path",{d:"M6 8a6 6 0 1112 0c0 7 3 7 3 9H3c0-2 3-2 3-9z"})};function v(e){let{name:t,className:a,strokeWidth:r=1.5}=e;return(0,n.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r,className:a,"aria-hidden":"true",focusable:"false",children:b[t]})}function g(e){return(0,r.useMemo)(()=>{let t=[{name:"Dreamspace",shortName:"Home",href:"/dreamspace",activePath:"/dreamspace",glyph:"moon"},{name:"Journal",shortName:"Journal",href:e?"/journal":"/journal/new",activePath:"/journal",glyph:"book"},{name:"Dictionary",shortName:"Symbols",href:"/dictionary",activePath:"/dictionary",glyph:"search"},{name:"Resources",shortName:"Resources",href:"/resources",activePath:"/resources",glyph:"star"}],a=[{name:"Profile",shortName:"You",href:"/profile",activePath:"/profile",glyph:"user"},{name:"Subscription",shortName:"Plans",href:"/subscription",activePath:"/subscription",glyph:"card"}],n=[t[0],t[1],t[2],a[0]];return{primary:t,account:a,tabs:n}},[e])}function k(){var e;let t=(0,u.usePathname)(),[a,n]=(0,r.useState)(null);(0,r.useEffect)(()=>{n(null)},[t]),(0,r.useEffect)(()=>{if(null===a)return;let e=setTimeout(()=>n(null),8e3);return()=>clearTimeout(e)},[a]);let s=(0,r.useCallback)(e=>{n({path:e})},[]);return{activePath:null!==(e=null==a?void 0:a.path)&&void 0!==e?e:t,realPathname:t,markPending:s}}function j(){var e,t,a,r;let{activePath:i,realPathname:l,markPending:o}=k(),{user:c,tierConfig:u}=(0,s.a)(),{primary:d,account:b}=g((0,m.vj)("journal_save").hasAccess),j=(0,p.xc)(null!==(a=null==c?void 0:null===(e=c.subscription)||void 0===e?void 0:e.tier)&&void 0!==a?a:null==c?void 0:c.subscriptionLevel,null!==(r=null==u?void 0:u.name)&&void 0!==r?r:null),w=(null==c?void 0:null===(t=c.profile)||void 0===t?void 0:t.name)||(null==c?void 0:c.email)||"",y=w?w.charAt(0).toUpperCase():"?",N=e=>{let t=!!i&&i.startsWith(e.activePath),a=!!l&&l.startsWith(e.activePath);return(0,n.jsxs)(h.default,{href:e.href,"aria-current":a?"page":void 0,"data-state":t?"active":"inactive",onClick:()=>o(e.activePath),className:(0,x.cn)("flex items-center gap-3 rounded-xl px-3 py-[11px] text-sm","touch-manipulation transition-[color,background-color,transform] duration-150 active:scale-[0.98]",t?"bg-[color-mix(in_oklab,var(--c-orchid)_20%,transparent)] text-nk-ink":"text-nk-ink-2 hover:bg-nk-surface hover:text-nk-ink active:bg-nk-surface"),children:[(0,n.jsx)(v,{name:e.glyph,className:"h-[18px] w-[18px] shrink-0"}),e.name]},e.name)};return(0,n.jsxs)("aside",{"data-testid":"app-sidebar",className:"hidden h-visible-viewport w-60 shrink-0 flex-col gap-6 overflow-y-auto border-r border-nk-line px-5 py-7 lg:flex",children:[(0,n.jsxs)(h.default,{href:"/dreamspace","data-testid":"app-sidebar-lockup",className:"flex items-center gap-2.5 font-display text-xl text-nk-ink",children:[(0,n.jsx)(f.ee,{className:"h-7"}),(0,n.jsxs)("span",{children:["Dreams",(0,n.jsx)("em",{className:"not-italic text-nk-ink-2 italic",children:"Decoder"})]})]}),(0,n.jsxs)("nav",{"aria-label":"Primary",className:"flex flex-col gap-0.5",children:[d.map(N),(0,n.jsx)("div",{className:"mt-4 px-3 font-mono text-[10px] uppercase tracking-[0.14em] text-nk-ink-3",children:"Account"}),b.map(N)]}),(0,n.jsxs)("div",{className:"mt-auto flex items-center gap-2.5 rounded-2xl border border-nk-line bg-nk-surface p-3.5 text-[13px]",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full bg-[radial-gradient(circle_at_30%_30%,var(--c-salmon),var(--c-orchid)_80%)] font-display text-sm text-[#1B1040]",children:y}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"truncate font-medium",children:w}),j?(0,n.jsx)("div",{className:"truncate text-[11px] text-nk-ink-3",children:j}):null]})]})]})}function w(){let{tabs:e}=g((0,m.vj)("journal_save").hasAccess),{activePath:t,realPathname:a,markPending:r}=k();return(0,n.jsx)("nav",{"aria-label":"Primary","data-testid":"app-tabbar",className:"z-30 flex h-[var(--app-tabbar-h)] shrink-0 justify-around border-t border-nk-line bg-[color-mix(in_oklab,var(--nk-bg-0)_85%,transparent)] px-2 pb-[max(6px,env(safe-area-inset-bottom))] backdrop-blur-[20px] lg:hidden",children:e.map(e=>{let s=!!t&&t.startsWith(e.activePath),i=!!a&&a.startsWith(e.activePath);return(0,n.jsxs)(h.default,{href:e.href,"aria-current":i?"page":void 0,"data-state":s?"active":"inactive",onClick:()=>r(e.activePath),className:(0,x.cn)("flex flex-1 flex-col items-center justify-center gap-1 px-0.5 py-1.5 font-mono text-[10px] uppercase tracking-[0.08em]","select-none touch-manipulation transition-[color,transform] duration-150 active:scale-90",s?"text-[color-mix(in_oklab,var(--c-salmon)_85%,var(--nk-ink))]":"text-nk-ink-3"),children:[(0,n.jsx)(v,{name:e.glyph,className:"h-5 w-5",strokeWidth:1.6}),e.shortName]},e.name)})})}var y=a(67594),N=a(82148),P=a(43107),S=a(45926),_=a(69829),A=a(96857);function I(e){let{pageTitle:t,crumb:a}=e,{user:i}=(0,s.a)(),{auth:l}=(0,y.f)(),o=(0,u.useRouter)(),c=async()=>
1{if(l)try{(0,A.JF)(),await (0,N.w7)(l),await fetch("/api/auth/signout",{method:"POST"}),o.replace("/signin")}catch(e){console.error("Error signing out:",e)}};if(!i)return(0,n.jsx)("div",{className:"h-16 shrink-0 border-b border-nk-line"});let d=i.profile.name||i.email,m=d?d.charAt(0).toUpperCase():"?";return(0,n.jsxs)("div",{"data-testid":"app-topbar",className:"sticky top-0 z-30 flex min-h-16 shrink-0 items-center justify-between gap-4 border-b border-nk-line bg-[color-mix(in_oklab,var(--nk-bg-0)_85%,transparent)] px-5 pb-2 pt-[calc(env(safe-area-inset-top)+0.5rem)] backdrop-blur-[20px] lg:px-14",children:[(0,n.jsx)("span",{"data-testid":"app-crumb",className:"hidden font-mono text-[11px] uppercase tracking-[0.12em] text-nk-ink-3 lg:block",children:a}),(0,n.jsx)("h1",{className:"truncate font-display text-xl text-nk-ink lg:hidden",children:t}),(0,n.jsxs)(P.v2,{as:"div",className:"relative shrink-0",children:[(0,n.jsxs)(P.v2.Button,{className:"flex items-center gap-2 rounded-full border border-nk-line bg-nk-surface p-1 pr-2 text-sm text-nk-ink touch-manipulation transition-[transform,background-color] duration-150 hover:bg-nk-surface-2 active:scale-95 active:bg-nk-surface-2",children:[(0,n.jsx)("span",{className:"sr-only",children:"Open user menu"}),(0,n.jsx)("span",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-full bg-[radial-gradient(circle_at_30%_30%,var(--c-salmon),var(--c-orchid)_80%)] font-display text-sm text-[#1B1040]",children:m}),(0,n.jsx)("span",{className:"hidden max-w-[16rem] truncate lg:block",children:d}),(0,n.jsx)(_.Z,{className:"h-5 w-5 text-nk-ink-3","aria-hidden":"true"})]}),(0,n.jsx)(S.u,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,n.jsxs)(P.v2.Items,{className:"absolute right-0 z-10 mt-2.5 w-48 origin-top-right rounded-2xl border border-nk-line bg-nk-bg-1 py-2 shadow-card focus:outline-none",children:[(0,n.jsx)(P.v2.Item,{children:e=>{let{active:t}=e;return(0,n.jsx)(h.default,{href:"/profile",className:"".concat(t?"bg-nk-surface":""," block px-3 py-2 text-sm leading-6 text-nk-ink"),children:"Profile"})}}),(0,n.jsx)(P.v2.Item,{children:e=>{let{active:t}=e;return(0,n.jsx)("button",{onClick:c,className:"".concat(t?"bg-nk-surface":""," block w-full px-3 py-2 text-left text-sm leading-6 text-nk-ink"),children:"Sign out"})}})]})})]})]})}var D=a(14438);function M(){let e=(0,u.useSearchParams)().get("payment");return(0,r.useEffect)(()=>{if("success"!==e)return;D.Am.success("Payment Successful!",{description:"Your subscription has been updated.",duration:5e3});let t=new URLSearchParams(window.location.search);t.delete("payment");let a=t.toString(),n=a?"".concat(window.location.pathname,"?").concat(a):window.location.pathname;window.history.replaceState({...window.history.state,as:n,url:n},"",n)},[e]),null}var F=a(21351);let C=["/welcome"];function E(e){let{children:t,user:a,tierConfig:h}=e,p=(0,u.usePathname)(),f=(0,u.useParams)(),x=(0,i.z)(),b=(0,r.useMemo)(()=>C.some(e=>null==p?void 0:p.startsWith(e)),[p]),v=(0,r.useMemo)(()=>p?p.includes("/journal")?"Journal":p.includes("/dictionary")?"Symbols":p.includes("/resources")?"Resources":p.includes("/subscription")?"Plans":p.includes("/profile")?"You":"Dreamspace":"Dreamspace",[p]),g=(0,r.useMemo)(()=>Object.values(null!=f?f:{}).some(e=>Array.isArray(e)?e.length>0:!!e),[f]),k=(0,r.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"Dreamspace";let a=e.split("/").filter(Boolean);if(0===a.length)return"Dreamspace";let{pattern:n,label:r,hasDynamicParams:s,publishedFor:i}=t,u=null==r?void 0:r.trim(),d=c(a[0]),h=n?n.split("/").filter(Boolean):null;if(!h)return s?d:a.map(c).join(" / ");if(i&&i!==e||h.length!==a.length||h.some(o)||!h.every((e,t)=>l(e)||e===a[t]))return d;let m=[];return a.forEach((e,t)=>{if(l(h[t])){u&&m.push(u);return}m.push(c(e))}),m.length>0?m.join(" / "):"Dreamspace"})(p,{pattern:null==x?void 0:x.pattern,label:null==x?void 0:x.label,publishedFor:null==x?void 0:x.publishedFor,hasDynamicParams:g}),[p,x,g]);return a?(0,n.jsx)(s.d,{user:a,tierConfig:h,children:(0,n.jsx)(m.PI,{uid:a.uid,children:(0,n.jsx)(m.jQ,{children:(0,n.jsxs)(F.c,{children:[(0,n.jsx)(M,{}),(0,n.jsx)(d,{children:b?(0,n.jsx)("main",{className:"min-h-visible-viewport w-full",children:t}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(j,{}),(0,n.jsxs)("div",{"data-testid":"app-shell-column",className:"flex h-visible-viewport w-0 flex-1 flex-col overflow-hidden",children:[(0,n.jsx)(I,{pageTitle:v,crumb:k}),(0,n.jsx)("main",{className:"scrollbar-dream mx-auto w-full max-w-[1090px] flex-1 overflow-y-auto overscroll-contain px-5 py-8 lg:px-14 lg:py-10",children:t}),(0,n.jsx)(w,{})]})]})})]})})})}):(0,n.jsx)(d,{children:(0,n.jsx)("div",{className:"flex h-visible-viewport w-full items-center justify-center",children:(0,n.jsx)("p",{className:"text-dream-text-secondary",children:"Loading user session..."})})})}},39170:function(e,t,a){a.d(t,{ee:function(){return i}});var n=a(57437),r=a(33145),s=a(43347);function i(e){let{className:t}=e;return(0,n.jsx)(r.default,{src:"/assets/brand/doorway-mark.png",alt:"","aria-hidden":"true","data-testid":"brand-mark",width:77,height:96,loading:"eager",className:(0,s.cn)("w-auto shrink-0",t)})}},96857:function(e,t,a){a.d(t,{D9:function(){return d},E5:function(){return l},El:function(){return h},JF:function(){return o},Mz:function(){return s},px:function(){return u},u2:function(){return c}});let n="dd.auth.signed-out",r="dd.auth.restore-attempts",s="/dreamspace";function i(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||"object"!=typeof t)return null;let{count:a,windowStartedAt:n}=t;if("number"!=typeof a||!Number.isInteger(a)||a<0||"number"!=typeof n||!Number.isFinite(n)||n<0)return null;return{count:a,windowStartedAt:n}}catch(e){return null}}function l(e){let{state:t,nowMs:a,maxAttempts:n=2,windowMs:r=6e4}=e;if(!t)return!0;let s=a-t.windowStartedAt;return s<0||s>=r||t.count<n}function o(){try{window.localStorage.setItem(n,"1")}catch(e){}}function c(){try{window.localStorage.removeItem(n)}catch(e){}}function u(){try{return"1"===window.localStorage.getItem(n)}catch(e){return!1}}function d(){try{return{countable:!0,state:i(window.sessionStorage.getItem(r))}}catch(e){return{countable:!1,state:null}}}function h(e,t){let a=function(e){let{state:t,nowMs:a,windowMs:n=6e4}=e;if(!t)return{count:1,windowStartedAt:a};let r=a-t.windowStartedAt;return r<0||r>=n?{count:1,windowStartedAt:a}:{count:t.count+1,windowStartedAt:t.windowStartedAt}}({state:e,nowMs:t});try{window.sessionStorage.setItem(r,JSON.stringify(a));let e=i(window.sessionStorage.getItem(r));return null!==e&&e.count===a.count&&e.windowStartedAt===a.windowStartedAt}catch(e){return!1}}}}]);
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.