1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26568,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function p(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function m(){var e={line:n,column:u};return function(t){return t.position=new h(e),g(a),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function f(r){var i=Error(t.source+":"+n+":"+u+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=u,i.source=e,t.silent);else throw i}function g(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function x(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return f("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,g(a);var y,v=[];for(x(v);y=function(){var e=m(),t=g(l);if(t){if(b(),!g(s))return f("property missing ':'");var n=g(o),i=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return g(c),i}}();)!1!==y&&(v.push(y),x(v));return v}},70454,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;a?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(26568))},62009,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||a.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,c):e.replace(l,c)).replace(i,o))}},15511,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),i=e.r(62009);function a(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a},4100,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},o=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(l)return l(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,l,d=arguments[0],p=1,m=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<m;++p)if(t=arguments[p],null!=t)for(n in t)r=u(d,n),d!==(i=u(t,n))&&(h&&i&&(o(i)||(a=s(i)))?(a?(a=!1,l=r&&s(r)?r:[]):l=r&&o(r)?r:{},c(d,{name:n,newValue:e(h,l,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let r=e.r(32061);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,
1configurable:!0});return t}},9885,(e,t,n)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return o}});let r=e.r(18050),i=e.r(74080),a=e.r(63599),l=e.r(9885),s=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=a.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,s.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let r=e.r(18050),i=e.r(71645),a=e.r(67585),l=e.r(52157);function s(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},n=(0,i.lazy)(()=>t.loader().then(s)),c=t.loading;function u(e){let s=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,u=o?i.Suspense:i.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(u,{...o?{fallback:s}:{},children:d})}return u.displayName="LoadableComponent",u}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i}});let r=e.r(55682)._(e.r(69093));function i(e,t){let n={};"function"==typeof e&&(n.loader=e);let i={...n,...t};return(0,r.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},27627,e=>{"use strict";var t=e.i(18050),n=e.i(71645),r=e.i(18566),i=e.i(38036),a=e.i(54858),l=e.i(75254);let s=(0,l.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),o=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),c=(0,l.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),u=(0,l.default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var d=e.i(86311),p=e.i(83086);let m=(0,l.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),h=(0,l.default)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var f=e.i(37727),g=e.i(44075),x=e.i(22016),b=e.i(7233),y=e.i(48256),v=e.i(26707),k=e.i(47780),w=e.i(73708);let j=(0,l.default)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);var N=e.i(53339);let S=(0,l.default)("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);var C=e.i(78583),A=e.i(63059),M=e.i(88712),_=e.i(32102),I=e.i(31245);let z=(0,l.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var E=e.i(43531),D=e.i(61911);let T=(0,l.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var P=e.i(61659),L=e.i(55436);let R=(0,l.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}
1]]);var F=e.i(22038);let O=(0,l.default)("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]);var B=e.i(47163),$=e.i(39312);let U=(0,l.default)("hammer",[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]);var H=e.i(91756);let q=(0,l.default)("gem",[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]),V=[{value:"auto",label:"Auto",Icon:p.Sparkles,hint:"Let SlateX pick the right mode"},{value:"quick",label:"Quick",Icon:$.Zap,hint:"Fast reply, no tools"},{value:"build",label:"Pro",Icon:U,hint:"Generate apps, brand kits, media"},{value:"deep",label:"Consensus answer",Icon:H.Telescope,hint:"30s parallel multi-AI consensus with sources"},{value:"research",label:"Deep report",Icon:H.Telescope,hint:"10â20 min deep report with tools"},{value:"slatex",label:"Slate X",Icon:q,hint:"Top-tier builder for the most demanding work"}],W=new Map(V.map(e=>[e.value,e])),G=V.filter(e=>"research"===e.value||"deep"===e.value);var X=e.i(76559);let K="slatex.demoRecents.v1",Y="slatex:demo-recents";function Q(){try{let e=window.localStorage.getItem(K),t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function J(e){let t=new Date(e.at).toISOString();return{id:e.id,projectId:`demo:${e.sceneId}`,projectName:"Demo",title:e.title,lastMessagePreview:e.preview,lastMessageAt:t,createdAt:t,updatedAt:t}}var Z=e.i(91799);let ee=(0,l.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),et="slatex.theme";function en({variant:e="icon",collapsed:r=!1}){let[i,a]=(0,n.useState)("dark");(0,n.useEffect)(()=>{a("light"===window.localStorage.getItem(et)?"light":"dark")},[]);let l=()=>{let e,t="dark"===i?"light":"dark";a(t),e=document.documentElement,"dark"===t?e.classList.add("dark"):e.classList.remove("dark");try{window.localStorage.setItem(et,t)}catch{}},s="dark"===i,o=s?"Switch to light theme":"Switch to dark theme",c=s?ee:Z.Moon;return"row"===e?(0,t.jsxs)("button",{onClick:l,"aria-label":o,title:o,className:(0,B.cn)("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",r&&"justify-center px-0"),children:[(0,t.jsx)(c,{size:16,className:"shrink-0"}),!r&&(0,t.jsx)("span",{children:s?"Light theme":"Dark theme"})]}):(0,t.jsx)("button",{onClick:l,"aria-label":o,title:o,className:"flex h-11 w-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground md:h-9 md:w-9",children:(0,t.jsx)(c,{size:18})})}let er=[{icon:p.Sparkles,label:"General",type:"general"},{icon:y.Globe,label:"Web Apps",type:"web_app"},{icon:v.Smartphone,label:"Mobile Apps",type:"mobile_app"},{icon:k.Palette,label:"Brand Kits",type:"brand_kit"},{icon:w.Image,label:"Images",type:"image"},{icon:j,label:"Videos",type:"video"},{icon:N.Music,label:"Music",type:"music"},{icon:S,label:"Presentations",type:"presentation"},{icon:C.FileText,label:"Documents",type:"document"}];function ei({onNewChat:e,lockedCapability:r,onLockCapability:l,composerMode:o,onSelectMode:c,mobileOpen:u=!1,onMobileClose:p,onSelectConversation:m,onReplayDemo:h,selectedConversationId:g,refreshKey:y}
1){let v=r||"general",k="general"===v?o:void 0,[w,j]=(0,n.useState)(!1),[N,S]=(0,n.useState)(""),[C,$]=(0,n.useState)(null),[U,H]=(0,n.useState)(null),[q,V]=(0,n.useState)([]),[W,K]=(0,n.useState)([]),[Z,ee]=(0,n.useState)(0),[et,ea]=(0,n.useState)(null),[el,es]=(0,n.useState)(""),[eo,ec]=(0,n.useState)(!1),[eu,ed]=(0,n.useState)([]),[ep,em]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(!1),[eg,ex]=(0,n.useState)(""),[eb,ey]=(0,n.useState)(!1),[ev,ek]=(0,n.useState)(null),[ew,ej]=(0,n.useState)(null),eN=async()=>{try{let e=await a.api.getProjects();ed(Array.isArray(e)?e:[])}catch{}},eS=async()=>{let e=eg.trim();if(!e)return void ef(!1);ey(!0);try{let t=await a.api.createProject(e);ed(e=>[t,...e]),ex(""),ef(!1)}catch{}finally{ey(!1)}},eC=async(e,t)=>{ej(e);try{await a.api.moveConversation(e,t),V(n=>n.map(n=>n.id===e?{...n,projectId:t}:n)),ek(null)}catch{}finally{ej(null)}},eA=()=>{ea(null),es("")},eM=async()=>{if(!et)return;let e=el.trim();if(!e)return void eA();ec(!0);try{await a.api.updateConversationTitle(et,e),V(t=>t.map(t=>t.id===et?{...t,title:e}:t)),eA()}catch{}finally{ec(!1)}};(0,n.useEffect)(()=>{let e=(0,i.getUser)();e&&H({email:e.email,name:e.name})},[]),(0,n.useEffect)(()=>{if(!u)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[u]),(0,n.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await a.api.getMyUsage(30);e||$({dollars:t.totalDollars,requests:t.totalRequests})}catch{}};t();let n=setInterval(t,6e4);return()=>{e=!0,clearInterval(n)}},[]),(0,n.useEffect)(()=>{let e=!1;return a.api.getRecentConversations(30).then(t=>{e||V(Array.isArray(t)?t:[])}).catch(()=>{}),()=>{e=!0}},[y]),(0,n.useEffect)(()=>{eN()},[y]),(0,n.useEffect)(()=>{let e=()=>K(Q());return e(),window.addEventListener(Y,e),window.addEventListener("storage",e),()=>{window.removeEventListener(Y,e),window.removeEventListener("storage",e)}},[y]);let e_=(0,n.useMemo)(()=>[...q,...W.map(J)].sort((e,t)=>new Date(t.lastMessageAt||t.updatedAt).getTime()-new Date(e.lastMessageAt||e.updatedAt).getTime()).slice(0,30),[q,W]),eI=(0,n.useMemo)(()=>eu.find(e=>e.id===ep)||null,[eu,ep]),ez=(0,n.useMemo)(()=>ep?e_.filter(e=>e.projectId===ep):e_,[e_,ep]),eE=N.trim().toLowerCase(),eD=(0,n.useMemo)(()=>eE?er.filter(e=>e.label.toLowerCase().includes(eE)):er,[eE]),eT=(0,n.useMemo)(()=>{let e;return(e=N.trim().toLowerCase())?G.filter(t=>t.label.toLowerCase().includes(e)||String(t.value).includes(e)):G},[N]),eP=(0,n.useMemo)(()=>eE?(0,X.searchVerticals)(N):[],[N,eE]);return(0,n.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await a.api.getUnreadCount();e||ee(t)}catch{}};t();let n=setInterval(t,6e4);return()=>{e=!0,clearInterval(n)}},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,onClick:p,className:(0,B.cn)("fixed inset-0 z-[60] bg-black/50 backdrop-blur-sm transition-opacity md:hidden",u?"opacity-100":"pointer-events-none opacity-0")}),(0,t.jsxs)("div",{className:(0,B.cn)("flex flex-col border-r border-border/50 bg-background md:bg-background/40 md:backdrop-blur-xl transition-all duration-200","md:relative md:translate-x-0 md:z-auto","fixed inset-y-0 left-0 z-[70] max-w-[85vw]",u?"translate-x-0":"-translate-x-full md:translate-x-0",w?"w-16":"w-64"),children:[(0,t.jsxs)("div",{className:"flex h-14 items-center justify-between border-b border-border px-4",children:[!w&&(0,t.jsxs)("span",{className:"flex items-center gap-2 text-lg font-bold tracking-tight",children:[(0,t.jsx)("span",{className:"deck-orb deck-orb--pulse",style:{"--orb":"var(--deck-cyan)"},"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Slate",(0,t.jsx)("span",{className:"text-brand",children:"X"})]})]}),(0,t.jsx)("button",{onClick:()=>j(!w),"aria-label":w?"Expand sidebar":"Collapse sidebar",className:"hidden h-8 w-8 items-center justify-center rounded-md hover:bg-accent md:flex",children:w?(0,t.jsx)(A.ChevronRight,{size:18}):(0,t.jsx)(s,{size:18})}),(0,t.jsx)("button",{onClick:p,"aria-label":"Close menu",className:"flex h-11 w-11 items-center justify-center rounded-md hover:bg-accent md:hidden",children:(0,t.jsx)(f.X,{size:20})})]}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsxs)("button",{onClick:()=>{e(),p?.()},className:(0,B.cn)("flex w-full items-center gap-2 rounded-lg border border-border px-3 py-2 text-sm","hover:bg-accent transition-colors",w&&"justify-center px-0"),children:[(0,t.jsx)(b.Plus,{size:16}
1),!w&&"New Chat"]})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-3",children:[!w&&(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-1.5",children:[(0,t.jsx)(L.Search,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>S(e.target.value),placeholder:"Search","data-testid":"nav-search-input",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),N&&(0,t.jsx)("button",{type:"button",onClick:()=>S(""),"aria-label":"Clear search",className:"rounded p-0.5 text-muted-foreground hover:text-foreground",children:(0,t.jsx)(f.X,{size:12})})]}),(!eE||eD.length>0)&&(0,t.jsxs)(t.Fragment,{children:[!w&&(0,t.jsx)("p",{className:"mb-2 px-2 text-xs font-medium uppercase text-muted-foreground",children:"Capabilities"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 md:flex md:flex-col md:gap-0 md:space-y-1",children:eD.map(e=>{let n=e.type===v;return(0,t.jsxs)("button",{onClick:()=>{l?.(e.type),p?.()},title:w?e.label:void 0,"aria-pressed":n,"data-testid":`cap-${e.type}`,className:(0,B.cn)("flex min-w-0 items-center gap-2 rounded-lg px-2 py-2 text-sm transition-colors md:w-full md:py-1.5",n?"bg-brand/15 text-brand":"text-muted-foreground hover:bg-accent hover:text-foreground",w&&"justify-center"),children:[(0,t.jsx)(e.icon,{size:16,className:"shrink-0"}),!w&&(0,t.jsx)("span",{className:"truncate",children:e.label})]},e.type)})})]}),(eT.length>0||eP.length>0)&&(0,t.jsxs)("div",{className:"mt-6",children:[!w&&(0,t.jsx)("p",{className:"mb-2 px-2 text-xs font-medium uppercase text-muted-foreground",children:"Modes"}),(0,t.jsxs)("div",{className:"space-y-1",children:[eT.map(e=>{let n=e.value===k;return(0,t.jsxs)("button",{onClick:()=>{c?.(n?"auto":e.value),p?.()},title:w?e.label:e.hint,"aria-pressed":n,"data-testid":`mode-${e.value}`,className:(0,B.cn)("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors",n?"bg-brand/15 text-brand":"text-muted-foreground hover:bg-accent hover:text-foreground",w&&"justify-center"),children:[(0,t.jsx)(e.Icon,{size:16}),!w&&e.label]},e.value)}),eP.map(e=>{let n=e.id===k;return(0,t.jsxs)("button",{onClick:()=>{c?.(e.id),p?.()},title:w?e.label:e.hint,"aria-pressed":n,"data-testid":`mode-${e.id}`,className:(0,B.cn)("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors",n?"bg-brand/15 text-brand":"text-muted-foreground hover:bg-accent hover:text-foreground",w&&"justify-center"),children:[(0,t.jsx)(e.Icon,{size:16}),!w&&e.label]},e.id)})]})]}),!w&&!eE&&(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between px-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Projects"}),(0,t.jsx)("button",{type:"button",onClick:()=>{ef(e=>!e),ex("")},"aria-label":"New project",title:"New project","data-testid":"new-project",className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(F.FolderPlus,{size:14})})]}),eh&&(0,t.jsx)("div",{className:"mb-2 px-1",children:(0,t.jsx)("input",{autoFocus:!0,value:eg,onChange:e=>ex(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),eS()):"Escape"===e.key&&(e.preventDefault(),ef(!1),ex(""))},onBlur:()=>void eS(),disabled:eb,placeholder:"Project name","data-testid":"new-project-input",className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm text-foreground outline-none focus:border-brand"})}),(0,t.jsxs)("div",{className:"space-y-1",children:[0===eu.length&&!eh&&(0,t.jsx)("p",{className:"px-2 py-1 text-xs text-muted-foreground/70",children:"No projects yet"}),eu.map(e=>{let n=e.id===ep;return(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>em(t=>t===e.id?null:e.id),title:e.name,"aria-pressed":n,"data-testid":`project-${e.id.slice(0,8)}`,className:(0,B.cn)("flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors",n?"bg-brand/15 text-brand":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[(0,t.jsx)(R,{size:16,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})},e.id)})]})]}),!w&&!eE&&(ez.length>0||ep)&&(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between px-2",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium uppercase text-muted-foreground",children:eI?eI.name:"Recent
1Chats"}),eI&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(x.default,{href:`/workspace/${eI.id}`,"data-testid":`open-workspace-${eI.id.slice(0,8)}`,className:"rounded px-1.5 text-[10px] font-medium uppercase text-muted-foreground hover:text-foreground",children:"Files"}),(0,t.jsx)("button",{type:"button",onClick:()=>em(null),"data-testid":"clear-project-filter",className:"rounded px-1.5 text-[10px] font-medium uppercase text-muted-foreground hover:text-foreground",children:"All"})]})]}),0===ez.length&&ep&&(0,t.jsx)("p",{className:"px-2 py-1 text-xs text-muted-foreground/70",children:"No chats in this project yet"}),(0,t.jsx)("div",{className:"space-y-1",children:ez.map(e=>{let n=e.id.startsWith("demo:"),r=e.title?.trim()||e.lastMessagePreview?.trim()||e.projectName?.trim()||"Untitled chat",i=n?"demo":e.id.slice(0,8),a=g===e.id;return et===e.id?(0,t.jsxs)("div",{className:"flex flex-col gap-1 rounded-lg border border-brand/40 bg-brand/10 px-2 py-1.5",children:[(0,t.jsx)("input",{autoFocus:!0,value:el,onChange:e=>es(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),eM()):"Escape"===e.key&&(e.preventDefault(),eA())},disabled:eo,className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm text-foreground outline-none focus:border-brand"}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:eA,disabled:eo,"aria-label":"Cancel rename",className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(f.X,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:()=>void eM(),disabled:eo||!el.trim(),"aria-label":"Save rename",className:"rounded-md p-1 text-brand hover:bg-brand/15 disabled:opacity-50",children:(0,t.jsx)(E.Check,{size:14})})]})]},e.id):(0,t.jsxs)("div",{"data-testid":`recent-${i}`,"data-active":a?"true":void 0,className:(0,B.cn)("group relative flex items-center gap-1 rounded-lg pr-1 transition-colors",a?"bg-brand/15 text-brand-foreground":"text-muted-foreground hover:bg-accent"),children:[(0,t.jsxs)("button",{onClick:()=>{if(n){let t=W.find(t=>t.id===e.id);t&&h?.(t.prompt)}else m?.(e.id,e.projectId);p?.()},title:r,"aria-current":a?"true":void 0,className:"flex min-w-0 flex-1 flex-col items-start gap-0.5 px-2 py-1.5 text-left text-sm",children:[(0,t.jsx)("span",{className:(0,B.cn)("line-clamp-1 w-full",a?"font-medium text-brand":"text-foreground group-hover:text-foreground"),children:r}),(0,t.jsx)("span",{className:(0,B.cn)("font-mono text-[10px] uppercase tracking-wide",a?"text-brand/70":"text-muted-foreground/70"),children:i})]}),!n&&(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),ea(e.id),es(e.title?.trim()||r)},"aria-label":"Rename chat",title:"Rename",className:(0,B.cn)("shrink-0 rounded-md p-1.5 transition-opacity hover:bg-accent",a?"text-brand opacity-100":"opacity-0 group-hover:opacity-100"),children:(0,t.jsx)(z,{size:14})}),!n&&eu.length>0&&(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),ek(t=>t===e.id?null:e.id)},"aria-label":"Move to project",title:"Move to project","data-testid":`move-${i}`,className:(0,B.cn)("rounded-md p-1.5 transition-opacity hover:bg-accent",a?"text-brand opacity-100":"opacity-0 group-hover:opacity-100"),children:(0,t.jsx)(O,{size:14})}),ev===e.id&&(0,t.jsxs)("div",{className:"absolute right-0 top-8 z-10 w-44 rounded-lg border border-border bg-popover p-1 shadow-lg",children:[(0,t.jsx)("p",{className:"px-2 py-1 text-[10px] font-medium uppercase text-muted-foreground",children:"Move to project"}),eu.map(n=>(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),eC(e.id,n.id)},disabled:ew===e.id||n.id===e.projectId,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground hover:bg-accent disabled:opacity-40",children:[(0,t.jsx)(R,{size:14,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:n.name})]},n.id))]})]})]},e.id)})})]})]}),(0,t.jsxs)("div",{className:"border-t border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-1 md:block md:space-y-2",children:[(0,t.jsxs)(x.default,{href:"/personas",className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",w&&"justify-center px-1"),title:"My Personas â saved people you can reuse across generations",children:[(0,t.jsx)(D.Users,{size:16}),!w&&(0,t.jsx)("span",{children:"My Personas"})]}),(0,t.jsxs)(x.default,{href:"/agents",className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",w&&"justify-center px-1"),title:"Agents â always-on monitors that watch and alert you",children:[(0,t.jsx)(I.Bot,{size:16}),!w&&(0,t.jsx)("span",{children:"Agents"})]}),(0,t.jsxs)("a",{href:"/inbox",className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",w&&"justify-center px-1"),title:Z>0?`${Z} unread notification${1===Z?"":"s"}`:"Inbox",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(_.Inbox,{size:16}),Z>0&&(0,t.jsx)("span",{className:"absolute -right-1.5 -top-1.5 inline-flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-red-500 px-1 text-[9px] font-bold leading-none text-white",children:Z>9?"9+":Z})]}),!w&&(0,t.jsxs)("span",{className:"flex flex-1 items-baseline justify-between",children:[(0,t.jsx)("span",{children:"Inbox"}),Z>0&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-red-500",children:[Z," new"]})]})]}),(0,t.jsxs)("a",{href:"/settings",className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",w&&"justify-center px-1"),title:"Settings â profile, subscription, packages",children:[(0,t.jsx)(T,{size:16}),!w&&(0,t.jsx)("span",{children:"Settings"})]}),(0,t.jsxs)("a",{href:"/billing","data-testid":"nav-billing",className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",w&&"justify-center px-1"),title:"Plans & billing â your plan, credits, and upgrades",children:[(0,t.jsx)(P.CreditCard,{size:16}),!w&&(0,t.jsx)("span",{children:"Plans & billing"})]})]}),(0,t.jsx)(en,{variant:"row",collapsed:w}),C&&(0,t.jsxs)("a",{href:"/usage",className:(0,B.cn)("flex items-center gap-2 rounded-lg bg-muted/40 px-2 py-1.5 text-xs transition-colors hover:bg-muted",w&&"justify-center px-1"),title:`Estimated spend over the last 30 days â ${C.requests} requests. Click for plan limits.`,children:[(0,t.jsx)(M.CircleDollarSign,{size:14,className:"text-brand shrink-0"}),!w&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-baseline justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Est. spend"}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",C.dollars.toFixed(C.dollars>=1?2:4)]})]})]}),(0,t.jsxs)("div",{className:(0,B.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5",w&&"justify-center"),children:[(0,t.jsx)("div",{className:"h-7 w-7 rounded-full bg-brand/20 flex items-center justify-center",children:(0,t.jsx)(d.MessageSquare,{size:14,className:"text-brand"})}),!w&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm text-muted-foreground",title:U?.email,children:U?.name||U?.email||"Guest"}),U&&(0,t.jsx)("button",{onClick:()=>{(0,i.clearSession)(),window.location.assign("/login")},className:"shrink-0 whitespace-nowrap rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Sign out",children:"Sign out"})]})]})]})]})]})}let ea=(0,l.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var el=e.i(91810),es=e.i(63209);let eo=(0,l.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var ec=e.i(84614);
1let eu=(0,l.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),ed=(0,l.default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var ep=e.i(75558),em=e.i(10289);let eh=(0,l.default)("repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);var ef=e.i(3116),eg=e.i(31278),ex=e.i(78894);function eb(){}function ey(){}let ev=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ek=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ew={};function ej(e,t){return((t||ew).jsx?ek:ev).test(e)}let eN=/[ \t\n\f\r]/g;function eS(e){return""===e.replace(eN,"")}class eC{constructor(e,t){this.attribute=t,this.property=e}}eC.prototype.attribute="",eC.prototype.booleanish=!1,eC.prototype.boolean=!1,eC.prototype.commaOrSpaceSeparated=!1,eC.prototype.commaSeparated=!1,eC.prototype.defined=!1,eC.prototype.mustUseProperty=!1,eC.prototype.number=!1,eC.prototype.overloadedBoolean=!1,eC.prototype.property="",eC.prototype.spaceSeparated=!1,eC.prototype.space=void 0;let eA=0,eM=eP(),e_=eP(),eI=eP(),ez=eP(),eE=eP(),eD=eP(),eT=eP();function eP(){return 2**++eA}e.s(["boolean",0,eM,"booleanish",0,e_,"commaOrSpaceSeparated",0,eT,"commaSeparated",0,eD,"number",0,ez,"overloadedBoolean",0,eI,"spaceSeparated",0,eE],744);var eL=e.i(744);let eR=Object.keys(eL);class eF extends eC{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<eR.length;){const e=eR[i];!function(e,t,n){n&&(e[t]=n)}(this,eR[i],(n&eL[e])===eL[e])}}}function eO(e){return e.toLowerCase()}eF.prototype.defined=!0;let eB=/[A-Z]/g,e$=/-[a-z]/g,eU=/^data[-\w.:]+$/i;function eH(e){return"-"+e.toLowerCase()}function eq(e){return e.charAt(1).toUpperCase()}let eV={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class eW{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function eG(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new eW(n,r,t)}function eX(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new eF(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[eO(r)]=r,n[eO(a.attribute)]=r}return new eW(t,n,e.space)}eW.prototype.normal={},eW.prototype.property={},eW.prototype.space=void 0;let eK=eX({properties:{ariaActiveDescendant:null,ariaAtomic:e_,ariaAutoComplete:null,ariaBusy:e_,ariaChecked:e_,ariaColCount:ez,ariaColIndex:ez,ariaColSpan:ez,ariaControls:eE,ariaCurrent:null,ariaDescribedBy:eE,ariaDetails:null,ariaDisabled:e_,ariaDropEffect:eE,ariaErrorMessage:null,ariaExpanded:e_,ariaFlowTo:eE,ariaGrabbed:e_,ariaHasPopup:null,ariaHidden:e_,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eE,ariaLevel:ez,ariaLive:null,ariaModal:e_,ariaMultiLine:e_,ariaMultiSelectable:e_,ariaOrientation:null,ariaOwns:eE,ariaPlaceholder:null,ariaPosInSet:ez,ariaPressed:e_,ariaReadOnly:e_,ariaRelevant:null,ariaRequired:e_,ariaRoleDescription:eE,ariaRowCount:ez,ariaRowIndex:ez,ariaRowSpan:ez,ariaSelected:e_,ariaSetSize:ez,ariaSort:null,ariaValueMax:ez,ariaValueMin:ez,ariaValueNow:ez,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function eY(e,t){return t in e?e[t]:t}function eQ(e,t){return eY(e,t.toLowerCase())}let eJ=eX({attributes:{acceptcharset:"accept-charset",classname:"
1class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:eD,acceptCharset:eE,accessKey:eE,action:null,allow:null,allowFullScreen:eM,allowPaymentRequest:eM,allowUserMedia:eM,alt:null,as:null,async:eM,autoCapitalize:null,autoComplete:eE,autoFocus:eM,autoPlay:eM,blocking:eE,capture:null,charSet:null,checked:eM,cite:null,className:eE,cols:ez,colSpan:null,content:null,contentEditable:e_,controls:eM,controlsList:eE,coords:ez|eD,crossOrigin:null,data:null,dateTime:null,decoding:null,default:eM,defer:eM,dir:null,dirName:null,disabled:eM,download:eI,draggable:e_,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:eM,formTarget:null,headers:eE,height:ez,hidden:eI,high:ez,href:null,hrefLang:null,htmlFor:eE,httpEquiv:eE,id:null,imageSizes:null,imageSrcSet:null,inert:eM,inputMode:null,integrity:null,is:null,isMap:eM,itemId:null,itemProp:eE,itemRef:eE,itemScope:eM,itemType:eE,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:eM,low:ez,manifest:null,max:null,maxLength:ez,media:null,method:null,min:null,minLength:ez,multiple:eM,muted:eM,name:null,nonce:null,noModule:eM,noValidate:eM,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:eM,optimum:ez,pattern:null,ping:eE,placeholder:null,playsInline:eM,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:eM,referrerPolicy:null,rel:eE,required:eM,reversed:eM,rows:ez,rowSpan:ez,sandbox:eE,scope:null,scoped:eM,seamless:eM,selected:eM,shadowRootClonable:eM,shadowRootDelegatesFocus:eM,shadowRootMode:null,shape:null,size:ez,sizes:null,slot:null,span:ez,spellCheck:e_,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ez,step:null,style:null,tabIndex:ez,target:null,title:null,translate:null,type:null,typeMustMatch:eM,useMap:null,value:e_,width:ez,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eE,axis:null,background:null,bgColor:null,border:ez,borderColor:null,bottomMargin:ez,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:eM,declare:eM,event:null,face:null,frame:null,frameBorder:null,hSpace:ez,leftMargin:ez,link:null,longDesc:null,lowSrc:null,marginHeight:ez,marginWidth:ez,noResize:eM,noHref:eM,noShade:eM,noWrap:eM,object:null,profile:null,prompt:null,rev:null,rightMargin:ez,rules:null,scheme:null,scrolling:e_,standby:null,summary:null,text:null,topMargin:ez,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ez,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:eM,disableRemotePlayback:eM,prefix:null,property:null,results:ez,security:null,unselectable:null},space:"html",transform:eQ}),eZ=eX({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
1dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:eT,accentHeight:ez,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ez,amplitude:ez,arabicForm:null,ascent:ez,attributeName:null,attributeType:null,azimuth:ez,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ez,by:null,calcMode:null,capHeight:ez,className:eE,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
1dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ez,diffuseConstant:ez,direction:null,display:null,dur:null,divisor:ez,dominantBaseline:null,download:eM,dx:null,dy:null,edgeMode:null,editable:null,elevation:ez,enableBackground:null,end:null,event:null,exponent:ez,externalResourcesRequired:null,fill:null,fillOpacity:ez,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:eD,g2:eD,glyphName:eD,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ez,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ez,horizOriginX:ez,horizOriginY:ez,id:null,ideographic:ez,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ez,k:ez,k1:ez,k2:ez,k3:ez,k4:ez,kernelMatrix:eT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ez,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ez,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ez,overlineThickness:ez,paintOrder:null,panose1:null,path:null,pathLength:ez,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eE,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ez,pointsAtY:ez,pointsAtZ:ez,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eT,rev:eT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eT,requiredFeatures:eT,requiredFonts:eT,requiredFormats:eT,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ez,specularExponent:ez,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ez,strikethroughThickness:ez,string:null,stroke:null,strokeDashArray:eT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ez,strokeOpacity:ez,strokeWidth:null,style:null,surfaceScale:ez,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eT,tabIndex:ez,tableValues:null,target:null,targetX:ez,targetY:ez,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ez,underlineThickness:ez,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ez,values:null,vAlphabetic:ez,vMathematical:ez,vectorEffect:null,vHanging:ez,vIdeographic:ez,version:null,vertAdvY:ez,vertOriginX:ez,vertOriginY:ez,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ez,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eY}),e0=eX({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>
1"xlink:"+t.slice(5).toLowerCase()}),e1=eX({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eQ}),e2=eX({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),e3=eG([eK,eJ,e0,e1,e2],"html"),e5=eG([eK,eZ,e0,e1,e2],"svg");var e4=e.i(15511);let e6=e8("end"),e9=e8("start");function e8(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function e7(e){return e&&"object"==typeof e?"position"in e||"type"in e?tt(e.position):"start"in e||"end"in e?tt(e):"line"in e||"column"in e?te(e):"":""}function te(e){return tn(e&&e.line)+":"+tn(e&&e.column)}function tt(e){return te(e&&e.start)+"-"+te(e&&e.end)}function tn(e){return e&&"number"==typeof e?e:1}class tr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=e7(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tr.prototype.file="",tr.prototype.name="",tr.prototype.reason="",tr.prototype.message="",tr.prototype.stack="",tr.prototype.column=void 0,tr.prototype.line=void 0,tr.prototype.ancestors=void 0,tr.prototype.cause=void 0,tr.prototype.fatal=void 0,tr.prototype.place=void 0,tr.prototype.ruleId=void 0,tr.prototype.source=void 0;let ti={}.hasOwnProperty,ta=new Map,tl=/[A-Z]/g,ts=new Set(["table","tbody","thead","tfoot","tr"]),to=new Set(["td","th"]),tc="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tu(e,t,n){var r,i,a,l,s,o,c,u,d;let p,m,h,f,g,x,b,y,v,k,w;return"element"===t.type?(r=e,i=t,a=n,m=p=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===p.space&&(r.schema=e5),r.ancestors.push(i),h=th(r,i.tagName,!1),f=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&ti.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=eO(t),r=t,i=eC;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&eU.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(e$,eq);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!e$.test(e)){let n=e.replace(eB,eH);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=eF}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,e4.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new tr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=tc+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)ti.call(e,t)&&(n[function(e){let t=e.replace(tl,tg);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?eV[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,l]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof l&&to.has(t.tagName)?n=l:i[r]=l}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=tm(r,i),ts.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&eS(e.value):eS(e))})),td(r,f,h,i),tp(f,g),r.ancestors.pop(),r.schema=p,r.create(i,h,f,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return eb("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}tf(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(l=e,s=t,o=n,b=x=l.schema,"svg"===s.name&&"html"===x.space&&(l.schema=e5),l.ancestors.push(s),y=null===s.name?l.Fragment:th(l,s.name,!0),v=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];eb("ExpressionStatement"===t.type);let i=t.expression;
1eb("ObjectExpression"===i.type);let a=i.properties[0];eb("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else tf(e,t.position);else{let i,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];eb("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else tf(e,t.position);else i=null===r.value||r.value;n[a]=i}return n}(l,s),k=tm(l,s),td(l,v,y,s),tp(v,k),l.ancestors.pop(),l.schema=x,l.create(s,y,v,o)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tf(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,tp(w={},tm(c,u)),c.create(u,c.Fragment,w,d)):"text"===t.type?t.value:void 0}function td(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tp(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tm(e,t){let n=[],r=-1,i=e.passKeys?new Map:ta;for(;++r<t.children.length;){let a,l=t.children[r];if(e.passKeys){let e="element"===l.type?l.tagName:"mdxJsxFlowElement"===l.type||"mdxJsxTextElement"===l.type?l.name:void 0;if(e){let t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}let s=tu(e,l,a);void 0!==s&&n.push(s)}return n}function th(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=ej(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}eb(e,"always a result"),r=e}else r=ej(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return ti.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);tf(e)}function tf(e,t){let n=new tr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=tc+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tg(e){return"-"+e.toLowerCase()}let tx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tb={};function ty(e,t){let n=t||tb;return tv(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function tv(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return tk(e.children,t,n)}return Array.isArray(e)?tk(e,t,n):""}function tk(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=tv(e[i],t,n);return r.join("")}function tw(e,t,n,r){let i,a=e.length,l=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)(i=r.slice(l,l+1e4)).unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function tj(e,t){return e.length>0?(tw(e,e.length,0,t),e):t}let tN={}.hasOwnProperty;function tS(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(tN.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){tN.call(i,r)||(i[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);tw(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let tC=tF(/[A-Za-z]/),tA=tF(/[\dA-Za-z]/),tM=tF(/[#-'*+\--9=?A-Z^-~]/);function t_(e){return null!==e&&(e<32||127===e)}let tI=tF(/\d/),tz=tF(/[\dA-Fa-f]/),tE=tF(/[!-/:-@[-`{-~]/);function tD(e){return null!==e&&e<-2}function tT(e){return null!==e&&(e<0||32===e)}function tP(e){return -2===e||-1===e||32===e}let tL=tF(/\p{P}|\p{S}/u),tR=tF(/\s/);function tF(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function tO(e,t,n,r){let i=r?r-1:1/0,a=0;return function(r){return tP(r)?(e.enter(n),function r(l){return tP(l)&&a++<i?(e.consume(l),r):(e.exit(n),t(l))}(r)):t(r)}}let tB={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tO(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tD(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},t$={tokenize:function(e){let t,n,r,i=this,a=[],l=0;return s;function s(t){if(l<a.length){let n=a[l];return i.containerState=n[1],e.attempt(n[0].continuation,o,c)(t)}return c(t)}function o(e){if(l++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,a=r;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){n=i.events[a][1].end;break}g(l);let s=r;for(;s<i.events.length;)i.events[s][1].end={...n},s++;return tw(i.events,a+1,0,i.events.slice(r)),i.events.length=s,c(e)}return s(e)}function c(n){if(l===a.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(tU,u,d)(n)}function u(e){return t&&x(),g(l),p(e)}function d(e){return i.parser.lazy[i.now().line]=l!==a.length,r=i.now().offset,h(e)}function p(t){return i.containerState={},e.attempt(tU,m,h)(t)}function m(e){return l++,a.push([i.currentConstruct,i.containerState]),p(e)}function h(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){f(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return tD(n)?(e.consume(n),f(e.exit("chunkFlow")),l=0,i.interrupt=void 0,s):(e.consume(n),t)}(r)}function f(e,a){let s=i.sliceStream(e);
1if(a&&s.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(s),i.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let s=i.events.length,o=s;for(;o--;)if("exit"===i.events[o][0]&&"chunkFlow"===i.events[o][1].type){if(e){n=i.events[o][1].end;break}e=!0}for(g(l),a=s;a<i.events.length;)i.events[a][1].end={...n},a++;tw(i.events,o+1,0,i.events.slice(s)),i.events.length=a}}function g(t){let n=a.length;for(;n-- >t;){let t=a[n];i.containerState=t[1],t[0].exit.call(i,e)}a.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},tU={tokenize:function(e,t,n){return tO(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tH={partial:!0,tokenize:function(e,t,n){return function(t){return tP(t)?tO(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tD(e)?t(e):n(e)}}};class tq{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tV(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tV(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tV(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tV(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tV(this.left,t.reverse())}}}function tV(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tW(e){let t,n,r,i,a,l,s,o={},c=-1,u=new tq(e);for(;++c<u.length;){for(;c in o;)c=o[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(l=t[1]._tokenizer.events).length&&"lineEndingBlank"===l[r][1].type&&(r+=2),r<l.length&&"content"===l[r][1].type))for(;++r<l.length&&"content"!==l[r][1].type;)"chunkText"===l[r][1].type&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(o,function(e,t){let n,r,i=e.get(t)[1],a=e.get(t)[2],l=t-1,s=[],o=i._tokenizer;!o&&(o=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let c=o.events,u=[],d={},p=-1,m=i,h=0,f=0,g=[0];for(;m;){for(;e.get(++l)[1]!==m;);s.push(l),!m._tokenizer&&(n=a.sliceStream(m),m.next||n.push(null),r&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(n),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),r=m,m=m.next}for(m=i;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(f=p+1,g.push(f),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):g.pop(),p=g.length;p--;){let t=c.slice(g[p],g[p+1]),n=s.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return d}(u,c)),c=o[c],s=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=u.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;
1n&&(t[1].end={...u.get(n)[1].start},(a=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,a))}}return tw(e,0,1/0,u.slice(0)),!s}let tG={resolve:function(e){return tW(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):tD(t)?e.check(tX,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tX={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tO(e,i,"linePrefix")};function i(i){if(null===i||tD(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},tK={tokenize:function(e){let t=this,n=e.attempt(tH,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,tO(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tG,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tY={resolveAll:t0()},tQ=tZ("string"),tJ=tZ("text");function tZ(e){return{resolveAll:t0("text"===e?t1:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,l);return a;function a(e){return o(e)?i(e):l(e)}function l(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return o(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function o(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function t0(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function t1(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],a=t.sliceStream(i),l=a.length,s=-1,o=0;for(;l--;){let e=a[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)o++,s--;if(s)break;s=-1}else if(-2===e)r=!0,o++;else if(-1===e);else{l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){let a={type:n===e.length||r||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:i.start._bufferIndex+s,_index:i.start._index+l,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function t2(e){return null===e||tT(e)||tR(e)?1:tL(e)?2:void 0}function t3(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let t5={name:"attention",resolveAll:function(e,t){let n,r,i,a,l,s,o,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};t4(d,-s),t4(p,s),a={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[n][1].end={...a.start},e[u][1].start={...l.end},o=[],e[n][1].end.offset-e[n][1].start.offset&&(o=tj(o,[["enter",e[n][1],t],["exit",e[n][1],t]])),o=tj(o,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),o=tj(o,t3(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),o=tj(o,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,o=tj(o,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,tw(e,n-1,u-n+3,o),u=n+o.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,a=t2(i);return function(l){return n=l,e.enter("attentionSequence"),function l(s){if(s===n)return e.consume(s),l;let o=e.exit("attentionSequence"),c=t2(s),u=!c||2===c&&a||r.includes(s),d=!a||2===a&&c||r.includes(i);return o._open=!!(42===n?u:u&&(a||!d)),o._close=!!(42===n?d:d&&(c||!u)),t(s)}(l)}}};function t4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let t6={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return tP(t)?tO(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(t6,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return tP(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},t9={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return tE(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},t8=document.createElement("i");function t7(e){let t="&"+e+";";t8.innerHTML=t;let n=t8.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let ne={name:"characterReference",tokenize:function(e,t,n){let r,i,a=this,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,i=tA,c(t))}function o(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=tz,c):(e.enter("characterReferenceValue"),r=7,i=tI,c(t))}function c(s){if(59===s&&l){let r=e.exit("characterReferenceValue");return i!==tA||t7(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<r?(e.consume(s),c):n(s)}}},nt={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},nn={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l};
1function l(t){return e.enter("codeFencedFence"),tP(t)?tO(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)}function o(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a>=s?(e.exit("codeFencedFenceSequence"),tP(i)?tO(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||tD(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},l=0,s=0;return function(t){var a;let c;return a=t,l=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(s++,e.consume(i),t):s<3?n(i):(e.exit("codeFencedFenceSequence"),tP(i)?tO(e,o,"whitespace")(i):o(i))}(a)};function o(a){return null===a||tD(a)?(e.exit("codeFencedFence"),i.interrupt?t(a):e.check(nt,u,h)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tD(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(i)):tP(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tO(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(a))}function c(t){return null===t||tD(t)?o(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tD(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function u(t){return e.attempt(a,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return l>0&&tP(t)?tO(e,m,"linePrefix",l+1)(t):m(t)}function m(t){return null===t||tD(t)?e.check(nt,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tD(n)?(e.exit("codeFlowValue"),m(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},nr={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),tO(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?a(n):tD(n)?e.attempt(ni,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tD(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},ni={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):tD(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):tO(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):tD(e)?i(e):n(e)}}};function na(e,t,n,r,i,a,l,s,o){let c=o||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),d):null===t||32===t||41===t||t_(t)?n(t):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||tD(t)?n(t):(e.consume(t),92===t?m:p)}function m(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(i){return!u&&(null===i||41===i||tT(i))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(i)):u<c&&40===i?(e.consume(i),u++,h):41===i?(e.consume(i),u--,h):null===i||32===i||40===i||t_(i)?n(i):(e.consume(i),92===i?f:h)}function f(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function nl(e,t,n,r,i,a){let l,s=this,o=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),c};function c(d){return o>999||null===d||91===d||93===d&&!l||94===d&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(a),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):tD(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||tD(t)||o++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!tP(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,u):u(t)}}function ns(e,t,n,r,i,a){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),l=40===t?41:t,s):n(t)};function s(n){return n===l?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),o(n))}function o(t){return t===l?(e.exit(a),s(l)):null===t?n(t):tD(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tO(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===l||null===t||tD(t)?(e.exit("chunkString"),o(t)):(e.consume(t),92===t?u:c)}function u(t){return t===l||92===t?(e.consume(t),c):c(t)}}function no(e,t){let n;return function r(i){return tD(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):tP(i)?tO(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function nc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let nu={partial:!0,tokenize:function(e,t,n){return function(t){return tT(t)?no(e,r)(t):n(t)};function r(t){return ns(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return tP(t)?tO(e,a,"whitespace")(t):a(t)}function a(e){return null===e||tD(e)?t(e):n(e)}}},nd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],np=["pre","script","style","textarea"],nm={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tH,t,n)}}},nh={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tD(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},nf={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&tw(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,a,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=l);let o={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return a=tj(a=[["enter",o,t],["enter",c,t]],e.slice(r+1,r+s+3)),a=tj(a,[["enter",u,t]]),a=tj(a,t3(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),a=tj(a,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),a=tj(a,e.slice(i+1)),a=tj(a,[["exit",o,t]]
1),tw(e,r,e.length,a),e},tokenize:function(e,t,n){let r,i,a=this,l=a.events.length;for(;l--;)if(("labelImage"===a.events[l][1].type||"labelLink"===a.events[l][1].type)&&!a.events[l][1]._balanced){r=a.events[l][1];break}return function(t){return r?r._inactive?u(t):(i=a.parser.defined.includes(nc(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(ng,c,i?c:u)(t):91===t?e.attempt(nx,c,i?o:u)(t):i?c(t):u(t)}function o(t){return e.attempt(nb,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},ng={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tT(t)?no(e,i)(t):i(t)}function i(t){return 41===t?c(t):na(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return tT(t)?no(e,s)(t):c(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?ns(e,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function o(t){return tT(t)?no(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},nx={tokenize:function(e,t,n){let r=this;return function(t){return nl.call(r,e,i,a,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},nb={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},ny={name:"labelStartImage",resolveAll:nf.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nv={name:"labelStartLink",resolveAll:nf.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nk={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),tO(e,t,"linePrefix")}}},nw={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(a){var l;return e.enter("thematicBreak"),r=l=a,function a(l){return l===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),tP(n)?tO(e,a,"whitespace")(n):a(n))}(l)):i>=3&&(null===l||tD(l))?(e.exit("thematicBreak"),t(l)):n(l)}(l)}}},nj={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tH,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tO(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!tP(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine
1=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nS,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,tO(e,e.attempt(nj,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,l=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:tI(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(nw,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return tI(i)&&++l<10?(e.consume(i),t):(!r.interrupt||l<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),s(i)):n(i)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tH,r.interrupt?n:o,e.attempt(nN,u,c))}
1function o(e){return r.containerState.initialBlankLine=!0,a++,u(e)}function c(t){return tP(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},nN={partial:!0,tokenize:function(e,t,n){let r=this;return tO(e,function(e){let i=r.events[r.events.length-1];return!tP(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},nS={partial:!0,tokenize:function(e,t,n){let r=this;return tO(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},nC={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",l,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var l;let s,o=i.events.length;for(;o--;)if("lineEnding"!==i.events[o][1].type&&"linePrefix"!==i.events[o][1].type&&"content"!==i.events[o][1].type){s="paragraph"===i.events[o][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||s)?(e.enter("setextHeadingLine"),r=t,l=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),tP(n)?tO(e,a,"lineSuffix")(n):a(n))}(l)):n(t)};function a(r){return null===r||tD(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,nl.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=nc(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return tT(t)?no(e,s)(t):s(t)}function s(t){return na(e,o,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function o(t){return e.attempt(nu,c,c)(t)}function c(t){return tP(t)?tO(e,u,"whitespace")(t):u(t)}function u(a){return null===a||tD(a)?(e.exit("definition"),i.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:nj,43:nj,45:nj,48:nj,49:nj,50:nj,51:nj,52:nj,53:nj,54:nj,55:nj,56:nj,57:nj,62:t6},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},tw(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var a;return e.enter("atxHeading"),a=i,e.enter("atxHeadingSequence"),function i(a){return 35===a&&r++<6?(e.consume(a),i):null===a||tT(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tD(r)?(e.exit("atxHeading"),t(r)):tP(r)?tO(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tT(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:nw,45:[nC,nw],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,a,l,s,o=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(l){return 33===l?(e.consume(l),u):47===l?(e.consume(l),i=!0,m):63===l?(e.consume(l),r=3,o.interrupt?t:E):tC(l)?(e.consume(l),a=String.fromCharCode(l),h):n(l)}function u(i){return 45===i?(e.consume(i),r=2,d):91===i?(e.consume(i),r=5,l=0,p):tC(i)?(e.consume(i),r=4,o.interrupt?t:E):n(i)}function d(r){return 45===r?(e.consume(r),o.interrupt?t:E):n(r)}function p(r){let i="CDATA[";return r===i.charCodeAt(l++)?(e.consume(r),l===i.length)?o.interrupt?t:N:p:n(r)}function m(t){return tC(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(l){if(null===l||47===l||62===l||tT(l)){let s=47===l,c=a.toLowerCase();return!s&&!i&&np.includes(c)?(r=1,o.interrupt?t(l):N(l)):nd.includes(a.toLowerCase())?(r=6,s)?(e.consume(l),f):o.interrupt?t(l):N(l):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(l):i?function t(n){return tP(n)?(e.consume(n),t):w(n)}(l):g(l))}return 45===l||tA(l)?(e.consume(l),a+=String.fromCharCode(l),h):n(l)}function f(r){return 62===r?(e.consume(r),o.interrupt?t:N):n(r)}function g(t){return 47===t?(e.consume(t),w):58===t||95===t||tC(t)?(e.consume(t),x):tP(t)?(e.consume(t),g):w(t)}function x(t){return 45===t||46===t||58===t||95===t||tA(t)?(e.consume(t),x):b(t)}function b(t){return 61===t?(e.consume(t),y):tP(t)?(e.consume(t),b):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,v):tP(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tT(n)?b(n):(e.consume(n),t)}(t)}function v(t){return t===s?(e.consume(t),s=null,k):null===t||tD(t)?n(t):(e.consume(t),v)}function k(e){return 47===e||62===e||tP(e)?g(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||tD(t)?N(t):tP(t)?(e.consume(t),j):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),M):60===t&&1===r?(e.consume(t),_):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),E):93===t&&5===r?(e.consume(t),z):tD(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(nm,T,S)(t)):null===t||tD(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),N)}function S(t){return e.check(nh,C,T)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return null===t||tD(t)?S(t):(e.enter("htmlFlowData"),N(t))}function M(t){return 45===t?(e.consume(t),E):N(t)}function _(t){return 47===t?(e.consume(t),a="",I):N(t)}function I(t){if(62===t){let n=a.toLowerCase();return np.includes(n)?(e.consume(t),D):N(t)}return tC(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):N(t)}function z(t){return 93===t?(e.consume(t),E):N(t)}function E(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),E):N(t)}function D(t){return null===t||tD(t)?(e.exit("htmlFlowData"),T(t)):(e.consume(t),D)}function T(n){return e.exit("htmlFlow"),t(n)}}},61:nC,95:nw,96:nn,126:nn},"flowInitial",0,{[-2]:nr,[-1]:nr,32:nr},"insideSpan",0,{null:[t5,tY]},"string",0,{38:ne,92:t9},"text",0,{[-5]:nk,[-4]:nk,[-3]:nk,33:ny,38:ne,42:t5,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return tC(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(t){return 43===t||45===t||46===t||tA(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,l):(43===n||45===n||46===n||tA(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function l(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||t_(r)?n(r):(e.consume(r),l)}function s(t){return 64===t?(e.consume(t),o):tM(t)?(e.consume(t),s):n(t)}function o(i){return tA(i)?function i(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||tA(a))&&r++<63){let n=45===a?t:i;return e.consume(a),n}return n(a)}(a)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,a,l=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),o):47===t?(e.consume(t),v):63===t?(e.consume(t),b):tC(t)?(e.consume(t),w):n(t)}function o(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,m):tC(t)?(e.consume(t),x):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):tD(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?_(e):45===e?d(e):u(e)}function m(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?h:m):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),f):tD(t)?(a=h,I(t)):(e.consume(t),h)}function f(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?_(t):93===t?(e.consume(t),g):h(t)}function x(t){return null===t||62===t?_(t):tD(t)?(a=x,I(t)):(e.consume(t),x)}function b(t){return null===t?n(t):63===t?(e.consume(t),y):tD(t)?(a=b,I(t)):(e.consume(t),b)}function y(e){return 62===e?_(e):b(e)}function v(t){return tC(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||tA(t)?(e.consume(t),k):function t(n){return tD(n)?(a=t,I(n)):tP(n)?(e.consume(n),t):_(n)}(t)}function w(t){return 45===t||tA(t)?(e.consume(t),w):47===t||62===t||tT(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),_):58===t||95===t||tC(t)?(e.consume(t),N):tD(t)?(a=j,I(t)):tP(t)?(e.consume(t),j):_(t)}function N(t){return 45===t||46===t||58===t||95===t||tA(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),S):tD(n)?(a=t,I(n)):tP(n)?(e.consume(n),t):j(n)}(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):tD(t)?(a=S,I(t)):tP(t)?(e.consume(t),S):(e.consume(t),A)}function C(t){return t===r?(e.consume(t),r=void 0,M):null===t?n(t):tD(t)?(a=C,I(t)):(e.consume(t),C)}function A(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tT(t)?j(t):(e.consume(t),A)}function M(e){return 47===e||62===e||tT(e)?j(e):n(e)}function _(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),z}function z(t){return tP(t)?tO(e,E,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):E(t)}function E(t){return e.enter("htmlTextData"),a(t)}}}],91:nv,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tD(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},t9],93:nf,95:t5,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,a=0;
1return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),l(n))}(t)};function l(o){return null===o?n(o):32===o?(e.enter("space"),e.consume(o),e.exit("space"),l):96===o?(i=e.enter("codeTextSequence"),r=0,function n(l){return 96===l?(e.consume(l),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(l)):(i.type="codeTextData",s(l))}(o)):tD(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):(e.enter("codeTextData"),s(o))}function s(t){return null===t||32===t||96===t||tD(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),s)}}}}],4127);var nA=e.i(4127);let nM=/[\0\t\n\r]/g;function n_(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let nI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return n_(n.slice(t?2:1),t?16:10)}return t7(n)||e}let nE={}.hasOwnProperty;function nD(e){return{line:e.line,column:e.column,offset:e.offset}}function nT(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+e7({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+e7({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+e7({start:t.start,end:t.end})+") is still open")}function nP(e){let t=this;t.parser=function(n){var r,i;let a,l,s,o;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(m),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(m,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(f),hardBreakTrailing:r(f),htmlFlow:r(g,i),htmlFlowData:c,htmlText:r(g,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=n_(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=t7(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=nD(e.end)},codeFenced:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=nc(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(d),hardBreakTrailing:l(d),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(nI,nz),n.identifier=nc(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nD(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.t
1ype)&&(c.call(this,e),u.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=nc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:l(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:l(),thematicBreak:l()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(nE.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},l={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:i,resume:o,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,i,a,l,s=t-1,o=-1,c=!1;for(;++s<=n;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?o++:o--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||o||a||(a=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!o&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===o&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(i=void 0;l--;){let t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=l}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!i||a<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,a=void 0,l=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];nE.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},l),e[u][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||nT).call(l,void 0,e[0])}for(r.position={start:nD(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nD(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nD(t.start),end:void 0}}function l(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nT).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+e7({start:e.start,end:e.end})+"): itâs not open");n.position.end=nD(e.end)}function o(){return ty(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nD(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nD(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function m(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function f(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!tW(e););return e}((function(e){let t={constructs:tS([nA,...(e||{}).extensions||[]]),content:n(tB),defined:[],document:n(t$),flow:n(tK),lazy:{},string:n(tQ),text:n(tJ)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
1olumn:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],l=[],s=[],o={attempt:h(function(e,t){f(e,t.from)}),check:h(m),consume:function(e){tD(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){let t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:h(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let a,l=e[r];if("string"==typeof l)a=l;else switch(l){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(l)}n=-2===l,i.push(a)}return i.join("")}(d(e),t)},sliceStream:d,write:function(e){return(l=tj(l,e),function(){let e;for(;r._index<l.length;){let n=l[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==l[l.length-1])?[]:(f(t,0),c.events=t3(a,c.events,c),c.events)}},u=t.tokenize.call(c,o);return t.resolveAll&&a.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;if(r===a)n=[e[r].slice(i,l)];else{if(n=e.slice(r,a),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}l>0&&n.push(e[a].slice(0,l))}return n}(l,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function m(e,t){t.restore()}function h(e,t){return function(n,i,a){var l;let u,d,m,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):(l=n,function(e){let t=null!==e&&l[e],n=null!==e&&l.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function f(e){return(u=e,d=0,0===e.length)?a:x(e[d])}function x(e){return function(n){let i,a,l,u,d;return(i=p(),a=c.previous,l=c.currentConstruct,u=c.events.length,d=Array.from(s),h={from:u,restore:function(){r=i,c.previous=a,c.currentConstruct=l,c.events.length=u,s=d,g()}},m=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,o,b,y)(n)}}function b(t){return e(m,h),i}function y(e){return(h.restore(),++d<u.length)?x(u[d]):a}}}function f(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&tw(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((l=1,s="",o=!0,function(e,t,n){let r,i,c,u,d,p=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,s="",o&&(65279===e.charCodeAt(0)&&c++,o=void 0);c<e.length;){if(nM.lastIndex=c,u=(r=nM.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){s=e.slice(c);break}if(10===d&&c===u&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),c<u&&(p.push(e.slice(c,u)),l+=u-c),d){case 0:p.push(65533),l++;break;case 9:for(i=4*Math.ceil(l/4),p.push(-2);l++<i;)p.push(-1);break;case 10:p.push(-4),l=1;break;default:a=!0,l=1}c=u+1}return n&&(a&&p.push(-5),s&&p.push(s),p.push(null)),p})(n,r,!0))))}}let nL="object"==typeof self?self:globalThis,nR=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[a,l]=e[i];switch(a){case 0:case -1:return n(l,i);case 1:{let e=n([],i);for(let t of l)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),i);case 4:{let{source:e,flags:t}=l;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of l)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of l)e.add(r(t));return e}case 7:{let{name:e,message:t}=l;return n(new nL[e](t),i)}case 8:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new nL[a](l),i)})(0)},{toString:nF}={},{keys:nO}=Object,nB=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=nF.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},n$=([e,t])=>0===e&&("function"===t||"symbol"===t),nU=(e,{json:t,lossy:n}={})=>{var r,i,a;let l,s,o=[];return(r=!(t||n),i=!!t,a=new Map,l=(e,t)=>
1{let n=o.push(e)-1;return a.set(t,n),n},s=e=>{if(a.has(e))return a.get(e);let[t,n]=nB(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return l([-1],e)}return l([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),l([n,[...t]],e)}let r=[],i=l([t,r],e);for(let t of e)r.push(s(t));return i}case 2:{if(n)switch(n){case"BigInt":return l([n,e.toString()],e);case"Boolean":case"Number":case"String":return l([n,e.valueOf()],e)}if(i&&"toJSON"in e)return s(e.toJSON());let a=[],o=l([t,a],e);for(let t of nO(e))(r||!n$(nB(e[t])))&&a.push([s(t),s(e[t])]);return o}case 3:return l([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return l([t,{source:n,flags:r}],e)}case 5:{let n=[],i=l([t,n],e);for(let[t,i]of e)(r||!(n$(nB(t))||n$(nB(i))))&&n.push([s(t),s(i)]);return i}case 6:{let n=[],i=l([t,n],e);for(let t of e)(r||!n$(nB(t)))&&n.push(s(t));return i}}let{message:o}=e;return l([t,{name:n,message:o}],e)})(e),o},nH="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nR(nU(e,t)):structuredClone(e):(e,t)=>nR(nU(e,t));function nq(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),l="";if(37===a&&tA(e.charCodeAt(n+1))&&tA(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(l=String.fromCharCode(a,t),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function nV(e,t){let n=[{type:"text",value:"â©"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nG=function(e){var t,n;if(null==e)return nK;if("function"==typeof e)return nX(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nG(e[n]);return nX(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nX(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nX(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nX(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nK(){return!0}let nY=[];function nQ(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let a=nG(i),l=r?-1:1;(function e(i,s,o){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){var c;let u,d,p,m=nY;if((!t||a(i,s,o[o.length-1]||void 0))&&!1===(m=Array.isArray(c=n(i,o))?c:"number"==typeof c?[!0,c]:null==c?nY:[c])[0])return m;if("children"in i&&i.children&&i.children&&"skip"!==m[0])for(d=(r?i.children.length:-1)+l,p=o.concat(i);d>-1&&d<i.children.length;){if(!1===(u=e(i.children[d],d,p)())[0])return u;d="number"==typeof u[1]?u[1]:d+l}return m}})(e,void 0,[])()}function nJ(e,t,n,r){let i,a,l;"function"==typeof t&&"function"!=typeof n?(a=void 0,l=t,i=n):(a=t,l=n,i=r),nQ(e,a,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},i)}function nZ(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});let l=i[i.length-1];return l&&"text"===l.type?l.value+=r:i.push({type:"text",value:r}),i}function n0(e){let t=e.spread;return null==t?e.children.length>1:t}function n1(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let n2={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}
1,footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=nq(i.toLowerCase()),l=e.footnoteOrder.indexOf(i),s=e.footnoteCounts.get(i);void 0===s?(s=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=l+1,s+=1,e.footnoteCounts.set(i,s);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,o);let c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nZ(e,t);let i={src:nq(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:nq(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nZ(e,t);let i={href:nq(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:nq(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=n0(n[r])}return t}(n):n0(t),a={},l=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){let e=r[s];(i||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?l.push(e):l.push(...e.children)}let o=r[r.length-1];o&&(i||"element"!==o.type||"p"!==o.tagName)&&l.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=e9(t.children[1]),l=e6(t.children[t.children.length-1]);a&&l&&(r.position={start:a,end:l}),i.push(r)}let a={type:"element",tagName:"table",properties:{}
1,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,l=a?a.length:t.children.length,s=-1,o=[];for(;++s<l;){let n=t.children[s],r={},l=a?a[s]:void 0;l&&(r.align=l);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),o.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(n1(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(n1(t.slice(i),i>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:n3,yaml:n3,definition:n3,footnoteDefinition:n3};function n3(){}let n5={}.hasOwnProperty,n4={};function n6(e,t){e.position&&(t.position=function(e){let t=e9(e),n=e6(e);if(t&&n)return{start:t,end:n}}(e))}function n9(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,nH(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function n8(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function n7(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function re(e,t){let n,r,i,a,l=(n=t||n4,r=new Map,i=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=n7(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=n7(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:n9,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...n2,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(n5.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nH(n);return r.children=a.all(e),r}return nH(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(n5.call(n,"hProperties")||n5.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:n6,wrap:n8},nJ(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),s=l.one(e,void 0),o=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nV,r=e.options.footnoteBackLabel||nW,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],o=-1;for(;++o<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[o]);if(!i)continue;let a=e.all(i),l=String(i.identifier).toUpperCase(),c=nq(l.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(l);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(o,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&"element"===m.type&&"p"===m.tagName){let e=m.children[m.children.length-1];e&&"text"===e.type?e.value+=" ":m.children.push({type:"text",value:" "}),m.children.push(...d)}else a.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...nH(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)}
1,{type:"text",value:"\n"}]}}(l),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&(eb("children"in c),c.children.push({type:"text",value:"\n"},o)),c}function rt(e,t){return e&&"run"in e?async function(n,r){let i=re(n,{file:r,...t});await e.run(i,r)}:function(n,r){return re(n,{file:r,...e||t})}}function rn(e){if(e)throw e}var rr=e.i(4100);function ri(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let ra=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');rc(e);let r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let l=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else l<0&&(n=!0,l=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(i=a):(s=-1,i=l));return r===i?i=l:i<0&&(i=e.length),e.slice(r,i)},rl=function(e){let t;if(rc(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},rs=function(e){let t;rc(e);let n=e.length,r=-1,i=0,a=-1,l=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==l&&(l=1):a>-1&&(l=-1)}return a<0||r<0||0===l||1===l&&a===r-1&&a===i+1?"":e.slice(a,r)},ro=function(...e){var t;let n,r,i,a=-1;for(;++a<e.length;)rc(e[a]),e[a]&&(i=void 0===i?e[a]:i+"/"+e[a]);return void 0===i?".":(rc(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",a=0,l=-1,s=0,o=-1;for(;++o<=e.length;){if(o<e.length)n=e.codePointAt(o);else if(47===n)break;else n=47;if(47===n){if(l===o-1||1===s);else if(l!==o-1&&2===s){if(i.length<2||2!==a||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",a=0):a=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),l=o,s=0;continue}}else if(i.length>0){i="",a=0,l=o,s=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(l+1,o):i=e.slice(l+1,o),a=o-l-1;l=o,s=0}else 46===n&&s>-1?s++:s=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function rc(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function ru(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let rd=["history","path","basename","stem","extname","dirname"];class rp{constructor(e){let t,n;t=e?ru(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rd.length;){const e=rd[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)rd.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?ra(this.path):void 0}set basename(e){rh(e,"basename"),rm(e,"basename"),this.path=ro(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?rl(this.path):void 0}set dirname(e){rf(this.basename,"dirname"),this.path=ro(e||"",this.basename)}get extname(){return"string"==typeof this.path?rs(this.path):void 0}set extname(e){if(rm(e,"extname"),rf(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ro(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ru(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!ru(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),rh(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?ra(this.path,this.extname):void 0}set stem(e){rh(e,"stem"),rm(e,"stem"),this.path=ro(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new tr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function rm(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function rh(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function rf(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let rg=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},rx={}.hasOwnProperty;class rb extends rg{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(a,...l){let s=e[++n],o=-1;if(a)return void r(a);for(;++o<t.length;)(null===l[o]||void 0===l[o])&&(l[o]=t[o]);t=l,s?(function(e,t){let n;return function(...t){let a,l=e.length>t.length;l&&t.push(r);try{a=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}}
1)(s,i)(...l):r(null,...l)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new rb,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,rr.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(rw("data",this.frozen),this.namespace[e]=t,this):rx.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rw("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=rS(e),n=this.parser||this.Parser;return rv("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rv("process",this.parser||this.Parser),rk("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=rS(e),l=n.parse(a);function s(e,n){e||!n?i(e):r?r(n):(eb(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(l,a,function(e,t,r){var i,a;if(e||!t||!r)return s(e);let l=n.stringify(t,r);"string"==typeof(i=l)||(a=i)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=l:r.result=l,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),rv("processSync",this.parser||this.Parser),rk("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,rn(e),t=r}),rN("processSync","process",n),eb(t,"we either bailed on an error or have a tree"),t}run(e,t,n){rj(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){eb("function"!=typeof t,"`file` canât be a `done` anymore, we checked");let l=rS(t);r.run(e,l,function(t,r,l){let s=r||e;t?a(t):i?i(s):(eb(n,"`done` is defined if `resolve` is not"),n(void 0,s,l))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){rn(e),n=t,r=!0}),rN("runSync","run",r),eb(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=rS(t),r=this.compiler||this.Compiler;return rk("stringify",r),rj(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rw("use",this.frozen),null==e);else if("function"==typeof e)l(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,rr.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;l(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,l=n[i][1];ri(l)&&ri(r)&&(r=(0,rr.default)(!0,l,r)),n[i]=[e,r,...a]}}}}let ry=new rb().freeze();function rv(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function rk(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function rw(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rj(e){if(!ri(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function rN(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function rS(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new rp(e)}let rC=[],rA={allowDangerousHtml:!0},rM=/^(https?|ircs?|mailto|xmpp)$/i,r_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rI(e){var n;let r,i,a,l,s,o=(r=(n=e).rehypePlugins||rC,i=n.remarkPlugins||rC,a=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...rA}:rA,ry().use(nP).use(i).use(rt,a).use(r)),c=(l=e.children||"",s=new rp,"string"==typeof l?s.value=l:ey("Unexpected value `"+l+"` for `children` prop, expected `string`"),s);return function(e,n){let r=n.allowedElements,i=n.allowElement,a=n.components,l=n.disallowedElements,s=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||rz;for(let e of r_)Object.hasOwn(n,e.from)&&ey("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&l&&ey("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nJ(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in tx)if(Object.hasOwn(tx,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=tx[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!l&&l.includes(e.tagName);if(!a&&i&&"number"==typeof t&&(a=!i(e,t,n)),a&&n&&"number"==typeof t)return o&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,a;let l;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=s,r=t.jsxDEV,l=function(e,t,i,a){let l=Array.isArray(i.children),s=e9(e);return r(t,i,a,l,{columnNumber:s?s.column-1:void 0,fileName:n,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");
1if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,l=function(e,t,n,r){let l=Array.isArray(n.children)?a:i;return r?l(t,n,r):l(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?e5:e3,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=tu(o,e,void 0);return c&&"string"!=typeof c?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:a,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(c),c),e)}function rz(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||rM.test(e.slice(0,t))?e:""}function rE(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let rD="phrasing",rT=["autolink","link","image","label"];function rP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rL(e){this.config.enter.autolinkProtocol.call(this,e)}function rR(e){this.config.exit.autolinkProtocol.call(this,e)}function rF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];eb("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function rO(e){this.config.exit.autolinkEmail.call(this,e)}function rB(e){this.exit(e)}function r$(e){!function(e,t,n){let r=nG((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),a=-1;for(;++a<i.length;)nQ(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){let e=t[l],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[a][0],l=i[a][1],s=0,o=n.children.indexOf(e),c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=l(...d,i);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}return c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(o,1,...u)):u=[e],o+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rU],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,rH]],{ignore:["link","linkReference"]})}function rU(e,t,n,r,i){let a,l="";if(!rq(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),(a=n.split(".")).length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))return!1;let s=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=rE(e,"("),a=rE(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),a++;return[e,n]}(n+r);if(!s[0])return!1;let o={type:"link",title:null,url:l+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function rH(e,t,n,r){return!(!rq(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rq(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||tR(n)||tL(n))&&(!t||47!==n)}function rV(){this.buffer()}function rW(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rG(){this.buffer()}function rX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rK(e){let t=this.resume(),n=this.stack[this.stack.length-1];eb("footnoteReference"===n.type),n.identifier=nc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rY(e){this.exit(e)}function rQ(e){let t=this.resume(),n=this.stack[this.stack.length-1];eb("footnoteDefinition"===n.type),n.identifier=nc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rJ(e){this.exit(e)}function rZ(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),l=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),l(),a+=i.move("]")}
1function r0(e,t,n){return 0===t?e:r1(e,t,n)}function r1(e,t,n){return(n?"":" ")+e}rZ.peek=function(){return"["};let r2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function r3(e){this.enter({type:"delete",children:[]},e)}function r5(e){this.exit(e)}function r4(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function r6(e){return e.length}function r9(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}r4.peek=function(){return"~"};function r8(e,t,n){let r=e.value||"",i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let e,t=n.unsafe[a],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}r8.peek=function(){return"`"};nG(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let r7=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),a=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(a=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let l=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));let s=n.createTracker(r);s.move(a+" ".repeat(l-a.length)),s.shift(l);let o=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(l))+e:(n?a:a+" ".repeat(l-a.length))+e});return o(),c};function ie(e){let t=e._align;eb(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function it(e){this.exit(e),this.data.inTable=void 0}function ir(e){this.enter({type:"tableRow",children:[]},e)}function ii(e){this.exit(e)}function ia(e){this.enter({type:"tableCell",children:[]},e)}function il(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,is));let n=this.stack[this.stack.length-1];eb("inlineCode"===n.type),n.value=t,this.exit(e)}function is(e,t){return"|"===t?t:e}function io(e){let t=this.stack[this.stack.length-2];eb("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function ic(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];eb("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,a=-1;for(;++a<i.length;){let e=i[a];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function iu(e,t,n,r){let i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(l);let o=r7(e,t,n,{...r,...s.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),o}let id={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},ip={tokenize:function(e,t,n){let r,i,a;return l;function l(t){return 46===t||95===t?e.check(ih,o,s)(t):null===t||tT(t)||tR(t)||45!==t&&tL(t)?o(t):(a=!0,e.consume(t),l)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),l}function o(e){return i||r||!a?n(e):t(e)}},partial:!0},im={tokenize:function(e,t){let n=0,r=0;return i;
1function i(l){return 40===l?(n++,e.consume(l),i):41===l&&r<n?a(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(ih,t,a)(l):null===l||tT(l)||tR(l)?t(l):(e.consume(l),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},ih={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),a):93===l?(e.consume(l),i):60===l||null===l||tT(l)||tR(l)?t(l):n(l)}function i(e){return null===e||40===e||91===e||tT(e)||tR(e)?t(e):r(e)}function a(t){return tC(t)?function t(i){return 59===i?(e.consume(i),r):tC(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},ig={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return tA(e)?n(e):t(e)}},partial:!0},ix={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!iw.call(r,r.previous)||iC(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(id,e.attempt(ip,e.attempt(im,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:iw},ib={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",a=!1;return function(t){return(72===t||104===t)&&ij.call(r,r.previous)&&!iC(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),l):n(t)};function l(t){if(tC(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),l;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),a)?o:(a=!0,s):n(t)}function o(t){return null===t||t_(t)||tT(t)||tR(t)||tL(t)?n(t):e.attempt(ip,e.attempt(im,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:ij},iy={name:"emailAutolink",tokenize:function(e,t,n){let r,i,a=this;return function(t){return!iS(t)||!iN.call(a,a.previous)||iC(a.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return iS(r)?(e.consume(r),t):64===r?(e.consume(r),l):n(r)}(t))};function l(t){return 46===t?e.check(ig,o,s)(t):45===t||95===t||tA(t)?(i=!0,e.consume(t),l):o(t)}function s(t){return e.consume(t),r=!0,l}function o(l){return i&&r&&tC(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:iN},iv={},ik=48;for(;ik<123;)iv[ik]=iy,58==++ik?ik=65:91===ik&&(ik=97);function iw(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||tT(e)}function ij(e){return!tC(e)}function iN(e){return!(47===e||iS(e))}function iS(e){return 43===e||45===e||46===e||95===e||tA(e)}function iC(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}iv[43]=iy,iv[45]=iy,iv[46]=iy,iv[95]=iy,iv[72]=[iy,ib],iv[104]=[iy,ib],iv[87]=[iy,ix],iv[119]=[iy,ix];let iA={tokenize:function(e,t,n){let r=this;return tO(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function iM(e,t,n){let r,i=this,a=i.events.length,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;a--;){let e=i.events[a][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(a){if(!r||!r._balanced)return n(a);let s=nc(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&l.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a)):n(a)}}function i_(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function iI(e,t,n){let r,i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",o)}function o(s){if(l>999||93===s&&!r||null===s||91===s||tT(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes(nc(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return tT(s)||(r=!0),l++,e.consume(s),92===s?c:o}function c(t){return 91===t||92===t||93===t?(e.consume(t),l++,o):o(t)}}function iz(e,t,n){let r,i,a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),o};function o(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!i||null===t||91===t||tT(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=nc(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return tT(t)||(i=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l.includes(r)||l.push(r),tO(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}
1function iE(e,t,n){return e.check(tH,t,e.attempt(iA,t,n))}function iD(e){e.exit("gfmFootnoteDefinition")}class iT{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function iP(e,t,n){let r,i=this,a=0,l=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,a="tableHead"===r||"tableRow"===r?b:s;return a===b&&i.parser.lazy[i.now().line]?n(e):a(e)};function s(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,l+=1),o(n)}function o(t){return null===t?n(t):tD(t)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):tP(t)?tO(e,o,"whitespace")(t):(l+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,o):(e.enter("data"),c(t))}function c(t){return null===t||124===t||tT(t)?(e.exit("data"),o(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,tP(t))?tO(e,p,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t)}function p(t){return 45===t||58===t?h(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),m):n(t)}function m(t){return tP(t)?tO(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(l+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),f):45===t?(l+=1,f(t)):null===t||tD(t)?x(t):n(t)}function f(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return tP(t)?tO(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return p(i);if(null===i||tD(i))return r&&a===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function b(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||tD(n)?(e.exit("tableRow"),t(n)):tP(n)?tO(e,y,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||tT(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:v)}function k(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function iL(e,t){let n,r,i,a=-1,l=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],u=!1,d=0,p=new iT;for(;++a<e.length;){let m=e[a],h=m[1];"enter"===m[0]?"tableHead"===h.type?(u=!1,0!==d&&(iF(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(l=!0,i=void 0,o=[0,0,0,0],c=[0,a+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):s&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)?(l=!1,0===c[2]&&(0!==o[1]&&(c[0]=c[1],i=iR(p,t,o,s,void 0,i),o=[0,0,0,0]),c[2]=a)):"tableCellDivider"===h.type&&(l?l=!1:(0!==o[1]&&(c[0]=c[1],i=iR(p,t,o,s,void 0,i)),c=[(o=c)[1],a,0,0])):"tableHead"===h.type?(u=!0,d=a):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=a,0!==o[1]?(c[0]=c[1],i=iR(p,t,o,s,a,i)):0!==c[1]&&(i=iR(p,t,c,s,a,i)),s=0):s&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)&&(c[3]=a)}for(0!==d&&iF(p,t,d,n,r),p.consume(t.events),a=-1;++a<t.events.length;){let e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left"
1:"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,a))}return e}function iR(e,t,n,r,i,a){0!==n[0]&&(a.end=Object.assign({},iO(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let l=iO(t.events,n[1]);if(a={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){let i=iO(t.events,n[2]),a=iO(t.events,n[3]),l={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==i&&(a.end=Object.assign({},iO(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function iF(e,t,n,r,i){let a=[],l=iO(t.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function iO(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let iB={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return tT(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return tD(r)?t(r):tP(r)?e.check({tokenize:i$},t,n)(r):n(r)}}};function i$(e,t,n){return tO(e,function(e){return null===e?n(e):t(e)},"whitespace")}let iU={};function iH(e){let t,n,r,i=e||iU,a=this.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(tS([{text:iv},{document:{91:{name:"gfmFootnoteDefinition",tokenize:iz,continuation:{tokenize:iE},exit:iD}},text:{91:{name:"gfmFootnoteCall",tokenize:iI},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iM,resolveTo:i_}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,a=this.events,l=0;return function(s){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function a(s){let o=t2(i);if(126===s)return l>1?r(s):(e.consume(s),l++,a);if(l<2&&!t)return r(s);let c=e.exit("strikethroughSequenceTemporary"),u=t2(s);return c._open=!u||2===u&&!!o,c._close=!o||2===o&&!!u,n(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],s=t.parser.constructs.insideSpan.null;s&&tw(l,l.length,0,t3(s,e.slice(r+1,n),t)),tw(l,l.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),tw(e,r-1,n-r+3,l),n=r+l.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:iP,resolveAll:iL}}},{text:{91:iB}}
1])),s.push([{transforms:[r$],enter:{literalAutolink:rP,literalAutolinkEmail:rL,literalAutolinkHttp:rL,literalAutolinkWww:rL},exit:{literalAutolink:rB,literalAutolinkEmail:rO,literalAutolinkHttp:rR,literalAutolinkWww:rF}},{enter:{gfmFootnoteCallString:rV,gfmFootnoteCall:rW,gfmFootnoteDefinitionLabelString:rG,gfmFootnoteDefinition:rX},exit:{gfmFootnoteCallString:rK,gfmFootnoteCall:rY,gfmFootnoteDefinitionLabelString:rQ,gfmFootnoteDefinition:rJ}},{canContainEols:["delete"],enter:{strikethrough:r3},exit:{strikethrough:r5}},{enter:{table:ie,tableData:ia,tableHeader:ia,tableRow:ir},exit:{codeText:il,table:it,tableData:ii,tableHeader:ii,tableRow:ii}},{exit:{taskListCheckValueChecked:io,taskListCheckValueUnchecked:io,paragraph:ic}}]),o.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rD,notInConstruct:rT},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rD,notInConstruct:rT},{character:":",before:"[ps]",after:"\\/",inConstruct:rD,notInConstruct:rT}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let a=n.createTracker(i),l=a.move("[^"),s=n.enter("footnoteDefinition"),o=n.enter("label");return l+=a.move(n.safe(n.associationId(e),{before:l,after:"]"})),o(),l+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),l+=a.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,a.current()),r?r1:r0))),s(),l},footnoteReference:rZ},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:r2}],handlers:{delete:r4}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=r8(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){let r=e.children,i=-1,a=[],l=t.enter("table");for(;++i<r.length;)a[i]=o(r[i],t,n);return l(),a}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){let i=s([o(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){let i=n.enter("tableCell"),l=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:a,after:a});return l(),i(),s}function s(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||r6,a=[],l=[],s=[],o=[],c=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>c&&(c=e[u].length);++a<e[u].length;){var d;let l=null==(d=e[u][a])?"":String(d);if(!1!==n.alignDelimiters){let e=i(l);r[a]=e,(void 0===o[a]||e>o[a])&&(o[a]=e)}t.push(l)}l[u]=t,s[u]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++p<c;)a[p]=r9(r[p]);else{let e=r9(r);for(;++p<c;)a[p]=e}p=-1;let m=[],h=[];for(;++p<c;){let e=a[p],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,o[p]-t.length-r.length),l=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>o[p]&&(o[p]=i),h[p]=i),m[p]=l}l.splice(1,0,m),s.splice(1,0,h),u=-1;let f=[];for(;++u<l.length;){let e=l[u],t=s[u];p=-1;let r=[];for(;++p<c;){let i=e[p]||"",l="",s="";if(!1!==n.alignDelimiters){let e=o[p]-(t[p]||0),n=a[p];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):s=l=" ".repeat(e/2):s=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||p)&&r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||p!==c-1)&&r.push("|")}f.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function o(e,t,n){let r=e.children,i=-1,a=[],s=t.enter("tableRow");for(;++i<r.length;)a[i]=l(r[i],e,t,n);return s(),a}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:iu}}]})}var iq=e.i(86536),iV=e.i(93886);let iW=(0,l.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var iG=e.i(40982);let iX=()=>new Date().toISOString();function iK(e){return[{at:0,event:{type:"turn_start",turnId:e.turnId,conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:e.capability,subtype:e.subtype,etaSeconds:360}},{at:300,event:{type:"task_plan",title:e.planTitle,summary:e.planSummary,total_estimated_minutes:6,issued_at:iX(),steps:[{label:"Plan the structure",estimated_minutes:1,status:"pending"},{label:"Design the layout",estimated_minutes:1,status:"pending"},{label:"Build the interface",estimated_minutes:2,status:"pending"},{label:"Wire up the logic",estimated_minutes:1,status:"pending"},{label:"Test & deploy",estimated_minutes:1,status:"pending"}]}},{at:1e3,event:{type:"progress",step:"planning",status:"active",detail:"Mapping sections"}},{at:2200,event:{type:"progress",step:"planning",status:"done"}},{at:2300,event:{type:"progress",step:"designing",status:"active",detail:"Choosing type & palette"}},{at:3600,event:{type:"progress",step:"designing",status:"done"}},{at:3700,event:{type:"progress",step:"frontend",status:"active",detail:"Writing the interface"}},{at:3800,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__web_app_publish"}},{at:5200,fetchHtml:`${e.deployedDir}/index.html`,filePath:"index.html"},{at:5400,event:{type:"progress",step:"frontend",status:"done"}},{at:5500,event:{type:"progress",step:"api",status:"active",detail:"Wiring interactions"}},{at:6600,event:{type:"progress",step:"api",status:"done"}},{at:6700,event:{type:"progress",step:"testing",status:"active",detail:"Smoke-testing"}},{at:7600,event:{type:"progress",step:"testing",status:"done"}},{at:7700,event:{type:"progress",step:"deploying",status:"active",detail:"Publishing"}},{at:8600,event:{type:"deployed",url:(0,iG.demoAsset)(`${e.deployedDir}/index.html`),slug:e.slug,fileCount:e.fileCount}},{at:8800,event:{type:"progress",step:"deploying",status:"done"}},{at:9e3,event:{type:"done",text:e.doneText}}]}function iY(e,t,n,r){return{type:"task_plan",title:e.title,summary:e.summary,total_estimated_minutes:e.total_estimated_minutes,issued_at:n,steps:t.map((e,t)=>({...e,status:t<r?"done":t===r?"active":"pending"}))}}function iQ(e,t,n,r,i){let a=t.length;if(0===a)return[];let l=Math.max(i-r,1)/a,s=[];for(let i=0;i<a;i++)s.push({at:Math.round(r+i*l),event:iY(e,t,n,i)});return s.push({at:Math.round(i),event:iY(e,t,n,a)}),s}function iJ(e){let t=iX(),n={title:e.planTitle,summary:e.planSummary,total_estimated_minutes:e.totalMinutes};return[{at:0,event:{type:"turn_start",turnId:e.turnId,conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"document",etaSeconds:60*e.totalMinutes}},{at:300,event:iY(n,e.planSteps,t,-1)},{at:1200,event:{type:"delta",text:e.introText}},...iQ(n,e.planSteps,t,1800,9600),{at:10200,event:{type:"document",id:e.doc.id,name:e.doc.name,format:"pdf",url:e.doc.url,previewUrl:e.doc.previewUrl,size:e.doc.size}},{at:10800,event:{type:"done",text:e.doneText}}]}function iZ(e){let t=iX(),n={title:e.planTitle,summary:e.planSummary,total_estimated_minutes:e.totalMinutes};return[{at:0,event:{type:"turn_start",turnId:e.turnId,conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"web_app",subtype:e.subtype,etaSeconds:60*e.totalMinutes}},{at:300,event:iY(n,e.planSteps,t,-1)},{at:1200,event:{type:"delta",text:e.introText}},...iQ(n,e.planSteps,t,1800,9600),{at:10200,event:{type:"deployed",url:e.url,slug:e.slug,fileCount:e.fileCount}},{at:10800,event:{type:"done",text:e.doneText}}]}let i0=[{id:"uae-tower",label:"UAE luxury tower PDF",prompt:"Design an iconic ultra-luxury supertall residential tower for Dubai Marina â concept package with renders, floor plans and apartment layouts",match:[["tower"],["residences"],["skyscraper"],["supertall"],["high","rise"],["highrise"],["lumina"]],build:function(){return iJ({turnId:"demo-uae-tower",planTitle:"Lumina Residences â
1concept package",planSummary:"An iconic supertall residential tower for Dubai Marina: photoreal renders, floor plans and apartment layouts in a luxury monograph.",totalMinutes:42,planSteps:[{label:"Define the sculptural form",estimated_minutes:4},{label:"Render exteriors & amenities",estimated_minutes:18},{label:"Draw floor & apartment plans",estimated_minutes:8},{label:"Write the vision narrative",estimated_minutes:8},{label:"Lay out & render the PDF",estimated_minutes:4}],introText:"This is the showpiece â a concept package for an iconic Dubai Marina tower: a sculptural twisting form, photoreal renders, floor plans and apartment layouts in a luxury monograph. It runs a while; I'll keep you posted.",renders:[],doc:{id:"demo-uae-tower-pdf",name:"Lumina-Residences-Concept-Package.pdf",url:(0,iG.demoAsset)("tower/tower.pdf"),previewUrl:(0,iG.demoAsset)("tower/tower.pdf"),size:"3.5 MB"},doneText:"Your concept package is ready â Lumina Residences, an iconic twisting supertall for Dubai Marina: cinematic exterior renders, amenity and interior visuals, the lobby and typical-floor plans, and per-apartment layouts, all in one luxury monograph on the right."})},showcase:!0},{id:"apt-125",label:"125 m² apartment PDF",prompt:"Give me a 125 square meter apartment â 2 bedrooms, kitchen, bathroom â with floor plan, room renders and full cost breakdown in UAE prices",match:[["125","apartment"],["125","square","meter"],["125","sqm"],["apartment","floor","plan"],["apartment","costing"],["apartment","interior"],["apartment","render"],["apartment","cost"],["interior","design","apartment"],["square","meter","apartment"],["sqm","apartment"],["two","bedroom"],["2","bedroom"],["two","bed"]],build:function(){return iJ({turnId:"demo-apt-125",planTitle:"125 m² apartment â concept & costing",planSummary:"A precise floor plan, photoreal room renders and a full UAE-priced cost breakdown in one premium PDF.",totalMinutes:32,planSteps:[{label:"Lay out the floor plan",estimated_minutes:4},{label:"Render every room",estimated_minutes:14},{label:"Price materials & finishes (UAE)",estimated_minutes:8},{label:"Lay out & format",estimated_minutes:4},{label:"Render the final PDF",estimated_minutes:2}],introText:"This is a full concept-and-costing book â a measured floor plan, photoreal renders of every room and a line-by-line UAE cost breakdown. It takes a while, so I'll keep you posted as it comes together.",renders:[{id:"apt-plan",url:(0,iG.demoAsset)("apartment/assets/floorplan.svg"),prompt:"Measured top-view floor plan â 2 bed, kitchen, bath, 125 m²"},{id:"apt-living",url:(0,iG.demoAsset)("apartment/assets/living-01.jpg"),prompt:"Living & dining, floor-to-ceiling glazing, warm stone and timber"},{id:"apt-kitchen",url:(0,iG.demoAsset)("apartment/assets/kitchen-01.jpg"),prompt:"Open kitchen, handleless cabinetry, stone island"},{id:"apt-master",url:(0,iG.demoAsset)("apartment/assets/master-01.jpg"),prompt:"Master bedroom suite with ensuite, soft daylight"}],doc:{id:"demo-apt-125-pdf",name:"Apartment-125-Concept-and-Costing.pdf",url:(0,iG.demoAsset)("apartment/apartment.pdf"),previewUrl:(0,iG.demoAsset)("apartment/apartment.pdf"),size:"2.5 MB"},doneText:"Done â your 125 m² apartment book is ready: a measured floor plan (2 bedrooms, kitchen, bathroom), photoreal renders of every room from several angles, and a complete UAE-priced cost breakdown totalling AED 571,017. It's all in the PDF on the right."})},showcase:!0},{id:"coffee-shop",label:"Coffee shop landing page",prompt:"Build a long, classy landing page for a specialty coffee shop",match:[["coffee","shop"],["coffee","website"],["coffee","landing"],["coffee","site"],["coffee","page"],["specialty","coffee"],["cafe","website"],["cafe","landing"],["cafe","site"],["cafe","page"],["espresso","bar"],["brolot"],["brôlot"]],build:function(){return iZ({turnId:"demo-coffee-shop",subtype:"website",planTitle:"Brûlot â specialty coffee landing page",planSummary:"A long, classy single-page site: hero, story, menu, gallery and visit details.",planSteps:[{label:"Plan the page structure",estimated_minutes:2},{label:"Design type & palette",estimated_minutes:2},{label:"Build the sections",estimated_minutes:4},{label:"Polish & animate",estimated_minutes:2},{label:"Publish",estimated_minutes:1}],totalMinutes:11,introText:"Building you a long, refined single-page site for the coffee shop â hero, story, menu, gallery and a visit section, all in one elegant scroll.",url:(0,iG.demoSiteUrl)("coffee"),slug:"brulot-coffee",fileCount:9,doneText:"Here you go â I've designed a long, classy single-page site for Brûlot: a cinematic hero, the roastery story, a full menu, a photo gallery and visit details. It's a beautiful website, ready to go live. Do you want me to deploy it on your own domain?"})},showcase:!0},{id:"car-showroom",label:"Car showroom + backend",prompt:"Build a car showroom website with a real admin to add and edit cars, buyer inquiries and appointment booking",match:[["car","showroom"],["car","dealership"],["car","website"],["car","inventory"],["car","listing"],["sell","cars"],["prestige","motors"]],build:function(){return iZ({turnId:"demo-car-showroom",subtype:"app",planTitle:"Prestige Motors â showroom + admin",planSummary:"A storefront plus a real backend: an admin to add/edit cars, buyer inquiries that land in the admin, and an emailed booking.",planSteps:[{label:"Design the storefront",estimated_minutes:3},{label:"Build the inventory backend",estimated_minutes:5},{label:"Wire the admin (add/edit cars)",estimated_minutes:4},{label:"Inquiries â admin + email + booking",estimated_minutes:4},{label:"Deploy",estimated_minutes:2}
1],totalMinutes:18,introText:"Building a working car showroom â a storefront on the front, and a real backend behind it: an admin to add and edit cars, buyer inquiries that show up in the admin, and an email with an appointment booking. I'll deploy it live so you can click through both sides.",url:"https://slatex-claude-dev.innovision.lol/showroom/",slug:"prestige-motors",fileCount:14,doneText:"Here you go â Prestige Motors is a real working web application, not a mockup: a storefront listing the inventory, an admin to add and edit cars on a live backend, and buyer inquiries that land in the admin and fire a confirmation email with the booked appointment. It's a beautiful, fully-functional web app. Do you want me to deploy it on your own domain?"})},showcase:!0},{id:"image",label:"Brand photo set",prompt:"Create a set of four brand photos for Domi, a specialty coffee roaster",match:[["domi","photo"],["domi","photos"],["domi","brand","photo"],["four","domi","photos"]],build:function(){let e=(e,t)=>({id:`demo-img-${e}`,url:(0,iG.demoAsset)(`imageset/${e}.jpg`),prompt:t,model:"slate-image",width:1280,height:832});return[{at:0,event:{type:"turn_start",turnId:"demo-image",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"image",etaSeconds:40}},{at:300,event:{type:"phase",phase:"thinking"}},{at:900,event:{type:"progress",step:"composing",status:"active",detail:"Framing four on-brand shots"}},{at:1600,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__image_gen"}},{at:1800,event:{type:"progress",step:"composing",status:"done"}},{at:1900,event:{type:"progress",step:"rendering",status:"active",detail:"Rendering at full quality"}},{at:3200,event:{type:"image",...e("IMG-01","Specialty coffee bag on warm oak, morning light")}},{at:4400,event:{type:"image",...e("IMG-02","Pour-over on a cafe counter, steam rising")}},{at:5600,event:{type:"image",...e("IMG-03","Roasted beans close-up, rich brown tones")}},{at:6800,event:{type:"image",...e("IMG-04","Barista pulling an espresso shot, candid")}},{at:7e3,event:{type:"progress",step:"rendering",status:"done"}},{at:7100,event:{type:"progress",step:"finalizing",status:"active"}}
1,{at:7800,event:{type:"progress",step:"finalizing",status:"done"}},{at:8e3,event:{type:"done",text:"Here's a four-shot brand set for Domi â warm, natural light, consistent palette across all four. Want a tighter crop or a different mood on any of them?"}}]}},{id:"video",label:"Cinematic video + voice",prompt:"Make a cinematic riverside teaser video with a warm voiceover",match:[["cinematic","riverside"],["riverside","teaser"],["riverside","voiceover"]],build:function(){return[{at:0,event:{type:"turn_start",turnId:"demo-video",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"video",etaSeconds:300}},{at:300,event:{type:"task_plan",title:"Cinematic riverside teaser",summary:"A short, moody hero film with a written narration track.",total_estimated_minutes:6,issued_at:iX(),steps:[{label:"Write the scene",estimated_minutes:1,status:"pending"},{label:"Record the narration",estimated_minutes:1,status:"pending"},{label:"Generate the visuals",estimated_minutes:3,status:"pending"},{label:"Render & grade",estimated_minutes:1,status:"pending"}]}},{at:1e3,event:{type:"progress",step:"planning",status:"active",detail:"Scripting the shot"}},{at:2200,event:{type:"progress",step:"planning",status:"done"}},{at:2300,event:{type:"progress",step:"designing",status:"active",detail:"Recording narration"}},{at:3500,event:{type:"progress",step:"designing",status:"done"}},{at:3600,event:{type:"progress",step:"frontend",status:"active",detail:"Generating visuals"}},{at:3700,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__video_gen"}},{at:7e3,event:{type:"progress",step:"frontend",status:"done"}},{at:7100,event:{type:"progress",step:"api",status:"active",detail:"Rendering 1080p"}},{at:9e3,event:{type:"video",id:"demo-video-1",url:(0,iG.demoAsset)("video/clip.mp4"),title:"Riverside teaser",prompt:"Cinematic riverside at golden hour, gentle c
1amera drift",model:"slate-motion",duration:6}},{at:9400,event:{type:"audio",id:"demo-vo-1",url:(0,iG.demoAsset)("voice/voiceover.mp3"),duration:9,model:"slate-voice"}},{at:9600,event:{type:"progress",step:"api",status:"done"}},{at:9700,event:{type:"progress",step:"testing",status:"active"}},{at:10400,event:{type:"progress",step:"testing",status:"done"}},{at:10600,event:{type:"done",text:"Your teaser is ready â a six-second riverside shot with a warm narration track laid over it. I can extend it, swap the voice, or cut a vertical version for social."}}]}},{id:"music",label:"Original music track",prompt:"Compose a warm acoustic track for a brand film",match:[["acoustic","brand","film"],["warm","acoustic","track"],["compose","brand","film"]],build:function(){return[{at:0,event:{type:"turn_start",turnId:"demo-music",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"music",etaSeconds:120}},{at:300,event:{type:"progress",step:"planning",status:"active",detail:"Sketching the theme"}},{at:1600,event:{type:"progress",step:"planning",status:"done"}},{at:1700,event:{type:"progress",step:"designing",status:"active",detail:"Arranging instruments"}},{at:1800,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__music_gen"}},{at:3200,event:{type:"progress",step:"designing",status:"done"}},{at:3300,event:{type:"progress",step:"frontend",status:"active",detail:"Recording stems"}},{at:5e3,event:{type:"progress",step:"frontend",status:"done"}},{at:5100,event:{type:"progress",step:"api",status:"active",detail:"Mixing"}},{at:6400,event:{type:"progress",step:"api",status:"done"}},{at:6500,event:{type:"progress",step:"testing",status:"active",detail:"Mastering"}},{at:7600,event:{type:"music",id:"demo-music-1",url:(0,iG.demoAsset)("music/track.mp3"),title:"Warm & Inviting",style:"Acoustic, mellow, hopeful",duration:55,model:"slate-audio"}},{at:7800,event:{type:"progress",step:"testing",status:"done"}},{at:8e3,event:{type:"done",text:"Here's an original instrumental â warm acoustic, mellow and hopeful, just under a minute and ready to underscore the brand film. I can make it longer, lift the energy, or add a vocal line."}}]}},{id:"website",label:"Marketing website",prompt:"Build a marketing website for Domi Coffee",match:[["domi","website"],["domi","coffee","site"],["marketing","website","domi"],["domi","landing","page"]],build:function(){return iK({turnId:"demo-website",capability:"web_app",subtype:"website",planTitle:"Domi Coffee marketing site",planSummary:"A warm, single-page site with hero, menu, story and contact.",assetHtml:"website/index.html",slug:"domi-coffee",fileCount:6,deployedDir:"website",doneText:"Your site is live â a warm single-page Domi Coffee landing with hero, menu, story and a contact section. The Share link above is live; you can also download the full source."})}},{id:"webapp",label:"Interactive web app",prompt:"Build me a simple budget tracker web app",match:[["budget","tracker","app"],["simple","budget","tracker"],["budget","tracker","web"]],build:function(){return iK({turnId:"demo-webapp",capability:"web_app",subtype:"app",planTitle:"Penny â budget tracker",planSummary:"A small interactive expense tracker with a live donut chart.",assetHtml:"webapp/index.html",slug:"penny-budget",fileCount:4,deployedDir:"webapp",doneText:"Penny is live â add an expense and the donut chart updates instantly, with totals saved in your browser. The Share link is ready, and the source is yours to download."})}},{id:"mobile",label:"Mobile app",prompt:"Design a habit tracker mobile app",match:[["habit","tracker","app"],["habit","tracker","mobile"],["habit","tracker","phone"]],build:function(){return[{at:0,event:{type:"turn_start",turnId:"demo-mobile",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"mobile_app",subtype:"app",platform:"ios",title:"Bloom â Habit Tracker",etaSeconds:360}},{at:300,event:{type:"task_plan",title:"Bloom â Habit Tracker",summary:"A clean iOS habit tracker with a daily progress ring.",total_estimated_minutes:6,issued_at:iX(),steps:[{label:"Plan the screens",estimated_minutes:1,status:"pending"},{label:"Design the layout",estimated_minutes:1,status:"pending"},{label:"Build the interface",estimated_minutes:2,status:"pending"},{label:"Wire up the logic",estimated_minutes:1,status:"pending"},{label:"Preview on device",estimated_minutes:1,status:"pending"}]}},{at:1e3,event:{type:"progress",step:"planning",status:"active",detail:"Mapping Today / Stats / Profile"}}
1,{at:2200,event:{type:"progress",step:"planning",status:"done"}},{at:2300,event:{type:"progress",step:"designing",status:"active",detail:"Choosing type & palette"}},{at:3600,event:{type:"progress",step:"designing",status:"done"}},{at:3700,event:{type:"progress",step:"frontend",status:"active",detail:"Building the screens"}},{at:3800,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__mobile_app_build"}},{at:5200,event:{type:"file",path:"preview-url",content:(0,iG.demoAsset)("mobileapp/index.html")}},{at:5400,event:{type:"progress",step:"frontend",status:"done"}},{at:5500,event:{type:"progress",step:"api",status:"active",detail:"Wiring interactions"}},{at:6600,event:{type:"progress",step:"api",status:"done"}},{at:6700,event:{type:"progress",step:"testing",status:"active",detail:"Booting the simulator"}},{at:7600,event:{type:"progress",step:"testing",status:"done"}},{at:7700,event:{type:"progress",step:"deploying",status:"active",detail:"Loading on device"}},{at:8600,event:{type:"progress",step:"deploying",status:"done"}},{at:9e3,event:{type:"done",text:"Here's Bloom â a mobile habit tracker with a daily progress ring and Today / Stats / Profile tabs. Tap a habit to check it off and watch the ring fill. I can theme it or add reminders next."}}]}},{id:"brochure",label:"50-page illustrated PDF",prompt:"Create a 50-page investment brochure for River Gardens Residence with photoreal renders, financials and floor plans",match:[["river","gardens"],["river","gardens","residence"],["river","gardens","brochure"]],build:function(){return[{at:0,event:{type:"turn_start",turnId:"demo-brochure",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"build",capability:"document",etaSeconds:2700}},{at:300,event:{type:"task_plan",title:"River Gardens Residence â investment brochure",summary:"A 50-page illustrated investment memorandum with photoreal renders, financials and floor plans.",total_estimated_minutes:45,issued_at:iX(),steps:[{label:"Outline the document",estimated_minutes:3,status:"pending"},{label:"Render exterior & interior visuals",estimated_minutes:18,status:"pending"},{label:"Write the content",estimated_minutes:12,status:"pending"},{label:"Lay out & format",estimated_minutes:8,status:"pending"},{label:"Render the final PDF",estimated_minutes:4,status:"pending"}]}},{at:1200,event:{type:"delta",text:"This is a big one â a fully illustrated, 50-page memorandum with custom renders. It runs around 45 minutes, so you don't need to wait here: I'll email you the moment it's ready."}},{at:2400,event:{type:"progress",step:"outlining",status:"active",detail:"Structuring 11 sections"}},{at:3600,event:{type:"progress",step:"outlining",status:"done"}},{at:3700,event:{type:"phase",phase:"tool_start",tool:"mcp__slatex__image_gen"}},{at:3800,event:{type:"progress",step:"writing",status:"active",detail:"Rendering visuals & writing copy"}},{at:4600,event:{type:"image",id:"demo-bro-ext",url:(0,iG.demoAsset)("renders/EXT-01.jpg"),prompt:"River Gardens hero â four-building community at golden hour",model:"slate-image",width:1280,height:832}},{at:5800,event:{type:"image",id:"demo-bro-int",url:(0,iG.demoAsset)("renders/INT-02.jpg"),prompt:"One-bedroom living room opening to a planted balcony",model:"slate-image",width:1280,height:832}},{at:7e3,event:{type:"progress",step:"writing",status:"done"}},{at:7100,event:{type:"progress",step:"formatting",status:"active",detail:"Placing renders & charts"}},{at:8400,event:{type:"progress",step:"formatting",status:"done"}},{at:8500,event:{type:"progress",step:"rendering",status:"active",detail:"Generating the PDF"}},{at:10200,event:{type:"document",id:"demo-brochure-1",name:"River-Gardens-Residence.pdf",format:"pdf",url:(0,iG.demoAsset)("brochure/river-gardens-illustrated.pdf"),previewUrl:(0,iG.demoAsset)("brochure/river-gardens-illustrated.pdf"),size:"8.0 MB"}},{at:10500,event:{type:"progress",step:"rendering",status:"done"}},{at:10800,event:{type:"done",text:"Done â and the email just went out to you. The River Gardens Residence memorandum is 50 pages: photoreal exteriors and interiors, the full financial picture (â¬63.3M GDV, 27% margin, ~30% IRR) and floor plans, all in one investor-ready PDF."}}]}},{id:"quick",label:"Quick answer",prompt:"Give me three quick wins to sharpen my homepage hero copy",match:[["three","quick","wins"],["sharpen","hero","copy"],["homepage","hero","copy"]],build:function(){let e=[{at:0,event:{type:"turn_start",turnId:"demo-quick",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"quick",capability:"general"}}],t=350;for(let n of["Three quick wins, in order of impact:\n\n","1. **Lead with the outcome, not the feature.** ",'Your hero says "AI-powered scheduling." Try "Get 6 hours a week back" â ',"buyers pay for the result, not the engine.\n\n","2. **One CTA above the fold.** ",'You have four competing buttons up top. Pick the single highe
1st-intent action ("Start free") and demote the rest.\n\n',"3. **Add proof early.** ",'A row of customer logos or a one-line metric ("12,000 teams") right under the headline ',"does more than a wall of testimonials at the bottom.\n\n","Want me to rewrite the hero section with these baked in?"])e.push({at:t,event:{type:"delta",text:n}}),t+=230;return e.push({at:t+150,event:{type:"done",text:'Three quick wins, in order of impact:\n\n1. **Lead with the outcome, not the feature.** Your hero says "AI-powered scheduling." Try "Get 6 hours a week back" â buyers pay for the result, not the engine.\n\n2. **One CTA above the fold.** You have four competing buttons up top. Pick the single highest-intent action ("Start free") and demote the rest.\n\n3. **Add proof early.** A row of customer logos or a one-line metric ("12,000 teams") right under the headline does more than a wall of testimonials at the bottom.\n\nWant me to rewrite the hero section with these baked in?'}}),e}},{id:"slate",label:"Slate council",prompt:"Should I raise a small seed round now or a larger one at a higher valuation?",match:[["small","seed","round"],["seed","round","valuation"],["smaller","seed","round"]],build:function(){let e=[{at:0,event:{type:"turn_start",turnId:"demo-slate",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"deep",capability:"general"}},{at:400,event:{type:"progress",step:"consulting",status:"active",detail:"Consulting 5 analystsâ¦"}},{at:1300,event:{type:"progress",step:"consulting",status:"active",detail:"Analyst A responded (1/5)"}},{at:2100,event:{type:"progress",step:"consulting",status:"active",detail:"Analyst B responded (2/5)"}},{at:2900,event:{type:"progress",step:"consulting",status:"active",detail:"Analyst C responded (3/5)"}},{at:3700,event:{type:"progress",step:"consulting",status:"active",detail:"Analyst D responded (4/5)"}},{at:4500,event:{type:"progress",step:"consulting",status:"active",detail:"Analyst E responded (5/5)"}},{at:4900,event:{type:"progress",step:"consulting",status:"done"}},{at:5e3,event:{type:"progress",step:"synthesizing",status:"active",detail:"Synthesizing consensusâ¦"}}],t=5300;for(let n of["Short answer: raise a smaller round now, but structure it so you're not boxed in later.\n\n","**The tradeoff.** A $2M seed at $10M post buys ~18 months of runway and keeps you at ~80% founder ownership through the next round. ","A $5M seed at $20M post doubles runway but, given your current $40K MRR, sets a Series-A bar (~$1.2M ARR at a 3à markup) you'd need ~18 months of triple-digit growth to clear. ","Miss it and you're raising flat â the worst signal in the market.\n\n","**Where the analysts converged:** capital is cheap relative to the dilution math only when you can deploy it into a *proven* channel. You haven't found that yet â CAC is still moving. Over-raising now funds experiments at a high price.\n\n","**Recommendation:** take ~$2.5M at $12â14M post, earmark 60% for the one channel showing payback under 9 months, and keep a clean cap table. ","Re-raise from strength in 12 months once the channel is proven â you'll command a far better multiple than buying runway at today's unproven metrics.\n\n","The one dissent worth noting: if you have line-of-sight to a defensible data moat, front-loading capital to win the category first can justify the dilution. That's the only case where the bigger round wins."])e.push({at:t,event:{type:"delta",text:n}}),t+=300;return e.push({at:t+100,event:{type:"progress",step:"synthesizing",status:"done"}}),e.push({at:t+250,event:{type:"done",text:"Short answer: raise a smaller round now, but structure it so you're not boxed in later.\n\n**The tradeoff.** A $2M seed at $10M post buys ~18 months of runway and keeps you at ~80% founder ownership through the next round. A $5M seed at $20M post doubles runway but, given your current $40K MRR, sets a Series-A bar (~$1.2M ARR at a 3à markup) you'd need ~18 months of triple-digit growth to clear. Miss it and you're raising flat â the worst signal in the market.\n\n**Where the analysts converged:** capital is cheap relative to the dilution math only when you can deploy it into a *proven* channel. You haven't found that yet â CAC is still moving. Over-raising now funds experiments at a high price.\n\n**Recommendation:** take ~$2.5M at $12â14M post, earmark 60% for the one channel showing payback under 9 months, and keep a clean cap table. Re-raise from strength in 12 months once the channel is proven â you'll command a far better multiple than buying runway at today's unproven metrics.\n\nThe one dissent worth noting: if you have line-of-sight to a defensible data moat, front-loading capital to win the category first can justify the dilution. That's the only case where the bigger round wins."}}),e}},{id:"research",label:"Deep research report",prompt:"Research the AI in healthcare market and write a 2025 analysis report",match:[["research","healthcare","market"],["ai","healthcare","market"],["healthcare","market","analysis"]],build:function(){return[{at:0,event:{type:"turn_start",turnId:"demo-research",conversationId:"demo"}},{at:50,event:{type:"mode",mode:"research",capability:"research"}},{at:300,event:{type:"delta",text:"Starting deep researchâ¦\n\n"}},{at:700,event:{type:"progress",step:"searching",status:"active",detail:"Searching sourcesâ¦"}},{at:1800,event:{type:"progress",step:"searching",status:"active",detail:"Found 10 web results"}},{at:3e3,event:{type:"progress",step:"searching",status:"active",detail:"Cross-checked 8 live sources"}},{at:3600,event:{type:"progress",step:"searching",status:"done"}},{at:3800,event:{type:"progress",step:"reading",status:"active",detail:"Synthesizing 18 sourcesâ¦"}},{at:5200,event:{type:"progress",step:"reading",status:"active",detail:"Cross-referencing claims⦠(7s)"}},{at:6800,event:{type:"progress",step:"reading",status:"active",detail:"Resolving conflicting figures⦠(11s)"}},{at:7400,event:{type:"progress",step:"reading",status:"done"}},{at:7600,event:{type:"progress",step:"synthesizing",status:"active",detail:"Rendering PDFâ¦"}},{at:8400,event:{type:"research",tier:"deepest",report:"# AI in Healthcare: Market Analysis 2025\n\n## Executive Summary\n\nThe global market for artificial intelligence in healthcare reached an estimated **$26.6B in 2024** and is on track to surpass **$187B by 2030**, a compound annual growth rate of roughly **38%**. Three forces are driving the curve: clinical-grade diagnostic models clearing regulatory approval, acute staffing shortages pushing automation of administrative work, and payers rewarding demonstrable cost reduction.\n\n## Where the Money Is Going\n\n- **Diagnostics & imaging** remain the largest single segment (~31% of spend), led by radiology and pathology triage tools.\n- **Clinical documentation / ambient scribing** is the fastest-growing category, cutting clinician charting time by 40â60% in deployed studies.\n- **Drug discovery** attracts the most venture capital per deal, though revenue lags the hype by several years.\n\n## Adoption & Barriers\n\nRoughly **38% of providers** report a production AI deployment, up from 22% in 2022. The dominant blockers are reimbursement uncertainty, integration with legacy EHR systems, and clinician trust. Tools that slot into existing workflows â rather than demanding new ones â see 3à the sustained usage.\n\n## Outlook\n\nExpect c
1onsolidation around platforms that own the clinical workflow, not point solutions. Regulatory clarity on reimbursement is the single largest unlock; the vendors positioned to win pair a defensible data asset with measurable outcomes payers will pay for.",sources:[{title:"Global AI in Healthcare Market Report 2025",url:"https://www.mckinsey.com/industries/healthcare",snippet:"Market sizing and CAGR projections through 2030 across diagnostics, documentation and discovery segments.",relevance:.97},{title:"World Health Organization â Ethics & Governance of AI for Health",url:"https://www.who.int/publications/i/item/9789240029200",snippet:"Policy guidance on safe, equitable deployment of AI in clinical settings.",relevance:.94},{title:"Nature Medicine â Clinical AI Diagnostic Accuracy Meta-Analysis",url:"https://www.nature.com/nm/",snippet:"Pooled performance of imaging models versus board-certified clinicians across 41 studies.",relevance:.93},{title:"The Lancet Digital Health â Ambient Documentation Trials",url:"https://www.thelancet.com/journals/landig",snippet:"Randomized evidence on clinician charting time reduction from ambient scribing.",relevance:.9},{title:"Deloitte â Health System AI Adoption Survey 2024",url:"https://www.deloitte.com/global/en/Industries/life-sciences-health-care.html",snippet:"Provider adoption rates, deployment maturity and top integration barriers.",relevance:.88},{title:"FDA â List of AI/ML-Enabled Medical Devices",url:"https://www.fda.gov/medical-devices/software-medical-device-samd",snippet:"Cleared and approved AI-enabled devices, by clearance year and specialty.",relevance:.86},{title:"JAMA â Reimbursement Pathways for Clinical AI",url:"https://jamanetwork.com/journals/jama",snippet:"Analysis of CPT coding and payer coverage as the gating factor for scale.",relevance:.83},{title:"Rock Health â Digital Health Funding 2024 Year-End",url:"https://rockhealth.com/insights/",snippet:"Venture funding by category, with AI drug discovery leading dollars per deal.",relevance:.81}]}},{at:10200,event:{type:"document",id:"demo-research-pdf",name:"AI-Healthcare-Report-2025.pdf",fileType:"pdf",url:(0,iG.demoAsset)("research/report.pdf"),previewUrl:(0,iG.demoAsset)("research/report.pdf")}},{at:10600,event:{type:"progress",step:"synthesizing",status:"done"}},{at:11e3,event:{type:"done",text:"Your report is ready: **AI in Healthcare: Market Analysis 2025**. I pulled from 18 live sources â WHO, McKinsey, Nature Medicine, The Lancet, the FDA device registry and more â and synthesized them into a sourced PDF.\n\nHeadline: a ~$26.6B market in 2024 growing ~38% a year toward $187B by 2030, with diagnostics leading spend and ambient documentation growing fastest. The full breakdown, charts and all 8 citations are in the report on the right."}}]}}],i1={"apt-125":12,"uae-tower":10,"coffee-shop":11,"car-showroom":8};async function i2(e,t,n){var r;let i=e.build().slice().sort((e,t)=>e.at-t.at),l=(r=e.id,!0!==e.showcase?null:6e4*Math.max(0,i1[r]??1)),s=i.length?i[i.length-1].at:0,o=l&&s>0?l/s:1,c=l?l/6e4:null,u=i.map(e=>{let t=1===o?e.at:Math.round(e.at*o);return"event"in e?{...e,at:t,event:(e=>{if(!c||!l)return e;if("task_plan"===e.type&&Array.isArray(e.steps)){let t=e.steps,n=t.reduce((e,t)=>e+(t.estimated_minutes||0),0)||1;return{...e,total_estimated_minutes:c,steps:t.map(e=>({...e,estimated_minutes:(e.estimated_minutes||0)/n*c}))}}return"mode"===e.type&&"number"==typeof e.etaSeconds?{...e,etaSeconds:Math.round(l/1e3)}:e})(e.event)}:{...e,at:t}}),d=Date.now();for(let e of u){if(n?.aborted)return;let r=e.at-(Date.now()-d);if(r>0&&!await function(e,t){return new Promise(n=>{if(t?.aborted)return n(!1);let r=setTimeout(()=>{t?.removeEventListener("abort",i),n(!0)},e),i=()=>{clearTimeout(r),n(!1)};t?.addEventListener("abort",i,{once:!0})})}(r,n)||n?.aborted)return;if("fetchHtml"in e){let r="";try{let t=await fetch((0,iG.demoAsset)(e.fetchHtml));r=await t.text()}catch{r='<!doctype html><meta charset="utf-8"><body style="font-family:system-ui;padding:2rem">Preview unavailable.</body>'}if(n?.aborted)return;(0,a.dispatchEvent)(t,{type:"file",path:e.filePath,content:r})}else(0,a.dispatchEvent)(t,e.event)}}function i3(e){return new Promise(t=>setTimeout(t,e))}function i5(e){let t=e.data;return`${e.kind}:${t.id||t.url||""}`}function i4(e,t){return e.map(e=>{let n=[];for(let t of e.artifacts||[])try{if("image"===t.kind)n.push({kind:"image",data:{id:t.id||t.url,url:t.url,prompt:t.prompt||"",model:t.model,width:t.width,height:t.height}});else if("video"===t.kind)n.push({kind:"video",data:{id:t.id||t.url,url:t.url,prompt:t.prompt,model:t.model,previewUrl:t.previewUrl,duration:t.duration}});else if("music"===t.kind)n.push({kind:"music",data:{id:t.id||t.url,url:t.url,t
1itle:t.title,prompt:t.prompt,imageUrl:t.imageUrl,lyrics:t.lyrics,duration:t.duration}});else if("document"===t.kind||"presentation"===t.kind){let e=t.name||t.title||"Document",r=e.split(".").pop()?.toLowerCase(),i=["pdf","docx","pptx","zip"],a=(t.fileType&&i.includes(t.fileType)?t.fileType:void 0)??(r&&i.includes(r)?r:void 0)??(t.mimeType?.includes("pdf")?"pdf":"docx");n.push({kind:"document",data:{id:t.id||t.url,url:t.url,name:e,type:a,previewUrl:t.previewUrl}})}else"web_app"===t.kind?n.push({kind:"web_app",data:{id:t.id||t.url,url:t.url,title:t.title,prompt:t.prompt,slug:t.slug,fileCount:t.fileCount,mobile:!0===t.mobile}}):"apk"===t.kind&&t.easBuildId?n.push({kind:"apk",data:{id:t.easBuildId,easBuildId:t.easBuildId,apkStatus:t.apkStatus||"building",url:t.url||void 0,name:t.name||t.title,packageName:t.packageName,sizeBytes:t.sizeBytes}}):"likeness_warning"===t.kind?n.push({kind:"likeness_warning",data:{id:t.id||`likeness-${e.id}`,url:t.url||"",subjects:t.subjects||[],minScore:"number"==typeof t.minScore?t.minScore:null,threshold:"number"==typeof t.threshold?t.threshold:4,reason:t.reason}}):"research"===t.kind&&t.research&&n.push({kind:"research",data:{id:t.id||`research-${e.id}`,title:t.title,report:t.research.report,sources:t.research.sources,tier:t.research.tier}})}catch(e){console.error("hydrateServerRows: skipping malformed artifact",t,e)}return{id:e.id,role:e.role,content:e.content,mode:e.mode||void 0,capability:e.capability||void 0,artifacts:n.length>0?n:void 0,conversationId:t}})}let i6="slatex.organizeNudge",i9=[{id:"planning",label:"Planning",status:"pending"},{id:"designing",label:"Designing",status:"pending"},{id:"frontend",label:"Building Frontend",status:"pending"},{id:"api",label:"Building API",status:"pending"},{id:"testing",label:"Testing",status:"pending"},{id:"deploying",label:"Deploying",status:"pending"}],i8={document:[{id:"outlining",label:"Outlining",status:"pending"},{id:"writing",label:"Writing content",status:"pending"},{id:"formatting",label:"Formatting",status:"pending"},{id:"rendering",label:"Rendering document",status:"pending"}],presentation:[{id:"planning",label:"Outlining slides",status:"pending"},{id:"writing",label:"Writing copy",status:"pending"},{id:"designing",label:"Designing layout",status:"pending"},{id:"rendering",label:"Building deck",status:"pending"}],brand_kit:[{id:"brief",label:"Reading brief",status:"pending"},{id:"palette",label:"Picking palette",status:"pending"},{id:"typography",label:"Choosing typography",status:"pending"},{id:"logos",label:"Drafting logo concepts",status:"pending"},{id:"guidelines",label:"Writing guidelines",status:"pending"}],image:[{id:"composing",label:"Composing prompt",status:"pending"},{id:"rendering",label:"Rendering image",status:"pending"},{id:"finalizing",label:"Finalizing",status:"pending"}],video:[{id:"planning",label:"Scripting scene",status:"pending"},{id:"designing",label:"Recording narration",status:"pending"},{id:"frontend",label:"Creating visuals",status:"pending"},{id:"api",label:"Rendering video",status:"pending"},{id:"testing",label:"Finalizing",status:"pending"}],music:[{id:"planning",label:"Sketching the idea",status:"pending"},{id:"designing",label:"Arranging",status:"pending"},{id:"frontend",label:"Recording stems",status:"pending"},{id:"api",label:"Mixing",status:"pending"},{id:"testing",label:"Mastering",status:"pending"}],research:[{id:"searching",label:"Searching sources",status:"pending"},{id:"reading",label:"Reading findings",status:"pending"},{id:"synthesizing",label:"Synthesizing report",status:"pending"}],general:[{id:"consulting",label:"Consulting experts",status:"pending"},{id:"synthesizing",label:"Synthesizing consensus",status:"pending"}]},i7="slatex.inflight.";function ae(e){if(e)try{window.localStorage.removeItem(i7+e)}catch{}}function at({artifacts:e,onSelect:n,selectedKey:r}){let i=(e||[]).filter(e=>"question"!==e.kind&&"apk"!==e.kind&&"likeness_warning"!==e.kind);return 0===i.length?null:(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:i.map((e,i)=>{let a=r===i5(e);return(0,t.jsx)(an,{artifact:e,isSelected:a,onClick:()=>n(e)},`${e.kind}-${i}`)})})}function an({artifact:e,isSelected:n,onClick:r}){let i=(0,B.cn)("group relative flex items-center gap-2 overflow-hidden rounded-lg border px-2 py-1.5 text-xs text-foreground transition-all cursor-pointer",n?"border-brand bg-brand/10 ring-2 ring-brand/40 shadow-sm":"border-border bg-background/60 hover:border-brand/40 hover:bg-brand/5"),a=n?(0,t.jsx)(ar,{}):null;if("image"===e.kind){let{url:l,prompt:s}=e.data;return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:s,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"relative h-9 w-9 shrink-0 overflow-hidden rounded-md bg-muted",children:(0,t.jsx)("img",{src:l,alt:"",className:"h-full w-full object-cover",loading:"lazy"})}),(0,t.jsx)("span",{className:(0,B.cn)("max-w-[160px] truncate text-left",n?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:s||"Image"}),a]})}if("video"===e.kind){let{title:l,prompt:s}=e.data,o=l||s||"Video";return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:o,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-brand/10 text-brand",children:(0,t.jsx)(iV.Film,{size:16})}),(0,t.jsx)("span",{className:(0,B.cn)("max-w-[160px] truncate text-left",n?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:o}),a]})}if("music"===e.kind){let{title:l}=e.data,s=l||"Track";return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:s,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-brand/10 text-brand",children:(0,t.jsx)(N.Music,{size:16})}),(0,t.jsx)("span",{className:(0,B.cn)("max-w-[160px] truncate text-left",n?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:s}),a]})}if("question"===e.kind||"apk"===e.kind||"likeness_warning"===e.kind)return null;if("web_app"===e.kind){let{title:l,prompt:s,url:o}=e.data,c="";try{c=new URL(o).hostname}catch{}return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:o,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-brand/10 text-brand",children:(0,t.jsx)(y.Globe,{size:16})}),(0,t.jsxs)("span",{className:"flex max-w-[200px] flex-col items-start text-left",children:[(0,t.jsx)("span",{className:(0,B.cn)("truncate","text-foreground"),children:l||s||"Website"}),(0,t.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:c||"Live site"})]}),a]})}if("research"===e.kind){let{title:l,tier:s,sources:o}=e.data,c=l||"Research Report",u=Array.isArray(o)?o.length:0;return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:c,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-brand/10 text-brand",children:(0,t.jsx)(iW,{size:16})}),(0,t.jsxs)("span",{className:"flex max-w-[200px] flex-col items-start text-left",children:[(0,t.jsx)("span",{className:(0,B.cn)("truncate","text-foreground"),children:c}),(0,t.jsxs)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:[s," · ",u," ",1===u?"source":"sources"]})]}),a]})}let{name:l,type:s}=e.data;return(0,t.jsxs)("button",{type:"button",onClick:r,className:i,title:l,"aria-pressed":n,children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-brand/10 text-brand",children:(0,t.jsx)(C.FileText,{size:16})}),(0,t.jsxs)("span",{className:"flex max-w-[200px] flex-col items-start text-left",children:[(0,t.jsx)("span",{className:(0,B.cn)("truncate","text-foreground"),children:l}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s})]}),a]})}function ar(){return(0,t.jsxs)("span",{"aria-label":"Currently showing",className:"ml-1 inline-flex items-center gap-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] font-medium text-brand-foreground",children:[(0,t.jsx)(iq.Eye,{size:10}),"Showing"]})}let ai=(0,l.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);function aa({apk:e}){let n=e.name||"Your Android app",r=function(e){if("number"!=typeof e||!Number.isFinite(e)||e<=0)return"";let t=e/1048576;return t>=1?`${t.toFixed(t>=10?0:1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}(e.sizeBytes);return"building"===e.apkStatus?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3 rounded-xl border border-border bg-muted/40 px-4 py-3",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand/10 text-brand",children:(0,t.jsx)(eg.Loader2,{size:18,className:"animate-spin"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-semibold text-foreground",children:["Building ",n,"â¦"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your Android app is compiling â this takes ~10-15 minutes. We'll notify you and light up the download here when it's ready."})]})]}):"failed"===e.apkStatus?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3 rounded-xl border border-destructive/40 bg-destructive/5 px-4 py-3",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive",children:(0,t.jsx)(ex.AlertTriangle,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-semibold text-foreground",children:[n," build failed"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Something went wrong compiling the Android app. Ask me to try again."})]})]}):(0,t.jsxs)("div",{className:"mt-3 rounded-xl border border-border bg-card px-4 py-3 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand/10 text-brand",children:(0,t.jsx)(v.Smartphone,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:n}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Android app",r?` \xb7 ${r}`:"",e.packageName?` \xb7 ${e.packageName}`:""]})]}),e.url&&(0,t.jsxs)("a",{href:e.url,download:!0,className:"inline-flex shrink-0 items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,t.jsx)(ai,{size:14}),"Download APK"]})]}),(0,t.jsx)("p",{className:"mt-2 text-[11px] leading-relaxed text-muted-foreground",children:"To install: open the .apk on your Android ph
1one and allow installs from this source when prompted."})]})}function al({message:e,onSelectArtifact:r,selectedArtifactKey:i,onChipReply:a,answeredChipValue:l,onBuildCta:s,onPremiumCta:o,onOpenBuildConversation:c}){let u="user"===e.role,d=!u&&e.isStreaming&&0===e.content.trim().length,m=function(e,t){let r=(0,n.useRef)(Date.now()),i=(0,n.useRef)(t),[a,l]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{i.current!==t&&(i.current=t,r.current=Date.now(),a&&l(!1))},[t,a]),(0,n.useEffect)(()=>{if(!e){a&&l(!1);return}let t=window.setInterval(()=>{let e=Date.now()-r.current;l(t=>{let n=e>1500;return t===n?t:n})},400);return()=>window.clearInterval(t)},[e,a]),e&&a}(!u&&!!e.isStreaming&&e.content.trim().length>0,e.content),[h,g]=(0,n.useState)(!1);if(u&&e.chipAck)return null;let x=!u&&e.isStreaming?function(e){if(!e)return e;let t=e,n=t.match(/```/g);if(n&&n.length%2==1){let e=t.lastIndexOf("```");t=t.slice(0,e)}let r=t.match(/\*\*/g);if(r&&r.length%2==1){let e=t.lastIndexOf("**");t=t.slice(0,e)+t.slice(e+2)}let i=t.slice(t.lastIndexOf("\n")+1).match(/`/g);if(i&&i.length%2==1){let e=t.lastIndexOf("`");t=t.slice(0,e)}return t}(ay(e.content)):u?e.content:ay(e.content),b=(0,t.jsxs)("button",{type:"button",onClick:()=>g(!0),className:"mt-3 inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:[(0,t.jsx)(f.X,{size:14}),"No"]}),y=!!e.buildCta&&!e.isStreaming&&!!s&&!h,v=!!e.premiumCta&&!e.isStreaming&&!!o&&!h,k=!!e.openBuildCta&&!e.isStreaming&&!!c&&!h;return(0,t.jsxs)("div",{"data-role":e.role,"data-streaming":e.isStreaming?"true":void 0,className:(0,B.cn)("flex gap-3 px-4 py-3",u&&"flex-row-reverse"),children:[(0,t.jsx)("div",{className:(0,B.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",u?"bg-brand/20":"bg-muted"),children:u?(0,t.jsx)(ec.User,{size:16,className:"text-brand"}):(0,t.jsx)(I.Bot,{size:16,className:"text-muted-foreground"})}),(0,t.jsx)("div",{"data-slot":"bubble-content",className:(0,B.cn)("max-w-[calc(100%-2.75rem)] sm:max-w-[75%] rounded-2xl px-4 py-2.5 text-sm leading-relaxed",u?"bg-brand text-brand-foreground":e.failed?"bg-red-50 text-red-700 border border-red-200 dark:bg-red-500/10 dark:text-red-100 dark:border-red-500/30":"bg-muted text-foreground",e.isStreaming&&!d&&"streaming-cursor"),children:u?(0,t.jsx)(ah,{content:e.content}):d?(0,t.jsx)(ab,{mode:e.mode,phase:e.phase}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(av,{content:x}),m&&(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ab,{mode:e.mode,phase:e.phase})}),e.artifacts&&e.artifacts.length>0&&r&&(0,t.jsx)(at,{artifacts:e.artifacts,onSelect:r,selectedKey:i??null}),e.artifacts?.filter(e=>"question"===e.kind).map(e=>(0,t.jsx)(aw,{question:e.data,onPick:(e,t)=>a?.(e,t),answeredValue:l??null},e.data.id)),e.artifacts?.filter(e=>"apk"===e.kind).map(e=>(0,t.jsx)(aa,{apk:e.data},e.data.easBuildId)),e.artifacts?.filter(e=>"likeness_warning"===e.kind).map(e=>(0,t.jsx)(ak,{warning:e.data},e.data.id)),y&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>s(e.buildCta.brief),className:"mt-3 inline-flex items-center gap-2 rounded-md border border-brand/40 bg-brand/10 px-3 py-1.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/20",children:[(0,t.jsx)(ep.ArrowUp,{size:14,className:"-rotate-45"}),"Yes, switch to Slate X"]}),b]}),v&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>o(e.premiumCta.brief),className:"mt-3 inline-flex items-center gap-2 rounded-md border border-brand/40 bg-brand/10 px-3 py-1.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/20",children:[(0,t.jsx)(p.Sparkles,{size:14}),"Yes, generate a better version"]}),b]}),k&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.openBuildCta.brief),className:"mt-3 inline-flex items-center gap-2 rounded-md border border-brand/40 bg-brand/10 px-3 py-1.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/20",children:[(0,t.jsx)(p.Sparkles,{size:14}),e.openBuildCta.buttonText||"Yes, open in Slate X"]}),b]}),!e.isStreaming&&e.loopSuggestion&&(0,t.jsx)(ao,{loop:e.loopSuggestion}),!e.isStreaming&&e.organizeSuggestion&&e.conversationId&&(0,t.jsx)(ac,{conversationId:e.conversationId}),!e.isStreaming&&e.turnId&&e.conversationId&&(0,t.jsx)(au,{conversationId:e.conversationId,turnId:e.turnId})]})})]})}function as(e){let t=Math.max(15,Math.round(e));if(t>=1440){let e=Math.round(t/1440);return 1===e?"once a day":`every ${e} days`}if(t>=60&&t%60==0){let e=t/60;return 1===e?"every hour":`every ${e} hours`}return`every ${t} minutes`}function ao({loop:e}
1){let[r,i]=(0,n.useState)({email:!0,inbox:!0,push:!1}),[l,s]=(0,n.useState)("idle"),[o,c]=(0,n.useState)(!1);if(o)return null;let u=async()=>{s("creating");try{await a.api.createLoopAgent({title:e.title,monitorQuery:e.monitorQuery,triggerCondition:e.triggerCondition,intervalMinutes:e.intervalMinutes,channels:r}),s("created")}catch{s("error")}};if("created"===l)return(0,t.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-xl border border-brand/30 bg-brand/5 px-4 py-3 text-sm",children:[(0,t.jsx)(E.Check,{size:16,className:"mt-0.5 shrink-0 text-brand"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Loop is running"}),(0,t.jsxs)("p",{className:"mt-0.5 text-muted-foreground",children:["I'll check ",as(e.intervalMinutes),"and let you know when there's something worth seeing. Manage it any time from Agents."]})]})]});let d=(e,n)=>(0,t.jsx)("button",{type:"button",onClick:()=>i(t=>({...t,[e]:!t[e]})),className:(0,B.cn)("rounded-full border px-3 py-1 text-xs font-medium transition-colors",r[e]?"border-brand/40 bg-brand/10 text-brand-foreground":"border-border bg-muted/40 text-muted-foreground hover:bg-muted"),children:n});return(0,t.jsxs)("div",{className:"mt-3 rounded-xl border border-brand/30 bg-brand/5 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eh,{size:16,className:"text-brand"}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Turn this into a recurring loop?"})]}),(0,t.jsx)("p",{className:"mt-2 text-sm font-medium text-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.triggerCondition}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(ef.Clock,{size:13}),"Checks ",as(e.intervalMinutes)]}),(0,t.jsx)("span",{children:"Stays within your daily budget"})]}),(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Alert me via"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[d("inbox","In-app"),d("email","Email"),d("push","Push")]})]}),"error"===l&&(0,t.jsx)("p",{className:"mt-3 text-xs text-destructive",children:"Couldn't start the loop â please try again."}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",disabled:"creating"===l,onClick:u,className:"inline-flex items-center gap-2 rounded-md border border-brand/40 bg-brand/10 px-3 py-1.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/20 disabled:opacity-60",children:["creating"===l?(0,t.jsx)(eg.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(eh,{size:14}),"Start this loop"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:[(0,t.jsx)(f.X,{size:14}),"No thanks"]})]})]})}function ac({conversationId:e}){let[r,i]=(0,n.useState)("idle"),[l,s]=(0,n.useState)(!1);if(l)return null;let o=async()=>{i("working");try{let t="New project";try{let n=await a.api.getMessages(e),r=Array.isArray(n)?n.find(e=>"user"===e.role):null,i=(r?.content||"").replace(/\s+/g," ").trim();i&&(t=(t=i.split(" ").slice(0,6).join(" ").slice(0,60)).charAt(0).toUpperCase()+t.slice(1))}catch{}let n=await a.api.createProject(t);await a.api.moveConversation(e,n.id),i("done")}catch{i("error")}};return"done"===r?(0,t.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-xl border border-border bg-muted/30 px-4 py-3 text-sm",children:[(0,t.jsx)(E.Check,{size:16,className:"mt-0.5 shrink-0 text-brand"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Moved into its own project â you'll find it in the sidebar with its files, views and agents."})]}):(0,t.jsxs)("div",{className:"mt-3 rounded-xl border border-border bg-muted/30 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.FolderPlus,{size:16,className:"text-brand"}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Organize this into a project?"})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"This chat is growing into something bigger. Give it a home with its own files, views and agents."}),"error"===r&&(0,t.jsx)("p",{className:"mt-2 text-xs text-destructive",children:"Couldn't create the project â please try again."}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",disabled:"working"===r,onClick:o,className:"inline-flex items-center gap-2 rounded-md border border-brand/40 bg-brand/10 px-3 py-1.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/20 disabled:opacity-60",children:["working"===r?(0,t.jsx)(eg.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(F.FolderPlus,{size:14}),"Put in a project"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:[(0,t.jsx)(f.X,{size:14}),"Not now"]})]})]})}function au({conversationId:e,turnId:r}
1){let[i,l]=(0,n.useState)(!1),[s,o]=(0,n.useState)([]),[c,u]=(0,n.useState)(!1),[d,p]=(0,n.useState)(null),m=(0,n.useCallback)(async()=>{u(!0),p(null);try{let t=await a.api.getTrace(e,r);o(t.events||[])}catch(e){p(e instanceof Error?e.message:"Failed to load trace")}finally{u(!1)}},[e,r]);return(0,n.useEffect)(()=>{i&&m()},[i,m]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!0),className:(0,B.cn)("mt-3 inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors","hover:border-border hover:text-foreground active:scale-[0.98]"),title:"Show this turn's AI decision trace",children:[(0,t.jsx)(em.Bug,{size:11}),"Inspect"]}),i&&(0,t.jsx)(ad,{turnId:r,events:s,loading:c,error:d,onClose:()=>l(!1)})]})}function ad({turnId:e,events:r,loading:i,error:a,onClose:l}){(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]);let s=r[0]?.ts??0;return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:l,children:(0,t.jsxs)("div",{className:"flex max-h-[85vh] w-full max-w-3xl flex-col overflow-hidden rounded-xl border border-border bg-background shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("div",{className:"text-sm font-semibold",children:"Turn Trace"}),(0,t.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground",children:e})]}),(0,t.jsx)("button",{type:"button",onClick:l,className:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close trace inspector",children:(0,t.jsx)(f.X,{size:16})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[i&&(0,t.jsx)("div",{className:"px-4 py-6 text-sm text-muted-foreground",children:"Loading traceâ¦"}),a&&(0,t.jsx)("div",{className:"px-4 py-6 text-sm text-red-400",children:a}),!i&&!a&&0===r.length&&(0,t.jsx)("div",{className:"px-4 py-6 text-sm text-muted-foreground",children:"No trace events recorded for this turn yet. Quick-mode and pre-trace legacy turns aren't traced; for a Build-mode turn that finished after the last backend restart, refresh once and try again."}),!i&&r.length>0&&(0,t.jsx)("ol",{className:"divide-y divide-border",children:r.map((e,n)=>(0,t.jsxs)("li",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:(0,B.cn)("rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",function(e){switch(e){case"orchestrator_decide":return"bg-brand/20 text-brand";case"orchestrator_fallback":return"bg-amber-500/20 text-amber-300";case"fast_path_call":return"bg-emerald-500/20 text-emerald-300";case"claude_session_start":case"claude_session_event":case"claude_session_end":return"bg-violet-500/20 text-violet-300";case"artifact_emitted":return"bg-sky-500/20 text-sky-300";
1case"error":return"bg-red-500/20 text-red-300";default:return"bg-muted text-muted-foreground"}}(e.kind)),children:e.kind}),(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.source})]}),(0,t.jsxs)("span",{className:"text-[10px] font-mono text-muted-foreground",children:["+",Math.max(0,e.ts-s),"ms"]})]}),e.payload&&Object.keys(e.payload).length>0&&(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted/40 p-2 text-[11px] leading-relaxed font-mono text-foreground/90",children:JSON.stringify(e.payload,null,2)})]},n))})]})]})})}let ap=/\.(png|jpe?g|gif|webp|svg|avif|bmp)(\?|#|$)/i,am=/^(!?)\[([^\]\n]+)\]\(((?:https?:\/\/|\/)[^)\s]+)\)\s*$/;function ah({content:e}){let{attachments:n,text:r}=function(e){let t=e.split("\n"),n=[],r=0;for(;r<t.length;){let e=t[r];if(""===e.trim()){r++;continue}let i=e.match(am);if(!i)break;let[,a,l,s]=i,o="!"===a||ap.test(s)?"image":"file";n.push({alt:l,url:s,kind:o}),r++}return{attachments:n,text:t.slice(r).join("\n").trimStart()}}(e);return 0===n.length?(0,t.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e}):(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>"image"===e.kind?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block overflow-hidden rounded-lg border border-brand-foreground/20 bg-black/10",children:(0,t.jsx)("img",{src:e.url,alt:e.alt,className:"max-h-64 max-w-full object-cover"})},e.url):(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg border border-brand-foreground/25 bg-black/10 px-3 py-2 text-xs hover:bg-black/20",title:e.alt,children:[(0,t.jsx)(C.FileText,{size:14}),(0,t.jsx)("span",{className:"max-w-[220px] truncate",children:e.alt})]},e.url))}),r&&(0,t.jsx)("div",{className:"whitespace-pre-wrap break-words",children:r})]})}let af=["Consulting Analyst Aâ¦","Consulting Analyst Bâ¦","Consulting Analyst Câ¦","Consulting Analyst Dâ¦","Asking the rubber duckâ¦","Polling Clodius the Wiseâ¦","Font-to-phulterizing the consensusâ¦","Triangulating contradictionsâ¦","Reconciling expert disagreementsâ¦","Bouncing ideas off the office plantâ¦","Cross-referencing the council of eldersâ¦","Brewing tea while analysts deliberateâ¦","Decoding analyst body languageâ¦","Synthesizing the panel's verdictâ¦","Polishing the final answerâ¦"],ag=["Getting startedâ¦"],ax=["Thinkingâ¦","Composing a replyâ¦","One momentâ¦"];function ab({mode:e,phase:r}
1){let i="deep"===e?af:"build"===e?ag:ax,[a,l]=(0,n.useState)(0);(0,n.useEffect)(()=>{l(0);let e=window.setInterval(()=>{l(e=>(e+1)%i.length)},2400);return()=>window.clearInterval(e)},[i]);let s=r||i[a];return(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-label":"Assistant is thinking",className:"flex items-center gap-2.5 py-0.5",children:[(0,t.jsx)("span",{className:"slate-thinking","aria-hidden":"true"}),(0,t.jsx)("span",{className:"slate-text-shimmer text-sm font-medium slate-rise",children:s},s)]})}function ay(e){if(!e)return e;let t=e;return(t=(t=t.replace(/\n*\s*Artifacts? produced this turn:[\s\S]*$/i,"")).replace(/\[\s*(?:image|video|audio|music|document|presentation|brand_kit)\s*:[^\]]*?https?:\/\/[^\]\s]+[^\]]*\]/gi,"")).replace(/\s+$/g,"")}function av({content:e}){return(0,t.jsx)("div",{className:"break-words text-[15px] leading-7 space-y-3.5 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:(0,t.jsx)(rI,{remarkPlugins:[iH],components:{p:({children:e})=>(0,t.jsx)("p",{className:"leading-7 whitespace-pre-wrap",children:e}),a:({href:e,children:n})=>(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-brand underline underline-offset-2 hover:opacity-80",children:n}),strong:({children:e})=>(0,t.jsx)("strong",{className:"font-semibold text-foreground",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"list-disc pl-5 space-y-1.5 marker:text-muted-foreground",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"list-decimal pl-5 space-y-1.5 marker:text-muted-foreground",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-7 pl-0.5",children:e}),h1:({children:e})=>(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight mt-5 mb-2",children:e}),h2:({children:e})=>(0,t.jsx)("h2",{className:"text-lg font-semibold tracking-tight mt-5 mb-2",children:e}),h3:({children:e})=>(0,t.jsx)("h3",{className:"text-[15px] font-semibold mt-4 mb-1.5",children:e}),code:({className:e,children:n})=>(e||"").includes("language-")?(0,t.jsx)("code",{className:(0,B.cn)("block",e),children:n}):(0,t.jsx)("code",{className:"rounded bg-background/60 px-1.5 py-0.5 text-[0.85em] font-mono",children:n}),pre:({children:e})=>(0,t.jsx)(aj,{children:e}),blockquote:({children:e})=>(0,t.jsx)("blockquote",{className:"border-l-2 border-border pl-3 italic text-muted-foreground",children:e}),hr:()=>(0,t.jsx)("hr",{className:"my-3 border-border"}),img:({src:e,alt:n})=>(0,t.jsx)("img",{src:"string"==typeof e?e:void 0,alt:"string"==typeof n?n:"",loading:"lazy",className:"my-3 max-h-80 w-auto max-w-full rounded-xl border border-border/50 object-contain"}),table:({children:e})=>(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("table",{className:"min-w-full text-xs border-collapse",children:e})}),th:({children:e})=>(0,t.jsx)("th",{className:"border border-border px-2 py-1 text-left font-semibold",children:e}),td:({children:e})=>(0,t.jsx)("td",{className:"border border-border px-2 py-1",children:e})},children:e})})}function ak({warning:e}){let n=e.subjects.length>0?e.subjects.join(" and "):"the requested likeness";return(0,t.jsxs)("div",{"data-testid":"likeness-warning-card",className:"mt-3 max-w-md rounded-xl border border-amber-500/50 bg-amber-500/15 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)(ex.AlertTriangle,{size:18,className:"mt-0.5 shrink-0 text-amber-500"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Couldn't lock the likeness"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:`Every attempt to render ${n} came out looking like a different person, so I didn't ship it as final.`}),e.reason&&(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:e.reason}),"number"==typeof e.minScore&&(0,t.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground/70",children:["Best likeness score: ",e.minScore,"/10 (needs ",e.threshold,"+)"]})]})]}),e.url&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs font-medium text-amber-600 dar
1k:text-amber-400",children:"Closest attempt â likeness not verified"}),(0,t.jsx)("img",{src:e.url,alt:"Closest attempt â likeness not verified",className:"max-h-72 w-full rounded-lg border border-amber-500/30 object-cover",loading:"lazy"})]})]})}function aw({question:e,onPick:r,answeredValue:i}){let a=e=>e.trim().toLowerCase(),l=i?e.chips.find(e=>a(e.value)===a(i)):void 0,s=!!i,o=e.chips.length>0,c=!1!==e.allowFreeText,u=!o,[d,p]=(0,n.useState)(u),[m,h]=(0,n.useState)(""),f=(0,n.useRef)(null);(0,n.useEffect)(()=>{d&&!s&&f.current?.focus()},[d,s]);let g=s?l?`You picked: ${l.label}`:`You typed: ${(i||"").slice(0,60)}${(i||"").length>60?"â¦":""}`:d?"Type your answer â Enter to send":"Pick a direction â or tap Other to type your own",x=()=>{let e=m.trim();e&&!s&&r(e,e.length>40?`${e.slice(0,40)}â¦`:e)};return(0,t.jsxs)("div",{className:(0,B.cn)("mt-3 flex flex-col gap-2 rounded-lg border p-3 transition-colors",s?"border-border/60 bg-muted/40":"border-brand/30 bg-brand/5"),children:[(0,t.jsxs)("div",{className:(0,B.cn)("flex items-center gap-1.5 text-xs font-medium",s?"text-muted-foreground":"text-brand"),children:[(0,t.jsx)(ed,{size:12}),(0,t.jsx)("span",{children:g})]}),o&&!d&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.chips.map(e=>{let n=!!i&&a(e.value)===a(i);return(0,t.jsx)("button",{type:"button",onClick:()=>!s&&r(e.value,e.label),disabled:s,"aria-pressed":n,className:(0,B.cn)("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",n?"border-brand bg-brand text-brand-foreground":s?"border-border/40 bg-background/40 text-muted-foreground/70":"border-border bg-background/80 text-foreground hover:border-brand/50 hover:bg-brand/10 active:scale-[0.98]",s&&!n&&"cursor-not-allowed",s&&"opacity-90"),title:e.value,children:e.label},e.label)}),c&&!s&&(0,t.jsx)("button",{type:"button",onClick:()=>p(!0),className:(0,B.cn)("rounded-full border border-dashed px-3 py-1.5 text-xs font-medium transition-colors","border-brand/50 bg-background/60 text-brand hover:border-brand hover:bg-brand/10 active:scale-[0.98]"),title:"Type your own answer",children:"Otherâ¦"})]}),d&&!s&&(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsx)("textarea",{ref:f,value:m,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),x()),"Escape"===e.key&&o&&(e.preventDefault(),p(!1),h(""))},rows:1,placeholder:e.context?`Your answer about ${e.context}â¦`:"Type your answerâ¦",className:(0,B.cn)("min-h-[36px] max-h-[160px] flex-1 resize-none rounded-md border border-border bg-background/80 px-3 py-2 text-sm text-foreground","placeholder:text-muted-foreground/70 focus:border-brand focus:outline-none focus:ring-1 focus:ring-brand/40")}),(0,t.jsx)("button",{type:"button",onClick:x,disabled:!m.trim(),"aria-label":"Send your answer",className:(0,B.cn)("flex h-9 w-9 items-center justify-center rounded-md transition-colors",m.trim()?"bg-brand text-brand-foreground hover:bg-brand/90 active:scale-[0.97]":"bg-muted text-muted-foreground/60 cursor-not-allowed"),children:(0,t.jsx)(ep.ArrowUp,{size:16})})]}),d&&o&&!s&&(0,t.jsx)("button",{type:"button",onClick:()=>{p(!1),h("")},className:"self-start text-[11px] text-muted-foreground hover:text-foreground",children:"â Back to options"})]})}function aj({children:e}){let[r,i]=(0,n.useState)(!1),a=function e(t){if("string"==typeof t)return t;if("number"==typeof t)return String(t);if(Array.isArray(t))return t.map(e).join("");if(t&&"object"==typeof t&&"props"in t){let n=t.props;if(n?.children!==void 0)return e(n.children)}return""}(e),l=async()=>{try{await navigator.clipboard.writeText(a),i(!0),window.setTimeout(()=>i(!1),1500)}catch{}};return(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-background/60 p-3 pr-10 text-xs font-mono leading-relaxed",children:e}),(0,t.jsx)("button",{onClick:l,title:r?"Copied":"Copy",className:(0,B.cn)("absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background/80 text-muted-foreground opacity-0 transition-all","group-hover:opacity-100 hover:text-foreground hover:bg-muted"),children:r?(0,t.jsx)(E.Check,{size:12,className:"text-emerald-500"}):(0,t.jsx)(eu,{size:12})})]})}let aN=(0,l.default)("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);var aS=e.i(14764),aC=e.i(87951),aA=e.i(87246),aM=e.i(82735),a_=e.i(3408),a_=a_,aI=e.i(23426),az=e.i(9165);function aE({onSend:e,onStop:r,isLoading:i,hasMessages:l=!1,onModeChangeNewConversation:s,mode:o,onModeChange:c,currentMode:u,lockedCapability:d,onQueue:p,onDequeue:m,queuedMessages:h=[]}
1){let[x,y]=(0,n.useState)(""),v=!!d&&"general"!==d,k=(0,X.getVertical)(o),w=!!p&&("build"===o||"slatex"===o||!!k||v);(0,n.useEffect)(()=>{v&&"slatex"!==o&&c("slatex")},[v,o,c]);let[j,N]=(0,n.useState)(null),[S,A]=(0,n.useState)([]),[M,_]=(0,n.useState)(!1),[I,z]=(0,n.useState)(!1),E=(0,n.useRef)(null),D=(0,n.useRef)(null),T=(0,n.useRef)(0),[P,L]=(0,n.useState)(!1),R=(0,n.useRef)(null),F="build"===o||"slatex"===o||!!k||v,[O,$]=(0,n.useState)(!1),[U,H]=(0,n.useState)(null),[V,G]=(0,n.useState)(!1),K=(0,n.useRef)(null),[Y,Q]=(0,n.useState)(!1),[J,Z]=(0,n.useState)(""),ee=(0,n.useCallback)(async()=>{G(!0);try{let e=await a.api.getCharacters();H(e)}finally{G(!1)}},[]),et=(0,n.useCallback)(e=>{y(t=>{let n=t.replace(/\s+$/,"");return 0===n.length?`${e} `:`${n} ${e} `}),$(!1),E.current?.focus()},[]),en=(0,n.useCallback)(e=>{let t=E.current;y(n=>{let r=t?.selectionStart??n.length,i=n.slice(0,r),a=n.slice(r),l=i.replace(/@([\p{L}\p{N}_-]{0,40})$/u,`${e} `),s=l+a;return requestAnimationFrame(()=>{t&&(t.selectionStart=t.selectionEnd=l.length,t.focus())}),s}),Q(!1)},[]),er=(U||[]).filter(e=>e.name.toLowerCase().includes(J.toLowerCase())),ei=x.trim().length>0||S.length>0,el=(0,n.useCallback)(()=>{L(!1),y(e=>0===e.length||e.endsWith(" ")?`${e}@`:`${e} @`),Z(""),Q(!0),null===U&&ee(),requestAnimationFrame(()=>E.current?.focus())},[U,ee]);(0,n.useEffect)(()=>{if(!P)return;let e=e=>{R.current?.contains(e.target)||L(!1)},t=e=>{"Escape"===e.key&&L(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[P]),(0,n.useEffect)(()=>{if(!O)return;let e=e=>{K.current?.contains(e.target)||$(!1)},t=e=>{"Escape"===e.key&&$(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[O]),(0,n.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"l"===e.key.toLowerCase()&&(e.preventDefault(),E.current?.focus())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let es=(0,n.useCallback)(async e=>{let t=Array.from(e);if(0!==t.length){_(!0);try{let e=await Promise.all(t.map(e=>a.api.uploadFile(e).catch(t=>(g.toast.error(`${e.name}: ${t instanceof Error?t.message:"upload failed"}`),null)))),n=[];for(let t of e){if(!t)continue;n.push({url:t.url,name:t.name,mimeType:t.mimeType,size:t.size});let e=t.contents;if(Array.isArray(e))for(let r of e)n.push({url:r.url,name:`${t.name}/${r.path}`,mimeType:r.mimeType,size:r.size})}n.length>0&&A(e=>[...e,...n])}finally{_(!1)}}},[]),eo=(0,n.useCallback)(e=>{A(t=>t.filter(t=>t.url!==e))},[]),ec=(0,n.useCallback)(e=>{let t=e.trim();return t||0!==S.length?[S.map(e=>e.mimeType.startsWith("image/")?``:`[${e.name}](${e.url})`).join("\n"),t].filter(Boolean).join("\n\n"):null},[S]),eu=(0,n.useCallback)(()=>{y(""),A([]),E.current&&(E.current.style.height="auto")},[]),ed=(0,n.useCallback)((t,n)=>{let r=ec(t);if(r){if(i){w&&p&&(p(r,{mode:o,extendedMode:!0}),eu());return}e(r,{mode:o,viaVoice:n?.viaVoice,extendedMode:!0}),eu()}},[ec,eu,i,w,p,e,o,!0]),ep=(0,n.useCallback)(()=>ed(x),[ed,x]),em=(0,n.useCallback)(e=>{if(e!==o){if(!l)return void c(e);N(e)}},[o,l,c]),eh=(0,n.useCallback)(()=>{j&&(s?.(),c(j)),N(null)},[j,s,c]),ex=k?.Icon,eb="research"===o||"deep"===o,ey=function(e){if(e)return W.get(e)}(o),{isRecording:ev,isProcessing:ek,toggleRecording:ew}=(0,az.useVoice)({onTranscript:e=>{ed(e,{viaVoice:!0})}});return(0,n.useEffect)(()=>{let e=e=>{e.dataTransfer?.types.includes("Files")&&(e.preventDefault(),T.current+=1,z(!0))},t=e=>{e.dataTransfer?.types.includes("Files")&&(e.preventDefault(),T.current-=1,T.current<=0&&(T.current=0,z(!1)))},n=e=>{e.dataTransfer?.types.includes("Files")&&e.preventDefault()},r=e=>{e.dataTransfer?.files?.length&&(e.preventDefault(),T.current=0,z(!1),es(e.dataTransfer.files))};return window.addEventListener("dragenter",e),window.addEventListener("dragleave",t),window.addEventListener("dragover",n),window.addEventListener("drop",r),()=>{window.removeEventListener("dragenter",e),window.removeEventListener("dragleave",t),window.removeEventListener("dragover",n
1),window.removeEventListener("drop",r)}},[es]),(0,t.jsxs)("div",{className:"relative border-t border-border/50 bg-background/40 p-4 backdrop-blur-md",children:[j&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/70 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-4 w-full max-w-sm rounded-2xl border border-border bg-card p-6 shadow-2xl",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight",children:"Start a new conversation?"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Each conversation stays in a single mode. Switching the mode now will open a new conversation so the two modes don't mix. Are you sure you want to continue?"}),(0,t.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>N(null),className:"rounded-md border border-border bg-muted/30 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"No"}),(0,t.jsx)("button",{type:"button",onClick:eh,className:"rounded-md bg-brand px-4 py-2 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand/90",children:"Yes"})]})]})}),I&&(0,t.jsx)("div",{className:"pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-brand/10 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"rounded-2xl border-2 border-dashed border-brand bg-background/90 px-8 py-6 text-center",children:[(0,t.jsx)(a_.default,{className:"mx-auto mb-2 text-brand",size:32}),(0,t.jsx)("div",{className:"text-sm font-medium",children:"Drop to upload"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Images, audio, video, docs, code, archives â up to 100 MB"})]})}),h.length>0&&(0,t.jsx)("div",{className:"mx-auto mb-2 flex max-w-3xl flex-col gap-1.5",children:h.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-brand/30 bg-brand/5 px-3 py-1.5 text-xs",children:[(0,t.jsx)(ef.Clock,{size:12,className:"shrink-0 text-brand"}),(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:e.content}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] uppercase tracking-wide text-brand/70",children:"Queued"}),m&&(0,t.jsx)("button",{type:"button",onClick:()=>m(e.id),className:"rounded-full p-0.5 text-muted-foreground hover:bg-muted-foreground/20 hover:text-foreground",title:"Remove from queue",children:(0,t.jsx)(f.X,{size:12})})]},e.id))}),S.length>0&&(0,t.jsx)("div",{className:"mx-auto mb-2 flex max-w-3xl flex-wrap gap-2",children:S.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border bg-muted/50 py-1 pl-1 pr-2 text-xs",children:[e.mimeType.startsWith("image/")?(0,t.jsx)("img",{src:e.url,alt:e.name,className:"h-6 w-6 rounded-full object-cover"}):(0,t.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-background",children:(0,t.jsx)(C.FileText,{size:12,className:"text-muted-foreground"})}),(0,t.jsx)("span",{className:"max-w-[180px] truncate",children:e.name}),(0,t.jsx)("button",{type:"button",onClick:()=>eo(e.url),className:"rounded-full p-0.5 text-muted-foreground hover:bg-muted-foreground/20 hover:text-foreground",title:"Remove attachment",children:(0,t.jsx)(f.X,{size:12})})]},e.url))}),(v||k||eb)&&(0,t.jsx)("div",{className:"mx-auto mb-2 flex max-w-3xl items-center gap-1 overflow-x-auto",children:v?(0,t.jsxs)("span",{"data-testid":"mode-chip-slatex-locked",title:"Dedicated modes run on Slate X â our top-tier builder",className:"flex shrink-0 items-center gap-1.5 rounded-full border border-brand/60 bg-brand/15 px-3 py-2 text-sm text-brand md:px-2.5 md:py-1 md:text-xs",children:[(0,t.jsx)(q,{className:"h-4 w-4 md:h-3 md:w-3"}),(0,t.jsx)("span",{children:"Slate X"})]}):k?(0,t.jsxs)("span",{"data-testid":`mode-chip-vertical-${k.id}`,title:k.hint,className:"flex shrink-0 items-center gap-1.5 rounded-full border border-brand/60 bg-brand/15 px-3 py-2 text-sm text-brand md:px-2.5 md:py-1 md:text-xs",children:[ex&&(0,t.jsx)(ex,{className:"h-4 w-4 md:h-3 md:w-3"}),(0,t.jsx)("span",{children:k.label}),(0,t.jsx)("button",{type:"button","data-testid":"mode-vertical-clear",onClick:()=>em("auto"),title:"Back to standard modes",className:"-mr-1 rounded-full p-0.5 text-brand/70 hover:bg-brand/20 hover:text-brand",children:(0,t.jsx)(f.X,{className:"h-3 w-3"})})]}):eb?(0,t.jsxs)("span",{"data-testid":`mode-toggle-${o}`,title:ey?.hint,className:"flex shrink-0 items-center gap-1.5 rounded-full border border-brand/60 bg-brand/15 px-3 py-2 text-sm text-brand md:px-2.5 md:py-1 md:text-xs",children:[ey?.Icon&&(0,t.jsx)(ey.Icon,{className:"h-4 w-4 md:h-3 md:w-3"}),(0,t.jsx)("span",{children:ey?.label}),(0,t.jsx)("button",{type:"button","data-testid":"mode-toggle-clear",onClick:()=>em("auto"),title:"Turn off â back to the automatic mode",className:"-mr-1 rounded-full p-0.5 text-brand/70 hover:bg-brand/20 hover:text-brand",children:(0,t.jsx)(f.X,{className:"h-3 w-3"})})]}):null}),(0,t.jsxs)("div",{className:"relative mx-auto flex max-w-3xl items-end gap-1 rounded-2xl border border-border bg-muted/30 px-2 py-1.5 md:gap-2 md:px-4 md:py-2",children:[Y&&F&&(0,t.jsxs)("div",{className:"absolute bottom-full left-3 z-50 mb-2 w-64 overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-lg",children:[(0,t.jsx)("div",{className:"border-b px-3 py-2 text-xs font-medium text-muted-foreground",children:"Reference a persona"}),(0,t.jsx)("div",{className:"max-h-56 overflow-y-auto",children:V&&null===U?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[(0,t.jsx)(eg.Loader2,{size:14,className:"animate-spin"})," Loadingâ¦"]}):er.length>0?er.map(e=>(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),en(e.name)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-accent",children:[e.referenceImageUrl?(0,t.jsx)("img",{src:e.referenceImageUrl,alt:e.name,className:"size-7 shrink-0 rounded-md border object-cover"}):(0,t.jsx)("span",{className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md bg-foreground
1/5 text-foreground/60",children:(0,t.jsx)(aI.UserRound,{size:14})}),(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name})]},e.id)):(0,t.jsx)("div",{className:"px-3 py-3 text-xs leading-relaxed text-muted-foreground",children:U&&0===U.length?(0,t.jsxs)(t.Fragment,{children:["No personas yet."," ",(0,t.jsx)("a",{href:"/personas",className:"underline hover:text-foreground",children:"Add one"})," ","to reuse the same face."]}):"No personas match."})})]}),(0,t.jsx)("textarea",{ref:E,value:x,onChange:e=>{let t=e.target.value;y(t);let n=e.target;if(n.style.height="auto",n.style.height=Math.min(n.scrollHeight,200)+"px",F){let e=n.selectionStart??t.length,r=t.slice(0,e).match(/(?:^|\s)@([\p{L}\p{N}_-]{0,40})$/u);r?(Z(r[1]),Q(!0),null===U&&ee()):Y&&Q(!1)}},onKeyDown:e=>{if(Y&&F){if("Escape"===e.key){e.preventDefault(),Q(!1);return}if("Enter"===e.key&&!e.shiftKey&&er.length>0){e.preventDefault(),en(er[0].name);return}}"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ep())},placeholder:ev?"Listening...":ek?"Transcribing...":i?w?"Working â type to queue your next messageâ¦":"Working on it â tap Stop to cancel...":"What should we create?",rows:1,disabled:ev||ek||i&&!w,className:(0,B.cn)("min-w-0 flex-1 resize-none bg-transparent text-base outline-none md:text-sm","placeholder:text-muted-foreground","max-h-[200px] py-2 md:py-1",(ev||ek||i&&!w)&&"opacity-50 cursor-not-allowed")}),(0,t.jsx)("input",{ref:D,type:"file",accept:"image/*,audio/*,video/*,application/pdf,application/zip,application/x-zip-compressed,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.odt,.odp,.ods,.pages,.numbers,.key,.epub,.mobi,.txt,.md,.markdown,.rtf,.tex,.log,.csv,.tsv,.json,.jsonl,.ndjson,.xml,.yaml,.yml,.toml,.ini,.conf,.html,.htm,.css,.scss,.js,.mjs,.cjs,.ts,.tsx,.jsx,.vue,.svelte,.py,.rb,.php,.go,.rs,.java,.kt,.swift,.c,.h,.cpp,.hpp,.cs,.sql,.graphql,.proto,.ipynb,.tar,.gz,.tgz,.7z,.rar",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&(es(e.target.files),e.target.value="")}}),(0,t.jsxs)("div",{ref:R,className:"relative shrink-0 md:hidden",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e=>!e),disabled:i||M,className:(0,B.cn)("flex h-11 w-11 items-center justify-center rounded-lg transition-colors",P?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:"Add files and more","aria-haspopup":"menu","aria-expanded":P,children:M?(0,t.jsx)(eg.Loader2,{size:18,className:"animate-spin"}):(0,t.jsx)(b.Plus,{size:20})}),P&&(0,t.jsxs)("div",{role:"menu",className:"absolute bottom-full left-0 z-50 mb-2 w-52 overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-lg",children:[(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{L(!1),D.current?.click()},className:"flex w-full items-center gap-3 px-4 py-3 text-left text-sm transition-colors hover:bg-accent",children:[(0,t.jsx)(aM.Paperclip,{size:16,className:"shrink-0 text-muted-foreground"}
1),"Add files"]}),F&&(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:el,className:"flex w-full items-center gap-3 border-t px-4 py-3 text-left text-sm transition-colors hover:bg-accent",children:[(0,t.jsx)(aI.UserRound,{size:16,className:"shrink-0 text-muted-foreground"}),"Reference a persona"]}),(0,t.jsxs)("a",{href:"/app/talk","data-talk-entry":!0,role:"menuitem",onClick:()=>L(!1),className:"flex w-full items-center gap-3 border-t px-4 py-3 text-left text-sm transition-colors hover:bg-accent",children:[(0,t.jsx)(aN,{size:16,className:"shrink-0 text-muted-foreground"}),"Talk live"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>D.current?.click(),disabled:i||M,className:(0,B.cn)("hidden h-8 w-8 shrink-0 items-center justify-center rounded-lg transition-colors md:flex","text-muted-foreground hover:text-foreground hover:bg-muted"),title:"Attach a file",children:M?(0,t.jsx)(eg.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(aM.Paperclip,{size:16})}),F&&(0,t.jsxs)("div",{ref:K,className:"relative hidden shrink-0 md:block",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let e=!O;$(e),e&&null===U&&ee()},disabled:i,className:(0,B.cn)("flex h-11 w-11 items-center justify-center rounded-lg md:h-8 md:w-8 transition-colors",O?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:"Reference a saved persona (or type @ in the message)",children:(0,t.jsx)(aI.UserRound,{size:16})}),O&&(0,t.jsxs)("div",{className:"absolute bottom-full right-0 z-50 mb-2 w-64 overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-lg",children:[(0,t.jsxs)("div",{className:"border-b px-3 py-2 text-xs font-medium text-muted-foreground",children:["Your personas ",(0,t.jsx)("span",{className:"font-normal text-muted-foreground/70",children:"· or type @"})]}),(0,t.jsx)("div",{className:"max-h-64 overflow-y-auto",children:V?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[(0,t.jsx)(eg.Loader2,{size:14,className:"animate-spin"})," Loadingâ¦"]}):U&&U.length>0?U.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>et(e.name),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-accent",children:[e.referenceImageUrl?(0,t.jsx)("img",{src:e.referenceImageUrl,alt:e.name,className:"size-7 shrink-0 rounded-md border object-cover"}):(0,t.jsx)("span",{className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md bg-foreground
1/5 text-foreground/60",children:(0,t.jsx)(aI.UserRound,{size:14})}),(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name})]},e.id)):(0,t.jsxs)("div",{className:"px-3 py-3 text-xs leading-relaxed text-muted-foreground",children:["No personas yet. Add one in"," ",(0,t.jsx)("a",{href:"/personas",className:"underline hover:text-foreground",children:"My Personas"})," ","to reuse the same person across scenes."]})})]})]}),(0,t.jsx)("a",{href:"/app/talk","data-talk-entry":!0,className:"hidden h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground md:flex",title:"Talk live â real-time voice conversation",children:(0,t.jsx)(aN,{size:16})}),(0,t.jsx)("button",{onClick:ew,disabled:i||ek,className:(0,B.cn)("h-11 w-11 shrink-0 items-center justify-center rounded-lg md:h-8 md:w-8 transition-colors",ei||i?"hidden md:flex":"flex",ev?"bg-red-500 text-white animate-pulse":ek?"text-muted-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:ev?"Stop recording":"Voice input",children:ek?(0,t.jsx)(eg.Loader2,{size:16,className:"animate-spin"}):ev?(0,t.jsx)(aA.MicOff,{size:16}):(0,t.jsx)(aC.Mic,{size:16})}),i&&w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:ep,disabled:!x.trim()&&0===S.length,title:"Queue this message â sends when the current turn finishes",className:(0,B.cn)("flex h-11 w-11 shrink-0 items-center justify-center rounded-lg md:h-8 md:w-8 transition-colors",x.trim()||S.length>0?"bg-brand text-brand-foreground hover:bg-brand/90":"text-muted-foreground"),children:(0,t.jsx)(b.Plus,{size:16})}),r&&(0,t.jsx)("button",{onClick:r,title:"Stop generation",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-red-500/80 text-white transition-colors hover:bg-red-500 md:h-8 md:w-8",children:(0,t.jsx)(ea,{size:12,className:"fill-current"})})]}):i&&r?(0,t.jsx)("button",{onClick:r,title:"Stop generation",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-red-500/80 text-white transition-colors hover:bg-red-500 md:h-8 md:w-8",children:(0,t.jsx)(ea,{size:12,className:"fill-current"})}):(0,t.jsx)("button",{onClick:ep,disabled:!x.trim()&&0===S.length||i||ev,className:(0,B.cn)("h-11 w-11 shrink-0 items-center justify-center rounded-lg md:h-8 md:w-8 transition-colors md:flex",ei?"flex":"hidden",!x.trim()||i||ev?"text-muted-foreground":"bg-brand text-brand-foreground hover:bg-brand/90"),children:i?(0,t.jsx)(eg.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(aS.Send,{size:16})})]}),(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"SlateX can make mistakes. Verify important outputs."})]})}let aD=(0,l.default)("microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),aT={quick:{icon:$.Zap,label:"Quick",color:"bg-emerald-500/10 text-emerald-500 border-emerald-500/20"},slatex:{icon:q,label:"Slate X",color:"bg-brand/10 text-brand border-brand/20"},deep:{icon:aD,label:"Slate",color:"bg-purple-500/10 text-purple-500 border-purple-500/20"},research:{icon:H.Telescope,label:"Research",color:"bg-sky-500/10 text-sky-500 border-sky-500/20"}};function aP({mode:e,capability:n,vertical:r}){let i=(0,X.getVertical)(r);if(!e&&!i)return null;let a=i?{icon:i.Icon,label:i.label,color:"bg-brand/10 text-brand border-brand/20"}:aT[e];if(!a)return null;let l=a.icon;return(0,t.jsxs)("span",{className:(0,B.cn)("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium",a.color),children:[(0,t.jsx)(l,{size:12}),a.label,n&&"general"!==n&&(0,t.jsxs)("span",{className:"opacity-60",children:[" ","/ ",n.replace("_"," ")]})]})}function aL(){let e=(0,n.useRef)(Date.now()),[r,i]=(0,n.useState)(0);(0,n.useEffect)(()=>{let t=window.setInterval(()=>i(Date.now()-e.current),1e3);return()=>window.clearInterval(t)},[]);let a=Math.floor(r/1e3),l=Math.floor(a/60),s=a%60;return(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:0===l?`${s}s`:`${l}m ${s.toString().padStart(2,"0")}s`})}let aR={web_app:{label:"Web App",Icon:y.Globe},mobile_app:{label:"Mobile App",Icon:v.Smartphone},brand_kit:{label:"Brand Kit",Icon:k.Palette},image:{label:"Image",Icon:w.Image},video:{label:"Video",Icon:j},music:{label:"Music",Icon:N.Music},presentation:{label:"Presentation",Icon:S},document:{label:"Document",Icon:C.FileText},research:{label:"Research",Icon:L.Search},compound:{label:"Startup Kit",Icon:p.Sparkles}};function aF({messages:e,isLoading:r,currentMode:i,currentVertical:a,currentCapability:l,lockedCapability:s,onClearLock:o,onSend:c,onStopGeneration:u,onRetry:d,limitNotice:p,onDismissLimit:g,autoSpeak:b,onToggleAutoSpeak:y,isSpeaking:v,onStopSpeaking:k,onSelectArtifact:w,selectedArtifactKey:j,onChipReply:N,onBuildCta:S,onPremiumCta:C,onOpenBuildConversation:M,onModeChangeNewConversation:_,composerMode:I,onComposerModeChange:z,onQueue:E,onDequeue:D,queuedMessages:T,workingLabel:P,workingDetail:L,onOpenProgress:R}){var F;let O=s&&"general"!==s?aR[s]:null,$=e[e.length-1],U=!r&&$?.role==="assistant"&&$.failed,H=(0,n.useRef)(null),q=(0,n.useRef)(!0),V=(0,n.useRef)(null),[W,G]=(0,n.use
1State)(!1),X=(0,n.useCallback)((e="auto")=>{let t=H.current;t&&(t.scrollTo({top:t.scrollHeight,behavior:e}),q.current=!0,G(!1))},[]),K=(0,n.useCallback)(()=>{let e=H.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<=120;q.current=t,G(!t)},[]);return(0,n.useEffect)(()=>{let t=e[e.length-1];if(t?.role==="user"&&t.id!==V.current&&(V.current=t.id,q.current=!0,G(!1)),!q.current)return;let n=H.current;n&&(n.scrollTop=n.scrollHeight)},[e]),(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"hidden h-14 items-center gap-3 border-b border-border px-4 md:flex",children:[(0,t.jsx)("h2",{className:"text-sm font-medium",children:"Chat"}),(0,t.jsx)(aP,{mode:i,vertical:a,capability:l}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[v&&(0,t.jsxs)("button",{onClick:k,className:"flex h-8 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Stop speaking",children:[(0,t.jsx)(ea,{size:12,className:"fill-current"}),(0,t.jsx)("span",{children:"Stop"})]}),(0,t.jsx)("button",{onClick:y,className:(0,B.cn)("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",b?"text-brand hover:bg-muted":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:b?"Voice replies on â click to mute":"Voice replies off â click to enable",children:b?(0,t.jsx)(m,{size:16}):(0,t.jsx)(h,{size:16})})]})]}),(0,t.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[(0,t.jsx)("div",{ref:H,onScroll:K,className:"h-full overflow-y-auto",children:0===e.length?(0,t.jsx)(aO,{onPick:e=>c(e),capability:s}):(0,t.jsx)("div",{className:"py-4",children:e.map((n,r)=>{let i=e[r+1]?.role==="user"?e[r+1].content.trim():null;return(0,t.jsx)(al,{message:n,onSelectArtifact:w,selectedArtifactKey:j,onChipReply:N,answeredChipValue:i,onBuildCta:S,onPremiumCta:C,onOpenBuildConversation:M},n.id)})})}),W&&(0,t.jsxs)("button",{onClick:()=>X("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-background/90 px-3 py-1.5 text-xs font-medium text-foreground shadow-lg backdrop-blur-sm transition-all hover:bg-muted",children:[(0,t.jsx)(eo,{size:12}),"Jump to latest"]})]}),p&&(0,t.jsxs)("div",{role:"status","data-testid":"limit-banner",className:"flex items-start gap-3 border-t border-amber-300 bg-amber-50 dark:border-amber-500/30 dark:bg-amber-500/10 px-4 py-3",children:[(0,t.jsx)(es.AlertCircle,{size:16,className:"mt-0.5 shrink-0 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 text-xs text-amber-900 dark:text-amber-100",children:[(0,t.jsxs)("p",{className:"font-medium",children:["Daily ","dollars"===(F=p.bucket)?"spend":F," cap reached"]}),(0,t.jsx)("p",{className:"mt-0.5 text-amber-800/90 dark:text-amber-100/80",children:p.message}),(0,t.jsxs)("p",{className:"mt-0.5 text-amber-800/70 dark:text-amber-100/60",children:["Resets ",function(e){let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t)||t<=0)return"soon";let n=Math.round(t/36e5);if(n<1){let e=Math.max(1,Math.round(t/6e4));return`in ${e}m`}if(n<=48)return`in ${n}h`;let r=Math.round(n/24);return`in ${r}d`}(p.windowEndsAt),"."]}),(0,t.jsx)(x.default,{href:"/usage",className:"mt-1 inline-block font-medium text-amber-900 dark:text-amber-200 underline-offset-2 hover:underline",children:"View usage & upgrade â"})]}),(0,t.jsx)("button",{onClick:g,"aria-label":"Dismiss",className:"rounded-md p-1 text-amber-800/70 hover:bg-amber-100 hover:text-amber-900 dark:text-amber-200/70 dark:hover:bg-amber-500/20 dark:hover:text-amber-100",children:(0,t.jsx)(f.X,{size:14})})]}),U&&(0,t.jsx)("div",{className:"flex justify-center border-t border-border bg-red-500/5 px-4 py-2",children:(0,t.jsxs)("button",{onClick:d,className:"flex items-center gap-1.5 rounded-lg border border-red-200 bg-red-50 px-3 py-1.5 text-xs text-red-700 hover:bg-red-100 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-100 dark:hover:bg-red-500/20 transition-colors",children:[(0,t.jsx)(el.RotateCw,{size:12}),"Retry last message"]})}),O&&(0,t.jsx)("div",{className:"border-t border-border bg-brand/5 px-4 py-2",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center gap-2",children:[(0,t.jsxs)("span",{"data-testid":"locked-cap-tag",className:"inline-flex items-center gap-1.5 rounded-full border border-brand/40 bg-brand/15 px-2.5 py-1 text-xs font-medium text-brand",children:[(0,t.jsx)(O.Icon,{size:12}),O.label," mode active"]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Every message routes here until you change it."}),(0,t.jsx)("button",{onClick:o,"aria-label":"Clear capability lock",className:"ml-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",title:"Switch back to General",children:(0,t.jsx)(f.X,{size:14})})]})}),P&&(0,t.jsxs)("button",{type:"button","data-testid":"mobile-working-strip",onClick:R,className:"flex w-full items-center gap-2.5 border-t border-brand/20 bg-brand/10 px-4 py-2.5 text-left transition-colors active:bg-brand/15 md:hidden",children:[(0,t.jsxs)("span",{className:"relative flex h-2.5 w-2.5 shrink-0","aria-hidden":!0,
1children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-brand opacity-60"}),(0,t.jsx)("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-brand"})]}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-xs font-medium text-foreground",children:P}),L&&(0,t.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:L})]}),(0,t.jsx)(aL,{}),(0,t.jsx)("span",{className:"shrink-0 text-[11px] font-medium text-brand",children:"View"}),(0,t.jsx)(A.ChevronRight,{size:14,className:"shrink-0 text-brand"})]}),(0,t.jsx)(aE,{onSend:c,onStop:u,isLoading:r,hasMessages:e.length>0,onModeChangeNewConversation:_,mode:I,onModeChange:z,currentMode:i,lockedCapability:s,onQueue:E,onDequeue:D,queuedMessages:T})]})}function aO({onPick:e,capability:n}){let r=n&&"general"!==n?n:null,i=r?aU[r]:null,a=i?.hero??aB,l=i?.items??a$,s=i?.eyebrow??"One-shot startup kit",o=i?.heroHint??"Brand identity · landing page · pitch deck · jingle â all from one prompt.",c=!!i;return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center px-4",children:[(0,t.jsxs)("div",{className:(0,B.cn)("text-center",c?"mb-6":"mb-8"),children:[(0,t.jsx)("h1",{className:(0,B.cn)("font-bold tracking-tight",c?"text-3xl":"text-4xl sm:text-5xl"),children:i?i.title:(0,t.jsxs)(t.Fragment,{children:["Slate",(0,t.jsx)("span",{className:"text-brand",children:"X"})]})}),(0,t.jsx)("p",{className:(0,B.cn)("text-muted-foreground",c?"mt-2":"mt-3 text-lg"),children:i?.subtitle??"Your AI-powered creative studio"})]}),c&&(0,t.jsxs)("button",{onClick:()=>e(a.prompt),className:"deck-corners group mb-4 w-full max-w-2xl rounded-2xl border border-brand/30 bg-brand/5 px-5 py-4 text-left transition hover:border-brand/60 hover:bg-brand/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wider text-brand",children:[(0,t.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-brand"}),s]}),(0,t.jsx)("div",{className:"mt-1 text-sm font-medium text-foreground",children:a.label}),(0,t.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:o})]}),c&&(0,t.jsx)("div",{className:"grid w-full max-w-2xl grid-cols-2 gap-3 sm:grid-cols-3",children:l.map(n=>(0,t.jsx)("button",{onClick:()=>e(n),className:"rounded-xl border border-border bg-muted/30 px-3 py-3 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:n},n))})]})}let aB={label:"Launch my startup: an AI copilot for freelance designers",prompt:"Launch my startup: an AI copilot for freelance designers that helps them price projects, draft proposals, and track revenue."},a$=["Build a landing page for my startup","Create a brand kit for a coffee shop","Generate product images for an e-commerce store","Make a pitch deck for investors","Research the AI SaaS market","Write a business proposal"],aU={web_app:{title:"Web App Studio",subtitle:"Describe a site or app and watch it build, live",eyebrow:"Featured build",heroHint:"Full landing page with hero, features, pricing, and a signup form.",hero:{label:"A SaaS landing page with pricing and a waitlist",prompt:"Build a SaaS landing page for my startup with a hero section, feature grid, three-tier pricing, and an email waitlist signup."},items:["A landing page for my startup","A personal portfolio site","A pricing page with three tiers","A waitlist page with email capture","A simple blog homepage","A product marketing site"]},mobile_app:{title:"Mobile App Studio",subtitle:"Describe an app and preview it inside a phone",eyebrow:"Featured build",heroHint:"Onboarding, home feed, and profile screens â previewed in a phone frame.",hero:{label:"A habit tracker app with streaks and reminders",prompt:"Build a mobile habit tracker app with an onboarding flow, a home screen showing daily habits and streaks, and a profile screen."},items:["A fitness tracker app","A to-do list app","A recipe app","A meditation app","A budgeting app","A daily journal app"]}
1,brand_kit:{title:"Brand Kit Studio",subtitle:"A complete identity from a single brief",eyebrow:"Featured kit",heroHint:"Logo, color palette, typography, and usage â one cohesive system.",hero:{label:"A full brand identity for a specialty coffee shop",prompt:"Create a complete brand kit for a specialty coffee shop: logo, color palette, typography, and a short brand voice guide."},items:["A brand kit for a tech startup","Logo and colors for a bakery","A palette for a fashion label","Branding for a fitness studio","Identity for a SaaS product","A logo for my podcast"]},image:{title:"Image Studio",subtitle:"Describe a shot and get it in seconds",eyebrow:"Featured image",heroHint:"Photoreal, studio-lit product shot â ready to drop into a store.",hero:{label:"A photoreal product shot of a sneaker on marble",prompt:"Generate a photorealistic product shot of a white sneaker on a marble surface with soft studio lighting."},items:["A minimalist logo concept","A hero banner for a website","Product photos for a store","A fantasy landscape","A social media graphic","An app icon"]},video:{title:"Video Studio",subtitle:"Describe a clip and watch it render",eyebrow:"Featured clip",heroHint:"A short, cinematic teaser â rendered and ready to play.",hero:{label:"A 10-second cinematic product teaser",prompt:"Create a 10-second cinematic product teaser video with smooth camera motion and a premium feel."},items:["An animated logo intro","A short social media clip","A looping background video","A product showcase reel","An explainer animation","A cinematic landscape shot"]},music:{title:"Music Studio",subtitle:"Describe a vibe and get an original track",eyebrow:"Featured track",heroHint:"An original, royalty-free track â stream it and download.",hero:{label:"An upbeat electronic track for a product launch",prompt:"Compose an upbeat, energetic electronic track suitable for a product launch video, around 30 seconds."},items:["A calm lo-fi study beat","An epic cinematic score","A catchy pop jingle","Ambient background music","A hip-hop instrumental","A corporate intro tune"]},presentation:{title:"Presentation Studio",subtitle:"Describe a deck and get polished slides",eyebrow:"Featured deck",heroHint:"A clean, on-brand investor deck â built slide by slide.",hero:{label:"An investor pitch deck for an AI startup",prompt:"Create an investor pitch deck for an AI startup covering problem, solution, market, product, traction, team, and ask."},items:["A product launch deck","A company overview","A sales presentation","A quarterly review deck","An onboarding slide deck","A webinar slide deck"]},document:{title:"Document Studio",subtitle:"Describe a document and get a clean PDF",eyebrow:"Featured document",heroHint:"A polished, properly typeset PDF â ready to send.",hero:{label:"A one-page business proposal",prompt:"Write a one-page business proposal with an overview, scope, timeline, and pricing, formatted as a clean PDF."},items:["A business plan","A project proposal","A professional resume","A whitepaper","A cover letter","A press release"]}};e.i(47167);let aH=(0,l.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),aq=(0,l.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var aV=e.i(9912),aW=e.i(70703);let aG=(0,l.default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),aX=(0,l.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),aK=(0,aW.default)(()=>e.A(53096).then(e=>e.Editor),{loadableGenerated:{modules:[67211]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex flex-1 items-center justify-center text-xs text-muted-foreground",children:"Loading editorâ¦"})});function aY({files:e,deployedUrl:r}){var i;
1let a=0===e.length&&!!r,[l,s]=(0,n.useState)("preview"),[o,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(0),[p,m]=(0,n.useState)(null),[h,f]=(0,n.useState)({}),g=(0,n.useRef)(null),x=(0,n.useMemo)(()=>e.map(e=>e.path).join("|"),[e]);(0,n.useEffect)(()=>{f({})},[x]);let b=(0,n.useMemo)(()=>e.map(e=>void 0!==h[e.path]?{...e,content:h[e.path]}:e),[e,h]),y=(0,n.useMemo)(()=>(function(e){let t=e.find(e=>"index.html"===e.path||"/index.html"===e.path||e.path.endsWith("/index.html")),n=t?.content??"";if(!n)return'<!doctype html><html><body style="background:#0b0f1a;color:#94a3b8;font-family:system-ui;display:grid;place-items:center;min-height:100vh"><div>No index.html yet</div></body></html>';let r=e.find(e=>e.path.endsWith("styles.css")),i=e.find(e=>e.path.endsWith("app.js"));if(r&&!n.includes(r.content)){let e=`<style> 2${r.content} 3</style>`;n=n.includes("</head>")?n.replace("</head>",`${e} 4</head>`):e+n}if(i&&!n.includes(i.content)){let e=`<script> 5${i.content} 6</script>`;n.includes("</body>")?n=n.replace("</body>",`${e} 7</body>`):n+=e}return(n=n.replace(/<link[^>]*href=["']\.?\/?styles\.css["'][^>]*>/g,"")).replace(/<script[^>]*src=["']\.?\/?app\.js["'][^>]*><\/script>/g,"")})(b),[b]);(0,n.useEffect)(()=>{"code"===l&&!p&&b.length>0&&m((b.find(e=>e.path.endsWith("index.html"))??b[0]).path)},[l,p,b]);let v=(0,n.useCallback)(()=>{d(e=>e+1)},[]),k=(0,n.useCallback)(async()=>{let e=g.current;if(e)try{document.fullscreenElement?(await document.exitFullscreen(),c(!1)):(await e.requestFullscreen(),c(!0))}catch{}},[]);(0,n.useEffect)(()=>{let e=()=>c(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);let w=b.find(e=>e.path===p);return(0,t.jsxs)("div",{ref:g,className:"flex h-full w-full flex-col bg-background",children:[(0,t.jsxs)("div",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border bg-muted/20 px-3",children:[(0,t.jsxs)("div",{className:"flex items-center rounded-md border border-border bg-background p-0.5 text-xs",children:[(0,t.jsxs)("button",{onClick:()=>s("preview"),className:(0,B.cn)("flex items-center gap-1 rounded px-2 py-1 transition-colors","preview"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(aH,{size:12}),"Preview"]}),!a&&(0,t.jsxs)("button",{onClick:()=>s("code"),className:(0,B.cn)("flex items-center gap-1 rounded px-2 py-1 transition-colors","code"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(aq,{size:12}),"Code"]})]}),"code"===l&&Object.keys(h).length>0&&(0,t.jsxs)("span",{className:"text-[10px] text-brand",children:[Object.keys(h).length," unsaved edit",1===Object.keys(h).length?"":"s"," · live in preview"]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:["preview"===l&&(0,t.jsx)("button",{onClick:v,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Refresh",children:(0,t.jsx)(el.RotateCw,{size:13})}),(0,t.jsx)("button",{onClick:k,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:o?"Exit full-screen":"Full-screen",children:o?(0,t.jsx)(aX,{size:13}):(0,t.jsx)(aG,{size:13})})]})]}),"preview"===l?a?(0,t.jsx)("iframe",{src:r??void 0,title:"Live preview",sandbox:"allow-scripts allow-forms allow-modals allow-popups allow-same-origin allow-downloads",className:"h-full w-full flex-1 border-0 bg-white"},u):(0,t.jsx)("iframe",{srcDoc:y,title:"Live preview",sandbox:"allow-scripts allow-forms allow-modals allow-popups allow-same-origin allow-downloads",className:"h-full w-full flex-1 border-0 bg-white"},u):(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"w-48 shrink-0 overflow-y-auto border-r border-border bg-muted/10 py-2 text-xs",children:b.map(e=>(0,t.jsxs)("button",{onClick:()=>m(e.path),className:(0,B.cn)("flex w-full items-center justify-between gap-1 truncate px-3 py-1.5 text-left font-mono transition-colors",p===e.path?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),title:e.path,children:[(0,t.jsx)("span",{className:"truncate",children:e.path.replace(/^\//,"")}),void 0!==h[e.path]&&(0,t.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-brand",title:"Edited"})]},e.path))}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:w?(0,t.jsx)(aK,{height:"100%",language:(i=w.path).endsWith(".html")||i.endsWith(".htm")?"html":i.endsWith(".css")?"css":i.endsWith(".js")||i.endsWith(".mjs")?"javascript":i.endsWith(".ts")||i.endsWith(".tsx")?"typescript":i.endsWith(".jsx")?"javascript":i.endsWith(".json")?"json":i.endsWith(".md")?"markdown":"plaintext",value:w.content,theme:"vs-dark",onChange:e=>{p&&f(t=>({...t,[p]:e??""}))},options:{fontSize:12,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",tabSize:2,padding:{top:12,bottom:12},smoothScrolling:!0,cursorBlinking:"smooth",renderLineHighlight:"none",scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}},w.path):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:"Select a file to edit"})})]})]})}let aQ=(0,l.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),aJ=[{id:"planning",label:"Planning",status:"pending"},{id:"designing",label:"Designing",status:"pending"},{id:"frontend",label:"Building Frontend",status:"pending"},{id:"api",label:"Building API",status:"pending"},{id:"testing",label:"Testing",status:"pending"},{id:"deploying",label:"Deploying",status:"pending"}],aZ={music:"Estimated ~2 min",video:"Estimated ~3â5 min",image:"Estimated ~20 sec",web_app:"Estimated ~5â8 min",mobile_app:"Estimated ~6â10 min",research:"Estimated ~2 min",brand_kit:"Estimated ~2 min",presentation:"Estimated ~3â5 min",document:"Estimated ~2â3 min"};function a0(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return 0===n?`${r}s`:`${n}m ${r.toString().padStart(2,"0")}s`}function a1({steps:e=aJ,title:r,capability:i,etaSeconds:a}){let l=e.length>0&&e.every(e=>"done"===e.status),s=e.some(e=>
7"error"===e.status),o=(0,n.useRef)(null),[c,u]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(null===o.current&&(o.current=Date.now()),l||s)return;let e=()=>{null!==o.current&&u(Date.now()-o.current)};e();let t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[l,s]);let d=a?function(e){if(e<60)return`Estimated ~${Math.max(5,5*Math.round(e/5))} sec`;let t=Math.round(e/60);return`Estimated ~${t} min`}(a):i?aZ[i]:null;return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center px-8",children:[r&&(0,t.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:r}),l?(0,t.jsxs)("div",{className:"slate-rise mb-7 inline-flex items-center gap-2 rounded-full border border-emerald-400/60 bg-emerald-500/15 px-4 py-1.5 text-sm font-semibold tracking-tight text-emerald-300 shadow-[0_0_36px_rgba(16,185,129,0.55),inset_0_0_0_1px_rgba(16,185,129,0.15)] backdrop-blur-sm",children:[(0,t.jsx)(p.Sparkles,{size:14,className:"slate-pop text-emerald-300 drop-shadow-[0_0_8px_rgba(110,231,183,0.9)]"}),(0,t.jsx)("span",{children:"Build complete"}),(0,t.jsx)("span",{className:"h-3.5 w-px bg-emerald-400/40"}),(0,t.jsx)("span",{className:"font-mono tabular-nums text-emerald-200",children:a0(c)})]}):(0,t.jsxs)("div",{className:"slate-rise mb-7 inline-flex items-center gap-2 rounded-full border border-border/60 bg-muted/40 px-3 py-1 text-[11px] tracking-tight backdrop-blur-sm",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-foreground",children:[(0,t.jsx)(ef.Clock,{size:11,className:"text-brand"}),(0,t.jsx)("span",{className:"font-mono tabular-nums",children:a0(c)})]}),d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"h-3 w-px bg-border"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d})]})]}),(0,t.jsx)("div",{className:"relative w-full max-w-sm",children:e.map((n,r)=>{let i=r===e.length-1,a=e[r+1],l=!i&&("done"===n.status||"active"===n.status&&a?.status==="done");return(0,t.jsxs)("div",{className:"relative flex items-start gap-3 pb-4 last:pb-0",children:[!i&&(0,t.jsx)("span",{className:"absolute left-[15px] top-9 h-[calc(100%-2.25rem)] w-0.5 bg-border","aria-hidden":!0}),!i&&l&&(0,t.jsx)("span",{className:"slate-fill-down absolute left-[15px] top-9 h-[calc(100%-2.25rem)] w-0.5 bg-gradient-to-b from-brand via-brand/70 to-brand/30","aria-hidden":!0}),(0,t.jsxs)("div",{className:(0,B.cn)("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-300","done"===n.status&&"slate-pop border-emerald-500 bg-emerald-500/10","active"===n.status&&"slate-halo border-brand bg-brand/15 shadow-[0_0_0_4px_rgba(99,102,241,0.18),0_0_28px_rgba(99,102,241,0.38)]","error"===n.status&&"slate-pop border-red-500 bg-red-500/10","pending"===n.status&&"border-border bg-transparent"),children:["done"===n.status&&(0,t.jsx)(E.Check,{size:14,className:"text-emerald-500",strokeWidth:3}),"active"===n.status&&(0,t.jsx)("span",{className:"slate-orbit","aria-hidden":!0}),"error"===n.status&&(0,t.jsx)("span",{className:"text-xs font-bold text-red-500",children:"!"}),"pending"===n.status&&(0,t.jsx)(aQ,{size:6,className:"fill-muted-foreground/50 text-muted-foreground/50"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 pt-1",children:[(0,t.jsx)("p",{className:(0,B.cn)("text-sm font-medium leading-none transition-colors duration-300","done"===n.status&&"text-emerald-500","active"===n.status&&"text-foreground","error"===n.status&&"text-red-500","pending"===n.status&&"text-muted-foreground"),children:n.label}),n.detail&&(0,t.jsx)("p",{className:(0,B.cn)("mt-1.5 text-xs leading-snug","active"===n.status?"slate-text-shimmer":"text-muted-foreground"),children:n.detail})]})]},n.id)})})]})}var a2=e.i(78917);function a3({images:e,onAnimate:r}){let[i,a]=(0,n.useState)(null);return 0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid gap-4 p-4",style:{gridTemplateColumns:1===e.length?"1fr":"repeat(auto-fill, minmax(250px, 1fr))"},children:e.map((e,n)=>(0,t.jsx)(a5,{img:e,index:n,onOpen:()=>a(n),onAnimate:r},e.id))}),null!==i&&(0,t.jsx)(a4,{images:e,index:i,onClose:()=>a(null),onNavigate:a,onAnimate:r})]})}function a5({img:e,index:r,onOpen:i,onAnimate:a}
7){let[l,s]=(0,n.useState)(!1);return(0,t.jsxs)("div",{className:"slate-rise group relative overflow-hidden rounded-xl border border-border bg-muted/30 shadow-sm",style:{animationDelay:`${70*Math.min(r,6)}ms`},children:[(0,t.jsxs)("button",{type:"button",onClick:i,"aria-label":"Open full image",className:"relative block aspect-square w-full cursor-zoom-in overflow-hidden",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:(0,B.cn)("slate-aurora absolute inset-0 transition-opacity duration-500",l?"opacity-0":"opacity-100")}),(0,t.jsx)("img",{src:e.url,alt:e.prompt,onLoad:()=>s(!0),className:(0,B.cn)("relative h-full w-full object-contain transition-all duration-700 ease-out group-hover:scale-105",l?"opacity-100 blur-0":"opacity-0 blur-md")})]}),(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col justify-between bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100",children:[(0,t.jsxs)("div",{className:"pointer-events-auto flex items-center justify-between p-3",children:[(0,t.jsx)("p",{className:"line-clamp-2 text-xs text-white/80",children:e.prompt}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"rounded-lg bg-white/20 p-1.5 backdrop-blur-sm transition-colors hover:bg-white/30",title:"Open in new tab",children:(0,t.jsx)(a2.ExternalLink,{size:14,className:"text-white"})}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),a9(e.url,a6(e))},className:"rounded-lg bg-white/20 p-1.5 backdrop-blur-sm transition-colors hover:bg-white/30",title:"Download",children:(0,t.jsx)(ai,{size:14,className:"text-white"})})]})]}),a&&(0,t.jsx)("div",{className:"pointer-events-auto flex justify-start p-3",children:(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),a(e)},className:"inline-flex items-center gap-1.5 rounded-full bg-brand/90 px-3 py-1.5 text-xs font-medium text-brand-foreground shadow-sm backdrop-blur-sm transition-colors hover:bg-brand",title:"Animate this image into a short looping video",children:[(0,t.jsx)(iV.Film,{size:13}),"Make video"]})})]})]})}function a4({images:e,index:r,onClose:i,onNavigate:a,onAnimate:l}){let s=e[r];return((0,n.useEffect)(()=>{let t=t=>{"Escape"===t.key&&i(),"ArrowRight"===t.key&&r<e.length-1&&a(r+1),"ArrowLeft"===t.key&&r>0&&a(r-1)};window.addEventListener("keydown",t);let n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",t),document.body.style.overflow=n}},[r,e.length,i,a]),s)?(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Image viewer",className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/85 p-4 backdrop-blur-sm",onClick:i,children:[(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"absolute right-4 top-4 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-white/10 text-white transition-colors hover:bg-white/20",children:(0,t.jsx)(f.X,{size:20})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>void a9(s.url,a6(s)),className:"flex items-center gap-1.5 rounded-md bg-white/10 px-3 py-1.5 text-xs text-white backdrop-blur-sm hover:bg-white/20",children:[(0,t.jsx)(ai,{size:12}),"Download"]}),(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 rounded-md bg-white/10 px-3 py-1.5 text-xs text-white backdrop-blur-sm hover:bg-white/20",children:[(0,t.jsx)(a2.ExternalLink,{size:12}),"Open original"]}),l&&(0,t.jsxs)("button",{type:"button",onClick:()=>{l(s),i()},className:"flex items-center gap-1.5 rounded-md bg-brand/90 px-3 py-1.5 text-xs font-medium text-brand-foreground backdrop-blur-sm hover:bg-brand",children:[(0,t.jsx)(iV.Film,{size:12}),"Make video"]}),e.length>1&&(0,t.jsxs)("span",{className:"rounded-md bg-white/10 px-3 py-1.5 text-xs text-white/80 backdrop-blur-sm",children:[r+1," / ",e.length]})]}),(0,t.jsx)("img",{src:s.url,alt:s.prompt,onClick:e=>e.stopPropagation(),className:"max-h-[90vh] max-w-[95vw] rounded-md object-contain shadow-2xl"})]}):null}function a6(e){let t=(e.prompt||e.id||"image").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60);return`${t||"image"}.png`}async function a9(e,t){try{let n=await fetch(e,{mode:"cors"});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.blob(),i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}catch{window.open(e,"_blank","noopener,noreferrer")}}function a8({result:e,isLoading:n,progressDetail:r}){return e||n?n?(0,t.jsxs)("div",{className:"relative flex h-full items-center justify-center overflow-hidden",children:[(0,t.jsx)("div",{"aria-hidden":!0,
7className:"slate-aurora pointer-events-none absolute inset-0 opacity-30"}),(0,t.jsxs)("div",{className:"relative slate-rise text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-5 flex items-center justify-center",children:(0,t.jsx)("span",{className:"slate-orbit slate-halo",style:{width:72,height:72},"aria-hidden":!0})}),(0,t.jsx)("p",{className:"text-base font-medium",children:(0,t.jsx)("span",{className:"slate-text-shimmer",children:r||"Researching sourcesâ¦"})}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:r?"Web search, cross-check, and synthesis â takes a minute":"Gathering citations and synthesizing"})]})]}):(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto border-r border-border p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)(C.FileText,{size:16,className:"text-brand"}),(0,t.jsx)("h3",{className:"text-sm font-semibold",children:"Research Report"}),(0,t.jsx)("span",{className:(0,B.cn)("rounded-full px-2 py-0.5 text-xs font-medium","quick"===e.tier&&"bg-emerald-500/10 text-emerald-500","deep"===e.tier&&"bg-purple-500/10 text-purple-500","deepest"===e.tier&&"bg-amber-500/10 text-amber-500"),children:e.tier})]}),(0,t.jsx)("div",{className:"prose prose-sm prose-invert max-w-none",children:(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-foreground/90",children:e.report})})]}),(0,t.jsxs)("div",{className:"w-72 overflow-y-auto bg-muted/20 p-4",children:[(0,t.jsxs)("h4",{className:"mb-3 text-xs font-semibold uppercase text-muted-foreground",children:["Sources (",e.sources.length,")"]}),(0,t.jsx)("div",{className:"space-y-3",children:e.sources.map((e,n)=>(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-lg border border-border bg-background p-3 transition-colors hover:bg-accent",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-brand/10 text-xs font-medium text-brand",children:n+1}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-foreground line-clamp-2",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:e.snippet}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-1 text-xs text-brand",children:[(0,t.jsx)(a2.ExternalLink,{size:10}),(0,t.jsx)("span",{className:"truncate",children:new URL(e.url).hostname})]})]})]})},n))})]})]}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(iW,{size:32,className:"mx-auto mb-3 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Research results will appear here"})]})})}let a7=(0,l.default)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]),le=(0,l.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),lt={pdf:{color:"text-red-400",bg:"bg-red-500/10"},docx:{color:"text-blue-400",bg:"bg-blue-500/10"},pptx:{color:"text-amber-400",bg:"bg-amber-500/10"},zip:{color:"text-emerald-400",bg:"bg-emerald-500/10"}},ln={color:"text-slate-400",bg:"bg-slate-500/10"};function lr(e){if(e)return/^https?:\/\//.test(e)?e:`https://app.slatex.ai${e}`}function li({assets:e,title:r}
7){let i=e.length-1,[a,l]=(0,n.useState)(null),s=(0,n.useMemo)(()=>{if(0===e.length)return null;if(a){let t=e.find(e=>e.id===a);if(t)return t}return e.find(e=>"docx"===e.type)??e.find(e=>"pdf"===e.type)??e[i]},[e,a,i]);(0,n.useEffect)(()=>{a||e.length},[a,e.length]);let o=(0,n.useRef)(null),[c,u]=(0,n.useState)(!1),[d,p]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>p(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),!s)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center p-8 text-center text-sm text-muted-foreground",children:"No documents generated yet."});let m=lr(s.url),h=s.url.includes("/api/presentations/")?"presentations":"documents",f="pdf"===s.type&&!!s.name?.toLowerCase().endsWith(".pdf"),g=s.previewUrl||(f?`/api/${h}/preview/${encodeURIComponent(s.name)}`:void 0),x=lr((d&&f?`/api/${h}/pdfview/${encodeURIComponent(s.name)}`:void 0)??g),b=lt[s.type]??ln;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-muted/20 px-3 py-2 sm:px-4",children:[(0,t.jsx)("div",{className:(0,B.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-md",b.bg),children:"pptx"===s.type?(0,t.jsx)(S,{size:16,className:b.color}):(0,t.jsx)(C.FileText,{size:16,className:b.color})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",title:s.name,children:s.name}),(0,t.jsxs)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:[s.type,s.size?` \xb7 ${s.size}`:"",r?` \xb7 ${r}`:""]})]}),e.length>1&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("select",{"data-testid":"doc-switcher",value:s.id,onChange:e=>l(e.target.value),className:"appearance-none rounded-md border border-border bg-background px-3 py-1.5 pr-7 text-xs text-foreground hover:border-brand/40",children:e.map((e,n)=>(0,t.jsxs)("option",{value:e.id,children:[n+1,". ",e.name]},e.id))}),(0,t.jsx)(le,{size:12,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground"})]}),x&&"pdf"!==s.type&&(0,t.jsxs)("button",{"data-testid":"doc-print",onClick:()=>{let e=o.current?.contentWindow;if(e){u(!0);try{e.focus(),e.print()}finally{window.setTimeout(()=>u(!1),800)}}},disabled:c,title:"Save as PDF (browser print)",className:"inline-flex min-h-[36px] items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:border-brand/40 hover:bg-brand/10 hover:text-brand disabled:opacity-50",children:[(0,t.jsx)(a7,{size:13}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Save as PDF"}),(0,t.jsx)("span",{className:"sm:hidden",children:"PDF"})]}),m&&(0,t.jsxs)("a",{"data-testid":"doc-download",href:m,download:s.name,className:"inline-flex min-h-[36px] items-center gap-1.5 rounded-md bg-brand px-3 py-1.5 text-xs font-medium text-brand-foreground transition-opacity hover:opacity-90",children:[(0,t.jsx)(ai,{size:13}),"Download"]})]}),x?"pdf"===s.type?(0,t.jsx)("iframe",{ref:o,src:x,"data-testid":"doc-iframe",title:s.name,className:"h-full w-full flex-1 border-0 bg-white"},s.id):(0,t.jsx)("iframe",{ref:o,src:x,"data-testid":"doc-iframe",title:s.name,sandbox:"allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads",className:"h-full w-full flex-1 border-0 bg-white"},s.id):(0,t.jsx)(la,{assets:e,activeId:s.id,onPick:l})]})}function la({assets:e,activeId:n,onPick:r}){return(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(e=>{let i=lt[e.type]??ln,a=e.id===n;return(0,t.jsxs)("button",{onClick:()=>r(e.id),className:(0,B.cn)("flex items-center gap-3 rounded-xl border p-4 text-left transition-colors",a?"border-brand/60 bg-brand/5":"border-border bg-muted/30 hover:bg-accent"),children:[(0,t.jsx)("div",{className:(0,B.cn)("flex h-12 w-12 shrink-0 items-center justify-center rounded-lg",i.bg),children:"pptx"===e.type?(0,t.jsx)(S,{size:20,className:i.color}):(0,t.jsx)(C.FileText,{size:20,className:i.color})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("p",{className:"text-xs uppercase text-muted-foreground",children:[e.type," ",e.size&&`- ${e.size}`]})]}),(0,t.jsx)("a",{href:lr(e.url),download:e.name,onClick:e=>e.stopPropagation(),className:"rounded-lg p-2 hover:bg-background",children:(0,t.jsx)(ai,{size:16,className:"text-muted-foreground"})})]},e.id)})})})}function ll({videos:e,audio:n,title:r,frames:i,sourceImageUrl:a,isLoading:l,onAddMusic:s}){let o=0===e.length&&(l||i&&i.length>0);return(0,t.jsxs)("div",{className:"space-y-6 p-4",children:[r&&(0,t.jsxs)("div",{className:"slate-rise flex items-center gap-2",children:[(0,t.jsx)(iV.Film,{size:18,className:"text-primary"}),(0,t.jsx)("h3",{className:"text-lg font-semibold",children:r})]}),o&&(0,t.jsx)(lu,{frames:i||[],sourceImageUrl:a??null}),e.map((e,n)=>(0,t.jsx)(ld,{video:e,index:n,onAddMusic:s},e.id)),n&&n.url&&(0,t.jsxs)("div",{className:"slate-rise overflow-hidden rounded-xl border border-border bg-card p-4 shadow-sm",style:{animationDelay:`${(e.length+1)*70}ms`},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:(0,t.jsx)(m,{size:18,className:"text-primary"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:"Narration Audio"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.duration,"s"]})]})]}),(0,t.jsx)("audio",{className:"mt-3 w-full",controls:!0,preload:"metadata",children:(0,t.jsx)("source",{src:n.url,type:"audio/mpeg"})})]}),0===e.length&&!n&&!o&&(0,t.jsx)("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Video assets will appear here..."})]})}let ls=["Composing the opening frameâ¦","Sketching motion pathsâ¦","Animating the first beatâ¦","Synthesizing in-between framesâ¦","Stabilizing camera motionâ¦","Color-grading the sequenceâ¦","Stitching frames into a clipâ¦","Almost there â final polishâ¦"],lo=["Wingly-diggling the codecâ¦","Bong-funguring the keyframesâ¦","Negotiating with ducks on Marsâ¦","Spinning up the snail-clusterâ¦","Plotting waveform spaghettiâ¦","Tickling the GPU one more timeâ¦","Petitioning the render godsâ¦","Counting sheep for the encoderâ¦","Convincing the bits to behaveâ¦","Wrangling pixels by the dozenâ¦","Bribing the queue with cookiesâ¦","Phasing the framework's frameworkâ¦","Reticulating the splinesâ¦","Drawing motion out with a stringâ¦","Flicking the patience switchâ¦","Massaging the pixel committeeâ¦","Realigning the chakras of frame 42â¦","Vacuuming the cache for snacksâ¦","Whispering encouragement to the GPUâ¦","Trading favors with the codec councilâ¦"],lc=18e4/ls.length;function lu({frames:e,sourceImageUrl:r}
7){let i,a,l,s,o=(0,n.useRef)(Date.now()),[c,u]=(0,n.useState)(0),d=(0,n.useMemo)(()=>[...lo].sort(()=>Math.random()-.5),[]),p=(i=Math.floor(c/lc))<ls.length?ls[i]:d[Math.floor((c-ls.length*lc)/9e3)%d.length],m=e=>!!e&&!/placehold\.co/i.test(e)&&!/Image\+Unavailable/i.test(e),h=(m(r)?r:null)||e.find(e=>m(e.url))?.url||null;return(0,n.useEffect)(()=>{let e=window.setInterval(()=>{u(Date.now()-o.current)},1e3);return()=>window.clearInterval(e)},[]),(0,t.jsxs)("div",{className:"slate-rise relative overflow-hidden rounded-2xl border border-border bg-card shadow-sm",children:[(0,t.jsxs)("div",{className:"relative aspect-video w-full overflow-hidden bg-black",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"slate-aurora absolute inset-0 opacity-70"}),h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("img",{src:h,alt:"",className:"slate-breathe absolute inset-0 h-full w-full object-cover opacity-40"}),(0,t.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-black/60"})]}),(0,t.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:(0,t.jsx)("div",{className:"slate-video-sweep absolute inset-x-0 h-24 bg-gradient-to-b from-transparent via-brand/30 to-transparent blur-sm"})}),(0,t.jsxs)("div",{className:"relative flex h-full flex-col items-center justify-center px-6 text-center",children:[(0,t.jsx)(iV.Film,{size:56,className:"slate-breathe mx-auto mb-3 text-brand drop-shadow-[0_0_28px_rgba(129,140,248,0.5)]"}),(0,t.jsx)("p",{className:"text-base font-semibold text-white",children:"Producing your video"}),(0,t.jsx)("p",{className:"slate-text-shimmer slate-rise mt-1.5 text-sm font-medium",children:p},p),(0,t.jsxs)("p",{className:"mt-3 text-xs text-white/60",children:["Typical wait 2â4 min · elapsed ",(l=Math.floor((a=Math.floor(c/1e3))/60),s=a%60,0===l?`${s}s`:`${l}m ${s.toString().padStart(2,"0")}s`)]})]})]}),e.length>0&&(0,t.jsxs)("div",{className:"border-t border-border bg-background/60 p-3",children:[(0,t.jsx)("div",{className:"mb-2 flex items-center justify-between text-xs",children:(0,t.jsx)("span",{className:"text-muted-foreground",children:1===e.length?"Source frame":`${e.length} scene frames`})}),(0,t.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((e,n)=>(0,t.jsx)("div",{className:"slate-rise relative h-16 w-28 shrink-0 overflow-hidden rounded-md bg-muted ring-1 ring-border",style:{animationDelay:`${60*Math.min(n,6)}ms`},title:e.prompt,children:(0,t.jsx)("img",{src:e.url,alt:"",className:"h-full w-full object-cover",loading:"lazy"})},e.id||n))})]})]})}function ld({video:e,index:r,onAddMusic:i}
7){let[a,l]=(0,n.useState)(!1),s=e.url.startsWith("https://placehold");return(0,t.jsxs)("div",{className:"slate-rise overflow-hidden rounded-xl border border-border bg-card shadow-sm",style:{animationDelay:`${70*Math.min(r,6)}ms`},children:[(0,t.jsxs)("div",{className:"relative aspect-video bg-black",children:[!s&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,B.cn)("slate-aurora absolute inset-0 transition-opacity duration-500",a?"opacity-0":"opacity-80")}),s?(0,t.jsxs)("div",{className:"relative flex h-full items-center justify-center",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"slate-aurora absolute inset-0 opacity-70"}),(0,t.jsxs)("div",{className:"relative text-center",children:[(0,t.jsx)(iV.Film,{size:56,className:"slate-breathe mx-auto mb-2 text-brand drop-shadow-[0_0_24px_rgba(129,140,248,0.45)]"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:(0,t.jsx)("span",{className:"slate-text-shimmer",children:"Rendering framesâ¦"})})]})]}):(0,t.jsxs)("video",{className:(0,B.cn)("relative h-full w-full object-contain transition-opacity duration-500",a?"opacity-100":"opacity-0"),controls:!0,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:e.thumbnail,preload:"metadata",onLoadedData:()=>l(!0),onCanPlay:()=>l(!0),children:[(0,t.jsx)("source",{src:e.url,type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,t.jsxs)("div",{className:"absolute bottom-2 right-2 rounded bg-black/70 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:[e.duration,"s"]})]}),(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h4",{className:"truncate text-sm font-medium",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:e.prompt})]}),!s&&(0,t.jsx)("a",{href:e.url,download:!0,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted transition-colors hover:bg-muted/80",children:(0,t.jsx)(ai,{size:14})})]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground",children:[e.duration,"s"]}),!s&&i&&(0,t.jsxs)("button",{type:"button",onClick:()=>i(e),className:"ml-auto inline-flex items-center gap-1.5 rounded-full border border-brand/30 bg-brand/10 px-3 py-1 text-xs font-medium text-brand transition-colors hover:bg-brand/20",title:"Score this clip with fitting background music",children:[(0,t.jsx)(N.Music,{size:13}),"Add music"]})]})]})]})}let lp=(0,l.default)("disc-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]]);function lm({songs:e,title:n,isLoading:r}){let i=0===e.length&&r;return(0,t.jsxs)("div",{className:"space-y-6 p-4",children:[n&&(0,t.jsxs)("div",{className:"slate-rise flex items-center gap-2",children:[(0,t.jsx)(N.Music,{size:18,className:"text-primary"}),(0,t.jsx)("h3",{className:"text-lg font-semibold",children:n})]}),i&&(0,t.jsx)(lb,{}),e.map((e,n)=>(0,t.jsx)(ly,{song:e,index:n},e.id)),0===e.length&&!r&&(0,t.jsx)("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Music will appear here..."})]})}let lh=["Sketching the chord progressionâ¦","Drafting the lyric hookâ¦","Laying down the rhythm bedâ¦","Tracking the lead vocalâ¦","Building the chorus stackâ¦","Mixing the low endâ¦","Mastering the final cutâ¦","Almost there â final polishâ¦"],lf=["Tuning the imaginary harpâ¦","Bribing the drum machineâ¦","Convincing the snare to behaveâ¦","Asking the bassline politelyâ¦","Counting beats with a metronome that dreamsâ¦","Adjusting the reverb thermostatâ¦","Whispering encouragement to the synthesizerâ¦","Negotiating with the click trackâ¦","Polishing the chorus to a mirror finishâ¦","Spinning the master to vinylâ¦","Recalibrating the loudness godsâ¦","Trading favors with the codec councilâ¦","Sending the kick drum to therapyâ¦","Teaching the strings to swingâ¦"],lg=12e4/lh.length,lx=[18,32,24,44,28,52,36,48,22,40,30,38];function lb(){let e,r,i,a,l=(0,n.useRef)(Date.now()),[s,o]=(0,n.use
7State)(0),c=(0,n.useMemo)(()=>[...lf].sort(()=>Math.random()-.5),[]),u=(e=Math.floor(s/lg))<lh.length?lh[e]:c[Math.floor((s-lh.length*lg)/8e3)%c.length];return(0,n.useEffect)(()=>{let e=window.setInterval(()=>{o(Date.now()-l.current)},1e3);return()=>window.clearInterval(e)},[]),(0,t.jsx)("div",{className:"slate-rise relative overflow-hidden rounded-2xl border border-border bg-card shadow-sm",children:(0,t.jsxs)("div",{className:"relative aspect-[4/3] w-full overflow-hidden bg-black",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"slate-aurora absolute inset-0 opacity-80"}),(0,t.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:(0,t.jsx)("div",{className:"slate-music-sweep absolute inset-y-0 w-32 bg-gradient-to-r from-transparent via-brand/40 to-transparent blur-md"})}),(0,t.jsxs)("div",{className:"relative flex h-full flex-col items-center justify-center px-6 text-center",children:[(0,t.jsx)("div",{className:"slate-breathe relative mb-4",children:(0,t.jsx)("span",{className:"slate-vinyl","aria-hidden":!0,children:(0,t.jsx)(lp,{size:42,className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-brand drop-shadow-[0_0_24px_rgba(129,140,248,0.6)]"})})}),(0,t.jsx)("div",{"aria-hidden":!0,className:"mb-4 flex h-12 items-end justify-center gap-1.5",children:lx.map((e,n)=>(0,t.jsx)("span",{className:"slate-eq-bar",style:{height:`${e}px`,"--i":n}},n))}),(0,t.jsx)("p",{className:"text-base font-semibold text-white",children:"Composing your track"}),(0,t.jsx)("p",{className:"slate-text-shimmer slate-rise mt-1.5 text-sm font-medium",children:u},u),(0,t.jsxs)("p",{className:"mt-3 text-xs text-white/60",children:["Typical wait 1â3 min · elapsed ",(i=Math.floor((r=Math.floor(s/1e3))/60),a=r%60,0===i?`${a}s`:`${i}m ${a.toString().padStart(2,"0")}s`)]})]})]})})}function ly({song:e,index:r}){let[i,a]=(0,n.useState)(!1),l=!!e.url,s=!!e.imageUrl;return(0,t.jsxs)("div",{className:"slate-rise overflow-hidden rounded-xl border border-border bg-card shadow-sm",style:{animationDelay:`${70*Math.min(r,6)}ms`},children:[(0,t.jsxs)("div",{className:"relative h-48 bg-gradient-to-br from-primary/20 via-primary/10 to-background",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:(0,B.cn)("slate-aurora absolute inset-0 transition-opacity duration-700",s&&i?"opacity-0":"opacity-60")}),s?(0,t.jsx)("img",{src:e.imageUrl,alt:e.title,onLoad:()=>a(!0),className:(0,B.cn)("relative h-full w-full object-cover transition-opacity duration-700",i?"opacity-100":"opacity-0")}):(0,t.jsx)("div",{className:"relative flex h-full items-center justify-center",children:(0,t.jsx)("span",{className:(0,B.cn)("slate-vinyl",!l&&"slate-breathe"),"aria-hidden":!0,children:(0,t.jsx)(lp,{size:42,className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-brand/70"})})}),(0,t.jsx)("div",{className:"absolute bottom-2 right-2 rounded bg-black/70 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:lv(e.duration)}),(0,t.jsx)("div",{className:"absolute left-2 top-2 rounded bg-black/70 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:e.style})]}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h4",{className:"text-base font-semibold",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:lv(e.duration)})]}),e.url&&(0,t.jsx)("a",{href:e.url,download:!0,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted transition-colors hover:bg-muted/80",children:(0,t.jsx)(ai,{size:14})})]}),(0,t.jsxs)("div",{className:"relative mt-3 h-10",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:(0,B.cn)("slate-aurora absolute inset-0 rounded-lg transition-opacity duration-500",l?"opacity-0":"opacity-100")}),!l&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium text-foreground/80",children:(0,t.jsx)("span",{className:"slate-text-shimmer",children:"Composing your trackâ¦"})}),l&&(0,t.jsx)("audio",{className:"slate-rise absolute inset-0 w-full",controls:!0,preload:"metadata",children:(0,t.jsx)("source",{src:e.url,type:"audio/mpeg"})})]}),e.lyrics&&(0,t.jsxs)("details",{className:"mt-3",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:"View Lyrics"}),(0,t.jsx)("pre",{className:"mt-2 whitespace-pre-wrap rounded-lg bg-muted p-3 text-xs leading-relaxed text-muted-foreground",children:e.lyrics})]}),e.style&&(0,t.jsx)("div",{className:"mt-2 flex gap-2",children:(0,t.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground",children:e.style})})]})]})}function lv(e){if(null==e||!Number.isFinite(e)||e<0)return"â:â";let t=Math.floor(e/60),n=Math.round(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function lk(e){return!(!e||e.includes("snack.expo.dev"))&&(!!e.startsWith("/")||/^https?:\/\//.test(e))}let lw=`import { StatusBar } from 'expo-status-bar'; 8import { StyleSheet, Text, View } from 'react-native'; 9 10export default function App() { 11 return ( 12 <View style={styles.container}> 13 <Text style={styles.title}>SlateX Mobile</Text> 14 <Text style={styles.sub}>Your app is being generatedâ¦</Text> 15 <StatusBar style="light" /> 16 </View> 17 ); 18} 19 20const styles = StyleSheet.create({ 21 container: { flex: 1, backgroundColor: '#0b0f1a', alignItems: 'center', justifyContent: 'center' }, 22 title: { color: '#fff', fontSize: 28, fontWeight: '700' }, 23 sub: { color: '#94a3b8', marginTop: 8 }, 24}); 25`;
25function lj({files:e,url:r}){let[i,a]=(0,n.useState)("android"),[l,s]=(0,n.useState)(!1),o=(0,n.useMemo)(()=>(function(e){if(!e?.length)return lw;for(let t of["App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"]){let n=e.find(e=>e.path===t||e.path.endsWith("/"+t));if(n?.content)return n.content}let t=e.find(e=>/export\s+default\s+function|AppRegistry\.registerComponent|react-native/.test(e.content||""));return t?.content||e[0]?.content||lw})(e),[e]),c=(0,n.useMemo)(()=>{if(lk(r))return r;for(let t of e??[]){let e=(t.path||"").toLowerCase(),n=(t.content||"").trim(),r="preview-url"===e||e.endsWith("/preview-url")||"url"===e,i=/^(\/|https?:\/\/)\S+$/.test(n)&&!n.includes("\n");if(r&&n&&lk(n)||i&&n.includes("/demo/")&&lk(n))return n}return null},[r,e]),u=(0,n.useMemo)(()=>{let e=new URLSearchParams({name:"SlateX App",platform:i,supportedPlatforms:"ios,android,web",theme:"dark",preview:"true",code:o});return`https://snack.expo.dev/embedded?${e.toString()}`},[o,i]),d=async()=>{try{await navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return c?(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(v.Smartphone,{size:13}),"Mobile app"]}),(0,t.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1.5 rounded-full bg-muted/50 px-2.5 py-1 text-[11px] font-medium text-muted-foreground",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),"Live preview"]})]}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden bg-gradient-to-b from-background to-muted/20",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute left-1/2 top-1/2 h-[120%] w-[80%] -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary/5 blur-3xl"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-4",children:(0,t.jsx)("div",{className:"relative h-full max-h-full w-auto overflow-hidden rounded-[2.5rem]",style:{aspectRatio:"9 / 19.5",maxWidth:"100%",filter:"drop-shadow(0 40px 70px rgba(0,0,0,0.55))"},children:(0,t.jsx)("iframe",{src:c,title:"Mobile app preview",className:"h-full w-full border-0",allow:"accelerometer; autoplay"})})})]})]}):(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-muted/30 p-0.5",children:["ios","android","web"].map(e=>(0,t.jsx)("button",{onClick:()=>a(e),className:(0,B.cn)("rounded-md px-2.5 py-1 text-xs capitalize transition-colors",i===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e},e))}),(0,t.jsx)("div",{className:"ml-auto flex items-center gap-1",children:(0,t.jsxs)("button",{onClick:d,className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Copy App.tsx to clipboard",children:[l?(0,t.jsx)(E.Check,{size:12}):(0,t.jsx)(eu,{size:12}),l?"Copied":"Copy code"]})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto p-6",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-3xl flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:(0,B.cn)("relative rounded-[2.5rem] border border-border bg-black p-3 shadow-2xl","web"===i?"w-full max-w-xl":"w-[320px]"),children:(0,t.jsx)("div",{className:(0,B.cn)("overflow-hidden rounded-[2rem] bg-[#0b0f1a]","web"===i?"aspect-video":"aspect-[9/19.5]"),children:(0,t.jsx)("iframe",{src:u,className:"h-full w-full border-0",title:"Expo Snack preview",allow:"camera; microphone; geolocation; accelerometer; autoplay"},i)})}),(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(v.Smartphone,{size:12}),"Live mobile preview â taps, animations and gestures work"]})]})})]})}let lN=(0,l.default)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);function lS({plan:e,hero:r=!0}){let i,a,l,s=e.issued_at?new Date(e.issued_at).getTime():null,o=(0,n.useRef)(s??Date.now()),[c,u]=(0,n.use
25State)(()=>Date.now()),d=e.steps.length>0&&e.steps.every(e=>"done"===e.status);(0,n.useEffect)(()=>{if(d)return;let e=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(e)},[d]);let p=Math.max(0,c-o.current);return(0,t.jsx)("div",{className:(0,B.cn)("w-full",r?"flex h-full items-center justify-center px-6 py-8":"px-4 py-4"),children:(0,t.jsxs)("div",{className:"w-full max-w-lg",children:[(0,t.jsxs)("div",{className:"mb-5 flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-brand/15 text-brand",children:(0,t.jsx)(lN,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-base font-semibold leading-tight tracking-tight text-foreground",children:e.title}),e.summary&&(0,t.jsx)("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:e.summary})]})]}),(0,t.jsxs)("div",{className:"mb-5 inline-flex items-center gap-2 rounded-full border border-border/60 bg-muted/40 px-3 py-1 text-[11px] tracking-tight backdrop-blur-sm",children:[(0,t.jsx)(ef.Clock,{size:11,className:"text-brand"}),(0,t.jsx)("span",{className:"font-mono tabular-nums text-foreground",children:(a=Math.floor((i=Math.floor(p/1e3))/60),l=i%60,0===a?`${l}s`:`${a}m ${l.toString().padStart(2,"0")}s`)}),(0,t.jsx)("span",{className:"h-3 w-px bg-border"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d?"Done":"Workingâ¦"})]}),(0,t.jsx)("ol",{className:"space-y-2.5",children:e.steps.map((e,n)=>{let r=function(e){let t=Math.max(1,Math.round(60*e));if(t<60)return`${t} sec`;let n=Math.floor(t/60),r=t%60;return 0===r?`${n} min`:`${n}m ${r}s`}(e.estimated_minutes);return(0,t.jsxs)("li",{className:(0,B.cn)("flex items-start gap-3 rounded-lg border px-3 py-2.5 transition-colors duration-300","done"===e.status&&"border-emerald-500/40 bg-emerald-500/5","active"===e.status&&"border-brand/50 bg-brand/5 shadow-[0_0_0_1px_rgba(99,102,241,0.18)]","pending"===e.status&&"border-border bg-transparent"),children:[(0,t.jsxs)("div",{className:(0,B.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors","done"===e.status&&"border-emerald-500 bg-emerald-500/10","active"===e.status&&"border-brand bg-brand/10","pending"===e.status&&"border-border bg-transparent"),children:["done"===e.status&&(0,t.jsx)(E.Check,{size:12,className:"text-emerald-500",strokeWidth:3}),"active"===e.status&&(0,t.jsx)(eg.Loader2,{size:11,className:"animate-spin text-brand"}),"pending"===e.status&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70",children:n+1})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)("p",{className:(0,B.cn)("text-sm font-medium leading-snug","done"===e.status&&"text-emerald-500","active"===e.status&&"text-foreground","pending"===e.status&&"text-muted-foreground"),children:e.label})}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:r})]},`${n}-${e.label}`)})})]})})}function lC({state:e,lockedCapability:r,onAnimate:i,onAddMusic:a,isWorking:l}){let s=e?.mode||"empty",[o,c]=(0,n.useState)(!1),u=async()=>{if(e?.deployedUrl)try{await navigator.clipboard.writeText(e.deployedUrl),c(!0),setTimeout(()=>c(!1),1500)}catch{}};return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border px-4",children:[(0,t.jsx)(lA,{mode:s,capability:e?.capability}),(0,t.jsx)("h2",{className:"text-sm font-medium",children:function(e,t){if("image"===e)return"video"===t?"Video Production":"music"===t?"Music Studio":"brand_kit"===t?"Brand Kit":"Image Studio";switch(e){case"code":return"Live Preview";case"mobile":return"Mobile App";case"building":return"Building...";case"research":return"Research Report";case"document":return"Documents";case"video":return"Video Production";case"music":return"Music Studio";default:return"Preview"}}(s,e?.capability)}),e?.deployedUrl&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsxs)("a",{href:function(e){try{let t=new URL(e).pathname.replace(/^\/apps\//,"").replace(/\/$/,"");if(!t)return e;return`https://app.slatex.ai/api/deploy/${encodeURIComponent(t)}/download`}catch{return e}}(e.deployedUrl),download:!0,className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:border-brand/40 hover:bg-brand/10 hover:text-brand",title:"Download a .zip of the source files",children:[(0,t.jsx)(ai,{size:12}),(0,t.jsx)("span",{children:"Download ZIP"})]}),(0,t.jsxs)("button",{onClick:u,className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:border-brand/40 hover:bg-brand/10 hover:text-brand",title:e.deployedUrl,children:[o?(0,t.jsx)(E.Check,{size:12}):(0,t.jsx)(aV.Rocket,{size:12}),(0,t.jsx)("span",{children:o?"Copied":"Share link"})]})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[e?.taskPlan&&("empty"===s||"building"===s)&&(0,t.jsx)(lS,{plan:e.taskPlan,hero:!0}),"empty"===s&&!e?.taskPlan&&(l?(0,t.jsx)(a1,{steps:[{id:"starting",label:"Getting started",status:"active",detail:"Setting up your buildâ¦"}],title:lM(r,null),capability:r}):r&&"general"!==r?(0,t.jsx)(lz,{capability:r}):(0,t.jsx)(l_,{})),"building"===s&&!e?.taskPlan&&e?.buildSteps&&(0,t.jsx)(a1,{steps:e.buildSteps,title:lM(e.capability,e.subtype),capability:e.capability,etaSeconds:e.etaSeconds}),"empty"!==s&&"building"!==s&&(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[e?.taskPlan&&!e.taskPlan.steps.every(e=>"done"===e.status)&&(0,t.jsx)("div",{className:"shrink-0 border-b border-border/60 bg-muted/20",children:(0,t.jsx)(lS,{plan:e.taskPlan,hero:!1})}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden",children:["code"===s&&(e?.files&&e.files.length>0||e?.deployedUrl)&&(0,t.jsx)(aY,{files:e?.files??[],deployedUrl:e?.deployedUrl??null}),"mobile"===s&&(e?.files&&e.files.length>0||e?.deployedUrl)&&(0,t.jsx)(lj,{files:e?.files??[],url:e?.deployedUrl??void 0}),"image"===s&&e?.images&&(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)(a3,{images:e.images,onAnimate:"video"===e.capability?void 0:i})}),"research"===s&&(0,t.jsx)(a8,{result:e?.research||null,isLoading:e?.isLoading,progressDetail:e?.progressDetail||null}),"document"===s&&e?.documents&&(0,t.jsx)("div",{className:"h-full",children:(0,t.jsx)(li,{assets:e.documents})}),"video"===s&&(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)(ll,{videos:e?.videos||[],audio:e?.audio,title:"Video Production",frames:(e?.images||[]).map(e=>({id:e.id,url:e.url,prompt:e.prompt})),sourceImageUrl:e?.sourceImageUrl??null,isLoading:e?.isLoading??!1,onAddMusic:a})}),"music"===s&&(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)(lm,{songs:e?.
25songs||[],title:"Music Studio",isLoading:e?.isLoading??!1})})]})]})]})]})}function lA({mode:e,capability:n}){let r={size:16,className:"text-muted-foreground"};if("image"===e)return"video"===n?(0,t.jsx)(iV.Film,{...r}):"music"===n?(0,t.jsx)(N.Music,{...r}):(0,t.jsx)(w.Image,{...r});switch(e){case"code":case"building":return(0,t.jsx)(aq,{...r});case"mobile":return(0,t.jsx)(v.Smartphone,{...r});case"research":return(0,t.jsx)(iW,{...r});case"document":return(0,t.jsx)(C.FileText,{...r});case"video":return(0,t.jsx)(iV.Film,{...r});case"music":return(0,t.jsx)(N.Music,{...r});default:return(0,t.jsx)(aH,{...r})}}function lM(e,t){switch(e){case"music":return"Composing your music...";case"video":return"Producing your video...";case"image":return"Generating your image...";case"mobile_app":return"Building your mobile app...";case"web_app":return"website"===t?"Building your website...":"Building your app...";case"research":return"Researching...";default:return"Working on it..."}}function l_(){return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-muted",children:(0,t.jsx)(iq.Eye,{size:24,className:"text-muted-foreground"})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your creations will appear here"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground/60",children:"Web apps, images, documents, and more"})]})})}let lI={web_app:{Icon:y.Globe,title:"Web App Studio",hint:"Your live site renders here â preview it, then share a link.",frame:"browser"},mobile_app:{Icon:v.Smartphone,title:"Mobile App Studio",hint:"Your app comes to life inside a phone â tap through every screen.",frame:"phone"},brand_kit:{Icon:k.Palette,title:"Brand Kit Studio",hint:"Logo, palette, and type system â a complete identity, generated."},image:{Icon:w.Image,title:"Image Studio",hint:"Photoreal shots, concepts, and graphics appear here in seconds."},video:{Icon:j,title:"Video Studio",hint:"Cinematic clips and animations render here, ready to play."},music:{Icon:N.Music,title:"Music Studio",hint:"Original tracks and jingles stream here â listen and download."},presentation:{Icon:S,title:"Presentation Studio",hint:"Polished, on-brand slide decks build out here."},document:{Icon:C.FileText,title:"Document Studio",hint:"Proposals, plans, and reports typeset into clean PDFs here."}};function lz({capability:e}){let n=lI[e];if(!n)return(0,t.jsx)(l_,{});let{Icon:r,title:i,hint:a,frame:l}=n;return(0,t.jsxs)("div",{className:"relative flex h-full flex-col items-center justify-center overflow-hidden px-8 text-center",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute left-1/2 top-1/3 h-72 w-72 -translate-x-1/2 -translate-y-1/2 rounded-full bg-brand/20 blur-[90px]"}),(0,t.jsxs)("div",{className:"relative",children:["phone"===l?(0,t.jsxs)("div",{className:"slate-rise mx-auto mb-6 flex h-56 w-28 items-center justify-center rounded-[1.75rem] border-[3px] border-border bg-gradient-to-b from-muted/60 to-muted/20 shadow-[0_20px_60px_-15px_rgba(99,102,241,0.45)]",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-2 h-1 w-10 rounded-full bg-border"}),(0,t.jsx)(r,{size:30,className:"text-brand slate-breathe"})]}):"browser"===l?(0,t.jsxs)("div",{className:"slate-rise mx-auto mb-6 w-64 overflow-hidden rounded-xl border border-border bg-gradient-to-b from-muted/60 to-muted/20 shadow-[0_20px_60px_-15px_rgba(99,102,241,0.45)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-b border-border/70 bg-muted/40 px-3 py-2",children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-red-400/70"}),(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-amber-400/70"}),(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-emerald-400/70"})]}),(0,t.jsx)("div",{className:"flex h-28 items-center justify-center",children:(0,t.jsx)(r,{size:34,className:"text-brand slate-breathe"})})]}):(0,t.jsx)("div",{className:"slate-rise mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-3xl border border-brand/30 bg-gradient-to-br from-brand/20 to-brand/5 shadow-[0_16px_50px_-12px_rgba(99,102,241,0.5)]",children:(0,t.jsx)(r,{size:34,className:"text-brand slate-breathe"})}),(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight text-foreground",children:i}),(0,t.jsx)("p",{className:"mx-auto mt-2 max-w-[18rem] text-sm leading-relaxed text-muted-foreground",children:a}),(0,t.jsxs)("div",{className:"mt-4 inline-flex items-center gap-1.5 rounded-full border border-brand/30 bg-brand/10 px-3 py-1 text-xs font-medium text-brand",children:[(0,t.jsx)(p.Sparkles,{size:12}),"Describe it on the left to begin"]})]})]})}var lE=e.i(28170),lD=e.i(49328);let lT=["auto","quick","build","deep","research","slatex"];function lP(e){return"auto"===e||"quick"===e?"build":e}let lL=e=>`slatex.convMode.${e}`;function lR(e){try{let t=localStorage.getItem(lL(e));if(!t)return null;return lT.includes(t)||(0,X.isVertical)(t)?t:null}catch{return null}}let lF=e=>`slatex.convCap.${e}`;function lO(e){try{return localStorage.getItem(lF(e))}catch{return null}}e.s(["default",0,function(){let e=(0,r.useRouter)(),[l,x]=(0,n.use
25State)(null);(0,n.useEffect)(()=>{(0,i.isSessionValid)()?x(!0):(x(!1),e.replace("/login?next=/"))},[e]);let{autoSpeak:b,toggleAutoSpeak:y,speak:v,stop:k,isSpeaking:w}=function(){let[e,t]=(0,n.useState)(!1),[r,i]=(0,n.useState)(!1),l=(0,n.useRef)(null),s=(0,n.useRef)(null),o=(0,n.useCallback)(()=>{l.current&&(l.current.pause(),l.current.currentTime=0,l.current=null),s.current&&(URL.revokeObjectURL(s.current),s.current=null),i(!1)},[]),c=(0,n.useCallback)(()=>{t(e=>{let t=!e;return t||o(),t})},[o]),u=(0,n.useCallback)(async e=>{if(e?.trim()){o();try{i(!0);let t=await a.api.speakText(e),n=URL.createObjectURL(t);s.current=n;let r=new Audio(n);l.current=r,r.onended=()=>{i(!1),s.current===n&&(URL.revokeObjectURL(n),s.current=null)},r.onerror=()=>{i(!1)},await r.play()}catch(e){console.error("TTS failed:",e),g.toast.error("Voice playback failed. ElevenLabs may be down."),i(!1)}}},[o]);return(0,n.useEffect)(()=>()=>o(),[o]),{autoSpeak:e,toggleAutoSpeak:c,speak:u,stop:o,isSpeaking:r}}(),[j,N]=(0,n.useState)("general"),S=(0,n.useCallback)(e=>{N(e)},[]),{messages:C,isLoading:A,currentMode:M,currentVertical:_,currentCapability:I,previewState:z,buildWorkTick:E,limitNotice:D,dismissLimit:T,sendMessage:P,queueMessage:L,dequeueMessage:R,queuedMessages:F,clearMessages:O,retryLast:$,stopGeneration:U,selectArtifact:H,selectedArtifactKey:q,loadConversation:V}=function(e={}
25){let t,r,[i,l]=(0,n.useState)([]),[s,o]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[d,p]=(0,n.useState)(null),[m,h]=(0,n.useState)(null),[f,x]=(0,n.useState)({mode:"empty"}),[b,y]=(0,n.useState)(0),v=(0,n.useRef)(!1),[k,w]=(0,n.useState)(null),[j,N]=(0,n.useState)(null),[S,C]=(0,n.useState)(null),[A,M]=(0,n.useState)([]),_=(0,n.useRef)(null),I=(0,n.useRef)([]),z=(0,n.useRef)([]),E=(0,n.useRef)([]),D=(0,n.useRef)([]),T=(0,n.useRef)(null),P=(0,n.useRef)([]),L=(0,n.useRef)(e.onAssistantDone);L.current=e.onAssistantDone;let R=(0,n.useRef)(e.onConversationOpen);R.current=e.onConversationOpen;let F=(0,n.useRef)(null),O=(0,n.useRef)(null),B=(0,n.useRef)(null),$=(0,n.useRef)(new Set),U=(0,n.useRef)(null),H=(0,n.useRef)(!1),q=(0,n.useRef)(e.lockedCapability??null);q.current=e.lockedCapability??null;let V=(t=(0,n.useRef)(!1),r=(0,n.useCallback)(()=>{t.current=!0},[]),{drain:(0,n.useCallback)(async(e,n)=>{t.current=!1;let r=0,i=Date.now();for(;!t.current;){let t;if(Date.now()-i>9e5)return n.onError?.("Job timed out â backend may still be running."),"failed";try{t=await a.api.getJob(e,r)}catch(e){await i3(1500);continue}for(let e of t.events)(0,a.dispatchEvent)(n,e);if(r=t.cursor,"done"===t.status||"failed"===t.status)return"failed"===t.status&&t.error&&n.onError?.(t.error),t.status;await i3(1500)}return"running"},[]),stop:r}),W=(0,n.useCallback)(async()=>{if(_.current)return _.current;let e=await a.api.getOrCreateDefaultProject(),t=await a.api.createConversation(e.id),n={projectId:e.id,conversationId:t.id};return _.current=n,R.current?.(t.id),n},[]),G=(0,n.useRef)(null),J=(0,n.useCallback)((e,t)=>{l(n=>n.map(n=>n.id===e?{...n,artifacts:[...n.artifacts||[],t]}:n)),w(i5(t))},[]),Z=Array.from(new Set(i.flatMap(e=>(e.artifacts||[]).filter(e=>"apk"===e.kind&&"building"===e.data.apkStatus&&!!e.data.easBuildId).map(e=>e.data.easBuildId)))).sort(),ee=Z.join(",");(0,n.useEffect)(()=>{if(0===Z.length)return;let e=!1,t=async()=>{for(let t of Z)try{let n=await a.api.getApkStatus(t);if(e||!n.found||"building"===n.status)continue;l(e=>e.map(e=>({...e,artifacts:e.artifacts?.map(e=>"apk"===e.kind&&e.data.easBuildId===t?{...e,data:{...e.data,apkStatus:n.status,url:n.artifactUrl||e.data.url,sizeBytes:"number"==typeof n.sizeBytes?n.sizeBytes:e.data.sizeBytes}}:e)}))),"ready"===n.status?g.toast.success("Your Android app is ready to download."):"failed"===n.status&&g.toast.error("The Android app build failed. You can try again.")}catch{}},n=setInterval(t,2e4);return t(),()=>{e=!0,clearInterval(n)}},[ee]);let et=(0,n.useCallback)(e=>{if("question"!==e.kind){if("image"===e.kind)x({mode:"image",images:[e.data],capability:G.current});else if("video"===e.kind)x({mode:"video",videos:[e.data],audio:null});else if("music"===e.kind)x({mode:"music",songs:[e.data]});else if("document"===e.kind)x({mode:"document",documents:[e.data]});else if("web_app"===e.kind){let t=!0===e.data.mobile;x({mode:t?"mobile":"code",files:[],deployedUrl:e.data.url,capability:t?"mobile_app":"web_app"})}else"research"===e.kind&&x({mode:"research",research:e.data,isLoading:!1});w(i5(e))}},[]),en=(0,n.useCallback)(async(e,t,n)=>{if($.current.has(t))return $.current.delete(t),!0;try{let r=async()=>{try{let t=await a.api.getMessages(e);if(Array.isArray(t)&&t.length>0){let e=[...t].reverse().find(e=>"assistant"===e.role);if(e){let r=e.createdAt?Date.parse(e.createdAt):NaN;if(Number.isFinite(r)&&r>=n-5e3)return{rows:t,last:e}}}}catch{}return null},i=null,s=[1e3,3e3,7e3,15e3,25e3,4e4,6e4];for(let e=0;e<=s.length&&!(i=await r());e++)if(e<s.length){let t=s[e],n=Math.floor(250*Math.random());await new Promise(e=>setTimeout(e,t+n))}if(!i){let n=Date.now()+6e6+6e4,s=!1,o=!1;try{s=!0===(await a.api.getInflight(e)).running}catch{o=!0}if(s||o)for(l(e=>e.map(e=>e.id===t?{...e,phase:"Still workingâ¦"}:e));Date.now()<n&&(await new Promise(e=>setTimeout(e,12e3)),!(i=await r()));)try{if(!(await a.api.getInflight(e)).running){await new Promise(e=>setTimeout(e,1500)),(i=await r())||(await new Promise(e=>setTimeout(e,4e3)),i=await r());break}}catch{}}if(!i)return!1;let{rows:o,last:c}=i,u=i4(o,e).find(e=>e.id===c.id);if(!u||!(u.content&&u.content.trim().length>0||u.artifacts&&u.artifacts.length>0))return!1;l(e=>e.some(e=>e.id===u.id)?e.filter(e=>e.id!==t):e.map(e=>e.id===t?{...u,isStreaming:!1,phase:null}:e));let d=[...u.artifacts??[]].reverse().find(e=>"question"!==e.kind);return d?et(d):x(e=>({...e,isLoading:!1})),ae(e),!0}catch{return!1}},[et]);(0,n.useEffect)(()=>{let e=!1,t=()=>{if("u">typeof document&&"hidden"===document.visibilityState)return;let t=B.current;if(!t?.conversationId||e)return;e=!0,U.current?.();let{conversationId:n,streamId:r,turnStartedAt:i}=t;(async()=>{try{let e=await a.api.getMessages(n);if(!(Array.isArray(e)&&e.some(e=>"assistant"===e.role&&!!e.createdAt&&Date.parse(e.createdAt)>=i-5e3))||B.current?.streamId!==r)return;await en(n,r,i)&&(B.current?.streamId===r&&(B.current=null),O.current?.abort(),o(!1))}catch{}finally{e=!1}})()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",t),window.addEventListener("online",t),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t),window.removeEventListener("online",t)}},[en]);let er=(0,n.useCallback)(async(e,t={})=>{let n;if(!e.trim()||s)return;let r=!!t.viaVoice,i=t.mode||"build";F.current={content:e.trim(),viaVoice:r};let c=(0,iG.isDemoEnabled)()?function(e){let t=e.trim().toLowerCase();for(let e of i0)if(e.prompt.trim().toLowerCase()===t)return e;let n=e=>RegExp(`\\b${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t);for(let e of i0)for(let t of e.match)if(t.every(n))return e;return null}(e.trim()):null,d={id:`user-${Date.now()}`,role:"user",content:e.trim(),chipAck:t.chipAck};if(l(e=>[...e,d]),o(!0),u(null),p((0,X.isVertical)(i)?i:null),h(null),N(null),H.
25current=!1,c)n={projectId:"demo",conversationId:"demo"};else try{n=await W()}catch{o(!1),g.toast.error("Can't reach the backend. Is the server running?"),l(e=>[...e,{id:`error-${Date.now()}`,role:"assistant",content:"Failed to initialize. Is the backend running?",failed:!0}]);return}let m=`assistant-${Date.now()}`,f=Date.now(),b="";I.current=[],z.current=[],E.current=[],D.current=[],T.current=null,P.current=[],v.current=!1,x({mode:"empty"}),w(null),l(e=>[...e.map(e=>"assistant"===e.role&&e.isStreaming?{...e,isStreaming:!1,phase:null}:e),{id:m,role:"assistant",content:"",isStreaming:!0}]);let k=new AbortController;O.current=k,B.current={streamId:m,conversationId:_.current?.conversationId??null,turnStartedAt:f},c||function(e,t){if(e)try{window.localStorage.setItem(i7+e,JSON.stringify(t))}catch{}}(n.conversationId,{streamId:m,userText:e.trim(),turnStartedAt:f,mode:i,capability:q.current});let j=null,S=!1,A=e=>{B.current?.streamId===m&&(B.current=null),ae(n.conversationId),l(t=>t.map(t=>t.id===m?{...t,content:e,isStreaming:!1,phase:null}:t)),x(e=>e.taskPlan?{...e,taskPlan:{...e.taskPlan,steps:e.taskPlan.steps.map(e=>({...e,status:"done"}))}}:"building"===e.mode?{...e,mode:"empty",isLoading:!1,buildSteps:void 0,progressDetail:null,etaSeconds:void 0}:e),L.current?.(e,{viaVoice:r})},M=()=>{B.current?.streamId===m&&(B.current=null),ae(n.conversationId),x(e=>e.buildSteps?.some(e=>"active"===e.status)?{...e,isLoading:!1,buildSteps:e.buildSteps.map(e=>"active"===e.status?{...e,status:"error"}:e)}:{...e,isLoading:!1})},R={onHeartbeat:()=>{},onQueue:e=>{g.toast.info(e?.text||"The studio is busy right now â your build is queued and will start automatically.")},onTurnStart:({turnId:e,conversationId:t})=>{l(r=>r.map(r=>r.id===m?{...r,turnId:e,conversationId:t||n.conversationId}:r))},onMode:(e,t,n,r)=>{u(e),h(t),G.current=t,l(n=>n.map(n=>n.id===m?{...n,mode:e,capability:t}:n)),"build"===e?"video"===t?x(e=>({mode:"video",capability:t,videos:[],audio:null,images:[],sourceImageUrl:"image"===e.mode&&e.images&&e.images[0]?e.images[0].url:null,isLoading:!0,etaSeconds:n})):"music"===t?x({mode:"music",capability:t,songs:[],isLoading:!0,etaSeconds:n}):"general"===t?x(e=>({...e,capability:t,etaSeconds:n})):x(e=>({...e,capability:t,subtype:r??null,etaSeconds:n})):"deep"===e?x(e=>({...e,capability:t,etaSeconds:n})):x(e=>({...e,capability:t,etaSeconds:n}))},onDelta:e=>{S||(b+=e,l(e=>e.map(e=>e.id===m?{...e,content:b,isStreaming:!0,phase:null}:e)))},onBusy:e=>{S=!0,g.toast.info(e.text||"Still working on your previous request â it will appear here shortly."),l(e=>e.filter(e=>e.id!==d.id)),ae(n.conversationId);let t="number"==typeof e.startedAt?e.startedAt:Date.now()-6e4;en(n.conversationId,m,t).then(t=>{t||(l(t=>t.map(t=>t.id===m?{...t,content:e.text||"Still working on your previous request â check back in a moment.",isStreaming:!1,phase:null}:t)),x(e=>({...e,isLoading:!1})))})},onPhase:e=>{"text_start"===e.phase&&b&&!/\s$/.test(b)&&(b+="\n\n");let t=function(e){if("text_start"===e.phase)return null;if("quick_media"===e.phase)return e.detail||null;if("thinking"===e.phase)return"Thinkingâ¦";let t=e.tool||"";if("Read"===t||"Glob"===t||"Grep"===t||"Bash"===t||"mcp__slatex__notify_user"===t)return null;if("tool_progress"===e.phase&&e.detail)return e.detail;if("tool_done"===e.phase)return null;let n={mcp__slatex__image_gen:"Generating imageâ¦",mcp__slatex__image_edit:"Editing imageâ¦",mcp__slatex__image_trim:"Trimming imageâ¦",mcp__slatex__video_gen:"Rendering videoâ¦",mcp__slatex__music_gen:"Composing musicâ¦",mcp__slatex__tts_gen:"Recording narrationâ¦",mcp__slatex__document_gen:"Writing documentâ¦",mcp__slatex__presentation_gen:"Designing slidesâ¦",mcp__slatex__brand_kit_gen:"Drafting brand kitâ¦",mcp__slatex__web_app_publish:"Building websiteâ¦",mcp__slatex__mux_audio:"Mixing audioâ¦",mcp__slatex__web_search:"Searching the webâ¦",mcp__slatex__research:"Researchingâ¦"};if(n[t])return n[t];if(t.startsWith("mcp__slatex__")){let e=t.replace("mcp__slatex__","").replace(/_/g," ");return`Running ${e}â¦`}return null}(e);null!==t&&l(e=>e.map(e=>e.id!==m||"Thinkingâ¦"===t&&e.phase&&"Thinkingâ¦"!==e.phase?e:{...e,phase:t}))},onModeSwitch:e=>{e.requiresUserClick?l(t=>t.map(t=>
25t.id===m?{...t,buildCta:{reason:e.reason,brief:e.brief}}:t)):e.silent&&e.brief&&C(e.brief)},onPremiumUpgrade:e=>{l(t=>t.map(t=>t.id===m?{...t,premiumCta:{brief:e.brief,capability:e.capability}}:t))},onBuildCta:e=>{l(t=>t.map(t=>t.id===m?{...t,openBuildCta:{capability:e.capability,label:e.label,brief:e.brief,buttonText:e.buttonText}}:t))},onLoopSuggestion:e=>{l(t=>t.map(t=>t.id===m?{...t,loopSuggestion:e.loop}:t))},onOrganizeSuggestion:()=>{(function(e){if(!e)return!1;try{let t=window.localStorage.getItem(i6),n=t?JSON.parse(t):{},r=n[e]||0;if(Date.now()-r<864e5)return!1;return n[e]=Date.now(),window.localStorage.setItem(i6,JSON.stringify(n)),!0}catch{return!1}})(n.conversationId)&&l(e=>e.map(e=>e.id===m?{...e,organizeSuggestion:!0}:e))},onProgress:(e,t,n)=>{if("deep"===i){"active"===t&&n&&l(e=>e.map(e=>e.id===m?{...e,phase:n}:e));return}v.current||(v.current=!0,y(e=>e+1)),x(r=>{let i=r.buildSteps&&r.buildSteps.length>0?r.buildSteps:function(e){if(!e)return i9;let t=i8[e];return t?t.map(e=>({...e})):i9.map(e=>({...e}))}(r.capability??G.current),a=i.findIndex(t=>t.id===e),l=i.map((r,i)=>r.id===e?{...r,status:t,detail:n}:a>=0&&i<a&&("pending"===r.status||"active"===r.status)?{...r,status:"done"}:r),s="active"===t&&n?n:r.progressDetail??null,o="music"===r.mode||"video"===r.mode||"image"===r.mode||"mobile"===r.mode||"code"===r.mode||"document"===r.mode||"research"===r.mode?r.mode:"building";return{...r,mode:o,buildSteps:l,progressDetail:s}})},onFile:(e,t)=>{I.current=[...I.current.filter(t=>t.path!==e),{path:e,content:t}];let n="mobile_app"===G.current||"mobile_app"===q.current;x(e=>({...e,mode:n?"mobile":"code",files:[...I.current]}))},onImage:e=>{z.current=[...z.current,e];let t=G.current;x(e=>"video"===t||"music"===t?{...e,mode:"video"===e.mode||"music"===e.mode?e.mode:"video",images:[...z.current],capability:e.capability??t??null,isLoading:!0}:{...e,mode:"image",images:[...z.current],capability:e.capability??t??null}),J(m,{kind:"image",data:e})},onLikenessWarning:e=>{J(m,{kind:"likeness_warning",data:e})},onResearch:e=>{x({mode:"research",research:e,isLoading:!1}),J(m,{kind:"research",data:{...e,id:`research-${Date.now()}`}})},onDocument:e=>{let t=e.format??e.fileType??e.docType??"docx",n={id:String(e.id??Math.random().toString(36).slice(2)),name:String(e.name??"document"),type:t,url:String(e.url??"#"),previewUrl:"string"==typeof e.previewUrl?e.previewUrl:void 0,thumbnail:e.thumbnail,size:e.size};E.current=[...E.current,n],x({mode:"document",documents:[...E.current]}),J(m,{kind:"document",data:n})},onVideo:e=>{let t=e.supersedes,n=t?D.current.filter(e=>e.url!==t):D.current;D.current=[...n,e],x(e=>({...e,mode:"video",videos:[...D.current],audio:T.current,isLoading:!1})),J(m,{kind:"video",data:e})},onAudio:e=>{T.current=e,x(e=>({...e,mode:"video",videos:[...D.current],audio:T.current}))},onMusic:e=>{P.current=[...P.current,e],x({mode:"music",songs:[...P.current]}),J(m,{kind:"music",data:e})},onDeployed:e=>{let t=0===I.current.length,n="mobile_app"===G.current||"mobile_app"===q.current;x(r=>({...r,mode:n?"mobile":t?"code":r.mode,deployedUrl:e.url,buildSteps:r.buildSteps?.map(e=>({...e,status:"done"})),etaSeconds:void 0})),J(m,{kind:"web_app",data:{id:e.slug||e.url,url:e.url,slug:e.slug,fileCount:e.fileCount,mobile:n}}),g.toast.success(`Deployed live: ${e.url}`)},onApk:e=>{e.easBuildId&&(J(m,{kind:"apk",data:{id:e.easBuildId,easBuildId:e.easBuildId,apkStatus:e.apkStatus||"building",url:e.url,name:e.name||e.title,packageName:e.packageName,sizeBytes:e.sizeBytes}}),g.toast.success("APK build started â you'll be notified when it's ready (~10-15 min)."))},onDone:e=>{S||j||A(e.text||b)},onJob:e=>{j=e.jobId;let t=e.message||`Generating ${e.capability}â¦`;b=t,l(e=>e.map(e=>e.id===m?{...e,content:t,isStreaming:!0}:e)),V.drain(e.jobId,{...R,onDone:e=>{j=null,A(e.text||b)},onError:e=>{j=null,g.toast.error(`Model error: ${e}`),l(t=>t.map(t=>t.id===m?{...t,content:b||`Error: ${e}`,isStreaming:!1,failed:!b}:t)),M()}})},onQuestion:e=>{J(m,{kind:"question",data:e})},onTaskPlan:e=>{let t={title:e.title,summary:e.summary,steps:e.steps,total_estimated_minutes:e.total_estimated_minutes,issued_at:e.issued_at};v.current||(v.current=!0,y(e=>e+1)),x(e=>{let n="empty"===e.mode?"building":e.mode;return{...e,mode:n,taskPlan:t}})},onGuardrail:e=>{b=e.message,l(t=>t.map(t=>
25t.id===m?{...t,content:e.message,isStreaming:!1}:t))},onLimit:e=>{N({message:e.message,plan:e.limit.plan,used:e.limit.used,limits:e.limit.limits,windowEndsAt:e.limit.windowEndsAt,bucket:e.bucket}),l(e=>e.filter(e=>e.id!==m)),H.current=!0},onError:e=>{if(H.current){H.current=!1;return}let t=n.conversationId,r=()=>{g.toast.error(`Model error: ${e}`),l(t=>t.map(t=>t.id===m?{...t,content:b||`Error: ${e}`,isStreaming:!1,failed:!b}:t)),M()};t?en(t,m,f).then(e=>{e||r()}):r()}};if(c){try{await i2(c,R,k.signal);var $={sceneId:c.id,title:c.label,preview:e.trim().slice(0,180),prompt:c.prompt};let t={id:`demo:${$.sceneId}:${Date.now()}`,sceneId:$.sceneId,title:$.title,preview:$.preview,prompt:$.prompt,at:Date.now()};try{let e=[t,...Q()].slice(0,20);window.localStorage.setItem(K,JSON.stringify(e)),window.dispatchEvent(new Event(Y))}catch{}}finally{O.current=null,o(!1)}return}let Z=null,ee=()=>{if(j){let e=n.conversationId,t=Date.now()-f>6e6,r=_.current?.conversationId===e;if(!e||!r||t)return;en(e,m,f).then(e=>{e?(j=null,V.stop(),o(!1)):et()});return}k.abort();let e=n.conversationId,t=()=>{g.toast.error("Connection lost. Refresh and try again."),l(e=>e.map(e=>e.id===m?{...e,content:b||"Connection lost.",isStreaming:!1,phase:null,failed:!b}:e)),M()};e?en(e,m,f).then(e=>{e||t()}):t()},et=()=>{Z&&clearTimeout(Z),Z=setTimeout(ee,9e4)};U.current=et;let er=Object.fromEntries(Object.entries(R).map(([e,t])=>[e,"function"==typeof t?(...e)=>(et(),t(...e)):t]));et();try{await a.api.chatStream(e.trim(),n.conversationId,er,k.signal,i,q.current,t.lockMode,t.extendedMode)}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)ae(n.conversationId),l(e=>e.map(e=>e.id===m?{...e,content:b?`${b} 26 27_(stopped)_`:"_(stopped)_",isStreaming:!1}:e));else{let e=n.conversationId,t=()=>{g.toast.error("Connection dropped. Tap retry to try again."),l(e=>e.map(e=>e.id===m?{...e,content:b||"Connection error",isStreaming:!1,failed:!b}:e)),M()};e?en(e,m,f).then(e=>{e||t()}):t()}}finally{Z&&!j&&clearTimeout(Z),U.current===et&&(U.current=null),O.current=null}o(!1)},[s,W]);(0,n.useEffect)(()=>{!S||s||(C(null),er(S,{mode:"build"}))},[S,s,er]);let ei=(0,n.useCallback)((e,t={})=>{let n=e.trim();if(!n)return null;let r=`queued-${Date.now()}-${Math.random().toString(36).slice(2,7)}`;return M(e=>[...e,{id:r,content:n,opts:t}]),r},[]),ea=(0,n.useCallback)(e=>{M(t=>t.filter(t=>t.id!==e))},[]);(0,n.useEffect)(()=>{if(s||0===A.length)return;let[e,...t]=A;M(t),er(e.content,e.opts)},[s,A,er]);let el=(0,n.useCallback)(()=>{let e=B.current;O.current&&(O.current.abort(),O.current=null),V.stop(),e&&($.current.add(e.streamId),ae(e.conversationId),e.conversationId&&a.api.cancelStream(e.conversationId),l(t=>t.map(t=>t.id===e.streamId&&t.isStreaming?{...t,isStreaming:!1,phase:null,content:t.content?`${t.content} 28 29_(stopped)_`:"_(stopped)_"}:t))),B.current=null,o(!1),M([])},[V]),es=(0,n.useCallback)(()=>{let e=F.current;e&&!s&&(l(e=>{let t=[...e].reverse().findIndex(e=>e.failed);if(-1===t)return e;let n=e.length-1-t;return e.slice(0,n)}),er(e.content,{viaVoice:e.viaVoice,isRetry:!0}))},[s,er]),eo=(0,n.useCallback)(()=>{l([]),_.current=null,F.current=null,u(null),h(null),x({mode:"empty"}),w(null),C(null),M([]),N(null),G.current=null,I.current=[],z.current=[],E.current=[],D.current=[],T.current=null,P.current=[],R.current?.(null)},[]),ec=(0,n.useCallback)(async(e,t,n)=>{let r=`assistant-resume-${Date.now()}`;l(e=>[...e,{id:r,role:"assistant",content:"",isStreaming:!0,phase:"Still working⦠you can leave this page",mode:n.mode??void 0,capability:n.capability??void 0}]),o(!0);let i=[2e3,3e3,5e3,8e3,12e3];for(;i.length<35;)i.push(15e3);let s=async()=>{let t=null;try{t=await a.api.getMessages(e)}catch{return null}if(!Array.isArray(t))return null;let r=[...t].reverse().find(e=>"assistant"===e.role&&!!e.createdAt&&Date.parse(e.createdAt)>=n.turnStartedAt-5e3);if(!r)return null;let i=i4(t,e).find(e=>e.id===r.id);return i&&(i.content&&i.content.trim().length>0||i.artifacts&&i.artifacts.length>0)?{row:r,hydrated:i}:null},c=()=>{let e=!1;return l(t=>(e=t.some(e=>e.id===r),t)),!e},u=!1,d=null;for(let e=0;e<i.length;e++){if(await new Promise(t=>setTimeout(t,i[e])),c())return;if(d=await s())break}if(!d){let t=Date.now()+6e6+6e4,n=!1,i=!1;try{n=!0===(await a.api.getInflight(e)).running}catch{i=!0}if(n||i)for(l(e=>e.map(e=>e.id===r?{...e,phase:"Still workingâ¦"}:e));Date.now()<t;){if(await new Promise(e=>setTimeout(e,12e3)),c())return;if(d=await s())break;try{if(!(await a.api.getInflight(e)).running){await new Promise(e=>setTimeout(e,1500)),(d=await s())||(await new Promise(e=>setTimeout(e,4e3)),d=await s());break}}catch{}}}if(d){let e=d.hydrated;l(t=>t.some(t=>t.id===e.id)?t.filter(e=>e.id!==r):t.map(t=>
29t.id===r?{...e,isStreaming:!1,phase:null}:t));let t=[...e.artifacts??[]].reverse().find(e=>"question"!==e.kind);t&&et(t),u=!0}ae(e),o(!1),u||l(e=>e.map(e=>e.id===r?{...e,isStreaming:!1,phase:null,content:"This is taking longer than expected â refresh to check on it, or try again."}:e))},[et]),eu=(0,n.useCallback)(async(e,t)=>{try{let n=await a.api.getMessages(e);if(!Array.isArray(n))return void g.toast.error("Couldn't load that chat â try again.");let r=i4(n,e);I.current=[],z.current=[],E.current=[],D.current=[],T.current=null,P.current=[],C(null),M([]);let i=(()=>{for(let e=r.length-1;e>=0;e--){let t=r[e],n=t.artifacts?.find(e=>"web_app"===e.kind);if(n&&"web_app"===n.kind)return n}return null})(),s=(()=>{for(let e=r.length-1;e>=0;e--){let t=r[e];if("assistant"!==t.role)continue;let n=t.artifacts?.filter(e=>"question"!==e.kind);return n?.length?n[n.length-1]:null}return null})();if(s)et(s);else if(i&&"web_app"===i.kind){let e=!0===i.data.mobile;x({mode:e?"mobile":"code",files:[],deployedUrl:i.data.url,capability:e?"mobile_app":"web_app"}),w(i5(i))}else x({mode:"empty"}),w(null);
29u(null),h(null),N(null),H.current=!1,F.current=null,G.current=null,C(null),_.current={projectId:t,conversationId:e},l(r);let o=function(e){if(!e)return null;try{let t=window.localStorage.getItem(i7+e);if(!t)return null;let n=JSON.parse(t);if(!n||"number"!=typeof n.turnStartedAt)return null;return n}catch{return null}}(e);if(o){let r=Date.now()-o.turnStartedAt>6e6,i=n.some(e=>"assistant"===e.role&&!!e.createdAt&&Date.parse(e.createdAt)>=o.turnStartedAt-5e3);r||i?ae(e):ec(e,t,o)}R.current?.(e)}catch(t){let e=t instanceof Error?t.message:String(t);g.toast.error(`Couldn't load that chat â ${e}`)}},[ec,et]);return{messages:i,isLoading:s,currentMode:c,currentVertical:d,currentCapability:m,previewState:f,buildWorkTick:b,limitNotice:j,dismissLimit:(0,n.useCallback)(()=>N(null),[]),sendMessage:er,queueMessage:ei,dequeueMessage:ea,queuedMessages:A,clearMessages:eo,retryLast:es,stopGeneration:el,selectArtifact:et,selectedArtifactKey:k,loadConversation:eu}}({onAssistantDone:e=>{b&&e?.trim()&&v(e)},lockedCapability:j,onConversationOpen:e=>{G(e??null);let t=new URL(window.location.href);e?t.searchParams.set("c",e):t.searchParams.delete("c"),window.history.replaceState({},"",t.toString())}}),[W,G]=(0,n.useState)(()=>new URL(window.location.href).searchParams.get("c"));(0,n.useEffect)(()=>((0,lD.registerBugSnapshotProvider)(()=>({conversationId:W,messages:C.map(e=>({role:e.role,content:e.content,mode:e.mode??null,capability:e.capability??null})),mode:M,capability:I,previewState:z?{mode:z.mode}:null})),()=>(0,lD.registerBugSnapshotProvider)(null)));let[J,Z]=(0,n.useState)("build"),ee=(0,n.useRef)(null),et=(0,n.useRef)(!!new URL(window.location.href).searchParams.get("c"));(0,n.useEffect)(()=>{if(!0!==l)return;let e=new URL(window.location.href).searchParams.get("c");if(!e||ee.current===e){et.current=!1;return}ee.current=e;let t=lP(lR(e)),n=lO(e);(async()=>{try{let r=await a.api.getConversation(e);if(!r)return;await V(r.id,r.projectId);let i=n??"general";N(i),"general"!==i?Z("slatex"):t&&Z(t)}finally{et.current=!1}})()},[l,V]),(0,n.useEffect)(()=>{if(!et.current&&W){try{localStorage.setItem(lL(W),J)}catch{}try{localStorage.setItem(lF(W),j)}catch{}}},[W,J,j]);let[er,ea]=(0,n.useState)(55),[el,es]=(0,n.useState)(!1),[eo,ec]=(0,n.useState)("chat"),[eu,ed]=(0,n.useState)(!0);(0,n.useEffect)(()=>{let e=window.matchMedia("(min-width: 768px)"),t=()=>ed(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let ep=(0,n.useRef)(null),em=(0,n.useRef)(!1),[eh,ef]=(0,n.useState)(!0),eg=(0,n.useRef)("empty"),ex=(0,n.useRef)(""),eb=(0,n.useRef)(!1),ey=(0,n.useRef)(!1),ev=(0,n.useRef)(0),[ek,ew]=(0,n.useState)(null),ej=(0,n.useCallback)((e,t)=>{let n="animate"===e?`Animate this image into a short, smoothly looping video. Source image: ${t}`:`Add fitting background music to this video. Source video: ${t}`;Z("build"),P(n,{mode:"build",lockMode:!0}),ec("preview"),ef(!1)},[P]),eN=(0,n.useCallback)((e,t)=>{"build"===J||"auto"===J?ej(e,t):ew({kind:e,url:t})},[J,ej]);(0,n.useEffect)(()=>{let e=z?.mode||"empty",t=z?JSON.stringify({mode:e,images:(z.images||[]).map(e=>e?.url),videos:(z.videos||[]).map(e=>e?.url),documents:(z.documents||[]).map(e=>e?.url),songs:(z.songs||[]).map(e=>e?.url),audio:z.audio?.url??null,files:(z.files||[]).map(e=>e?.path),deployedUrl:z.deployedUrl??null}):"",n=t!==ex.current;if("empty"!==e&&n){let e="u">typeof document?document.activeElement:null,t=!!e&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&!!e.closest('[data-testid="chat-panel"]');ey.current&&t||eb.current||(t&&e instanceof HTMLElement&&e.blur(),ey.current=!0,ec("preview")),"empty"===eg.current&&ef(!1)}"empty"===e&&"building"===eg.current&&(ef(!0),ec("chat")),eg.current=e,ex.current=t},[z]);let eS=(0,n.useRef)(!1);(0,n.useEffect)(()=>{A&&!eS.current&&(eg.current="empty",eb.current=!1,ey.current=!1),eS.current=A},[A]),(0,n.useEffect)(()=>{if(E===ev.current||(ev.current=E,eb.current))return;let e=document.querySelector('[data-testid="chat-panel"] textarea');e&&e.value.trim().length>0||(ey.current=!0,ec("preview"))},[E]),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&w&&k()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w,k]);let eC=(0,n.useCallback)(()=>{em.current=!0;let e=e=>{if(!em.current||!ep.current)return;let t=ep.current.getBoundingClientRect();ea(Math.min(Math.max((e.clientX-t.left)/t.width*100,25),80))},t=()=>{em.current=!1,document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),eA=(0,n.useCallback)(e=>{N(e),O(),G(null),Z("general"===e?"build":"slatex"),ec("chat"),"general"!==e&&ef(!1)},[O]),eM=(0,n.useCallback)(e=>{N("general"),Z(e),O(),G(null),ec("chat")},[O]),e_=z&&"empty"!==z.mode,eI=z?.mode==="building"||A&&("build"===M||"slatex"===M||j&&"general"!==j),ez=null,eE=null;if(A&&eI){let e=z?.taskPlan?.steps?.find(e=>"active"===e.status),t=z?.buildSteps?.find(e=>"active"===e.status);ez=e?.label??t?.label??"Working on itâ¦",eE=t?.detail??z?.progressDetail??null}let eD=!eh;return!0!==l?(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center text-sm text-muted-foreground",children:!1===l?"Redirectingâ¦":"Loadingâ¦"}):(0,t.jsxs)("div",{className:"deck-root dark isolate flex h-full",children:[(0,t.jsx)(lE.DeckBackdrop,{
29className:"-z-10"}),(0,t.jsx)(ei,{onNewChat:()=>{O(),G(null),Z("build"),N("general"),ec("chat")},lockedCapability:j,onLockCapability:eA,composerMode:J,onSelectMode:eM,mobileOpen:el,onMobileClose:()=>es(!1),onSelectConversation:(e,t)=>{let n=lP(lR(e)),r=lO(e)??"general";V(e,t),G(e),N(r),"general"!==r?Z("slatex"):Z(n??"build"),ec("chat")},onReplayDemo:e=>{O(),G(null),ec("chat"),P(e)},selectedConversationId:W,refreshKey:C.length}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex h-14 items-center gap-2 border-b border-border/50 bg-background/40 px-3 backdrop-blur-md md:hidden",children:[(0,t.jsx)("button",{onClick:()=>es(!0),"aria-label":"Open menu",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md hover:bg-accent",children:(0,t.jsx)(u,{size:22})}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-base font-bold tracking-tight",children:[(0,t.jsx)("span",{className:"deck-orb deck-orb--pulse",style:{"--orb":"var(--deck-cyan)"},"aria-hidden":!0}),(0,t.jsxs)("span",{className:"hidden min-[480px]:inline",children:["Slate",(0,t.jsx)("span",{className:"text-brand",children:"X"})]})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[W&&(0,t.jsx)("button",{onClick:()=>{let e=`${window.location.origin}/app?c=${W}`;navigator.clipboard?.writeText?navigator.clipboard.writeText(e).then(()=>g.toast.success("Link copied â share this chat"),()=>g.toast.error("Couldn't copy the link")):g.toast.error("Couldn't copy the link")},"aria-label":"Copy link to this chat",title:"Copy link to this chat",className:"flex h-11 w-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:(0,t.jsx)(c,{size:18})}),(0,t.jsx)("button",{onClick:y,"aria-label":b?"Mute voice replies":"Enable voice replies",className:(0,B.cn)("flex h-11 w-11 items-center justify-center rounded-md transition-colors",b?"text-brand hover:bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:b?(0,t.jsx)(m,{size:18}):(0,t.jsx)(h,{size:18})}),(0,t.jsx)("div",{className:"hidden min-[480px]:block",children:(0,t.jsx)(en,{})})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center rounded-lg border border-border bg-muted/40 p-0.5 text-[13px]",children:[(0,t.jsxs)("button",{onClick:()=>{ec("chat"),A&&(eb.current=!0)},className:(0,B.cn)("flex min-h-[34px] items-center gap-1.5 rounded-md px-2.5 py-1.5 transition-colors","chat"===eo?"bg-background text-foreground shadow-sm":"text-muted-foreground"),children:[(0,t.jsx)(d.MessageSquare,{size:14}),"Chat"]}),(0,t.jsxs)("button",{onClick:()=>ec("preview"),className:(0,B.cn)("relative flex min-h-[34px] items-center gap-1.5 rounded-md px-2.5 py-1.5 transition-colors","preview"===eo?"bg-background text-foreground shadow-sm":"text-muted-foreground"),children:[(0,t.jsx)(p.Sparkles,{size:14}),"Preview",e_&&"preview"!==eo&&(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-brand"})]})]})]}),(0,t.jsxs)("div",{ref:ep,className:"relative flex flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:(0,B.cn)("h-full min-w-0 overflow-hidden","chat"===eo?"flex w-full":"hidden w-full","md:flex"),style:eu&&eD?{width:`${er}%`}:void 0,children:(0,t.jsx)("div",{className:(0,B.cn)("h-full w-full min-w-0",eu&&!eD&&"md:mx-auto md:max-w-4xl"),"data-testid":"chat-panel",children:(0,t.jsx)(aF,{messages:C,isLoading:A,currentMode:M,currentVertical:_,currentCapability:I,lockedCapability:j,onClearLock:()=>S("general"),onSend:P,onQueue:L,onDequeue:R,queuedMessages:F,onStopGeneration:U,onRetry:$,limitNotice:D,onDismissLimit:T,autoSpeak:b,onToggleAutoSpeak:y,isSpeaking:w,onStopSpeaking:k,onSelectArtifact:e=>{H(e),ec("preview"),ef(!1)},selectedArtifactKey:q,workingLabel:ez,workingDetail:eE,onOpenProgress:()=>{ec("preview"),ef(!1)},composerMode:J,onComposerModeChange:Z,onChipReply:(e,t)=>P(e,{chipAck:t}),onBuildCta:e=>{O(),G(null),Z("slatex"),P(e,{mode:"slatex",lockMode:!0})},onPremiumCta:e=>{O(),G(null),Z("slatex"),P(e,{mode:"slatex",lockMode:!0})},onModeChangeNewConversation:()=>{O(),G(null)},onOpenBuildConversation:e=>{O(),G(null),Z("slatex"),P(e,{mode:"slatex",lockMode:!0}),ec("chat")}})})}),eD&&(0,t.jsx)("div",{onMouseDown:eC,className:(0,B.cn)("group relative hidden w-1 cursor-col-resize items-center justify-center md:flex","border-x-0 bg-border transition-colors hover:bg-brand/40"),children:(0,t.jsx)("div",{className:"absolute z-10 flex h-8 w-4 items-center justify-center rounded-sm bg-border opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(o,{className:"h-3 w-3 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:(0,B.cn)("relative h-full min-w-0 overflow-hidden bg-background/40 backdrop-blur-sm","preview"===eo?"flex w-full":"hidden w-full",eD?"md:flex md:flex-1":"md:hidden"),children:[(0,t.jsxs)("button",{onClick:()=>{ec("chat"),A&&(eb.current=!0)},"aria-label":"Back to chat",className:"absolute left-3 top-3 z-20 flex h-9 items-center gap-1.5 rounded-full border border-border bg-background/90 px-3 text-[13px] font-medium text-foreground shadow-sm backdrop-blur-sm transition-colors hover:bg-muted md:hidden",children:[(0,t.jsx)(s,{size:15}),"Back to chat"]}),(0,t.jsx)("button",{onClick:()=>ef(!0),"aria-label":"Close preview",className:"absolute right-3 top-3 z-20 hidden h-8 w-8 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-muted hover:text-foreground md:flex",children:(0,t.jsx)(f.X,{size:16})}),(0,t.jsx)("div",{className:"h-full w-full min-w-0","data-testid":"preview-panel",children:(0,t.jsx)(lC,{state:z,isWorking:!!(A&&eI),lockedCapability:j,onAnimate:e=>eN("animate",e.url),onAddMusic:e=>eN("music",e.url)})})]}),!eD&&(0,t.jsx)("button",{onClick:()=>ef(!1),"aria-label":"Open preview",className:(0,B.cn)("absolute right-0 top-1/2 z-20 hidden -translate-y-1/2 items-center justify-center","h-24 w-3 rounded-l-md border border-r-0 border-border bg-muted/60 text-muted-foreground transition-all","hover:w-4 hover:bg-brand/30 hover:text-foreground","md:flex",e_&&"border-brand/40 bg-brand/15 text-brand slate-breathe"),title:e_?"Preview ready â click to open":"Open preview",children:(0,t.jsx)(s,{size:12})})]})]}),ek&&(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Switch to Build mode",className:"fixed inset-0 z-[110] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:()=>ew(null),children:(0,t.jsxs)("div",{className:"deck-glass deck-corners w-full max-w-sm p-6",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight",children:"animate"===ek.kind?"Make a video?":"Add music?"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground leading-relaxed",children:"animate"===ek.kind?"Animating images into video runs in Build mode. Switch to Build and continue?":"Scoring a video with music runs in Build mode. Switch to Build and continue?"}
29),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground/70",children:["You're currently in ",function(e){let t=(0,X.getVertical)(e);if(t)return t.label;switch(e){case"quick":return"Quick";case"deep":return"Slate";case"research":return"Deep Research";case"build":return"Pro";case"slatex":return"Slate X";default:return"Auto"}}(J)," mode."]}),(0,t.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>ew(null),className:"rounded-md border border-border px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let{kind:e,url:t}=ek;ew(null),ej(e,t)},className:"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Switch to Build"})]})]})})]})}],27627)}]);
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.