claudius-chat-widget 1.16.0 → 1.17.0
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/claudius.cjs +16 -6
- package/dist/claudius.css +1 -1
- package/dist/claudius.iife.js +26 -16
- package/dist/claudius.js +1692 -1153
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/package.json +1 -1
package/dist/claudius.cjs
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var at=Object.defineProperty;var it=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var le=(e,t,n)=>it(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react");class G extends Error{constructor(t,n,r,s){super(t),this.status=n,this.code=r,this.retryAfter=s,this.name="ChatApiError"}}class ve extends Error{constructor(){super("Request debounced"),this.name="DebounceError"}}const ct=3e4;function lt(e,t){const n=atob(e),r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return new Blob([r],{type:t})}class Ve{constructor(t,n){le(this,"baseUrl");le(this,"maxRetries");le(this,"debounceMs");le(this,"timeoutMs");le(this,"lastSendTime",0);this.baseUrl=t,this.maxRetries=(n==null?void 0:n.maxRetries)??2,this.debounceMs=(n==null?void 0:n.debounceMs)??300,this.timeoutMs=(n==null?void 0:n.timeoutMs)??ct}async sendMessage(t){if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ve;this.lastSendTime=Date.now();let n;for(let r=0;r<=this.maxRetries;r++)try{const s=await this.fetchWithTimeout(t);if(s.ok)return await s.json();const o=await s.json().catch(()=>({})),i=s.headers.get("Retry-After"),l=i?Number(i):void 0;if(n=new G(o.error??`Request failed with status ${s.status}`,s.status,o.code,l),!this.isRetryable(s.status))throw n;if(r<this.maxRetries){const u=this.getRetryDelay(s,r);await this.delay(u)}}catch(s){if(s instanceof G){if(!this.isRetryable(s.status,s.code))throw s;if(n=s,r<this.maxRetries){const o=this.getRetryDelay(null,r);await this.delay(o)}}else if(n=new G("Failed to connect. Please try again.",0,"NETWORK_ERROR"),r<this.maxRetries){const o=this.getRetryDelay(null,r);await this.delay(o)}}throw n}buildRequest(t){if(!t.some(o=>{var i;return(i=o.attachments)==null?void 0:i.some(l=>!!l.data)}))return{headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t})};const r=new FormData,s=t.map(o=>o.attachments?{...o,attachments:o.attachments.map(i=>{const l={...i};return delete l.data,l})}:o);r.append("payload",JSON.stringify({messages:s}));for(const o of t)for(const i of o.attachments??[])i.data&&r.append(i.id,lt(i.data,i.mediaType),i.name);return{body:r}}async streamMessage(t,n={}){var s;if(typeof ReadableStream>"u")return this.sendMessage(t);if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ve;this.lastSendTime=Date.now();let r;for(let o=0;o<=this.maxRetries;o++){let i;try{i=await this.fetchStream(t,n.signal)}catch(u){if((s=n.signal)!=null&&s.aborted)return{reply:"",aborted:!0};if(r=u instanceof G?u:new G("Failed to connect. Please try again.",0,"NETWORK_ERROR"),!this.isRetryable(r.status,r.code))throw r;o<this.maxRetries&&await this.delay(this.getRetryDelay(null,o));continue}if(i.status===404||i.status===405)return this.lastSendTime=0,this.sendMessage(t);if(!i.ok){const u=await i.json().catch(()=>({})),d=i.headers.get("Retry-After");if(r=new G(u.error??`Request failed with status ${i.status}`,i.status,u.code,d?Number(d):void 0),!this.isRetryable(i.status))throw r;o<this.maxRetries&&await this.delay(this.getRetryDelay(i,o));continue}if(!(i.headers.get("Content-Type")??"").includes("text/event-stream"))try{return await i.json()}catch{return this.lastSendTime=0,this.sendMessage(t)}return i.body?this.readSseStream(i.body,n):(this.lastSendTime=0,this.sendMessage(t))}throw r}async readSseStream(t,n){var f,w,S,x,h,p,j;const r=t.getReader(),s=new TextDecoder;let o="",i="";const l=[];let u;const d=()=>{r.cancel().catch(()=>{})};(f=n.signal)==null||f.addEventListener("abort",d,{once:!0});try{for(;;){let b;try{b=await r.read()}catch(y){if((w=n.signal)!=null&&w.aborted)break;throw y}if((S=n.signal)!=null&&S.aborted||b.done)break;o+=s.decode(b.value,{stream:!0});let E;for(;(E=o.indexOf(`
|
|
2
2
|
|
|
3
|
-
`))!==-1;){const
|
|
3
|
+
`))!==-1;){const y=o.slice(0,E);o=o.slice(E+2);const v=ut(y);if(v){if(v.event==="chunk"){const k=typeof v.data.text=="string"?v.data.text:"";k&&(i+=k,(x=n.onChunk)==null||x.call(n,k,i))}else if(v.event==="tool"){if(typeof v.data.name=="string"){const k=v.data;l.push(k),(h=n.onToolUse)==null||h.call(n,k,l)}}else if(v.event==="done"){const k=Array.isArray(v.data.toolUses)?v.data.toolUses:l;u={reply:typeof v.data.reply=="string"?v.data.reply:i,sources:v.data.sources,...k.length>0?{toolUses:k}:{},...Array.isArray(v.data.attachments)?{attachments:v.data.attachments}:{}}}else if(v.event==="error")throw new G(typeof v.data.error=="string"?v.data.error:"Something went wrong. Please try again.",0,"STREAM_ERROR")}}}}finally{(p=n.signal)==null||p.removeEventListener("abort",d),r.releaseLock()}if((j=n.signal)!=null&&j.aborted)return{reply:i,aborted:!0,...l.length>0?{toolUses:l}:{}};if(u)return u;throw new G("Connection interrupted. Please try again.",0,"STREAM_ERROR")}async fetchStream(t,n){const r=new AbortController,s=()=>r.abort();n==null||n.addEventListener("abort",s,{once:!0});let o=!1;const i=this.timeoutMs>0?setTimeout(()=>{o=!0,r.abort()},this.timeoutMs):void 0,{headers:l,body:u}=this.buildRequest(t);try{return await fetch(`${this.baseUrl}/api/chat/stream`,{method:"POST",headers:l,body:u,signal:r.signal})}catch(d){throw o?new G("Request timed out. Please try again.",0,"TIMEOUT"):d}finally{i!==void 0&&clearTimeout(i),n==null||n.removeEventListener("abort",s)}}async fetchWithTimeout(t){const{headers:n,body:r}=this.buildRequest(t);if(this.timeoutMs<=0)return fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:n,body:r});const s=new AbortController,o=setTimeout(()=>s.abort(),this.timeoutMs);try{return await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:n,body:r,signal:s.signal})}catch(i){throw s.signal.aborted?new G("Request timed out. Please try again.",0,"TIMEOUT"):i}finally{clearTimeout(o)}}isRetryable(t,n){return n==="TIMEOUT"||n==="NETWORK_ERROR"?!0:t===429||t===503}getRetryDelay(t,n){if(t&&t.status===429){const r=t.headers.get("Retry-After");if(r){const s=Number(r);return Math.min(s*1e3,6e4)}}return n===0?1e3:3e3}delay(t){return new Promise(n=>setTimeout(n,t))}}function ut(e){let t="message";const n=[];for(const r of e.split(`
|
|
4
4
|
`))r.startsWith("event:")?t=r.slice(6).trim():r.startsWith("data:")&&n.push(r.slice(5).trimStart());if(n.length===0)return null;try{const r=JSON.parse(n.join(`
|
|
5
|
-
`));return typeof r!="object"||r===null?null:{event:t,data:r}}catch{return null}}function Oe(e){return typeof e=="string"?{content:e}:e}function pe(e,t,n){console.error(`[claudius] plugin "${e.name}" failed in ${t}:`,n)}async function Ye(e,t,n){let r=t;for(const s of e){if(!s.onBeforeSend)continue;let o=null;const i={...n,respondWith(u){o={type:"respond",message:r,reply:Oe(u)}},abort(u){o={type:"abort",reason:u}}};try{const u=await s.onBeforeSend(r,i);if(o)return o;u&&(r=u)}catch(u){pe(s,"onBeforeSend",u)}}return{type:"send",message:r}}async function Qe(e,t,n){let r=t;for(const s of e)if(s.onAfterReceive)try{const o=await s.onAfterReceive(r,n);o&&(r=o)}catch(o){pe(s,"onAfterReceive",o)}return r}async function Ze(e,t,n){for(const r of e){if(!r.onError)continue;let s=null;const o={...n,respondWith(i){s=Oe(i)}};try{if(await r.onError(t,o),s)return s}catch(i){pe(r,"onError",i)}}return null}const ce={maxSizeBytes:5*1024*1024,maxCount:5,allowedTypes:["image/jpeg","image/png","image/gif","image/webp","application/pdf"]};function Je(e){return e?e===!0?ce:{maxSizeBytes:e.maxSizeBytes??ce.maxSizeBytes,maxCount:e.maxCount??ce.maxCount,allowedTypes:(e.allowedTypes??ce.allowedTypes).map(t=>t.trim().toLowerCase()).filter(Boolean)}:null}function he(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;const t=e/1024;if(t<1024)return`${Math.round(t)} KB`;const n=t/1024;return`${Number.isInteger(n)?n:n.toFixed(1)} MB`}const Xe={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",pdf:"application/pdf"};function Pe(e){var r;const t=(e.type||"").trim().toLowerCase();if(t)return t;const n=((r=e.name.split(".").pop())==null?void 0:r.toLowerCase())??"";return Xe[n]??""}function et(e){return e.startsWith("image/")}function tt(e){if(et(e.mediaType)){if(e.url)try{const t=new URL(e.url);if(t.protocol==="http:"||t.protocol==="https:")return e.url}catch{}if(e.data)return`data:${e.mediaType};base64,${e.data}`}}function nt(e,t,n){const r=[],s=[];let o=Math.max(0,n.maxCount-t);for(const i of e){const u=Pe(i);!u||!n.allowedTypes.includes(u)?s.push({file:i,reason:"type"}):i.size>n.maxSizeBytes||i.size===0?s.push({file:i,reason:"size"}):o<=0?s.push({file:i,reason:"count"}):(r.push(i),o-=1)}return{accepted:r,rejected:s}}function rt(e){return new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error??new Error("Failed to read file")),r.onload=()=>{const s=String(r.result??""),o=s.indexOf(",");t(o>=0?s.slice(o+1):s)},r.readAsDataURL(e)})}let je=0;function st(){return je+=1,`att-${Date.now().toString(36)}-${je}`}async function at(e){const t=await rt(e);return{id:st(),name:e.name||"attachment",mediaType:Pe(e),size:e.size,data:t}}function ot(e){return e.map(t=>{var n;return(n=t.attachments)!=null&&n.some(r=>r.data)?{...t,attachments:t.attachments.map(r=>{if(!r.data)return r;const s={...r};return delete s.data,s})}:t})}function it(e,t){if(!t||t.length===0)return e;const n=new Map(t.map(r=>[r.id,r]));return e.map(r=>{var s;return(s=r.attachments)!=null&&s.some(o=>n.has(o.id))?{...r,attachments:r.attachments.map(o=>{const i=n.get(o.id);if(!i)return o;const u={...o,key:i.key,url:i.url,expiresAt:i.expiresAt};return delete u.data,u})}:r})}const ct=200,ut="claudius:messages";function lt(e,t){let n;try{n=new URL(t).host}catch{n=t}return`${e}:${n}`}function me(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function dt(e){const t=me();if(!t)return[];try{const n=t.getItem(e);if(!n)return[];const r=JSON.parse(n);return Array.isArray(r)?r:[]}catch{return[]}}function ft({apiUrl:e,persistMessages:t=!0,storageKeyPrefix:n=ut,timeoutMs:r,translations:s,plugins:o,streaming:i=!0}){const u=c.useMemo(()=>new Ie(e,{debounceMs:0,timeoutMs:r}),[e,r]),d=lt(n,e),l=t?dt(d):[],[p,R]=c.useState(l),[A,g]=c.useState(!1),[f,m]=c.useState(!1),[v,M]=c.useState(null),[C,E]=c.useState(null),[x,T]=c.useState(!1),k=c.useRef(l.length),I=c.useRef(!1),b=c.useRef(l),$=c.useRef(null),_=c.useRef(o??[]);_.current=o??[];const O=c.useCallback(y=>{if(!t)return;const B=me();if(B)try{const N=ot(y.slice(-ct));B.setItem(d,JSON.stringify(N))}catch{}},[t,d]),P=()=>(k.current+=1,`msg-${k.current}`),q=c.useCallback((y,B)=>{if(!s)return B??"Something went wrong. Please try again.";switch(y){case"TIMEOUT":return s.errorTimeout;case"NETWORK_ERROR":return s.errorConnection;case"RATE_LIMITED":return B!=null&&B.includes("minute")?s.errorRateLimitMinute:s.errorRateLimitHour;case"ATTACHMENT_QUOTA_EXCEEDED":return s.errorAttachmentQuota;case"ATTACHMENTS_DISABLED":case"ATTACHMENT_INVALID":case"ATTACHMENT_TOO_LARGE":return s.errorAttachmentRejected;case"VALIDATION_ERROR":case"CONFIG_ERROR":case"SERVICE_ERROR":case"UNKNOWN_ERROR":default:return B??s.errorGeneric}},[s]),ee=c.useCallback(y=>!(y instanceof U)||y.code==="TIMEOUT"||y.code==="NETWORK_ERROR"||y.code==="RATE_LIMITED"||y.code==="SERVICE_ERROR"||y.code==="UNKNOWN_ERROR"||y.status>=500||y.status===0,[]),Y=c.useCallback(async y=>{var J,K;g(!0),I.current=!0,E(null),T(!1);const B=i&&typeof u.streamMessage=="function";let N=null;const V=j=>{if(N===null){N=P(),M(N);const L=[...b.current,{id:N,role:"assistant",content:"",...j}];b.current=L,R(L)}else{const L=N,D=b.current.map(W=>W.id===L?{...W,...j}:W);b.current=D,R(D)}},H=()=>{if(N===null)return;const j=N,L=b.current.filter(D=>D.id!==j);b.current=L,R(L)};try{let j,L,D,W,G=!1;if(B){const S=new AbortController;$.current=S,m(!0);const z=await u.streamMessage(y,{signal:S.signal,onChunk:(se,F)=>V({content:F}),onToolUse:(se,F)=>V({toolUses:[...F]})});j=z.reply,L=z.sources,D=z.toolUses,W=z.attachments,G=z.aborted??!1}else{const S=await u.sendMessage(y);j=S.reply,L=S.sources,D=S.toolUses,W=S.attachments}if(G&&!j){H();return}let X={id:N??P(),role:"assistant",content:j,sources:L,toolUses:D};_.current.length>0&&!G&&(X=await Qe(_.current,X,{messages:y,apiUrl:e}));const re=N!==null?b.current.map(S=>S.id===X.id?X:S):[...y,X],h=it(re,W);b.current=h,R(h),O(h)}catch(j){if(j instanceof de)return;if(j instanceof U&&((J=j.code)!=null&&J.startsWith("ATTACHMENT"))&&y.length>0){const L=y[y.length-1];if(L.role==="user"&&((K=L.attachments)!=null&&K.length)){const D=y.slice(0,-1);b.current=D,R(D),O(D)}}if(N!==null){O(b.current),j instanceof U?E(q(j.code,j.message)):E((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),T(!1);return}if(_.current.length>0){const L=j instanceof Error?j:new Error(String(j)),D=await Ze(_.current,L,{messages:y,apiUrl:e});if(D){const W={id:P(),role:"assistant",content:D.content,sources:D.sources},G=[...y,W];b.current=G,R(G),O(G),E(null),T(!1);return}}j instanceof U?E(q(j.code,j.message)):E((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),T(ee(j))}finally{g(!1),I.current=!1,m(!1),M(null),$.current=null}},[e,u,q,ee,O,i,s]),Z=c.useCallback(()=>{var y;(y=$.current)==null||y.abort()},[]),w=c.useCallback(async(y,B)=>{const N=y.trim(),V=(B==null?void 0:B.filter(j=>j&&j.id))??[];if(!N&&V.length===0||I.current)return;const H={id:P(),role:"user",content:N,...V.length>0?{attachments:V}:{}};let J=H;if(_.current.length>0){const j=await Ye(_.current,H,{messages:b.current,apiUrl:e});if(j.type==="abort")return;if(j.type==="respond"){const L={id:P(),role:"assistant",content:j.reply.content,sources:j.reply.sources},D=[...b.current,j.message,L];b.current=D,R(D),O(D),E(null),T(!1);return}J=j.message}const K=[...b.current,J];b.current=K,R(K),O(K),await Y(K)},[e,O,Y]),Q=c.useCallback(async()=>{if(I.current)return;const y=b.current[b.current.length-1];!y||y.role!=="user"||await Y(b.current)},[Y]),ne=c.useCallback(()=>{if(b.current=[],R([]),E(null),T(!1),t){const y=me();if(!y)return;try{y.removeItem(d)}catch{}}},[t,d]);return{messages:p,isLoading:A,isStreaming:f,streamingMessageId:v,error:C,canRetry:x,sendMessage:w,stop:Z,retry:Q,clearMessages:ne}}function ht(e){const[t,n]=c.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return c.useEffect(()=>{const r=window.matchMedia(e);n(r.matches);const s=o=>n(o.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}function ue(e,t){return e instanceof RegExp?e.test(t):t.toLowerCase().includes(e.toLowerCase())}function mt(){const e=document.documentElement,t=document.body,n=e.scrollTop||t.scrollTop||0,r=Math.max(e.scrollHeight,t.scrollHeight),s=e.clientHeight||window.innerHeight,o=r-s;return o<=0?100:n/o*100}function pt({triggers:e,enabled:t,onOpen:n,onGreeting:r}){c.useEffect(()=>{if(!t||!e||e.length===0)return;const s=new Set,o=[],i=typeof window<"u"?window.location.href:"",u=(d,l)=>{s.has(d)||(s.add(d),l==="open"?n():r(l.greeting))};return e.forEach((d,l)=>{switch(d.on){case"url":{ue(d.pattern,i)&&u(l,d.action);break}case"time":{if(d.matchUrl&&!ue(d.matchUrl,i))return;const p=window.setTimeout(()=>u(l,d.action),Math.max(0,d.seconds*1e3));o.push(()=>window.clearTimeout(p));break}case"scroll":{if(d.matchUrl&&!ue(d.matchUrl,i))return;const p=()=>{mt()>=d.percent&&u(l,d.action)};p(),window.addEventListener("scroll",p,{passive:!0}),o.push(()=>window.removeEventListener("scroll",p));break}case"exit-intent":{if(d.matchUrl&&!ue(d.matchUrl,i))return;const p=R=>{R.clientY<=0&&u(l,d.action)};document.addEventListener("mouseleave",p),o.push(()=>document.removeEventListener("mouseleave",p));break}}}),()=>{o.forEach(d=>d())}},[e,t,n,r])}const gt={"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","top-right":"top-6 right-6","top-left":"top-6 left-6"},xt=c.forwardRef(function({isOpen:t,onClick:n,position:r="bottom-right",translations:s},o){const i=t?(s==null?void 0:s.closeChat)??"Close chat":(s==null?void 0:s.openChat)??"Open chat";return a.jsx("button",{ref:o,onClick:n,"aria-label":i,className:`fixed ${gt[r]} z-50 flex h-14 w-14 items-center justify-center rounded-claudius-full bg-claudius-accent text-claudius-accent-text shadow-claudius-floating transition-transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-claudius-accent focus:ring-offset-2`,children:t?a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})}),bt=c.memo(function({count:t,isActive:n,onClick:r}){return a.jsxs("button",{onClick:r,"aria-label":"View sources",title:"View sources",className:`group relative flex h-7 w-7 items-center justify-center rounded-claudius-full transition-colors ${n?"bg-claudius-accent text-claudius-accent-text":"text-claudius-text-muted hover:bg-claudius-surface-muted hover:text-claudius-text"}`,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),a.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-claudius-full bg-claudius-accent px-1 text-[10px] font-bold text-claudius-accent-text",children:t})]})}),yt=["http:","https:"];function ge(e){if(!e||typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(t);return yt.includes(n.protocol)?t:null}catch{return null}}function vt(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Re({label:e,onClick:t}){return a.jsx("button",{type:"button",onClick:t,"aria-label":e,className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-claudius-full bg-claudius-text text-claudius-surface shadow-claudius-floating hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-accent",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}const Be=c.memo(function({attachment:t,variant:n,onRemove:r,removeLabel:s}){const o=tt(t),i=n==="composer",u=`${t.name} (${he(t.size)})`,d=t.url?ge(t.url):null;if(o){const p=a.jsx("img",{src:o,alt:t.name,title:u,loading:"lazy",className:i?"h-12 w-12 rounded-claudius-sm border border-claudius-border object-cover":"max-h-48 max-w-full rounded-claudius-sm object-contain"});return a.jsxs("div",{className:"relative inline-block",children:[!i&&d?a.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:[p,a.jsxs("span",{className:"sr-only",children:[u," (opens in a new tab)"]})]}):p,r&&s&&a.jsx(Re,{label:s,onClick:r})]})}const l=a.jsxs("span",{title:u,className:`inline-flex max-w-[220px] items-center gap-1.5 rounded-claudius-sm border px-2 py-1 text-xs ${i?"border-claudius-border bg-claudius-field text-claudius-text":"border-current/30 bg-transparent"}`,children:[a.jsx(vt,{}),a.jsx("span",{className:"truncate",children:t.name}),a.jsx("span",{className:"shrink-0 opacity-70",children:he(t.size)})]});return a.jsxs("div",{className:"relative inline-block",children:[!i&&d?a.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline",children:[l,a.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]}):l,r&&s&&a.jsx(Re,{label:s,onClick:r})]})});function le({label:e,onClick:t,children:n}){return a.jsx("button",{type:"button",onClick:t,"aria-label":e,title:e,className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n})})}function wt({state:e,labels:t,onPlay:n,onPause:r,onResume:s,onStop:o}){return e==="idle"?a.jsxs(le,{label:t.play,onClick:n,children:[a.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),a.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",fill:"none"}),a.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",fill:"none"})]}):a.jsxs("div",{className:"flex items-center gap-1",children:[e==="paused"?a.jsx(le,{label:t.resume,onClick:s,children:a.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}):a.jsxs(le,{label:t.pause,onClick:r,children:[a.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),a.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}),a.jsx(le,{label:t.stop,onClick:o,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})]})}function jt(e){const t=e.lastIndexOf(`
|
|
6
|
-
`),n=t===-1?"":e.slice(0,t+1);let r=t===-1?e:e.slice(t+1);return r=
|
|
7
|
-
`);return t.map((n,r)=>a.jsxs("span",{children:[
|
|
8
|
-
`||(s==="."||s==="!"||s==="?")&&(r+1===e.length||/\s/.test(e[r+1])))&&(t.push(e.slice(n,r+1)),n=r+1)}return n<e.length&&t.push(e.slice(n)),t}function Ut(e,t=200){const n=[];let r="";const s=()=>{const o=r.trim();o&&n.push(o),r=""};for(const o of zt(e)){if((r+o).trim().length<=t){r+=o;continue}if(s(),o.trim().length<=t){r=o;continue}for(const i of o.trim().split(/\s+/))r&&`${r} ${i}`.length>t&&s(),r=r?`${r} ${i}`:i}return s(),n}function Ae(){if(typeof window>"u")return;const e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function $t(e){switch(e){case"not-allowed":case"service-not-allowed":return"permission";case"no-speech":return"no-speech";case"audio-capture":return"no-microphone";default:return"unavailable"}}function Ft(e){const[t]=c.useState(()=>Ae()!==void 0),[n,r]=c.useState(!1),[s,o]=c.useState(!1),i=c.useRef(null),u=c.useRef(!1),d=c.useRef(e);c.useEffect(()=>{d.current=e});const l=c.useCallback(g=>{g.onstart=null,g.onend=null,g.onerror=null,g.onresult=null,g.onspeechstart=null,g.onspeechend=null,i.current===g&&(i.current=null),r(!1),o(!1)},[]),p=c.useCallback(()=>{const g=i.current;g&&(l(g),g.abort())},[l]),R=c.useCallback(()=>{const g=i.current;if(g){if(!u.current){p();return}g.stop()}},[p]),A=c.useCallback(()=>{var M,C;const g=Ae();if(!g||i.current)return;const f=new g;f.lang=d.current.lang,f.interimResults=!0,f.continuous=!1;let m="",v=!1;f.onstart=()=>{u.current=!0},f.onspeechstart=()=>o(!0),f.onspeechend=()=>o(!1),f.onresult=E=>{var k,I;let x="",T="";for(let b=0;b<E.results.length;b++){const $=E.results[b];$.isFinal?x+=$[0].transcript:T+=$[0].transcript}m=x,o(!0),(I=(k=d.current).onTranscript)==null||I.call(k,x+T)},f.onerror=E=>{var x,T;E.error!=="aborted"&&(v=!0,(T=(x=d.current).onError)==null||T.call(x,$t(E.error)))},f.onend=()=>{var E,x;l(f),v||(x=(E=d.current).onEnd)==null||x.call(E,m)},i.current=f,u.current=!1,r(!0);try{f.start()}catch{l(f),(C=(M=d.current).onError)==null||C.call(M,"unavailable")}},[l]);return c.useEffect(()=>p,[p]),{isSupported:t,isListening:n,isSpeechDetected:s,start:A,stop:R,abort:p}}const ae=2e3,Wt=1800;function Me(e){var n;const t=(n=e.dataTransfer)==null?void 0:n.types;return!!t&&Array.from(t).includes("Files")}function Gt({onSend:e,isLoading:t,isStreaming:n=!1,onStop:r,placeholder:s,translations:o,attachments:i=null,voice:u=null,onVoiceStart:d}){const l=o??xe,[p,R]=c.useState(""),[A,g]=c.useState([]),[f,m]=c.useState(null),[v,M]=c.useState(!1),[C,E]=c.useState(null),x=c.useRef(null),T=c.useRef(null),k=c.useRef([]),I=c.useRef(0),b=c.useRef(""),$=c.useRef(""),_=h=>{b.current=h,R(h)},O=p.length,P=O>=Wt,q=O>=ae,ee=s??l.placeholder,Y=!!i&&A.length<i.maxCount,Z=n&&!!r;c.useEffect(()=>{var h;t||(h=x.current)==null||h.focus()},[t]);const w=c.useCallback((h,S)=>{if(!i)return"";switch(S){case"size":return fe(l.attachmentTooLarge,{name:h,max:he(i.maxSizeBytes)});case"type":return fe(l.attachmentTypeNotAllowed,{name:h});case"count":return fe(l.attachmentTooMany,{max:i.maxCount})}},[i,l]),Q=c.useCallback(async h=>{if(!i||h.length===0)return;const{accepted:S,rejected:z}=nt(h,k.current.length,i);if(m(z.length>0?w(z[0].file.name,z[0].reason):null),S.length===0)return;const se=await Promise.all(S.map(at));k.current=[...k.current,...se],g(k.current)},[i,w]),ne=c.useCallback(h=>{k.current=k.current.filter(S=>S.id!==h),g(k.current),m(null)},[]),y=()=>{const h=b.current.trim(),S=k.current;!h&&S.length===0||b.current.length>=ae||(S.length>0?e(h,S):e(h),_(""),k.current=[],g([]),m(null))},B=h=>{switch(h){case"permission":return l.voicePermissionDenied;case"no-speech":return l.voiceNoSpeech;case"no-microphone":return l.voiceNoMicrophone;case"unavailable":return l.voiceUnavailable}},N=Ft({lang:(u==null?void 0:u.lang)??"en-US",onTranscript:h=>_(Ht($.current,h,ae)),onEnd:h=>{u!=null&&u.autoSubmit&&h.trim()&&y()},onError:h=>E(B(h))}),V=!!(u!=null&&u.input)&&N.isSupported,H=N.isListening;c.useEffect(()=>{const h=x.current;H&&h&&(h.scrollLeft=h.scrollWidth)},[H,p]);const J=()=>{E(null),$.current=b.current,d==null||d(),N.start()},K=h=>{h.preventDefault(),N.abort(),y()},j=h=>{const S=h.target.value;S.length<=ae&&(N.abort(),E(null),_(S))},L=h=>{const S=Array.from(h.target.files??[]);h.target.value="",Q(S)},D=h=>{var z;if(!i)return;const S=Array.from(((z=h.clipboardData)==null?void 0:z.files)??[]);S.length!==0&&(h.preventDefault(),Q(S))},W=h=>{!i||!Me(h)||(h.preventDefault(),I.current+=1,M(!0))},G=h=>{!i||!Me(h)||h.preventDefault()},X=()=>{i&&(I.current=Math.max(0,I.current-1),I.current===0&&M(!1))},re=h=>{var S;i&&(h.preventDefault(),I.current=0,M(!1),Q(Array.from(((S=h.dataTransfer)==null?void 0:S.files)??[])))};return a.jsxs("form",{onSubmit:K,onDragEnter:W,onDragOver:G,onDragLeave:X,onDrop:re,"data-drag-over":v||void 0,className:`relative border-t border-claudius-border bg-claudius-surface p-3 ${v?"ring-2 ring-inset ring-claudius-accent":""}`,children:[v&&a.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-claudius-surface text-sm font-medium text-claudius-accent",children:l.dropFilesHint}),i&&A.length>0&&a.jsx("ul",{"aria-label":l.attachmentsLabel,className:"mb-2 flex flex-wrap gap-3 pt-1",children:A.map(h=>a.jsx("li",{children:a.jsx(Be,{attachment:h,variant:"composer",onRemove:()=>ne(h.id),removeLabel:`${l.removeAttachment}: ${h.name}`})},h.id))}),a.jsxs("div",{className:"flex gap-2",children:[i&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:T,type:"file",multiple:!0,hidden:!0,tabIndex:-1,accept:i.allowedTypes.join(","),onChange:L,"aria-label":l.attachFile}),a.jsx("button",{type:"button",onClick:()=>{var h;return(h=T.current)==null?void 0:h.click()},disabled:t||!Y,"aria-label":l.attachFile,title:l.attachFile,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm border border-claudius-border bg-claudius-field text-claudius-text-muted transition-colors hover:text-claudius-text focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),a.jsxs("div",{className:"relative min-w-0 flex-1",children:[a.jsx("input",{ref:x,type:"text",value:p,onChange:j,onPaste:D,placeholder:H?l.voiceListening:ee,disabled:t,"aria-label":l.typeYourMessage,"aria-describedby":P?"char-count":void 0,className:`h-full w-full rounded-claudius-sm border border-claudius-border bg-claudius-field py-2 pl-3 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50 ${H?"pr-10":"pr-3"}`}),H&&a.jsx(It,{active:N.isSpeechDetected})]}),V&&u&&a.jsx(Dt,{mode:u.mode,isListening:H,disabled:t,onStart:J,onStop:N.stop,label:u.mode==="hold"?l.voiceInputHold:l.voiceInput}),Z?a.jsx("button",{type:"button",onClick:r,"aria-label":l.stopGenerating,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})}):a.jsx("button",{type:"submit",disabled:t||q,"aria-label":l.sendMessage,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(f??C)&&a.jsx("div",{role:"alert",className:"mt-1 text-xs text-claudius-error",children:f??C}),P&&a.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${q?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[O,"/",ae]})]})}const Vt=["blog","page","external"],Kt={blog:"Blog",page:"Page",external:"External"};function qt(e){try{return new URL(e).hostname}catch{return e}}const Yt=c.memo(function({sources:t,onClose:n}){const r=Vt.map(o=>({type:o,label:Kt[o],items:t.filter(i=>i.type===o)})).filter(o=>o.items.length>0),s=t.length===1?"1 source found":`${t.length} sources found`;return a.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),a.jsx("p",{className:"text-xs text-claudius-text-muted",children:s})]}),a.jsx("button",{onClick:n,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:r.map(o=>a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:o.label}),a.jsx("div",{className:"space-y-2",children:o.items.map(i=>{const u=ge(i.url);return u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[a.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:i.title}),a.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:qt(u)})]},u):null})})]},o.type))})]})});function Qt({title:e,subtitle:t,titleId:n,closeLabel:r,onClose:s}){return a.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[a.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:e.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{id:n,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:e}),a.jsx("p",{className:"text-xs text-claudius-accent-text",children:t})]}),a.jsx("button",{onClick:s,"aria-label":r,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function Zt({message:e,retryLabel:t,onRetry:n}){return a.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[a.jsx("span",{children:e}),n&&a.jsx("button",{type:"button",onClick:n,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:t})]})}function Jt({label:e}){return a.jsx("div",{role:"status","aria-live":"polite","aria-label":e,className:"mr-auto flex max-w-[85%]",children:a.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function Xt(e,t,n){const[r,s]=c.useState(0),o=c.useRef(0),i=c.useRef(0),u=c.useRef(0),d=c.useRef(!1);return c.useEffect(()=>{const l=e.current;if(!n||!l)return;const p=g=>{if(l.scrollTop>0){d.current=!1;return}d.current=!0,i.current=g.touches[0].clientY,u.current=Date.now()},R=g=>{if(!d.current)return;let f=g.touches[0].clientY-i.current;f<0&&(f=f*.3),o.current=f,s(f)},A=()=>{if(!d.current)return;d.current=!1;const g=o.current,f=(Date.now()-u.current)/1e3,m=l.getBoundingClientRect().height,v=f>.05&&g>0&&g/f>500,M=g>m*.3;v||M?t():(o.current=0,s(0))};return l.addEventListener("touchstart",p,{passive:!0}),l.addEventListener("touchmove",R,{passive:!0}),l.addEventListener("touchend",A),()=>{l.removeEventListener("touchstart",p),l.removeEventListener("touchmove",R),l.removeEventListener("touchend",A)}},[e,t,n]),{offsetY:r}}const en='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function tn(e,t){c.useEffect(()=>{const n=e.current;if(!n)return;const r=s=>{if(s.key!=="Tab")return;const o=Array.from(n.querySelectorAll(en)).filter(l=>!l.hasAttribute("aria-hidden"));if(o.length===0)return;const i=o[0],u=o[o.length-1],d=document.activeElement;s.shiftKey&&d===i?(s.preventDefault(),u.focus()):!s.shiftKey&&d===u&&(s.preventDefault(),i.focus())};return n.addEventListener("keydown",r),()=>n.removeEventListener("keydown",r)},[e,t])}function oe(){if(!(typeof window>"u")&&!(typeof window.SpeechSynthesisUtterance>"u"))return window.speechSynthesis??void 0}function nn(e){const[t]=c.useState(()=>oe()!==void 0),[n,r]=c.useState(null),[s,o]=c.useState(!1),i=c.useRef(0),u=c.useRef(!1),d=c.useRef([]),l=c.useCallback(()=>{i.current+=1,u.current=!1,d.current=[],r(null),o(!1)},[]),p=c.useCallback(()=>{var f;l(),(f=oe())==null||f.cancel()},[l]),R=c.useCallback((f,m)=>{const v=oe();if(!v)return;l(),(v.speaking||v.pending)&&v.cancel();const M=Ut(m);if(M.length===0)return;const C=i.current,E=()=>i.current===C;d.current=M.map((x,T)=>{const k=new SpeechSynthesisUtterance(x);return k.lang=e,k.onerror=()=>{E()&&p()},k.onend=()=>{E()&&(u.current&&!v.paused?p():T===M.length-1&&l())},k}),r(f);for(const x of d.current)v.speak(x)},[e,p,l]),A=c.useCallback(()=>{const f=oe();f&&(u.current=!0,f.pause(),o(f.paused))},[]),g=c.useCallback(()=>{const f=oe();f&&(u.current=!1,f.resume(),o(!1))},[]);return c.useEffect(()=>p,[p]),{isSupported:t,activeId:n,isPaused:s,speak:R,pause:A,resume:g,cancel:p}}const rn=/\*\*([^*]+)\*\*/g,sn=/\*([^*]+)\*/g,an=/https?:\/\/[^\s)]+/g;function Ne(e){return e.replace(rn,"$1").replace(sn,"$1").replace(an,t=>{try{return new URL(t).hostname}catch{return t}})}const on={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function cn({messages:e,isLoading:t,isStreaming:n=!1,streamingMessageId:r=null,error:s,canRetry:o=!1,onSend:i,onStop:u,onRetry:d,onClose:l,title:p="Chat",subtitle:R="Ask me anything",welcomeMessage:A="Hi! How can I help you today?",placeholder:g,position:f="bottom-right",translations:m,isMobile:v=!1,attachments:M=null,voice:C=null}){const E=c.useId(),x=c.useRef(null),T=c.useRef(null),[k,I]=c.useState(null);tn(x,!0);const b=nn((C==null?void 0:C.lang)??"en-US"),$=!!(C!=null&&C.output)&&b.isSupported,_={play:(m==null?void 0:m.readAloud)??"Read aloud",pause:(m==null?void 0:m.pauseReading)??"Pause reading",resume:(m==null?void 0:m.resumeReading)??"Resume reading",stop:(m==null?void 0:m.stopReading)??"Stop reading"},{offsetY:O}=Xt(T,l,v),P=O!==0,q=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;c.useEffect(()=>{const w=T.current;w&&(w.scrollTop=w.scrollHeight)},[e,t]),c.useEffect(()=>{const w=Q=>{Q.key==="Escape"&&!Q.isComposing&&l()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[l]);const ee=(m==null?void 0:m.closeChat)??"Close chat",Y=(m==null?void 0:m.chatMessages)??"Chat messages",Z=[...e].reverse().find(w=>w.role==="assistant");return a.jsxs("div",{ref:x,role:"dialog","aria-modal":v?"true":void 0,"aria-labelledby":E,className:v?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${on[f]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:v&&!q?{transform:`translateY(${Math.max(0,O)}px)`}:void 0,"data-dragging":P||void 0,children:[v&&a.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:a.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),a.jsx(Qt,{title:p,subtitle:R,titleId:E,closeLabel:ee,onClose:l}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[k&&a.jsx(Yt,{sources:k.sources,onClose:()=>I(null)}),a.jsxs("div",{ref:T,role:"log","aria-label":Y,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[e.length===0&&!s&&a.jsx("div",{className:"mr-auto flex max-w-[85%]",children:a.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:A})}),e.map(w=>a.jsx(Nt,{role:w.role,content:w.content,isStreaming:w.id===r,sources:w.sources,attachments:w.attachments,toolUses:w.toolUses,toolUsedLabel:m==null?void 0:m.toolUsed,toolDetailsLabel:m==null?void 0:m.toolDetails,isSourceActive:(k==null?void 0:k.messageId)===w.id,onSourceClick:()=>{(k==null?void 0:k.messageId)===w.id?I(null):w.sources&&w.sources.length>0&&I({messageId:w.id,sources:w.sources})},speech:$&&w.role==="assistant"&&w.id!==r&&w.content.trim()!==""?{state:b.activeId!==w.id?"idle":b.isPaused?"paused":"speaking",labels:_,onPlay:()=>b.speak(w.id,Ne(w.content)),onPause:b.pause,onResume:b.resume,onStop:b.cancel}:void 0},w.id)),t&&!(r!==null&&e.some(w=>w.id===r&&w.content.length>0))&&a.jsx(Jt,{label:(m==null?void 0:m.typingIndicator)??"Assistant is typing"}),s&&a.jsx(Zt,{message:s,retryLabel:(m==null?void 0:m.errorRetry)??"Retry",onRetry:o&&d&&!t?d:void 0})]})]}),a.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Z&&Z.id!==r?Ne(Z.content):""}),a.jsx(Gt,{onSend:i,isLoading:t,isStreaming:n,onStop:u,placeholder:g,translations:m,attachments:M,voice:C,onVoiceStart:b.cancel})]})}function un({message:e,position:t,onOpen:n,onDismiss:r,dismissLabel:s}){const o=t.startsWith("bottom"),i=t.endsWith("right"),u=["claudius-greeting-bubble","fixed z-40 max-w-xs",o?"bottom-20":"top-20",i?"right-4":"left-4"].join(" ");return a.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[a.jsx("button",{type:"button",onClick:n,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:e}),a.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r()},"aria-label":s,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:a.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const ln={title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",stopGenerating:"Detener la respuesta",toolUsed:"Herramienta usada:",toolDetails:"Detalles de la herramienta",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",attachFile:"Adjuntar un archivo",removeAttachment:"Quitar adjunto",attachmentsLabel:"Adjuntos",dropFilesHint:"Suelta los archivos para adjuntarlos",attachmentTooLarge:"{name} es demasiado grande. El tamaño máximo es {max}.",attachmentTypeNotAllowed:"{name} no es un tipo de archivo compatible.",attachmentTooMany:"Puedes adjuntar hasta {max} archivos por mensaje.",voiceInput:"Entrada de voz",voiceInputHold:"Mantén pulsado para hablar",voiceListening:"Escuchando...",voicePermissionDenied:"El acceso al micrófono está bloqueado. Permítelo en la configuración de tu navegador para usar la entrada de voz.",voiceNoSpeech:"No se detectó ninguna voz. Inténtalo de nuevo.",voiceNoMicrophone:"No se encontró ningún micrófono.",voiceUnavailable:"La entrada de voz no está disponible en este momento.",readAloud:"Leer en voz alta",pauseReading:"Pausar la lectura",resumeReading:"Reanudar la lectura",stopReading:"Detener la lectura",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorAttachmentRejected:"Se rechazó un adjunto. Quítalo e inténtalo de nuevo.",errorAttachmentQuota:"Límite de subida alcanzado. Inténtalo más tarde.",errorRetry:"Reintentar"},dn={title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",stopGenerating:"Arrêter la génération",toolUsed:"Outil utilisé :",toolDetails:"Détails de l'outil",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",attachFile:"Joindre un fichier",removeAttachment:"Retirer la pièce jointe",attachmentsLabel:"Pièces jointes",dropFilesHint:"Déposez les fichiers pour les joindre",attachmentTooLarge:"{name} est trop volumineux. La taille maximale est de {max}.",attachmentTypeNotAllowed:"{name} n'est pas un type de fichier pris en charge.",attachmentTooMany:"Vous pouvez joindre jusqu'à {max} fichiers par message.",voiceInput:"Saisie vocale",voiceInputHold:"Maintenez pour parler",voiceListening:"Écoute en cours...",voicePermissionDenied:"L'accès au microphone est bloqué. Autorisez-le dans les paramètres de votre navigateur pour utiliser la saisie vocale.",voiceNoSpeech:"Aucune voix n'a été détectée. Veuillez réessayer.",voiceNoMicrophone:"Aucun microphone n'a été trouvé.",voiceUnavailable:"La saisie vocale n'est pas disponible pour le moment.",readAloud:"Lire à voix haute",pauseReading:"Mettre la lecture en pause",resumeReading:"Reprendre la lecture",stopReading:"Arrêter la lecture",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorAttachmentRejected:"Une pièce jointe a été refusée. Retirez-la et réessayez.",errorAttachmentQuota:"Limite d'envoi atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},fn={title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",stopGenerating:"Generierung stoppen",toolUsed:"Verwendetes Tool:",toolDetails:"Tool-Details",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",attachFile:"Datei anhängen",removeAttachment:"Anhang entfernen",attachmentsLabel:"Anhänge",dropFilesHint:"Dateien hier ablegen, um sie anzuhängen",attachmentTooLarge:"{name} ist zu groß. Die maximale Größe beträgt {max}.",attachmentTypeNotAllowed:"{name} ist kein unterstützter Dateityp.",attachmentTooMany:"Sie können bis zu {max} Dateien pro Nachricht anhängen.",voiceInput:"Spracheingabe",voiceInputHold:"Zum Sprechen gedrückt halten",voiceListening:"Ich höre zu...",voicePermissionDenied:"Der Zugriff auf das Mikrofon ist blockiert. Erlauben Sie ihn in den Einstellungen Ihres Browsers, um die Spracheingabe zu nutzen.",voiceNoSpeech:"Es wurde keine Sprache erkannt. Bitte versuchen Sie es erneut.",voiceNoMicrophone:"Es wurde kein Mikrofon gefunden.",voiceUnavailable:"Die Spracheingabe ist momentan nicht verfügbar.",readAloud:"Vorlesen",pauseReading:"Vorlesen pausieren",resumeReading:"Vorlesen fortsetzen",stopReading:"Vorlesen beenden",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorAttachmentRejected:"Ein Anhang wurde abgelehnt. Bitte entfernen Sie ihn und versuchen Sie es erneut.",errorAttachmentQuota:"Upload-Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"},be={en:_e,es:ln,fr:dn,de:fn};function Le(e){if(!e)return;const t=e.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(be,t)?t:void 0}function ye(){const e=typeof document<"u"?Le(document.documentElement.lang):void 0;if(e)return e;const t=typeof navigator<"u"?Le(navigator.language):void 0;return t||"en"}function He(e={}){const{locale:t,translations:n}=e,r=be[t??ye()];return n?{...r,...n}:{...r}}const De=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],hn=["sm","md","lg","full","tail"],mn=["elevated","floating","floatingHover"],pn=["heading","body"],ve={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function gn(e){return Object.prototype.hasOwnProperty.call(ve,e)}const xn=new Set(["light","dark","auto"]);function bn(e){if(e===void 0)return{mode:"light"};if(typeof e=="string"){if(xn.has(e))return{mode:e};if(gn(e)){const t=ve[e];return{mode:t.colorScheme??"light",theme:t}}return{mode:"light",url:e}}return{mode:e.colorScheme??"light",theme:e}}function yn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function vn(e,t){console.warn(`[Claudius] Ignoring unknown theme token "${t}" in "${e}"`)}function ie(e,t,n,r,s,o=""){if(s)for(const[i,u]of Object.entries(s)){if(!r.includes(i)){vn(t,i);continue}typeof u=="string"&&(e[`${n}${yn(i)}${o}`]=u)}}function wn(e){const t={};ie(t,"colors","--cl-color-",De,e.colors);for(const[n,r]of Object.entries({...t}))t[`${n}-dark`]=r;return ie(t,"colorsDark","--cl-color-",De,e.colorsDark,"-dark"),ie(t,"radii","--cl-radius-",hn,e.radii),ie(t,"shadows","--cl-shadow-",mn,e.shadows),ie(t,"fonts","--cl-font-",pn,e.fonts),t}function jn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rn(e){const t=c.useMemo(()=>bn(e),[e]),[n,r]=c.useState(null),s=t.url;c.useEffect(()=>{if(r(null),!s)return;const d=new AbortController;return fetch(s,{signal:d.signal}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{if(!jn(l))throw new Error("theme JSON must be an object");r(l)}).catch(l=>{d.signal.aborted||console.error(`[Claudius] Failed to load theme from ${s}:`,l)}),()=>d.abort()},[s]);const o=t.theme??n??null,i=(n==null?void 0:n.colorScheme)??t.mode,u=c.useMemo(()=>o?wn(o):{},[o]);return{mode:i,cssVars:u}}const ze="claudius:triggers:dismissed";function En(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(ze)==="1"}catch{return!1}}function Sn(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(ze,"1")}catch{}}function Tn({apiUrl:e,title:t,subtitle:n,welcomeMessage:r,placeholder:s,persistMessages:o,storageKeyPrefix:i,requestTimeoutMs:u,theme:d="light",accentColor:l,position:p="bottom-right",locale:R,translations:A,triggers:g,plugins:f,streaming:m=!0,attachments:v=!1,voice:M=!1}){const[C,E]=c.useState(!1),x=c.useMemo(()=>Je(v),[v]),T=c.useMemo(()=>_t(M,R??ye()),[M,R]),[k,I]=c.useState(null),[b,$]=c.useState(En),_=c.useRef(!1),O=ht("(max-width: 639px)"),P=c.useMemo(()=>He({locale:R,translations:A}),[R,A]),{messages:q,isLoading:ee,isStreaming:Y,streamingMessageId:Z,error:w,canRetry:Q,sendMessage:ne,stop:y,retry:B}=ft({apiUrl:e,persistMessages:o,storageKeyPrefix:i,timeoutMs:u,translations:P,plugins:f,streaming:m}),N=c.useRef(null),V=c.useRef(C),{mode:H,cssVars:J}=Rn(d),[K,j]=c.useState(!1);c.useEffect(()=>{if(H!=="auto")return;const F=window.matchMedia("(prefers-color-scheme: dark)");j(F.matches);const we=Fe=>j(Fe.matches);return F.addEventListener("change",we),()=>F.removeEventListener("change",we)},[H]),c.useEffect(()=>{var F;V.current&&!C&&((F=N.current)==null||F.focus()),V.current=C},[C]);const L=c.useCallback(()=>{$(!0),Sn()},[]),D=c.useCallback(()=>{E(!1),_.current&&(_.current=!1,L())},[L]),W=c.useCallback(()=>{E(F=>!F)},[]),G=c.useCallback(()=>{_.current=!0,I(null),E(!0)},[]),X=c.useCallback(F=>{I(F)},[]),re=c.useCallback(()=>{I(null),G()},[G]),h=c.useCallback(()=>{I(null),L()},[L]);pt({triggers:g,enabled:!b&&!C,onOpen:G,onGreeting:X});const S=H==="dark"||H==="auto"&&K,z={...J,...l?{"--cl-color-accent":l,"--cl-color-accent-dark":l}:{}},se=Object.keys(z).length>0?z:void 0;return a.jsx("div",{className:"claudius-root",style:se,children:a.jsxs("div",{"data-claudius-dark":S?"true":"false",children:[C&&O&&a.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:D,"aria-hidden":"true"}),C&&a.jsx(cn,{messages:q,isLoading:ee,isStreaming:Y,streamingMessageId:Z,error:w,canRetry:Q,onSend:ne,onStop:y,onRetry:B,onClose:D,title:t??P.title,subtitle:n??P.subtitle,welcomeMessage:r??P.welcomeMessage,placeholder:s??P.placeholder,position:p,translations:P,isMobile:O,attachments:x,voice:T}),!(C&&O)&&a.jsx(xt,{ref:N,isOpen:C,onClick:W,position:p,translations:P}),!C&&k&&a.jsx(un,{message:k,position:p,onOpen:re,onDismiss:h,dismissLabel:P.dismissGreeting})]})})}function Cn(e){const{onEvent:t,includeContent:n=!0}=e,r=s=>n?s:"";return{name:"analytics",onBeforeSend(s){t({type:"message_sent",role:"user",content:r(s.content),chars:s.content.length})},onAfterReceive(s){t({type:"message_received",role:"assistant",content:r(s.content),chars:s.content.length})},onError(s){t({type:"chat_error",message:s.message,code:s.code})}}}const Ue=[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d[ -]?){13,16}\b/g,/\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g];function $e(e,t,n){return t.reduce((r,s)=>(s.lastIndex=0,r.replace(s,n)),e)}function kn(e={}){const{patterns:t=Ue,replacement:n="[redacted]",redactReplies:r=!1}=e,s=o=>{const i=$e(o.content,t,n);if(i!==o.content)return{...o,content:i}};return{name:"redact-pii",onBeforeSend:s,onAfterReceive:r?s:void 0}}function An(e,t,n){return typeof e=="function"?e(t):e instanceof RegExp?e.test(t):n?t.includes(e):t.toLowerCase().includes(e.toLowerCase())}function Mn(e){const{rules:t,caseSensitive:n=!1}=e;return{name:"canned-responses",onBeforeSend(r,s){for(const o of t)if(An(o.match,r.content,n)){s.respondWith(o.reply);return}}}}exports.ChatApiClient=Ie;exports.ChatApiError=U;exports.ChatWidget=Tn;exports.DEFAULT_ATTACHMENT_OPTIONS=ce;exports.DEFAULT_PII_PATTERNS=Ue;exports.DebounceError=de;exports.builtinThemes=ve;exports.createTranslations=Lt;exports.defaultTranslations=xe;exports.detectLocale=ye;exports.locales=be;exports.pluginAnalytics=Cn;exports.pluginCannedResponses=Mn;exports.pluginRedactPII=kn;exports.redactText=$e;exports.resolveTranslations=He;
|
|
5
|
+
`));return typeof r!="object"||r===null?null:{event:t,data:r}}catch{return null}}function Ke(e){return typeof e=="string"?{content:e}:e}function Te(e,t,n){console.error(`[claudius] plugin "${e.name}" failed in ${t}:`,n)}async function dt(e,t,n){let r=t;for(const s of e){if(!s.onBeforeSend)continue;let o=null;const i={...n,respondWith(l){o={type:"respond",message:r,reply:Ke(l)}},abort(l){o={type:"abort",reason:l}}};try{const l=await s.onBeforeSend(r,i);if(o)return o;l&&(r=l)}catch(l){Te(s,"onBeforeSend",l)}}return{type:"send",message:r}}async function ft(e,t,n){let r=t;for(const s of e)if(s.onAfterReceive)try{const o=await s.onAfterReceive(r,n);o&&(r=o)}catch(o){Te(s,"onAfterReceive",o)}return r}async function ht(e,t,n){for(const r of e){if(!r.onError)continue;let s=null;const o={...n,respondWith(i){s=Ke(i)}};try{if(await r.onError(t,o),s)return s}catch(i){Te(r,"onError",i)}}return null}const ge={maxSizeBytes:5*1024*1024,maxCount:5,allowedTypes:["image/jpeg","image/png","image/gif","image/webp","application/pdf"]};function pt(e){return e?e===!0?ge:{maxSizeBytes:e.maxSizeBytes??ge.maxSizeBytes,maxCount:e.maxCount??ge.maxCount,allowedTypes:(e.allowedTypes??ge.allowedTypes).map(t=>t.trim().toLowerCase()).filter(Boolean)}:null}function je(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;const t=e/1024;if(t<1024)return`${Math.round(t)} KB`;const n=t/1024;return`${Number.isInteger(n)?n:n.toFixed(1)} MB`}const mt={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",pdf:"application/pdf"};function qe(e){var r;const t=(e.type||"").trim().toLowerCase();if(t)return t;const n=((r=e.name.split(".").pop())==null?void 0:r.toLowerCase())??"";return mt[n]??""}function gt(e){return e.startsWith("image/")}function xt(e){if(gt(e.mediaType)){if(e.url)try{const t=new URL(e.url);if(t.protocol==="http:"||t.protocol==="https:")return e.url}catch{}if(e.data)return`data:${e.mediaType};base64,${e.data}`}}function bt(e,t,n){const r=[],s=[];let o=Math.max(0,n.maxCount-t);for(const i of e){const l=qe(i);!l||!n.allowedTypes.includes(l)?s.push({file:i,reason:"type"}):i.size>n.maxSizeBytes||i.size===0?s.push({file:i,reason:"size"}):o<=0?s.push({file:i,reason:"count"}):(r.push(i),o-=1)}return{accepted:r,rejected:s}}function yt(e){return new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error??new Error("Failed to read file")),r.onload=()=>{const s=String(r.result??""),o=s.indexOf(",");t(o>=0?s.slice(o+1):s)},r.readAsDataURL(e)})}let Me=0;function wt(){return Me+=1,`att-${Date.now().toString(36)}-${Me}`}async function vt(e){const t=await yt(e);return{id:wt(),name:e.name||"attachment",mediaType:qe(e),size:e.size,data:t}}function Ye(e){return e.map(t=>{var n;return(n=t.attachments)!=null&&n.some(r=>r.data)?{...t,attachments:t.attachments.map(r=>{if(!r.data)return r;const s={...r};return delete s.data,s})}:t})}function jt(e,t){if(!t||t.length===0)return e;const n=new Map(t.map(r=>[r.id,r]));return e.map(r=>{var s;return(s=r.attachments)!=null&&s.some(o=>n.has(o.id))?{...r,attachments:r.attachments.map(o=>{const i=n.get(o.id);if(!i)return o;const l={...o,key:i.key,url:i.url,expiresAt:i.expiresAt};return delete l.data,l})}:r})}const Rt=200,Et="claudius:messages",fe=()=>new Date().toISOString();function St(e,t){let n;try{n=new URL(t).host}catch{n=t}return`${e}:${n}`}function Se(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function Tt(e){const t=Se();if(!t)return[];try{const n=t.getItem(e);if(!n)return[];const r=JSON.parse(n);return Array.isArray(r)?r:[]}catch{return[]}}function kt({apiUrl:e,persistMessages:t=!0,storageKeyPrefix:n=Et,timeoutMs:r,translations:s,plugins:o,streaming:i=!0}){const l=c.useMemo(()=>new Ve(e,{debounceMs:0,timeoutMs:r}),[e,r]),u=St(n,e),d=t?Tt(u):[],[f,w]=c.useState(d),[S,x]=c.useState(!1),[h,p]=c.useState(!1),[j,b]=c.useState(null),[E,y]=c.useState(null),[v,k]=c.useState(!1),L=c.useRef(d.length),C=c.useRef(!1),R=c.useRef(d),P=c.useRef(null),N=c.useRef(o??[]);N.current=o??[];const $=c.useCallback(m=>{if(!t)return;const I=Se();if(I)try{const O=Ye(m.slice(-Rt));I.setItem(u,JSON.stringify(O))}catch{}},[t,u]),V=()=>(L.current+=1,`msg-${L.current}`),F=c.useCallback((m,I)=>{if(!s)return I??"Something went wrong. Please try again.";switch(m){case"TIMEOUT":return s.errorTimeout;case"NETWORK_ERROR":return s.errorConnection;case"RATE_LIMITED":return I!=null&&I.includes("minute")?s.errorRateLimitMinute:s.errorRateLimitHour;case"ATTACHMENT_QUOTA_EXCEEDED":return s.errorAttachmentQuota;case"ATTACHMENTS_DISABLED":case"ATTACHMENT_INVALID":case"ATTACHMENT_TOO_LARGE":return s.errorAttachmentRejected;case"VALIDATION_ERROR":case"CONFIG_ERROR":case"SERVICE_ERROR":case"UNKNOWN_ERROR":default:return I??s.errorGeneric}},[s]),K=c.useCallback(m=>!(m instanceof G)||m.code==="TIMEOUT"||m.code==="NETWORK_ERROR"||m.code==="RATE_LIMITED"||m.code==="SERVICE_ERROR"||m.code==="UNKNOWN_ERROR"||m.status>=500||m.status===0,[]),U=c.useCallback(async m=>{var Q,_,B;x(!0),C.current=!0,y(null),k(!1);const I=i&&typeof l.streamMessage=="function";let O=null;const Z=T=>{if(O===null){O=V(),b(O);const A=[...R.current,{id:O,role:"assistant",content:"",createdAt:fe(),...T}];R.current=A,w(A)}else{const A=O,M=R.current.map(z=>z.id===A?{...z,...T}:z);R.current=M,w(M)}},J=()=>{if(O===null)return;const T=O,A=R.current.filter(M=>M.id!==T);R.current=A,w(A)};try{let T,A,M,z,q=!1;if(I){const H=new AbortController;P.current=H,p(!0);const ee=await l.streamMessage(m,{signal:H.signal,onChunk:(ie,ae)=>Z({content:ae}),onToolUse:(ie,ae)=>Z({toolUses:[...ae]})});T=ee.reply,A=ee.sources,M=ee.toolUses,z=ee.attachments,q=ee.aborted??!1}else{const H=await l.sendMessage(m);T=H.reply,A=H.sources,M=H.toolUses,z=H.attachments}if(q&&!T){J();return}const se=((Q=R.current.find(H=>H.id===O))==null?void 0:Q.createdAt)??fe();let W={id:O??V(),role:"assistant",content:T,createdAt:se,sources:A,toolUses:M};N.current.length>0&&!q&&(W=await ft(N.current,W,{messages:m,apiUrl:e}),W.createdAt||(W={...W,createdAt:se}));const de=O!==null?R.current.map(H=>H.id===W.id?W:H):[...m,W],oe=jt(de,z);R.current=oe,w(oe),$(oe)}catch(T){if(T instanceof ve)return;if(T instanceof G&&((_=T.code)!=null&&_.startsWith("ATTACHMENT"))&&m.length>0){const A=m[m.length-1];if(A.role==="user"&&((B=A.attachments)!=null&&B.length)){const M=m.slice(0,-1);R.current=M,w(M),$(M)}}if(O!==null){$(R.current),T instanceof G?y(F(T.code,T.message)):y((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),k(!1);return}if(N.current.length>0){const A=T instanceof Error?T:new Error(String(T)),M=await ht(N.current,A,{messages:m,apiUrl:e});if(M){const z={id:V(),role:"assistant",content:M.content,createdAt:fe(),sources:M.sources},q=[...m,z];R.current=q,w(q),$(q),y(null),k(!1);return}}T instanceof G?y(F(T.code,T.message)):y((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),k(K(T))}finally{x(!1),C.current=!1,p(!1),b(null),P.current=null}},[e,l,F,K,$,i,s]),te=c.useCallback(()=>{var m;(m=P.current)==null||m.abort()},[]),ne=c.useCallback(async(m,I)=>{const O=m.trim(),Z=(I==null?void 0:I.filter(B=>B&&B.id))??[];if(!O&&Z.length===0||C.current)return;const J={id:V(),role:"user",content:O,createdAt:fe(),...Z.length>0?{attachments:Z}:{}};let Q=J;if(N.current.length>0){const B=await dt(N.current,J,{messages:R.current,apiUrl:e});if(B.type==="abort")return;const T=A=>A.createdAt?A:{...A,createdAt:J.createdAt};if(B.type==="respond"){const A={id:V(),role:"assistant",content:B.reply.content,createdAt:fe(),sources:B.reply.sources},M=[...R.current,T(B.message),A];R.current=M,w(M),$(M),y(null),k(!1);return}Q=T(B.message)}const _=[...R.current,Q];R.current=_,w(_),$(_),await U(_)},[e,$,U]),re=c.useCallback(async()=>{if(C.current)return;const m=R.current[R.current.length-1];!m||m.role!=="user"||await U(R.current)},[U]),X=c.useCallback(()=>{if(R.current=[],w([]),y(null),k(!1),t){const m=Se();if(!m)return;try{m.removeItem(u)}catch{}}},[t,u]);return{messages:f,isLoading:S,isStreaming:h,streamingMessageId:j,error:E,canRetry:v,sendMessage:ne,stop:te,retry:re,clearMessages:X}}function At(e){const[t,n]=c.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return c.useEffect(()=>{const r=window.matchMedia(e);n(r.matches);const s=o=>n(o.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}function be(e,t){return e instanceof RegExp?e.test(t):t.toLowerCase().includes(e.toLowerCase())}function Ct(){const e=document.documentElement,t=document.body,n=e.scrollTop||t.scrollTop||0,r=Math.max(e.scrollHeight,t.scrollHeight),s=e.clientHeight||window.innerHeight,o=r-s;return o<=0?100:n/o*100}function Mt({triggers:e,enabled:t,onOpen:n,onGreeting:r}){c.useEffect(()=>{if(!t||!e||e.length===0)return;const s=new Set,o=[],i=typeof window<"u"?window.location.href:"",l=(u,d)=>{s.has(u)||(s.add(u),d==="open"?n():r(d.greeting))};return e.forEach((u,d)=>{switch(u.on){case"url":{be(u.pattern,i)&&l(d,u.action);break}case"time":{if(u.matchUrl&&!be(u.matchUrl,i))return;const f=window.setTimeout(()=>l(d,u.action),Math.max(0,u.seconds*1e3));o.push(()=>window.clearTimeout(f));break}case"scroll":{if(u.matchUrl&&!be(u.matchUrl,i))return;const f=()=>{Ct()>=u.percent&&l(d,u.action)};f(),window.addEventListener("scroll",f,{passive:!0}),o.push(()=>window.removeEventListener("scroll",f));break}case"exit-intent":{if(u.matchUrl&&!be(u.matchUrl,i))return;const f=w=>{w.clientY<=0&&l(d,u.action)};document.addEventListener("mouseleave",f),o.push(()=>document.removeEventListener("mouseleave",f));break}}}),()=>{o.forEach(u=>u())}},[e,t,n,r])}const Nt={"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","top-right":"top-6 right-6","top-left":"top-6 left-6"},Dt=c.forwardRef(function({isOpen:t,onClick:n,position:r="bottom-right",translations:s},o){const i=t?(s==null?void 0:s.closeChat)??"Close chat":(s==null?void 0:s.openChat)??"Open chat";return a.jsx("button",{ref:o,onClick:n,"aria-label":i,className:`fixed ${Nt[r]} z-50 flex h-14 w-14 items-center justify-center rounded-claudius-full bg-claudius-accent text-claudius-accent-text shadow-claudius-floating transition-transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-claudius-accent focus:ring-offset-2`,children:t?a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})}),Lt=c.memo(function({count:t,isActive:n,onClick:r}){return a.jsxs("button",{onClick:r,"aria-label":"View sources",title:"View sources",className:`group relative flex h-7 w-7 items-center justify-center rounded-claudius-full transition-colors ${n?"bg-claudius-accent text-claudius-accent-text":"text-claudius-text-muted hover:bg-claudius-surface-muted hover:text-claudius-text"}`,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),a.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-claudius-full bg-claudius-accent px-1 text-[10px] font-bold text-claudius-accent-text",children:t})]})}),It=["http:","https:"];function Re(e){if(!e||typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(t);return It.includes(n.protocol)?t:null}catch{return null}}function Ot(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Ne({label:e,onClick:t}){return a.jsx("button",{type:"button",onClick:t,"aria-label":e,className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-claudius-full bg-claudius-text text-claudius-surface shadow-claudius-floating hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-accent",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}const Ze=c.memo(function({attachment:t,variant:n,onRemove:r,removeLabel:s}){const o=xt(t),i=n==="composer",l=`${t.name} (${je(t.size)})`,u=t.url?Re(t.url):null;if(o){const f=a.jsx("img",{src:o,alt:t.name,title:l,loading:"lazy",className:i?"h-12 w-12 rounded-claudius-sm border border-claudius-border object-cover":"max-h-48 max-w-full rounded-claudius-sm object-contain"});return a.jsxs("div",{className:"relative inline-block",children:[!i&&u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:[f,a.jsxs("span",{className:"sr-only",children:[l," (opens in a new tab)"]})]}):f,r&&s&&a.jsx(Ne,{label:s,onClick:r})]})}const d=a.jsxs("span",{title:l,className:`inline-flex max-w-[220px] items-center gap-1.5 rounded-claudius-sm border px-2 py-1 text-xs ${i?"border-claudius-border bg-claudius-field text-claudius-text":"border-current/30 bg-transparent"}`,children:[a.jsx(Ot,{}),a.jsx("span",{className:"truncate",children:t.name}),a.jsx("span",{className:"shrink-0 opacity-70",children:je(t.size)})]});return a.jsxs("div",{className:"relative inline-block",children:[!i&&u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline",children:[d,a.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]}):d,r&&s&&a.jsx(Ne,{label:s,onClick:r})]})}),De=c.forwardRef(function({label:t,onClick:n,children:r},s){return a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":t,title:t,className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r})})});function Pt({state:e,labels:t,onPlay:n,onPause:r,onResume:s,onStop:o}){var f;const i=c.useRef(null),l=c.useRef(null),u=!!((f=i.current)!=null&&f.contains(document.activeElement));c.useEffect(()=>{var w,S;e==="idle"&&u&&!((w=i.current)!=null&&w.contains(document.activeElement))&&((S=l.current)==null||S.focus())},[e,u]);const d=e==="idle"?{label:t.play,onClick:n}:e==="paused"?{label:t.resume,onClick:s}:{label:t.pause,onClick:r};return a.jsxs("div",{ref:i,className:"flex items-center gap-1",children:[a.jsx(De,{ref:l,...d,children:e==="idle"?a.jsxs(a.Fragment,{children:[a.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),a.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",fill:"none"}),a.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",fill:"none"})]}):e==="paused"?a.jsx("polygon",{points:"6 3 20 12 6 21 6 3"}):a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),a.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})}),e!=="idle"&&a.jsx(De,{label:t.stop,onClick:o,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})]})}function $t(e){const t=e.lastIndexOf(`
|
|
6
|
+
`),n=t===-1?"":e.slice(0,t+1);let r=t===-1?e:e.slice(t+1);return r=_t(r),r=Ft(r),n+r}function Ut(e){const t=[];for(let n=0;n<e.length-1;n++)e[n]==="*"&&e[n+1]==="*"&&(t.push(n),n++);return t}function Bt(e){const t=[];for(let n=0;n<e.length;n++)if(e[n]==="*"){if(e[n+1]==="*"){n++;continue}t.push(n)}return t}function _t(e){const t=Ut(e);if(t.length%2===0)return e;const n=t[t.length-1],r=e.slice(n+2);return r.trim()===""?e.slice(0,n)+r:e+"**"}function Ft(e){const t=Bt(e);if(t.length%2===0)return e;const n=t[t.length-1],r=e.slice(n+1);return r.trim()===""?e.slice(0,n)+r:e+"*"}function zt({toolUse:e,usedLabel:t,detailsLabel:n}){const[r,s]=c.useState(!1),o=e.input!==void 0||e.result!==void 0;return a.jsxs("div",{className:"text-xs text-claudius-text-muted",children:[a.jsxs("button",{type:"button",disabled:!o,onClick:()=>s(i=>!i),"aria-expanded":o?r:void 0,className:"flex items-center gap-1.5 rounded-claudius-full border border-claudius-border bg-claudius-surface px-2 py-0.5 hover:opacity-80 disabled:cursor-default disabled:hover:opacity-100",children:[a.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),a.jsxs("span",{children:[t," ",a.jsx("span",{className:"font-mono text-claudius-text",children:e.name}),e.isError&&a.jsx("span",{className:"text-claudius-error",children:" ✕"})]}),o&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sr-only",children:n}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:r?"rotate-180":void 0,children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]})]}),r&&o&&a.jsxs("div",{className:"mt-1 overflow-x-auto rounded-claudius-sm border border-claudius-border bg-claudius-field p-2 font-mono",children:[e.input!==void 0&&a.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(e.input,null,2)}),e.result!==void 0&&a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all border-t border-claudius-border pt-1",children:e.result})]})]})}const Le=/(https?:\/\/[^\s)]+)/,Ie=/(\*\*[^*]+\*\*)/,Oe=/(\*[^*]+\*)/;function Ht(e,t){const n=e.match(/[.,;:!?'"]+$/),r=n?e.slice(0,-n[0].length):e,s=n?n[0]:"",o=Re(r);return o?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:opacity-80 text-claudius-link",children:[o.replace(/^https?:\/\//,""),a.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]},t),s]}):e}function Wt(e,t){const n=e.split(Ie),r=[];return n.forEach((s,o)=>{if(Ie.test(s)){const i=s.slice(2,-2);r.push(a.jsx("strong",{children:i},`${t}-b${o}`))}else s.split(Oe).forEach((l,u)=>{if(Oe.test(l)){const d=l.slice(1,-1);r.push(a.jsx("em",{children:d},`${t}-b${o}-i${u}`))}else l.split(Le).forEach((f,w)=>{Le.test(f)?r.push(Ht(f,`${t}-b${o}-i${u}-u${w}`)):f&&r.push(f)})})}),r}function Gt(e){const t=e.split(`
|
|
7
|
+
`);return t.map((n,r)=>a.jsxs("span",{children:[Wt(n,`l${r}`),r<t.length-1&&a.jsx("br",{})]},r))}const Vt=c.memo(function({role:t,content:n,isStreaming:r=!1,sources:s,attachments:o,toolUses:i,toolUsedLabel:l="Used tool:",toolDetailsLabel:u="Tool details",onSourceClick:d,isSourceActive:f,speech:w}){const S=t==="user",x=!!o&&o.length>0,h=r?$t(n):n,p=S||n!==""||!(i!=null&&i.length);return a.jsxs("div",{className:`${S?"ml-auto":"mr-auto"} max-w-[85%]`,children:[p&&a.jsxs("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${S?"bg-claudius-user-bubble text-claudius-user-bubble-text rounded-br-claudius-tail":"bg-claudius-assistant-bubble text-claudius-assistant-bubble-text rounded-bl-claudius-tail"}`,children:[x&&a.jsx("ul",{className:`flex flex-wrap gap-2 ${n?"mb-2":""}`,"aria-label":"Attachments",children:o.map(j=>a.jsx("li",{children:a.jsx(Ze,{attachment:j,variant:"message"})},j.id))}),(n!==""||!x)&&Gt(h)]}),!S&&i&&i.length>0&&a.jsx("div",{className:"mt-1 space-y-1",children:i.map((j,b)=>a.jsx(zt,{toolUse:j,usedLabel:l,detailsLabel:u},`${j.name}-${b}`))}),!S&&s&&s.length>0&&d&&a.jsx("div",{className:"mt-1",children:a.jsx(Lt,{count:s.length,isActive:f??!1,onClick:d})}),!S&&w&&a.jsx("div",{className:"mt-1",children:a.jsx(Pt,{...w})})]})}),Je={title:"Chat",subtitle:"Ask me anything",welcomeMessage:"Hi! How can I help you today?",closeChat:"Close chat",chatMessages:"Chat messages",typingIndicator:"Assistant is typing",placeholder:"Type your message...",sendMessage:"Send message",stopGenerating:"Stop generating",toolUsed:"Used tool:",toolDetails:"Tool details",typeYourMessage:"Type your message",openChat:"Open chat",dismissGreeting:"Dismiss greeting",attachFile:"Attach a file",removeAttachment:"Remove attachment",attachmentsLabel:"Attachments",dropFilesHint:"Drop files to attach",attachmentTooLarge:"{name} is too large. The maximum size is {max}.",attachmentTypeNotAllowed:"{name} is not a supported file type.",attachmentTooMany:"You can attach up to {max} files per message.",voiceInput:"Voice input",voiceInputHold:"Hold to talk",voiceListening:"Listening...",voicePermissionDenied:"Microphone access is blocked. Allow it in your browser settings to use voice input.",voiceNoSpeech:"No speech was detected. Please try again.",voiceNoMicrophone:"No microphone was found.",voiceUnavailable:"Voice input is not available right now.",readAloud:"Read aloud",pauseReading:"Pause reading",resumeReading:"Resume reading",stopReading:"Stop reading",moreOptions:"More options",copyAsMarkdown:"Copy as Markdown",downloadAsMarkdown:"Download as Markdown",downloadAsJson:"Download as JSON",copiedToClipboard:"Copied to clipboard",copyFailed:"Could not copy. Try downloading instead.",transcriptTitle:"Chat transcript",transcriptExported:"Exported {date}",transcriptUser:"User",transcriptAssistant:"Assistant",transcriptAttachments:"Attachments:",transcriptSources:"Sources:",errorGeneric:"Something went wrong. Please try again.",errorConnection:"Failed to connect. Please try again.",errorTimeout:"Request timed out. Please try again.",errorRateLimitMinute:"Too many requests. Please wait a minute.",errorRateLimitHour:"Hourly limit reached. Please try again later.",errorAttachmentRejected:"An attachment was rejected. Please remove it and try again.",errorAttachmentQuota:"Upload limit reached. Please try again later.",errorRetry:"Retry"},Ee=Je;function Kt(e){return{...Ee,...e}}function Pe(e){return e.key===" "||e.key==="Enter"}function qt({mode:e,isListening:t,disabled:n=!1,onStart:r,onStop:s,label:o}){const i=e==="hold",l=c.useRef(!1),u=()=>{n||l.current||(l.current=!0,r({held:!0}))},d=()=>{l.current&&(l.current=!1,s())},f=h=>{i&&h.detail!==0||(t?s():r({held:!1}))},w=h=>{var p,j;!i||h.button!==0||((j=(p=h.currentTarget).setPointerCapture)==null||j.call(p,h.pointerId),u())},S=h=>{!i||!Pe(h)||(h.preventDefault(),h.repeat||u())},x=h=>{!i||!Pe(h)||(h.preventDefault(),d())};return a.jsx("button",{type:"button",disabled:n,"aria-label":o,"aria-pressed":t,title:o,onClick:f,onPointerDown:w,onPointerUp:d,onPointerCancel:d,onLostPointerCapture:d,onKeyDown:S,onKeyUp:x,onBlur:d,onContextMenu:i?h=>h.preventDefault():void 0,style:i?{WebkitTouchCallout:"none"}:void 0,className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm border transition-colors focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50 ${t?"border-claudius-accent bg-claudius-accent text-claudius-accent-text focus:ring-2 focus:ring-offset-2 focus:ring-offset-claudius-surface":"border-claudius-border bg-claudius-field text-claudius-text-muted hover:text-claudius-text focus:border-claudius-accent"} ${i?"touch-none select-none":""}`,children:t&&!i?a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})}):a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),a.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),a.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]})})}function Yt({active:e}){return a.jsxs("span",{"aria-hidden":"true","data-claudius-voice-level":e?"active":"idle",className:"claudius-voice-level pointer-events-none absolute right-3 top-1/2 flex h-4 -translate-y-1/2 items-center gap-0.5 text-claudius-accent",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})}function ye(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>r in t?String(t[r]):n)}const Zt={en:"en-US",es:"es-ES",fr:"fr-FR",de:"de-DE"},Jt=["toggle","hold"];function $e(e,t){if(!(!e||!e.includes("-")))return e.toLowerCase().split("-")[0]===t?e:void 0}function Qe(e,t){const n=t==null?void 0:t.trim();if(n)return n;const r=typeof document<"u"?$e(document.documentElement.lang,e):void 0;if(r)return r;const s=typeof navigator<"u"?$e(navigator.language,e):void 0;return s||Zt[e]}function Qt(e,t){const n=typeof e=="object"&&e!==null&&!Array.isArray(e);if(e!==!0&&!n)return null;const r=e===!0?{}:e,s={input:r.input??!0,output:r.output??!0,mode:Jt.includes(r.mode)?r.mode:"toggle",autoSubmit:r.autoSubmit??!1,lang:Qe(t,r.lang)};return s.input||s.output?s:null}function Xt(e,t,n){const r=t.trim();if(!r)return e;const s=e.trimEnd();return(s?`${s} ${r}`:r).slice(0,n)}function en(e){const t=[];let n=0;for(let r=0;r<e.length;r++){const s=e[r];(s===`
|
|
8
|
+
`||s==="。"||s==="!"||s==="?"||(s==="."||s==="!"||s==="?")&&(r+1===e.length||/\s/.test(e[r+1])))&&(t.push(e.slice(n,r+1)),n=r+1)}return n<e.length&&t.push(e.slice(n)),t}function tn(e,t=150){const n=[];let r="";const s=()=>{const o=r.trim();o&&n.push(o),r=""};for(const o of en(e)){if((r+o).trim().length<=t){r+=o;continue}if(s(),o.trim().length<=t){r=o;continue}for(let i of o.trim().split(/\s+/)){for(r&&`${r} ${i}`.length>t&&s();i.length>t;)n.push(i.slice(0,t)),i=i.slice(t);r=r?`${r} ${i}`:i}}return s(),n}function Ue(){if(typeof window>"u")return;const e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function nn(e){switch(e){case"not-allowed":case"service-not-allowed":return"permission";case"no-speech":return"no-speech";case"audio-capture":return"no-microphone";default:return"unavailable"}}function rn(e){const[t]=c.useState(()=>Ue()!==void 0),[n,r]=c.useState(!1),[s,o]=c.useState(!1),i=c.useRef(null),l=c.useRef(!1),u=c.useRef(e);c.useEffect(()=>{u.current=e});const d=c.useCallback(x=>{x.onstart=null,x.onend=null,x.onerror=null,x.onresult=null,x.onspeechstart=null,x.onspeechend=null,i.current===x&&(i.current=null),r(!1),o(!1)},[]),f=c.useCallback(()=>{const x=i.current;x&&(d(x),x.abort())},[d]),w=c.useCallback(()=>{const x=i.current;return x?(l.current?x.stop():f(),!0):!1},[f]),S=c.useCallback(()=>{var b,E;const x=Ue();if(!x||i.current)return!1;const h=new x;h.lang=u.current.lang,h.interimResults=!0,h.continuous=!1;let p="";const j=()=>{l.current=!0};h.onstart=j,h.onspeechstart=()=>{j(),o(!0)},h.onspeechend=()=>o(!1),h.onresult=y=>{var L,C;let v="",k="";for(let R=0;R<y.results.length;R++){const P=y.results[R];P.isFinal?v+=P[0].transcript:k+=P[0].transcript}p=v,j(),o(!0),(C=(L=u.current).onTranscript)==null||C.call(L,v+k)},h.onerror=y=>{var v,k;y.error!=="aborted"&&((k=(v=u.current).onError)==null||k.call(v,nn(y.error))),d(h),h.abort()},h.onend=()=>{var y,v;d(h),(v=(y=u.current).onEnd)==null||v.call(y,p)},i.current=h,l.current=!1,r(!0);try{h.start()}catch{return d(h),(E=(b=u.current).onError)==null||E.call(b,"unavailable"),!1}return!0},[d]);return c.useEffect(()=>f,[f]),{isSupported:t,isListening:n,isSpeechDetected:s,start:S,stop:w,abort:f}}const he=2e3,sn=1800;function Be(e){var n;const t=(n=e.dataTransfer)==null?void 0:n.types;return!!t&&Array.from(t).includes("Files")}function on({onSend:e,isLoading:t,isStreaming:n=!1,onStop:r,placeholder:s,translations:o,attachments:i=null,voice:l=null,onVoiceStart:u,isReadingAloud:d=!1}){const f=o??Ee,[w,S]=c.useState(""),[x,h]=c.useState([]),[p,j]=c.useState(null),[b,E]=c.useState(!1),[y,v]=c.useState(null),k=c.useRef(null),L=c.useRef(null),C=c.useRef([]),R=c.useRef(0),P=c.useRef(""),N=c.useRef(""),$=c.useRef(!1),V=c.useRef(!1),F=c.useRef(!1),K=g=>{P.current=g,S(g)},U=w.length,te=U>=sn,ne=U>=he,re=s??f.placeholder,X=!!i&&x.length<i.maxCount,m=n&&!!r;c.useEffect(()=>{var g;t||(g=k.current)==null||g.focus()},[t]);const I=c.useCallback((g,D)=>{if(!i)return"";switch(D){case"size":return ye(f.attachmentTooLarge,{name:g,max:je(i.maxSizeBytes)});case"type":return ye(f.attachmentTypeNotAllowed,{name:g});case"count":return ye(f.attachmentTooMany,{max:i.maxCount})}},[i,f]),O=c.useCallback(async g=>{if(!i||g.length===0)return;const{accepted:D,rejected:ce}=bt(g,C.current.length,i);if(j(ce.length>0?I(ce[0].file.name,ce[0].reason):null),D.length===0)return;const ot=await Promise.all(D.map(vt));C.current=[...C.current,...ot],h(C.current)},[i,I]),Z=c.useCallback(g=>{C.current=C.current.filter(D=>D.id!==g),h(C.current),j(null)},[]),J=()=>{const g=P.current.trim(),D=C.current;!g&&D.length===0||P.current.length>=he||(D.length>0?e(g,D):e(g),K(""),C.current=[],h([]),j(null),v(null))},Q=g=>{switch(g){case"permission":return f.voicePermissionDenied;case"no-speech":return f.voiceNoSpeech;case"no-microphone":return f.voiceNoMicrophone;case"unavailable":return f.voiceUnavailable}},_=rn({lang:(l==null?void 0:l.lang)??"en-US",onTranscript:g=>K(Xt(N.current,g,he)),onEnd:g=>{const D=g.trim()!=="";if(D&&(V.current=!0),!$.current){A();return}D&&M()},onError:g=>{g==="no-speech"&&V.current||(F.current=!0,v(Q(g)))}}),B=!!(l!=null&&l.input)&&_.isSupported,T=_.isListening;c.useEffect(()=>{const g=k.current;T&&g&&(g.scrollLeft=g.scrollWidth)},[T,w]);const A=()=>{l!=null&&l.autoSubmit&&V.current&&!F.current&&J()},M=()=>{const g=P.current;_.start()&&(N.current=g)},z=({held:g})=>{v(null),$.current=g,V.current=!1,F.current=!1,u==null||u(),M()},q=()=>{const g=$.current;$.current=!1,!_.stop()&&g&&A()},se=()=>{$.current=!1,_.abort()},{abort:W}=_;c.useEffect(()=>{!t&&!d||($.current=!1,W())},[t,d,W]);const de=g=>{g.preventDefault(),se(),J()},oe=g=>{const D=g.target.value;D.length<=he&&(se(),v(null),K(D))},H=g=>{const D=Array.from(g.target.files??[]);g.target.value="",O(D)},ee=g=>{var ce;if(!i)return;const D=Array.from(((ce=g.clipboardData)==null?void 0:ce.files)??[]);D.length!==0&&(g.preventDefault(),O(D))},ie=g=>{!i||!Be(g)||(g.preventDefault(),R.current+=1,E(!0))},ae=g=>{!i||!Be(g)||g.preventDefault()},Y=()=>{i&&(R.current=Math.max(0,R.current-1),R.current===0&&E(!1))},xe=g=>{var D;i&&(g.preventDefault(),R.current=0,E(!1),O(Array.from(((D=g.dataTransfer)==null?void 0:D.files)??[])))};return a.jsxs("form",{onSubmit:de,onDragEnter:ie,onDragOver:ae,onDragLeave:Y,onDrop:xe,"data-drag-over":b||void 0,className:`relative border-t border-claudius-border bg-claudius-surface p-3 ${b?"ring-2 ring-inset ring-claudius-accent":""}`,children:[b&&a.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-claudius-surface text-sm font-medium text-claudius-accent",children:f.dropFilesHint}),i&&x.length>0&&a.jsx("ul",{"aria-label":f.attachmentsLabel,className:"mb-2 flex flex-wrap gap-3 pt-1",children:x.map(g=>a.jsx("li",{children:a.jsx(Ze,{attachment:g,variant:"composer",onRemove:()=>Z(g.id),removeLabel:`${f.removeAttachment}: ${g.name}`})},g.id))}),a.jsxs("div",{className:"flex gap-2",children:[i&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:L,type:"file",multiple:!0,hidden:!0,tabIndex:-1,accept:i.allowedTypes.join(","),onChange:H,"aria-label":f.attachFile}),a.jsx("button",{type:"button",onClick:()=>{var g;return(g=L.current)==null?void 0:g.click()},disabled:t||!X,"aria-label":f.attachFile,title:f.attachFile,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm border border-claudius-border bg-claudius-field text-claudius-text-muted transition-colors hover:text-claudius-text focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),a.jsxs("div",{className:"relative min-w-0 flex-1",children:[a.jsx("input",{ref:k,type:"text",value:w,onChange:oe,onPaste:ee,placeholder:T?f.voiceListening:re,disabled:t,"aria-label":f.typeYourMessage,"aria-describedby":te?"char-count":void 0,className:`h-full w-full rounded-claudius-sm border border-claudius-border bg-claudius-field py-2 pl-3 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50 ${T?"pr-10":"pr-3"}`}),T&&a.jsx(Yt,{active:_.isSpeechDetected})]}),B&&l&&a.jsx(qt,{mode:l.mode,isListening:T,disabled:t,onStart:z,onStop:q,label:l.mode==="hold"?f.voiceInputHold:f.voiceInput}),m?a.jsx("button",{type:"button",onClick:r,"aria-label":f.stopGenerating,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})}):a.jsx("button",{type:"submit",disabled:t||ne,"aria-label":f.sendMessage,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(p??y)&&a.jsx("div",{role:"alert",className:"mt-1 text-xs text-claudius-error",children:p??y}),te&&a.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${ne?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[U,"/",he]})]})}const an=["blog","page","external"],cn={blog:"Blog",page:"Page",external:"External"};function ln(e){try{return new URL(e).hostname}catch{return e}}const un=c.memo(function({sources:t,onClose:n}){const r=an.map(o=>({type:o,label:cn[o],items:t.filter(i=>i.type===o)})).filter(o=>o.items.length>0),s=t.length===1?"1 source found":`${t.length} sources found`;return a.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),a.jsx("p",{className:"text-xs text-claudius-text-muted",children:s})]}),a.jsx("button",{onClick:n,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:r.map(o=>a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:o.label}),a.jsx("div",{className:"space-y-2",children:o.items.map(i=>{const l=Re(i.url);return l?a.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[a.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:i.title}),a.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:ln(l)})]},l):null})})]},o.type))})]})});function dn({title:e,subtitle:t,titleId:n,closeLabel:r,onClose:s,actions:o}){return a.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[a.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:e.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{id:n,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:e}),a.jsx("p",{className:"text-xs text-claudius-accent-text",children:t})]}),o,a.jsx("button",{onClick:s,"aria-label":r,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function fn({message:e,retryLabel:t,onRetry:n}){return a.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[a.jsx("span",{children:e}),n&&a.jsx("button",{type:"button",onClick:n,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:t})]})}function hn({label:e}){return a.jsx("div",{role:"status","aria-live":"polite","aria-label":e,className:"mr-auto flex max-w-[85%]",children:a.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function pn({label:e,items:t,onOpen:n}){const[r,s]=c.useState(!1),o=c.useId(),i=c.useId(),l=c.useRef(null),u=c.useRef(null),d=c.useRef([]),f=c.useRef(null),w=b=>{f.current=b,s(!0),n==null||n()},S=b=>{var E;s(!1),(E=u.current)==null||E.focus()};c.useEffect(()=>{var E;if(!r)return;f.current!==null&&((E=d.current[f.current])==null||E.focus(),f.current=null);const b=y=>{var v;(v=l.current)!=null&&v.contains(y.target)||s(!1)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[r]);const x=b=>{var y;const E=t.length;(y=d.current[(b+E)%E])==null||y.focus()},h=b=>{b.key==="ArrowDown"?(b.preventDefault(),w(0)):b.key==="ArrowUp"&&(b.preventDefault(),w(t.length-1))},p=b=>{const E=d.current.findIndex(y=>y===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),x(E+1);break;case"ArrowUp":b.preventDefault(),x(E===-1?t.length-1:E-1);break;case"Home":b.preventDefault(),x(0);break;case"End":b.preventDefault(),x(t.length-1);break;case"Escape":b.preventDefault(),b.stopPropagation(),S();break;case"Tab":b.shiftKey&&(b.preventDefault(),S());break}},j=b=>{var y;const E=b.relatedTarget;E&&((y=l.current)!=null&&y.contains(E)||s(!1))};return a.jsxs("div",{ref:l,className:"relative",children:[a.jsx("button",{ref:u,id:o,type:"button","aria-label":e,"aria-haspopup":"menu","aria-expanded":r,"aria-controls":r?i:void 0,onClick:()=>r?S():w(0),onKeyDown:h,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"5",r:"1.75"}),a.jsx("circle",{cx:"12",cy:"12",r:"1.75"}),a.jsx("circle",{cx:"12",cy:"19",r:"1.75"})]})}),r&&a.jsx("div",{id:i,role:"menu","aria-labelledby":o,tabIndex:-1,onKeyDown:p,onBlur:j,className:"absolute right-0 top-full z-20 mt-1 min-w-[12rem] rounded-claudius-md border border-claudius-border bg-claudius-surface py-1 shadow-claudius-elevated",children:t.map((b,E)=>a.jsx("button",{ref:y=>{d.current[E]=y},type:"button",role:"menuitem",tabIndex:-1,"aria-disabled":b.disabled||void 0,onClick:()=>{b.disabled||(S(),b.onSelect())},className:"flex min-h-[40px] w-full items-center whitespace-nowrap px-4 text-left text-sm text-claudius-text hover:bg-claudius-surface-muted focus:bg-claudius-surface-muted aria-disabled:cursor-default aria-disabled:opacity-50 aria-disabled:hover:bg-transparent",children:b.label},b.id))})]})}function mn(e,t,n){const[r,s]=c.useState(0),o=c.useRef(0),i=c.useRef(0),l=c.useRef(0),u=c.useRef(!1);return c.useEffect(()=>{const d=e.current;if(!n||!d)return;const f=x=>{if(d.scrollTop>0){u.current=!1;return}u.current=!0,i.current=x.touches[0].clientY,l.current=Date.now()},w=x=>{if(!u.current)return;let h=x.touches[0].clientY-i.current;h<0&&(h=h*.3),o.current=h,s(h)},S=()=>{if(!u.current)return;u.current=!1;const x=o.current,h=(Date.now()-l.current)/1e3,p=d.getBoundingClientRect().height,j=h>.05&&x>0&&x/h>500,b=x>p*.3;j||b?t():(o.current=0,s(0))};return d.addEventListener("touchstart",f,{passive:!0}),d.addEventListener("touchmove",w,{passive:!0}),d.addEventListener("touchend",S),()=>{d.removeEventListener("touchstart",f),d.removeEventListener("touchmove",w),d.removeEventListener("touchend",S)}},[e,t,n]),{offsetY:r}}const gn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function xn(e,t){c.useEffect(()=>{const n=e.current;if(!n)return;const r=s=>{if(s.key!=="Tab")return;const o=Array.from(n.querySelectorAll(gn)).filter(d=>!d.hasAttribute("aria-hidden"));if(o.length===0)return;const i=o[0],l=o[o.length-1],u=document.activeElement;s.shiftKey&&u===i?(s.preventDefault(),l.focus()):!s.shiftKey&&u===l&&(s.preventDefault(),i.focus())};return n.addEventListener("keydown",r),()=>n.removeEventListener("keydown",r)},[e,t])}function pe(){if(!(typeof window>"u")&&!(typeof window.SpeechSynthesisUtterance>"u"))return window.speechSynthesis??void 0}function bn(e){const[t]=c.useState(()=>pe()!==void 0),[n,r]=c.useState(null),[s,o]=c.useState(!1),i=c.useRef(0),l=c.useRef(!1),u=c.useRef([]),d=c.useCallback(()=>{i.current+=1,l.current=!1,u.current=[],r(null),o(!1)},[]),f=c.useCallback(()=>{const h=u.current.length>0;d();const p=pe();!h||!p||(p.cancel(),p.paused&&p.resume())},[d]),w=c.useCallback((h,p)=>{const j=pe();if(!j)return;d(),(j.speaking||j.pending)&&j.cancel(),j.paused&&j.resume();const b=tn(p);if(b.length===0)return;const E=i.current,y=()=>i.current===E;u.current=b.map((v,k)=>{const L=new SpeechSynthesisUtterance(v);return L.lang=e,L.onerror=C=>{if(!y())return;(C.error==="interrupted"||C.error==="canceled")&&!l.current?d():f()},L.onpause=()=>{y()&&o(!0)},L.onresume=()=>{y()&&o(!1)},L.onend=()=>{y()&&(l.current&&!j.paused?f():k===b.length-1&&d())},L}),r(h);for(const v of u.current)j.speak(v)},[e,f,d]),S=c.useCallback(()=>{const h=pe();h&&(l.current=!0,h.pause(),h.paused&&o(!0))},[]),x=c.useCallback(()=>{const h=pe();h&&(l.current=!1,h.resume(),o(!1))},[]);return c.useEffect(()=>f,[f]),{isSupported:t,activeId:n,isPaused:s,speak:w,pause:S,resume:x,cancel:f}}const yn=/^([ \t]*)(`{3,}|~{3,})(.*)$/,wn=/^( {0,3})<(?![A-Za-z][A-Za-z0-9+.-]{1,31}:[^<>\s]*>|[^\s<>@]+@[^\s<>]+>)(?=[A-Za-z!?/])/,vn=/^(?: {4}|\t)/;function Xe(e){let t=0;for(const n of e)if(n===" ")t+=1;else if(n===" ")t+=4-t%4;else break;return t}function _e(e){let t=e.length;for(;t>0&&(e[t-1]===" "||e[t-1]===" ");)t-=1;return t===e.length?e:e.slice(0,t)}function jn(e){const t=yn.exec(e);if(!t)return null;const[,n,r,s]=t;return r[0]==="`"&&s.includes("`")?null:{indent:n,indentColumns:Xe(n),char:r[0],length:r.length}}function Rn(e,t){const n=e.trim();if(n.length<t.length)return!1;for(const r of n)if(r!==t.char)return!1;return Xe(e)<=t.indentColumns+3}function En(e){const t=e.replace(/\r\n?/g,`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),n=[];let r=null;for(let s=0;s<t.length;s++){const o=t[s];if(r){n.push(o),Rn(o,r)&&(r=null);continue}const i=jn(o);if(i){r=i,n.push(o);continue}let l=o.replace(wn,"$1\\<");const u=t[s+1];o.trim()!==""&&u!==void 0&&u.trim()!==""&&!vn.test(o)&&!o.endsWith("\\")&&(l=_e(l)+" "),n.push(l)}if(r)n[n.length-1]===""&&n.pop(),n.push(r.indent+r.char.repeat(r.length));else{for(;n.length>0&&n[n.length-1].trim()==="";)n.pop();n.length>0&&(n[n.length-1]=_e(n[n.length-1]))}return n.join(`
|
|
11
|
+
`)}const Sn=/[\u00a0\u202f]/g;function Tn(e){if(e.formatDate)return e.formatDate;const t=s=>new Intl.DateTimeFormat(s,{dateStyle:"medium",timeStyle:"short",timeZone:e.timeZone});let n=null;try{n=t(e.locale)}catch{try{n=t(void 0)}catch{n=null}}const r=n;return r?s=>r.format(s):s=>s.toISOString()}function kn(e){const t=Tn(e);return n=>t(n).replace(Sn," ")}function An(e,t){var n;try{return((n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"longOffset"}).formatToParts(e).find(s=>s.type==="timeZoneName"))==null?void 0:n.value)??""}catch{return""}}function et(e){const t=e.replace(/\s+/g," ").trim();if(t==="")return"";const n=Math.max(0,...(t.match(/`+/g)??[]).map(o=>o.length)),r="`".repeat(n+1),s=t.startsWith("`")||t.endsWith("`")?" ":"";return`${r}${s}${t}${s}${r}`}const Cn={"(":"%28",")":"%29","<":"%3C",">":"%3E","\\":"%5C"};function Mn(e,t){const n=ue(e.title||e.url).replace(/\s+/g," ").trim().replace(/[\\[\]<]/g,"\\$&"),r=Re(ue(e.url));if(!r)return`${t+1}. ${n}`;const s=r.replace(/[()<>\\]/g,o=>Cn[o]).replace(/\s/g,"%20");return`${t+1}. [${n}](${s})`}function Nn(e){const t=et(ue(e.name)),n=je(Number(e.size));return`- ${t} (${ue(e.mediaType)}, ${n})`}function ue(e){return typeof e=="string"?e:String(e??"")}function we(e){return Array.isArray(e)?e.filter(t=>t!==null&&typeof t=="object"):[]}function Dn(e,t){const{labels:n}=t,r=kn(t),s=t.now??new Date,o=An(s,t.timeZone),i=r(s)+(o?` (${o})`:""),l=[`# ${n.title}`,ye(n.exported,{date:i})];for(const u of e){if(u===null||typeof u!="object")continue;const d=u.role==="user"?n.user:n.assistant,f=u.createdAt?new Date(u.createdAt):null,w=f&&!Number.isNaN(f.getTime())?` · ${r(f)}`:"";l.push(`## ${d}${w}`);const S=En(ue(u.content));S&&l.push(S);const x=we(u.attachments);x.length&&l.push(n.attachments,x.map(Nn).join(`
|
|
12
|
+
`));const h=we(u.toolUses);h.length&&l.push(h.map(j=>`${n.toolUsed} ${et(ue(j.name))}`).join(`
|
|
13
|
+
`));const p=we(u.sources);p.length&&l.push(n.sources,p.map(Mn).join(`
|
|
14
|
+
`))}return l.join(`
|
|
15
|
+
|
|
16
|
+
`)+`
|
|
17
|
+
`}function Ln(e){const t=e.filter(n=>n!==null&&typeof n=="object").map(n=>n.attachments===void 0?n:{...n,attachments:we(n.attachments)});return JSON.stringify(Ye(t),null,2)+`
|
|
18
|
+
`}function Fe(e,t={}){const n=t.now??new Date;let r;try{const s=new Intl.DateTimeFormat("en",{timeZone:t.timeZone,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(n),o=i=>{var l;return((l=s.find(u=>u.type===i))==null?void 0:l.value)??""};r=`${o("year")}-${o("month")}-${o("day")}`}catch{r=n.toISOString().slice(0,10)}return`chat-transcript-${r}.${e}`}function In(e){const t=document.activeElement;let n=null;try{return n=document.createElement("textarea"),n.value=e,n.setAttribute("readonly",""),n.setAttribute("aria-hidden","true"),n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",document.body.appendChild(n),n.focus({preventScroll:!0}),n.select(),document.execCommand("copy")}catch{return!1}finally{n==null||n.remove(),t==null||t.focus()}}async function On(e){var t;try{if((t=navigator.clipboard)!=null&&t.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return In(e)}const Pn=4e4;function ze(e,t,n){const r=URL.createObjectURL(new Blob([t],{type:n})),s=document.createElement("a");s.href=r,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(r),Pn)}const $n=4e3;function Un({enabled:e,messages:t,busy:n,locale:r,translations:s}){const o=s??Ee,[i,l]=c.useState(null),u=c.useRef(null),d=c.useRef(!0);c.useEffect(()=>(d.current=!0,()=>{d.current=!1,u.current&&clearTimeout(u.current)}),[]);const f=c.useCallback(()=>{u.current&&clearTimeout(u.current),u.current=null,l(null)},[]),w=c.useCallback(x=>{d.current&&(u.current&&clearTimeout(u.current),l(x),u.current=setTimeout(()=>{u.current=null,l(null)},$n))},[]);return{items:c.useMemo(()=>{if(!e)return[];const x=n||t.length===0,h=()=>Dn(t,{locale:r,labels:{title:o.transcriptTitle,exported:o.transcriptExported,user:o.transcriptUser,assistant:o.transcriptAssistant,attachments:o.transcriptAttachments,sources:o.transcriptSources,toolUsed:o.toolUsed}});return[{id:"copy-markdown",label:o.copyAsMarkdown,disabled:x,onSelect:()=>{On(h()).then(p=>w(p?o.copiedToClipboard:o.copyFailed))}},{id:"download-markdown",label:o.downloadAsMarkdown,disabled:x,onSelect:()=>ze(Fe("md"),h(),"text/markdown;charset=utf-8")},{id:"download-json",label:o.downloadAsJson,disabled:x,onSelect:()=>ze(Fe("json"),Ln(t),"application/json")}]},[e,n,t,r,o,w]),status:i,clearStatus:f}}const Bn=/\*\*([^*]+)\*\*/g,_n=/\*([^*]+)\*/g,Fn=/https?:\/\/[^\s)]+/g;function He(e){return e.replace(Bn,"$1").replace(_n,"$1").replace(Fn,t=>{var s;const n=((s=t.match(/[.,;:!?'"]+$/))==null?void 0:s[0])??"",r=n?t.slice(0,-n.length):t;try{return new URL(r).hostname+n}catch{return t}})}const zn={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function Hn({messages:e,isLoading:t,isStreaming:n=!1,streamingMessageId:r=null,error:s,canRetry:o=!1,onSend:i,onStop:l,onRetry:u,onClose:d,title:f="Chat",subtitle:w="Ask me anything",welcomeMessage:S="Hi! How can I help you today?",placeholder:x,position:h="bottom-right",translations:p,isMobile:j=!1,attachments:b=null,voice:E=null,conversationExport:y=!1,locale:v="en-US"}){const k=c.useId(),L=c.useRef(null),C=c.useRef(null),[R,P]=c.useState(null);xn(L,!0);const N=bn((E==null?void 0:E.lang)??"en-US"),$=!!(E!=null&&E.output)&&N.isSupported,V={play:(p==null?void 0:p.readAloud)??"Read aloud",pause:(p==null?void 0:p.pauseReading)??"Pause reading",resume:(p==null?void 0:p.resumeReading)??"Resume reading",stop:(p==null?void 0:p.stopReading)??"Stop reading"},F=Un({enabled:y,messages:e,busy:t,locale:v,translations:p}),{offsetY:K}=mn(C,d,j),U=K!==0,te=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;c.useEffect(()=>{const m=C.current;m&&(m.scrollTop=m.scrollHeight)},[e,t]),c.useEffect(()=>{const m=I=>{I.key==="Escape"&&!I.isComposing&&!I.defaultPrevented&&d()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[d]);const ne=(p==null?void 0:p.closeChat)??"Close chat",re=(p==null?void 0:p.chatMessages)??"Chat messages",X=[...e].reverse().find(m=>m.role==="assistant");return a.jsxs("div",{ref:L,role:"dialog","aria-modal":j?"true":void 0,"aria-labelledby":k,className:j?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${zn[h]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:j&&!te?{transform:`translateY(${Math.max(0,K)}px)`}:void 0,"data-dragging":U||void 0,children:[j&&a.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:a.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),a.jsx(dn,{title:f,subtitle:w,titleId:k,closeLabel:ne,onClose:d,actions:y?a.jsx(pn,{label:(p==null?void 0:p.moreOptions)??"More options",items:F.items,onOpen:F.clearStatus}):void 0}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[R&&a.jsx(un,{sources:R.sources,onClose:()=>P(null)}),y&&a.jsx("div",{role:"status",className:"pointer-events-none absolute inset-x-0 top-2 z-10 flex justify-center px-4",children:F.status&&a.jsx("span",{className:"rounded-claudius-full bg-claudius-text px-3 py-1 text-xs text-claudius-surface shadow-claudius-elevated",children:F.status})}),a.jsxs("div",{ref:C,role:"log","aria-label":re,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[e.length===0&&!s&&a.jsx("div",{className:"mr-auto flex max-w-[85%]",children:a.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:S})}),e.map(m=>a.jsx(Vt,{role:m.role,content:m.content,isStreaming:m.id===r,sources:m.sources,attachments:m.attachments,toolUses:m.toolUses,toolUsedLabel:p==null?void 0:p.toolUsed,toolDetailsLabel:p==null?void 0:p.toolDetails,isSourceActive:(R==null?void 0:R.messageId)===m.id,onSourceClick:()=>{(R==null?void 0:R.messageId)===m.id?P(null):m.sources&&m.sources.length>0&&P({messageId:m.id,sources:m.sources})},speech:$&&m.role==="assistant"&&m.id!==r&&m.content.trim()!==""?{state:N.activeId!==m.id?"idle":N.isPaused?"paused":"speaking",labels:V,onPlay:()=>N.speak(m.id,He(m.content)),onPause:N.pause,onResume:N.resume,onStop:N.cancel}:void 0},m.id)),t&&!(r!==null&&e.some(m=>m.id===r&&m.content.length>0))&&a.jsx(hn,{label:(p==null?void 0:p.typingIndicator)??"Assistant is typing"}),s&&a.jsx(fn,{message:s,retryLabel:(p==null?void 0:p.errorRetry)??"Retry",onRetry:o&&u&&!t?u:void 0})]})]}),a.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:X&&X.id!==r?He(X.content):""}),a.jsx(on,{onSend:i,isLoading:t,isStreaming:n,onStop:l,placeholder:x,translations:p,attachments:b,voice:E,onVoiceStart:N.cancel,isReadingAloud:N.activeId!==null})]})}function Wn({message:e,position:t,onOpen:n,onDismiss:r,dismissLabel:s}){const o=t.startsWith("bottom"),i=t.endsWith("right"),l=["claudius-greeting-bubble","fixed z-40 max-w-xs",o?"bottom-20":"top-20",i?"right-4":"left-4"].join(" ");return a.jsxs("div",{className:l,role:"status","aria-live":"polite",children:[a.jsx("button",{type:"button",onClick:n,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:e}),a.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),r()},"aria-label":s,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:a.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const Gn={title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",stopGenerating:"Detener la respuesta",toolUsed:"Herramienta usada:",toolDetails:"Detalles de la herramienta",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",attachFile:"Adjuntar un archivo",removeAttachment:"Quitar adjunto",attachmentsLabel:"Adjuntos",dropFilesHint:"Suelta los archivos para adjuntarlos",attachmentTooLarge:"{name} es demasiado grande. El tamaño máximo es {max}.",attachmentTypeNotAllowed:"{name} no es un tipo de archivo compatible.",attachmentTooMany:"Puedes adjuntar hasta {max} archivos por mensaje.",voiceInput:"Entrada de voz",voiceInputHold:"Mantén pulsado para hablar",voiceListening:"Escuchando...",voicePermissionDenied:"El acceso al micrófono está bloqueado. Permítelo en la configuración de tu navegador para usar la entrada de voz.",voiceNoSpeech:"No se detectó ninguna voz. Inténtalo de nuevo.",voiceNoMicrophone:"No se encontró ningún micrófono.",voiceUnavailable:"La entrada de voz no está disponible en este momento.",readAloud:"Leer en voz alta",pauseReading:"Pausar la lectura",resumeReading:"Reanudar la lectura",stopReading:"Detener la lectura",moreOptions:"Más opciones",copyAsMarkdown:"Copiar como Markdown",downloadAsMarkdown:"Descargar como Markdown",downloadAsJson:"Descargar como JSON",copiedToClipboard:"Copiado al portapapeles",copyFailed:"No se pudo copiar. Prueba a descargarlo.",transcriptTitle:"Transcripción del chat",transcriptExported:"Exportado el {date}",transcriptUser:"Usuario",transcriptAssistant:"Asistente",transcriptAttachments:"Adjuntos:",transcriptSources:"Fuentes:",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorAttachmentRejected:"Se rechazó un adjunto. Quítalo e inténtalo de nuevo.",errorAttachmentQuota:"Límite de subida alcanzado. Inténtalo más tarde.",errorRetry:"Reintentar"},Vn={title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",stopGenerating:"Arrêter la génération",toolUsed:"Outil utilisé :",toolDetails:"Détails de l'outil",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",attachFile:"Joindre un fichier",removeAttachment:"Retirer la pièce jointe",attachmentsLabel:"Pièces jointes",dropFilesHint:"Déposez les fichiers pour les joindre",attachmentTooLarge:"{name} est trop volumineux. La taille maximale est de {max}.",attachmentTypeNotAllowed:"{name} n'est pas un type de fichier pris en charge.",attachmentTooMany:"Vous pouvez joindre jusqu'à {max} fichiers par message.",voiceInput:"Saisie vocale",voiceInputHold:"Maintenez pour parler",voiceListening:"Écoute en cours...",voicePermissionDenied:"L'accès au microphone est bloqué. Autorisez-le dans les paramètres de votre navigateur pour utiliser la saisie vocale.",voiceNoSpeech:"Aucune voix n'a été détectée. Veuillez réessayer.",voiceNoMicrophone:"Aucun microphone n'a été trouvé.",voiceUnavailable:"La saisie vocale n'est pas disponible pour le moment.",readAloud:"Lire à voix haute",pauseReading:"Mettre la lecture en pause",resumeReading:"Reprendre la lecture",stopReading:"Arrêter la lecture",moreOptions:"Plus d'options",copyAsMarkdown:"Copier en Markdown",downloadAsMarkdown:"Télécharger en Markdown",downloadAsJson:"Télécharger en JSON",copiedToClipboard:"Copié dans le presse-papiers",copyFailed:"Impossible de copier. Essayez plutôt de télécharger.",transcriptTitle:"Transcription du chat",transcriptExported:"Exporté le {date}",transcriptUser:"Utilisateur",transcriptAssistant:"Assistant",transcriptAttachments:"Pièces jointes :",transcriptSources:"Sources :",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorAttachmentRejected:"Une pièce jointe a été refusée. Retirez-la et réessayez.",errorAttachmentQuota:"Limite d'envoi atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},Kn={title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",stopGenerating:"Generierung stoppen",toolUsed:"Verwendetes Tool:",toolDetails:"Tool-Details",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",attachFile:"Datei anhängen",removeAttachment:"Anhang entfernen",attachmentsLabel:"Anhänge",dropFilesHint:"Dateien hier ablegen, um sie anzuhängen",attachmentTooLarge:"{name} ist zu groß. Die maximale Größe beträgt {max}.",attachmentTypeNotAllowed:"{name} ist kein unterstützter Dateityp.",attachmentTooMany:"Sie können bis zu {max} Dateien pro Nachricht anhängen.",voiceInput:"Spracheingabe",voiceInputHold:"Zum Sprechen gedrückt halten",voiceListening:"Ich höre zu...",voicePermissionDenied:"Der Zugriff auf das Mikrofon ist blockiert. Erlauben Sie ihn in den Einstellungen Ihres Browsers, um die Spracheingabe zu nutzen.",voiceNoSpeech:"Es wurde keine Sprache erkannt. Bitte versuchen Sie es erneut.",voiceNoMicrophone:"Es wurde kein Mikrofon gefunden.",voiceUnavailable:"Die Spracheingabe ist momentan nicht verfügbar.",readAloud:"Vorlesen",pauseReading:"Vorlesen pausieren",resumeReading:"Vorlesen fortsetzen",stopReading:"Vorlesen beenden",moreOptions:"Weitere Optionen",copyAsMarkdown:"Als Markdown kopieren",downloadAsMarkdown:"Als Markdown herunterladen",downloadAsJson:"Als JSON herunterladen",copiedToClipboard:"In die Zwischenablage kopiert",copyFailed:"Kopieren nicht möglich. Bitte stattdessen herunterladen.",transcriptTitle:"Chat-Protokoll",transcriptExported:"Exportiert am {date}",transcriptUser:"Nutzer",transcriptAssistant:"Assistent",transcriptAttachments:"Anhänge:",transcriptSources:"Quellen:",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorAttachmentRejected:"Ein Anhang wurde abgelehnt. Bitte entfernen Sie ihn und versuchen Sie es erneut.",errorAttachmentQuota:"Upload-Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"},ke={en:Je,es:Gn,fr:Vn,de:Kn};function We(e){if(!e)return;const t=e.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(ke,t)?t:void 0}function Ae(){const e=typeof document<"u"?We(document.documentElement.lang):void 0;if(e)return e;const t=typeof navigator<"u"?We(navigator.language):void 0;return t||"en"}function tt(e={}){const{locale:t,translations:n}=e,r=ke[t??Ae()];return n?{...r,...n}:{...r}}const Ge=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],qn=["sm","md","lg","full","tail"],Yn=["elevated","floating","floatingHover"],Zn=["heading","body"],Ce={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function Jn(e){return Object.prototype.hasOwnProperty.call(Ce,e)}const Qn=new Set(["light","dark","auto"]);function Xn(e){if(e===void 0)return{mode:"light"};if(typeof e=="string"){if(Qn.has(e))return{mode:e};if(Jn(e)){const t=Ce[e];return{mode:t.colorScheme??"light",theme:t}}return{mode:"light",url:e}}return{mode:e.colorScheme??"light",theme:e}}function er(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function tr(e,t){console.warn(`[Claudius] Ignoring unknown theme token "${t}" in "${e}"`)}function me(e,t,n,r,s,o=""){if(s)for(const[i,l]of Object.entries(s)){if(!r.includes(i)){tr(t,i);continue}typeof l=="string"&&(e[`${n}${er(i)}${o}`]=l)}}function nr(e){const t={};me(t,"colors","--cl-color-",Ge,e.colors);for(const[n,r]of Object.entries({...t}))t[`${n}-dark`]=r;return me(t,"colorsDark","--cl-color-",Ge,e.colorsDark,"-dark"),me(t,"radii","--cl-radius-",qn,e.radii),me(t,"shadows","--cl-shadow-",Yn,e.shadows),me(t,"fonts","--cl-font-",Zn,e.fonts),t}function rr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sr(e){const t=c.useMemo(()=>Xn(e),[e]),[n,r]=c.useState(null),s=t.url;c.useEffect(()=>{if(r(null),!s)return;const u=new AbortController;return fetch(s,{signal:u.signal}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{if(!rr(d))throw new Error("theme JSON must be an object");r(d)}).catch(d=>{u.signal.aborted||console.error(`[Claudius] Failed to load theme from ${s}:`,d)}),()=>u.abort()},[s]);const o=t.theme??n??null,i=(n==null?void 0:n.colorScheme)??t.mode,l=c.useMemo(()=>o?nr(o):{},[o]);return{mode:i,cssVars:l}}const nt="claudius:triggers:dismissed";function or(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(nt)==="1"}catch{return!1}}function ar(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(nt,"1")}catch{}}function ir({apiUrl:e,title:t,subtitle:n,welcomeMessage:r,placeholder:s,persistMessages:o,storageKeyPrefix:i,requestTimeoutMs:l,theme:u="light",accentColor:d,position:f="bottom-right",locale:w,translations:S,triggers:x,plugins:h,streaming:p=!0,attachments:j=!1,voice:b=!1,conversationExport:E=!1}){const[y,v]=c.useState(!1),k=c.useMemo(()=>pt(j),[j]),L=c.useMemo(()=>w??Ae(),[w]),C=c.useMemo(()=>Qt(b,L),[b,L]),R=c.useMemo(()=>Qe(L),[L]),[P,N]=c.useState(null),[$,V]=c.useState(or),F=c.useRef(!1),K=At("(max-width: 639px)"),U=c.useMemo(()=>tt({locale:w,translations:S}),[w,S]),{messages:te,isLoading:ne,isStreaming:re,streamingMessageId:X,error:m,canRetry:I,sendMessage:O,stop:Z,retry:J}=kt({apiUrl:e,persistMessages:o,storageKeyPrefix:i,timeoutMs:l,translations:U,plugins:h,streaming:p}),Q=c.useRef(null),_=c.useRef(y),{mode:B,cssVars:T}=sr(u),[A,M]=c.useState(!1);c.useEffect(()=>{if(B!=="auto")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");M(Y.matches);const xe=g=>M(g.matches);return Y.addEventListener("change",xe),()=>Y.removeEventListener("change",xe)},[B]),c.useEffect(()=>{var Y;_.current&&!y&&((Y=Q.current)==null||Y.focus()),_.current=y},[y]);const z=c.useCallback(()=>{V(!0),ar()},[]),q=c.useCallback(()=>{v(!1),F.current&&(F.current=!1,z())},[z]),se=c.useCallback(()=>{v(Y=>!Y)},[]),W=c.useCallback(()=>{F.current=!0,N(null),v(!0)},[]),de=c.useCallback(Y=>{N(Y)},[]),oe=c.useCallback(()=>{N(null),W()},[W]),H=c.useCallback(()=>{N(null),z()},[z]);Mt({triggers:x,enabled:!$&&!y,onOpen:W,onGreeting:de});const ee=B==="dark"||B==="auto"&&A,ie={...T,...d?{"--cl-color-accent":d,"--cl-color-accent-dark":d}:{}},ae=Object.keys(ie).length>0?ie:void 0;return a.jsx("div",{className:"claudius-root",style:ae,children:a.jsxs("div",{"data-claudius-dark":ee?"true":"false",children:[y&&K&&a.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:q,"aria-hidden":"true"}),y&&a.jsx(Hn,{messages:te,isLoading:ne,isStreaming:re,streamingMessageId:X,error:m,canRetry:I,onSend:O,onStop:Z,onRetry:J,onClose:q,title:t??U.title,subtitle:n??U.subtitle,welcomeMessage:r??U.welcomeMessage,placeholder:s??U.placeholder,position:f,translations:U,isMobile:K,attachments:k,voice:C,conversationExport:E===!0,locale:R}),!(y&&K)&&a.jsx(Dt,{ref:Q,isOpen:y,onClick:se,position:f,translations:U}),!y&&P&&a.jsx(Wn,{message:P,position:f,onOpen:oe,onDismiss:H,dismissLabel:U.dismissGreeting})]})})}function cr(e){const{onEvent:t,includeContent:n=!0}=e,r=s=>n?s:"";return{name:"analytics",onBeforeSend(s){t({type:"message_sent",role:"user",content:r(s.content),chars:s.content.length})},onAfterReceive(s){t({type:"message_received",role:"assistant",content:r(s.content),chars:s.content.length})},onError(s){t({type:"chat_error",message:s.message,code:s.code})}}}const rt=[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d[ -]?){13,16}\b/g,/\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g];function st(e,t,n){return t.reduce((r,s)=>(s.lastIndex=0,r.replace(s,n)),e)}function lr(e={}){const{patterns:t=rt,replacement:n="[redacted]",redactReplies:r=!1}=e,s=o=>{const i=st(o.content,t,n);if(i!==o.content)return{...o,content:i}};return{name:"redact-pii",onBeforeSend:s,onAfterReceive:r?s:void 0}}function ur(e,t,n){return typeof e=="function"?e(t):e instanceof RegExp?e.test(t):n?t.includes(e):t.toLowerCase().includes(e.toLowerCase())}function dr(e){const{rules:t,caseSensitive:n=!1}=e;return{name:"canned-responses",onBeforeSend(r,s){for(const o of t)if(ur(o.match,r.content,n)){s.respondWith(o.reply);return}}}}exports.ChatApiClient=Ve;exports.ChatApiError=G;exports.ChatWidget=ir;exports.DEFAULT_ATTACHMENT_OPTIONS=ge;exports.DEFAULT_PII_PATTERNS=rt;exports.DebounceError=ve;exports.builtinThemes=Ce;exports.createTranslations=Kt;exports.defaultTranslations=Ee;exports.detectLocale=Ae;exports.locales=ke;exports.pluginAnalytics=cr;exports.pluginCannedResponses=dr;exports.pluginRedactPII=lr;exports.redactText=st;exports.resolveTranslations=tt;
|
package/dist/claudius.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--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: rgb(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: rgb(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: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{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}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-20{bottom:5rem}.bottom-24{bottom:6rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-20{top:5rem}.top-24{top:6rem}.top-6{top:1.5rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[90vh\]{height:90vh}.h-\[min\(500px\,calc\(100vh-7rem\)\)\]{height:min(500px,calc(100vh - 7rem))}.h-full{height:100%}.max-h-48{max-height:12rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[280px\]{width:280px}.w-\[calc\(100vw-1\.5rem\)\]{width:calc(100vw - 1.5rem)}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.max-w-\[220px\]{max-width:220px}.max-w-\[380px\]{max-width:380px}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(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 * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-claudius-bubble{border-radius:var(--claudius-radius-bubble, var(--cl-radius-lg, 16px))}.rounded-claudius-full{border-radius:var(--cl-radius-full, 9999px)}.rounded-claudius-lg{border-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-claudius-md{border-radius:var(--claudius-radius-button, var(--cl-radius-md, 12px))}.rounded-claudius-sm{border-radius:var(--cl-radius-sm, 8px)}.rounded-r-claudius-lg{border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-bottom-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-t-claudius-lg{border-top-left-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-bl-claudius-tail{border-bottom-left-radius:var(--cl-radius-tail, 2px)}.rounded-br-claudius-tail{border-bottom-right-radius:var(--cl-radius-tail, 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-claudius-accent{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.border-claudius-border{border-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-accent{background-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.bg-claudius-accent-soft{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.bg-claudius-assistant-bubble{background-color:var(--claudius-assistant-bg, var(--cl-color-assistant-bubble, var(--cl-color-surface-muted, #f1f5f9)))}.bg-claudius-border{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-error{background-color:var(--claudius-error, var(--cl-color-error, #dc2626))}.bg-claudius-error-surface{background-color:var(--claudius-error-bg, var(--cl-color-error-surface, #fef2f2))}.bg-claudius-field{background-color:var(--cl-color-field, #ffffff)}.bg-claudius-scrim{background-color:var(--cl-color-scrim, rgb(0 0 0 / .5))}.bg-claudius-surface{background-color:var(--cl-color-surface, #ffffff)}.bg-claudius-surface-muted{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.bg-claudius-text{background-color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.bg-claudius-text-muted{background-color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.bg-claudius-user-bubble{background-color:var(--claudius-user-bg, var(--cl-color-user-bubble, var(--cl-color-accent, #2563eb)))}.bg-transparent{background-color:transparent}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.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-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl-3{padding-left:.75rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-body{font-family:var(--claudius-font-body, var(--cl-font-body, system-ui)),sans-serif}.font-heading{font-family:var(--claudius-font-heading, var(--cl-font-heading, system-ui)),sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-claudius-accent{color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.text-claudius-accent-text{color:var(--cl-color-accent-text, #ffffff)}.text-claudius-accent-text-muted{color:var(--cl-color-accent-text-muted, rgb(255 255 255 / .7))}.text-claudius-assistant-bubble-text{color:var(--claudius-assistant-text, var(--cl-color-assistant-bubble-text, var(--cl-color-text, #1e293b)))}.text-claudius-error{color:var(--claudius-error, var(--cl-color-error, #dc2626))}.text-claudius-error-text{color:var(--cl-color-error-text, #ffffff)}.text-claudius-link{color:var(--cl-color-link, currentColor)}.text-claudius-surface{color:var(--cl-color-surface, #ffffff)}.text-claudius-text{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.text-claudius-text-muted{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.text-claudius-user-bubble-text{color:var(--claudius-user-text, var(--cl-color-user-bubble-text, #ffffff))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-70{opacity:.7}.shadow-claudius-elevated{--tw-shadow: var(--cl-shadow-elevated, 0 25px 50px -12px rgb(0 0 0 / .25));--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-claudius-floating{--tw-shadow: var(--cl-shadow-floating, 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1));--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--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(1px + 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)}.ring-2{--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)}.ring-inset{--tw-ring-inset: inset}.ring-claudius-accent{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.ring-claudius-border{--tw-ring-color: var(--claudius-border, var(--cl-color-border, #e2e8f0))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[animation-delay\:0ms\]{animation-delay:0ms}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}[data-claudius-dark=true]{--cl-color-accent: var(--cl-color-accent-dark, #2563eb);--cl-color-accent-text: var(--cl-color-accent-text-dark, #ffffff);--cl-color-accent-soft: var( --cl-color-accent-soft-dark, rgb(255 255 255 / .2) );--cl-color-accent-text-muted: var( --cl-color-accent-text-muted-dark, rgb(255 255 255 / .7) );--cl-color-surface: var(--cl-color-surface-dark, #111827);--cl-color-surface-muted: var(--cl-color-surface-muted-dark, #1f2937);--cl-color-text: var(--cl-color-text-dark, #f3f4f6);--cl-color-text-muted: var(--cl-color-text-muted-dark, #9ca3af);--cl-color-border: var(--cl-color-border-dark, #374151);--cl-color-user-bubble: var( --cl-color-user-bubble-dark, var(--cl-color-accent) );--cl-color-user-bubble-text: var(--cl-color-user-bubble-text-dark, #ffffff);--cl-color-assistant-bubble: var( --cl-color-assistant-bubble-dark, var(--cl-color-surface-muted) );--cl-color-assistant-bubble-text: var( --cl-color-assistant-bubble-text-dark, #e5e7eb );--cl-color-field: var(--cl-color-field-dark, #1f2937);--cl-color-error: var(--cl-color-error-dark, #f87171);--cl-color-error-surface: var( --cl-color-error-surface-dark, rgb(127 29 29 / .3) );--cl-color-error-text: var(--cl-color-error-text-dark, #ffffff);--cl-color-link: var(--cl-color-link-dark, #60a5fa);--cl-color-scrim: var(--cl-color-scrim-dark, rgb(0 0 0 / .5))}.claudius-bottom-sheet{transition:transform .3s cubic-bezier(.32,.72,0,1)}.claudius-bottom-sheet[data-dragging=true]{transition:none}.claudius-scrim{transition:opacity .3s ease}.claudius-voice-level>span{width:3px;height:100%;border-radius:9999px;background:currentColor;opacity:.5;transform:scaleY(.25);animation:claudius-voice-idle 1.2s ease-in-out infinite}.claudius-voice-level[data-claudius-voice-level=active]>span{opacity:1;animation:claudius-voice-active .6s ease-in-out infinite}.claudius-voice-level>span:nth-child(2){animation-delay:-.45s}.claudius-voice-level>span:nth-child(3){animation-delay:-.2s}.claudius-voice-level>span:nth-child(4){animation-delay:-.65s}@keyframes claudius-voice-idle{0%,to{transform:scaleY(.25)}50%{transform:scaleY(.4)}}@keyframes claudius-voice-active{0%,to{transform:scaleY(.3)}50%{transform:scaleY(1)}}@media(prefers-reduced-motion:reduce){.claudius-bottom-sheet{transition:opacity .2s ease;transform:none!important}.claudius-scrim{transition:opacity .15s ease}.claudius-voice-level>span,.claudius-voice-level[data-claudius-voice-level=active]>span{animation:none;transform:scaleY(.6)}}.placeholder\:text-claudius-text-muted::-moz-placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.placeholder\:text-claudius-text-muted::placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-claudius-accent-soft:hover{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.hover\:bg-claudius-border:hover{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.hover\:bg-claudius-surface-muted:hover{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.hover\:text-claudius-accent-text:hover{color:var(--cl-color-accent-text, #ffffff)}.hover\:text-claudius-text:hover{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-claudius-floating-hover:hover{--tw-shadow: var(--cl-shadow-floating-hover, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--tw-shadow-colored: 0 20px 25px -5px 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-claudius-accent:focus{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1: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(1px + 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-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-claudius-accent:focus{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:ring-2:focus-visible{--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-visible\:ring-claudius-accent:focus-visible{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus-visible\:ring-claudius-error:focus-visible{--tw-ring-color: var(--claudius-error, var(--cl-color-error, #dc2626))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:opacity-100:hover:disabled{opacity:1}@media(prefers-reduced-motion:no-preference){@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.motion-safe\:animate-bounce{animation:bounce 1s infinite}}@media(min-width:640px){.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:max-w-\[400px\]{max-width:400px}}@media(min-width:768px){.md\:max-w-\[440px\]{max-width:440px}}
|
|
1
|
+
*,:before,:after{--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: rgb(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: rgb(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: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{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}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-20{bottom:5rem}.bottom-24{bottom:6rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-0{right:0}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-20{top:5rem}.top-24{top:6rem}.top-6{top:1.5rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[90vh\]{height:90vh}.h-\[min\(500px\,calc\(100vh-7rem\)\)\]{height:min(500px,calc(100vh - 7rem))}.h-full{height:100%}.max-h-48{max-height:12rem}.min-h-\[40px\]{min-height:40px}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[280px\]{width:280px}.w-\[calc\(100vw-1\.5rem\)\]{width:calc(100vw - 1.5rem)}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-\[12rem\]{min-width:12rem}.max-w-\[220px\]{max-width:220px}.max-w-\[380px\]{max-width:380px}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(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 * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-claudius-bubble{border-radius:var(--claudius-radius-bubble, var(--cl-radius-lg, 16px))}.rounded-claudius-full{border-radius:var(--cl-radius-full, 9999px)}.rounded-claudius-lg{border-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-claudius-md{border-radius:var(--claudius-radius-button, var(--cl-radius-md, 12px))}.rounded-claudius-sm{border-radius:var(--cl-radius-sm, 8px)}.rounded-r-claudius-lg{border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-bottom-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-t-claudius-lg{border-top-left-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-bl-claudius-tail{border-bottom-left-radius:var(--cl-radius-tail, 2px)}.rounded-br-claudius-tail{border-bottom-right-radius:var(--cl-radius-tail, 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-claudius-accent{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.border-claudius-border{border-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-accent{background-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.bg-claudius-accent-soft{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.bg-claudius-assistant-bubble{background-color:var(--claudius-assistant-bg, var(--cl-color-assistant-bubble, var(--cl-color-surface-muted, #f1f5f9)))}.bg-claudius-border{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-error{background-color:var(--claudius-error, var(--cl-color-error, #dc2626))}.bg-claudius-error-surface{background-color:var(--claudius-error-bg, var(--cl-color-error-surface, #fef2f2))}.bg-claudius-field{background-color:var(--cl-color-field, #ffffff)}.bg-claudius-scrim{background-color:var(--cl-color-scrim, rgb(0 0 0 / .5))}.bg-claudius-surface{background-color:var(--cl-color-surface, #ffffff)}.bg-claudius-surface-muted{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.bg-claudius-text{background-color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.bg-claudius-text-muted{background-color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.bg-claudius-user-bubble{background-color:var(--claudius-user-bg, var(--cl-color-user-bubble, var(--cl-color-accent, #2563eb)))}.bg-transparent{background-color:transparent}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.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-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl-3{padding-left:.75rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-body{font-family:var(--claudius-font-body, var(--cl-font-body, system-ui)),sans-serif}.font-heading{font-family:var(--claudius-font-heading, var(--cl-font-heading, system-ui)),sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-claudius-accent{color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.text-claudius-accent-text{color:var(--cl-color-accent-text, #ffffff)}.text-claudius-accent-text-muted{color:var(--cl-color-accent-text-muted, rgb(255 255 255 / .7))}.text-claudius-assistant-bubble-text{color:var(--claudius-assistant-text, var(--cl-color-assistant-bubble-text, var(--cl-color-text, #1e293b)))}.text-claudius-error{color:var(--claudius-error, var(--cl-color-error, #dc2626))}.text-claudius-error-text{color:var(--cl-color-error-text, #ffffff)}.text-claudius-link{color:var(--cl-color-link, currentColor)}.text-claudius-surface{color:var(--cl-color-surface, #ffffff)}.text-claudius-text{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.text-claudius-text-muted{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.text-claudius-user-bubble-text{color:var(--claudius-user-text, var(--cl-color-user-bubble-text, #ffffff))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-70{opacity:.7}.shadow-claudius-elevated{--tw-shadow: var(--cl-shadow-elevated, 0 25px 50px -12px rgb(0 0 0 / .25));--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-claudius-floating{--tw-shadow: var(--cl-shadow-floating, 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1));--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring{--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(3px + 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)}.ring-1{--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(1px + 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)}.ring-2{--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)}.ring-inset{--tw-ring-inset: inset}.ring-claudius-accent{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.ring-claudius-border{--tw-ring-color: var(--claudius-border, var(--cl-color-border, #e2e8f0))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[animation-delay\:0ms\]{animation-delay:0ms}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}[data-claudius-dark=true]{--cl-color-accent: var(--cl-color-accent-dark, #2563eb);--cl-color-accent-text: var(--cl-color-accent-text-dark, #ffffff);--cl-color-accent-soft: var( --cl-color-accent-soft-dark, rgb(255 255 255 / .2) );--cl-color-accent-text-muted: var( --cl-color-accent-text-muted-dark, rgb(255 255 255 / .7) );--cl-color-surface: var(--cl-color-surface-dark, #111827);--cl-color-surface-muted: var(--cl-color-surface-muted-dark, #1f2937);--cl-color-text: var(--cl-color-text-dark, #f3f4f6);--cl-color-text-muted: var(--cl-color-text-muted-dark, #9ca3af);--cl-color-border: var(--cl-color-border-dark, #374151);--cl-color-user-bubble: var( --cl-color-user-bubble-dark, var(--cl-color-accent) );--cl-color-user-bubble-text: var(--cl-color-user-bubble-text-dark, #ffffff);--cl-color-assistant-bubble: var( --cl-color-assistant-bubble-dark, var(--cl-color-surface-muted) );--cl-color-assistant-bubble-text: var( --cl-color-assistant-bubble-text-dark, #e5e7eb );--cl-color-field: var(--cl-color-field-dark, #1f2937);--cl-color-error: var(--cl-color-error-dark, #f87171);--cl-color-error-surface: var( --cl-color-error-surface-dark, rgb(127 29 29 / .3) );--cl-color-error-text: var(--cl-color-error-text-dark, #ffffff);--cl-color-link: var(--cl-color-link-dark, #60a5fa);--cl-color-scrim: var(--cl-color-scrim-dark, rgb(0 0 0 / .5))}.claudius-bottom-sheet{transition:transform .3s cubic-bezier(.32,.72,0,1)}.claudius-bottom-sheet[data-dragging=true]{transition:none}.claudius-scrim{transition:opacity .3s ease}.claudius-voice-level>span{width:3px;height:100%;border-radius:9999px;background:currentColor;opacity:.5;transform:scaleY(.25);animation:claudius-voice-idle 1.2s ease-in-out infinite}.claudius-voice-level[data-claudius-voice-level=active]>span{opacity:1;animation:claudius-voice-active .6s ease-in-out infinite}.claudius-voice-level>span:nth-child(2){animation-delay:-.45s}.claudius-voice-level>span:nth-child(3){animation-delay:-.2s}.claudius-voice-level>span:nth-child(4){animation-delay:-.65s}@keyframes claudius-voice-idle{0%,to{transform:scaleY(.25)}50%{transform:scaleY(.4)}}@keyframes claudius-voice-active{0%,to{transform:scaleY(.3)}50%{transform:scaleY(1)}}@media(prefers-reduced-motion:reduce){.claudius-bottom-sheet{transition:opacity .2s ease;transform:none!important}.claudius-scrim{transition:opacity .15s ease}.claudius-voice-level>span,.claudius-voice-level[data-claudius-voice-level=active]>span{animation:none;transform:scaleY(.6)}}.placeholder\:text-claudius-text-muted::-moz-placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.placeholder\:text-claudius-text-muted::placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-claudius-accent-soft:hover{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.hover\:bg-claudius-border:hover{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.hover\:bg-claudius-surface-muted:hover{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.hover\:text-claudius-accent-text:hover{color:var(--cl-color-accent-text, #ffffff)}.hover\:text-claudius-text:hover{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-claudius-floating-hover:hover{--tw-shadow: var(--cl-shadow-floating-hover, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--tw-shadow-colored: 0 20px 25px -5px 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-claudius-accent:focus{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:bg-claudius-surface-muted:focus{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1: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(1px + 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-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-claudius-accent:focus{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-claudius-surface:focus{--tw-ring-offset-color: var(--cl-color-surface, #ffffff)}.focus-visible\:ring-2:focus-visible{--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-visible\:ring-claudius-accent:focus-visible{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus-visible\:ring-claudius-error:focus-visible{--tw-ring-color: var(--claudius-error, var(--cl-color-error, #dc2626))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:opacity-100:hover:disabled{opacity:1}.aria-disabled\:cursor-default[aria-disabled=true]{cursor:default}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-disabled\:hover\:bg-transparent:hover[aria-disabled=true]{background-color:transparent}@media(prefers-reduced-motion:no-preference){@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.motion-safe\:animate-bounce{animation:bounce 1s infinite}}@media(min-width:640px){.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:max-w-\[400px\]{max-width:400px}}@media(min-width:768px){.md\:max-w-\[440px\]{max-width:440px}}
|