@hanzo/team 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404.html +2 -2
- package/dist/admin/index.html +2 -2
- package/dist/agents/algo/index.html +2 -2
- package/dist/agents/art/index.html +2 -2
- package/dist/agents/biz/index.html +2 -2
- package/dist/agents/cal/index.html +2 -2
- package/dist/agents/core/index.html +2 -2
- package/dist/agents/cyber/index.html +2 -2
- package/dist/agents/data/index.html +2 -2
- package/dist/agents/db/index.html +2 -2
- package/dist/agents/des/index.html +2 -2
- package/dist/agents/dev/index.html +2 -2
- package/dist/agents/doc/index.html +2 -2
- package/dist/agents/ed/index.html +2 -2
- package/dist/agents/fin/index.html +2 -2
- package/dist/agents/gov/index.html +2 -2
- package/dist/agents/huma/index.html +2 -2
- package/dist/agents/index.html +2 -2
- package/dist/agents/lang/index.html +2 -2
- package/dist/agents/law/index.html +2 -2
- package/dist/agents/mana/index.html +2 -2
- package/dist/agents/mark/index.html +2 -2
- package/dist/agents/mo/index.html +2 -2
- package/dist/agents/mu/index.html +2 -2
- package/dist/agents/opera/index.html +2 -2
- package/dist/agents/rev/index.html +2 -2
- package/dist/agents/sal/index.html +2 -2
- package/dist/agents/sci/index.html +2 -2
- package/dist/agents/sec/index.html +2 -2
- package/dist/agents/su/index.html +2 -2
- package/dist/agents/vi/index.html +2 -2
- package/dist/apps/ads/index.html +2 -2
- package/dist/apps/ai-chat/index.html +2 -2
- package/dist/apps/analytics/index.html +2 -2
- package/dist/apps/billing/index.html +2 -2
- package/dist/apps/bots/index.html +2 -2
- package/dist/apps/cal/index.html +2 -2
- package/dist/apps/chat/index.html +2 -2
- package/dist/apps/cms/index.html +2 -2
- package/dist/apps/commerce/index.html +2 -2
- package/dist/apps/console/index.html +2 -2
- package/dist/apps/crm/index.html +2 -2
- package/dist/apps/dataroom/index.html +2 -2
- package/dist/apps/dev/index.html +2 -2
- package/dist/apps/email/index.html +2 -2
- package/dist/apps/index.html +2 -2
- package/dist/apps/meet/index.html +2 -2
- package/dist/apps/platform/index.html +2 -2
- package/dist/apps/sign/index.html +2 -2
- package/dist/apps/social/index.html +2 -2
- package/dist/apps/tracker/index.html +2 -2
- package/dist/assets/{Bots-ut9jYpti.js → Bots-BAs5KcxC.js} +2 -2
- package/dist/assets/{Bots-ut9jYpti.js.map → Bots-BAs5KcxC.js.map} +1 -1
- package/dist/assets/{ModelPickerMenu-DVDLitAq.js → ModelPickerMenu-BeA_2xVG.js} +2 -2
- package/dist/assets/{ModelPickerMenu-DVDLitAq.js.map → ModelPickerMenu-BeA_2xVG.js.map} +1 -1
- package/dist/assets/{ThemeToggleNext-GGp7XI4T.js → ThemeToggleNext-1QCLnhiZ.js} +2 -2
- package/dist/assets/{ThemeToggleNext-GGp7XI4T.js.map → ThemeToggleNext-1QCLnhiZ.js.map} +1 -1
- package/dist/assets/{index-DZzmIhRO.js → index-B5JD-zDn.js} +7 -7
- package/dist/assets/{index-DZzmIhRO.js.map → index-B5JD-zDn.js.map} +1 -1
- package/dist/assets/index-DfvuHduu.css +1 -0
- package/dist/auth/callback/index.html +2 -2
- package/dist/auth/index.html +2 -2
- package/dist/bots/index.html +2 -2
- package/dist/cal/index.html +2 -2
- package/dist/calendar/index.html +2 -2
- package/dist/chat/c-design/index.html +2 -2
- package/dist/chat/c-general/index.html +2 -2
- package/dist/chat/c-lux-bank/index.html +2 -2
- package/dist/chat/c-lux-bridge/index.html +2 -2
- package/dist/chat/c-revenue/index.html +2 -2
- package/dist/chat/c-support/index.html +2 -2
- package/dist/chat/c-tracker/index.html +2 -2
- package/dist/chat/c-ui/index.html +2 -2
- package/dist/chat/c-video/index.html +2 -2
- package/dist/chat/dm-algo/index.html +2 -2
- package/dist/chat/dm-art/index.html +2 -2
- package/dist/chat/dm-biz/index.html +2 -2
- package/dist/chat/dm-cal/index.html +2 -2
- package/dist/chat/dm-core/index.html +2 -2
- package/dist/chat/dm-cyber/index.html +2 -2
- package/dist/chat/dm-data/index.html +2 -2
- package/dist/chat/dm-db/index.html +2 -2
- package/dist/chat/dm-des/index.html +2 -2
- package/dist/chat/dm-dev/index.html +2 -2
- package/dist/chat/dm-doc/index.html +2 -2
- package/dist/chat/dm-ed/index.html +2 -2
- package/dist/chat/dm-fin/index.html +2 -2
- package/dist/chat/dm-gov/index.html +2 -2
- package/dist/chat/dm-huma/index.html +2 -2
- package/dist/chat/dm-lang/index.html +2 -2
- package/dist/chat/dm-law/index.html +2 -2
- package/dist/chat/dm-mana/index.html +2 -2
- package/dist/chat/dm-mark/index.html +2 -2
- package/dist/chat/dm-mo/index.html +2 -2
- package/dist/chat/dm-mu/index.html +2 -2
- package/dist/chat/dm-opera/index.html +2 -2
- package/dist/chat/dm-rev/index.html +2 -2
- package/dist/chat/dm-sal/index.html +2 -2
- package/dist/chat/dm-sci/index.html +2 -2
- package/dist/chat/dm-sec/index.html +2 -2
- package/dist/chat/dm-su/index.html +2 -2
- package/dist/chat/dm-vi/index.html +2 -2
- package/dist/chat/index.html +2 -2
- package/dist/crm/analytics/index.html +2 -2
- package/dist/crm/automations/index.html +2 -2
- package/dist/crm/campaigns/index.html +2 -2
- package/dist/crm/companies/index.html +2 -2
- package/dist/crm/contacts/index.html +2 -2
- package/dist/crm/customers/index.html +2 -2
- package/dist/crm/deliverability/index.html +2 -2
- package/dist/crm/forms/index.html +2 -2
- package/dist/crm/funds/index.html +2 -2
- package/dist/crm/index.html +2 -2
- package/dist/crm/investors/index.html +2 -2
- package/dist/crm/journeys/index.html +2 -2
- package/dist/crm/leads/index.html +2 -2
- package/dist/crm/lists/index.html +2 -2
- package/dist/crm/opportunities/index.html +2 -2
- package/dist/crm/segments/index.html +2 -2
- package/dist/crm/settings/index.html +2 -2
- package/dist/crm/templates/index.html +2 -2
- package/dist/crm/webhooks/index.html +2 -2
- package/dist/docs/index.html +2 -2
- package/dist/files/index.html +2 -2
- package/dist/inbox/index.html +2 -2
- package/dist/index.html +2 -2
- package/dist/issues/index.html +2 -2
- package/dist/issues/kanban/index.html +2 -2
- package/dist/issues/list/index.html +2 -2
- package/dist/login/index.html +2 -2
- package/dist/mail/index.html +2 -2
- package/dist/meet/index.html +2 -2
- package/dist/mine/index.html +2 -2
- package/dist/people/index.html +2 -2
- package/dist/projects/index.html +2 -2
- package/dist/projects/proj-crm/components/index.html +2 -2
- package/dist/projects/proj-crm/index.html +2 -2
- package/dist/projects/proj-crm/issues/index.html +2 -2
- package/dist/projects/proj-crm/issues/kanban/index.html +2 -2
- package/dist/projects/proj-crm/issues/list/index.html +2 -2
- package/dist/projects/proj-crm/milestones/index.html +2 -2
- package/dist/projects/proj-crm/templates/index.html +2 -2
- package/dist/projects/proj-dev/components/index.html +2 -2
- package/dist/projects/proj-dev/index.html +2 -2
- package/dist/projects/proj-dev/issues/index.html +2 -2
- package/dist/projects/proj-dev/issues/kanban/index.html +2 -2
- package/dist/projects/proj-dev/issues/list/index.html +2 -2
- package/dist/projects/proj-dev/milestones/index.html +2 -2
- package/dist/projects/proj-dev/templates/index.html +2 -2
- package/dist/projects/proj-mkt/components/index.html +2 -2
- package/dist/projects/proj-mkt/index.html +2 -2
- package/dist/projects/proj-mkt/issues/index.html +2 -2
- package/dist/projects/proj-mkt/issues/kanban/index.html +2 -2
- package/dist/projects/proj-mkt/issues/list/index.html +2 -2
- package/dist/projects/proj-mkt/milestones/index.html +2 -2
- package/dist/projects/proj-mkt/templates/index.html +2 -2
- package/dist/projects/proj-next/components/index.html +2 -2
- package/dist/projects/proj-next/index.html +2 -2
- package/dist/projects/proj-next/issues/index.html +2 -2
- package/dist/projects/proj-next/issues/kanban/index.html +2 -2
- package/dist/projects/proj-next/issues/list/index.html +2 -2
- package/dist/projects/proj-next/milestones/index.html +2 -2
- package/dist/projects/proj-next/templates/index.html +2 -2
- package/dist/settings/index.html +2 -2
- package/dist/time/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-BMlGl4T8.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{D as t,Et as n,Ot as r,R as i,a,n as o,z as s}from"./react-DIaL9_ob.js";import{B as c,C as l,H as u,L as d,Q as f,V as ee,_ as p,a as m,b as h,c as te,d as g,f as _,g as v,h as ne,i as y,l as re,m as b,n as ie,o as ae,p as x,r as S,s as oe,t as C,u as se,x as ce,y as le}from"./catalog-BM2B7gTj.js";import{t as w}from"./Anchor-Avsca6-o.js";import{ct as T,gt as E,it as D,nt as O,ot as k,rt as A,st as j,vt as ue}from"./index-DZzmIhRO.js";var M=e(r(),1),N=n();function P(e,t,n,r=()=>!1){if(n<=0)return-1;let i=e=>Math.max(0,Math.min(n-1,e)),a,o;switch(e){case`ArrowDown`:a=i(t+1),o=1;break;case`ArrowUp`:a=t<0?0:i(t-1),o=-1;break;case`Home`:a=0,o=1;break;case`End`:a=n-1,o=-1;break;case`PageDown`:a=i((t<0?0:t)+10),o=1;break;case`PageUp`:a=i((t<0?0:t)-10),o=-1}for(let e of[o,-o])for(let t=a;t>=0&&t<n;t+=e)if(!r(t))return t;return-1}var F=[{id:`zen7`,owned_by:`zenlm`,family:`zen`,name:`Zen 7`,access:`research`,request:`https://hanzo.ai/research-access`,description:a(`The next open-weight generation after Zen 6, in research preview.`)}];function I(e){let t=new Set(e.map(e=>e.id));return[...e,...F.filter(e=>!t.has(e.id))]}var de=`agents:not`,L=e=>e.access!==`research`;function R(e,t,n,r=!1){let i=I(e).filter(e=>!b(e)&&v(e,t)),a=i.filter(e=>!n||m(e,n)),o=[],s=h(a).sort((e,t)=>Number(t.id===S)-Number(e.id===S)),c=new Set,l=s.filter(e=>{let t=`${g(e)}:${p(e).toLowerCase()}`;return!c.has(t)&&(c.add(t),!0)});for(let e of x(l)){o.push({kind:`group`,key:e.key,label:e.label,count:e.models.length});for(let t of e.models)o.push({kind:`model`,model:t})}if(n===`agent`){let e=h(i.filter(e=>!m(e,`agent`)&&e.access!==`research`)).map(e=>({model:e,gap:y(e)})).filter(e=>e.gap!==null&&e.gap!==`decision`&&e.gap!==`comparison`);if(e.length&&(o.push({kind:`group`,key:de,label:``,count:e.length,fold:r?`open`:`shut`}),r))for(let t of e)o.push({kind:`model`,model:t.model,gap:t.gap})}return o}var fe=e=>e.filter(e=>e.kind===`model`).length,z=(e,t)=>{let n=e[t];return n?.kind===`group`?n.fold!==void 0:n?.kind===`model`&&L(n.model)&&!n.gap};function B(e,t,n){return ce(e)&&n?n(e.id)?`pick`:`top-up`:t&&!t(e.id)?`upgrade`:`pick`}function pe(e,t,n,r,i=8){if(r<=0||n<=0)return{start:0,end:0};let a=Math.floor(Math.max(0,e)/n),o=Math.ceil((Math.max(0,e)+Math.max(0,t))/n);return{start:Math.max(0,a-i),end:Math.min(r,o+i)}}function me(e,t,n,r){let i=e*r;return i<t?i:i+r>t+n?i+r-n:null}var V=360,H=360,he=new Set([`ArrowDown`,`ArrowUp`,`Home`,`End`,`PageDown`,`PageUp`]);function U({models:e,value:n,onChange:r,onClose:a,scope:h,limits:g,loading:v,error:y,name:b,sheet:x,row:S,granted:T,onUpgrade:D,funded:O,balance:k,onTopUp:A}){let{t:j}=o(),[I,de]=(0,M.useState)(``),[H,U]=(0,M.useState)(-1),[W,ge]=(0,M.useState)(0),[_e,ve]=(0,M.useState)(!1),[G,ye]=(0,M.useState)(V),be=(0,M.useRef)(null),xe=(0,M.useRef)(null),Se=(0,M.useId)(),Ce=`${Se}-list`,K=e=>`${Se}-opt-${e}`,q=(0,M.useMemo)(()=>R(e,I,h,_e),[e,I,h,_e]),J=(0,M.useMemo)(()=>fe(q),[q]),Y=(0,M.useMemo)(()=>F.filter(e=>q.some(t=>t.kind===`model`&&t.model.id===e.id)),[q]),we=(0,M.useMemo)(()=>{let e=[],t=0;for(let n of q)e.push(n.kind===`model`?++t:0);return e},[q]),X=(0,M.useCallback)(e=>{be.current?.scrollTo?.({y:e,animated:!1}),ge(e)},[]);(0,M.useEffect)(()=>{let t=R(e,``,h),r=t.findIndex(e=>e.kind===`model`&&e.model.id===n),i=t.findIndex((e,n)=>z(t,n)),a=r>=0?r:i;U(a);let o=a>=0?Math.max(0,a*S-G/2+S/2):0;xe.current?.focus(),requestAnimationFrame(()=>X(o))},[]);let Z=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(!Z.current){Z.current=!0;return}U(q.findIndex((e,t)=>z(q,t))),X(0)},[I]);let Te=(0,M.useCallback)(e=>{let t=me(e,W,G,S);t!==null&&X(t)},[W,G,S,X]),Q=(0,M.useCallback)(e=>{if(e?.kind===`group`){e.fold&&ve(e=>!e);return}if(e?.kind!==`model`||!L(e.model)||e.gap)return;let t=B(e.model,T,O);t===`top-up`?A?.(e.model.id):t===`upgrade`?D?.(e.model.id):r(e.model.id),a()},[r,a,T,D,O,A]),Ee=e=>{let t=e.key;if(he.has(t)){if((t===`Home`||t===`End`)&&I)return;e.preventDefault?.();let n=P(t,H,q.length,e=>!z(q,e));U(n),n>=0&&Te(n);return}if(e.key===`Enter`){e.preventDefault?.(),Q(q[H]);return}e.key===`Escape`&&(e.preventDefault?.(),a())},$=pe(W,G,S,q.length),De=q.slice($.start,$.end);return(0,N.jsxs)(s,{...d(`model-picker-body`),flex:x?1:void 0,minH:0,gap:`$1`,children:[(0,N.jsxs)(i,{...d(`model-picker-search`),height:x?40:32,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,borderWidth:1,borderColor:`$rim`,bg:`$background`,focusWithinStyle:{borderColor:`$outlineColor`},children:[(0,N.jsx)(E,{size:14,color:`$soft`,"aria-hidden":!0}),(0,N.jsx)(u,{ref:xe,...d(`model-picker-input`),unstyled:!0,flex:1,minW:0,height:x?38:30,p:0,borderWidth:0,bg:`transparent`,fontSize:x?`$3`:`$2`,color:`$ink`,placeholderTextColor:`$placeholderColor`,placeholder:j(`Search models`),value:I,onChangeText:de,role:`combobox`,"aria-label":j(`Search models`),"aria-expanded":!0,"aria-controls":Ce,"aria-autocomplete":`list`,"aria-activedescendant":H>=0&&q[H]?K(H):void 0,autoComplete:`off`,spellCheck:!1,onKeyDown:Ee}),(0,N.jsx)(t,{...d(`model-picker-count`),size:`$1`,color:`$soft`,shrink:0,"aria-live":`polite`,children:v&&!e.length?j(`Loading`):j(J===1?`{n} model`:`{n} models`,{n:J})})]}),y?(0,N.jsx)(i,{...d(`model-picker-error`),px:`$2`,py:`$1.5`,role:`alert`,children:(0,N.jsx)(t,{size:`$2`,color:`$bad`,children:y})}):null,(0,N.jsxs)(f,{ref:be,height:x?void 0:Math.min(V,Math.max(S*3,q.length*S)),flex:x?1:void 0,showsVerticalScrollIndicator:!0,scrollEventThrottle:16,onScroll:e=>ge(e.nativeEvent?.contentOffset?.y??0),onLayout:e=>{let t=e.nativeEvent?.layout?.height;t&&ye(t)},children:[(0,N.jsxs)(s,{...d(`model-picker-list`),id:Ce,role:`listbox`,"aria-label":b,height:q.length*S,children:[(0,N.jsx)(s,{height:$.start*S}),De.map((r,a)=>{let o=$.start+a;if(r.kind===`group`&&r.fold)return(0,N.jsxs)(i,{...d(`model-picker-fold`),id:K(o),role:`button`,"aria-expanded":r.fold===`open`,"aria-label":j(`Not available for agents`),height:S,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,cursor:`pointer`,bg:o===H?`$raised`:`transparent`,focusVisibleStyle:l,onHoverIn:()=>U(o),onPress:()=>Q(r),children:[r.fold===`open`?(0,N.jsx)(ue,{size:14,color:`$soft`,"aria-hidden":!0}):(0,N.jsx)(c,{size:14,color:`$soft`,"aria-hidden":!0}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontWeight:`600`,numberOfLines:1,flex:1,children:j(`Not available for agents`)}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontVariant:[`tabular-nums`],children:r.count})]},r.key);if(r.kind===`group`)return(0,N.jsxs)(i,{...d(`model-picker-group`),role:`presentation`,height:S,px:`$2`,gap:`$2`,items:`flex-end`,pb:`$1.5`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontWeight:`600`,numberOfLines:1,flex:1,children:r.label}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontVariant:[`tabular-nums`],children:r.count})]},r.key);let s=r.model,u=!L(s),f=r.gap,v=!u&&!f&&ne(s,g),y=u||f?`pick`:B(s,T,O),b=y===`upgrade`,w=y===`top-up`,E=s.id===n,D=ce(s)?re(s.pricing?.input_per_million,j):``,k=[te(s.context_window),D&&s.pricing?.input_per_million?j(`{price} / 1M`,{price:D}):``].filter(Boolean).join(` · `),A=p(s),M=h||m(s,`chat`)?null:ae(s)[0],P=le(s,e),F=oe(s,j);return(0,N.jsxs)(i,{...d(`model-picker-option`),id:K(o),role:`option`,"aria-selected":E,"aria-disabled":u||f!==void 0||void 0,"aria-setsize":J,"aria-posinset":we[o],"aria-label":u?j(`{model}, {group}, research preview`,{model:A,group:_(s)}):f?j(`{model}, {group}, not available for agents: {why}`,{model:A,group:_(s),why:j(C[f])}):j(w?`{model}, {group}, top up to use`:v?`{model}, {group}, paused`:`{model}, {group}`,{model:A,group:_(s)}),"data-model":s.id,"data-class":s.class,"data-paused":v||void 0,height:S,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,cursor:u||f?`default`:`pointer`,bg:o===H?`$raised`:`transparent`,onHoverIn:()=>U(o),onPress:()=>Q(r),children:[(0,N.jsx)(ee,{size:14,color:`$ink`,shrink:0,opacity:+!!E,"aria-hidden":!0}),(0,N.jsx)(t,{size:x?`$3`:`$2`,color:`$ink`,opacity:u||f?.5:1,numberOfLines:1,flex:1,minW:0,children:A}),s.class===`premium`?(0,N.jsx)(t,{size:`$1`,color:`$soft`,shrink:0,"aria-hidden":!0,children:`✦`}):null,u||f||b||w||v||P||F||M||k?(0,N.jsx)(t,{size:`$1`,color:`$soft`,shrink:0,maxW:`60%`,numberOfLines:1,fontVariant:[`tabular-nums`],children:u?j(`Research preview`):f?j(C[f]):w?k?`${j(`Top up`)} · ${k}`:j(`Top up`):b?j(`Upgrade`):v?j(`Paused`):P?se(P,j):F||(M?j(ie[M]):k)}):null]},s.id)})]}),q.length===0&&!y?(0,N.jsx)(i,{...d(`model-picker-empty`),px:`$2`,py:`$2`,role:`status`,children:(0,N.jsx)(t,{size:`$2`,color:`$soft`,children:v?j(`Loading models…`):I?j(`No models match “{query}”.`,{query:I}):j(`No models to choose from.`)})}):null]}),k!==void 0||A?(0,N.jsxs)(i,{...d(`model-picker-balance`),px:`$2`,py:`$1.5`,gap:`$2`,items:`center`,justify:`space-between`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,numberOfLines:1,flex:1,minW:0,children:k===void 0?``:j(`Balance {amount}`,{amount:k})}),A?(0,N.jsx)(i,{render:`button`,role:`button`,"aria-label":j(`Top up`),cursor:`pointer`,rounded:`$2`,px:`$1.5`,focusVisibleStyle:l,onPress:()=>{A(),a()},children:(0,N.jsx)(t,{size:`$1`,color:`$ink`,textDecorationLine:`underline`,children:j(`Top up`)})}):null]}):null,Y.length?(0,N.jsxs)(i,{...d(`model-picker-research`),px:`$2`,py:`$1.5`,gap:`$1.5`,items:`center`,flexWrap:`wrap`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,children:Y.length===1?j(`{models} is in research preview.`,{models:Y.map(p).join(`, `)}):j(`{models} are in research preview.`,{models:Y.map(p).join(`, `)})}),(0,N.jsx)(w,{href:Y[0].request,target:`_blank`,rel:`noopener noreferrer`,size:`$1`,color:`$ink`,textDecorationLine:`underline`,children:j(`Request access`)})]}):null]})}function W({trigger:e,open:t,onOpen:n,disabled:r,width:i,focusTrigger:a,...o}){let s=t?(0,N.jsx)(U,{...o}):null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(k,{open:t&&!o.sheet,onOpenChange:e=>e?n():o.onClose(),placement:`bottom-start`,allowFlip:!0,stayInFrame:!0,children:[(0,N.jsx)(T,{asChild:!0,disabled:r,children:e}),o.sheet?null:(0,N.jsx)(j,{...d(`model-picker-panel`),sideOffset:6,width:Math.max(i,H),maxW:`92vw`,p:`$1.5`,items:`stretch`,trapFocus:!0,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),a()},children:s})]}),o.sheet?(0,N.jsx)(O,{open:t,onOpenChange:e=>e?n():o.onClose(),children:(0,N.jsxs)(A,{...d(`model-picker-sheet`),side:`bottom`,height:`85%`,maxH:`85%`,p:`$3`,gap:`$2`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(D,{size:`$4`,children:o.name}),s]})}):null]})}export{W as ModelPickerMenu,W as default};
|
|
2
|
-
//# sourceMappingURL=ModelPickerMenu-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{D as t,Et as n,Ot as r,R as i,a,n as o,z as s}from"./react-DIaL9_ob.js";import{B as c,C as l,H as u,L as d,Q as f,V as ee,_ as p,a as m,b as h,c as te,d as g,f as _,g as v,h as ne,i as y,l as re,m as b,n as ie,o as ae,p as x,r as S,s as oe,t as C,u as se,x as ce,y as le}from"./catalog-BM2B7gTj.js";import{t as w}from"./Anchor-Avsca6-o.js";import{ct as T,gt as E,it as D,nt as O,ot as k,rt as A,st as j,vt as ue}from"./index-B5JD-zDn.js";var M=e(r(),1),N=n();function P(e,t,n,r=()=>!1){if(n<=0)return-1;let i=e=>Math.max(0,Math.min(n-1,e)),a,o;switch(e){case`ArrowDown`:a=i(t+1),o=1;break;case`ArrowUp`:a=t<0?0:i(t-1),o=-1;break;case`Home`:a=0,o=1;break;case`End`:a=n-1,o=-1;break;case`PageDown`:a=i((t<0?0:t)+10),o=1;break;case`PageUp`:a=i((t<0?0:t)-10),o=-1}for(let e of[o,-o])for(let t=a;t>=0&&t<n;t+=e)if(!r(t))return t;return-1}var F=[{id:`zen7`,owned_by:`zenlm`,family:`zen`,name:`Zen 7`,access:`research`,request:`https://hanzo.ai/research-access`,description:a(`The next open-weight generation after Zen 6, in research preview.`)}];function I(e){let t=new Set(e.map(e=>e.id));return[...e,...F.filter(e=>!t.has(e.id))]}var de=`agents:not`,L=e=>e.access!==`research`;function R(e,t,n,r=!1){let i=I(e).filter(e=>!b(e)&&v(e,t)),a=i.filter(e=>!n||m(e,n)),o=[],s=h(a).sort((e,t)=>Number(t.id===S)-Number(e.id===S)),c=new Set,l=s.filter(e=>{let t=`${g(e)}:${p(e).toLowerCase()}`;return!c.has(t)&&(c.add(t),!0)});for(let e of x(l)){o.push({kind:`group`,key:e.key,label:e.label,count:e.models.length});for(let t of e.models)o.push({kind:`model`,model:t})}if(n===`agent`){let e=h(i.filter(e=>!m(e,`agent`)&&e.access!==`research`)).map(e=>({model:e,gap:y(e)})).filter(e=>e.gap!==null&&e.gap!==`decision`&&e.gap!==`comparison`);if(e.length&&(o.push({kind:`group`,key:de,label:``,count:e.length,fold:r?`open`:`shut`}),r))for(let t of e)o.push({kind:`model`,model:t.model,gap:t.gap})}return o}var fe=e=>e.filter(e=>e.kind===`model`).length,z=(e,t)=>{let n=e[t];return n?.kind===`group`?n.fold!==void 0:n?.kind===`model`&&L(n.model)&&!n.gap};function B(e,t,n){return ce(e)&&n?n(e.id)?`pick`:`top-up`:t&&!t(e.id)?`upgrade`:`pick`}function pe(e,t,n,r,i=8){if(r<=0||n<=0)return{start:0,end:0};let a=Math.floor(Math.max(0,e)/n),o=Math.ceil((Math.max(0,e)+Math.max(0,t))/n);return{start:Math.max(0,a-i),end:Math.min(r,o+i)}}function me(e,t,n,r){let i=e*r;return i<t?i:i+r>t+n?i+r-n:null}var V=360,H=360,he=new Set([`ArrowDown`,`ArrowUp`,`Home`,`End`,`PageDown`,`PageUp`]);function U({models:e,value:n,onChange:r,onClose:a,scope:h,limits:g,loading:v,error:y,name:b,sheet:x,row:S,granted:T,onUpgrade:D,funded:O,balance:k,onTopUp:A}){let{t:j}=o(),[I,de]=(0,M.useState)(``),[H,U]=(0,M.useState)(-1),[W,ge]=(0,M.useState)(0),[_e,ve]=(0,M.useState)(!1),[G,ye]=(0,M.useState)(V),be=(0,M.useRef)(null),xe=(0,M.useRef)(null),Se=(0,M.useId)(),Ce=`${Se}-list`,K=e=>`${Se}-opt-${e}`,q=(0,M.useMemo)(()=>R(e,I,h,_e),[e,I,h,_e]),J=(0,M.useMemo)(()=>fe(q),[q]),Y=(0,M.useMemo)(()=>F.filter(e=>q.some(t=>t.kind===`model`&&t.model.id===e.id)),[q]),we=(0,M.useMemo)(()=>{let e=[],t=0;for(let n of q)e.push(n.kind===`model`?++t:0);return e},[q]),X=(0,M.useCallback)(e=>{be.current?.scrollTo?.({y:e,animated:!1}),ge(e)},[]);(0,M.useEffect)(()=>{let t=R(e,``,h),r=t.findIndex(e=>e.kind===`model`&&e.model.id===n),i=t.findIndex((e,n)=>z(t,n)),a=r>=0?r:i;U(a);let o=a>=0?Math.max(0,a*S-G/2+S/2):0;xe.current?.focus(),requestAnimationFrame(()=>X(o))},[]);let Z=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(!Z.current){Z.current=!0;return}U(q.findIndex((e,t)=>z(q,t))),X(0)},[I]);let Te=(0,M.useCallback)(e=>{let t=me(e,W,G,S);t!==null&&X(t)},[W,G,S,X]),Q=(0,M.useCallback)(e=>{if(e?.kind===`group`){e.fold&&ve(e=>!e);return}if(e?.kind!==`model`||!L(e.model)||e.gap)return;let t=B(e.model,T,O);t===`top-up`?A?.(e.model.id):t===`upgrade`?D?.(e.model.id):r(e.model.id),a()},[r,a,T,D,O,A]),Ee=e=>{let t=e.key;if(he.has(t)){if((t===`Home`||t===`End`)&&I)return;e.preventDefault?.();let n=P(t,H,q.length,e=>!z(q,e));U(n),n>=0&&Te(n);return}if(e.key===`Enter`){e.preventDefault?.(),Q(q[H]);return}e.key===`Escape`&&(e.preventDefault?.(),a())},$=pe(W,G,S,q.length),De=q.slice($.start,$.end);return(0,N.jsxs)(s,{...d(`model-picker-body`),flex:x?1:void 0,minH:0,gap:`$1`,children:[(0,N.jsxs)(i,{...d(`model-picker-search`),height:x?40:32,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,borderWidth:1,borderColor:`$rim`,bg:`$background`,focusWithinStyle:{borderColor:`$outlineColor`},children:[(0,N.jsx)(E,{size:14,color:`$soft`,"aria-hidden":!0}),(0,N.jsx)(u,{ref:xe,...d(`model-picker-input`),unstyled:!0,flex:1,minW:0,height:x?38:30,p:0,borderWidth:0,bg:`transparent`,fontSize:x?`$3`:`$2`,color:`$ink`,placeholderTextColor:`$placeholderColor`,placeholder:j(`Search models`),value:I,onChangeText:de,role:`combobox`,"aria-label":j(`Search models`),"aria-expanded":!0,"aria-controls":Ce,"aria-autocomplete":`list`,"aria-activedescendant":H>=0&&q[H]?K(H):void 0,autoComplete:`off`,spellCheck:!1,onKeyDown:Ee}),(0,N.jsx)(t,{...d(`model-picker-count`),size:`$1`,color:`$soft`,shrink:0,"aria-live":`polite`,children:v&&!e.length?j(`Loading`):j(J===1?`{n} model`:`{n} models`,{n:J})})]}),y?(0,N.jsx)(i,{...d(`model-picker-error`),px:`$2`,py:`$1.5`,role:`alert`,children:(0,N.jsx)(t,{size:`$2`,color:`$bad`,children:y})}):null,(0,N.jsxs)(f,{ref:be,height:x?void 0:Math.min(V,Math.max(S*3,q.length*S)),flex:x?1:void 0,showsVerticalScrollIndicator:!0,scrollEventThrottle:16,onScroll:e=>ge(e.nativeEvent?.contentOffset?.y??0),onLayout:e=>{let t=e.nativeEvent?.layout?.height;t&&ye(t)},children:[(0,N.jsxs)(s,{...d(`model-picker-list`),id:Ce,role:`listbox`,"aria-label":b,height:q.length*S,children:[(0,N.jsx)(s,{height:$.start*S}),De.map((r,a)=>{let o=$.start+a;if(r.kind===`group`&&r.fold)return(0,N.jsxs)(i,{...d(`model-picker-fold`),id:K(o),role:`button`,"aria-expanded":r.fold===`open`,"aria-label":j(`Not available for agents`),height:S,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,cursor:`pointer`,bg:o===H?`$raised`:`transparent`,focusVisibleStyle:l,onHoverIn:()=>U(o),onPress:()=>Q(r),children:[r.fold===`open`?(0,N.jsx)(ue,{size:14,color:`$soft`,"aria-hidden":!0}):(0,N.jsx)(c,{size:14,color:`$soft`,"aria-hidden":!0}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontWeight:`600`,numberOfLines:1,flex:1,children:j(`Not available for agents`)}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontVariant:[`tabular-nums`],children:r.count})]},r.key);if(r.kind===`group`)return(0,N.jsxs)(i,{...d(`model-picker-group`),role:`presentation`,height:S,px:`$2`,gap:`$2`,items:`flex-end`,pb:`$1.5`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontWeight:`600`,numberOfLines:1,flex:1,children:r.label}),(0,N.jsx)(t,{size:`$1`,color:`$soft`,fontVariant:[`tabular-nums`],children:r.count})]},r.key);let s=r.model,u=!L(s),f=r.gap,v=!u&&!f&&ne(s,g),y=u||f?`pick`:B(s,T,O),b=y===`upgrade`,w=y===`top-up`,E=s.id===n,D=ce(s)?re(s.pricing?.input_per_million,j):``,k=[te(s.context_window),D&&s.pricing?.input_per_million?j(`{price} / 1M`,{price:D}):``].filter(Boolean).join(` · `),A=p(s),M=h||m(s,`chat`)?null:ae(s)[0],P=le(s,e),F=oe(s,j);return(0,N.jsxs)(i,{...d(`model-picker-option`),id:K(o),role:`option`,"aria-selected":E,"aria-disabled":u||f!==void 0||void 0,"aria-setsize":J,"aria-posinset":we[o],"aria-label":u?j(`{model}, {group}, research preview`,{model:A,group:_(s)}):f?j(`{model}, {group}, not available for agents: {why}`,{model:A,group:_(s),why:j(C[f])}):j(w?`{model}, {group}, top up to use`:v?`{model}, {group}, paused`:`{model}, {group}`,{model:A,group:_(s)}),"data-model":s.id,"data-class":s.class,"data-paused":v||void 0,height:S,px:`$2`,gap:`$2`,items:`center`,rounded:`$2`,cursor:u||f?`default`:`pointer`,bg:o===H?`$raised`:`transparent`,onHoverIn:()=>U(o),onPress:()=>Q(r),children:[(0,N.jsx)(ee,{size:14,color:`$ink`,shrink:0,opacity:+!!E,"aria-hidden":!0}),(0,N.jsx)(t,{size:x?`$3`:`$2`,color:`$ink`,opacity:u||f?.5:1,numberOfLines:1,flex:1,minW:0,children:A}),s.class===`premium`?(0,N.jsx)(t,{size:`$1`,color:`$soft`,shrink:0,"aria-hidden":!0,children:`✦`}):null,u||f||b||w||v||P||F||M||k?(0,N.jsx)(t,{size:`$1`,color:`$soft`,shrink:0,maxW:`60%`,numberOfLines:1,fontVariant:[`tabular-nums`],children:u?j(`Research preview`):f?j(C[f]):w?k?`${j(`Top up`)} · ${k}`:j(`Top up`):b?j(`Upgrade`):v?j(`Paused`):P?se(P,j):F||(M?j(ie[M]):k)}):null]},s.id)})]}),q.length===0&&!y?(0,N.jsx)(i,{...d(`model-picker-empty`),px:`$2`,py:`$2`,role:`status`,children:(0,N.jsx)(t,{size:`$2`,color:`$soft`,children:v?j(`Loading models…`):I?j(`No models match “{query}”.`,{query:I}):j(`No models to choose from.`)})}):null]}),k!==void 0||A?(0,N.jsxs)(i,{...d(`model-picker-balance`),px:`$2`,py:`$1.5`,gap:`$2`,items:`center`,justify:`space-between`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,numberOfLines:1,flex:1,minW:0,children:k===void 0?``:j(`Balance {amount}`,{amount:k})}),A?(0,N.jsx)(i,{render:`button`,role:`button`,"aria-label":j(`Top up`),cursor:`pointer`,rounded:`$2`,px:`$1.5`,focusVisibleStyle:l,onPress:()=>{A(),a()},children:(0,N.jsx)(t,{size:`$1`,color:`$ink`,textDecorationLine:`underline`,children:j(`Top up`)})}):null]}):null,Y.length?(0,N.jsxs)(i,{...d(`model-picker-research`),px:`$2`,py:`$1.5`,gap:`$1.5`,items:`center`,flexWrap:`wrap`,children:[(0,N.jsx)(t,{size:`$1`,color:`$soft`,children:Y.length===1?j(`{models} is in research preview.`,{models:Y.map(p).join(`, `)}):j(`{models} are in research preview.`,{models:Y.map(p).join(`, `)})}),(0,N.jsx)(w,{href:Y[0].request,target:`_blank`,rel:`noopener noreferrer`,size:`$1`,color:`$ink`,textDecorationLine:`underline`,children:j(`Request access`)})]}):null]})}function W({trigger:e,open:t,onOpen:n,disabled:r,width:i,focusTrigger:a,...o}){let s=t?(0,N.jsx)(U,{...o}):null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(k,{open:t&&!o.sheet,onOpenChange:e=>e?n():o.onClose(),placement:`bottom-start`,allowFlip:!0,stayInFrame:!0,children:[(0,N.jsx)(T,{asChild:!0,disabled:r,children:e}),o.sheet?null:(0,N.jsx)(j,{...d(`model-picker-panel`),sideOffset:6,width:Math.max(i,H),maxW:`92vw`,p:`$1.5`,items:`stretch`,trapFocus:!0,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),a()},children:s})]}),o.sheet?(0,N.jsx)(O,{open:t,onOpenChange:e=>e?n():o.onClose(),children:(0,N.jsxs)(A,{...d(`model-picker-sheet`),side:`bottom`,height:`85%`,maxH:`85%`,p:`$3`,gap:`$2`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(D,{size:`$4`,children:o.name}),s]})}):null]})}export{W as ModelPickerMenu,W as default};
|
|
2
|
+
//# sourceMappingURL=ModelPickerMenu-BeA_2xVG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelPickerMenu-DVDLitAq.js","names":["useState","useRef","useId","useMemo","useCallback","_jsxs","_jsx","GuiInput","_Fragment"],"sources":["../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/product/chipSelect.logic.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/research.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/picker.logic.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/ModelPickerMenu.js"],"sourcesContent":["/**\n * ChipSelect's decisions, as pure functions over plain values.\n *\n * Paging, pinning and the cursor are the parts of a searchable list that are\n * easy to get subtly wrong and impossible to see wrong in a screenshot: a page\n * that arrives twice lists a row twice, a stale page lands under a newer search,\n * a cursor walks off the end. So they live here, importing nothing, and are\n * tested in node.\n */\n/**\n * Append a page to what is listed, dropping anything already there.\n *\n * Cursor pagination over a list that moves under it (a repository pushed,\n * reordering by `pushed_at`) hands the same row back on two pages. Keyed by id,\n * the second copy is dropped and the first keeps its place.\n */\nexport function merge(listed, page) {\n const seen = new Set(listed.map((i) => i.id));\n const out = listed.slice();\n for (const item of page) {\n if (seen.has(item.id))\n continue;\n seen.add(item.id);\n out.push(item);\n }\n return out;\n}\n/**\n * The rows in the order they are drawn: the chosen item first, then the rest\n * without it.\n *\n * The chosen item is pinned only while the search could have matched it — an\n * empty search, or one its label contains — so typing narrows the list instead\n * of leaving an unrelated row stuck on top.\n */\n/** What a row says, label and tail together: what a search is held against. */\nexport const said = (i) => i.label + (i.tail ?? '');\nexport function pin(items, chosen, q = '') {\n const rest = items.filter((i) => !chosen || i.id !== chosen.id);\n if (!chosen)\n return rest;\n const needle = q.trim().toLowerCase();\n if (needle && !said(chosen).toLowerCase().includes(needle))\n return rest;\n return [chosen, ...rest];\n}\n/**\n * A literal, case-insensitive substring match on the label and hint — for a\n * list the caller hands over whole (no loader), where the search is ours to\n * apply. Never a compiled pattern: the needle is whatever was typed.\n */\nexport function narrow(items, q) {\n const needle = q.trim().toLowerCase();\n if (!needle)\n return items.slice();\n return items.filter((i) => said(i).toLowerCase().includes(needle) || (i.hint ?? '').toLowerCase().includes(needle));\n}\n/** How far PageUp/PageDown travel — roughly what the list shows at once. */\nexport const PAGE = 10;\n/**\n * Where the cursor lands.\n *\n * `from` is -1 before anything is under the cursor; `count` is how many rows\n * are drawn. It stops at the ends rather than wrapping: the list pages in more\n * rows at its end, and a cursor that wrapped to the top would skip the load.\n * Disabled rows are stepped over in the direction of travel.\n */\nexport function move(key, from, count, disabled = () => false) {\n if (count <= 0)\n return -1;\n const clamp = (n) => Math.max(0, Math.min(count - 1, n));\n let at;\n let dir;\n switch (key) {\n case 'ArrowDown':\n at = clamp(from + 1);\n dir = 1;\n break;\n case 'ArrowUp':\n at = from < 0 ? 0 : clamp(from - 1);\n dir = -1;\n break;\n case 'Home':\n at = 0;\n dir = 1;\n break;\n case 'End':\n at = count - 1;\n dir = -1;\n break;\n case 'PageDown':\n at = clamp((from < 0 ? 0 : from) + PAGE);\n dir = 1;\n break;\n case 'PageUp':\n at = clamp((from < 0 ? 0 : from) - PAGE);\n dir = -1;\n break;\n }\n // Step over disabled rows; if the whole remaining direction is disabled, try\n // the other way; if everything is, nothing is under the cursor.\n for (const d of [dir, -dir]) {\n for (let i = at; i >= 0 && i < count; i += d)\n if (!disabled(i))\n return i;\n }\n return -1;\n}\n/**\n * Whether the list should ask for the next page: there is one, nothing is in\n * flight, and the reader is within `slack` rows of the end — by the cursor, or\n * by having scrolled there.\n */\nexport function wants(opts) {\n const { next, loading, at, count, slack = 3 } = opts;\n if (!next || loading)\n return false;\n return at >= count - 1 - slack;\n}\n/** Whether a scroll position is near the bottom of what is scrollable. */\nexport function near(top, height, content, slack = 48) {\n return top + height >= content - slack;\n}\n/**\n * The list's height while a panel is open, decided once, at open.\n *\n * The panel is placed from its size at open: the popper watches the chip and\n * not the panel (watching the panel loops), so a panel that grows afterwards\n * grows past its own placement — a top-placed panel down over its chip and off\n * the screen. So nothing may resize it while it is open. A list whose length is\n * not known yet — pages from a loader, or rows still loading — takes the whole\n * `ceiling`; a known list its own length, capped there.\n */\nexport function frame(opts) {\n const { pending, count, row, ceiling, pad = 8 } = opts;\n if (pending)\n return ceiling;\n return Math.min(ceiling, Math.max(count, 1) * row + pad);\n}\n//# sourceMappingURL=chipSelect.logic.js.map","/**\n * The models that exist and cannot be called, apart from the rest of the\n * catalog so that a page naming one (hanzo.ai's lib/zen) loads this row alone.\n * `./catalog` re-exports both names.\n */\nimport { phrase } from '@hanzo/i18n';\n/**\n * The models that exist and cannot be called, said once for every list of\n * models: a picker draws each one disabled, a catalogue page draws it muted.\n * `/v1/models` never answers for one, so nothing can route to it.\n */\nexport const RESEARCH = [\n {\n id: 'zen7',\n owned_by: 'zenlm',\n family: 'zen',\n name: 'Zen 7',\n access: 'research',\n request: 'https://hanzo.ai/research-access',\n // Authored here, not read from the catalog: a page draws it through `t`.\n description: phrase('The next open-weight generation after Zen 6, in research preview.'),\n },\n];\n/** The catalog with the research models it does not already list, appended. */\nexport function withResearch(models) {\n const ids = new Set(models.map((m) => m.id));\n return [...models, ...RESEARCH.filter((m) => !ids.has(m.id))];\n}\n//# sourceMappingURL=research.js.map","/**\n * ModelPicker's decisions, as pure functions over plain values: which rows are\n * drawn, and which slice of them a scrolled viewport shows. Tested in node.\n */\nimport { agentGap, can, ENSO, groupKey, groupModels, isComparison, matchesModel, modelName, sortModels, thirdParty, withResearch, } from './catalog.js';\n/** The key of the group that holds what an agent cannot run on. */\nexport const NOT_FOR_AGENTS = 'agents:not';\n/** Whether a model may be picked: everything the gateway lists, never a research preview. */\nexport const pickable = (m) => m.access !== 'research';\n/**\n * The rows for a catalog: the models `scope` allows (all of them without one),\n * the research previews among them, narrowed by the search, in groups — Hanzo's\n * families first — each sorted by name, with the house router first in Enso. The\n * comparison vendor's models (Jev) are in no list.\n *\n * For an agent (`scope` 'agent'), what cannot run one stands last in a group of\n * its own, shut until `opened`, each model disabled with the few words that say\n * why. Decision models and the comparison vendor's are not listed at all.\n */\nexport function pickerRows(models, query, scope, opened = false) {\n const listed = withResearch(models).filter((m) => !isComparison(m) && matchesModel(m, query));\n const offered = listed.filter((m) => !scope || can(m, scope));\n const rows = [];\n const sorted = sortModels(offered).sort((a, b) => Number(b.id === ENSO) - Number(a.id === ENSO));\n // Two ids that read as one name in one group are one row.\n const seen = new Set();\n const unique = sorted.filter((m) => {\n const k = `${groupKey(m)}:${modelName(m).toLowerCase()}`;\n if (seen.has(k))\n return false;\n seen.add(k);\n return true;\n });\n for (const g of groupModels(unique)) {\n rows.push({ kind: 'group', key: g.key, label: g.label, count: g.models.length });\n for (const model of g.models)\n rows.push({ kind: 'model', model });\n }\n if (scope === 'agent') {\n const rest = sortModels(listed.filter((m) => !can(m, 'agent') && m.access !== 'research'))\n .map((model) => ({ model, gap: agentGap(model) }))\n .filter((r) => r.gap !== null && r.gap !== 'decision' && r.gap !== 'comparison');\n if (rest.length) {\n rows.push({ kind: 'group', key: NOT_FOR_AGENTS, label: '', count: rest.length, fold: opened ? 'open' : 'shut' });\n if (opened)\n for (const r of rest)\n rows.push({ kind: 'model', model: r.model, gap: r.gap });\n }\n }\n return rows;\n}\n/** How many models the rows draw. */\nexport const modelCount = (rows) => rows.filter((r) => r.kind === 'model').length;\n/** Whether the cursor may rest on a row: a model that can be picked, or the heading that opens a shut group. */\nexport const restable = (rows, i) => {\n const r = rows[i];\n if (r?.kind === 'group')\n return r.fold !== undefined;\n return r?.kind === 'model' && pickable(r.model) && !r.gap;\n};\n/**\n * Hanzo's own models follow the plan (`granted`); another maker's are paid from the\n * prepaid balance on any plan (`funded`). A check the host does not supply is not\n * made, and a third-party model with no `funded` check follows the plan as it did.\n */\nexport function standing(m, granted, funded) {\n if (thirdParty(m) && funded)\n return funded(m.id) ? 'pick' : 'top-up';\n return granted && !granted(m.id) ? 'upgrade' : 'pick';\n}\n/**\n * The rows a viewport shows, `over` rows beyond each edge, for rows of one\n * height. `end` is exclusive.\n */\nexport function visibleRange(top, height, row, count, over = 8) {\n if (count <= 0 || row <= 0)\n return { start: 0, end: 0 };\n const first = Math.floor(Math.max(0, top) / row);\n const last = Math.ceil((Math.max(0, top) + Math.max(0, height)) / row);\n return { start: Math.max(0, first - over), end: Math.min(count, last + over) };\n}\n/**\n * The scroll offset that brings row `i` into a viewport, or null when it is in\n * view already: the least movement, the way `scrollIntoView({block:'nearest'})` reads.\n */\nexport function revealTop(i, top, height, row) {\n const y = i * row;\n if (y < top)\n return y;\n if (y + row > top + height)\n return y + row - height;\n return null;\n}\n//# sourceMappingURL=picker.logic.js.map","'use client';\nimport { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';\n/**\n * The open half of ModelPicker: the popover (a bottom sheet on a phone) and in\n * it the search, the virtualised list and the research note. It loads when a\n * picker is first pointed at, focused or opened, so a page that only shows the\n * chosen model carries the trigger alone.\n *\n * VIRTUALISED. Five hundred rows are drawn as the ~15 in view plus a margin:\n * every row is one height, so a scroll offset names the slice outright and\n * two spacers stand in for the rest. The cursor moves over the full list and\n * scrolls itself into view, so keyboard reach is the same as a full render.\n *\n * ARIA: the search field is the combobox and owns the cursor through\n * `aria-activedescendant`; the list is a listbox whose options carry\n * `aria-setsize` / `aria-posinset`, since most of them are not in the DOM.\n * Group headings are presentation: the option's own label names the group.\n */\nimport { Anchor, Input as GuiInput, ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';\nimport { useI18n } from '@hanzo/i18n/react';\nimport { Check, ChevronDown, ChevronRight, Search } from '@hanzogui/lucide-icons-2';\nimport { Popover, PopoverContent, PopoverTrigger } from '../backends/gui/popover.js';\nimport { Sheet, SheetContent, SheetTitle } from '../backends/gui/sheet.js';\nimport { RING } from '../backends/gui/press.js';\nimport { slot } from '../backends/gui/slot.js';\nimport { move } from '../product/chipSelect.logic.js';\nimport { AGENT_GAPS, can, capabilitiesOf, CAPABILITY_NAMES, formatCeiling, formatContext, formatPrice, formatSaving, groupLabel, isPaused, modelName, RESEARCH, savingOf, thirdParty } from './catalog.js';\nimport { modelCount, pickable, pickerRows, restable, revealTop, standing, visibleRange } from './picker.logic.js';\n/** The list's ceiling in a popover, px. */\nconst LIST_H = 360;\nconst PANEL_W = 360;\nconst MOVES = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End', 'PageDown', 'PageUp']);\nfunction List({ models, value, onChange, onClose, scope, limits, loading, error, name, sheet, row, granted, onUpgrade, funded, balance, onTopUp }) {\n const { t } = useI18n();\n const [q, setQ] = useState('');\n const [at, setAt] = useState(-1);\n const [top, setTop] = useState(0);\n // What cannot run an agent is listed shut, and opens when asked.\n const [opened, setOpened] = useState(false);\n const [viewH, setViewH] = useState(LIST_H);\n const list = useRef(null);\n const field = useRef(null);\n const id = useId();\n const listId = `${id}-list`;\n const optionId = (i) => `${id}-opt-${i}`;\n const rows = useMemo(() => pickerRows(models, q, scope, opened), [models, q, scope, opened]);\n const total = useMemo(() => modelCount(rows), [rows]);\n const research = useMemo(() => RESEARCH.filter((r) => rows.some((x) => x.kind === 'model' && x.model.id === r.id)), [rows]);\n // Position among the models alone, for aria-posinset.\n const position = useMemo(() => {\n const pos = [];\n let n = 0;\n for (const r of rows)\n pos.push(r.kind === 'model' ? ++n : 0);\n return pos;\n }, [rows]);\n const scrollTo = useCallback((y) => {\n list.current?.scrollTo?.({ y, animated: false });\n setTop(y);\n }, []);\n // It mounts as the picker opens: from the top of an empty search, the cursor\n // on the chosen model — scrolled to the middle of the list — or the first one,\n // and the search field holding the focus.\n useEffect(() => {\n const all = pickerRows(models, '', scope);\n const chosen = all.findIndex((r) => r.kind === 'model' && r.model.id === value);\n const first = all.findIndex((_, i) => restable(all, i));\n const i = chosen >= 0 ? chosen : first;\n setAt(i);\n const y = i >= 0 ? Math.max(0, i * row - viewH / 2 + row / 2) : 0;\n field.current?.focus();\n // The list lays out with the panel; scroll once it is there.\n requestAnimationFrame(() => scrollTo(y));\n // Only on mount: the cursor is the reader's after that.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n // A new search puts the cursor on its first match, at the top.\n const searched = useRef(false);\n useEffect(() => {\n if (!searched.current) {\n searched.current = true;\n return;\n }\n setAt(rows.findIndex((_, i) => restable(rows, i)));\n scrollTo(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [q]);\n const reveal = useCallback((i) => {\n const y = revealTop(i, top, viewH, row);\n if (y !== null)\n scrollTo(y);\n }, [top, viewH, row, scrollTo]);\n const choose = useCallback((r) => {\n if (r?.kind === 'group') {\n if (r.fold)\n setOpened((o) => !o);\n return;\n }\n if (r?.kind !== 'model' || !pickable(r.model) || r.gap)\n return;\n const s = standing(r.model, granted, funded);\n if (s === 'top-up')\n onTopUp?.(r.model.id);\n else if (s === 'upgrade')\n onUpgrade?.(r.model.id);\n else\n onChange(r.model.id);\n onClose();\n }, [onChange, onClose, granted, onUpgrade, funded, onTopUp]);\n const onField = (e) => {\n const key = e.key;\n if (MOVES.has(key)) {\n if ((key === 'Home' || key === 'End') && q)\n return;\n e.preventDefault?.();\n const to = move(key, at, rows.length, (i) => !restable(rows, i));\n setAt(to);\n if (to >= 0)\n reveal(to);\n return;\n }\n if (e.key === 'Enter') {\n e.preventDefault?.();\n choose(rows[at]);\n return;\n }\n if (e.key === 'Escape') {\n e.preventDefault?.();\n onClose();\n }\n };\n const range = visibleRange(top, viewH, row, rows.length);\n const shown = rows.slice(range.start, range.end);\n return (_jsxs(YStack, { ...slot('model-picker-body'), flex: sheet ? 1 : undefined, minH: 0, gap: \"$1\", children: [_jsxs(XStack, { ...slot('model-picker-search'), height: sheet ? 40 : 32, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", borderWidth: 1, borderColor: \"$rim\", bg: \"$background\", focusWithinStyle: { borderColor: '$outlineColor' }, children: [_jsx(Search, { size: 14, color: \"$soft\", \"aria-hidden\": true }), _jsx(GuiInput, { ref: field, ...slot('model-picker-input'), unstyled: true, flex: 1, minW: 0, height: sheet ? 38 : 30, p: 0, borderWidth: 0, bg: \"transparent\", fontSize: sheet ? '$3' : '$2', color: \"$ink\", placeholderTextColor: \"$placeholderColor\", placeholder: t('Search models'), value: q, onChangeText: setQ, role: \"combobox\", \"aria-label\": t('Search models'), \"aria-expanded\": true, \"aria-controls\": listId, \"aria-autocomplete\": \"list\", \"aria-activedescendant\": at >= 0 && rows[at] ? optionId(at) : undefined, autoComplete: \"off\", spellCheck: false, onKeyDown: onField }), _jsx(SizableText, { ...slot('model-picker-count'), size: \"$1\", color: \"$soft\", shrink: 0, \"aria-live\": \"polite\", children: loading && !models.length ? t('Loading') : total === 1 ? t('{n} model', { n: total }) : t('{n} models', { n: total }) })] }), error ? (_jsx(XStack, { ...slot('model-picker-error'), px: \"$2\", py: \"$1.5\", role: \"alert\", children: _jsx(SizableText, { size: \"$2\", color: \"$bad\", children: error }) })) : null, _jsxs(ScrollView, { ref: list, height: sheet ? undefined : Math.min(LIST_H, Math.max(row * 3, rows.length * row)), flex: sheet ? 1 : undefined, showsVerticalScrollIndicator: true, scrollEventThrottle: 16, onScroll: (e) => setTop(e.nativeEvent?.contentOffset?.y ?? 0), onLayout: (e) => {\n const h = e.nativeEvent?.layout?.height;\n if (h)\n setViewH(h);\n }, children: [_jsxs(YStack, { ...slot('model-picker-list'), id: listId, role: \"listbox\", \"aria-label\": name, height: rows.length * row, children: [_jsx(YStack, { height: range.start * row }), shown.map((r, k) => {\n const i = range.start + k;\n if (r.kind === 'group' && r.fold) {\n return (_jsxs(XStack, { ...slot('model-picker-fold'), id: optionId(i), role: \"button\", \"aria-expanded\": r.fold === 'open', \"aria-label\": t('Not available for agents'), height: row, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", cursor: \"pointer\", bg: i === at ? '$raised' : 'transparent', focusVisibleStyle: RING, onHoverIn: () => setAt(i), onPress: () => choose(r), children: [r.fold === 'open' ? _jsx(ChevronDown, { size: 14, color: \"$soft\", \"aria-hidden\": true }) : _jsx(ChevronRight, { size: 14, color: \"$soft\", \"aria-hidden\": true }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontWeight: \"600\", numberOfLines: 1, flex: 1, children: t('Not available for agents') }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontVariant: ['tabular-nums'], children: r.count })] }, r.key));\n }\n if (r.kind === 'group') {\n return (_jsxs(XStack, { ...slot('model-picker-group'), role: \"presentation\", height: row, px: \"$2\", gap: \"$2\", items: \"flex-end\", pb: \"$1.5\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", fontWeight: \"600\", numberOfLines: 1, flex: 1, children: r.label }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontVariant: ['tabular-nums'], children: r.count })] }, r.key));\n }\n const m = r.model;\n const locked = !pickable(m);\n const gap = r.gap;\n const paused = !locked && !gap && isPaused(m, limits);\n const s = locked || gap ? 'pick' : standing(m, granted, funded);\n const upgrade = s === 'upgrade';\n const topup = s === 'top-up';\n const picked = m.id === value;\n // Another maker's model shows what it costs by the million tokens, beside its window.\n const price = thirdParty(m) ? formatPrice(m.pricing?.input_per_million, t) : '';\n const ctx = [formatContext(m.context_window), price && m.pricing?.input_per_million ? t('{price} / 1M', { price }) : ''].filter(Boolean).join(' · ');\n const title = modelName(m);\n // A model that answers in something other than a conversation says\n // what it does, so an unscoped list is honest about each row.\n const kind = scope || can(m, 'chat') ? null : capabilitiesOf(m)[0];\n // A model sold against another says by how much, from the two list prices;\n // a router, the ceiling it bills up to.\n const saving = savingOf(m, models);\n const ceiling = formatCeiling(m, t);\n return (_jsxs(XStack, { ...slot('model-picker-option'), id: optionId(i), role: \"option\", \"aria-selected\": picked, \"aria-disabled\": locked || gap !== undefined || undefined, \"aria-setsize\": total, \"aria-posinset\": position[i], \"aria-label\": locked\n ? t('{model}, {group}, research preview', { model: title, group: groupLabel(m) })\n : gap\n ? t('{model}, {group}, not available for agents: {why}', { model: title, group: groupLabel(m), why: t(AGENT_GAPS[gap]) })\n : topup\n ? t('{model}, {group}, top up to use', { model: title, group: groupLabel(m) })\n : paused\n ? t('{model}, {group}, paused', { model: title, group: groupLabel(m) })\n : t('{model}, {group}', { model: title, group: groupLabel(m) }), \"data-model\": m.id, \"data-class\": m.class, \"data-paused\": paused || undefined, height: row, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", cursor: locked || gap ? 'default' : 'pointer', bg: i === at ? '$raised' : 'transparent', onHoverIn: () => setAt(i), onPress: () => choose(r), children: [_jsx(Check, { size: 14, color: \"$ink\", shrink: 0, opacity: picked ? 1 : 0, \"aria-hidden\": true }), _jsx(SizableText, { size: sheet ? '$3' : '$2', color: \"$ink\", opacity: locked || gap ? 0.5 : 1, numberOfLines: 1, flex: 1, minW: 0, children: title }), m.class === 'premium' ? (_jsx(SizableText, { size: \"$1\", color: \"$soft\", shrink: 0, \"aria-hidden\": true, children: \"\\u2726\" })) : null, locked || gap || upgrade || topup || paused || saving || ceiling || kind || ctx ? (_jsx(SizableText, { size: \"$1\", color: \"$soft\", shrink: 0, maxW: \"60%\", numberOfLines: 1, fontVariant: ['tabular-nums'], children: locked\n ? t('Research preview')\n : gap\n ? t(AGENT_GAPS[gap])\n : topup\n ? ctx\n ? `${t('Top up')} · ${ctx}`\n : t('Top up')\n : upgrade\n ? t('Upgrade')\n : paused\n ? t('Paused')\n : saving\n ? formatSaving(saving, t)\n : ceiling\n ? ceiling\n : kind\n ? t(CAPABILITY_NAMES[kind])\n : ctx })) : null] }, m.id));\n })] }), rows.length === 0 && !error ? (_jsx(XStack, { ...slot('model-picker-empty'), px: \"$2\", py: \"$2\", role: \"status\", children: _jsx(SizableText, { size: \"$2\", color: \"$soft\", children: loading ? t('Loading models…') : q ? t('No models match “{query}”.', { query: q }) : t('No models to choose from.') }) })) : null] }), balance !== undefined || onTopUp ? (_jsxs(XStack, { ...slot('model-picker-balance'), px: \"$2\", py: \"$1.5\", gap: \"$2\", items: \"center\", justify: \"space-between\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", numberOfLines: 1, flex: 1, minW: 0, children: balance !== undefined ? t('Balance {amount}', { amount: balance }) : '' }), onTopUp ? (_jsx(XStack, { render: \"button\", role: \"button\", \"aria-label\": t('Top up'), cursor: \"pointer\", rounded: \"$2\", px: \"$1.5\", focusVisibleStyle: RING, onPress: () => {\n onTopUp();\n onClose();\n }, children: _jsx(SizableText, { size: \"$1\", color: \"$ink\", textDecorationLine: \"underline\", children: t('Top up') }) })) : null] })) : null, research.length ? (_jsxs(XStack, { ...slot('model-picker-research'), px: \"$2\", py: \"$1.5\", gap: \"$1.5\", items: \"center\", flexWrap: \"wrap\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", children: research.length === 1\n ? t('{models} is in research preview.', { models: research.map(modelName).join(', ') })\n : t('{models} are in research preview.', { models: research.map(modelName).join(', ') }) }), _jsx(Anchor, { href: research[0].request, target: \"_blank\", rel: \"noopener noreferrer\", size: \"$1\", color: \"$ink\", textDecorationLine: \"underline\", children: t('Request access') })] })) : null] }));\n}\n/** The trigger in its popover, or beside its sheet on a phone, and the list in it while open. */\nexport function ModelPickerMenu({ trigger, open, onOpen, disabled, width, focusTrigger, ...list }) {\n const body = open ? _jsx(List, { ...list }) : null;\n return (_jsxs(_Fragment, { children: [_jsxs(Popover, { open: open && !list.sheet, onOpenChange: (v) => (v ? onOpen() : list.onClose()), placement: \"bottom-start\", allowFlip: true, stayInFrame: true, children: [_jsx(PopoverTrigger, { asChild: true, disabled: disabled, children: trigger }), list.sheet ? null : (_jsx(PopoverContent, { ...slot('model-picker-panel'), sideOffset: 6, width: Math.max(width, PANEL_W), maxW: \"92vw\", p: \"$1.5\", items: \"stretch\", trapFocus: true, onOpenAutoFocus: (e) => e.preventDefault(), onCloseAutoFocus: (e) => {\n e.preventDefault();\n focusTrigger();\n }, children: body }))] }), list.sheet ? (_jsx(Sheet, { open: open, onOpenChange: (v) => (v ? onOpen() : list.onClose()), children: _jsxs(SheetContent, { ...slot('model-picker-sheet'), side: \"bottom\", height: \"85%\", maxH: \"85%\", p: \"$3\", gap: \"$2\", onOpenAutoFocus: (e) => e.preventDefault(), children: [_jsx(SheetTitle, { size: \"$4\", children: list.name }), body] }) })) : null] }));\n}\nexport default ModelPickerMenu;\n//# sourceMappingURL=ModelPickerMenu.js.map"],"x_google_ignoreList":[0,1,2,3],"mappings":"qgBAmEA,SAAgB,EAAK,EAAK,EAAM,EAAO,MAAiB,GAAO,CAC3D,GAAI,GAAS,EACT,MAAO,GACX,IAAM,EAAS,GAAM,KAAK,IAAI,EAAG,KAAK,IAAI,EAAQ,EAAG,CAA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UD,EAAAA,KAAAA,CAAM,EAAc,CAAE,GAAG,EAAK,oBAAoB,EAAG,KAAM,SAAU,OAAQ,MAAO,KAAM,MAAO,EAAG,KAAM,IAAK,KAAM,gBAAkB,GAAM,EAAE,eAAe,EAAG,SAAU,EAAA,EAACC,EAAAA,IAAAA,CAAK,EAAY,CAAE,KAAM,KAAM,SAAU,EAAK,IAAK,CAAC,EAAG,CAAI,CAAE,CAAC,CAAE,CAAC,EAAK,IAAI,CAAE,CAAC,CACpZ"}
|
|
1
|
+
{"version":3,"file":"ModelPickerMenu-BeA_2xVG.js","names":["useState","useRef","useId","useMemo","useCallback","_jsxs","_jsx","GuiInput","_Fragment"],"sources":["../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/product/chipSelect.logic.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/research.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/picker.logic.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/models/ModelPickerMenu.js"],"sourcesContent":["/**\n * ChipSelect's decisions, as pure functions over plain values.\n *\n * Paging, pinning and the cursor are the parts of a searchable list that are\n * easy to get subtly wrong and impossible to see wrong in a screenshot: a page\n * that arrives twice lists a row twice, a stale page lands under a newer search,\n * a cursor walks off the end. So they live here, importing nothing, and are\n * tested in node.\n */\n/**\n * Append a page to what is listed, dropping anything already there.\n *\n * Cursor pagination over a list that moves under it (a repository pushed,\n * reordering by `pushed_at`) hands the same row back on two pages. Keyed by id,\n * the second copy is dropped and the first keeps its place.\n */\nexport function merge(listed, page) {\n const seen = new Set(listed.map((i) => i.id));\n const out = listed.slice();\n for (const item of page) {\n if (seen.has(item.id))\n continue;\n seen.add(item.id);\n out.push(item);\n }\n return out;\n}\n/**\n * The rows in the order they are drawn: the chosen item first, then the rest\n * without it.\n *\n * The chosen item is pinned only while the search could have matched it — an\n * empty search, or one its label contains — so typing narrows the list instead\n * of leaving an unrelated row stuck on top.\n */\n/** What a row says, label and tail together: what a search is held against. */\nexport const said = (i) => i.label + (i.tail ?? '');\nexport function pin(items, chosen, q = '') {\n const rest = items.filter((i) => !chosen || i.id !== chosen.id);\n if (!chosen)\n return rest;\n const needle = q.trim().toLowerCase();\n if (needle && !said(chosen).toLowerCase().includes(needle))\n return rest;\n return [chosen, ...rest];\n}\n/**\n * A literal, case-insensitive substring match on the label and hint — for a\n * list the caller hands over whole (no loader), where the search is ours to\n * apply. Never a compiled pattern: the needle is whatever was typed.\n */\nexport function narrow(items, q) {\n const needle = q.trim().toLowerCase();\n if (!needle)\n return items.slice();\n return items.filter((i) => said(i).toLowerCase().includes(needle) || (i.hint ?? '').toLowerCase().includes(needle));\n}\n/** How far PageUp/PageDown travel — roughly what the list shows at once. */\nexport const PAGE = 10;\n/**\n * Where the cursor lands.\n *\n * `from` is -1 before anything is under the cursor; `count` is how many rows\n * are drawn. It stops at the ends rather than wrapping: the list pages in more\n * rows at its end, and a cursor that wrapped to the top would skip the load.\n * Disabled rows are stepped over in the direction of travel.\n */\nexport function move(key, from, count, disabled = () => false) {\n if (count <= 0)\n return -1;\n const clamp = (n) => Math.max(0, Math.min(count - 1, n));\n let at;\n let dir;\n switch (key) {\n case 'ArrowDown':\n at = clamp(from + 1);\n dir = 1;\n break;\n case 'ArrowUp':\n at = from < 0 ? 0 : clamp(from - 1);\n dir = -1;\n break;\n case 'Home':\n at = 0;\n dir = 1;\n break;\n case 'End':\n at = count - 1;\n dir = -1;\n break;\n case 'PageDown':\n at = clamp((from < 0 ? 0 : from) + PAGE);\n dir = 1;\n break;\n case 'PageUp':\n at = clamp((from < 0 ? 0 : from) - PAGE);\n dir = -1;\n break;\n }\n // Step over disabled rows; if the whole remaining direction is disabled, try\n // the other way; if everything is, nothing is under the cursor.\n for (const d of [dir, -dir]) {\n for (let i = at; i >= 0 && i < count; i += d)\n if (!disabled(i))\n return i;\n }\n return -1;\n}\n/**\n * Whether the list should ask for the next page: there is one, nothing is in\n * flight, and the reader is within `slack` rows of the end — by the cursor, or\n * by having scrolled there.\n */\nexport function wants(opts) {\n const { next, loading, at, count, slack = 3 } = opts;\n if (!next || loading)\n return false;\n return at >= count - 1 - slack;\n}\n/** Whether a scroll position is near the bottom of what is scrollable. */\nexport function near(top, height, content, slack = 48) {\n return top + height >= content - slack;\n}\n/**\n * The list's height while a panel is open, decided once, at open.\n *\n * The panel is placed from its size at open: the popper watches the chip and\n * not the panel (watching the panel loops), so a panel that grows afterwards\n * grows past its own placement — a top-placed panel down over its chip and off\n * the screen. So nothing may resize it while it is open. A list whose length is\n * not known yet — pages from a loader, or rows still loading — takes the whole\n * `ceiling`; a known list its own length, capped there.\n */\nexport function frame(opts) {\n const { pending, count, row, ceiling, pad = 8 } = opts;\n if (pending)\n return ceiling;\n return Math.min(ceiling, Math.max(count, 1) * row + pad);\n}\n//# sourceMappingURL=chipSelect.logic.js.map","/**\n * The models that exist and cannot be called, apart from the rest of the\n * catalog so that a page naming one (hanzo.ai's lib/zen) loads this row alone.\n * `./catalog` re-exports both names.\n */\nimport { phrase } from '@hanzo/i18n';\n/**\n * The models that exist and cannot be called, said once for every list of\n * models: a picker draws each one disabled, a catalogue page draws it muted.\n * `/v1/models` never answers for one, so nothing can route to it.\n */\nexport const RESEARCH = [\n {\n id: 'zen7',\n owned_by: 'zenlm',\n family: 'zen',\n name: 'Zen 7',\n access: 'research',\n request: 'https://hanzo.ai/research-access',\n // Authored here, not read from the catalog: a page draws it through `t`.\n description: phrase('The next open-weight generation after Zen 6, in research preview.'),\n },\n];\n/** The catalog with the research models it does not already list, appended. */\nexport function withResearch(models) {\n const ids = new Set(models.map((m) => m.id));\n return [...models, ...RESEARCH.filter((m) => !ids.has(m.id))];\n}\n//# sourceMappingURL=research.js.map","/**\n * ModelPicker's decisions, as pure functions over plain values: which rows are\n * drawn, and which slice of them a scrolled viewport shows. Tested in node.\n */\nimport { agentGap, can, ENSO, groupKey, groupModels, isComparison, matchesModel, modelName, sortModels, thirdParty, withResearch, } from './catalog.js';\n/** The key of the group that holds what an agent cannot run on. */\nexport const NOT_FOR_AGENTS = 'agents:not';\n/** Whether a model may be picked: everything the gateway lists, never a research preview. */\nexport const pickable = (m) => m.access !== 'research';\n/**\n * The rows for a catalog: the models `scope` allows (all of them without one),\n * the research previews among them, narrowed by the search, in groups — Hanzo's\n * families first — each sorted by name, with the house router first in Enso. The\n * comparison vendor's models (Jev) are in no list.\n *\n * For an agent (`scope` 'agent'), what cannot run one stands last in a group of\n * its own, shut until `opened`, each model disabled with the few words that say\n * why. Decision models and the comparison vendor's are not listed at all.\n */\nexport function pickerRows(models, query, scope, opened = false) {\n const listed = withResearch(models).filter((m) => !isComparison(m) && matchesModel(m, query));\n const offered = listed.filter((m) => !scope || can(m, scope));\n const rows = [];\n const sorted = sortModels(offered).sort((a, b) => Number(b.id === ENSO) - Number(a.id === ENSO));\n // Two ids that read as one name in one group are one row.\n const seen = new Set();\n const unique = sorted.filter((m) => {\n const k = `${groupKey(m)}:${modelName(m).toLowerCase()}`;\n if (seen.has(k))\n return false;\n seen.add(k);\n return true;\n });\n for (const g of groupModels(unique)) {\n rows.push({ kind: 'group', key: g.key, label: g.label, count: g.models.length });\n for (const model of g.models)\n rows.push({ kind: 'model', model });\n }\n if (scope === 'agent') {\n const rest = sortModels(listed.filter((m) => !can(m, 'agent') && m.access !== 'research'))\n .map((model) => ({ model, gap: agentGap(model) }))\n .filter((r) => r.gap !== null && r.gap !== 'decision' && r.gap !== 'comparison');\n if (rest.length) {\n rows.push({ kind: 'group', key: NOT_FOR_AGENTS, label: '', count: rest.length, fold: opened ? 'open' : 'shut' });\n if (opened)\n for (const r of rest)\n rows.push({ kind: 'model', model: r.model, gap: r.gap });\n }\n }\n return rows;\n}\n/** How many models the rows draw. */\nexport const modelCount = (rows) => rows.filter((r) => r.kind === 'model').length;\n/** Whether the cursor may rest on a row: a model that can be picked, or the heading that opens a shut group. */\nexport const restable = (rows, i) => {\n const r = rows[i];\n if (r?.kind === 'group')\n return r.fold !== undefined;\n return r?.kind === 'model' && pickable(r.model) && !r.gap;\n};\n/**\n * Hanzo's own models follow the plan (`granted`); another maker's are paid from the\n * prepaid balance on any plan (`funded`). A check the host does not supply is not\n * made, and a third-party model with no `funded` check follows the plan as it did.\n */\nexport function standing(m, granted, funded) {\n if (thirdParty(m) && funded)\n return funded(m.id) ? 'pick' : 'top-up';\n return granted && !granted(m.id) ? 'upgrade' : 'pick';\n}\n/**\n * The rows a viewport shows, `over` rows beyond each edge, for rows of one\n * height. `end` is exclusive.\n */\nexport function visibleRange(top, height, row, count, over = 8) {\n if (count <= 0 || row <= 0)\n return { start: 0, end: 0 };\n const first = Math.floor(Math.max(0, top) / row);\n const last = Math.ceil((Math.max(0, top) + Math.max(0, height)) / row);\n return { start: Math.max(0, first - over), end: Math.min(count, last + over) };\n}\n/**\n * The scroll offset that brings row `i` into a viewport, or null when it is in\n * view already: the least movement, the way `scrollIntoView({block:'nearest'})` reads.\n */\nexport function revealTop(i, top, height, row) {\n const y = i * row;\n if (y < top)\n return y;\n if (y + row > top + height)\n return y + row - height;\n return null;\n}\n//# sourceMappingURL=picker.logic.js.map","'use client';\nimport { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';\n/**\n * The open half of ModelPicker: the popover (a bottom sheet on a phone) and in\n * it the search, the virtualised list and the research note. It loads when a\n * picker is first pointed at, focused or opened, so a page that only shows the\n * chosen model carries the trigger alone.\n *\n * VIRTUALISED. Five hundred rows are drawn as the ~15 in view plus a margin:\n * every row is one height, so a scroll offset names the slice outright and\n * two spacers stand in for the rest. The cursor moves over the full list and\n * scrolls itself into view, so keyboard reach is the same as a full render.\n *\n * ARIA: the search field is the combobox and owns the cursor through\n * `aria-activedescendant`; the list is a listbox whose options carry\n * `aria-setsize` / `aria-posinset`, since most of them are not in the DOM.\n * Group headings are presentation: the option's own label names the group.\n */\nimport { Anchor, Input as GuiInput, ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';\nimport { useI18n } from '@hanzo/i18n/react';\nimport { Check, ChevronDown, ChevronRight, Search } from '@hanzogui/lucide-icons-2';\nimport { Popover, PopoverContent, PopoverTrigger } from '../backends/gui/popover.js';\nimport { Sheet, SheetContent, SheetTitle } from '../backends/gui/sheet.js';\nimport { RING } from '../backends/gui/press.js';\nimport { slot } from '../backends/gui/slot.js';\nimport { move } from '../product/chipSelect.logic.js';\nimport { AGENT_GAPS, can, capabilitiesOf, CAPABILITY_NAMES, formatCeiling, formatContext, formatPrice, formatSaving, groupLabel, isPaused, modelName, RESEARCH, savingOf, thirdParty } from './catalog.js';\nimport { modelCount, pickable, pickerRows, restable, revealTop, standing, visibleRange } from './picker.logic.js';\n/** The list's ceiling in a popover, px. */\nconst LIST_H = 360;\nconst PANEL_W = 360;\nconst MOVES = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End', 'PageDown', 'PageUp']);\nfunction List({ models, value, onChange, onClose, scope, limits, loading, error, name, sheet, row, granted, onUpgrade, funded, balance, onTopUp }) {\n const { t } = useI18n();\n const [q, setQ] = useState('');\n const [at, setAt] = useState(-1);\n const [top, setTop] = useState(0);\n // What cannot run an agent is listed shut, and opens when asked.\n const [opened, setOpened] = useState(false);\n const [viewH, setViewH] = useState(LIST_H);\n const list = useRef(null);\n const field = useRef(null);\n const id = useId();\n const listId = `${id}-list`;\n const optionId = (i) => `${id}-opt-${i}`;\n const rows = useMemo(() => pickerRows(models, q, scope, opened), [models, q, scope, opened]);\n const total = useMemo(() => modelCount(rows), [rows]);\n const research = useMemo(() => RESEARCH.filter((r) => rows.some((x) => x.kind === 'model' && x.model.id === r.id)), [rows]);\n // Position among the models alone, for aria-posinset.\n const position = useMemo(() => {\n const pos = [];\n let n = 0;\n for (const r of rows)\n pos.push(r.kind === 'model' ? ++n : 0);\n return pos;\n }, [rows]);\n const scrollTo = useCallback((y) => {\n list.current?.scrollTo?.({ y, animated: false });\n setTop(y);\n }, []);\n // It mounts as the picker opens: from the top of an empty search, the cursor\n // on the chosen model — scrolled to the middle of the list — or the first one,\n // and the search field holding the focus.\n useEffect(() => {\n const all = pickerRows(models, '', scope);\n const chosen = all.findIndex((r) => r.kind === 'model' && r.model.id === value);\n const first = all.findIndex((_, i) => restable(all, i));\n const i = chosen >= 0 ? chosen : first;\n setAt(i);\n const y = i >= 0 ? Math.max(0, i * row - viewH / 2 + row / 2) : 0;\n field.current?.focus();\n // The list lays out with the panel; scroll once it is there.\n requestAnimationFrame(() => scrollTo(y));\n // Only on mount: the cursor is the reader's after that.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n // A new search puts the cursor on its first match, at the top.\n const searched = useRef(false);\n useEffect(() => {\n if (!searched.current) {\n searched.current = true;\n return;\n }\n setAt(rows.findIndex((_, i) => restable(rows, i)));\n scrollTo(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [q]);\n const reveal = useCallback((i) => {\n const y = revealTop(i, top, viewH, row);\n if (y !== null)\n scrollTo(y);\n }, [top, viewH, row, scrollTo]);\n const choose = useCallback((r) => {\n if (r?.kind === 'group') {\n if (r.fold)\n setOpened((o) => !o);\n return;\n }\n if (r?.kind !== 'model' || !pickable(r.model) || r.gap)\n return;\n const s = standing(r.model, granted, funded);\n if (s === 'top-up')\n onTopUp?.(r.model.id);\n else if (s === 'upgrade')\n onUpgrade?.(r.model.id);\n else\n onChange(r.model.id);\n onClose();\n }, [onChange, onClose, granted, onUpgrade, funded, onTopUp]);\n const onField = (e) => {\n const key = e.key;\n if (MOVES.has(key)) {\n if ((key === 'Home' || key === 'End') && q)\n return;\n e.preventDefault?.();\n const to = move(key, at, rows.length, (i) => !restable(rows, i));\n setAt(to);\n if (to >= 0)\n reveal(to);\n return;\n }\n if (e.key === 'Enter') {\n e.preventDefault?.();\n choose(rows[at]);\n return;\n }\n if (e.key === 'Escape') {\n e.preventDefault?.();\n onClose();\n }\n };\n const range = visibleRange(top, viewH, row, rows.length);\n const shown = rows.slice(range.start, range.end);\n return (_jsxs(YStack, { ...slot('model-picker-body'), flex: sheet ? 1 : undefined, minH: 0, gap: \"$1\", children: [_jsxs(XStack, { ...slot('model-picker-search'), height: sheet ? 40 : 32, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", borderWidth: 1, borderColor: \"$rim\", bg: \"$background\", focusWithinStyle: { borderColor: '$outlineColor' }, children: [_jsx(Search, { size: 14, color: \"$soft\", \"aria-hidden\": true }), _jsx(GuiInput, { ref: field, ...slot('model-picker-input'), unstyled: true, flex: 1, minW: 0, height: sheet ? 38 : 30, p: 0, borderWidth: 0, bg: \"transparent\", fontSize: sheet ? '$3' : '$2', color: \"$ink\", placeholderTextColor: \"$placeholderColor\", placeholder: t('Search models'), value: q, onChangeText: setQ, role: \"combobox\", \"aria-label\": t('Search models'), \"aria-expanded\": true, \"aria-controls\": listId, \"aria-autocomplete\": \"list\", \"aria-activedescendant\": at >= 0 && rows[at] ? optionId(at) : undefined, autoComplete: \"off\", spellCheck: false, onKeyDown: onField }), _jsx(SizableText, { ...slot('model-picker-count'), size: \"$1\", color: \"$soft\", shrink: 0, \"aria-live\": \"polite\", children: loading && !models.length ? t('Loading') : total === 1 ? t('{n} model', { n: total }) : t('{n} models', { n: total }) })] }), error ? (_jsx(XStack, { ...slot('model-picker-error'), px: \"$2\", py: \"$1.5\", role: \"alert\", children: _jsx(SizableText, { size: \"$2\", color: \"$bad\", children: error }) })) : null, _jsxs(ScrollView, { ref: list, height: sheet ? undefined : Math.min(LIST_H, Math.max(row * 3, rows.length * row)), flex: sheet ? 1 : undefined, showsVerticalScrollIndicator: true, scrollEventThrottle: 16, onScroll: (e) => setTop(e.nativeEvent?.contentOffset?.y ?? 0), onLayout: (e) => {\n const h = e.nativeEvent?.layout?.height;\n if (h)\n setViewH(h);\n }, children: [_jsxs(YStack, { ...slot('model-picker-list'), id: listId, role: \"listbox\", \"aria-label\": name, height: rows.length * row, children: [_jsx(YStack, { height: range.start * row }), shown.map((r, k) => {\n const i = range.start + k;\n if (r.kind === 'group' && r.fold) {\n return (_jsxs(XStack, { ...slot('model-picker-fold'), id: optionId(i), role: \"button\", \"aria-expanded\": r.fold === 'open', \"aria-label\": t('Not available for agents'), height: row, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", cursor: \"pointer\", bg: i === at ? '$raised' : 'transparent', focusVisibleStyle: RING, onHoverIn: () => setAt(i), onPress: () => choose(r), children: [r.fold === 'open' ? _jsx(ChevronDown, { size: 14, color: \"$soft\", \"aria-hidden\": true }) : _jsx(ChevronRight, { size: 14, color: \"$soft\", \"aria-hidden\": true }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontWeight: \"600\", numberOfLines: 1, flex: 1, children: t('Not available for agents') }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontVariant: ['tabular-nums'], children: r.count })] }, r.key));\n }\n if (r.kind === 'group') {\n return (_jsxs(XStack, { ...slot('model-picker-group'), role: \"presentation\", height: row, px: \"$2\", gap: \"$2\", items: \"flex-end\", pb: \"$1.5\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", fontWeight: \"600\", numberOfLines: 1, flex: 1, children: r.label }), _jsx(SizableText, { size: \"$1\", color: \"$soft\", fontVariant: ['tabular-nums'], children: r.count })] }, r.key));\n }\n const m = r.model;\n const locked = !pickable(m);\n const gap = r.gap;\n const paused = !locked && !gap && isPaused(m, limits);\n const s = locked || gap ? 'pick' : standing(m, granted, funded);\n const upgrade = s === 'upgrade';\n const topup = s === 'top-up';\n const picked = m.id === value;\n // Another maker's model shows what it costs by the million tokens, beside its window.\n const price = thirdParty(m) ? formatPrice(m.pricing?.input_per_million, t) : '';\n const ctx = [formatContext(m.context_window), price && m.pricing?.input_per_million ? t('{price} / 1M', { price }) : ''].filter(Boolean).join(' · ');\n const title = modelName(m);\n // A model that answers in something other than a conversation says\n // what it does, so an unscoped list is honest about each row.\n const kind = scope || can(m, 'chat') ? null : capabilitiesOf(m)[0];\n // A model sold against another says by how much, from the two list prices;\n // a router, the ceiling it bills up to.\n const saving = savingOf(m, models);\n const ceiling = formatCeiling(m, t);\n return (_jsxs(XStack, { ...slot('model-picker-option'), id: optionId(i), role: \"option\", \"aria-selected\": picked, \"aria-disabled\": locked || gap !== undefined || undefined, \"aria-setsize\": total, \"aria-posinset\": position[i], \"aria-label\": locked\n ? t('{model}, {group}, research preview', { model: title, group: groupLabel(m) })\n : gap\n ? t('{model}, {group}, not available for agents: {why}', { model: title, group: groupLabel(m), why: t(AGENT_GAPS[gap]) })\n : topup\n ? t('{model}, {group}, top up to use', { model: title, group: groupLabel(m) })\n : paused\n ? t('{model}, {group}, paused', { model: title, group: groupLabel(m) })\n : t('{model}, {group}', { model: title, group: groupLabel(m) }), \"data-model\": m.id, \"data-class\": m.class, \"data-paused\": paused || undefined, height: row, px: \"$2\", gap: \"$2\", items: \"center\", rounded: \"$2\", cursor: locked || gap ? 'default' : 'pointer', bg: i === at ? '$raised' : 'transparent', onHoverIn: () => setAt(i), onPress: () => choose(r), children: [_jsx(Check, { size: 14, color: \"$ink\", shrink: 0, opacity: picked ? 1 : 0, \"aria-hidden\": true }), _jsx(SizableText, { size: sheet ? '$3' : '$2', color: \"$ink\", opacity: locked || gap ? 0.5 : 1, numberOfLines: 1, flex: 1, minW: 0, children: title }), m.class === 'premium' ? (_jsx(SizableText, { size: \"$1\", color: \"$soft\", shrink: 0, \"aria-hidden\": true, children: \"\\u2726\" })) : null, locked || gap || upgrade || topup || paused || saving || ceiling || kind || ctx ? (_jsx(SizableText, { size: \"$1\", color: \"$soft\", shrink: 0, maxW: \"60%\", numberOfLines: 1, fontVariant: ['tabular-nums'], children: locked\n ? t('Research preview')\n : gap\n ? t(AGENT_GAPS[gap])\n : topup\n ? ctx\n ? `${t('Top up')} · ${ctx}`\n : t('Top up')\n : upgrade\n ? t('Upgrade')\n : paused\n ? t('Paused')\n : saving\n ? formatSaving(saving, t)\n : ceiling\n ? ceiling\n : kind\n ? t(CAPABILITY_NAMES[kind])\n : ctx })) : null] }, m.id));\n })] }), rows.length === 0 && !error ? (_jsx(XStack, { ...slot('model-picker-empty'), px: \"$2\", py: \"$2\", role: \"status\", children: _jsx(SizableText, { size: \"$2\", color: \"$soft\", children: loading ? t('Loading models…') : q ? t('No models match “{query}”.', { query: q }) : t('No models to choose from.') }) })) : null] }), balance !== undefined || onTopUp ? (_jsxs(XStack, { ...slot('model-picker-balance'), px: \"$2\", py: \"$1.5\", gap: \"$2\", items: \"center\", justify: \"space-between\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", numberOfLines: 1, flex: 1, minW: 0, children: balance !== undefined ? t('Balance {amount}', { amount: balance }) : '' }), onTopUp ? (_jsx(XStack, { render: \"button\", role: \"button\", \"aria-label\": t('Top up'), cursor: \"pointer\", rounded: \"$2\", px: \"$1.5\", focusVisibleStyle: RING, onPress: () => {\n onTopUp();\n onClose();\n }, children: _jsx(SizableText, { size: \"$1\", color: \"$ink\", textDecorationLine: \"underline\", children: t('Top up') }) })) : null] })) : null, research.length ? (_jsxs(XStack, { ...slot('model-picker-research'), px: \"$2\", py: \"$1.5\", gap: \"$1.5\", items: \"center\", flexWrap: \"wrap\", children: [_jsx(SizableText, { size: \"$1\", color: \"$soft\", children: research.length === 1\n ? t('{models} is in research preview.', { models: research.map(modelName).join(', ') })\n : t('{models} are in research preview.', { models: research.map(modelName).join(', ') }) }), _jsx(Anchor, { href: research[0].request, target: \"_blank\", rel: \"noopener noreferrer\", size: \"$1\", color: \"$ink\", textDecorationLine: \"underline\", children: t('Request access') })] })) : null] }));\n}\n/** The trigger in its popover, or beside its sheet on a phone, and the list in it while open. */\nexport function ModelPickerMenu({ trigger, open, onOpen, disabled, width, focusTrigger, ...list }) {\n const body = open ? _jsx(List, { ...list }) : null;\n return (_jsxs(_Fragment, { children: [_jsxs(Popover, { open: open && !list.sheet, onOpenChange: (v) => (v ? onOpen() : list.onClose()), placement: \"bottom-start\", allowFlip: true, stayInFrame: true, children: [_jsx(PopoverTrigger, { asChild: true, disabled: disabled, children: trigger }), list.sheet ? null : (_jsx(PopoverContent, { ...slot('model-picker-panel'), sideOffset: 6, width: Math.max(width, PANEL_W), maxW: \"92vw\", p: \"$1.5\", items: \"stretch\", trapFocus: true, onOpenAutoFocus: (e) => e.preventDefault(), onCloseAutoFocus: (e) => {\n e.preventDefault();\n focusTrigger();\n }, children: body }))] }), list.sheet ? (_jsx(Sheet, { open: open, onOpenChange: (v) => (v ? onOpen() : list.onClose()), children: _jsxs(SheetContent, { ...slot('model-picker-sheet'), side: \"bottom\", height: \"85%\", maxH: \"85%\", p: \"$3\", gap: \"$2\", onOpenAutoFocus: (e) => e.preventDefault(), children: [_jsx(SheetTitle, { size: \"$4\", children: list.name }), body] }) })) : null] }));\n}\nexport default ModelPickerMenu;\n//# sourceMappingURL=ModelPickerMenu.js.map"],"x_google_ignoreList":[0,1,2,3],"mappings":"qgBAmEA,SAAgB,EAAK,EAAK,EAAM,EAAO,MAAiB,GAAO,CAC3D,GAAI,GAAS,EACT,MAAO,GACX,IAAM,EAAS,GAAM,KAAK,IAAI,EAAG,KAAK,IAAI,EAAQ,EAAG,CAAC,CAAC,EACnD,EACA,EACJ,OAAQ,EAAR,CACI,IAAK,YACD,EAAK,EAAM,EAAO,CAAC,EACnB,EAAM,EACN,MACJ,IAAK,UACD,EAAK,EAAO,EAAI,EAAI,EAAM,EAAO,CAAC,EAClC,EAAM,GACN,MACJ,IAAK,OACD,EAAK,EACL,EAAM,EACN,MACJ,IAAK,MACD,EAAK,EAAQ,EACb,EAAM,GACN,MACJ,IAAK,WACD,EAAK,GAAO,EAAO,EAAI,EAAI,GAAA,EAAY,EACvC,EAAM,EACN,MACJ,IAAK,SACD,EAAK,GAAO,EAAO,EAAI,EAAI,GAAA,EAAY,EACv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t as n,Et as r,J as i,Ot as a,St as o}from"./react-DIaL9_ob.js";import{N as s}from"./index-DZzmIhRO.js";var c=t((e=>{function t(e){return e&&e.__esModule?e:{default:e}}e._=t})),l=t((e=>{function t(e){if(typeof WeakMap!=`function`)return null;var n=new WeakMap,r=new WeakMap;return(t=function(e){return e?r:n})(e)}function n(e,n){if(!n&&e&&e.__esModule)return e;if(e===null||typeof e!=`object`&&typeof e!=`function`)return{default:e};var r=t(n);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}e._=n})),u=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HeadManagerContext",{enumerable:!0,get:function(){return t}});var t=c()._(a()).default.createContext({})})),d=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"setAttributesFromProps",{enumerable:!0,get:function(){return a}});var n={acceptCharset:`accept-charset`,className:`class`,htmlFor:`for`,httpEquiv:`http-equiv`,noModule:`noModule`},r=[`onLoad`,`onReady`,`dangerouslySetInnerHTML`,`children`,`onError`,`strategy`,`stylesheets`];function i(e){return[`async`,`defer`,`noModule`].includes(e)}function a(e,t){for(let[a,o]of Object.entries(t)){if(!t.hasOwnProperty(a)||r.includes(a)||o===void 0)continue;let s=n[a]||a.toLowerCase();e.tagName===`SCRIPT`&&i(s)?e[s]=!!o:e.setAttribute(s,String(o)),(o===!1||e.tagName===`SCRIPT`&&i(s)&&(!o||o===`false`))&&(e.setAttribute(s,``),e.removeAttribute(s))}}(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),f=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={cancelIdleCallback:null,requestIdleCallback:null});function n(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}n(e,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});var r=typeof self<`u`&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},i=typeof self<`u`&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),p=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={ESCAPE_REGEX:null,htmlEscapeAttributeString:null,htmlEscapeJsonString:null});function n(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}n(e,{ESCAPE_REGEX:function(){return i},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return s}});var r={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},i=/[&><\u2028\u2029]/g,a={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`},o=/[&"'<>]/g;function s(e){return e.replace(i,e=>r[e])}function c(e){return e.replace(o,e=>a[e])}})),m=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={default:null,handleClientScriptLoad:null,initScriptLoader:null});function i(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}i(e,{default:function(){return A},handleClientScriptLoad:function(){return T},initScriptLoader:function(){return O}});var o=c(),s=l(),m=r(),h=o._(n()),g=s._(a()),_=u(),v=d(),y=f(),b=p(),x=new Map,S=new Set,C=e=>{if(h.default.preinit){e.forEach(e=>{h.default.preinit(e,{as:`style`})});return}if(typeof window<`u`){let t=document.head;e.forEach(e=>{let n=document.createElement(`link`);n.type=`text/css`,n.rel=`stylesheet`,n.href=e,t.appendChild(n)})}},w=e=>{let{src:t,id:n,onLoad:r=()=>{},onReady:i=null,dangerouslySetInnerHTML:a,children:o=``,strategy:s=`afterInteractive`,onError:c,stylesheets:l}=e,u=n||t;if(u&&S.has(u))return;if(x.has(t)){S.add(u),x.get(t).then(r,c);return}let d=()=>{i&&i(),S.add(u)},f=document.createElement(`script`),p=new Promise((e,t)=>{f.addEventListener(`load`,function(t){e(),r&&r.call(this,t),d()}),f.addEventListener(`error`,function(e){t(e)})}).catch(function(e){c&&c(e)});a?(f.innerHTML=a.__html||``,d()):o?(f.textContent=typeof o==`string`?o:Array.isArray(o)?o.join(``):``,d()):t&&(f.src=t,x.set(t,p)),(0,v.setAttributesFromProps)(f,e),s===`worker`&&f.setAttribute(`type`,`text/partytown`),f.setAttribute(`data-nscript`,s),l&&C(l),document.body.appendChild(f)};function T(e){let{strategy:t=`afterInteractive`}=e;t===`lazyOnload`?window.addEventListener(`load`,()=>{(0,y.requestIdleCallback)(()=>w(e))}):w(e)}function E(e){document.readyState===`complete`?(0,y.requestIdleCallback)(()=>w(e)):window.addEventListener(`load`,()=>{(0,y.requestIdleCallback)(()=>w(e))})}function D(){[...document.querySelectorAll(`[data-nscript="beforeInteractive"]`),...document.querySelectorAll(`[data-nscript="beforePageRender"]`)].forEach(e=>{let t=e.id||e.getAttribute(`src`);S.add(t)})}function O(e){e.forEach(T),D()}function k(e){let{id:t,src:n=``,onLoad:r=()=>{},onReady:i=null,strategy:a=`afterInteractive`,onError:o,stylesheets:s,...c}=e,{updateScripts:l,scripts:u,getIsSsr:d,appDir:f,nonce:p}=(0,g.useContext)(_.HeadManagerContext);p=c.nonce||p;let v=(0,g.useRef)(!1);(0,g.useEffect)(()=>{let e=t||n;v.current||=(i&&e&&S.has(e)&&i(),!0)},[i,t,n]);let y=(0,g.useRef)(!1);if((0,g.useEffect)(()=>{y.current||=(a===`afterInteractive`?w(e):a===`lazyOnload`&&E(e),!0)},[e,a]),(a===`beforeInteractive`||a===`worker`)&&(l?(u[a]=(u[a]||[]).concat([{id:t,src:n,onLoad:r,onReady:i,onError:o,...c,nonce:p}]),l(u)):d&&d()?S.add(t||n):d&&!d()&&w({...e,nonce:p})),f){if(s&&s.forEach(e=>{h.default.preinit(e,{as:`style`})}),a===`beforeInteractive`)return n?(h.default.preload(n,c.integrity?{as:`script`,integrity:c.integrity,nonce:p,crossOrigin:c.crossOrigin}:{as:`script`,nonce:p,crossOrigin:c.crossOrigin}),(0,m.jsx)(`script`,{nonce:p,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,b.htmlEscapeJsonString)(JSON.stringify([n,{...c,id:t}]))})`}})):(c.dangerouslySetInnerHTML&&(c.children=c.dangerouslySetInnerHTML.__html,delete c.dangerouslySetInnerHTML),(0,m.jsx)(`script`,{nonce:p,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,b.htmlEscapeJsonString)(JSON.stringify([0,{...c,id:t}]))})`}}));a===`afterInteractive`&&n&&h.default.preload(n,c.integrity?{as:`script`,integrity:c.integrity,nonce:p,crossOrigin:c.crossOrigin}:{as:`script`,nonce:p,crossOrigin:c.crossOrigin})}return null}Object.defineProperty(k,"__nextScript",{value:!0});var A=k;(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),h=t(((e,t)=>{t.exports=m()})),g=e(a(),1),_=r(),v=e(h(),1),y=[`light`,`dark`],b=`(prefers-color-scheme: dark)`,x=(e,t)=>{if(typeof window>`u`)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},S=e=>(e||=window.matchMedia(b),e.matches?`dark`:`light`),C=(0,g.createContext)({toggle:()=>{},set:e=>{},themes:[]});(0,g.memo)(({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a=`theme`,themes:s=y,defaultTheme:c=n?`system`:`light`,attribute:l=`class`,skipNextHead:u,onChangeTheme:d,value:f={dark:`t_dark`,light:`t_light`},children:p})=>{let[m,h]=(0,g.useState)(()=>x(a,c)),[v,T]=(0,g.useState)(()=>x(a)),E=f?Object.values(f):s,D=i(n=>{let r=S(n),i=()=>T(r);t?i():g.startTransition(()=>i()),m===`system`&&!e&&O(r,!1)}),O=i((e,t=!0,r=!0)=>{let i=f?.[e]||e;if(t)try{localStorage.setItem(a,e)}catch{}if(e===`system`&&n){let e=S();i=f?.[e]||e}if(d?.(i.replace(`t_`,``)),r){let e=document.documentElement;l===`class`?(e.classList.remove(...E),e.classList.add(i)):e.setAttribute(l,i)}});o(()=>{let e=window.matchMedia(b);return e.addListener(D),D(e),()=>{e.removeListener(D)}},[]);let k=i(t=>{e||(O(t),h(t))});(0,g.useEffect)(()=>{let e=e=>{if(e.key!==a)return;let t=e.newValue||c;k(t)};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[c,k,a]),o(()=>{if(!r)return;let t=e&&y.includes(e)?e:m&&y.includes(m)?m:m===`system`&&v||null;(typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)!==(t||`light`)&&document.documentElement.style.setProperty(`color-scheme`,t)},[r,m,v,e]);let A=i(()=>{let e=v===`dark`?[`system`,`light`,`dark`]:[`system`,`dark`,`light`],t=e[(e.indexOf(m)+1)%e.length];k(t)}),j=n?v:void 0,M=(0,g.useMemo)(()=>({theme:m,current:m,set:k,toggle:A,forcedTheme:e,resolvedTheme:m===`system`?v:m,themes:n?[...s,`system`]:s,systemTheme:j}),[m,k,A,e,v,n,s,j]);return(0,_.jsxs)(C.Provider,{value:M,children:[(0,_.jsx)(w,{forcedTheme:e,storageKey:a,systemTheme:v,attribute:l,value:f,enableSystem:n,defaultTheme:c,attrs:E,skipNextHead:u}),p]})});var w=(0,g.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,defaultTheme:i,value:a,attrs:o,skipNextHead:s})=>{let c=n===`class`?`var d=document.documentElement.classList;${o.map(e=>`d.remove('${e}')`).join(`;`)};`:`var d=document.documentElement;`,l=(e,t)=>{e=a?.[e]||e;let r=t?e:`'${e}'`;return n===`class`?`d.add(${r})`:`d.setAttribute('${n}', ${r})`},u=i===`system`,d=e?`!function(){${c}${l(e)}}()`:r?`!function(){try {${c}var e=localStorage.getItem('${t}');if("system"===e||(!e&&${u})){var t="${b}",m=window.matchMedia(t);m.media!==t||m.matches?${l(`dark`)}:${l(`light`)}}else if(e){${a?`var x=${JSON.stringify(a)};`:``}${l(a?`x[e]`:`e`,!0)}}${u?``:`else{${l(i)}}`}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem("${t}");if(e){${a?`var x=${JSON.stringify(a)};`:``}${l(a?`x[e]`:`e`,!0)}}else{${l(i)};}}catch(t){}}();`;return s?(0,_.jsx)(`script`,{dangerouslySetInnerHTML:{__html:d}},`next-themes-script`):(0,_.jsx)(v.default,{id:`next-themes-script`,strategy:`beforeInteractive`,dangerouslySetInnerHTML:{__html:d}})},(e,t)=>e.forcedTheme===t.forcedTheme),T=()=>(0,g.useContext)(C);function E({size:e,label:t}){let{current:n,resolvedTheme:r,set:i}=T();return(0,_.jsx)(s,{theme:(r??n??`dark`)===`light`?`light`:`dark`,onToggle:e=>i(e),size:e,label:t})}export{E as ThemeToggleNext,E as default};
|
|
2
|
-
//# sourceMappingURL=ThemeToggleNext-
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{Dt as n,Et as r,J as i,Ot as a,St as o}from"./react-DIaL9_ob.js";import{N as s}from"./index-B5JD-zDn.js";var c=t((e=>{function t(e){return e&&e.__esModule?e:{default:e}}e._=t})),l=t((e=>{function t(e){if(typeof WeakMap!=`function`)return null;var n=new WeakMap,r=new WeakMap;return(t=function(e){return e?r:n})(e)}function n(e,n){if(!n&&e&&e.__esModule)return e;if(e===null||typeof e!=`object`&&typeof e!=`function`)return{default:e};var r=t(n);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}e._=n})),u=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HeadManagerContext",{enumerable:!0,get:function(){return t}});var t=c()._(a()).default.createContext({})})),d=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"setAttributesFromProps",{enumerable:!0,get:function(){return a}});var n={acceptCharset:`accept-charset`,className:`class`,htmlFor:`for`,httpEquiv:`http-equiv`,noModule:`noModule`},r=[`onLoad`,`onReady`,`dangerouslySetInnerHTML`,`children`,`onError`,`strategy`,`stylesheets`];function i(e){return[`async`,`defer`,`noModule`].includes(e)}function a(e,t){for(let[a,o]of Object.entries(t)){if(!t.hasOwnProperty(a)||r.includes(a)||o===void 0)continue;let s=n[a]||a.toLowerCase();e.tagName===`SCRIPT`&&i(s)?e[s]=!!o:e.setAttribute(s,String(o)),(o===!1||e.tagName===`SCRIPT`&&i(s)&&(!o||o===`false`))&&(e.setAttribute(s,``),e.removeAttribute(s))}}(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),f=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={cancelIdleCallback:null,requestIdleCallback:null});function n(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}n(e,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});var r=typeof self<`u`&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},i=typeof self<`u`&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),p=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={ESCAPE_REGEX:null,htmlEscapeAttributeString:null,htmlEscapeJsonString:null});function n(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}n(e,{ESCAPE_REGEX:function(){return i},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return s}});var r={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},i=/[&><\u2028\u2029]/g,a={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`},o=/[&"'<>]/g;function s(e){return e.replace(i,e=>r[e])}function c(e){return e.replace(o,e=>a[e])}})),m=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),0&&(t.exports={default:null,handleClientScriptLoad:null,initScriptLoader:null});function i(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}i(e,{default:function(){return A},handleClientScriptLoad:function(){return T},initScriptLoader:function(){return O}});var o=c(),s=l(),m=r(),h=o._(n()),g=s._(a()),_=u(),v=d(),y=f(),b=p(),x=new Map,S=new Set,C=e=>{if(h.default.preinit){e.forEach(e=>{h.default.preinit(e,{as:`style`})});return}if(typeof window<`u`){let t=document.head;e.forEach(e=>{let n=document.createElement(`link`);n.type=`text/css`,n.rel=`stylesheet`,n.href=e,t.appendChild(n)})}},w=e=>{let{src:t,id:n,onLoad:r=()=>{},onReady:i=null,dangerouslySetInnerHTML:a,children:o=``,strategy:s=`afterInteractive`,onError:c,stylesheets:l}=e,u=n||t;if(u&&S.has(u))return;if(x.has(t)){S.add(u),x.get(t).then(r,c);return}let d=()=>{i&&i(),S.add(u)},f=document.createElement(`script`),p=new Promise((e,t)=>{f.addEventListener(`load`,function(t){e(),r&&r.call(this,t),d()}),f.addEventListener(`error`,function(e){t(e)})}).catch(function(e){c&&c(e)});a?(f.innerHTML=a.__html||``,d()):o?(f.textContent=typeof o==`string`?o:Array.isArray(o)?o.join(``):``,d()):t&&(f.src=t,x.set(t,p)),(0,v.setAttributesFromProps)(f,e),s===`worker`&&f.setAttribute(`type`,`text/partytown`),f.setAttribute(`data-nscript`,s),l&&C(l),document.body.appendChild(f)};function T(e){let{strategy:t=`afterInteractive`}=e;t===`lazyOnload`?window.addEventListener(`load`,()=>{(0,y.requestIdleCallback)(()=>w(e))}):w(e)}function E(e){document.readyState===`complete`?(0,y.requestIdleCallback)(()=>w(e)):window.addEventListener(`load`,()=>{(0,y.requestIdleCallback)(()=>w(e))})}function D(){[...document.querySelectorAll(`[data-nscript="beforeInteractive"]`),...document.querySelectorAll(`[data-nscript="beforePageRender"]`)].forEach(e=>{let t=e.id||e.getAttribute(`src`);S.add(t)})}function O(e){e.forEach(T),D()}function k(e){let{id:t,src:n=``,onLoad:r=()=>{},onReady:i=null,strategy:a=`afterInteractive`,onError:o,stylesheets:s,...c}=e,{updateScripts:l,scripts:u,getIsSsr:d,appDir:f,nonce:p}=(0,g.useContext)(_.HeadManagerContext);p=c.nonce||p;let v=(0,g.useRef)(!1);(0,g.useEffect)(()=>{let e=t||n;v.current||=(i&&e&&S.has(e)&&i(),!0)},[i,t,n]);let y=(0,g.useRef)(!1);if((0,g.useEffect)(()=>{y.current||=(a===`afterInteractive`?w(e):a===`lazyOnload`&&E(e),!0)},[e,a]),(a===`beforeInteractive`||a===`worker`)&&(l?(u[a]=(u[a]||[]).concat([{id:t,src:n,onLoad:r,onReady:i,onError:o,...c,nonce:p}]),l(u)):d&&d()?S.add(t||n):d&&!d()&&w({...e,nonce:p})),f){if(s&&s.forEach(e=>{h.default.preinit(e,{as:`style`})}),a===`beforeInteractive`)return n?(h.default.preload(n,c.integrity?{as:`script`,integrity:c.integrity,nonce:p,crossOrigin:c.crossOrigin}:{as:`script`,nonce:p,crossOrigin:c.crossOrigin}),(0,m.jsx)(`script`,{nonce:p,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,b.htmlEscapeJsonString)(JSON.stringify([n,{...c,id:t}]))})`}})):(c.dangerouslySetInnerHTML&&(c.children=c.dangerouslySetInnerHTML.__html,delete c.dangerouslySetInnerHTML),(0,m.jsx)(`script`,{nonce:p,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,b.htmlEscapeJsonString)(JSON.stringify([0,{...c,id:t}]))})`}}));a===`afterInteractive`&&n&&h.default.preload(n,c.integrity?{as:`script`,integrity:c.integrity,nonce:p,crossOrigin:c.crossOrigin}:{as:`script`,nonce:p,crossOrigin:c.crossOrigin})}return null}Object.defineProperty(k,"__nextScript",{value:!0});var A=k;(typeof e.default==`function`||typeof e.default==`object`&&e.default!==null)&&e.default.__esModule===void 0&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})),h=t(((e,t)=>{t.exports=m()})),g=e(a(),1),_=r(),v=e(h(),1),y=[`light`,`dark`],b=`(prefers-color-scheme: dark)`,x=(e,t)=>{if(typeof window>`u`)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},S=e=>(e||=window.matchMedia(b),e.matches?`dark`:`light`),C=(0,g.createContext)({toggle:()=>{},set:e=>{},themes:[]});(0,g.memo)(({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a=`theme`,themes:s=y,defaultTheme:c=n?`system`:`light`,attribute:l=`class`,skipNextHead:u,onChangeTheme:d,value:f={dark:`t_dark`,light:`t_light`},children:p})=>{let[m,h]=(0,g.useState)(()=>x(a,c)),[v,T]=(0,g.useState)(()=>x(a)),E=f?Object.values(f):s,D=i(n=>{let r=S(n),i=()=>T(r);t?i():g.startTransition(()=>i()),m===`system`&&!e&&O(r,!1)}),O=i((e,t=!0,r=!0)=>{let i=f?.[e]||e;if(t)try{localStorage.setItem(a,e)}catch{}if(e===`system`&&n){let e=S();i=f?.[e]||e}if(d?.(i.replace(`t_`,``)),r){let e=document.documentElement;l===`class`?(e.classList.remove(...E),e.classList.add(i)):e.setAttribute(l,i)}});o(()=>{let e=window.matchMedia(b);return e.addListener(D),D(e),()=>{e.removeListener(D)}},[]);let k=i(t=>{e||(O(t),h(t))});(0,g.useEffect)(()=>{let e=e=>{if(e.key!==a)return;let t=e.newValue||c;k(t)};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[c,k,a]),o(()=>{if(!r)return;let t=e&&y.includes(e)?e:m&&y.includes(m)?m:m===`system`&&v||null;(typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)!==(t||`light`)&&document.documentElement.style.setProperty(`color-scheme`,t)},[r,m,v,e]);let A=i(()=>{let e=v===`dark`?[`system`,`light`,`dark`]:[`system`,`dark`,`light`],t=e[(e.indexOf(m)+1)%e.length];k(t)}),j=n?v:void 0,M=(0,g.useMemo)(()=>({theme:m,current:m,set:k,toggle:A,forcedTheme:e,resolvedTheme:m===`system`?v:m,themes:n?[...s,`system`]:s,systemTheme:j}),[m,k,A,e,v,n,s,j]);return(0,_.jsxs)(C.Provider,{value:M,children:[(0,_.jsx)(w,{forcedTheme:e,storageKey:a,systemTheme:v,attribute:l,value:f,enableSystem:n,defaultTheme:c,attrs:E,skipNextHead:u}),p]})});var w=(0,g.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,defaultTheme:i,value:a,attrs:o,skipNextHead:s})=>{let c=n===`class`?`var d=document.documentElement.classList;${o.map(e=>`d.remove('${e}')`).join(`;`)};`:`var d=document.documentElement;`,l=(e,t)=>{e=a?.[e]||e;let r=t?e:`'${e}'`;return n===`class`?`d.add(${r})`:`d.setAttribute('${n}', ${r})`},u=i===`system`,d=e?`!function(){${c}${l(e)}}()`:r?`!function(){try {${c}var e=localStorage.getItem('${t}');if("system"===e||(!e&&${u})){var t="${b}",m=window.matchMedia(t);m.media!==t||m.matches?${l(`dark`)}:${l(`light`)}}else if(e){${a?`var x=${JSON.stringify(a)};`:``}${l(a?`x[e]`:`e`,!0)}}${u?``:`else{${l(i)}}`}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem("${t}");if(e){${a?`var x=${JSON.stringify(a)};`:``}${l(a?`x[e]`:`e`,!0)}}else{${l(i)};}}catch(t){}}();`;return s?(0,_.jsx)(`script`,{dangerouslySetInnerHTML:{__html:d}},`next-themes-script`):(0,_.jsx)(v.default,{id:`next-themes-script`,strategy:`beforeInteractive`,dangerouslySetInnerHTML:{__html:d}})},(e,t)=>e.forcedTheme===t.forcedTheme),T=()=>(0,g.useContext)(C);function E({size:e,label:t}){let{current:n,resolvedTheme:r,set:i}=T();return(0,_.jsx)(s,{theme:(r??n??`dark`)===`light`?`light`:`dark`,onToggle:e=>i(e),size:e,label:t})}export{E as ThemeToggleNext,E as default};
|
|
2
|
+
//# sourceMappingURL=ThemeToggleNext-1QCLnhiZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggleNext-GGp7XI4T.js","names":["createContext","memo","useState","useMemo","_jsxs","_jsx","Script","useContext","_jsx"],"sources":["../../node_modules/.pnpm/@swc+helpers@0.5.23/node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../node_modules/.pnpm/@swc+helpers@0.5.23/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/set-attributes-from-props.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/request-idle-callback.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/shared/lib/htmlescape.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/script.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/script.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/constants.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/helpers.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/ThemeSettingContext.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/NextThemeProvider.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/useTheme.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/product/ThemeToggleNext.js"],"sourcesContent":["\"use strict\";\n\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexports._ = _interop_require_default;\n","\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"HeadManagerContext\", {\n enumerable: true,\n get: function() {\n return HeadManagerContext;\n }\n});\nconst _interop_require_default = require(\"@swc/helpers/_/_interop_require_default\");\nconst _react = /*#__PURE__*/ _interop_require_default._(require(\"react\"));\nconst HeadManagerContext = _react.default.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext';\n}\n\n//# sourceMappingURL=head-manager-context.shared-runtime.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"setAttributesFromProps\", {\n enumerable: true,\n get: function() {\n return setAttributesFromProps;\n }\n});\nconst DOMAttributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule'\n};\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets'\n];\nfunction isBooleanScriptAttribute(attr) {\n return [\n 'async',\n 'defer',\n 'noModule'\n ].includes(attr);\n}\nfunction setAttributesFromProps(el, props) {\n for (const [p, value] of Object.entries(props)){\n if (!props.hasOwnProperty(p)) continue;\n if (ignoreProps.includes(p)) continue;\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue;\n }\n const attr = DOMAttributeNames[p] || p.toLowerCase();\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;\n el[attr] = !!value;\n } else {\n el.setAttribute(attr, String(value));\n }\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (value === false || el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr) && (!value || value === 'false')) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '');\n el.removeAttribute(attr);\n }\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=set-attributes-from-props.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n cancelIdleCallback: null,\n requestIdleCallback: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n cancelIdleCallback: function() {\n return cancelIdleCallback;\n },\n requestIdleCallback: function() {\n return requestIdleCallback;\n }\n});\nconst requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n let start = Date.now();\n return self.setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nconst cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=request-idle-callback.js.map","// This utility is based on https://github.com/zertosh/htmlescape\n// License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d256101bb310a9f970f63078ad/LICENSE\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n ESCAPE_REGEX: null,\n htmlEscapeAttributeString: null,\n htmlEscapeJsonString: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ESCAPE_REGEX: function() {\n return ESCAPE_REGEX;\n },\n htmlEscapeAttributeString: function() {\n return htmlEscapeAttributeString;\n },\n htmlEscapeJsonString: function() {\n return htmlEscapeJsonString;\n }\n});\nconst ESCAPE_LOOKUP = {\n '&': '\\\\u0026',\n '>': '\\\\u003e',\n '<': '\\\\u003c',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029'\n};\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\nconst ATTRIBUTE_ESCAPE_LOOKUP = {\n '&': '&',\n '\"': '"',\n \"'\": ''',\n '<': '<',\n '>': '>'\n};\nconst ATTRIBUTE_ESCAPE_REGEX = /[&\"'<>]/g;\nfunction htmlEscapeJsonString(str) {\n return str.replace(ESCAPE_REGEX, (match)=>ESCAPE_LOOKUP[match]);\n}\nfunction htmlEscapeAttributeString(str) {\n return str.replace(ATTRIBUTE_ESCAPE_REGEX, (match)=>ATTRIBUTE_ESCAPE_LOOKUP[match]);\n}\n\n//# sourceMappingURL=htmlescape.js.map","'use client';\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n handleClientScriptLoad: null,\n initScriptLoader: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n default: function() {\n return _default;\n },\n handleClientScriptLoad: function() {\n return handleClientScriptLoad;\n },\n initScriptLoader: function() {\n return initScriptLoader;\n }\n});\nconst _interop_require_default = require(\"@swc/helpers/_/_interop_require_default\");\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _reactdom = /*#__PURE__*/ _interop_require_default._(require(\"react-dom\"));\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _headmanagercontextsharedruntime = require(\"../shared/lib/head-manager-context.shared-runtime\");\nconst _setattributesfromprops = require(\"./set-attributes-from-props\");\nconst _requestidlecallback = require(\"./request-idle-callback\");\nconst _htmlescape = require(\"../shared/lib/htmlescape\");\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst insertStylesheets = (stylesheets)=>{\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (_reactdom.default.preinit) {\n stylesheets.forEach((stylesheet)=>{\n _reactdom.default.preinit(stylesheet, {\n as: 'style'\n });\n });\n return;\n }\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (typeof window !== 'undefined') {\n let head = document.head;\n stylesheets.forEach((stylesheet)=>{\n let link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = stylesheet;\n head.appendChild(link);\n });\n }\n};\nconst loadScript = (props)=>{\n const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n (0, _setattributesfromprops.setAttributesFromProps)(el, props);\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets);\n }\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy = 'afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n } else {\n loadScript(props);\n }\n}\nfunction loadLazyScript(props) {\n if (document.readyState === 'complete') {\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n } else {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n }\n}\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]')\n ];\n scripts.forEach((script)=>{\n const cacheKey = script.id || script.getAttribute('src');\n LoadCache.add(cacheKey);\n });\n}\nfunction initScriptLoader(scriptLoaderItems) {\n scriptLoaderItems.forEach(handleClientScriptLoad);\n addBeforeInteractiveToCache();\n}\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */ function Script(props) {\n const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props;\n // Context is available only during SSR\n let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);\n // if a nonce is explicitly passed to the script tag, favor that over the automatic handling\n nonce = restProps.nonce || nonce;\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */ const hasOnReadyEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n const cacheKey = id || src;\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady();\n }\n hasOnReadyEffectCalled.current = true;\n }\n }, [\n onReady,\n id,\n src\n ]);\n const hasLoadScriptEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props);\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props);\n }\n hasLoadScriptEffectCalled.current = true;\n }\n }, [\n props,\n strategy\n ]);\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps,\n nonce\n }\n ]);\n updateScripts(scripts);\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src);\n } else if (getIsSsr && !getIsSsr()) {\n loadScript({\n ...props,\n nonce\n });\n }\n }\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc)=>{\n _reactdom.default.preinit(styleSrc, {\n as: 'style'\n });\n });\n }\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native <script> tags, because they no longer have `defer`.\n if (strategy === 'beforeInteractive') {\n if (!src) {\n // For inlined scripts, we put the content in `children`.\n if (restProps.dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n restProps.children = restProps.dangerouslySetInnerHTML.__html;\n delete restProps.dangerouslySetInnerHTML;\n }\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: `(self.__next_s=self.__next_s||[]).push(${(0, _htmlescape.htmlEscapeJsonString)(JSON.stringify([\n 0,\n {\n ...restProps,\n id\n }\n ]))})`\n }\n });\n } else {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: `(self.__next_s=self.__next_s||[]).push(${(0, _htmlescape.htmlEscapeJsonString)(JSON.stringify([\n src,\n {\n ...restProps,\n id\n }\n ]))})`\n }\n });\n }\n } else if (strategy === 'afterInteractive') {\n if (src) {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n }\n }\n }\n return null;\n}\nObject.defineProperty(Script, '__nextScript', {\n value: true\n});\nconst _default = Script;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=script.js.map","module.exports = require('./dist/client/script')\n","export const constants = {};\nexport const colorSchemes = ['light', 'dark'];\nexport const MEDIA = '(prefers-color-scheme: dark)';\n//# sourceMappingURL=constants.js.map","import { MEDIA } from './constants.js';\nexport const helpers = {};\n// Helpers\nexport const getTheme = (key, fallback) => {\n if (typeof window === 'undefined')\n return undefined;\n let theme;\n try {\n theme = localStorage.getItem(key) || undefined;\n }\n catch (e) {\n // Unsupported\n }\n return theme || fallback;\n};\nexport const getSystemTheme = (e) => {\n if (!e) {\n e = window.matchMedia(MEDIA);\n }\n const isDark = e.matches;\n const systemTheme = isDark ? 'dark' : 'light';\n return systemTheme;\n};\n//# sourceMappingURL=helpers.js.map","import { createContext } from 'react';\nexport const ThemeSettingContext = createContext({\n toggle: () => { },\n set: (_) => { },\n themes: [],\n});\n//# sourceMappingURL=ThemeSettingContext.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from '@hanzogui/constants';\nimport { useEvent } from '@hanzogui/use-event';\nimport Script from 'next/script';\nimport * as React from 'react';\nimport { memo, useEffect, useMemo, useState } from 'react';\nimport { MEDIA, colorSchemes } from './constants.js';\nimport { getSystemTheme, getTheme } from './helpers.js';\nimport { ThemeSettingContext } from './ThemeSettingContext.js';\nexport const NextThemeProvider = memo(({ forcedTheme, disableTransitionOnChange = false, enableSystem = true, enableColorScheme = true, storageKey = 'theme', themes = colorSchemes, defaultTheme = enableSystem ? 'system' : 'light', attribute = 'class', skipNextHead, onChangeTheme, value = {\n dark: 't_dark',\n light: 't_light',\n}, children, }) => {\n const [theme, setThemeState] = useState(() => getTheme(storageKey, defaultTheme));\n const [resolvedTheme, setResolvedTheme] = useState(() => getTheme(storageKey));\n const attrs = !value ? themes : Object.values(value);\n const handleMediaQuery = useEvent((e) => {\n const _ = getSystemTheme(e);\n const update = () => setResolvedTheme(_);\n if (disableTransitionOnChange) {\n update();\n }\n else {\n React.startTransition(() => update());\n }\n if (theme === 'system' && !forcedTheme) {\n handleChangeTheme(_, false);\n }\n });\n const handleChangeTheme = useEvent((theme, updateStorage = true, updateDOM = true) => {\n let name = value?.[theme] || theme;\n if (updateStorage) {\n try {\n localStorage.setItem(storageKey, theme);\n }\n catch (e) {\n // Unsupported\n }\n }\n if (theme === 'system' && enableSystem) {\n const resolved = getSystemTheme();\n name = value?.[resolved] || resolved;\n }\n onChangeTheme?.(name.replace('t_', ''));\n if (updateDOM) {\n const d = document.documentElement;\n if (attribute === 'class') {\n d.classList.remove(...attrs);\n d.classList.add(name);\n }\n else {\n d.setAttribute(attribute, name);\n }\n }\n });\n useIsomorphicLayoutEffect(() => {\n // Always listen to System preference\n const media = window.matchMedia(MEDIA);\n // Intentionally use deprecated listener methods to support iOS & old browsers\n media.addListener(handleMediaQuery);\n handleMediaQuery(media);\n return () => {\n media.removeListener(handleMediaQuery);\n };\n }, []);\n const set = useEvent((newTheme) => {\n if (forcedTheme) {\n // when forcedTheme is active, block all updates to avoid desync\n return;\n }\n handleChangeTheme(newTheme);\n setThemeState(newTheme);\n });\n // localStorage event handling\n useEffect(() => {\n const handleStorage = (e) => {\n if (e.key !== storageKey) {\n return;\n }\n // If default theme set, use it if localstorage === null (happens on local storage manual deletion)\n const theme = e.newValue || defaultTheme;\n set(theme);\n };\n window.addEventListener('storage', handleStorage);\n return () => {\n window.removeEventListener('storage', handleStorage);\n };\n }, [defaultTheme, set, storageKey]);\n // color-scheme handling\n useIsomorphicLayoutEffect(() => {\n if (!enableColorScheme)\n return;\n const colorScheme = \n // If theme is forced to light or dark, use that\n forcedTheme && colorSchemes.includes(forcedTheme)\n ? forcedTheme\n : // If regular theme is light or dark\n theme && colorSchemes.includes(theme)\n ? theme\n : // If theme is system, use the resolved version\n theme === 'system'\n ? resolvedTheme || null\n : null;\n // color-scheme tells browser how to render built-in elements like forms, scrollbars, etc.\n // if color-scheme is null, this will remove the property\n const userPrefers = typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n const wePrefer = colorScheme || 'light';\n // avoid running this because it causes full page reflow\n if (userPrefers !== wePrefer) {\n document.documentElement.style.setProperty('color-scheme', colorScheme);\n }\n }, [enableColorScheme, theme, resolvedTheme, forcedTheme]);\n const toggle = useEvent(() => {\n const order = resolvedTheme === 'dark'\n ? ['system', 'light', 'dark']\n : ['system', 'dark', 'light'];\n const next = order[(order.indexOf(theme) + 1) % order.length];\n set(next);\n });\n const systemTheme = (enableSystem ? resolvedTheme : undefined);\n const contextValue = useMemo(() => {\n const value = {\n theme,\n current: theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme: theme === 'system' ? resolvedTheme : theme,\n themes: enableSystem ? [...themes, 'system'] : themes,\n systemTheme,\n };\n return value;\n }, [\n theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme,\n enableSystem,\n themes,\n systemTheme,\n ]);\n return (_jsxs(ThemeSettingContext.Provider, { value: contextValue, children: [_jsx(ThemeScript, { forcedTheme,\n storageKey,\n systemTheme: resolvedTheme,\n attribute,\n value,\n enableSystem,\n defaultTheme,\n attrs,\n skipNextHead }), children] }));\n});\nconst ThemeScript = memo(({ forcedTheme, storageKey, attribute, enableSystem, defaultTheme, value, attrs, skipNextHead, }) => {\n // Code-golfing the amount of characters in the script\n const optimization = (() => {\n if (attribute === 'class') {\n const removeClasses = attrs.map((t) => `d.remove('${t}')`).join(';');\n return `var d=document.documentElement.classList;${removeClasses};`;\n }\n return `var d=document.documentElement;`;\n })();\n const updateDOM = (name, literal) => {\n name = value?.[name] || name;\n const val = literal ? name : `'${name}'`;\n if (attribute === 'class') {\n return `d.add(${val})`;\n }\n return `d.setAttribute('${attribute}', ${val})`;\n };\n const defaultSystem = defaultTheme === 'system';\n const scriptContent = forcedTheme\n ? `!function(){${optimization}${updateDOM(forcedTheme)}}()`\n : enableSystem\n ? `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');if(\"system\"===e||(!e&&${defaultSystem})){var t=\"${MEDIA}\",m=window.matchMedia(t);m.media!==t||m.matches?${updateDOM('dark')}:${updateDOM('light')}}else if(e){${value ? `var x=${JSON.stringify(value)};` : ''}${updateDOM(value ? 'x[e]' : 'e', true)}}${!defaultSystem ? `else{${updateDOM(defaultTheme)}}` : ''}}catch(e){}}()`\n : `!function(){try{${optimization}var e=localStorage.getItem(\"${storageKey}\");if(e){${value ? `var x=${JSON.stringify(value)};` : ''}${updateDOM(value ? 'x[e]' : 'e', true)}}else{${updateDOM(defaultTheme)};}}catch(t){}}();`;\n // skipNextHead returns raw script for useServerInsertedHTML usage\n if (skipNextHead) {\n return (_jsx(\"script\", { dangerouslySetInnerHTML: { __html: scriptContent } }, \"next-themes-script\"));\n }\n return (_jsx(Script, { id: \"next-themes-script\", strategy: \"beforeInteractive\", dangerouslySetInnerHTML: { __html: scriptContent } }));\n}, (prevProps, nextProps) => {\n // Only re-render when forcedTheme changes\n // the rest of the props should be completely stable\n if (prevProps.forcedTheme !== nextProps.forcedTheme)\n return false;\n return true;\n});\n//# sourceMappingURL=NextThemeProvider.js.map","import { useContext } from 'react';\nimport { ThemeSettingContext } from './ThemeSettingContext.js';\n/**\n * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook\n */\nexport const useTheme = () => useContext(ThemeSettingContext);\nexport const useThemeSetting = () => useContext(ThemeSettingContext);\n//# sourceMappingURL=useTheme.js.map","'use client';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * ThemeToggleNext — the @hanzogui/next-theme binding (console / Next). This is the ONLY\n * module that imports @hanzogui/next-theme, so it stays an OPTIONAL dependency: the base\n * ThemeToggle lazy-loads it (default export) and non-Next hosts never pull it in unless\n * they import this component directly. UI is delegated to the framework-agnostic button\n * in controlled mode, so every toggle looks identical.\n */\nimport { useThemeSetting } from '@hanzogui/next-theme';\nimport { AgnosticThemeToggle } from './ThemeToggle.js';\nfunction ThemeToggleNext({ size, label }) {\n const { current, resolvedTheme, set } = useThemeSetting();\n const isDark = (resolvedTheme ?? current ?? 'dark') !== 'light';\n return (_jsx(AgnosticThemeToggle, { theme: isDark ? 'dark' : 'light', onToggle: (next) => set(next), size: size, label: label }));\n}\nexport default ThemeToggleNext;\nexport { ThemeToggleNext };\n//# sourceMappingURL=ThemeToggleNext.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":"kLAEA,SAAS,EAAyB,EAAK,CACnC,OAAO,GAAO,EAAI,WAAa,EAAM,CAAE,QAAS,CAAI,CACxD,CACA,EAAQ,EAAI,cCHZ,SAAS,EAAyB,EAAa,CAC3C,GAAI,OAAO,SAAY,WAAY,OAAO,KAE1C,IAAI,EAAoB,IAAI,QACxB,EAAmB,IAAI,QAE3B,OAAQ,EAA2B,SAAS,EAAa,CACrD,OAAO,EAAc,EAAmB,CAC5C,EAAA,CAAG,CAAW,CAClB,CACA,SAAS,EAA0B,EAAK,EAAa,CACjD,GAAI,CAAC,GAAe,GAAO,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Q,EAAU,CAAY,EAAE,GAAQ,gBAChY,mBAAmB,EAAa,8BAA8B,EAAW,WAAW,EAAQ,SAAS,KAAK,UAAU,CAAK,EAAE,GAAK,KAAK,EAAU,EAAQ,OAAS,IAAK,EAAI,EAAE,QAAQ,EAAU,CAAY,EAAE,mBAKrN,OAHI,GACA,EAAQI,EAAAA,IAAAA,CAAK,SAAU,CAAE,wBAAyB,CAAE,OAAQ,CAAc,CAAE,EAAG,oBAAoB,GAEvG,EAAQA,EAAAA,IAAAA,CAAKC,EAAAA,QAAQ,CAAE,GAAI,qBAAsB,SAAU,oBAAqB,wBAAyB,CAAE,OAAQ,CAAc,CAAE,CAAC,CACxI,GAAI,EAAW,IAGP,EAAU,cAAgB,EAAU,WAG3C,ECxLY,OAAA,EAAwBC,EAAAA,WAAAA,CAAW,CAAmB,ECKnE,SAAS,EAAgB,CAAE,OAAM,SAAS,CACtC,GAAM,CAAE,UAAS,gBAAe,OAAQ,EAAgB,EAExD,OAAA,EAAQC,EAAAA,IAAAA,CAAK,EAAqB,CAAE,OADpB,GAAiB,GAAW,UAAY,QACK,QAAT,OAAkB,SAAW,GAAS,EAAI,CAAI,EAAS,OAAa,OAAM,CAAC,CACnI"}
|
|
1
|
+
{"version":3,"file":"ThemeToggleNext-1QCLnhiZ.js","names":["createContext","memo","useState","useMemo","_jsxs","_jsx","Script","useContext","_jsx"],"sources":["../../node_modules/.pnpm/@swc+helpers@0.5.23/node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../node_modules/.pnpm/@swc+helpers@0.5.23/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/set-attributes-from-props.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/request-idle-callback.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/shared/lib/htmlescape.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/script.js","../../node_modules/.pnpm/next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+node@26.4.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/script.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/constants.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/helpers.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/ThemeSettingContext.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/NextThemeProvider.js","../../node_modules/.pnpm/@hanzogui+next-theme@8.3.5_next@16.3.4_@babel+core@7.29.7_supports-color@8.1.1__@types+_87c7e759dd65c8c887e02d85d3ec3280/node_modules/@hanzogui/next-theme/dist/esm/useTheme.js","../../node_modules/.pnpm/@hanzo+ui@8.32.4_b8d39b8c7f735cdf822db78faac56616/node_modules/@hanzo/ui/dist/product/ThemeToggleNext.js"],"sourcesContent":["\"use strict\";\n\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexports._ = _interop_require_default;\n","\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"HeadManagerContext\", {\n enumerable: true,\n get: function() {\n return HeadManagerContext;\n }\n});\nconst _interop_require_default = require(\"@swc/helpers/_/_interop_require_default\");\nconst _react = /*#__PURE__*/ _interop_require_default._(require(\"react\"));\nconst HeadManagerContext = _react.default.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext';\n}\n\n//# sourceMappingURL=head-manager-context.shared-runtime.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"setAttributesFromProps\", {\n enumerable: true,\n get: function() {\n return setAttributesFromProps;\n }\n});\nconst DOMAttributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule'\n};\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets'\n];\nfunction isBooleanScriptAttribute(attr) {\n return [\n 'async',\n 'defer',\n 'noModule'\n ].includes(attr);\n}\nfunction setAttributesFromProps(el, props) {\n for (const [p, value] of Object.entries(props)){\n if (!props.hasOwnProperty(p)) continue;\n if (ignoreProps.includes(p)) continue;\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue;\n }\n const attr = DOMAttributeNames[p] || p.toLowerCase();\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;\n el[attr] = !!value;\n } else {\n el.setAttribute(attr, String(value));\n }\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (value === false || el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr) && (!value || value === 'false')) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '');\n el.removeAttribute(attr);\n }\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=set-attributes-from-props.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n cancelIdleCallback: null,\n requestIdleCallback: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n cancelIdleCallback: function() {\n return cancelIdleCallback;\n },\n requestIdleCallback: function() {\n return requestIdleCallback;\n }\n});\nconst requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n let start = Date.now();\n return self.setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nconst cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=request-idle-callback.js.map","// This utility is based on https://github.com/zertosh/htmlescape\n// License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d256101bb310a9f970f63078ad/LICENSE\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n ESCAPE_REGEX: null,\n htmlEscapeAttributeString: null,\n htmlEscapeJsonString: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ESCAPE_REGEX: function() {\n return ESCAPE_REGEX;\n },\n htmlEscapeAttributeString: function() {\n return htmlEscapeAttributeString;\n },\n htmlEscapeJsonString: function() {\n return htmlEscapeJsonString;\n }\n});\nconst ESCAPE_LOOKUP = {\n '&': '\\\\u0026',\n '>': '\\\\u003e',\n '<': '\\\\u003c',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029'\n};\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\nconst ATTRIBUTE_ESCAPE_LOOKUP = {\n '&': '&',\n '\"': '"',\n \"'\": ''',\n '<': '<',\n '>': '>'\n};\nconst ATTRIBUTE_ESCAPE_REGEX = /[&\"'<>]/g;\nfunction htmlEscapeJsonString(str) {\n return str.replace(ESCAPE_REGEX, (match)=>ESCAPE_LOOKUP[match]);\n}\nfunction htmlEscapeAttributeString(str) {\n return str.replace(ATTRIBUTE_ESCAPE_REGEX, (match)=>ATTRIBUTE_ESCAPE_LOOKUP[match]);\n}\n\n//# sourceMappingURL=htmlescape.js.map","'use client';\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n handleClientScriptLoad: null,\n initScriptLoader: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n default: function() {\n return _default;\n },\n handleClientScriptLoad: function() {\n return handleClientScriptLoad;\n },\n initScriptLoader: function() {\n return initScriptLoader;\n }\n});\nconst _interop_require_default = require(\"@swc/helpers/_/_interop_require_default\");\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _reactdom = /*#__PURE__*/ _interop_require_default._(require(\"react-dom\"));\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _headmanagercontextsharedruntime = require(\"../shared/lib/head-manager-context.shared-runtime\");\nconst _setattributesfromprops = require(\"./set-attributes-from-props\");\nconst _requestidlecallback = require(\"./request-idle-callback\");\nconst _htmlescape = require(\"../shared/lib/htmlescape\");\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst insertStylesheets = (stylesheets)=>{\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (_reactdom.default.preinit) {\n stylesheets.forEach((stylesheet)=>{\n _reactdom.default.preinit(stylesheet, {\n as: 'style'\n });\n });\n return;\n }\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (typeof window !== 'undefined') {\n let head = document.head;\n stylesheets.forEach((stylesheet)=>{\n let link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = stylesheet;\n head.appendChild(link);\n });\n }\n};\nconst loadScript = (props)=>{\n const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n (0, _setattributesfromprops.setAttributesFromProps)(el, props);\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets);\n }\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy = 'afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n } else {\n loadScript(props);\n }\n}\nfunction loadLazyScript(props) {\n if (document.readyState === 'complete') {\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n } else {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n }\n}\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]')\n ];\n scripts.forEach((script)=>{\n const cacheKey = script.id || script.getAttribute('src');\n LoadCache.add(cacheKey);\n });\n}\nfunction initScriptLoader(scriptLoaderItems) {\n scriptLoaderItems.forEach(handleClientScriptLoad);\n addBeforeInteractiveToCache();\n}\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */ function Script(props) {\n const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props;\n // Context is available only during SSR\n let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);\n // if a nonce is explicitly passed to the script tag, favor that over the automatic handling\n nonce = restProps.nonce || nonce;\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */ const hasOnReadyEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n const cacheKey = id || src;\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady();\n }\n hasOnReadyEffectCalled.current = true;\n }\n }, [\n onReady,\n id,\n src\n ]);\n const hasLoadScriptEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props);\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props);\n }\n hasLoadScriptEffectCalled.current = true;\n }\n }, [\n props,\n strategy\n ]);\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps,\n nonce\n }\n ]);\n updateScripts(scripts);\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src);\n } else if (getIsSsr && !getIsSsr()) {\n loadScript({\n ...props,\n nonce\n });\n }\n }\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc)=>{\n _reactdom.default.preinit(styleSrc, {\n as: 'style'\n });\n });\n }\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native <script> tags, because they no longer have `defer`.\n if (strategy === 'beforeInteractive') {\n if (!src) {\n // For inlined scripts, we put the content in `children`.\n if (restProps.dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n restProps.children = restProps.dangerouslySetInnerHTML.__html;\n delete restProps.dangerouslySetInnerHTML;\n }\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: `(self.__next_s=self.__next_s||[]).push(${(0, _htmlescape.htmlEscapeJsonString)(JSON.stringify([\n 0,\n {\n ...restProps,\n id\n }\n ]))})`\n }\n });\n } else {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: `(self.__next_s=self.__next_s||[]).push(${(0, _htmlescape.htmlEscapeJsonString)(JSON.stringify([\n src,\n {\n ...restProps,\n id\n }\n ]))})`\n }\n });\n }\n } else if (strategy === 'afterInteractive') {\n if (src) {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n }\n }\n }\n return null;\n}\nObject.defineProperty(Script, '__nextScript', {\n value: true\n});\nconst _default = Script;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=script.js.map","module.exports = require('./dist/client/script')\n","export const constants = {};\nexport const colorSchemes = ['light', 'dark'];\nexport const MEDIA = '(prefers-color-scheme: dark)';\n//# sourceMappingURL=constants.js.map","import { MEDIA } from './constants.js';\nexport const helpers = {};\n// Helpers\nexport const getTheme = (key, fallback) => {\n if (typeof window === 'undefined')\n return undefined;\n let theme;\n try {\n theme = localStorage.getItem(key) || undefined;\n }\n catch (e) {\n // Unsupported\n }\n return theme || fallback;\n};\nexport const getSystemTheme = (e) => {\n if (!e) {\n e = window.matchMedia(MEDIA);\n }\n const isDark = e.matches;\n const systemTheme = isDark ? 'dark' : 'light';\n return systemTheme;\n};\n//# sourceMappingURL=helpers.js.map","import { createContext } from 'react';\nexport const ThemeSettingContext = createContext({\n toggle: () => { },\n set: (_) => { },\n themes: [],\n});\n//# sourceMappingURL=ThemeSettingContext.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from '@hanzogui/constants';\nimport { useEvent } from '@hanzogui/use-event';\nimport Script from 'next/script';\nimport * as React from 'react';\nimport { memo, useEffect, useMemo, useState } from 'react';\nimport { MEDIA, colorSchemes } from './constants.js';\nimport { getSystemTheme, getTheme } from './helpers.js';\nimport { ThemeSettingContext } from './ThemeSettingContext.js';\nexport const NextThemeProvider = memo(({ forcedTheme, disableTransitionOnChange = false, enableSystem = true, enableColorScheme = true, storageKey = 'theme', themes = colorSchemes, defaultTheme = enableSystem ? 'system' : 'light', attribute = 'class', skipNextHead, onChangeTheme, value = {\n dark: 't_dark',\n light: 't_light',\n}, children, }) => {\n const [theme, setThemeState] = useState(() => getTheme(storageKey, defaultTheme));\n const [resolvedTheme, setResolvedTheme] = useState(() => getTheme(storageKey));\n const attrs = !value ? themes : Object.values(value);\n const handleMediaQuery = useEvent((e) => {\n const _ = getSystemTheme(e);\n const update = () => setResolvedTheme(_);\n if (disableTransitionOnChange) {\n update();\n }\n else {\n React.startTransition(() => update());\n }\n if (theme === 'system' && !forcedTheme) {\n handleChangeTheme(_, false);\n }\n });\n const handleChangeTheme = useEvent((theme, updateStorage = true, updateDOM = true) => {\n let name = value?.[theme] || theme;\n if (updateStorage) {\n try {\n localStorage.setItem(storageKey, theme);\n }\n catch (e) {\n // Unsupported\n }\n }\n if (theme === 'system' && enableSystem) {\n const resolved = getSystemTheme();\n name = value?.[resolved] || resolved;\n }\n onChangeTheme?.(name.replace('t_', ''));\n if (updateDOM) {\n const d = document.documentElement;\n if (attribute === 'class') {\n d.classList.remove(...attrs);\n d.classList.add(name);\n }\n else {\n d.setAttribute(attribute, name);\n }\n }\n });\n useIsomorphicLayoutEffect(() => {\n // Always listen to System preference\n const media = window.matchMedia(MEDIA);\n // Intentionally use deprecated listener methods to support iOS & old browsers\n media.addListener(handleMediaQuery);\n handleMediaQuery(media);\n return () => {\n media.removeListener(handleMediaQuery);\n };\n }, []);\n const set = useEvent((newTheme) => {\n if (forcedTheme) {\n // when forcedTheme is active, block all updates to avoid desync\n return;\n }\n handleChangeTheme(newTheme);\n setThemeState(newTheme);\n });\n // localStorage event handling\n useEffect(() => {\n const handleStorage = (e) => {\n if (e.key !== storageKey) {\n return;\n }\n // If default theme set, use it if localstorage === null (happens on local storage manual deletion)\n const theme = e.newValue || defaultTheme;\n set(theme);\n };\n window.addEventListener('storage', handleStorage);\n return () => {\n window.removeEventListener('storage', handleStorage);\n };\n }, [defaultTheme, set, storageKey]);\n // color-scheme handling\n useIsomorphicLayoutEffect(() => {\n if (!enableColorScheme)\n return;\n const colorScheme = \n // If theme is forced to light or dark, use that\n forcedTheme && colorSchemes.includes(forcedTheme)\n ? forcedTheme\n : // If regular theme is light or dark\n theme && colorSchemes.includes(theme)\n ? theme\n : // If theme is system, use the resolved version\n theme === 'system'\n ? resolvedTheme || null\n : null;\n // color-scheme tells browser how to render built-in elements like forms, scrollbars, etc.\n // if color-scheme is null, this will remove the property\n const userPrefers = typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n const wePrefer = colorScheme || 'light';\n // avoid running this because it causes full page reflow\n if (userPrefers !== wePrefer) {\n document.documentElement.style.setProperty('color-scheme', colorScheme);\n }\n }, [enableColorScheme, theme, resolvedTheme, forcedTheme]);\n const toggle = useEvent(() => {\n const order = resolvedTheme === 'dark'\n ? ['system', 'light', 'dark']\n : ['system', 'dark', 'light'];\n const next = order[(order.indexOf(theme) + 1) % order.length];\n set(next);\n });\n const systemTheme = (enableSystem ? resolvedTheme : undefined);\n const contextValue = useMemo(() => {\n const value = {\n theme,\n current: theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme: theme === 'system' ? resolvedTheme : theme,\n themes: enableSystem ? [...themes, 'system'] : themes,\n systemTheme,\n };\n return value;\n }, [\n theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme,\n enableSystem,\n themes,\n systemTheme,\n ]);\n return (_jsxs(ThemeSettingContext.Provider, { value: contextValue, children: [_jsx(ThemeScript, { forcedTheme,\n storageKey,\n systemTheme: resolvedTheme,\n attribute,\n value,\n enableSystem,\n defaultTheme,\n attrs,\n skipNextHead }), children] }));\n});\nconst ThemeScript = memo(({ forcedTheme, storageKey, attribute, enableSystem, defaultTheme, value, attrs, skipNextHead, }) => {\n // Code-golfing the amount of characters in the script\n const optimization = (() => {\n if (attribute === 'class') {\n const removeClasses = attrs.map((t) => `d.remove('${t}')`).join(';');\n return `var d=document.documentElement.classList;${removeClasses};`;\n }\n return `var d=document.documentElement;`;\n })();\n const updateDOM = (name, literal) => {\n name = value?.[name] || name;\n const val = literal ? name : `'${name}'`;\n if (attribute === 'class') {\n return `d.add(${val})`;\n }\n return `d.setAttribute('${attribute}', ${val})`;\n };\n const defaultSystem = defaultTheme === 'system';\n const scriptContent = forcedTheme\n ? `!function(){${optimization}${updateDOM(forcedTheme)}}()`\n : enableSystem\n ? `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');if(\"system\"===e||(!e&&${defaultSystem})){var t=\"${MEDIA}\",m=window.matchMedia(t);m.media!==t||m.matches?${updateDOM('dark')}:${updateDOM('light')}}else if(e){${value ? `var x=${JSON.stringify(value)};` : ''}${updateDOM(value ? 'x[e]' : 'e', true)}}${!defaultSystem ? `else{${updateDOM(defaultTheme)}}` : ''}}catch(e){}}()`\n : `!function(){try{${optimization}var e=localStorage.getItem(\"${storageKey}\");if(e){${value ? `var x=${JSON.stringify(value)};` : ''}${updateDOM(value ? 'x[e]' : 'e', true)}}else{${updateDOM(defaultTheme)};}}catch(t){}}();`;\n // skipNextHead returns raw script for useServerInsertedHTML usage\n if (skipNextHead) {\n return (_jsx(\"script\", { dangerouslySetInnerHTML: { __html: scriptContent } }, \"next-themes-script\"));\n }\n return (_jsx(Script, { id: \"next-themes-script\", strategy: \"beforeInteractive\", dangerouslySetInnerHTML: { __html: scriptContent } }));\n}, (prevProps, nextProps) => {\n // Only re-render when forcedTheme changes\n // the rest of the props should be completely stable\n if (prevProps.forcedTheme !== nextProps.forcedTheme)\n return false;\n return true;\n});\n//# sourceMappingURL=NextThemeProvider.js.map","import { useContext } from 'react';\nimport { ThemeSettingContext } from './ThemeSettingContext.js';\n/**\n * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook\n */\nexport const useTheme = () => useContext(ThemeSettingContext);\nexport const useThemeSetting = () => useContext(ThemeSettingContext);\n//# sourceMappingURL=useTheme.js.map","'use client';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * ThemeToggleNext — the @hanzogui/next-theme binding (console / Next). This is the ONLY\n * module that imports @hanzogui/next-theme, so it stays an OPTIONAL dependency: the base\n * ThemeToggle lazy-loads it (default export) and non-Next hosts never pull it in unless\n * they import this component directly. UI is delegated to the framework-agnostic button\n * in controlled mode, so every toggle looks identical.\n */\nimport { useThemeSetting } from '@hanzogui/next-theme';\nimport { AgnosticThemeToggle } from './ThemeToggle.js';\nfunction ThemeToggleNext({ size, label }) {\n const { current, resolvedTheme, set } = useThemeSetting();\n const isDark = (resolvedTheme ?? current ?? 'dark') !== 'light';\n return (_jsx(AgnosticThemeToggle, { theme: isDark ? 'dark' : 'light', onToggle: (next) => set(next), size: size, label: label }));\n}\nexport default ThemeToggleNext;\nexport { ThemeToggleNext };\n//# sourceMappingURL=ThemeToggleNext.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":"kLAEA,SAAS,EAAyB,EAAK,CACnC,OAAO,GAAO,EAAI,WAAa,EAAM,CAAE,QAAS,CAAI,CACxD,CACA,EAAQ,EAAI,cCHZ,SAAS,EAAyB,EAAa,CAC3C,GAAI,OAAO,SAAY,WAAY,OAAO,KAE1C,IAAI,EAAoB,IAAI,QACxB,EAAmB,IAAI,QAE3B,OAAQ,EAA2B,SAAS,EAAa,CACrD,OAAO,EAAc,EAAmB,CAC5C,EAAA,CAAG,CAAW,CAClB,CACA,SAAS,EAA0B,EAAK,EAAa,CACjD,GAAI,CAAC,GAAe,GAAO,EAAI,WAAY,OAAO,EAClD,GAAI,IAAQ,MAAQ,OAAO,GAAQ,UAAY,OAAO,GAAQ,WAAY,MAAO,CAAE,QAAS,CAAI,EAEhG,I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