PageSourceSearch

https://tnkr.ai/_next/static/chunks/57667-552ad6ecdb92444a.js?dpl=dpl_5jfERKQTbddDPvZJXMnjdME3G8i3

js tnkr.ai collected 2026-10-04 22:23:07 UTC 58,030 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[57667,61142],{204:(e,t,n)=>{n.d(t,{BW:()=>m,O1:()=>p,P$:()=>b,RA:()=>d,cr:()=>v,mB:()=>g,t_:()=>u});var r=n(12115);let s={text:null,files:[]},a=new Map,l=new Set,i={};function o(){for(let e of(i=Object.fromEntries(a),l))e()}function c(e,t){var n;let r=null!=(n=a.get(e))?n:s;a.set(e,{...r,...t}),o()}function d(e){var t;return null!=(t=a.get(e))?t:s}function u(e,t){d(e).text!==t&&c(e,{text:t})}function m(e,t){c(e,{files:[...d(e).files,t]})}function p(e,t){c(e,{files:d(e).files.filter(e=>e!==t)})}function g(e){a.has(e)&&(a.delete(e),o())}function f(e){return l.add(e),()=>{l.delete(e)}}let h=()=>s,x={};function b(){return(0,r.useSyncExternalStore)(f,()=>i,()=>x)}function v(e){return(0,r.useSyncExternalStore)(f,()=>e?d(e):s,h)}},18667:(e,t,n)=>{n.d(t,{b:()=>r});async function r(e,t){let n=await fetch("/api/leonardo-chat/image-upload-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:e.name,fileType:e.type,fileSize:e.size,projectId:t})});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Image upload failed");let{presignedUrl:r,s3Key:s}=await n.json();return await new Promise((t,n)=>{let s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?t():n(Error("Image upload failed (".concat(s.status,")")))},s.onerror=()=>n(Error("Network error during image upload")),s.open("PUT",r),s.setRequestHeader("Content-Type",e.type),s.send(e)}),{key:s}}},20751:(e,t,n)=>{n.d(t,{il:()=>r,md:()=>l});let r="tnkr-public-assets.s3.eu-west-2.amazonaws.com",s="d37md34e1hoap4.cloudfront.net";function a(e){return s&&e.includes(r)?e.replace(r,s):e}let l={OG_DEFAULT:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/og-default_zsaxyd.jpg"),OG_PROFILE_FALLBACK:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/og-default_g4xzua.png"),OG_EXPLORE:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/projectsv3_gl86o3.png"),OG_EXPLORE_BUILD:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/buildsv3_uqppfy.png"),OG_BUILDS:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/tnkr-explore-builds-image_zfyrc0.png"),TNKR_LOGO_PNG:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/tnkr-logo.png"),TNKR_LOGO_SVG:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/Tnkr_Logo_yvjruu.svg"),TNKR_LOGO_ORANGE_SVG:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/tnkr-logo-orange_gdqrvx.svg"),TNKR_LOGO_GENERIC_SVG:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/Logo_llzhen.svg"),AUTH_BACKGROUND:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/Torn_Image_itntfs.png"),LEO_TEMPLATE_WORKSHOP:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/workshop-template-image.png"),LEO_TEMPLATE_MANUAL:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/manual-template-image.png"),LEO_TEMPLATE_GUIDE:a("https://tnkr-public-assets.s3.eu-west-2.amazonaws.com/media/images/guide-template-image.png")}},33229:(e,t,n)=>{n.d(t,{A4:()=>u,Bb:()=>d,TL:()=>m,TZ:()=>g,Zf:()=>f,sF:()=>o,yF:()=>c});var r=n(95155),s=n(12115),a=n(36863);let l=Math.round(a.mO/1024/1024*10)/10,i=Math.round(a.tO/1024/1024*10)/10;function o(e,t){return(0,a.cS)(e)&&!t&&"generate-wiring"!==t&&"use-file-as-page"!==t}function c(e,t){let n=[],r=null,s=e.length,o=e.reduce((e,t)=>e+t.file.size,0);for(let e of t){if(s>=a.SG){r="You can attach up to ".concat(a.SG," images.");break}if(!a.bc.includes(e.type)){r="Unsupported image type. Use JPEG, PNG, WebP, or GIF.";continue}if(e.size>a.mO){r="Each image must be ".concat(l,"MB or smaller.");continue}if(o+e.size>a.tO){r="Images can total ".concat(i,"MB — remove one first.");continue}n.push(e),s+=1,o+=e.size}return{accepted:n,error:r}}function d(e){var t;return Array.from(null!=(t=null==e?void 0:e.files)?t:[])}function u(e){var t,n;if(!e)return[];let r=Array.from(null!=(t=e.files)?t:[]);return r.length>0?r.filter(e=>e.type.startsWith("image/")):Array.from(null!=(n=e.items)?n:[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>null!==e)}function m(e){let t=null==e?void 0:e.types;return!!t&&Array.prototype.includes.call(t,"Files")}let p=(0,s.createContext)(null);function g(e){let{children:t}=e,n=(0,s.useRef)(null),a=(0,s.useRef)(null),l=(0,s.useMemo)(()=>({register:e=>{n.current=e},attach:(e,t)=>{var r;return null==(r=n.current)?void 0:r.call(n,e,t)},registerPicker:e=>{a.current=e},openPicker:()=>{var e;return null==(e=a.current)?void 0:e.call(a)}}),[]);return(0,r.jsx)(p.Provider,{value:l,children:t})}function f(){return(0,s.useContext)(p)}},57667:(e,t,n)=>{n.d(t,{x:()=>V});var r=n(95155),s=n(12115),a=n(54774),l=n(62316),i=n(82266),o=n(30051),c=n(71195),d=n(204),u=n(61142),m=n(25016),p=n(32964),g=n(52171),f=n(92661),h=n(64774),x=n(3255),b=n(47284),v=n(87062),y=n(88131);let j={join:"round",fill:"outlined",radius:"2",stroke:"1.5"};function w(){let{setIsCommandMenuOpen:e,setActiveCommand:t,setCommandChips:n,commandFilter:l,setCommandFilter:o,setIsContextPickerOpen:c,setIsFilePickerOpen:d,modeConfig:m}=(0,i.q3)(),{openUpgradeModal:p}=(0,u.v)(),{canUseFeature:g}
1=(0,v.j)(),f=g("slashCommands"),[h,x]=(0,s.useState)(0),b=(0,s.useRef)(null),w=y.F.filter(e=>!!e.label.toLowerCase().includes(l.toLowerCase())&&(!m.allowedCommands||m.allowedCommands.includes(e.type)));(0,s.useEffect)(()=>{x(0)},[l]),(0,s.useEffect)(()=>{let t=t=>{"ArrowDown"===t.key?(t.preventDefault(),x(e=>Math.min(e+1,w.length-1))):"ArrowUp"===t.key?(t.preventDefault(),x(e=>Math.max(e-1,0))):"Enter"===t.key?(t.preventDefault(),w[h]&&k(w[h].type)):"Escape"===t.key&&(e(!1),o(""))};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[h,w,e,o]),(0,s.useEffect)(()=>{let t=t=>{b.current&&!b.current.contains(t.target)&&(e(!1),o(""))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e,o]);let k=(0,s.useCallback)(r=>{let s=y.F.find(e=>e.type===r);if(null==s||!s.disabled){if((null==s?void 0:s.requiresPro)&&!f){e(!1),o(""),p({source:"slash-command",preselectedPlan:"pro",reason:"The /".concat(s.label," command requires a Pro plan.")});return}t(r),e(!1),o(""),s&&n([{type:"command",label:s.label,icon:s.icon}]),["write","improve","review","summarize","suggest"].includes(r)&&c(!0),["use-file-as-page","generate-wiring"].includes(r)&&d(!0)}},[t,e,o,n,c,d,f,p]),I=0;return(0,r.jsxs)("div",{ref:b,className:"absolute bottom-full left-4 mb-2 w-[70%] rounded-xl border border-border bg-card shadow-xl z-20",children:[w.map((e,t)=>{let n=e.group!==I&&t>0;I=e.group;let l="disabled"in e&&e.disabled,i=e.requiresPro&&!f&&!l;return(0,r.jsxs)(s.Fragment,{children:[n&&(0,r.jsx)("div",{className:"border-t border-border-subtle"}),(0,r.jsxs)("button",{type:"button",onClick:()=>k(e.type),onMouseEnter:()=>!l&&x(t),disabled:l,className:"\n                flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors\n                ".concat(l?"opacity-40 cursor-not-allowed":"","\n                ").concat(i?"opacity-60":"","\n                ").concat(l||h!==t?"":"bg-card-hovered","\n              "),children:[(0,r.jsx)(a.default,{name:e.icon,size:18,...j,className:"flex-shrink-0 text-foreground"}),(0,r.jsxs)("span",{className:"flex-1 text-base text-foreground",children:[e.label,l&&(0,r.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Coming soon"})]}),i&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[(0,r.jsx)(a.default,{name:"IconDiamond",size:12,fill:"filled"}),"Pro"]})]})]},e.type)}),0===w.length&&(0,r.jsx)("div",{className:"px-3 py-3 text-sm text-muted-foreground text-center",children:"No matching commands"})]})}function k(e){let{title:t,items:n,divide:s,onSelect:l}=e;return n.length?(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)("div",{className:"border-t border-border-subtle my-1"}),(0,r.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,r.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t})}),n.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>l(e),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-card-hovered",children:[(0,r.jsx)(a.default,{name:"IconBlankPagePortrait",size:16,className:"flex-shrink-0 text-foreground"}),(0,r.jsx)("span",{className:"text-sm text-foreground truncate flex-1",children:e.name}),e.source&&(0,r.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:e.source})]},e.id))]}):null}function I(e){let{filter:t="",excludeRef:n,onItemSelect:a}=e,{setIsContextPickerOpen:l,addContextItem:o,setCommandChips:c,commandChips:d,connectedFiles:u,availableContextItems:m}=(0,i.q3)(),p=(0,s.useRef)(null),g=(0,s.useMemo)(()=>[...m,...u.map(e=>({id:e.id,name:e.name,type:"file",source:e.source}))],[m,u]),f=(0,s.useMemo)(()=>{let e=t.toLowerCase(),n=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return g.filter(t=>n.includes(t.type)&&(!e||t.name.toLowerCase().includes(e)))};return{pages:n("page"),files:n("file"),parts:n("part"),robot:n("accessory","remix")}},[g,t]),h=!Object.values(f).some(e=>e.length);(0,s.useEffect)(()=>{let e=e=>{!p.current||p.current.contains(e.target)||(null==n?void 0:n.current)&&n.current.contains(e.target)||l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[l,n]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l]);let x=e=>{o(e),c([...d,{type:"context",label:e.name,icon:"IconBlankPagePortrait"}]),l(!1),null==a||a(e)};return(0,r.jsxs)("div",{ref:p,className:"absolute bottom-full left-4 mb-2 w-[70%] max-h-[300px] overflow-y-auto rounded-xl border border-border bg-card shadow-xl z-20",children:[(0,r.jsx)(k,{title:"Current Page",items:f.pages,divide:!1,onSelect:x}),(0,r.jsx)(k,{title:"Files",items:f.files,divide:f.pages.length>0,onSelect:x}),(0,r.jsx)(k,{title:"Parts",items:f.parts,divide:f.pages.length+f.files.length>0,onSelect:x}),(0,r.jsx)(k,{title:"On the robot",items:f.robot,divide:f.pages.length+f.files.length+f.parts.length>0,onSelect:x}),h&&(0,r.jsx)("div",{className:"px-3 py-3 text-sm text-muted-foreground text-center",children:t?"Nothing matches that":"Nothing to reference here yet"})]})}var N=n(18720),S=n(23037),C=n(28783),E=n(77540),P=n(66188),z=n(66536),L=n(43392);let T=new Set(["pdf","md","txt"]),R=new Set(["jpg","jpeg","png","webp"]);function _(e,t){let n=(e||"").toLowerCase().replace(".","");return"generate-wiring"===t?R.has(n):T.has(n)}let M={internal:{icon:"IconCloudUpload",label:"Uploaded"},github:{icon:"IconGithub",label:"GitHub"},onshape:{icon:"IconBox2",label:"Onshape"}};function A(){let{setIsFilePickerOpen:e,setSelectedFile:t,setSelectedFileUrl:n,setWiringImage:a,setCommandChips:l,commandChips:o,activeCommand:c,projectId:d}=(0,i.q3)(),{organization:u}=(0,C.Z)(),m=(null==u?void 0:u.id)||"",p=(0,s.useRef)(null),f=(0,s.useRef)(null),[x,b]=(0,s.use
1State)("project"),[v,y]=(0,s.useState)(""),[j,w]=(0,s.useState)(null),{data:k,isLoading:I}=(0,E.h)(m,d),T=(0,s.useMemo)(()=>(null==k?void 0:k.files)?k.files.filter(e=>"file"===e.type):[],[k]),R=(0,s.useMemo)(()=>{if(!v.trim())return T;let e=v.toLowerCase();return T.filter(t=>t.name.toLowerCase().includes(e))},[T,v]);(0,s.useEffect)(()=>{if("project"===x){var e;null==(e=f.current)||e.focus()}},[x]),(0,s.useEffect)(()=>{let t=t=>{p.current&&!p.current.contains(t.target)&&e(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,s.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]);let A=(0,s.useCallback)(async r=>{if(_(r.extension,c)&&!j){w(r.id);try{let s;if("internal"===r.source){let{presignedUrl:e}=await P.FileManagementService.getDownloadUrl(r.id,m,d);s=e}else s=(await P.FileManagementService.materialize(m,d,r)).publicUrl;if("generate-wiring"===c){let e=await fetch(s),t=await e.blob(),n=new File([t],r.name,{type:r.mimeType||t.type});a(n)}else t({id:r.id,name:r.name,source:"internal"===r.source?"upload":r.source,extension:r.extension}),n(s);let i=o.filter(e=>"context"!==e.type);l([...i,{type:"context",label:r.name}]),e(!1)}catch(e){console.error("[LeoChatFilePicker] Failed to resolve file URL:",e),N.oR.error("Failed to select file")}finally{w(null)}}},[m,d,j,c,o,t,n,a,l,e]),O=(0,s.useCallback)(()=>{e(!1),setTimeout(()=>{let e=document.getElementById("leo-file-input");null==e||e.click()},50)},[e]);return(0,r.jsxs)("div",{ref:p,className:"absolute bottom-full left-4 mb-2 w-[70%] max-h-[400px] flex flex-col rounded-xl border border-border bg-card shadow-xl z-20",children:[(0,r.jsxs)("div",{className:"flex border-b border-border-subtle px-3 pt-3 pb-0 gap-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>b("project"),className:"flex-1 rounded-t-lg px-3 py-2 text-sm font-medium transition-colors ".concat("project"===x?"bg-background text-foreground-strong border-b-2 border-primary-subtle-foreground":"text-muted-foreground hover:text-foreground hover:bg-background-hovered"),children:"Project Files"}),(0,r.jsx)("button",{type:"button",onClick:()=>b("upload"),className:"flex-1 rounded-t-lg px-3 py-2 text-sm font-medium transition-colors ".concat("upload"===x?"bg-background text-foreground-strong border-b-2 border-primary-subtle-foreground":"text-muted-foreground hover:text-foreground hover:bg-background-hovered"),children:"Upload"})]}),"project"===x&&(0,r.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,r.jsx)("div",{className:"px-3 pt-3 pb-2",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(L.I,{name:"IconMagnifyingGlass",size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 .5 .5 text-muted-foreground z-10"}),(0,r.jsx)(S.p,{ref:f,type:"text",placeholder:"Search files...",value:v,onChange:e=>y(e.target.value),size:"sm",className:"pl-8"})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto max-h-[240px] pb-2",children:I?(0,r.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,r.jsx)(h.y,{size:"sm"})}):0===R.length?(0,r.jsx)("div",{className:"px-3 py-6 text-sm text-muted-foreground text-center",children:v?"No matching files":0===T.length?"No files in this project yet":"No files match the search"}):R.map(e=>{let t=_(e.extension,c),n=j===e.id,s=M[e.source];return(0,r.jsxs)("button",{type:"button",disabled:!t||!!j,onClick:()=>A(e),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors ".concat(t?"hover:bg-card-hovered cursor-pointer":"opacity-40 cursor-not-allowed"),children:[n?(0,r.jsx)(h.y,{size:"sm",className:"text-foreground flex-shrink-0"}):(0,r.jsx)(L.I,{name:(0,z.I3)(e.extension||""),className:"h-4 w-4 text-foreground flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-foreground truncate flex-1",children:e.name}),!t&&(0,r.jsx)("span",{className:"text-2xs text-foreground-disabled shrink-0",children:"unsupported"}),s&&t&&(0,r.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground shrink-0",children:[(0,r.jsx)(L.I,{name:s.icon,className:"h-3 w-3"}),s.label]}),null!=e.size&&t&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:(0,z.v7)(e.size)})]},e.id)})}),(0,r.jsx)("div",{className:"px-3 py-2 border-t border-border-subtle",children:(0,r.jsx)("p",{className:"text-xs text-foreground-disabled",children:"generate-wiring"===c?"Supported: JPG, PNG, WebP images":"Supported: PDF, Markdown, Text files"})})]}),"upload"===x&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 gap-3",children:[(0,r.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:(0,r.jsx)(L.I,{name:"IconCloudUpload",size:24,className:"text-muted-foreground"})}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-sm text-foreground-strong",children:"Upload a file from your computer"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"generate-wiring"===c?"Supports JPG, PNG, and WebP images":"Supports PDF, Markdown, and Text files"})]}),(0,r.jsx)(g.$,{variant:"outline",size:"sm",onClick:O,className:"mt-1",children:"Browse Files"})]})]})}var O=n(18667),B=n(97572),F=n(46951),G=n(99588),D=n(36863),U=n(33229);let W=Math.round(D.Lx/1024/1024*10)/10;var q=n(5494),H=n(26564),K=n(40112);let Z={join:"round",fill:"outlined",radius:"2",stroke:"1.5"},$=D.bc.join(","),J="".concat($,",").concat(D.FO),Q="CAD files can only be attached inside a mod workspace.",X={IconPromptSuggestion:"IconPromptSuggestion",IconTextSelectDashed:"IconTextSelectDashed",IconSearchlinesSparkle:"IconSearchlinesSparkle",IconBubbleWideSparkle:"IconBubbleWideSparkle",IconCodeAnalyze:"IconCodeAnalyze",IconBlankPagePortrait:"IconBlankPagePortrait"};function V(){var e,t,n,v,y,j,k,N,S;let{sendMessage:C,sendSlashCommand:E,isSending:P,isStreaming:z,activeCommand:T,setActiveCommand:R,setIsCommandMenuOpen:_,setIsContextPickerOpen:M,setIsFilePickerOpen:V,isCommandMenuOpen:Y,isContextPickerOpen:ee,isFilePickerOpen:et,commandChips:en,setCommandChips:er,messages:es=[],clearCommandChips:ea,pendingCommandPrompt:el,setPendingCommandPrompt:ei,composerDraft:eo,setComposerDraft:ec,composerPlaceholder:ed,setComposerPlaceholder:eu,selectedContextItems:em,setCommandFilter:ep,limitInfo:eg,modeConfig:ef,captureSendScope:eh=()=>({projectId:"",modId:null,chatId:null,turnId:"turn"}),wiringImage:ex,setWiringImage:eb,selectedFile:ev,setSelectedFile:ey,setSelectedFileUrl:ej,isGenerationRunning:ew,generationMode:ek,stopStreaming:eI,cancelGeneration:eN,mode:eS,panelState:eC,chatDockNode:eE,composerContext:eP=[],setComposerContext:ez=()=>{},studioBridgeRef:eL={current:null},currentChatId:eT=null,userId:eR=null,draftManager:e_=F.BT,submission:eM,beginSubmission:eA,finishSubmission:eO,isCurrentSubmission:eB,studioBuild:eF=null,specPhase:eG=null,planMirror:eD={rows:[],chip:null}}=(0,i.q3)(),eU=es.filter(e=>"assistant"===e.role).length,{readDraft:eW,writeDraft:eq,consumeDraft:eH,subscribeDrafts:eK,draftLifetime:eZ}=e_,e$=(0,c.tx)(),eJ=(0,d.cr)(null!=(e=null==e$?void 0:e$.taskId)?e:null),eQ=(0,s.useRef)(eP);eQ.current=eP;let{openUpgradeModal:eX}=(0,u.v)(),{track:eV}
1=(0,q.st)(),eY=eE?"docked":"collapsed"===eC?"modal":eC,[e0,e1]=(0,s.useState)(()=>eW(eR,eT).text),[e2,e3]=(0,s.useState)(()=>eW(eR,eT).pastedBlocks),[e5,e4]=(0,s.useState)(null),[e6,e8]=(0,s.useState)(null),[e7,e9]=(0,s.useState)(()=>eW(eR,eT).pendingImages),[te,tt]=(0,s.useState)(null),[tn,tr]=(0,s.useState)([]),ts=(0,B.e)(eR),ta="function"==typeof eA?eM:ts.submission,tl=null!=eA?eA:ts.beginSubmission,ti=null!=eO?eO:ts.finishSubmission,to=null!=eB?eB:ts.isCurrentSubmission,tc=(null==ta?void 0:ta.phase)==="uploading",td=(0,s.useRef)(null),tu=(0,s.useRef)(null),tm=(0,s.useRef)(null),tp=(0,s.useRef)(!1),tg=(0,s.useRef)(null),tf=(0,s.useRef)(e0);tf.current=e0;let th=null!=eT?eT:F.QF,tx=(0,s.useRef)(null!=eT?eT:null),tb=(0,s.useRef)({userId:eR,lifetime:eZ(eR,eT)}),tv=(0,s.useRef)(!1),ty=(0,s.useRef)(e2);ty.current=e2,(0,s.useEffect)(()=>{if(tb.current.userId===eR&&tx.current===(null!=eT?eT:null))return;eq(tb.current.userId,tx.current,{text:tf.current,pastedBlocks:ty.current,pendingImages:tR.current},tb.current.lifetime),tx.current=null!=eT?eT:null,tv.current=!0,tb.current={userId:eR,lifetime:eZ(eR,eT)};let e=eW(eR,null!=eT?eT:null);e1(e.text),e3(e.pastedBlocks),e9(e.pendingImages)},[eZ,eW,eq,th,eT,eR]),(0,s.useEffect)(()=>()=>{eq(tb.current.userId,tx.current,{text:tf.current,pastedBlocks:ty.current,pendingImages:tR.current},tb.current.lifetime)},[eq]),(0,s.useEffect)(()=>{if(tv.current){tv.current=!1;return}tb.current.userId===eR&&tx.current===eT&&eq(eR,eT,{text:e0,pastedBlocks:e2,pendingImages:e7},tb.current.lifetime)},[eq,eR,eT,e0,e2,e7]),(0,s.useEffect)(()=>eK(()=>{let e=eW(tb.current.userId,tx.current);e1(e.text),e3(e.pastedBlocks),e9(e.pendingImages)}),[eW,eK]);let tj=Y&&e0.startsWith("/"),tw=ee&&e0.includes("@"),tk=(0,s.useMemo)(()=>{if(!ee||!e0.includes("@"))return"";let e=e0.lastIndexOf("@");return e0.slice(e+1)},[e0,ee]),tI=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=tI.current;if(!e)return;let t=()=>(0,c.j0)("composer"),n=()=>(0,c.HL)("composer");return e.addEventListener("focusin",t),e.addEventListener("focusout",n),()=>{e.removeEventListener("focusin",t),e.removeEventListener("focusout",n),(0,c.HL)("composer")}},[]),(0,s.useEffect)(()=>{tm.current&&(tm.current.style.height="auto",tm.current.style.height="".concat(Math.min(tm.current.scrollHeight,120),"px"))},[e0]),(0,s.useEffect)(()=>{if(null!==el){var e;null==(e=tm.current)||e.focus()}},[el]),(0,s.useEffect)(()=>{if(!eo)return;e1(e=>"".concat(eo).concat(e)),ec(null);let e=tm.current;e&&(e.focus(),requestAnimationFrame(()=>{e.setSelectionRange(e.value.length,e.value.length)}))},[eo,ec]),(0,s.useEffect)(()=>{var e;ed&&(null==(e=tm.current)||e.focus())},[ed]);let tN="generate-wiring"===T||"use-file-as-page"===T,tS=(0,U.sF)(ef,T),tC=tN||ef.filePickerEnabled,tE="generate-wiring"===T?"image/jpeg,image/png,image/webp":".pdf,.md,.txt",tP=(0,s.useCallback)(e=>{var t;let n=null==(t=e.target.files)?void 0:t[0];if(n){if("generate-wiring"===T){if(n.size>0xa00000){alert("Image too large (".concat((n.size/1024/1024).toFixed(1),"MB). Maximum is 10MB.")),td.current&&(td.current.value="");return}if(!["image/jpeg","image/png","image/webp"].includes(n.type)){alert("Unsupported image type. Please use JPG, PNG, or WebP."),td.current&&(td.current.value="");return}}eb(n),er([...en.filter(e=>"context"!==e.type),{type:"context",label:n.name}]),td.current&&(td.current.value="")}},[T,eb,er,en]),tz=(0,s.useCallback)(e=>{e3(t=>t.filter(t=>t.id!==e)),e8(null)},[]),tL=(0,s.useCallback)(()=>{e9([]),tt(null)},[]),tT=(0,s.useCallback)(e=>{e9(t=>t.filter(t=>t.id!==e)),tt(null)},[]),tR=(0,s.useRef)([]);tR.current=e7;let t_=(0,D.hc)(ef)&&!T,tM=(0,s.useRef)([]);tM.current=tn;let tA=(0,s.useRef)(Promise.resolve()),tO=(0,s.useCallback)((e,t)=>{let n=async()=>{var n;let r=null==(n=eL.current)?void 0:n.uploadCadFile;if(!r)return void tr(t=>t.map(t=>t.id===e?{...t,error:Q}:t));try{await r(t),tr(t=>t.filter(t=>t.id!==e))}catch(r){let n=r instanceof Error&&r.message?r.message:"Could not attach ".concat(t.name,".");tr(t=>t.map(t=>t.id===e?{...t,error:n}:t))}};tr(t=>t.map(t=>t.id===e?{...t,error:null}:t));let r=tA.current.then(n,n);return tA.current=r.catch(()=>{}),r},[eL]),tB=tn.flatMap(e=>e.error?[{id:e.id,error:e.error}]:[]),tF=(0,s.useCallback)(e=>{tr(t=>t.filter(t=>t.id!==e))},[]),tG=(0,s.useCallback)(e=>{var t;if(!(null==(t=eL.current)?void 0:t.uploadCadFile))return void tt(Q);let{accepted:n,error:r}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=null,s=t;
1for(let t of e){if(s>=D.BI){r="You can attach up to ".concat(D.BI," CAD files at a time.");break}if(!(0,D.vq)(t.name)){r="Only STEP (.step, .stp) and STL (.stl) files can be attached.";continue}if(t.size>D.Lx){r="".concat(t.name," is too large — CAD files must be ").concat(W,"MB or smaller.");continue}if(0===t.size){r="".concat(t.name," is empty.");continue}n.push(t),s+=1}return{accepted:n,error:r}}(e,tM.current.length);if(tt(r),0===n.length)return;let s=n.map((e,t)=>({id:"cad-".concat(Date.now(),"-").concat(t,"-").concat(Math.random().toString(36).slice(2,8)),file:e,error:null}));for(let e of(tr(e=>[...e,...s]),s))tO(e.id,e.file)},[eL,tO]),tD=(0,s.useCallback)((e,t)=>{if(0===e.length)return;if(e$){for(let n of(eV("leo_image_attached",{mode:eS,entry:t,count:e.length,bytes:e.reduce((e,t)=>e+t.size,0)}),e))(0,d.BW)(e$.taskId,n);return}let n=e;if(t_){let{cad:t,rest:r}=function(e){let t=[],n=[];for(let r of e)((0,D.vq)(r.name)?t:n).push(r);return{cad:t,rest:n}}(e);if(t.length>0&&tG(t),0===r.length)return;n=r}let{accepted:r,error:s}=(0,U.yF)(tR.current,n);if(tt(s),0===r.length)return;eV("leo_image_attached",{mode:eS,entry:t,count:r.length,bytes:r.reduce((e,t)=>e+t.size,0)});let a=r.map((e,t)=>({id:"img-".concat(Date.now(),"-").concat(t,"-").concat(Math.random().toString(36).slice(2,8)),file:e,previewUrl:URL.createObjectURL(e)}));e9(e=>{let t=D.SG-e.length;return t<=0?(a.forEach(e=>URL.revokeObjectURL(e.previewUrl)),e):(a.slice(t).forEach(e=>URL.revokeObjectURL(e.previewUrl)),[...e,...a.slice(0,t)])})},[eV,eS,t_,tG,e$]),tU=(0,s.useCallback)(e=>{var t;let n=Array.from(null!=(t=e.target.files)?t:[]);tu.current&&(tu.current.value=""),tD(n,"button")},[tD]),tW=(0,U.Zf)();(0,s.useEffect)(()=>{if(tW)return tW.register(tS?tD:null),()=>tW.register(null)},[tW,tS,tD]),(0,s.useEffect)(()=>{if(tW)return tW.registerPicker(tS?()=>{var e;return null==(e=tu.current)?void 0:e.click()}:null),()=>tW.registerPicker(null)},[tW,tS]);let tq=(0,s.useCallback)(e=>{var t;if(tS){let t=(0,U.A4)(e.clipboardData);if(t.length>0){e.preventDefault(),tD(t,"paste");return}}let n=null==(t=e.clipboardData)?void 0:t.getData("text/plain");n&&!(n.length<F.QS)&&(e.preventDefault(),e8(null),e3(e=>[...e,{id:"paste-".concat(Date.now(),"-").concat(e.length),text:n,lines:n.split("\n").length,kb:(new Blob([n]).size/1024).toFixed(1)}]))},[tS,tD]);(0,s.useEffect)(()=>{T&&tL()},[T,tL]);let tH=(0,s.useCallback)(()=>{ez((0,H.Uv)(eQ.current)),(0,K.yi)()},[ez]),tK=(0,s.useCallback)(()=>{if(P||z||ta)return;let e=eh(),t=e0.trim(),n=[t||el||"",...e2.map(e=>(0,F.tg)(e.text))].filter(Boolean).join("\n\n"),r=e=>{eV("leo_message_sent",{mode:eS,surface:eY,has_images:e>0,image_count:e,entry:T?"chip":!t&&el?"tile":"typed"})};if(tN&&T){if(!ex&&!ev)return;e1(""),e3([]),R(null),ea(),ei(null),tH(),r(0),E(T,void 0,n);return}if(n||T)if(T){var s;let e=null==(s=em[0])?void 0:s.name;e1(""),e3([]),R(null),ea(),ei(null),tH(),r(0),E(T,e,n)}else{if(n.length>5e4)return void e8("This message is ~".concat(n.length.toLocaleString()," characters — Leo can read up to ").concat(5e4.toLocaleString()," per message. Trim the paste or split it across messages."));if(e8(null),e7.length>0){let t=tl(eT);if(!t)return;let s=tx.current,a={...tb.current},l={text:e0,pastedBlocks:e2,pendingImages:e7,pendingCommandPrompt:el};tt(null),(async()=>{let i;try{i=await Promise.all(e7.map(t=>(0,O.b)(t.file,e.projectId)))}catch(e){if(!to(t))return;ti(t),tx.current===s&&tb.current.userId===a.userId&&tt(e instanceof Error?e.message:"Failed to upload image. Try again.");return}if(!to(t))return;let o=e7.map((e,t)=>({type:"image",s3Key:i[t].key,fileName:e.file.name,fileSize:e.file.size}));tH(),r(i.length),"function"==typeof eA?C(n,void 0,{images:i,attachments:o,scope:e,submission:t,onDispatched:e=>eH(a.userId,null!=s?s:e,l,null===s?eZ(a.userId,e):a.lifetime)}):(eH(a.userId,s,l,a.lifetime),Promise.resolve(C(n,void 0,{images:i,attachments:o,scope:e})).finally(()=>ti(t)))})();return}r(0),C(n,void 0,{scope:e}),e1(""),e3([]),ei(null),tH()}},[eH,eZ,ea,ev,R,ta,tl,ti,to,eT,eA,e0,e2,P,z,T,tN,ex,em,C,E,el,ei,e7,eh,eV,eS,eY,tH]),[tZ,t$]=(0,s.use
1State)(!1);(0,s.useEffect)(()=>{ew||t$(!1)},[ew]);let tJ=(0,s.useCallback)(()=>{if(ed&&eu(null),ew)return void t$(!0);if(e$&&!T&&e0.trim()){(0,o.UN)(e$.taskId)&&(0,c.PS)(null);return}tK()},[ew,tK,ed,eu,e$,T,e0]),tQ=P||z,tX=!e0.trim()&&0===e2.length&&!T,tV=ew&&tX,tY=(0,s.useCallback)(()=>{if(P||z)return void eI().then(e=>{eV("leo_turn_stopped",{mode:eS,target:"chat_turn",elapsed_ms:e.elapsedMs,chars_streamed:e.charsStreamed,kept_partial:e.keptPartial})});eN(),eV("leo_turn_stopped",{mode:eS,target:"generation_run",elapsed_ms:0,chars_streamed:0,kept_partial:!1})},[P,z,eI,eN,eV,eS]),t0=(0,s.useCallback)(e=>{let t=tf.current,n=t.lastIndexOf("@"),r=n>=0?t.slice(0,n):t;e1(e?"".concat(r,"@").concat(e.name," "):r.trimEnd())},[]),t1=(0,s.useCallback)(e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),Y||ee)return;tJ();return}if("Escape"===e.key){if(Y){e.preventDefault(),_(!1),ep(""),e1("");return}if(ee){e.preventDefault(),M(!1);let t=e0.lastIndexOf("@");t>=0&&e1(e0.slice(0,t).trimEnd());return}if(et){e.preventDefault(),V(!1);return}}},[e0,tJ,Y,ee,et,_,M,V,ep]),t2=(0,s.useRef)(null),t3=(0,s.useCallback)(e=>{e1(e),ef.slashCommandsEnabled&&e.startsWith("/")?(_(!0),ep(e.slice(1))):Y&&(_(!1),ep("")),ef.contextPickerEnabled&&e.includes("@")?M(!0):ee&&!e.includes("@")&&M(!1),e$&&((0,d.t_)(e$.taskId,e),t2.current!==e$.taskId&&(t2.current=e$.taskId,(0,o.CP)()))},[Y,ee,_,M,ep,ef.slashCommandsEnabled,ef.contextPickerEnabled,e$]),t5=null!=(t=null==e$?void 0:e$.taskId)?t:null,t4=null!=(n=null==e$?void 0:e$.briefText)?n:"",t6=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(t5){var e;t6.current=!0,e1(null!=(e=eJ.text)?e:t4);return}t6.current&&(t6.current=!1,e1(""))},[t5,t4,eJ.text]),(0,s.useEffect)(()=>{T&&(e1(""),e8(null))},[T]);let t8=null!=(v=null==eg?void 0:eg.isLimited)&&v,t7=null!=(y=eD.chip)?y:"ready"===eG?"Plan ready \xb7 your turn":"question"===eG?"Planning \xb7 your turn":"thinking"===eG?"Planning \xb7 thinking…":(null==eF?void 0:eF.jobLane)?"spec"===eF.jobLane?"Planning":"Building":null,t9=null==eg?void 0:eg.daily,ne=!!eg&&!eg.isLimited&&!!t9&&t9.max!==1/0&&t9.used>0,nt=ne&&t9?Math.round(t9.used/t9.max*100):0,nn=(0,s.useMemo)(()=>[e0.trim()||el||"",...e2.map(e=>(0,F.tg)(e.text))].filter(Boolean).join("\n\n").length,[e0,el,e2]),nr=!T&&nn>5e4,ns=nn>3e4,na=Math.round(nn/5e4*100),nl=ef.placeholder||"Ask Leo anything...";return ef.contextPickerEnabled&&ef.slashCommandsEnabled?nl="Ask, @ for context, / for commands":ef.slashCommandsEnabled&&(nl="Ask Leo, / for commands"),ek&&(nl="Tell Leo what to change about ".concat(G.E[ek],"...")),t8?nl="Message limit reached":tN?nl=ex||ev?"Hit send to start":"Attach a file to get started":T?nl="Add additional context...":tj?nl="Type to filter commands":tw?nl="Type to filter context":e$?nl="The ".concat(e$.title," brief — Generate sends it"):ed&&(nl=ed),(0,r.jsxs)("div",{className:"relative px-4 pb-4 flex-shrink-0",children:[ta&&ta.chatId!==eT&&(0,r.jsx)("p",{role:"status",className:"mb-2 text-xs text-muted-foreground",children:"Leo is finishing a submission in another conversation. You can keep editing here."}),Y&&ef.slashCommandsEnabled&&(0,r.jsx)(w,{}),ee&&ef.contextPickerEnabled&&(0,r.jsx)(I,{filter:tk,excludeRef:tg,onItemSelect:t0}),et&&(ef.filePickerEnabled||tN)&&(0,r.jsx)(A,{}),(0,r.jsxs)("div",{className:"relative",style:{isolation:"isolate",paddingTop:t8?"36px":void 0},children:[t8&&(0,r.jsx)("div",{className:(0,m.cn)("absolute inset-x-1.5 top-0 rounded-lg px-3 pt-2","border border-border-warning-subtle","bg-warning-subtle"),style:{zIndex:0,bottom:"20px"},children:(0,r.jsxs)("div",{className:"text-sm flex items-center gap-2.5 leading-6 overflow-hidden",children:[(0,r.jsx)("span",{className:"truncate min-w-0 text-warning-subtle-foreground",children:(0,i.Jt)(null==eg?void 0:eg.limitType)}),(0,r.jsxs)(g.$,{variant:"link",size:"sm",onClick:()=>eX({source:"leonardo-limit-hit",preselectedPlan:"pro"}),className:"h-auto p-0 gap-1 text-foreground-strong no-underline hover:no-underline hover:opacity-80 shrink-0",children:[(0,r.jsx)("span",{children:"Upgrade to"}),(0,r.jsx)(a.default,{name:"IconDiamond",size:14,fill:"filled"}),(0,r.jsx)("span",{children:"Pro."})]})]})}),(0,r.jsx)("div",{ref:tI,className:"contents",children:(0,r.jsxs)(l.r,{value:e0,onChange:t3,onKeyDown:t1,onPaste:tq,placeholder:nl,disabled:t8,textareaRef:tm,inputWrapClassName:tj||tw?"rounded-lg -mx-1 bg-muted px-2 py-0.5":void 0,bodyClassName:(0,m.cn)(t8&&"opacity-50"),images:e7.map(e=>
1({id:e.id,previewUrl:e.previewUrl,name:e.file.name})),onRemoveImage:tT,chips:e$||eJ.files.length>0||eP.length>0||en.length>0||tn.length>0||e2.length>0?(0,r.jsxs)(r.Fragment,{children:[e$&&(0,r.jsxs)(p.E,{variant:"outline",className:"gap-1","data-slot":"task-focus-chip",children:[(0,r.jsx)(L.I,{name:"IconChecklist",size:12}),(0,r.jsx)("span",{className:"max-w-36 truncate",children:e$.title}),(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>(0,c.PS)(null),icon:(0,r.jsx)(L.I,{name:"IconCrossMedium",size:12}),className:"size-4","aria-label":"Stop writing into the ".concat(e$.title," brief")})]}),e$&&eJ.files.map((e,t)=>(0,r.jsxs)(p.E,{variant:"outline",className:"gap-1","data-slot":"task-draft-file-chip",children:[(0,r.jsx)(L.I,{name:"IconPaperclip1",size:12}),(0,r.jsx)("span",{className:"max-w-28 truncate",children:e.name}),(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>(0,d.O1)(e$.taskId,e),icon:(0,r.jsx)(L.I,{name:"IconCrossMedium",size:12}),className:"size-4","aria-label":"Remove ".concat(e.name)})]},"".concat(e.name,"-").concat(t))),tn.map(e=>e.error?(0,r.jsxs)(p.E,{variant:"destructive-subtle",className:"gap-1",children:[(0,r.jsx)(L.I,{name:"IconExclamationTriangle",size:12}),(0,r.jsx)("span",{className:"max-w-28 truncate",children:e.file.name}),(0,r.jsx)("span",{className:"shrink-0",children:"failed"}),(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>void tO(e.id,e.file),icon:(0,r.jsx)(L.I,{name:"IconArrowRotateClockwise",size:12}),className:"size-4","aria-label":"Retry uploading ".concat(e.file.name)}),(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>tF(e.id),icon:(0,r.jsx)(L.I,{name:"IconCrossMedium",size:12}),className:"size-4","aria-label":"Remove ".concat(e.file.name)})]},e.id):(0,r.jsxs)(p.E,{variant:"outline",className:"gap-1 text-muted-foreground",children:[(0,r.jsx)(h.y,{size:"xs"}),(0,r.jsx)("span",{className:"max-w-28 truncate",children:e.file.name}),(0,r.jsx)("span",{className:"shrink-0",children:"uploading…"})]},e.id)),eP.map(e=>(0,r.jsx)(H.Qz,{item:e,...e.id?{onRemove:()=>ez((0,H._P)(eP,(0,H.CX)(e)))}:{}},(0,H.CX)(e))),e2.map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-foreground dark:bg-[#2B2B2B]",children:[(0,r.jsxs)(g.$,{variant:"outline",size:"xs",onClick:()=>e4(e),startIcon:(0,r.jsx)(L.I,{name:"IconFileText",size:12}),className:"h-auto gap-1.5 px-1.5 py-1 text-xs font-medium hover:bg-primary/20","aria-label":"View pasted content (".concat(e.kb," KB)"),children:["Pasted \xb7 ",e.kb," KB"]}),(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>tz(e.id),icon:(0,r.jsx)(a.default,{name:"IconCrossMedium",size:12,...Z}),className:"size-4 hover:bg-primary/20","aria-label":"Remove pasted content"})]},e.id)),en.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5 rounded-sm bg-primary/10 px-2.5 py-[4.2px] text-xs font-medium text-foreground",children:[e.icon&&X[e.icon]?(0,r.jsx)(a.default,{name:X[e.icon],size:12,...Z,className:"shrink-0"}):(0,r.jsx)(L.I,{name:"command"===e.type?"IconRunShortcut":"IconFileText",className:"h-3 w-3 shrink-0"}),e.label,(0,r.jsx)(f.K,{variant:"ghost",size:"xs",onClick:()=>{"command"===e.type?(R(null),ea(),ei(null)):(er(en.filter((e,n)=>n!==t)),ey(null),ej(null),eb(null))},icon:(0,r.jsx)(a.default,{name:"IconCrossMedium",size:12,...Z}),className:"ml-0.5 size-4 hover:bg-primary/20","aria-label":"Remove ".concat(e.label)})]},t))]}):void 0,actions:(0,r.jsx)(r.Fragment,{children:(tC||tS||ef.contextPickerEnabled||ef.slashCommandsEnabled)&&(0,r.jsxs)(b.rI,{children:[(0,r.jsx)(b.ty,{asChild:!0,children:(0,r.jsx)(f.K,{ref:tg,variant:"ghost",size:"sm",disabled:t8,icon:(0,r.jsx)(L.I,{name:"IconPlusMedium",size:16,fill:"outlined"}),className:"text-muted-foreground","aria-label":"Attach, add context, or run a command"})}),(0,r.jsxs)(b.SQ,{align:"start",side:"top",className:"w-64",onCloseAutoFocus:e=>{if(tp.current){var t;e.preventDefault(),null==(t=tm.current)||t.focus(),tp.current=!1}},children:[tC&&(0,r.jsxs)(b._2,{onSelect:()=>V(!0),className:"gap-2",children:[(0,r.jsx)(L.I,{name:"IconPaperclip1",size:16}),"Attach file"]}
1),tS&&(0,r.jsxs)(b._2,{disabled:tc||!t_&&e7.length>=D.SG,onSelect:()=>{var e;return null==(e=tu.current)?void 0:e.click()},className:"gap-2",children:[(0,r.jsx)(L.I,{name:"IconPaperclip3",size:16}),t_?"Attach image or CAD file":"Attach image"]}),ef.contextPickerEnabled&&(0,r.jsxs)(b._2,{onSelect:()=>{tp.current=!0,_(!1),M(!0),e0.includes("@")||e1(e0+"@")},className:"gap-2",children:[(0,r.jsx)(L.I,{name:"IconAt",size:16}),"Add context"]}),ef.slashCommandsEnabled&&(0,r.jsxs)(b._2,{onSelect:()=>{tp.current=!0,M(!1),ep(""),_(!0)},className:"gap-2",children:[(0,r.jsx)(L.I,{name:"IconRunShortcut",size:16}),"Run command"]})]})]})}),trailing:t7?(0,r.jsx)(p.E,{variant:"secondary",size:"sm",rounded:"round","aria-live":"polite",children:t7}):null,onSend:tJ,canSend:!ta&&!P&&!z&&!t8&&!nr&&!!(e0.trim()||T||e2.length>0||el),sending:tc,showStop:tQ||tV,onStop:tY,canStop:!t8,body:tN&&(ex||ev)?(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[(0,r.jsx)(a.default,{name:"IconFeather",size:16,fill:"filled",className:"text-primary-subtle-foreground"}),(0,r.jsxs)("span",{children:["Ready to"," ","generate-wiring"===T?"generate wiring diagram":"generate page"]})]}),(0,r.jsx)(g.$,{size:"sm",onClick:tJ,disabled:t8,startIcon:(0,r.jsx)(a.default,{name:"IconSparklesTwo",size:14,...Z}),children:"Generate"})]}):void 0,error:(nr||e6||te||tB.length>0)&&(0,r.jsxs)(r.Fragment,{children:[(nr||e6)&&(0,r.jsx)("p",{children:nr?"Message is ".concat(nn.toLocaleString()," characters — Leo can read up to ").concat(5e4.toLocaleString()," per message. Trim it or split it across messages."):e6}),te&&(0,r.jsx)("p",{children:te}),tB.map(e=>{let{id:t,error:n}=e;return(0,r.jsx)("p",{children:n},t)})]}),children:[(0,r.jsx)("input",{ref:td,id:"leo-file-input",type:"file",accept:tE,onChange:tP,className:"hidden"}),(0,r.jsx)("input",{ref:tu,id:"leo-image-input",type:"file",accept:t_?J:$,multiple:!0,onChange:tU,className:"hidden"})]})})]}),tZ?(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card px-3 py-2",children:[(0,r.jsx)("p",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:"Leo is generating — sending will restart with your new instruction."}),(0,r.jsx)(g.$,{size:"xs",variant:"default",onClick:()=>{t$(!1),tK()},children:"Restart with this"}),(0,r.jsx)(g.$,{size:"xs",variant:"ghost",onClick:()=>t$(!1),children:"Keep current run"})]}):ew?(0,r.jsx)("p",{className:"mt-2 px-1 text-xs text-muted-foreground",children:"Leo is generating — sending will restart with your new instruction."}):ek?(0,r.jsx)("p",{className:"mt-2 px-1 text-xs text-muted-foreground",children:"Generation mode — your message steers this draft instead of asking a question."}):null,(0,r.jsx)(x.lG,{open:null!==e5,onOpenChange:e=>!e&&e4(null),children:(0,r.jsxs)(x.Cf,{size:"lg",children:[(0,r.jsxs)(x.c7,{children:[(0,r.jsx)(x.L3,{children:"Pasted content"}),e5&&(0,r.jsxs)(x.rr,{children:[e5.kb," KB \xb7 ",e5.lines," ",1===e5.lines?"line":"lines"," \xb7 sent with your next message"]})]}),(0,r.jsx)(x.R4,{children:(0,r.jsx)("pre",{className:"max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border bg-muted p-3 text-xs text-foreground",children:null==e5?void 0:e5.text})})]})}),ns?(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2 px-1",children:[(0,r.jsx)("p",{className:"text-2xs font-normal text-muted-foreground",children:"Responses are generated using AI and may contain mistakes."}),(0,r.jsxs)("span",{className:(0,m.cn)("text-xs tabular-nums shrink-0",nr?"text-destructive-subtle-foreground":na>=90?"text-[#92700a] dark:text-[#fdc700]":"text-muted-foreground"),"aria-label":"".concat(nn.toLocaleString()," of ").concat(5e4.toLocaleString()," characters used"),children:[nn.toLocaleString(),"/",5e4.toLocaleString()]})]}):ne?(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2 px-1",children:[(0,r.jsx)("p",{className:"text-2xs font-normal text-muted-foreground",children:"Responses are generated using AI and may contain mistakes."}),(0,r.jsxs)("span",{className:(0,m.cn)("text-xs tabular-nums shrink-0",nt>=100?"text-warning-subtle-foreground":nt>=66?"text-foreground":"text-muted-foreground"),"aria-label":"".concat(null!=(j=null==t9?void 0:t9.used)?j:0," of ").concat(null!=(k=null==t9?void 0:t9.max)?k:0," daily messages used"),children:[null!=(N=null==t9?void 0:t9.used)?N:0,"/",null!=(S=null==t9?void 0:t9.max)?S:0," messages"]})]}):!t8&&eU>0&&(1===eU||eU%5==0)?(0,r.jsx)("p",{className:"text-2xs font-normal text-muted-foreground text-center mt-2",children:"Leo can make mistakes — 
1check important details."}):null]})}},61142:(e,t,n)=>{n.d(t,{UpgradeModalProvider:()=>h,v:()=>x});var r=n(95155),s=n(12115),a=n(28783),l=n(54774),i=n(34801),o=n(25016),c=n(20063),d=n(3255),u=n(43392);let m={pro:["Private repositories","Unlimited Leonardo messages","Priority access to Fleet Program opportunities"],startup:["Everything in Pro","Up to 10 team members","Role management & team billing","Analytics dashboard","Integrations (Slack, Notion)"]};function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd";return new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e/100)}let g=e=>{var t;let{isOpen:n,onClose:g,preselectedPlan:f="pro",reason:h}=e,{organization:x}=(0,a.Z)(),b=(0,c.useRouter)(),[v,y]=(0,s.useState)(f),[j,w]=(0,s.useState)("annual"),[k,I]=(0,s.useState)(!1),[N,S]=(0,s.useState)(null),[C,E]=(0,s.useState)(!1),[P,z]=(0,s.useState)(null),[L,T]=(0,s.useState)(!1),R=(0,s.useRef)(null),_=i.ZL[v].monthly,M=null!=(t=null==x?void 0:x.subscription_plan)?t:"free",A="free"!==M,O=(0,s.useMemo)(()=>["pro","startup"].filter(e=>!(0,i.yZ)(M,e)),[M]);(0,s.useEffect)(()=>{if(!C)return;let e=e=>{R.current&&!R.current.contains(e.target)&&E(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[C]),(0,s.useEffect)(()=>{n&&(O.includes(f)?y(f):O.length>0&&y(O[0]))},[n,f,O]),(0,s.useEffect)(()=>{if(!n||!A||!(null==x?void 0:x.id))return void z(null);let e=new AbortController;return T(!0),z(null),S(null),fetch("/api/stripe/proration-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:v,billingInterval:j,orgId:x.id}),signal:e.signal}).then(e=>e.json()).then(e=>{e.success&&z(e.data)}).catch(e=>{"AbortError"!==e.name&&console.error("Proration preview error:",e)}).finally(()=>{e.signal.aborted||T(!1)}),()=>e.abort()},[n,v,j,A,null==x?void 0:x.id]);let B=async()=>{if(null==x?void 0:x.id){I(!0),S(null);try{var e,t,n;let r=await fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:v,billingInterval:j,orgId:x.id})}),s=await r.json();if(s.success&&(null==(e=s.data)?void 0:e.upgraded)){let{refreshOrganization:e}=a.Z.getState();await e(),g(),b.push("/overview/settings/billing?upgraded=true")}else if(s.success&&(null==(t=s.data)?void 0:t.url))window.location.href=s.data.url;else{let e=(null==(n=s.error)?void 0:n.message)||"Something went wrong. Please try again.";console.error("Checkout error:",s.error),S(e),I(!1)}}catch(e){console.error("Checkout error:",e),S("Something went wrong. Please try again."),I(!1)}}},F="pro"===v?"free":"pro",G=i.uH[F],D=k?"Processing...":L?"Loading preview...":P?"Upgrade now — ".concat(p(P.amountDue,P.currency)):"Upgrade to ".concat(i.uH[v].name);return(0,r.jsx)(d.lG,{open:n,onOpenChange:e=>{e||g()},children:(0,r.jsx)(d.Cf,{className:"sm:max-w-[1060px] rounded-2xl p-0",children:(0,r.jsxs)("div",{className:"max-h-[90vh] overflow-y-auto p-6 sm:p-8 lg:p-10",children:[(0,r.jsxs)("div",{className:"mb-6 pr-10 sm:mb-8",children:[(0,r.jsx)("h2",{className:"text-2xl font-normal tracking-tight text-foreground-strong sm:text-display-xs lg:text-display-sm",children:"Access Private Repositories and More"}),(0,r.jsx)("p",{className:"mt-2 text-base text-muted-foreground",children:h||"Upgrade to ".concat(v," plan to access the full features of tnkr.")})]}),(0,r.jsxs)("div",{className:"mb-6 flex items-center justify-between rounded-lg border border-border bg-muted px-4 py-3 sm:px-5 sm:py-4",children:[(0,r.jsxs)("div",{className:"relative",ref:R,children:[(0,r.jsxs)("button",{onClick:()=>O.length>1&&E(!C),className:(0,o.cn)("flex items-center gap-2.5 rounded-md border border-border bg-background px-4 py-2 text-base text-foreground-strong transition-colors",O.length>1?"cursor-pointer hover:border-border-emphasis":"cursor-default"),children:[(0,r.jsx)(l.CentralIcon,{name:i.uH[v].icon,size:16,fill:"filled",className:"text-foreground"}),(0,r.jsxs)("span",{children:[i.uH[v].name," \xb7 $",_,"/mo."]}),O.length>1&&(0,r.jsx)(u.I,{name:"IconChevronBottom",size:16,className:"text-muted-foreground"})]}),C&&O.length>1&&(0,r.jsx)("div",{className:"absolute left-0 top-full z-10 mt-1 w-[220px] rounded-lg border border-border bg-popover py-1 shadow-xl",children:O.map(e=>(0,r.jsxs)("button",{onClick:()=>{y(e),E(!1)},className:(0,o.cn)("flex w-full cursor-pointer items-center gap-2.5 px-4 py-2.5 text-left text-sm transition-colors hover:bg-muted",v===e?"text-foreground-strong":"text-foreground"),children:[(0,r.jsx)(l.CentralIcon,{name:i.uH[e].icon,size:14,fill:"filled",className:"text-foreground"}),i.uH[e].name," \xb7 $",i.ZL[e].monthly,"/mo."]},e))})]}),"pro"===v&&(0,r.jsx)("span",{className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground",children:"POPULAR"})]}),(0,r.jsxs)("div",{className:"mb-6 sm:mb-8 rounded-lg border border-border bg-muted px-5 py-5 sm:px-6 sm:py-6",children:[(0,r.jsxs)("div",{className:"mb-5 flex items-center gap-1.5 text-base text-foreground-strong",children:[(0,r.jsx)("span",{children:"Everything in"}),(0,r.jsx)(l.CentralIcon,{name:G.icon,size:15,fill:"filled",className:"text-foreground"}),(0,r.jsx)("span",{className:"font-medium",children:G.name}),(0,r.jsx)("span",{children:", plus:"})]}),(0,r.jsx)("ul",{className:"flex flex-col gap-4",children:m[v].map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-3 text-base text-foreground-strong",children:[(0,r.jsx)(l.CentralIcon,{name:"IconCheckmark1Small",size:20,fill:"filled",className:"shrink-0 text-foreground-strong"}),e]},e))})]}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h3",{className:"mb-3 text-base font-medium text-foreground-strong",children:"Billing Options"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:[(0,r.jsxs)("button",{onClick:()=>w("annual"),className:"cursor-pointer flex items-center gap-3.5 rounded-lg border border-border px-5 py-5 text-left transition-colors hover:border-border-emphasis",children:[(0,r.jsx)("div",{className:(0,o.cn)("flex h-[20px] w-[20px] shrink-0 items-center justify-center rounded-full border-2","annual"===j?"border-black dark:border-white":"border-border-emphasis"),children:"annual"===j&&(0,r.jsx)("div",{className:"h-2.5 w-2.5 rounded-full bg-black dark:bg-white"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"text-base font-medium text-foreground-strong",children:"Pay Annually"}),(0,r.jsx)("span",{className:"rounded-md bg-emerald-500/15 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400",children:"Save 10%"})]}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",i.ZL[v].annual," per member, per month"]})]})]}),(0,r.jsxs)("button",{onClick:()=>w("monthly"),className:"cursor-pointer flex items-center gap-3.5 rounded-lg border border-border px-5 py-5 text-left transition-colors hover:border-border-emphasis",children:[(0,r.jsx)("div",{className:(0,o.cn)("flex h-[20px] w-[20px] shrink-0 items-center justify-center rounded-full border-2","monthly"===j?"border-black dark:border-white":"border-border-emphasis"),children:"monthly"===j&&(0,r.jsx)("div",{className:"h-2.5 w-2.5 rounded-full bg-black dark:bg-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-base font-medium text-foreground-strong",children:"Pay Monthly"}),(0,r.jsxs)("span",{className:"block text-sm text-muted-foreground",children:["$",i.ZL[v].monthly," per member, per month"]})]})]})]})]}),A&&(0,r.jsx)("div",{className:"mb-6 rounded-lg border border-border bg-muted px-5 py-4",children:L?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)(u.I,{name:"IconLoadingCircle",size:16,className:"animate-spin"}),"Calculating price change..."]}):P?(0,r.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between text-foreground",children:[(0,r.jsx)("span",{children:"Credit for unused time"}),(0,r.jsxs)("span",{children:["-",p(P.credit,P.currency)]})]}),(0,r.jsxs)("div",{className:"flex justify-between text-foreground",children:[(0,r.jsx)("span",{children:"New plan (prorated)"}),(0,r.jsx)("span",{children:p(P.newPlanCost,P.currency)})]}),(0,r.jsx)("div",{className:"border-t border-border pt-2",children:(0,r.jsxs)("div",{className:"flex justify-between font-medium text-foreground-strong",children:[(0,r.jsx)("span",{children:"Due today"}),(0,r.jsx)("span",{children:p(P.amountDue,P.currency)})]})})]}):null}),(0,r.jsxs)("p",{className:"mb-6 text-xs leading-caption text-foreground-disabled sm:text-sm sm:leading-body",children:["Your Tnkr subscription will auto-renew each month at the provided price unless canceled. Cancel via the Billing tab prior to renew
1al to avoid future charges."," ",(0,r.jsx)("a",{href:"/terms",className:"underline hover:text-muted-foreground",children:"Terms"})]}),N&&(0,r.jsx)("p",{className:"mb-4 rounded-[4px] border border-border bg-destructive/10 px-4 py-3 text-sm text-destructive-subtle-foreground",children:N}),(0,r.jsxs)("button",{onClick:B,disabled:k||L,className:(0,o.cn)("cursor-pointer rounded-lg bg-[#a94138] px-8 py-3 text-base font-medium text-[#f6eceb] shadow-sm transition-colors hover:bg-[#8b3632]",(k||L)&&"cursor-not-allowed opacity-60"),children:[k&&(0,r.jsx)(u.I,{name:"IconLoadingCircle",size:16,className:"mr-2 inline animate-spin"}),D]})]})})})},f=(0,s.createContext)(void 0),h=e=>{let{children:t}=e,[n,a]=(0,s.useState)(!1),[l,i]=(0,s.useState)({}),o=(0,s.useCallback)(e=>{i(null!=e?e:{}),a(!0)},[]),c=(0,s.useCallback)(()=>{a(!1)},[]);(0,s.useEffect)(()=>{let e=e=>{let t=e.detail;o({source:null==t?void 0:t.source,preselectedPlan:"pro",reason:null==t?void 0:t.reason})};return window.addEventListener("plan-upgrade-required",e),()=>window.removeEventListener("plan-upgrade-required",e)},[o]);let d=(0,s.useMemo)(()=>({openUpgradeModal:o,closeUpgradeModal:c}),[o,c]);return(0,r.jsxs)(f.Provider,{value:d,children:[t,(0,r.jsx)(g,{isOpen:n,onClose:c,preselectedPlan:l.preselectedPlan,reason:l.reason})]})};function x(){let e=(0,s.useContext)(f);if(!e)throw Error("useUpgradeModal must be used within UpgradeModalProvider");return e}},88131:(e,t,n)=>{n.d(t,{F:()=>a,Q:()=>s});var r=n(20751);let s=[{type:"workshop",name:"Workshop",description:"Short steps, 3D views. Less reading, more doing.",audience:"Makers, kits, community",pageCount:6,icon:"IconMaintenance",iconBg:"#C084FC",heroImage:r.md.LEO_TEMPLATE_WORKSHOP,pages:[{name:"Introduction",type:"intro"},{name:"Parts & Tools",type:"documentation"},{name:"Assembly",type:"tutorial"},{name:"Wiring",type:"tutorial"},{name:"Testing",type:"tutorial"},{name:"Next Steps",type:"documentation"}]},{type:"manual",name:"Manual",description:"Schematics, specs, and full system documentation.",audience:"Research, advanced builds, reference",page
1Count:9,icon:"IconBook",iconBg:"#22D3EE",heroImage:r.md.LEO_TEMPLATE_MANUAL,pages:[{name:"Overview",type:"intro"},{name:"Specifications",type:"documentation"},{name:"Bill of Materials",type:"documentation"},{name:"Mechanical Assembly",type:"tutorial"},{name:"Electrical Wiring",type:"tutorial"},{name:"Software Setup",type:"tutorial"},{name:"Calibration",type:"tutorial"},{name:"Troubleshooting",type:"documentation"},{name:"Appendix",type:"documentation"}]},{type:"guide",name:"Guide",description:"A tutorial that builds understanding, not just a robot.",audience:"Education, beginners, workshops",pageCount:7,icon:"IconHumanMashine",iconBg:"#34D399",heroImage:r.md.LEO_TEMPLATE_GUIDE,pages:[{name:"Introduction",type:"intro"},{name:"Key Features",type:"documentation"},{name:"Getting Started",type:"tutorial"},{name:"Build Guide",type:"tutorial"},{name:"Programming",type:"tutorial"},{name:"Projects & Ideas",type:"documentation"},{name:"Conclusion",type:"documentation"}]}],a=[{type:"write",label:"Write",icon:"IconPromptSuggestion",group:1,disabled:!1,requiresPro:!0},{type:"improve",label:"Improve",icon:"IconTextSelectDashed",group:1,disabled:!1,requiresPro:!0},{type:"suggest",label:"Suggest",icon:"IconMagicWand2",group:1,disabled:!1,requiresPro:!0},{type:"use-file-as-page",label:"Use file as page",icon:"IconBlankPagePortrait",group:2,disabled:!1,requiresPro:!0},{type:"generate-wiring",label:"Generate wiring",icon:"IconSearchlinesSparkle",group:2,disabled:!0,requiresPro:!0},{type:"generate-parts-list",label:"Generate parts list",icon:"IconSearchlinesSparkle",group:2,disabled:!0,requiresPro:!0},{type:"review",label:"Review",icon:"IconBubbleWideSparkle",group:3,disabled:!0,requiresPro:!0},{type:"summarize",label:"Summarize",icon:"IconCodeAnalyze",group:3,disabled:!1,requiresPro:!0}]},99588:(e,t,n)=>{n.d(t,{E:()=>r,f:()=>s});let r={assembly:"your steps",wiring:"your board",bom:"your parts list"},s={global:{greeting:"What can I help you with?",actionTiles:[{label:"Explore projects",icon:"IconSearchlinesSparkle",message:"Show me some interesting robotics projects on Tnkr"},{label:"Find a robot to build",icon:"IconMagicWand2",message:"Suggest a robot I could build as a beginner"},{label:"What is Tnkr?",icon:"IconCirclePlus",message:"What is Tnkr and what can I do here?"},{label:"What can Leo do?",icon:"IconTextSelectDashed",message:"What can you help me with as a robotics assistant?"}]},docs:{greeting:"Ask me about this project",actionTiles:[{label:"Summarize this project",icon:"IconTextSelectDashed",message:"Give me a summary of this project"},{label:"What parts do I need?",icon:"IconSearchlinesSparkle",message:"What parts and materials do I need to build this?"},{label:"How do I assemble this?",icon:"IconMagicWand2",message:"Walk me through the assembly process for this robot"},{label:"Show me the BOM",icon:"IconFileSparkle",message:"Show me the bill of materials for this project"}]},"central-docs":{greeting:"What are you building?",actionTiles:[{label:"Generate parts list",icon:"IconSearchlinesSparkle",slashCommand:"write",prompt:"Generate a bill of materials / parts list for this page as a markdown table with columns for Name, Quantity, and a short description. Infer the parts from the project context."},{label:"Improve",icon:"IconTextSelectDashed",slashCommand:"improve"},{label:"Suggest",icon:"IconMagicWand2",slashCommand:"suggest"},{label:"Write",icon:"IconPromptSuggestion",slashCommand:"write"}]},hardware:{greeting:"Ask me about this hardware",actionTiles:[{label:"Explain this assembly",icon:"IconSearchlinesSparkle",message:"Explain the assembly structure of this hardware"},{label:"List all parts",icon:"IconFileSparkle",message:"List all the parts in this assembly"},{label:"Generate step instructions",icon:"IconMagicWand2",message:"Generate step-by-step assembly instructions for this hardware"},{label:"Identify a component",icon:"IconTextSelectDashed",message:"Help me identify and understand a specific component in this assembly"}]},assembly:{greeting:"Ask me about your assembly plan",actionTiles:[{label:"What order do I build in?",icon:"IconTextSelectDashed",message:"What order should I build the sub-assemblies in?"},{label:"Parts in this plan",icon:"IconSearchlinesSparkle",message:"Which parts does the current assembly plan use, step by step?"},{label:"Review my current steps",icon:"IconFileSparkle",message:"Review my current assembly steps — anything missing or out of order?"}]},wiring:{greeting:"Ask me about your wiring",actionTiles:[{label:"Photograph your wiring",icon:"IconCamera1",requiresImages:!0,message:"Here's a photo of my wiring — read it and tell me what to draw or fix on the board."},{label:"Generate a wiring board",icon:"IconMagicWand2",message:"Generate a wiring board for this project from its BOM."},{label:"Explain this board",icon:"IconTextSelectDashed",message:"Explain the connections on my current wiring board."},{label:"Check my connections",icon:"IconSearchlinesSparkle",message:"Check my current wiring for missing or suspicious connections."},{label:"Power layout advice",icon:"IconFileSparkle",message:"How should I lay out power distribution for this project?"}]},bom:{greeting:"Ask me about your bill of materials",actionTiles:[{label:"Photograph your parts",icon:"IconCamera1",requiresImages:!0,message:"Here's a photo of the parts I received — check them against my bill of materials."},{label:"What parts do I need?",icon:"IconSearchlinesSparkle",message:"What parts and materials do I need to build this project?"},{label:"Explain my parts list",icon:"IconTextSelectDashed",message:"Explain the parts in my bill of materials and what each one is for."},{label:"Estimate the cost",icon:"IconFileSparkle",message:"Roughly how much would the parts for this project cost?"},{label:"Suggest alternatives",icon:"IconMagicWand2",message:"Suggest cheaper or easier-to-source alternatives for parts in this project."}]},mod:{greeting:"What are we changing?",actionTiles:[]},build:{greeting:"Ask me about this build",actionTiles:[{label:"Summarize this build",icon:"IconTextSelectDashed",message:"Give me a summary of this build"},{label:"What parts are used?",icon:"IconSearchlinesSparkle",message:"What parts and components are used in this build?"},{label:"How was this assembled?",icon:"IconMagicWand2",message:"How was this robot assembled? Walk me through the process"},{label:"Share build insights",icon:"IconFileSparkle",message:"What are the key design decisions and insights from this build?"}]}}}}]);

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.