@liminalcash/nim-chat 0.1.0 → 0.1.1

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/index.cjs CHANGED
@@ -33,7 +33,7 @@
33
33
  hover:opacity-90 hover:scale-105
34
34
  active:scale-95
35
35
  disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:scale-100
36
- `,"aria-label":"Send message",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),b.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})}function Ir(){return b.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-3 bg-nim-white border border-nim-grey-100 rounded-lg max-w-bubble",children:[b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"})]})}function Er({request:e,onConfirm:n,onCancel:t}){const[r,i]=j.useState(0);j.useEffect(()=>{const s=()=>{const u=Math.max(0,e.expiresAt.getTime()-Date.now());i(u),u<=0&&t(e.actionId)};s();const c=setInterval(s,100);return()=>clearInterval(c)},[e.expiresAt,e.actionId,t]);const l=e.expiresAt.getTime()-Date.now()+r,o=l>0?r/l*100:0,a=Math.ceil(r/1e3);return b.jsxs("div",{className:"bg-nim-white border-2 border-nim-black rounded-lg p-5 shadow-lg",children:[b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-nim-beige rounded-lg flex items-center justify-center",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-nim-black",children:[b.jsx("path",{d:"M12 9v4"}),b.jsx("path",{d:"M12 17h.01"}),b.jsx("path",{d:"M3.6 15.8l4.8-9.6a2 2 0 0 1 3.6 0l4.8 9.6a2 2 0 0 1-1.8 2.8H5.4a2 2 0 0 1-1.8-2.8z"})]})}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h4",{className:"font-display font-medium text-nim-black text-base",children:"Confirm Action"}),b.jsx("p",{className:"text-nim-grey-400 text-xs mt-0.5 font-mono",children:e.tool}),b.jsx("p",{className:"text-nim-black font-body text-sm mt-2",children:e.summary})]}),b.jsxs("div",{className:"flex-shrink-0 relative w-10 h-10",children:[b.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#ddd",strokeWidth:"3"}),b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#231f18",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:100-o,className:"transition-all duration-100"})]}),b.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-nim-black font-mono",children:a})]})]}),b.jsxs("div",{className:"flex gap-3 mt-4",children:[b.jsx("button",{onClick:()=>t(e.actionId),className:"flex-1 h-10 px-4 bg-nim-beige text-nim-black rounded-lg text-sm font-display font-medium hover:bg-nim-grey-100 transition-colors border border-nim-grey-100",children:"Cancel"}),b.jsx("button",{onClick:()=>n(e.actionId),className:"flex-1 h-10 px-4 bg-nim-black text-nim-white rounded-lg text-sm font-display font-medium hover:opacity-90 transition-opacity",children:"Confirm"})]})]})}function Tr({title:e,messages:n,isStreaming:t,connectionState:r,confirmationRequest:i,onSendMessage:l,onConfirm:o,onCancel:a,onClose:s,onLogout:c}){var x;const u=j.useRef(null);j.useEffect(()=>{var v;(v=u.current)==null||v.scrollIntoView({behavior:"smooth"})},[n,t,i]);const p=r==="connecting",d=r==="reconnecting",f=r==="disconnected",g=r==="error";return b.jsxs("div",{className:"nim-panel-enter flex flex-col h-full bg-white rounded-xl shadow-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-5 py-4 bg-white border-b border-nim-cream",children:[b.jsx("h2",{className:"font-display text-xl font-medium text-nim-black",children:e}),b.jsxs("div",{className:"flex items-center gap-2",children:[c&&b.jsx("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg bg-nim-cream hover:bg-nim-cream/80 text-nim-black font-body transition-colors","aria-label":"Logout",children:"Logout"}),b.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-nim-cream transition-colors","aria-label":"Close chat",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-nim-black",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),d&&b.jsx("div",{className:"px-4 py-2 bg-yellow-100 border-b border-yellow-200 text-nim-black font-body text-sm",children:"Reconnecting..."}),f&&!d&&b.jsx("div",{className:"px-4 py-2 bg-orange-100 border-b border-orange-200 text-nim-black font-body text-sm",children:"Connection lost. Reconnecting..."}),g&&b.jsx("div",{className:"px-4 py-2 bg-red-100 border-b border-red-200 text-nim-black font-body text-sm",children:"Connection failed. Please refresh the page."}),b.jsxs("div",{className:"nim-chat-messages flex-1 overflow-y-auto p-4 space-y-3",children:[n.length===0&&!p&&b.jsxs("div",{className:"text-center py-8 px-4",children:[b.jsx("p",{className:"font-display text-lg font-medium text-nim-black mb-3",children:"Chat with Nim"}),b.jsx("p",{className:"font-body text-sm text-nim-brown/60 mb-4",children:"Ask me anything about your finances"}),b.jsxs("div",{className:"space-y-2 text-sm text-left bg-nim-cream rounded-lg p-4",children:[b.jsx("p",{className:"font-display font-medium text-nim-black mb-2",children:"Try asking:"}),b.jsxs("ul",{className:"space-y-1.5 font-body text-nim-brown/60",children:[b.jsx("li",{children:`• "What's my balance?"`}),b.jsx("li",{children:'• "Show me recent transactions"'}),b.jsx("li",{children:'• "Analyze my spending for last 30 days"'})]})]})]}),n.map(v=>b.jsx(Sr,{message:v},v.id)),t&&((x=n[n.length-1])==null?void 0:x.role)!=="assistant"&&b.jsx(Ir,{}),i&&b.jsx("div",{className:"py-2",children:b.jsx(Er,{request:i,onConfirm:o,onCancel:a})}),b.jsx("div",{ref:u})]}),b.jsx("div",{className:"p-4 border-t border-nim-cream bg-white",children:b.jsx(Cr,{onSend:l,disabled:p||d||f||g||t||!!i,placeholder:p?"Connecting...":d?"Reconnecting...":f||g?"Disconnected":t?"Nim is responding...":i?"Waiting for confirmation...":"Type a message..."})})]})}function Ps({onLoginSuccess:e,apiUrl:n="https://api.liminal.cash"}){const[t,r]=j.useState(""),[i,l]=j.useState(""),[o,a]=j.useState("email"),[s,c]=j.useState(""),[u,p]=j.useState(!1),d=async()=>{p(!0),c("");try{if(!(await fetch(`${n}/auth/v1/otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),type:1})})).ok)throw new Error("Failed to send OTP");a("otp")}catch(g){c(g instanceof Error?g.message:"Failed to send OTP")}finally{p(!1)}},f=async()=>{p(!0),c("");try{const g=await fetch(`${n}/auth/v1/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),code:i.trim(),type:1})});if(!g.ok)throw new Error("Invalid OTP code");const x=await g.json();if(!x.success)throw new Error(x.error||"Login failed");localStorage.setItem("nim_access_token",x.accessToken),localStorage.setItem("nim_refresh_token",x.refreshToken),localStorage.setItem("nim_expires_at",x.expiresAt),localStorage.setItem("nim_user_id",x.user.id),localStorage.setItem("nim_user_email",x.user.email),e(x.accessToken,x.user.id)}catch(g){c(g instanceof Error?g.message:"Verification failed")}finally{p(!1)}};return o==="otp"?b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Enter Code"}),b.jsxs("p",{className:"text-sm text-nim-brown/60 mt-1",children:["We sent a 6-digit code to ",t]})]}),b.jsx("input",{type:"text",value:i,onChange:g=>l(g.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange font-mono text-center text-2xl tracking-widest text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:f,disabled:u||i.length!==6,className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Verifying...":"Verify & Sign In"}),b.jsx("button",{onClick:()=>{a("email"),l(""),c("")},className:"text-sm text-nim-brown/60 hover:text-nim-brown transition-colors",children:"← Use different email"})]}):b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Sign In to Nim"}),b.jsx("p",{className:"text-sm text-nim-brown/60 mt-1",children:"Enter your Liminal email to receive a login code"})]}),b.jsx("input",{type:"email",value:t,onChange:g=>r(g.target.value),placeholder:"your@email.com",className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:d,disabled:u||!t.includes("@"),className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Sending code...":"Send Login Code"}),b.jsx("p",{className:"text-xs text-nim-brown/40 text-center",children:"Don't have an account? Download the Liminal app to sign up."})]})}function En(){const e=localStorage.getItem("nim_access_token"),n=localStorage.getItem("nim_refresh_token"),t=localStorage.getItem("nim_expires_at"),r=localStorage.getItem("nim_user_id"),i=localStorage.getItem("nim_user_email");return!e||!n||!t||!r?null:{accessToken:e,refreshToken:n,expiresAt:parseInt(t,10),userId:r,email:i||void 0}}function Tn(){localStorage.removeItem("nim_access_token"),localStorage.removeItem("nim_refresh_token"),localStorage.removeItem("nim_expires_at"),localStorage.removeItem("nim_user_id"),localStorage.removeItem("nim_user_email")}function Ft(e,n=60){return Math.floor(Date.now()/1e3)>=e-n}async function Rt(e,n="https://api.liminal.cash"){const t=await fetch(`${n}/auth/v1/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})});if(!t.ok)throw new Error("Failed to refresh token");const r=await t.json(),i={accessToken:r.access_token,refreshToken:r.refresh_token,expiresAt:r.expires_at,userId:r.user.id,email:r.user.email};return localStorage.setItem("nim_access_token",i.accessToken),localStorage.setItem("nim_refresh_token",i.refreshToken),localStorage.setItem("nim_expires_at",i.expiresAt.toString()),localStorage.setItem("nim_user_id",i.userId),i.email&&localStorage.setItem("nim_user_email",i.email),i}const We="nim-chat-conversation-id";function vr({wsUrl:e,jwt:n,onError:t}){const[r,i]=j.useState([]),[l,o]=j.useState(!1),[a,s]=j.useState("disconnected"),[c,u]=j.useState(null),p=j.useRef(null),d=j.useRef(""),f=j.useRef(null),g=j.useRef(!0),x=j.useRef(0),v=j.useRef(null),S=j.useRef(!1),A=j.useCallback(L=>{var O;((O=p.current)==null?void 0:O.readyState)===WebSocket.OPEN&&p.current.send(JSON.stringify(L))},[]),T=j.useCallback(()=>{var E;if(((E=p.current)==null?void 0:E.readyState)===WebSocket.OPEN)return;s("connecting");const L=n?`${e}${e.includes("?")?"&":"?"}token=${encodeURIComponent(n)}`:e,O=new WebSocket(L);p.current=O,O.onopen=()=>{s("connected"),x.current=0;const I=localStorage.getItem(We);I&&!S.current?(f.current=I,A({type:"resume_conversation",conversationId:I})):(S.current=!1,A({type:"new_conversation"}))},O.onmessage=I=>{const z=JSON.parse(I.data);switch(z.type){case"conversation_started":f.current=z.conversationId,localStorage.setItem(We,z.conversationId);break;case"conversation_resumed":f.current=z.conversationId,localStorage.setItem(We,z.conversationId),i(z.messages||[]);break;case"text_chunk":o(!0),d.current+=z.content,i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"&&!M.content.endsWith("█")?[...P.slice(0,-1),{...M,content:d.current}]:(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:d.current}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:d.current,timestamp:Date.now()}]});break;case"text":o(!1),d.current="",i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:z.content}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:z.content,timestamp:Date.now()}]});break;case"confirm_request":u({actionId:z.actionId,tool:z.tool,summary:z.summary,expiresAt:new Date(z.expiresAt)});break;case"complete":o(!1),d.current="",u(null);break;case"error":o(!1),d.current="",z.content.toLowerCase().includes("conversation not found")||z.content.toLowerCase().includes("conversation does not exist")?(localStorage.removeItem(We),f.current=null,S.current=!0,F()):(t==null||t(z.content),i(P=>[...P,{id:`msg-${Date.now()}`,role:"assistant",content:`Error: ${z.content}`,timestamp:Date.now()}]));break}},O.onerror=()=>{s("error"),t==null||t("WebSocket connection error")},O.onclose=()=>{if(s("disconnected"),o(!1),!!g.current)if(x.current<5){s("reconnecting");const I=Math.min(1e3*Math.pow(2,x.current),1e4);x.current++,v.current=setTimeout(()=>{g.current&&T()},I)}else s("error"),t==null||t("Failed to reconnect after multiple attempts")}},[e,n,A,t]),H=j.useCallback(()=>{var L;v.current&&(clearTimeout(v.current),v.current=null),(L=p.current)==null||L.close(),p.current=null},[]),F=j.useCallback(()=>{x.current=0,H(),T()},[T,H]),k=j.useCallback(L=>{if(!L.trim())return;const O={id:`msg-${Date.now()}`,role:"user",content:L.trim(),timestamp:Date.now()};i(E=>[...E,O]),A({type:"message",content:L.trim()})},[A]),V=j.useCallback(L=>{A({type:"confirm",actionId:L}),u(null)},[A]),W=j.useCallback(L=>{A({type:"cancel",actionId:L}),u(null)},[A]);return j.useEffect(()=>(g.current=!0,n&&T(),()=>{g.current=!1,H()}),[n]),j.useEffect(()=>{const L=setInterval(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken),p.current&&F()}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}},3e5);return(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken)}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}})(),()=>{clearInterval(L)}},[n,t,F]),{messages:r,isStreaming:l,connectionState:a,confirmationRequest:c,sendMessage:k,confirmAction:V,cancelAction:W,reconnect:F}}function Ls({wsUrl:e,apiUrl:n="https://api.liminal.cash",title:t="Nim",position:r="bottom-right",defaultOpen:i=!1}){const[l,o]=j.useState(i),[a,s]=j.useState(!1),[c,u]=j.useState(null);j.useEffect(()=>{const F=En();F&&(u(F.accessToken),s(!0))},[]);const p=(F,k)=>{u(F),s(!0)},d=()=>{Tn(),u(null),s(!1)},{messages:f,isStreaming:g,connectionState:x,confirmationRequest:v,sendMessage:S,confirmAction:A,cancelAction:T}=vr({wsUrl:e,jwt:a?c:null,onError:F=>console.error("[NimChat]",F)}),H=r==="bottom-right"?"right-4 sm:right-6":"left-4 sm:left-6";return b.jsxs("div",{className:"nim-chat-widget fixed bottom-4 sm:bottom-6 z-50",style:{[r==="bottom-right"?"right":"left"]:"1rem"},children:[l&&!a&&b.jsx("div",{className:`
36
+ `,"aria-label":"Send message",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),b.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})}function Ir(){return b.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-3 bg-nim-white border border-nim-grey-100 rounded-lg max-w-bubble",children:[b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"})]})}function Er({request:e,onConfirm:n,onCancel:t}){const[r,i]=j.useState(0);j.useEffect(()=>{const s=()=>{const u=Math.max(0,e.expiresAt.getTime()-Date.now());i(u),u<=0&&t(e.actionId)};s();const c=setInterval(s,100);return()=>clearInterval(c)},[e.expiresAt,e.actionId,t]);const l=e.expiresAt.getTime()-Date.now()+r,o=l>0?r/l*100:0,a=Math.ceil(r/1e3);return b.jsxs("div",{className:"bg-white border-2 border-nim-black rounded-lg p-5 shadow-lg",children:[b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-nim-cream rounded-lg flex items-center justify-center",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-nim-orange",children:[b.jsx("path",{d:"M12 9v4"}),b.jsx("path",{d:"M12 17h.01"}),b.jsx("path",{d:"M3.6 15.8l4.8-9.6a2 2 0 0 1 3.6 0l4.8 9.6a2 2 0 0 1-1.8 2.8H5.4a2 2 0 0 1-1.8-2.8z"})]})}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h4",{className:"font-display font-medium text-nim-black text-base",children:"Confirm Action"}),b.jsx("p",{className:"text-nim-brown/70 text-xs mt-0.5 font-mono",children:e.tool}),b.jsx("p",{className:"text-nim-black font-body text-sm mt-2",children:e.summary})]}),b.jsxs("div",{className:"flex-shrink-0 relative w-10 h-10",children:[b.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#F1EDE7",strokeWidth:"3"}),b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#FF6D00",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:100-o,className:"transition-all duration-100"})]}),b.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-nim-black font-mono",children:a})]})]}),b.jsxs("div",{className:"flex gap-3 mt-4",children:[b.jsx("button",{onClick:()=>t(e.actionId),className:"flex-1 h-10 px-4 bg-white text-nim-black rounded-lg text-sm font-display font-medium hover:bg-nim-cream transition-colors border-2 border-nim-black",children:"Cancel"}),b.jsx("button",{onClick:()=>n(e.actionId),className:"flex-1 h-10 px-4 bg-nim-orange text-white rounded-lg text-sm font-display font-medium hover:opacity-90 transition-opacity",children:"Confirm"})]})]})}function Tr({title:e,messages:n,isStreaming:t,connectionState:r,confirmationRequest:i,onSendMessage:l,onConfirm:o,onCancel:a,onClose:s,onLogout:c}){var x;const u=j.useRef(null);j.useEffect(()=>{var v;(v=u.current)==null||v.scrollIntoView({behavior:"smooth"})},[n,t,i]);const p=r==="connecting",d=r==="reconnecting",f=r==="disconnected",g=r==="error";return b.jsxs("div",{className:"nim-panel-enter flex flex-col h-full bg-white rounded-xl shadow-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-5 py-4 bg-white border-b border-nim-cream",children:[b.jsx("h2",{className:"font-display text-xl font-medium text-nim-black",children:e}),b.jsxs("div",{className:"flex items-center gap-2",children:[c&&b.jsx("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg bg-nim-cream hover:bg-nim-cream/80 text-nim-black font-body transition-colors","aria-label":"Logout",children:"Logout"}),b.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-nim-cream transition-colors","aria-label":"Close chat",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-nim-black",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),d&&b.jsx("div",{className:"px-4 py-2 bg-yellow-100 border-b border-yellow-200 text-nim-black font-body text-sm",children:"Reconnecting..."}),f&&!d&&b.jsx("div",{className:"px-4 py-2 bg-orange-100 border-b border-orange-200 text-nim-black font-body text-sm",children:"Connection lost. Reconnecting..."}),g&&b.jsx("div",{className:"px-4 py-2 bg-red-100 border-b border-red-200 text-nim-black font-body text-sm",children:"Connection failed. Please refresh the page."}),b.jsxs("div",{className:"nim-chat-messages flex-1 overflow-y-auto p-4 space-y-3",children:[n.length===0&&!p&&b.jsxs("div",{className:"text-center py-8 px-4",children:[b.jsx("p",{className:"font-display text-lg font-medium text-nim-black mb-3",children:"Chat with Nim"}),b.jsx("p",{className:"font-body text-sm text-nim-brown/60 mb-4",children:"Ask me anything about your finances"}),b.jsxs("div",{className:"space-y-2 text-sm text-left bg-nim-cream rounded-lg p-4",children:[b.jsx("p",{className:"font-display font-medium text-nim-black mb-2",children:"Try asking:"}),b.jsxs("ul",{className:"space-y-1.5 font-body text-nim-brown/60",children:[b.jsx("li",{children:`• "What's my balance?"`}),b.jsx("li",{children:'• "Show me recent transactions"'}),b.jsx("li",{children:'• "Analyze my spending for last 30 days"'})]})]})]}),n.map(v=>b.jsx(Sr,{message:v},v.id)),t&&((x=n[n.length-1])==null?void 0:x.role)!=="assistant"&&b.jsx(Ir,{}),i&&b.jsx("div",{className:"py-2",children:b.jsx(Er,{request:i,onConfirm:o,onCancel:a})}),b.jsx("div",{ref:u})]}),b.jsx("div",{className:"p-4 border-t border-nim-cream bg-white",children:b.jsx(Cr,{onSend:l,disabled:p||d||f||g||t||!!i,placeholder:p?"Connecting...":d?"Reconnecting...":f||g?"Disconnected":t?"Nim is responding...":i?"Waiting for confirmation...":"Type a message..."})})]})}function Ps({onLoginSuccess:e,apiUrl:n="https://api.liminal.cash"}){const[t,r]=j.useState(""),[i,l]=j.useState(""),[o,a]=j.useState("email"),[s,c]=j.useState(""),[u,p]=j.useState(!1),d=async()=>{p(!0),c("");try{if(!(await fetch(`${n}/auth/v1/otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),type:1})})).ok)throw new Error("Failed to send OTP");a("otp")}catch(g){c(g instanceof Error?g.message:"Failed to send OTP")}finally{p(!1)}},f=async()=>{p(!0),c("");try{const g=await fetch(`${n}/auth/v1/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),code:i.trim(),type:1})});if(!g.ok)throw new Error("Invalid OTP code");const x=await g.json();if(!x.success)throw new Error(x.error||"Login failed");localStorage.setItem("nim_access_token",x.accessToken),localStorage.setItem("nim_refresh_token",x.refreshToken),localStorage.setItem("nim_expires_at",x.expiresAt),localStorage.setItem("nim_user_id",x.user.id),localStorage.setItem("nim_user_email",x.user.email),e(x.accessToken,x.user.id)}catch(g){c(g instanceof Error?g.message:"Verification failed")}finally{p(!1)}};return o==="otp"?b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Enter Code"}),b.jsxs("p",{className:"text-sm text-nim-brown/60 mt-1",children:["We sent a 6-digit code to ",t]})]}),b.jsx("input",{type:"text",value:i,onChange:g=>l(g.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange font-mono text-center text-2xl tracking-widest text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:f,disabled:u||i.length!==6,className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Verifying...":"Verify & Sign In"}),b.jsx("button",{onClick:()=>{a("email"),l(""),c("")},className:"text-sm text-nim-brown/60 hover:text-nim-brown transition-colors",children:"← Use different email"})]}):b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Sign In to Nim"}),b.jsx("p",{className:"text-sm text-nim-brown/60 mt-1",children:"Enter your Liminal email to receive a login code"})]}),b.jsx("input",{type:"email",value:t,onChange:g=>r(g.target.value),placeholder:"your@email.com",className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:d,disabled:u||!t.includes("@"),className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Sending code...":"Send Login Code"}),b.jsx("p",{className:"text-xs text-nim-brown/40 text-center",children:"Don't have an account? Download the Liminal app to sign up."})]})}function En(){const e=localStorage.getItem("nim_access_token"),n=localStorage.getItem("nim_refresh_token"),t=localStorage.getItem("nim_expires_at"),r=localStorage.getItem("nim_user_id"),i=localStorage.getItem("nim_user_email");return!e||!n||!t||!r?null:{accessToken:e,refreshToken:n,expiresAt:parseInt(t,10),userId:r,email:i||void 0}}function Tn(){localStorage.removeItem("nim_access_token"),localStorage.removeItem("nim_refresh_token"),localStorage.removeItem("nim_expires_at"),localStorage.removeItem("nim_user_id"),localStorage.removeItem("nim_user_email")}function Ft(e,n=60){return Math.floor(Date.now()/1e3)>=e-n}async function Rt(e,n="https://api.liminal.cash"){const t=await fetch(`${n}/auth/v1/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})});if(!t.ok)throw new Error("Failed to refresh token");const r=await t.json(),i={accessToken:r.access_token,refreshToken:r.refresh_token,expiresAt:r.expires_at,userId:r.user.id,email:r.user.email};return localStorage.setItem("nim_access_token",i.accessToken),localStorage.setItem("nim_refresh_token",i.refreshToken),localStorage.setItem("nim_expires_at",i.expiresAt.toString()),localStorage.setItem("nim_user_id",i.userId),i.email&&localStorage.setItem("nim_user_email",i.email),i}const We="nim-chat-conversation-id";function vr({wsUrl:e,jwt:n,onError:t}){const[r,i]=j.useState([]),[l,o]=j.useState(!1),[a,s]=j.useState("disconnected"),[c,u]=j.useState(null),p=j.useRef(null),d=j.useRef(""),f=j.useRef(null),g=j.useRef(!0),x=j.useRef(0),v=j.useRef(null),S=j.useRef(!1),A=j.useCallback(L=>{var O;((O=p.current)==null?void 0:O.readyState)===WebSocket.OPEN&&p.current.send(JSON.stringify(L))},[]),T=j.useCallback(()=>{var E;if(((E=p.current)==null?void 0:E.readyState)===WebSocket.OPEN)return;s("connecting");const L=n?`${e}${e.includes("?")?"&":"?"}token=${encodeURIComponent(n)}`:e,O=new WebSocket(L);p.current=O,O.onopen=()=>{s("connected"),x.current=0;const I=localStorage.getItem(We);I&&!S.current?(f.current=I,A({type:"resume_conversation",conversationId:I})):(S.current=!1,A({type:"new_conversation"}))},O.onmessage=I=>{const z=JSON.parse(I.data);switch(z.type){case"conversation_started":f.current=z.conversationId,localStorage.setItem(We,z.conversationId);break;case"conversation_resumed":f.current=z.conversationId,localStorage.setItem(We,z.conversationId),i(z.messages||[]);break;case"text_chunk":o(!0),d.current+=z.content,i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"&&!M.content.endsWith("█")?[...P.slice(0,-1),{...M,content:d.current}]:(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:d.current}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:d.current,timestamp:Date.now()}]});break;case"text":o(!1),d.current="",i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:z.content}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:z.content,timestamp:Date.now()}]});break;case"confirm_request":u({actionId:z.actionId,tool:z.tool,summary:z.summary,expiresAt:new Date(z.expiresAt)});break;case"complete":o(!1),d.current="",u(null);break;case"error":o(!1),d.current="",z.content.toLowerCase().includes("conversation not found")||z.content.toLowerCase().includes("conversation does not exist")?(localStorage.removeItem(We),f.current=null,S.current=!0,F()):(t==null||t(z.content),i(P=>[...P,{id:`msg-${Date.now()}`,role:"assistant",content:`Error: ${z.content}`,timestamp:Date.now()}]));break}},O.onerror=()=>{s("error"),t==null||t("WebSocket connection error")},O.onclose=()=>{if(s("disconnected"),o(!1),!!g.current)if(x.current<5){s("reconnecting");const I=Math.min(1e3*Math.pow(2,x.current),1e4);x.current++,v.current=setTimeout(()=>{g.current&&T()},I)}else s("error"),t==null||t("Failed to reconnect after multiple attempts")}},[e,n,A,t]),H=j.useCallback(()=>{var L;v.current&&(clearTimeout(v.current),v.current=null),(L=p.current)==null||L.close(),p.current=null},[]),F=j.useCallback(()=>{x.current=0,H(),T()},[T,H]),k=j.useCallback(L=>{if(!L.trim())return;const O={id:`msg-${Date.now()}`,role:"user",content:L.trim(),timestamp:Date.now()};i(E=>[...E,O]),A({type:"message",content:L.trim()})},[A]),V=j.useCallback(L=>{A({type:"confirm",actionId:L}),u(null)},[A]),W=j.useCallback(L=>{A({type:"cancel",actionId:L}),u(null)},[A]);return j.useEffect(()=>(g.current=!0,n&&T(),()=>{g.current=!1,H()}),[n]),j.useEffect(()=>{const L=setInterval(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken),p.current&&F()}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}},3e5);return(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken)}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}})(),()=>{clearInterval(L)}},[n,t,F]),{messages:r,isStreaming:l,connectionState:a,confirmationRequest:c,sendMessage:k,confirmAction:V,cancelAction:W,reconnect:F}}function Ls({wsUrl:e,apiUrl:n="https://api.liminal.cash",title:t="Nim",position:r="bottom-right",defaultOpen:i=!1}){const[l,o]=j.useState(i),[a,s]=j.useState(!1),[c,u]=j.useState(null);j.useEffect(()=>{const F=En();F&&(u(F.accessToken),s(!0))},[]);const p=(F,k)=>{u(F),s(!0)},d=()=>{Tn(),u(null),s(!1)},{messages:f,isStreaming:g,connectionState:x,confirmationRequest:v,sendMessage:S,confirmAction:A,cancelAction:T}=vr({wsUrl:e,jwt:a?c:null,onError:F=>console.error("[NimChat]",F)}),H=r==="bottom-right"?"right-4 sm:right-6":"left-4 sm:left-6";return b.jsxs("div",{className:"nim-chat-widget fixed bottom-4 sm:bottom-6 z-50",style:{[r==="bottom-right"?"right":"left"]:"1rem"},children:[l&&!a&&b.jsx("div",{className:`
37
37
  absolute bottom-16
38
38
  w-[calc(100vw-2rem)] sm:w-96
39
39
  `,style:{[r==="bottom-right"?"right":"left"]:0},children:b.jsx(Ps,{onLoginSuccess:p,apiUrl:n})}),l&&a&&b.jsx("div",{className:`
package/dist/index.js CHANGED
@@ -6848,9 +6848,9 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6848
6848
  return () => clearInterval(c);
6849
6849
  }, [e.expiresAt, e.actionId, t]);
6850
6850
  const l = e.expiresAt.getTime() - Date.now() + r, o = l > 0 ? r / l * 100 : 0, a = Math.ceil(r / 1e3);
6851
- return /* @__PURE__ */ q("div", { className: "bg-nim-white border-2 border-nim-black rounded-lg p-5 shadow-lg", children: [
6851
+ return /* @__PURE__ */ q("div", { className: "bg-white border-2 border-nim-black rounded-lg p-5 shadow-lg", children: [
6852
6852
  /* @__PURE__ */ q("div", { className: "flex items-start gap-3", children: [
6853
- /* @__PURE__ */ C("div", { className: "flex-shrink-0 w-10 h-10 bg-nim-beige rounded-lg flex items-center justify-center", children: /* @__PURE__ */ q(
6853
+ /* @__PURE__ */ C("div", { className: "flex-shrink-0 w-10 h-10 bg-nim-cream rounded-lg flex items-center justify-center", children: /* @__PURE__ */ q(
6854
6854
  "svg",
6855
6855
  {
6856
6856
  width: "20",
@@ -6859,7 +6859,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6859
6859
  fill: "none",
6860
6860
  stroke: "currentColor",
6861
6861
  strokeWidth: "2",
6862
- className: "text-nim-black",
6862
+ className: "text-nim-orange",
6863
6863
  children: [
6864
6864
  /* @__PURE__ */ C("path", { d: "M12 9v4" }),
6865
6865
  /* @__PURE__ */ C("path", { d: "M12 17h.01" }),
@@ -6869,7 +6869,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6869
6869
  ) }),
6870
6870
  /* @__PURE__ */ q("div", { className: "flex-1 min-w-0", children: [
6871
6871
  /* @__PURE__ */ C("h4", { className: "font-display font-medium text-nim-black text-base", children: "Confirm Action" }),
6872
- /* @__PURE__ */ C("p", { className: "text-nim-grey-400 text-xs mt-0.5 font-mono", children: e.tool }),
6872
+ /* @__PURE__ */ C("p", { className: "text-nim-brown/70 text-xs mt-0.5 font-mono", children: e.tool }),
6873
6873
  /* @__PURE__ */ C("p", { className: "text-nim-black font-body text-sm mt-2", children: e.summary })
6874
6874
  ] }),
6875
6875
  /* @__PURE__ */ q("div", { className: "flex-shrink-0 relative w-10 h-10", children: [
@@ -6881,7 +6881,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6881
6881
  cy: "18",
6882
6882
  r: "16",
6883
6883
  fill: "none",
6884
- stroke: "#ddd",
6884
+ stroke: "#F1EDE7",
6885
6885
  strokeWidth: "3"
6886
6886
  }
6887
6887
  ),
@@ -6892,7 +6892,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6892
6892
  cy: "18",
6893
6893
  r: "16",
6894
6894
  fill: "none",
6895
- stroke: "#231f18",
6895
+ stroke: "#FF6D00",
6896
6896
  strokeWidth: "3",
6897
6897
  strokeLinecap: "round",
6898
6898
  strokeDasharray: "100",
@@ -6909,7 +6909,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6909
6909
  "button",
6910
6910
  {
6911
6911
  onClick: () => t(e.actionId),
6912
- className: "flex-1 h-10 px-4 bg-nim-beige text-nim-black rounded-lg text-sm font-display font-medium hover:bg-nim-grey-100 transition-colors border border-nim-grey-100",
6912
+ className: "flex-1 h-10 px-4 bg-white text-nim-black rounded-lg text-sm font-display font-medium hover:bg-nim-cream transition-colors border-2 border-nim-black",
6913
6913
  children: "Cancel"
6914
6914
  }
6915
6915
  ),
@@ -6917,7 +6917,7 @@ function vs({ request: e, onConfirm: n, onCancel: t }) {
6917
6917
  "button",
6918
6918
  {
6919
6919
  onClick: () => n(e.actionId),
6920
- className: "flex-1 h-10 px-4 bg-nim-black text-nim-white rounded-lg text-sm font-display font-medium hover:opacity-90 transition-opacity",
6920
+ className: "flex-1 h-10 px-4 bg-nim-orange text-white rounded-lg text-sm font-display font-medium hover:opacity-90 transition-opacity",
6921
6921
  children: "Confirm"
6922
6922
  }
6923
6923
  )
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-16{bottom:4rem}.bottom-4{bottom:1rem}.left-4{left:1rem}.right-4{right:1rem}.z-50{z-index:50}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-8{height:2rem}.h-\[min\(600px\2c calc\(100vh-8rem\)\)\]{height:min(600px,calc(100vh - 8rem))}.h-full{height:100%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-8{width:2rem}.w-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.min-w-0{min-width:0}.max-w-bubble{max-width:85%}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-rotate-90{--tw-rotate:-90deg}.-rotate-90,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem*var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem*var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-nim-black{--tw-border-opacity:1;border-color:rgb(35 31 24/var(--tw-border-opacity,1))}.border-nim-cream{--tw-border-opacity:1;border-color:rgb(241 237 231/var(--tw-border-opacity,1))}.border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-yellow-200{--tw-border-opacity:1;border-color:rgb(254 240 138/var(--tw-border-opacity,1))}.bg-nim-black{--tw-bg-opacity:1;background-color:rgb(35 31 24/var(--tw-bg-opacity,1))}.bg-nim-cream{--tw-bg-opacity:1;background-color:rgb(241 237 231/var(--tw-bg-opacity,1))}.bg-nim-orange{--tw-bg-opacity:1;background-color:rgb(255 109 0/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-left{text-align:left}.text-center{text-align:center}.font-body{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace}.font-display{font-family:ABC Marist,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.font-mono{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tracking-widest{letter-spacing:.1em}.text-nim-black{--tw-text-opacity:1;color:rgb(35 31 24/var(--tw-text-opacity,1))}.text-nim-brown\/40{color:rgba(73,38,16,.4)}.text-nim-brown\/60{color:rgba(73,38,16,.6)}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.placeholder-nim-brown\/40::-moz-placeholder{color:rgba(73,38,16,.4)}.placeholder-nim-brown\/40::placeholder{color:rgba(73,38,16,.4)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Regular.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Medium.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-SemiBold.otf) format("opentype");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Bold.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:"Helvetica Monospaced Pro";src:url(/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Rg.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:"Helvetica Monospaced Pro";src:url(/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Bd.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap}.nim-chat-widget{font-family:"Helvetica Monospaced Pro",SF Mono,Monaco,Courier New,monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.nim-chat-messages::-webkit-scrollbar{width:6px}.nim-chat-messages::-webkit-scrollbar-track{background:transparent}.nim-chat-messages::-webkit-scrollbar-thumb{background:#b6b6b6;border-radius:3px}.nim-chat-messages::-webkit-scrollbar-thumb:hover{background:#6b6b6b}@keyframes nim-bounce{0%,80%,to{transform:scale(.8);opacity:.5}40%{transform:scale(1);opacity:1}}.nim-thinking-dot{animation:nim-bounce 1.4s ease-in-out infinite both}.nim-thinking-dot:first-child{animation-delay:-.32s}.nim-thinking-dot:nth-child(2){animation-delay:-.16s}.nim-thinking-dot:nth-child(3){animation-delay:0s}@keyframes nim-slide-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.nim-panel-enter{animation:nim-slide-in .2s ease-out forwards}@keyframes nim-countdown{0%{stroke-dashoffset:0}to{stroke-dashoffset:100}}.nim-message-content p{margin:0}.nim-message-content p+p{margin-top:.5rem}.nim-message-content code{background:rgba(35,31,24,.1);padding:.125rem .25rem;border-radius:.25rem;font-size:.875em;font-family:"Helvetica Monospaced Pro",monospace}.nim-message-content pre{background:rgba(35,31,24,.1);padding:.75rem;border-radius:.5rem;overflow-x:auto;margin:.5rem 0}.nim-message-content pre code{background:none;padding:0}.nim-message-content ol,.nim-message-content ul{margin:.5rem 0;padding-left:1.5rem}.nim-message-content li{margin:.25rem 0}.nim-message-content a{color:inherit;text-decoration:underline}.nim-message-content strong{font-weight:600}.hover\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.hover\:scale-105:hover,.hover\:scale-110:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1}.hover\:bg-nim-cream:hover{--tw-bg-opacity:1;background-color:rgb(241 237 231/var(--tw-bg-opacity,1))}.hover\:bg-nim-cream\/80:hover{background-color:hsla(36,26%,93%,.8)}.hover\:bg-orange-600:hover{--tw-bg-opacity:1;background-color:rgb(234 88 12/var(--tw-bg-opacity,1))}.hover\:text-nim-brown:hover{--tw-text-opacity:1;color:rgb(73 38 16/var(--tw-text-opacity,1))}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:border-nim-orange:focus{--tw-border-opacity:1;border-color:rgb(255 109 0/var(--tw-border-opacity,1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-nim-orange:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(255 109 0/var(--tw-ring-opacity,1))}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:scale-100:hover:disabled{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:640px){.sm\:bottom-6{bottom:1.5rem}.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:w-96{width:24rem}}
1
+ *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-16{bottom:4rem}.bottom-4{bottom:1rem}.left-4{left:1rem}.right-4{right:1rem}.z-50{z-index:50}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-8{height:2rem}.h-\[min\(600px\2c calc\(100vh-8rem\)\)\]{height:min(600px,calc(100vh - 8rem))}.h-full{height:100%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-8{width:2rem}.w-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.min-w-0{min-width:0}.max-w-bubble{max-width:85%}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-rotate-90{--tw-rotate:-90deg}.-rotate-90,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem*var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem*var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-nim-black{--tw-border-opacity:1;border-color:rgb(35 31 24/var(--tw-border-opacity,1))}.border-nim-cream{--tw-border-opacity:1;border-color:rgb(241 237 231/var(--tw-border-opacity,1))}.border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-yellow-200{--tw-border-opacity:1;border-color:rgb(254 240 138/var(--tw-border-opacity,1))}.bg-nim-black{--tw-bg-opacity:1;background-color:rgb(35 31 24/var(--tw-bg-opacity,1))}.bg-nim-cream{--tw-bg-opacity:1;background-color:rgb(241 237 231/var(--tw-bg-opacity,1))}.bg-nim-orange{--tw-bg-opacity:1;background-color:rgb(255 109 0/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-left{text-align:left}.text-center{text-align:center}.font-body{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace}.font-display{font-family:ABC Marist,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.font-mono{font-family:Helvetica Monospaced Pro,SF Mono,Monaco,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tracking-widest{letter-spacing:.1em}.text-nim-black{--tw-text-opacity:1;color:rgb(35 31 24/var(--tw-text-opacity,1))}.text-nim-brown\/40{color:rgba(73,38,16,.4)}.text-nim-brown\/60{color:rgba(73,38,16,.6)}.text-nim-brown\/70{color:rgba(73,38,16,.7)}.text-nim-orange{--tw-text-opacity:1;color:rgb(255 109 0/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.placeholder-nim-brown\/40::-moz-placeholder{color:rgba(73,38,16,.4)}.placeholder-nim-brown\/40::placeholder{color:rgba(73,38,16,.4)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Regular.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Medium.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-SemiBold.otf) format("opentype");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:ABC Marist;src:url(/fonts/abc-marist/ABCMarist-Bold.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:"Helvetica Monospaced Pro";src:url(/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Rg.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:"Helvetica Monospaced Pro";src:url(/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Bd.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap}.nim-chat-widget{font-family:"Helvetica Monospaced Pro",SF Mono,Monaco,Courier New,monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.nim-chat-messages::-webkit-scrollbar{width:6px}.nim-chat-messages::-webkit-scrollbar-track{background:transparent}.nim-chat-messages::-webkit-scrollbar-thumb{background:#b6b6b6;border-radius:3px}.nim-chat-messages::-webkit-scrollbar-thumb:hover{background:#6b6b6b}@keyframes nim-bounce{0%,80%,to{transform:scale(.8);opacity:.5}40%{transform:scale(1);opacity:1}}.nim-thinking-dot{animation:nim-bounce 1.4s ease-in-out infinite both}.nim-thinking-dot:first-child{animation-delay:-.32s}.nim-thinking-dot:nth-child(2){animation-delay:-.16s}.nim-thinking-dot:nth-child(3){animation-delay:0s}@keyframes nim-slide-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.nim-panel-enter{animation:nim-slide-in .2s ease-out forwards}@keyframes nim-countdown{0%{stroke-dashoffset:0}to{stroke-dashoffset:100}}.nim-message-content p{margin:0}.nim-message-content p+p{margin-top:.5rem}.nim-message-content code{background:rgba(35,31,24,.1);padding:.125rem .25rem;border-radius:.25rem;font-size:.875em;font-family:"Helvetica Monospaced Pro",monospace}.nim-message-content pre{background:rgba(35,31,24,.1);padding:.75rem;border-radius:.5rem;overflow-x:auto;margin:.5rem 0}.nim-message-content pre code{background:none;padding:0}.nim-message-content ol,.nim-message-content ul{margin:.5rem 0;padding-left:1.5rem}.nim-message-content li{margin:.25rem 0}.nim-message-content a{color:inherit;text-decoration:underline}.nim-message-content strong{font-weight:600}.hover\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.hover\:scale-105:hover,.hover\:scale-110:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1}.hover\:bg-nim-cream:hover{--tw-bg-opacity:1;background-color:rgb(241 237 231/var(--tw-bg-opacity,1))}.hover\:bg-nim-cream\/80:hover{background-color:hsla(36,26%,93%,.8)}.hover\:bg-orange-600:hover{--tw-bg-opacity:1;background-color:rgb(234 88 12/var(--tw-bg-opacity,1))}.hover\:text-nim-brown:hover{--tw-text-opacity:1;color:rgb(73 38 16/var(--tw-text-opacity,1))}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:border-nim-orange:focus{--tw-border-opacity:1;border-color:rgb(255 109 0/var(--tw-border-opacity,1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-nim-orange:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(255 109 0/var(--tw-ring-opacity,1))}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:scale-100:hover:disabled{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:640px){.sm\:bottom-6{bottom:1.5rem}.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:w-96{width:24rem}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liminalcash/nim-chat",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "React chat widget for nim SDK backends",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",