PageSourceSearch

https://sourcelibrary.org/_next/static/immutable/chunks/3pnufdeijziox.js

js sourcelibrary.org collected 2026-10-02 06:12:53 UTC 34,843 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0f7f4-8d1e-0000-dd9c-db414c72bc76";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="c17ee101-1469-58d9-acbf-a6703a145364")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,173998,341240,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);e.s(["Book",0,r],173998);let s=(0,t.default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,s],341240)},664659,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],664659)},346897,e=>{"use strict";let t=(0,e.i(475254).default)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);e.s(["MapPin",0,t],346897)},555436,e=>{"use strict";let t=(0,e.i(475254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],555436)},284614,e=>{"use strict";let t=(0,e.i(475254).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],284614)},968673,e=>{"use strict";var t=e.i(271645);e.s(["useDebouncedCallback",0,function(e,r,s,a){var l=this,n=(0,t.useRef)(null),i=(0,t.useRef)(0),o=(0,t.useRef)(0),c=(0,t.useRef)(null),d=(0,t.useRef)([]),u=(0,t.useRef)(),h=(0,t.useRef)(),x=(0,t.useRef)(e),m=(0,t.useRef)(!0),f=(0,t.useRef)(),p=(0,t.useRef)();x.current=e;var b="u">typeof window,v=!r&&0!==r&&b;if("function"!=typeof e)throw TypeError("Expected a function");r=+r||0;var y=!!(s=s||{}).leading,g=!("trailing"in s)||!!s.trailing,k=!!s.flushOnExit&&g,j="maxWait"in s,w="debounceOnServer"in s&&!!s.debounceOnServer,N=j?Math.max(+s.maxWait||0,r):null,$=(0,t.useMemo)(function(){var e=function(e){var t=d.current,r=u.current;return d.current=u.current=null,i.current=e,o.current=o.current||e,h.current=x.current.apply(r,t)},t=function(e,t){v&&cancelAnimationFrame(c.current),c.current=v?requestAnimationFrame(e):setTimeout(e,t)},s=function(e){if(!m.current)return!1;var t=e-n.current;return!n.current||t>=r||t<0||j&&e-i.current>=N},$=function(t){return c.current=null,g&&d.current?e(t):(d.current=u.current=null,h.current)},C=function e(){var a=Date.now();if(y&&o.current===i.current&&S(),s(a))return $(a);if(m.current){var l=r-(a-n.current);t(e,j?Math.min(l,N-(a-i.current)):l)}},S=function(){a&&a({})},_=function(){if(b||w){var a,o=Date.now(),x=s(o);if(d.current=[].slice.call(arguments),u.current=l,n.current=o,k&&!f.current&&(f.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&p.current.flush()},null==(a=globalThis.document)||null==a.addEventListener||a.addEventListener("visibilitychange",f.current)),x){if(!c.current&&m.current)return i.current=n.current,t(C,r),y?e(n.current):h.current;if(j)return t(C,r),e(n.current)}return c.current||t(C,r),h.current}};return _.cancel=function(){var e=c.current;e&&(v?cancelAnimationFrame(c.current):clearTimeout(c.current)),i.current=0,d.current=n.current=u.current=c.current=null,e&&a&&a({})},_.isPending=function(){return!!c.current},_.flush=function(){return c.current?$(Date.now()):h.current},_},[y,j,r,N,g,k,v,b,w,a]);return p.current=$,(0,t.useEffect)(function(){return m.current=!0,function(){var e;k&&p.current.flush(),f.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",f.current),f.current=null),m.current=!1}},[k]),$}])},814573,e=>{"use strict";var t=e.i(843476),r=e.i(500932),s=e.i(522016),a=e.i(635333);e.s(["default",0,function(e){let l,n,i,o,c,d,u,h,x,m,f=(0,r.c)(23),{white:p,compact:b,mini:v,alwaysWordmark:y,lang:g}=e,k=void 0===g?"en":g,j=p?"white":"currentColor",w=v?"w-6 h-6":b?"w-8 h-8":"w-8 h-8 md:w-[2.4rem] md:h-[2.4rem]",N=v?"text-sm":b?"text-lg":"text-base md:text-[1.2rem]",$=y?"inline":v?"hidden lg:inline":"hidden sm:inline";f[0]!==k?(l=(0,a.localePath)("/",k),f[0]=k,f[1]=l):l=f[1];let C=`inline-flex items-center ${v?"gap-1.5":"gap-3"} ${p?"text-white hover:opacity-80":"text-primary hover:text-secondary"} transition-colors`;f[2]!==j?(n=(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:j,strokeWidth:"1"}),i=(0,t.jsx)("circle",{cx:"12",cy:"12",r:"7",stroke:j,strokeWidth:"1"}),o=(0,t.jsx)("circle",{cx:"12",cy:"12",r:"4",stroke:j,strokeWidth:"1"}),f[2]=j,f[3]=n,f[4]=i,f[5]=o):(n=f[3],i=f[4],o=f[5]),f[6]!==w||f[7]!==n||f[8]!==i||f[9]!==o?(c=(0,t.jsxs)("svg",{className:w,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n,i,o]}),f[6]=w,f[7]=n,f[8]=i,f[9]=o,f[10]=c):c=f[10];let S=`${N} uppercase tracking-wider ${$}`;return f[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("span",{className:"font-semibold",children:"Source"}),d=(0,t.jsx)("span",{className:"font-light",children:"Library"}),f[11]=d,f[12]=u):(d=f[11],u=f[12]),f[13]!==v?(h=!v&&(0,t.jsx)("sup",{className:"text-[0.6em] font-light tracking-normal normal-case ml-1 opacity-80 relative -top-[0.5em]",children:"Beta"}),f[13]=v,f[14]=h):h=f[14],f[15]!==h||f[16]!==S?(x=(0,t.jsxs)("span",{className:S,children:[u,d,h]}),f[15]=h,f[16]=S,f[17]=x):x=f[17],f[18]!==x||f[19]!==l||f[20]!==C||f[21]!==c?(m=(0,t.jsxs)(s.default,{href:l,className:C,"aria-label":"Source Library home",children:[c,x]}),f[18]=x,f[19]=l,f[20]=C,f[21]=c,f[22]=m):m=f[22],m}])},250309,e=>{"use strict";var t=e.i(843476),r=e.i(500932),s=e.i(271645),a=e.i(522016),l=e.i(618566),n=e.i(814573),i=e.i(481011),o=e.i(555436),c=e.i(664659),d=e.i(100930),u=e.i(635333),h=e.i(603064),x=e.i(927908),m=e.i(565961);function f(){return(0,m.trackEvent)("give_nav_click",{source:"header",url:"/give"})}function p(e){return!(0,h.isGlobalOnlyNavHref)((0,u.canonicalPath)(e.href))}e.s(["default",0,function(e){let m,b,v,y,g,k,j,w,N,$,C,S,_,E,L,R,P,T,U,M,I,q,B,D,z,A=(0,r.c)(63),{variant:W,breadcrumbs:O,sticky:H,className:F,homeLocale:Y}=e,G=void 0===W?"light":W,K="transparent"===G||"dark"===G,[V,X]=(0,s.use
1State)(!1),[J,Q]=(0,s.useState)(null),Z=(0,s.useRef)(null),ee=(0,s.useRef)(null),et=(0,l.usePathname)(),er=(0,d.useLocale)(),es=Y??er,ea=d.NAV_STRINGS[es],el=(0,x.useIsEmbedded)();A[0]!==el?(m=e=>!(el&&(0,h.isGlobalOnlyNavHref)((0,u.canonicalPath)(e.href))),A[0]=el,A[1]=m):m=A[1],A[2]!==el?(b=e=>e.children&&el?{...e,children:e.children.filter(p)}:e,A[2]=el,A[3]=b):b=A[3];let en=(z=[{label:ea.collections,href:"/collections",activePrefix:"/collections"},{label:ea.gallery,href:"/gallery"},{label:ea.identify,href:"/identify"},{label:ea.browse,href:"/browse",activePrefix:"/browse",children:[{label:ea.browse,href:"/browse"},{label:ea.catalogue,href:"/catalog"},{label:ea.works,href:"/works"}]},{label:ea.explore,href:"/explore",activePrefix:"/explore"},{label:ea.librarian,href:"/librarian"}],"en"===es?z:z.map(e=>({...e,href:(0,u.localePath)(e.href,es),...e.activePrefix?{activePrefix:(0,u.localePath)(e.activePrefix,es)}:{},...e.children?{children:e.children.map(e=>({...e,href:(0,u.localePath)(e.href,es)}))}:{}}))).filter(m).map(b);A[4]!==el?(v=el&&(0,h.isGlobalOnlyNavHref)("/give"),A[4]=el,A[5]=v):v=A[5];let ei=!v;A[6]!==Y||A[7]!==et?(y=void 0!==Y||(0,u.hasLocalizedTwin)(et),A[6]=Y,A[7]=et,A[8]=y):y=A[8];let eo=y;A[9]!==et?(g=(0,u.localeHref)("en",et),A[9]=et,A[10]=g):g=A[10];let ec=g;A[11]!==et?(k=(0,u.localeHref)("es",et),A[11]=et,A[12]=k):k=A[12];let ed=k;A[13]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{X(!1),Q(null)},A[13]=j):j=A[13],A[14]!==et?(w=[et],A[14]=et,A[15]=w):w=A[15],(0,s.useEffect)(j,w),A[16]!==J||A[17]!==V?(N=()=>{if(!V&&!J)return;let e=function(e){V&&Z.current&&!Z.current.contains(e.target)&&X(!1),J&&ee.current&&!ee.current.contains(e.target)&&Q(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},$=[V,J],A[16]=J,A[17]=V,A[18]=N,A[19]=$):(N=A[18],$=A[19]),(0,s.useEffect)(N,$),A[20]===Symbol.for("react.memo_cache_sentinel")?(C={transparent:"relative z-50 py-4",light:"bg-cream border-b border-border-light py-3",dark:"bg-dark border-b border-white/10 py-3"},A[20]=C):C=A[20];let eu=C[G],eh=K?"text-white/70 hover:text-white":"text-secondary hover:text-primary",ex=K?"text-white":"text-primary font-medium",em=!!O;A[21]!==K||A[22]!==es||A[23]!==em?(S=(0,t.jsx)(n.default,{white:K,compact:em,lang:es}),A[21]=K,A[22]=es,A[23]=em,A[24]=S):S=A[24],A[25]!==O||A[26]!==K?(_=O?.map(e=>(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:K?"text-white/40 hidden sm:inline":"text-stone-400 hidden sm:inline",children:"/"}),(0,t.jsx)(a.default,{href:e.href,className:`text-base font-serif ${K?"text-white hover:opacity-80":"text-primary hover:text-secondary"} transition-colors`,children:e.label})]},e.href)),A[25]=O,A[26]=K,A[27]=_):_=A[27],A[28]!==S||A[29]!==_?(E=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[S,_]}),A[28]=S,A[29]=_,A[30]=E):E=A[30],A[31]!==K||A[32]!==ei||A[33]!==ea.support?(L=ei&&(0,t.jsx)(a.default,{href:"/give",onClick:f,className:`whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium tracking-wide transition-colors ${K?"border-white/40 text-white hover:bg-white hover:text-dark":"border-accent-rust text-accent-rust hover:bg-accent-rust hover:text-white"}`,children:ea.support}),A[31]=K,A[32]=ei,A[33]=ea.support,A[34]=L):L=A[34],A[35]!==ec||A[36]!==ed||A[37]!==K||A[38]!==es||A[39]!==eo?(R=eo&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium tracking-wide","aria-label":"Language",children:[(0,t.jsx)(a.default,{href:ec,"aria-current":"en"===es?"page":void 0,className:"en"===es?K?"text-white":"text-primary":K?"text-white/50 hover:text-white":"text-secondary hover:text-primary",children:"EN"}),(0,t.jsx)("span",{className:K?"text-white/30":"text-stone-300",children:"·"}),(0,t.jsx)(a.default,{href:ed,"aria-current":"es"===es?"page":void 0,className:"es"===es?K?"text-white":"text-primary":K?"text-white/50 hover:text-white":"text-secondary hover:text-primary",children:"ES"})]}),A[35]=ec,A[36]=ed,A[37]=K,A[38]=es,A[39]=eo,A[40]=R):R=A[40],A[41]!==es?(P=(0,u.localePath)("/search",es),A[41]=es,A[42]=P):P=A[42];let ef=`hidden lg:flex items-center justify-center w-8 h-8 rounded-lg transition-colors ${"/search"===(0,u.canonicalPath)(et)?K?"text-white bg-white/10":"text-primary bg-warm":K?"text-white/60 hover:text-white hover:bg-white/10":"text-secondary hover:text-primary hover:bg-warm/50"}`;A[43]===Symbol.for("react.memo_cache_sentinel")?(T=(0,t.jsx)(o.Search,{className:"w-4 h-4"}),A[43]=T):T=A[43],A[44]!==ea.search||A[45]!==P||A[46]!==ef?(U=(0,t.jsx)(a.default,{href:P,className:ef,"aria-label":ea.search,children:T}),A[44]=ea.search,A[45]=P,A[46]=ef,A[47]=U):U=A[47],A[48]!==V?(M=()=>X(!V),A[48]=V,A[49]=M):M=A[49];let ep=`p-1.5 rounded transition-colors ${K?"text-white/70 hover:text-white":"text-secondary hover:text-primary"}`;
1A[50]!==V?(I=V?(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}):(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),A[50]=V,A[51]=I):I=A[51],A[52]!==V||A[53]!==ea.menu||A[54]!==M||A[55]!==ep||A[56]!==I?(q=(0,t.jsx)("button",{onClick:M,className:ep,"aria-label":ea.menu,"aria-expanded":V,children:I}),A[52]=V,A[53]=ea.menu,A[54]=M,A[55]=ep,A[56]=I,A[57]=q):q=A[57];let eb=V&&(0,t.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-52 bg-white rounded-lg shadow-lg border border-border-light py-2 z-50",children:[en.flatMap(e=>{if(e.children)return e.children.map(e=>{let r=et===e.href||et?.startsWith(e.href+"/");return(0,t.jsx)(a.default,{href:e.href,className:`block px-4 py-2.5 text-sm transition-colors ${r?"text-primary font-medium bg-warm":"text-secondary hover:text-primary hover:bg-warm/50"}`,children:e.label},e.href)});let r=e.activePrefix||e.href,s=et===r||et?.startsWith(r+"/");return(0,t.jsx)(a.default,{href:e.href,className:`block px-4 py-2.5 text-sm transition-colors ${s?"text-primary font-medium bg-warm":"text-secondary hover:text-primary hover:bg-warm/50"}`,children:e.label},e.href)}),(0,t.jsx)("div",{className:"border-t border-border-light my-1.5"}),(0,t.jsx)(a.default,{href:(0,u.localePath)("/search",es),className:"block px-4 py-2.5 text-sm text-secondary hover:text-primary hover:bg-warm/50 transition-colors",children:ea.search})]});A[58]!==q||A[59]!==eb?(B=(0,t.jsxs)("div",{className:"relative lg:hidden",ref:Z,children:[q,eb]}),A[58]=q,A[59]=eb,A[60]=B):B=A[60];let ev=K?"hero":"default";return A[61]!==ev?(D=(0,t.jsx)(i.default,{variant:ev}),A[61]=ev,A[62]=D):D=A[62],(0,t.jsx)("header",{"data-site-header":"",className:`${eu} ${H?"sticky top-0 z-20":""} ${void 0===F?"":F}`,children:(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 md:px-12 max-w-[var(--container-wide)] mx-auto",children:[E,(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("nav",{className:"hidden lg:flex items-center gap-5",children:en.map(e=>{let r=e.activePrefix||e.href,s=et===r||et?.startsWith(r+"/"),l=e.children?.some(e=>et===e.href||et?.startsWith(e.href+"/"));return e.children?(0,t.jsxs)("div",{className:"relative",ref:ee,children:[(0,t.jsxs)("button",{onClick:()=>Q(J===e.label?null:e.label),className:`text-sm font-sans tracking-wide transition-colors flex items-center gap-0.5 ${s||l?ex:eh}`,children:[e.label,(0,t.jsx)(c.ChevronDown,{className:`w-3 h-3 transition-transform ${J===e.label?"rotate-180":""}`})]}),J===e.label&&(0,t.jsx)("div",{className:"absolute left-0 top-full mt-2 w-36 bg-white rounded-lg shadow-lg border border-border-light py-1.5 z-50",children:e.children.map(e=>{let r=et===e.href||et?.startsWith(e.href+"/");return(0,t.jsx)(a.default,{href:e.href,className:`block px-4 py-2 text-sm transition-colors ${r?"text-primary font-medium bg-warm":"text-secondary hover:text-primary hover:bg-warm/50"}`,children:e.label},e.href)})})]},e.href):(0,t.jsx)(a.default,{href:e.href,className:`text-sm font-sans tracking-wide transition-colors ${s?ex:eh}`,children:e.label},e.href)})}),L,R,U,B,D]})]})})}])},481011,e=>{"use strict";var t=e.i(843476),r=e.i(500932),s=e.i(526732),a=e.i(304412),l=e.i(522016),n=e.i(271645),i=e.i(100930),o=e.i(635333);function c(){return(0,s.signOut)({callbackUrl:"/"})}function d(e){return e[0]}e.s(["default",0,function(e){let s,u,h,x,m,f,p,b,v,y,g=(0,r.c)(41),{variant:k}=e,j=void 0===k?"default":k,{data:w,status:N}=(0,a.useStableSession)(),$=(0,i.useLocale)(),[C,S]=(0,n.useState)(!1),[_,E]=(0,n.useState)(!1),L=(0,n.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>E(!0),g[0]=s):s=g[0];let R=s;if(g[1]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{let e=function(e){L.current&&!L.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},h=[],g[1]=u,g[2]=h):(u=g[1],h=g[2]),(0,n.useEffect)(u,h),"loading"===N){let e;return g[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"w-8 h-8"}),g[3]=e):e=g[3],e}if(!w){let e,r,s,a="hero"===j?"text-white/80 hover:text-white":"";g[4]!==j?(e="hero"===j?{}:{color:"var(--text-muted)"}
1,g[4]=j,g[5]=e):e=g[5];let n=e;g[6]!==$?(r=(0,o.localePath)("/auth/signin",$),g[6]=$,g[7]=r):r=g[7];let i=`text-sm font-medium transition-colors hover:opacity-80 ${a}`,c="es"===$?"Iniciar sesión":"Sign in";return g[8]!==r||g[9]!==i||g[10]!==c||g[11]!==n?(s=(0,t.jsx)(l.default,{href:r,className:i,style:n,children:c}),g[8]=r,g[9]=i,g[10]=c,g[11]=n,g[12]=s):s=g[12],s}let P=w.user?.role,T="admin"===P||"superadmin"===P,U=w.user?.membership!=null;g[13]!==w.user?.email?.[0]||g[14]!==w.user?.name?(x=w.user?.name?.split(" ").map(d).join("").toUpperCase().slice(0,2)||w.user?.email?.[0]?.toUpperCase()||"?",g[13]=w.user?.email?.[0],g[14]=w.user?.name,g[15]=x):x=g[15];let M=x,I="hero"===j,q=U?"var(--accent-gold)":I?"rgba(255,255,255,0.3)":"var(--border-light)";g[16]!==q||g[17]!==U||g[18]!==I?(m=I?{background:U?"rgba(201,168,108,0.2)":"rgba(255,255,255,0.2)",color:"#fff",borderColor:q}:{background:U?"rgba(201,168,108,0.2)":"var(--bg-warm)",color:"var(--text-primary)",borderColor:q},g[16]=q,g[17]=U,g[18]=I,g[19]=m):m=g[19];let B=m;return g[20]!==C?(f=()=>S(!C),g[20]=C,g[21]=f):f=g[21],g[22]!==q||g[23]!==B||g[24]!==_||g[25]!==M||g[26]!==w.user?(p=w.user?.image&&!_?(0,t.jsx)("img",{src:w.user.image,alt:w.user.name||"User","data-avatar":"true",className:"w-8 h-8 rounded-full border-2",style:{borderColor:q},onError:R}):(0,t.jsx)("div",{"data-avatar":"true",className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium border-2",style:B,children:M}),g[22]=q,g[23]=B,g[24]=_,g[25]=M,g[26]=w.user,g[27]=p):p=g[27],g[28]!==f||g[29]!==p?(b=(0,t.jsx)("button",{onClick:f,"aria-label":"Account menu",className:"flex items-center gap-2 cursor-pointer focus:outline-none",children:p}),g[28]=f,g[29]=p,g[30]=b):b=g[30],g[31]!==T||g[32]!==C||g[33]!==$||g[34]!==P||g[35]!==w.user?.email||g[36]!==w.user?.name?(v=C&&(0,t.jsxs)("div",{className:"absolute right-0 mt-2 w-56 rounded-xl shadow-lg py-2 z-50",style:{background:"var(--bg-white)",border:"1px solid var(--border-light)"},children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--border-light)"},children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",style:{color:"var(--text-primary)"},children:w.user?.name}),(0,t.jsx)("p",{className:"text-xs truncate",style:{color:"var(--text-muted)"},children:w.user?.email})]}),(0,t.jsxs)("div",{className:"py-1",children:[(0,t.jsx)(l.default,{href:"/account",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Account"}),(0,t.jsx)(l.default,{href:"/favorites",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Favorites"}),(0,t.jsx)(l.default,{href:"/lists",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"My Lists"}),(0,t.jsx)(l.default,{href:"/rooms",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Reading Rooms"}),(0,t.jsx)(l.default,{href:"/reading-history",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Reading History"}),(0,t.jsx)(l.default,{href:(0,o.localePath)("/support",$),className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Support"}),T&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.default,{href:"/admin",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Dashboard"}),(0,t.jsx)(l.default,{href:"/analytics",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Analytics"}),(0,t.jsx)(l.default,{href:"/admin/introductions",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Introductions"}),(0,t.jsx)(l.default,{href:"/admin/users",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Users"}),(0,t.jsx)(l.default,{href:"/feedback",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Feedback"}),"superadmin"===P&&(0,t.jsx)(l.default,{href:"/admin/spend",className:"block px-4 py-2 text-sm hover:opacity-70 transition-opacity",style:{color:"var(--text-primary)"},onClick:()=>S(!1),children:"Spend"})]}),(0,t.jsx)("button",{onClick:c,className:"w-full text-left px-4 py-2 text-sm hover:opacity-70 transition-opacity cursor-pointer",style:{color:"var(--accent-rust)"},children:"Sign Out"})]})]}),g[31]=T,g[32]=C,g[33]=$,g[34]=P,g[35]=w.user?.email,g[36]=w.user?.name,g[37]=v):v=g[37],g[38]!==v||g[39]!==b?(y=(0,t.jsxs)("div",{ref:L,className:"relative",children:[b,v]}),g[38]=v,g[39]=b,g[40]=y):y=g[40],y}])},245341,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(618566),a=e.i(522016),l=e.i(657688),n=e.i(555436),i=e.i(173998),o=e.i(341240),c=e.i(284614),d=e.i(346897),u=e.i(810980),h=e.i(531278),x=e.i(37727),m=e.i(463059),f=e.i(735501),p=e.i(194983),b=e.i(968673);e.i(497608);var v=e.i(594800),y=e.i(956460),g=e.i(975157),k=e.i(550033),j=e.i(929718),w=e.i(616),N=e.i(100930),$=e.i(635333);let C={concept:o.Lightbulb,person:c.User,place:d.MapPin,keyword:u.BookOpen},S=new Map,_=null,E=null;function L(){return E?Promise.resolve(E):(_||(_=v.search.vocabulary().then(e=>(E=e,e)).catch(()=>(_=null,[]))),_)}function R(e,t){if(e.length<2)return null;let r=e.toLowerCase();for(let s of t)if(s.toLowerCase().startsWith(r)&&s.length>e.length)return s;return null}e.s(["default",0,function({dropdownPosition:e="top"}={}){let c,d,u,_,P=(0,s.useRouter)(),T=(0,s.usePathname)(),[U,M]=(0,r.useState)(""),[I,q]=(0,r.useState)(null),[B,D]=(0,r.useState)(!1),[z,A]=(0,r.useState)(!1),[W,O]=(0,r.useState)(-1),[H,F]=(0,r.useState)(null),[Y,G]=(0,r.useState)(null),K=(0,r.useRef)(null),V=(0,r.useRef)(null),X=(0,N.useLocalePath)(),J=(0,$.canonicalPath)(T).split("/").filter(
1Boolean),Q=J[0]&&"search"!==J[0]?`/${J[0]}`:"",Z=(0,r.useCallback)(()=>{L(),I&&A(!0)},[I]),ee=(0,r.useCallback)(async e=>{let t;if(!e||e.length<2){q(null),A(!1);return}let r=e.toLowerCase().trim(),s=((t=S.get(r))&&(S.delete(r),S.set(r,t)),t);if(s){q(s),A(!0),D(!1);return}D(!0),A(!0);try{let t=await v.search.unified(e,{limit:8});if(S.delete(r),S.set(r,t),S.size>50){let e=S.keys().next().value;void 0!==e&&S.delete(e)}q(t)}catch(e){console.error("Search error:",e)}finally{D(!1)}},[]),et=(0,b.useDebouncedCallback)(ee,300),er=(0,r.useCallback)(e=>{M(e),et(e),E?G(R(e,E)):L().then(t=>{G(R(e,t))})},[et]);(0,r.useEffect)(()=>{let e=e=>{K.current&&!K.current.contains(e.target)&&A(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(A(!1),V.current?.blur())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let es=I?.gallery?.results||[],ea=I?.semantic?.results||[],el=I&&(I.books.total>0||I.index.total>0||es.length>0||ea.length>0),en=I&&!el&&U.length>=2;(0,r.useEffect)(()=>{if(!en||U.length<3)return void F(null);let e=!1;return v.search.suggest(U).then(t=>{e||F(t.suggestions?.[0]||null)}).catch(()=>{e||F(null)}),()=>{e=!0}},[en,U]);let ei=(0,r.useMemo)(()=>{if(!I||!el)return[];let e=[];for(let t of I.books.results)e.push({type:"book",href:X((0,y.bookUrl)(t)),id:`book-${t.id}`});for(let t=0;t<I.index.results.length;t++){let r=I.index.results[t],s=r.book_slug||r.book_id,a=X(r.pages?.[0]?`${Q}/book/${s}/guide?page=${r.pages[0]}`:`${Q}/book/${s}`);e.push({type:"index",href:a,id:`index-${r.book_id}-${r.type}-${t}`})}for(let t of ea)e.push({type:"book",href:X(`${Q}/book/${t.book_id}`),id:`semantic-${t.book_id}`});for(let t of es)e.push({type:"gallery",href:X(`${Q}/gallery/image/${t.id}`),id:`gallery-${t.id}`});return e.push({type:"full-search",href:X(`${Q}/search?q=${encodeURIComponent(U)}`),id:"full-search"}),e},[I,el,U,es,ea,Q,X]);return(0,r.useEffect)(()=>{O(-1)},[I]),(0,r.useEffect)(()=>{if(W>=0&&ei[W]){let e=K.current?.querySelector(`[data-search-index="${W}"]`);e?.scrollIntoView({block:"nearest"})}},[W,ei]),(0,t.jsxs)("div",{ref:K,className:"relative w-full",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(n.Search,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-stone-400","aria-hidden":"true"}),Y&&U.length>=2&&(0,t.jsxs)("div",{className:"absolute left-12 top-1/2 -translate-y-1/2 text-lg pointer-events-none select-none text-stone-300","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"invisible",children:U}),(0,t.jsx)("span",{children:Y.slice(U.length)})]}),(0,t.jsx)("input",{ref:V,type:"text",value:U,onChange:e=>er(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&Y&&!z||"Tab"===e.key&&Y&&z&&W<0){e.preventDefault(),M(Y),G(null),et(Y);return}"Enter"===e.key?W>=0&&W<ei.length?(e.preventDefault(),A(!1),P.push(ei[W].href)):U.length>=2&&(e.preventDefault(),A(!1),P.push(X(`${Q}/search?q=${encodeURIComponent(U)}`))):z&&0!==ei.length&&("ArrowDown"===e.key?(e.preventDefault(),O(e=>(e+1)%ei.length)):"ArrowUp"===e.key&&(e.preventDefault(),O(e=>e<=0?ei.length-1:e-1)))},onFocus:Z,placeholder:"Search books, concepts, people...","aria-label":"Search the library","aria-expanded":z,"aria-autocomplete":"list","aria-activedescendant":W>=0?`search-item-${W}`:void 0,role:"combobox","aria-controls":"search-results",className:"w-full pl-12 pr-12 py-4 bg-white/95 backdrop-blur border border-white/20 rounded-2xl text-stone-900 placeholder-stone-500 focus:outline-none focus:ring-2 focus-visible:ring-accent-rust/50 text-lg shadow-lg"}),B&&(0,t.jsx)(h.Loader2,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-stone-400 animate-spin"}),U&&!B&&(0,t.jsx)("button",{onClick:()=>{M(""),q(null),A(!1),V.current?.focus()},className:"absolute right-4 top-1/2 -translate-y-1/2 text-stone-400 hover:text-stone-600","aria-label":"Clear search",children:(0,t.jsx)(x.X,{className:"w-5 h-5","aria-hidden":"true"})})]}),z&&(el||en)&&(0,t.jsx)("div",{id:"search-results",role:"listbox",className:`absolute ${"bottom"===e?"top-full mt-2":"bottom-full mb-2"} left-0 right-0 bg-white rounded-xl shadow-xl border border-stone-200 overflow-hidden z-50 max-h-[60vh] overflow-y-auto`,children:en?(0,t.jsxs)("div",{className:"p-6 text-center",children:[(0,t.jsx)(n.Search,{className:"w-8 h-8 text-stone-300 mx-auto mb-2"}),(0,t.jsxs)("p",{className:"text-stone-500",children:["No results for “",U,"”"]}
1),H&&(0,t.jsxs)("p",{className:"text-sm text-stone-600 mt-2",children:["Did you mean"," ",(0,t.jsx)("button",{onClick:()=>{M(H),ee(H)},className:"font-medium text-accent-rust hover:text-accent-gold-dark underline underline-offset-2",children:H}),"?"]}),(0,t.jsxs)(a.default,{href:X(`/search?q=${encodeURIComponent(U)}`),onClick:()=>A(!1),className:"inline-flex items-center gap-2 mt-3 text-sm text-accent-rust hover:text-accent-rust",children:[(0,t.jsx)(n.Search,{className:"w-4 h-4"}),"Try full search"]})]}):(0,t.jsxs)("div",{className:"divide-y divide-stone-100",children:[I&&I.books.total>0&&(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2 px-2",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-stone-400 uppercase tracking-wide",children:["Books",I.books.hasMore?"":` (${I.books.total})`]}),I.books.hasMore&&(0,t.jsxs)(a.default,{href:X(`/search?q=${encodeURIComponent(U)}`),className:"text-xs text-accent-rust hover:text-accent-rust flex items-center gap-0.5",onClick:()=>A(!1),children:["See all ",(0,t.jsx)(m.ChevronRight,{className:"w-3 h-3"})]})]}),I.books.results.map((e,r)=>{let s,n=0+r;return(0,t.jsxs)(a.default,{id:`search-item-${n}`,href:(0,y.bookUrl)(e),onClick:()=>A(!1),role:"option","aria-selected":W===n,"data-search-index":n,className:`flex items-center gap-3 px-2 py-2 rounded-lg transition-colors ${W===n?"bg-accent-gold/8":"hover:bg-accent-gold/8"}`,children:[(0,g.getBookThumbnailUrl)(e,"thumb")?(0,t.jsx)("div",{className:"w-8 h-10 rounded overflow-hidden flex-shrink-0 bg-stone-100",children:(0,t.jsx)(l.default,{src:(0,g.getBookThumbnailUrl)(e,"thumb"),alt:e.display_title||e.title,width:32,height:40,sizes:"32px",className:"w-full h-full object-cover",unoptimized:!0,onError:e=>{e.target.style.display="none"}})}):(0,t.jsx)(i.Book,{className:"w-4 h-4 text-accent-rust flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-stone-900 truncate text-sm",children:(0,t.jsx)(j.default,{text:e.display_title||e.title,query:U})}),(0,t.jsx)("p",{className:"text-xs text-stone-500 truncate",children:"editor"===(s=(0,k.getEffectiveByline)(e)).role?(0,t.jsxs)(t.Fragment,{children:["ed. ",(0,t.jsx)(j.default,{text:s.editor,query:U})]}):(0,t.jsx)(j.default,{text:e.author,query:U})})]}),void 0!==e.translation_percent&&e.translation_percent>0&&(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 bg-green-100 text-green-700 rounded",children:[e.translation_percent,"%"]})]},e.id)})]}),I&&I.index.total>0&&(c=I.books.results.length,(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2 px-2",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-stone-400 uppercase tracking-wide",children:["Index",I.index.hasMore?"":` (${I.index.total})`]}),I.index.hasMore&&(0,t.jsxs)(a.default,{href:X(`/search?q=${encodeURIComponent(U)}&mode=index`),className:"text-xs text-accent-rust hover:text-accent-rust flex items-center gap-0.5",onClick:()=>A(!1),children:["See all ",(0,t.jsx)(m.ChevronRight,{className:"w-3 h-3"})]})]}),I.index.results.map((e,r)=>{let s=c+r,l=C[e.type]||o.Lightbulb;return(0,t.jsxs)(a.default,{id:`search-item-${s}`,href:e.pages?.[0]?`/book/${e.book_slug||e.book_id}/guide?page=${e.pages[0]}`:`/book/${e.book_slug||e.book_id}`,onClick:()=>A(!1),role:"option","aria-selected":W===s,"data-search-index":s,className:`flex items-center gap-3 px-2 py-2 rounded-lg transition-colors ${W===s?"bg-accent-violet/[0.06]":"hover:bg-accent-violet/[0.06]"}`,children:[(0,t.jsx)(l,{className:`w-4 h-4 flex-shrink-0 ${w.ENTITY_TYPE_STYLES[e.type]?.iconColor??"text-stone-500"}`}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-stone-900 text-sm",children:(0,t.jsx)(j.default,{text:e.term,query:U})}),(0,t.jsx)("p",{className:"text-xs text-stone-500 truncate",children:e.book_title})]}),(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${w.ENTITY_TYPE_STYLES[e.type]?.badge??"bg-stone-100 text-stone-700"}`,children:e.type})]},`${e.book_id}-${e.type}-${r}`)})]})),ea.length>0&&(d=I.books.results.length+I.index.results.length,(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-2 px-2",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-stone-400 uppercase tracking-wide",children:"Related"})}),ea.slice(0,4).map((e,r)=>{let s,l=d+r;return(0,t.jsxs)(a.default,{id:`search-item-${l}`,href:`/book/${e.book_id}`,onClick:()=>A(!1),role:"option","aria-selected":W===l,"data-search-index":l,className:`flex items-center gap-3 px-2 py-2 rounded-lg transition-colors ${W===l?"bg-violet-50":"hover:bg-violet-50"}`,children:[(0,t.jsx)(o.Lightbulb,{className:"w-4 h-4 text-violet-400 flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-stone-900 text-sm truncate",children:e.title}),(0,t.jsxs)("p",{className:"text-xs text-stone-500 truncate",children:["editor"===(s=(0,k.getEffectiveByline)({author:e.author,editor:e.editor})).role?`ed. ${s.editor}`:e.author||"",e.year?` \xb7 ${e.year}`:"",e.relevance_hint?` \xb7 ${e.relevance_hint}`:""]}),e.summary_snippet&&(0,t.jsx)("p",{className:"text-xs text-stone-400 truncate mt-0.5",children:e.summary_snippet})]})]},e.book_id)}),(0,t.jsxs)(a.default,{href:`/librarian?q=${encodeURIComponent(U)}`,onClick:()=>A(!1),className:"flex items-center gap-2 px-2 py-2 mt-1 rounded-lg text-xs text-violet-600 hover:bg-violet-50 transition-colors",children:[(0,t.jsx)(p.MessageCircle,{className:"w-3.5 h-3.5"}),"Ask the Librarian about this"]})]})),es.length>0&&(u=I.books.results.length+I.index.results.length+ea.length,(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2 px-2",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-stone-400 uppercase tracking-wide",children:["Images (",es.length,")"]}),(0,t.jsxs)(a.default,{href:`${Q}/gallery?q=${encodeURIComponent(U)}`,className:"text-xs text-accent-rust hover:text-accent-rust flex items-center gap-0.5",onClick:()=>A(!1),children:["See all ",(0,t.jsx)(m.ChevronRight,{className:"w-3 h-3"})]})]}),es.map((e,r)=>{let s=u+r;return(0,t.jsxs)(a.default,{id:`search-item-${s}`,href:`${Q}/gallery/image/${e.id}`,onClick:()=>A(!1),role:"option","aria-selected":W===s,"data-search-index":s,className:`flex items-center gap-3 px-2 py-2 rounded-lg transition-colors ${W===s?"bg-rose-50":"hover:bg-rose-50"}`,children:[e.imageUrl?(0,t.jsx)("div",{className:"w-8 h-8 rounded overflow-hidden flex-shrink-0 bg-stone-100",children:(0,t.jsx)(l.default,{src:e.imageUrl,alt:e.description||"",width:32,height:32,sizes:"32px",className:"w-full h-full object-cover",unoptimized:!0,onError:e=>{e.target.style.display="none"}})}):(0,t.jsx)(f.ImageIcon,{className:"w-4 h-4 text-rose-400 flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-stone-900 text-sm truncate",children:(0,t.jsx)(j.default,{text:e.description||"Gallery image",query:U})}),(0,t.jsx)("p",{className:"text-xs text-stone-500 truncate",children:e.bookTitle})]}),e.type&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-rose-100 text-rose-700 rounded",children:e.type})]},e.id)})]})),(_=ei.length-1,(0,t.jsxs)(a.default,{id:`search-item-${_}`,href:X(`/search?q=${encodeURIComponent(U)}`),onClick:()=>A(!1),role:"option","aria-selected":W===_,"data-search-index":_,className:`flex items-center justify-center gap-2 p-3 text-sm font-medium transition-colors ${W===_?"bg-accent-gold/8 text-accent-gold-dark":"bg-stone-50 text-stone-600 hover:text-stone-900"}`,children:[(0,t.jsx)(n.Search,{className:"w-4 h-4"}),"Full search for “",U,"”"]}
1))]})})]})}])},956460,e=>{"use strict";RegExp("[æœßøþðłđħıĸŋſ]","g"),e.s(["bookUrl",0,function(e){return`/book/${e.slug||e.id}`},"tenantBookUrl",0,function(e,t){return`/book/${e.slug||e.id}`}])}]);
2
3//# chunkId=c17ee101-1469-58d9-acbf-a6703a145364

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.