1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[729],{20729:(e,t,a)=>{"use strict";a.d(t,{A:()=>T});var r=a(30303),n=a(62711);a(77618);var l=a(7441),s=a(71702),i=a(32965),o=a(42794),c=a(62049),u=a(42511),d=a(22281),h=a(95065),m=a(94113);a(1537);let x={en:{prefix:"",suffix:" - via TalkToDia",hashtag:"#LearnLanguages #AI"},es:{prefix:"",suffix:" - v\xeda TalkToDia",hashtag:"#AprendeIdiomas #IA"},fr:{prefix:"",suffix:" - via TalkToDia",hashtag:"#ApprendreLesLangues #IA"},de:{prefix:"",suffix:" - \xfcber TalkToDia",hashtag:"#SprachenLernen #KI"},ja:{prefix:"",suffix:" - TalkToDiaãã",hashtag:"#èªå¦å¦ç¿ #AI"},ko:{prefix:"",suffix:" - TalkToDiaìì",hashtag:"#ì¸ì´íìµ #AI"},zh:{prefix:"",suffix:" - æ¥èªTalkToDia",hashtag:"#å¦ä¹ è¯è¨ #AI"},ar:{prefix:"",suffix:" - عبر TalkToDia",hashtag:"#تعÙÙ
_اÙÙØºØ§Øª #Ø°ÙØ§Ø¡_Ø§ØµØ·ÙØ§Ø¹Ù"},pt:{prefix:"",suffix:" - via TalkToDia",hashtag:"#AprendaIdiomas #IA"},ru:{prefix:"",suffix:" - ÑеÑез TalkToDia",hashtag:"#ÐзÑÑениеЯзÑков #ÐÐ"},it:{prefix:"",suffix:" - via TalkToDia",hashtag:"#ImparaLingue #IA"},hi:{prefix:"",suffix:" - TalkToDia सà¥",hashtag:"#à¤à¤¾à¤·à¤¾à¤à¤à¤¸à¥à¤à¥à¤ #AI"},tr:{prefix:"",suffix:" - TalkToDia ile",hashtag:"#Dil\xd6Ären #YZ"},nl:{prefix:"",suffix:" - via TalkToDia",hashtag:"#TalenLeren #AI"},pl:{prefix:"",suffix:" - przez TalkToDia",hashtag:"#NaukaJÄzyk\xf3w #AI"},sv:{prefix:"",suffix:" - via TalkToDia",hashtag:"#L\xe4raSpr\xe5k #AI"},th:{prefix:"",suffix:" - à¸à¹à¸²à¸ TalkToDia",hashtag:"#à¹à¸£à¸µà¸¢à¸à¸ าษา #AI"},vi:{prefix:"",suffix:" - qua TalkToDia",hashtag:"#Há»cNg\xf4nNgữ #AI"},mn:{prefix:"",suffix:" - TalkToDia-ааÑ",hashtag:"#Ð¥ÑлСÑÑаÑ
#AI"}};var f=a(80919);let p=()=>(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:"w-5 h-5",fill:"currentColor",children:(0,r.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),g=e=>{let{isOpen:t,onClose:a,content:g,preview:b,dictionary:v={}}=e,w=(0,l.Y)(),[k,y]=(0,n.useState)(!1),[j,N]=(0,n.useState)(!1),[T,C]=(0,n.useState)(null),[A,D]=(0,n.useState)(null),I=(0,n.useRef)(g),L=(0,n.useRef)(b),E=(0,n.useRef)(!1);(0,n.useEffect)(()=>{I.current=g,L.current=b},[g,b]),(0,n.useEffect)(()=>{if(!t){y(!1),C(null),D(null),E.current=!1;return}E.current||(E.current=!0,(async()=>{N(!0),D(null);let e=I.current,t=L.current;try{let a=await fetch("/api/share",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:(null==t?void 0:t.text)||e.text||"",audioFile:e.audioFile,personaName:(null==t?void 0:t.personaName)||e.personaName,personaAvatar:(null==t?void 0:t.personaAvatar)||e.personaAvatar,languageCode:e.locale,locale:e.locale})}),r=await a.json();r.success&&r.shareUrl?C(r.shareUrl):C("https://talktodia.com")}catch(e){C("https://talktodia.com")}finally{N(!1)}})())},[t]);let M=async()=>{if(T){w.light();try{await navigator.clipboard.writeText(T),y(!0),w.success(),setTimeout(()=>{y(!1),a()},1500)}catch(e){D("Failed to copy link")}}},S=async()=>{var e;if(!T)return;w.light();let t={title:(null==b?void 0:b.personaName)?"".concat(b.personaName," says..."):"Listen to this",text:(null==b||null==(e=b.text)?void 0:e.slice(0,100))||"Check out this AI voice message",url:T};try{navigator.share?(await navigator.share(t),w.success(),a()):(await navigator.clipboard.writeText("".concat(t.text,"\n\n").concat(T)),y(!0),w.success(),setTimeout(()=>{y(!1),a()},1500))}catch(e){e.name}};return((0,n.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),"undefined"==typeof document)?null:(0,s.createPortal)((0,r.jsx)(i.N,{children:t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md",style:{zIndex:99999},onClick:a}),(0,r.jsx)(o.P.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:400},className:"fixed bottom-0 left-0 right-0 max-h-[85vh] overflow-hidden",style:{zIndex:1e5},children:(0,r.jsxs)("div",{className:"bg-background/95 backdrop-blur-xl shadow-2xl rounded-t-2xl border-t border-border",children:[(0,r.jsx)("div",{className:"flex justify-center pt-4 pb-2",children:(0,r.jsx)("div",{className:"w-10 h-1 rounded-full bg-muted-foreground
1/30"})}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 pb-4 border-b border-border/20",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:v.share||"Share"}),(0,r.jsx)(f.$,{variant:"ghost",size:"icon",onClick:a,className:"p-2 rounded-full hover:bg-muted/50 transition-colors","aria-label":"Close",children:(0,r.jsx)(c.A,{className:"w-5 h-5"})})]}),b&&(b.text||b.personaName)&&(0,r.jsx)("div",{className:"px-5 py-4 border-b border-border/10",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[b.personaAvatar&&(0,r.jsx)("img",{src:b.personaAvatar,alt:b.personaName||"",className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[b.personaName&&(0,r.jsx)("p",{className:"text-sm font-medium text-primary mb-1",children:b.personaName}),b.text&&(0,r.jsxs)("p",{className:"text-sm text-muted-foreground line-clamp-3",children:['"',b.text,'"']})]})]})}),j&&(0,r.jsxs)("div",{className:"px-5 py-6 flex items-center justify-center gap-3",children:[(0,r.jsx)(u.A,{className:"w-5 h-5 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:"Creating share link..."})]}),A&&(0,r.jsx)("div",{className:"px-5 py-4 bg-destructive/10 border-b border-destructive/20",children:(0,r.jsx)("p",{className:"text-sm text-destructive text-center",children:A})}),!j&&T&&(0,r.jsxs)("div",{className:"p-5 space-y-3",children:[(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsxs)("button",{onClick:M,className:"flex-1 flex flex-col items-center gap-2.5 p-4 rounded-2xl bg-muted/50 hover:bg-muted/80 active:scale-[0.98] transition-all",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center",children:k?(0,r.jsx)(d.A,{className:"w-6 h-6 text-green-500"}):(0,r.jsx)(h.A,{className:"w-6 h-6 text-primary"})}),(0,r.jsx)("span",{className:"text-xs font-medium",children:k?v.copied||"Copied!":v.copyLink||"Copy Link"})]}),(0,r.jsxs)("button",{onClick:()=>{if(!T)return;w.light();let e=function(e){let t=encodeURIComponent(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=x[(e.locale||"en").split("-")[0]]||x.en,r=e.text||"";r.length>200&&(r=r.slice(0,197)+"...");let n=a.suffix,l=t?" ".concat(a.hashtag):"";return"".concat(a.prefix).concat(r).concat(n).concat(l)}(e,!0)),a=encodeURIComponent(e.url||"https://talktodia.com");return"https://twitter.com/intent/tweet?text=".concat(t,"&url=").concat(a)}({...g,url:T});window.open(e,"_blank"),a()},className:"flex-1 flex flex-col items-center gap-2.5 p-4 rounded-2xl bg-muted/50 hover:bg-muted/80 active:scale-[0.98] transition-all",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-full bg-foreground
1/10 flex items-center justify-center",children:(0,r.jsx)(p,{})}),(0,r.jsx)("span",{className:"text-xs font-medium",children:v.shareToX||"Share on X"})]}),(0,r.jsxs)("button",{onClick:S,className:"flex-1 flex flex-col items-center gap-2.5 p-4 rounded-2xl bg-muted/50 hover:bg-muted/80 active:scale-[0.98] transition-all",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-full bg-muted flex items-center justify-center",children:(0,r.jsx)(m.A,{className:"w-6 h-6"})}),(0,r.jsx)("span",{className:"text-xs font-medium",children:v.moreOptions||"More"})]})]}),(0,r.jsx)("div",{className:"mt-4 p-3 bg-muted/30 rounded-xl border border-border/20",children:(0,r.jsx)("p",{className:"text-xs text-muted-foreground text-center truncate",children:T})})]}),(0,r.jsx)("div",{className:"px-5 pb-8 pt-2",children:(0,r.jsx)("button",{onClick:a,className:"w-full py-3.5 text-center text-muted-foreground hover:text-foreground font-medium rounded-2xl hover:bg-muted/30 transition-all",children:v.cancel||"Cancel"})})]})})]})}),document.body)};var b=a(34723),v=a(14269),w=a(22791);let k="h-9 min-h-0 min-w-0 gap-1.5 rounded-xl px-2.5 text-xs font-medium",y="h-3.5 w-3.5";async function j(e){try{var t;if("undefined"==typeof navigator||!(null==(t=navigator.clipboard)?void 0:t.writeText))return!1;return await navigator.clipboard.writeText(e),!0}catch(e){return!1}}let N=e=>{var t,a;let{isOpen:c,getAnchorRect:u,getBoundsRect:x,labels:f,onClose:p,onCopy:g,onAsk:j,onShare:N}=e,T=(0,l.Y)(),C=(0,n.useRef)(null),[A,D]=(0,n.useState)(null),[I,L]=(0,n.useState)(!1),E=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>{if(!c)return void D(null);let e=0,t=()=>{var e;let t=C.current,a=u();if(!t||!a)return;let r=window.visualViewport,n=r?r.width:window.innerWidth,l=r?r.offsetTop+r.height:window.innerHeight,s=null!=(e=null==x?void 0:x())?e:null,i=Math.max(0,s?s.top:0),o=Math.min(l,s?s.bottom:l);if(a.bottom<i||a.top>o||a.right<0||a.left>n)return void p();let c={top:Math.max(a.top,i),bottom:Math.min(a.bottom,o),left:a.left,right:a.right};D(function(e,t,a){var r,n;let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=null!=(r=l.gap)?r:8,i=null!=(n=l.margin)?n:8,o=e.bottom+s+t.height<=a.height-i?"below":"above",c="below"===o?e.bottom+s:e.top-s-t.height,u=Math.max(i,a.height-i-t.height),d=Math.min(Math.max(c,i),u),h=(e.left+e.right)/2>a.width/2?e.right-t.width:e.left,m=Math.max(i,a.width-i-t.width);return{top:d,left:Math.min(Math.max(h,i),m),side:o}}(c,{width:t.offsetWidth,height:t.offsetHeight},{width:n,height:o}))},a=()=>{e||(e=window.requestAnimationFrame(()=>{e=0,t()}))};return t(),window.addEventListener("resize",a),window.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>{e&&window.cancelAnimationFrame(e),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,{capture:!0})}},[c,u,x,p]),(0,n.useEffect)(()=>{if(!c)return;let e=e=>{C.current&&e.target instanceof Node&&C.current.contains(e.target)||p()},t=e=>{"Escape"===e.key&&p()};return document.addEventListener("pointerdown",e,{capture:!0}),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("keydown",t)}},[c,p]),(0,n.useEffect)(()=>{!c&&(L(!1),E.current&&(clearTimeout(E.current),E.current=null))},[c]);let M=(0,n.useCallback)(async()=>{if(!await g()){T.warning(),p();return}T.success(),L(!0),E.current=setTimeout(p,900)},[g,p,T]),S=(0,n.useCallback)(()=>{p(),null==j||j()},[j,p]),z=(0,n.useCallback)(()=>{p(),null==N||N()},[N,p]);return"undefined"==typeof document?null:(0,s.createPortal)((0,r.jsx)(i.N,{children:c&&(0,r.jsxs)(o.P.div,{ref:C,role:"menu","data-testid":"bubble-action-menu",initial:{opacity:0,scale:.96},animate:{opacity:+!!A,scale:1},exit:{opacity:0,scale:.96},transition:{duration:.12},className:"fixed flex max-w-[calc(100vw-16px)] flex-wrap items-center justify-center gap-0.5 rounded-2xl border border-border bg-popover/95 p-1 text-xs text-popover-foreground shadow-lg backdrop-blur-xl",style:{zIndex:w.Z.popover,top:null!=(t=null==A?void 0:A.top)?t:0,left:null!=(a=null==A?void 0:A.left)?a:0,visibility:A?"visible":"hidden"},children:[(0,r.jsxs)(v.$,{type:"button",variant:"ghost",size:"sm",role:"menuitem","data-testid":"bubble-action-copy","aria-live":"polite",onClick:M,className:k,children:[I?(0,r.jsx)(d.A,{className:y,"aria-hidden":"true"}):(0,r.jsx)(h.A,{className:y,"aria-hidden":"true"}),(0,r.jsx)("span",{children:I?f.copied:f.copy})]}),j&&(0,r.jsxs)(v.$,{type:"button",variant:"ghost",size:"sm",role:"menuitem","data-testid":"bubble-action-ask",onClick:S,className:k,children:[(0,r.jsx)(b.A,{className:y,"aria-hidden":"true"}),(0,r.jsx)("span",{children:f.ask})]}),N&&(0,r.jsxs)(v.$,{type:"button",variant:"ghost",size:"sm",role:"menuitem","data-testid":"bubble-action-share",onClick:z,className:k,children:[(0,r.jsx)(m.A,{className:y,"aria-hidden":"true"}),(0,r.jsx)("span",{children:f.share})]})]})}),document.body)},T=e=>{let{sender:t,children:a,className:s,messageId:i,segmentIndex:o,chunkIndex:c,maxWidthClassName:u,maxWidthStyle:d,isThinking:h=!1,onClick:m,isClickable:x=!1,isDisabled:f=!1,isPlaying:p=!1,isLoadingAudio:b=!1,hasAudio:v=!1,audioProgress:w=0,forceGlassEffect:k=!1,isRTL:y=!1,shareContent:T,sharePreview:C,shareDictionary:A,actions:D}=e,I=(0,l.Y)(),L="user"===t?"justify-end":"justify-start",[E,M]=(0,n.use
1State)(!1),[S,z]=(0,n.useState)(!1),R=(0,n.useRef)(null),H=(0,n.useCallback)(()=>{var e,t;let a=null!=(t=null==(e=R.current)?void 0:e.parentElement)?t:null;for(;a&&a!==document.body;){let e=window.getComputedStyle(a).overflowY;if(("auto"===e||"scroll"===e)&&a.scrollHeight>a.clientHeight)return a.getBoundingClientRect();a=a.parentElement}return null},[]),P=(0,n.useCallback)(()=>{var e;let t=null==(e=R.current)?void 0:e.getBoundingClientRect();return t?{top:t.top,bottom:t.bottom,left:t.left,right:t.right}:null},[]),Y=(0,n.useCallback)(()=>z(!0),[]),F=(0,n.useCallback)(()=>z(!1),[]),_=!!T||!!D,O=(0,n.useRef)(null),X=(0,n.useRef)(!1),U=(0,n.useRef)(null),B={"--card-hue":"210","--card-tint-light":"transparent","--card-glow-light":"rgba(0, 0, 0, 0.06)","--card-border-light":"rgba(0, 0, 0, 0.1)","--card-tint-dark":"transparent","--card-glow-dark":"rgba(0, 0, 0, 0.25)","--card-border-dark":"rgba(255, 255, 255, 0.1)",...d?{maxWidth:d}:{}},$=(0,n.useCallback)(()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]),W=(0,n.useCallback)((e,t)=>{!f&&_&&($(),X.current=!1,U.current={x:e,y:t},O.current=setTimeout(()=>{X.current=!0,I.medium(),D?Y():M(!0)},500))},[f,_,D,Y,$,I]),Z=(0,n.useCallback)(e=>{let t=e.touches[0];t&&W(t.clientX,t.clientY)},[W]),q=(0,n.useCallback)(e=>{if(!U.current)return;let t=e.touches[0];if(t){let e=Math.abs(t.clientX-U.current.x),a=Math.abs(t.clientY-U.current.y);(e>10||a>10)&&($(),U.current=null)}},[$]),J=(0,n.useCallback)(e=>{if($(),X.current){e.preventDefault(),e.stopPropagation(),X.current=!1,U.current=null;return}m&&!f&&(I.light(),m()),U.current=null},[$,m,f,I]),K=(0,n.useCallback)(e=>{if(X.current){e.preventDefault(),e.stopPropagation();return}m&&!f&&(I.light(),m())},[m,f,I]),V=(0,n.useCallback)(e=>{X.current&&(e.preventDefault(),e.stopPropagation(),X.current=!1,U.current=null)},[]),G=(0,n.useCallback)(e=>{0===e.button&&W(e.clientX,e.clientY)},[W]),Q=(0,n.useCallback)(()=>{$(),U.current=null},[$]),ee=(0,n.useCallback)(()=>{$(),U.current=null,X.current=!1},[$]),et=(0,n.useCallback)(e=>{_&&(e.preventDefault(),I.medium(),D?Y():M(!0))},[_,D,Y,I]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex w-full ".concat(L),children:(0,r.jsxs)("div",{ref:R,style:B,"data-message-id":i,"data-segment-index":o,"data-chunk-index":c,"data-sender":t,"data-thinking":h&&"ai"===t?"true":void 0,className:"glassy-card glassy-bubble group ".concat(u||"max-w-[72%] max-[768px]:max-w-[92%]"," ").concat(s||""," ").concat(x&&!f?"cursor-pointer":""," ").concat(f?"cursor-not-allowed opacity-60":""," ").concat(p?"is-playing":""," ").concat("user"===t?"ml-auto":"mr-auto"," ").concat(k?"force-glass-dark":""),onClick:K,onClickCapture:V,onTouchStart:Z,onTouchMove:q,onTouchEnd:J,onMouseDown:G,onMouseUp:Q,onMouseLeave:ee,onContextMenu:et,children:[w>0&&(0,r.jsx)("div",{className:"audio-progress",children:(0,r.jsx)("div",{className:"audio-progress-fill",style:{transform:"scaleX(".concat(w,")"),transformOrigin:y?"right":"left"}})}),h&&"ai"===t?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0ms] translate-y-0.5"}),(0,r.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:150ms] translate-y-0.5"}),(0,r.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:300ms] translate-y-0.5"})]}):a]})}),D&&(0,r.jsx)(N,{isOpen:S,getAnchorRect:P,getBoundsRect:H,labels:D.labels,onClose:F,onCopy:()=>j(D.copyText),onAsk:D.onAsk,onShare:T?()=>M(!0):void 0}),T&&(0,r.jsx)(g,{isOpen:E,onClose:()=>M(!1),content:T,preview:C,dictionary:A})]})}},22791:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});let r={base:0,raised:10,sticky:20,header:30,scrim:40,sheet:50,dialog:60,popover:70,toast:80,tooltip:90,drag:95,devtool:100}},77618:()=>{}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.