sgiant-ai-widget 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/ai-invalidation.d.ts +29 -0
- package/dist/ai-invalidation.d.ts.map +1 -0
- package/dist/ai-invalidation.js +121 -0
- package/dist/ai-invalidation.js.map +1 -0
- package/dist/contrast.d.ts +87 -0
- package/dist/contrast.d.ts.map +1 -0
- package/dist/contrast.js +151 -0
- package/dist/contrast.js.map +1 -0
- package/dist/directive.d.ts +37 -0
- package/dist/directive.d.ts.map +1 -0
- package/dist/directive.js +87 -0
- package/dist/directive.js.map +1 -0
- package/dist/dom.d.ts +83 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +146 -0
- package/dist/dom.js.map +1 -0
- package/dist/host-actions.d.ts +192 -0
- package/dist/host-actions.d.ts.map +1 -0
- package/dist/host-actions.js +443 -0
- package/dist/host-actions.js.map +1 -0
- package/dist/icons.d.ts +21 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +84 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +600 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4833 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.d.ts +187 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/labels.js +232 -0
- package/dist/labels.js.map +1 -0
- package/dist/limits.d.ts +43 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +48 -0
- package/dist/limits.js.map +1 -0
- package/dist/markdown.d.ts +23 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +0 -0
- package/dist/markdown.js.map +1 -0
- package/dist/message-chrome.d.ts +45 -0
- package/dist/message-chrome.d.ts.map +1 -0
- package/dist/message-chrome.js +101 -0
- package/dist/message-chrome.js.map +1 -0
- package/dist/pane-follow.d.ts +67 -0
- package/dist/pane-follow.d.ts.map +1 -0
- package/dist/pane-follow.js +61 -0
- package/dist/pane-follow.js.map +1 -0
- package/dist/prefix.d.ts +9 -0
- package/dist/prefix.d.ts.map +1 -0
- package/dist/prefix.js +9 -0
- package/dist/prefix.js.map +1 -0
- package/dist/proposal-summary.d.ts +19 -0
- package/dist/proposal-summary.d.ts.map +1 -0
- package/dist/proposal-summary.js +73 -0
- package/dist/proposal-summary.js.map +1 -0
- package/dist/replay.d.ts +125 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +172 -0
- package/dist/replay.js.map +1 -0
- package/dist/safe-url.d.ts +47 -0
- package/dist/safe-url.d.ts.map +1 -0
- package/dist/safe-url.js +80 -0
- package/dist/safe-url.js.map +1 -0
- package/dist/sgiant-ai-widget.global.js +778 -0
- package/dist/sgiant-ai-widget.global.js.map +7 -0
- package/dist/specs.d.ts +173 -0
- package/dist/specs.d.ts.map +1 -0
- package/dist/specs.js +231 -0
- package/dist/specs.js.map +1 -0
- package/dist/storage.d.ts +77 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +124 -0
- package/dist/storage.js.map +1 -0
- package/dist/styles.d.ts +29 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +876 -0
- package/dist/styles.js.map +1 -0
- package/dist/ui-control.d.ts +8 -0
- package/dist/ui-control.d.ts.map +1 -0
- package/dist/ui-control.js +8 -0
- package/dist/ui-control.js.map +1 -0
- package/dist/ui-render.d.ts +75 -0
- package/dist/ui-render.d.ts.map +1 -0
- package/dist/ui-render.js +617 -0
- package/dist/ui-render.js.map +1 -0
- package/dist/ui-spec.d.ts +143 -0
- package/dist/ui-spec.d.ts.map +1 -0
- package/dist/ui-spec.js +288 -0
- package/dist/ui-spec.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,778 @@
|
|
|
1
|
+
/*! sgiant-ai-widget 1.0.0 — MIT — https://vedatugur.github.io/sgiant-ai-widget/ */
|
|
2
|
+
"use strict";var SgiantAiWidget=(()=>{var li=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var Qo=Object.getOwnPropertyNames;var Zo=Object.prototype.hasOwnProperty;var es=(t,a)=>{for(var o in a)li(t,o,{get:a[o],enumerable:!0})},ts=(t,a,o,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let h of Qo(a))!Zo.call(t,h)&&h!==o&&li(t,h,{get:()=>a[h],enumerable:!(c=Xo(a,h))||c.enumerable});return t};var ns=t=>ts(li({},"__esModule",{value:!0}),t);var Is={};es(Is,{KNOWN_UI_STATUSES:()=>$i,OPEN_ASSISTANT_EVENT:()=>Ss,OPERATE_ACTIONS:()=>gn,PREFIX:()=>e,STANDARD_ACTION_PATHS:()=>Ht,UI_CONTROL_ACTIONS:()=>un,UI_SAY_ACTION:()=>Pt,WIDGET_LABELS:()=>it,broadcastAiChange:()=>br,buildThreadReplay:()=>Yr,clearHighlight:()=>It,createAiChatWidget:()=>Ms,createHostActions:()=>or,gateNavigationTarget:()=>En,genericProposalSummary:()=>Ln,isKnownNavTarget:()=>Rt,isNavigationAction:()=>hn,isOperateAction:()=>ze,isUiControlAction:()=>et,makePageContext:()=>rr,matchManifest:()=>hi,normalizeUiSpec:()=>xn,parseJsonDirective:()=>re,resolveWidgetLabels:()=>Jr,scanAiTargets:()=>pi,subscribeAiChange:()=>$n,subscribeLiveSync:()=>mr,uiSpecMediaIds:()=>yn});var un=["highlight","scroll-to","focus-field"];function et(t){return un.includes(t)}function is(t){return t.replace(/["\\]/g,"\\$&")}function Xa(t){if(typeof document>"u")return null;let a=document.querySelector(`[data-ai-target="${is(t)}"]`);return a&&a.isConnected?a:null}function as(t){let a=t.getAttribute("aria-label"),o=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.placeholder:"";return(a||t.textContent||o||"").trim().replace(/\s+/g," ").slice(0,60)}function pi(t=40){if(typeof document>"u")return[];let a=[],o=new Set,c=document.querySelectorAll("[data-ai-target]");for(let h of Array.from(c)){let l=h.getAttribute("data-ai-target");if(!(!l||o.has(l))){if(!h.isConnected||h.offsetParent===null){let r=h.getBoundingClientRect();if(r.width===0&&r.height===0)continue}if(o.add(l),a.push({id:l,label:as(h)}),a.length>=t)break}}return a}var Qa="ai-bridge-highlight",Ga="ai-bridge-highlight-kf";function rs(){if(typeof document>"u"||document.getElementById(Ga))return;let t=document.createElement("style");t.id=Ga,t.textContent=`@keyframes ai-bridge-pulse{
|
|
3
|
+
0%,100%{box-shadow:0 0 0 2px rgba(250,113,45,.9),0 0 0 6px rgba(250,113,45,.22)}
|
|
4
|
+
50%{box-shadow:0 0 0 2px rgba(250,113,45,1),0 0 0 10px rgba(250,113,45,.06)}
|
|
5
|
+
}`,document.head.appendChild(t)}var pn;function ci(t,a=3500){if(typeof document>"u")return;rs(),It();let o=6,c=document.createElement("div");c.id=Qa,c.setAttribute("aria-hidden","true"),Object.assign(c.style,{position:"fixed",borderRadius:"10px",pointerEvents:"none",zIndex:"2147483000",animation:"ai-bridge-pulse 1.1s ease-in-out infinite"});let h=()=>{let m=t.getBoundingClientRect();c.style.top=`${m.top-o}px`,c.style.left=`${m.left-o}px`,c.style.width=`${m.width+o*2}px`,c.style.height=`${m.height+o*2}px`};h(),document.body.appendChild(c);let l=()=>h();window.addEventListener("scroll",l,!0),window.addEventListener("resize",l);let r=()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l),c.remove()};c._cleanup=r,pn=window.setTimeout(It,a)}function It(){if(typeof document>"u")return;pn&&(window.clearTimeout(pn),pn=void 0);let t=document.getElementById(Qa);t&&(t._cleanup?.(),t.remove())}function ui(t,a){let o=Xa(a);if(!o)return!1;switch(t){case"highlight":return o.scrollIntoView({behavior:"smooth",block:"center"}),ci(o),!0;case"scroll-to":return o.scrollIntoView({behavior:"smooth",block:"center"}),!0;case"focus-field":return o.scrollIntoView({block:"center"}),o.focus?.(),!0;default:return!1}}var gn=["fill","click"];function ze(t){return gn.includes(t)}function os(t,a){let o=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value")?.set;c?c.call(t,a):t.value=a}function gi(t,a,o){let c=Xa(a);if(!c)return!1;switch(t){case"fill":return c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement?(c.scrollIntoView({block:"center"}),ci(c,2200),os(c,o??""),c.dispatchEvent(new Event("input",{bubbles:!0})),c.dispatchEvent(new Event("change",{bubbles:!0})),!0):!1;case"click":return c.scrollIntoView({block:"center"}),ci(c,2200),c.click(),!0;default:return!1}}var fn="ai-agent-bridge";function Za(t){return typeof t=="object"&&t!==null&&t.ch===fn&&t.v===1&&typeof t.type=="string"}function er(t,a){return a==="*"?!0:a.includes(t)}function nr(t,a={}){let o=a.targetOrigin??(typeof location<"u"?location.origin:"*"),c=a.allowedOrigins??(o==="*"?"*":[o]),h=[],l=null,r=!1,m=0,L=new Map,w=q=>{let V=t.contentWindow;if(V)try{V.postMessage(q,o)}catch{}},$=q=>{if(q.source!==t.contentWindow||!er(q.origin,c))return;let V=q.data;if(!Za(V))return;let F=V;if(F.type==="hello")r=!0,l=F.path,a.onReady?.(F.path),j();else if(F.type==="targets")h=F.targets,l=F.path,a.onTargets?.(F.targets,F.path);else if(F.type==="result"){let D=L.get(F.id);D&&(window.clearTimeout(D.timer),L.delete(F.id),D.resolve({ok:F.ok,message:F.message}))}};window.addEventListener("message",$);let j=()=>w({ch:fn,v:1,type:"scan"});return{act:(q,V)=>new Promise(F=>{let D=++m,le=window.setTimeout(()=>{L.delete(D),F({ok:!1,message:"the page didn't respond in time"})},a.actTimeoutMs??8e3);L.set(D,{resolve:F,timer:le}),w({ch:fn,v:1,type:"act",id:D,action:q,target:V.target,...V.value!==void 0?{value:V.value}:{}})}),requestScan:j,getTargets:()=>h,getPath:()=>l,isReady:()=>r,destroy:()=>{window.removeEventListener("message",$);for(let{timer:q}of L.values())window.clearTimeout(q);L.clear()}}}var ss=["en","tr"];function ar(t){return ss.includes(t)}function ds(t){let a=t.replace(/\/+$/,"")||"/",o=a.match(/^\/([a-z]{2})(\/|$)/);return o&&ar(o[1])&&(a=a.slice(o[1].length+1)||"/"),a}function ls(t){return t.replace(/\/+$/,"").split("/").filter(Boolean)}function cs(t){let a=t;for(let o=0;o<6;o++){if(!a.includes("%"))return a;let c;try{c=decodeURIComponent(a)}catch{return null}if(c===a)return a;a=c}return null}function ps(t){let a=cs(t);if(a===null)return null;let o=a.normalize("NFKC");return/[/\\]/.test(o)||/[\u0000-\u001f\u007f]/.test(o)?null:o}function us(t){if(typeof t!="string"||t!==t.trim()||!t.startsWith("/"))return null;let a=t.split(/[?#]/)[0]??"";if(a.includes("\\")||a.includes("//"))return null;let o=[];for(let c of a.split("/")){if(!c)continue;let h=ps(c);if(h===null||h==="."||h==="..")return null;o.push(h)}return o.length&&ar(o[0])&&o.shift(),o}function hi(t,a){let o=r=>r.split("/").filter(Boolean),c=o(ds(t)),h,l=-1;for(let r of a){let m=o(r.path);if(!m.length){!c.length&&l<0&&(h=r,l=0);continue}if(m.length>c.length)continue;let L=c.length-m.length;m.every(($,j)=>$.startsWith(":")||$===c[L+j])&&m.length>l&&(h=r,l=m.length)}return h}function Rt(t,a){let o=us(t);if(o===null||!a?.length)return!1;for(let c of a){if(!c.path)continue;let h=ls(c.path);if(!h.length){if(!o.length)return!0;continue}if(!(h.length>o.length)&&h.every((l,r)=>l.startsWith(":")||l===o[r]))return!0}return!1}function rr(t,a,o=[],c){let h=a.split("/").filter(Boolean).slice(-1)[0]||"home",l={app:t,path:a,page:h,recentPages:o.slice(-8)};return c?.length&&(l.pageInfo=hi(a,c),l.navTargets=c.map(r=>({path:r.path,title:r.title,purpose:r.purpose,...r.action?{action:r.action}:{}}))),l}var Ht={"open-dashboards":"/dashboards","open-dashboard-builder":"/dashboards/new/edit","open-billing":"/billing","open-assets":"/assets"},gs={"open-dashboards":"Opened dashboards","open-dashboard-builder":"Opened the dashboard builder","open-billing":"Opened billing","open-assets":"Opened assets"};function hn(t){return t==="navigate"||t==="show-assets"||t in Ht}var fs={"open-dashboards":"Already on dashboards","open-dashboard-builder":"Already in the dashboard builder","open-billing":"Already on billing","open-assets":"Already on assets"};function ir(t,a){return a.startsWith("/accounts/")?a:`${t}${a}`}function fi(t){if(typeof window>"u")return!1;let a=r=>r.length>1&&r.endsWith("/")?r.slice(0,-1):r,[o="",c=""]=t.split("?");if(a(window.location.pathname)!==a(o))return!1;let h=new URLSearchParams(window.location.search),l=new URLSearchParams(c);for(let[r,m]of l)if(h.get(r)!==m)return!1;return!0}function or(t){let a=t.accountId?`/accounts/${t.accountId}`:"",o=t.t??((l,r)=>r),c={"show-assets":l=>{let r=l.folderId||null,m=l.assetId||null;if(!r&&!m)return;let L=new URLSearchParams;r&&L.set("folder",r),m&&L.set("asset",m);let w=`${Ht["open-assets"]}?${L}`;return fi(ir(a,w))||t.navigate(w),t.showAssets?.({folderId:r,assetId:m}),m?o("aiAssistant.action.actionOpenedFile","Opened the file"):o("aiAssistant.action.actionOpenedFolder","Opened the folder")},navigate:l=>{if(l.path)return Rt(l.path,t.pages)?fi(ir(a,l.path))?o("aiAssistant.action.actionAlreadyThere","Already there"):(t.navigate(l.path),o("aiAssistant.action.actionOpened","Opened")):o("aiAssistant.action.actionNotAPage","That is not a page I can open")}};for(let[l,r]of Object.entries(Ht))c[l]=()=>{let m=`${a}${r}`;return fi(m)?o(`aiAssistant.action.actionAlready_${l.replace(/-/g,"_")}`,fs[l]??"Already there"):(t.navigate(m),o(`aiAssistant.action.actionDone_${l.replace(/-/g,"_")}`,gs[l]??"Opened"))};let h={...c,...t.handlers??{}};return async(l,r)=>{if(et(l)){if(!ui(l,r.target??""))throw new Error(`no such control on this page: ${r.target}`);return o("aiAssistant.action.actionShownOnPage","Shown on the page")}if(ze(l)){if(!gi(l,r.target??"",r.value))throw new Error(`no such control on this page: ${r.target}`);return o("aiAssistant.action.actionDoneOnPage","Done on the page")}let m=h[l];if(!m)throw new Error(`unsupported action: ${l}`);return await m(r)}}var Ot=t=>!!t;function bi(t,a=""){if(!Ot(t))return a;try{return localStorage.getItem(t)??a}catch{return a}}function Nt(t,a){if(Ot(t))try{a?localStorage.setItem(t,a):localStorage.removeItem(t)}catch{}}function gt(t,a=!1){if(!Ot(t))return!1;try{return localStorage.getItem(t)==="1"}catch{return a}}function ft(t,a){Nt(t,a?"1":"0")}function bn(t,a){if(!Ot(t))return null;try{let o=localStorage.getItem(t);if(!o)return null;let c=JSON.parse(o);return a(c)?c:null}catch{return null}}function mn(t,a){if(Ot(t))try{a===null?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(a))}catch{}}function sr(){return["--duration-fast: 150ms;","--duration-base: 300ms;","--duration-slow: 600ms;","--ease-out: cubic-bezier(0.22, 1, 0.36, 1);","--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);","--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);"].join(`
|
|
6
|
+
`)}var dr="#151D2F",lr="#FCF7E3";function vn(t){let a=t.trim().replace(/^#/,"");if(a.length===3){let[o,c,h]=a.split("");return/^[0-9a-f]{3}$/i.test(a)?[parseInt(o+o,16),parseInt(c+c,16),parseInt(h+h,16)]:null}return(a.length===6||a.length===8)&&/^[0-9a-f]+$/i.test(a)?[parseInt(a.slice(0,2),16),parseInt(a.slice(2,4),16),parseInt(a.slice(4,6),16)]:null}function mi(t){let a=vn(t);if(!a)return null;let[o,c,h]=a.map(l=>{let r=l/255;return r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)});return .2126*o+.7152*c+.0722*h}function vi(t,a){let o=mi(t),c=mi(a);return o===null||c===null?null:(Math.max(o,c)+.05)/(Math.min(o,c)+.05)}function wi(t){let a=vi(t,dr),o=vi(t,lr);return a===null||o===null?null:a>=o?dr:lr}function xi(t,a,o){let c=vn(t),h=vn(a);if(!c||!h)return null;let l=Math.min(1,Math.max(0,o)),r=m=>Math.round(c[m]*l+h[m]*(1-l)).toString(16).padStart(2,"0");return`#${r(0)}${r(1)}${r(2)}`}function cr(t,a,o=4.5){let c=mi(a);if(c===null||vn(t)===null)return null;let h=c>.5?"#000000":"#ffffff";for(let l=1;l>=0;l-=.05){let r=xi(t,h,l);if(!r)return null;let m=vi(r,a);if(m!==null&&m>=o)return r}return h}function pr(t,a){if(!t||!a)return!1;let o=c=>{let h=c.split("?")[0]??"";return h.length>1&&h.endsWith("/")?h.slice(0,-1):h};return o(t)===o(a)}function ur(t){return!(!t.advanced||!t.canNavigate||!t.userConfirmedThisSession||t.userDriven||t.alreadyFollowed||!t.path||!t.path.startsWith("/")||t.path.startsWith("//")||pr(t.currentPath,t.path))}function gr(t){return t.advanced?pr(t.currentPath,t.livePath):!1}function re(t,a){let o=`[[${a}:`,c=t.indexOf(o);if(c<0)return null;let h=t.indexOf("{",c+o.length);if(h<0)return null;let l=0,r=!1,m=!1,L=-1;for(let w=h;w<t.length;w++){let $=t[w];if(r)m?m=!1:$==="\\"?m=!0:$==='"'&&(r=!1);else if($==='"')r=!0;else if($==="{")l++;else if($==="}"&&(l--,l===0)){L=w;break}}if(L<0)return null;try{let w=JSON.parse(t.slice(h,L+1)),$=L+1,j=0;for(;t[$]==="}"&&j<3;)$++,j++;t[$]==="]"&&$++,t[$]==="]"&&$++;let z=(t.slice(0,c)+t.slice($)).trim();return{spec:w,stripped:z,start:c,end:$}}catch{return null}}var Pt="say",hs=["square","portrait","story","landscape","wide"],$i=["pending","running","ready","failed"],fr={queued:"pending",waiting:"pending",rendering:"running",generating:"running",processing:"running",in_progress:"running",done:"ready",complete:"ready",completed:"ready",ok:"ready",success:"ready",error:"failed",cancelled:"failed",canceled:"failed"},bs=24,ms=4,vs=240,ws=12,Re=(t,a=vs)=>{if(typeof t!="string")return;let o=t.trim();if(o)return o.length>a?`${o.slice(0,a-1)}\u2026`:o},wn=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function yi(t){if(typeof t!="string")return;let a=t.trim();if(!(!a||a.length>64))return/^[A-Za-z0-9_-]+$/.test(a)?a:void 0}function xs(t){let a=Re(t,32);if(!a)return;let o=a.toLowerCase().replace(/[\s-]+/g,"_");return fr[o]?fr[o]:$i.includes(o)?o:a}function ys(t){if(!wn(t))return;let a={};for(let[o,c]of Object.entries(t)){if(Object.keys(a).length>=ws)break;(typeof c=="string"||typeof c=="number"||typeof c=="boolean")&&(a[o]=String(c))}return Object.keys(a).length?a:void 0}function $s(t){if(!wn(t))return null;let a=Re(t.name,64);if(!a)return null;let o=Re(t.label,48),c=Re(t.confirm),h=ys(t.data),l=t.variant==="primary"||t.variant==="danger"?t.variant:void 0;return a===Pt&&!h?.text&&!o?null:{name:a,...o?{label:o}:{},...c?{confirm:c}:{},...h?{data:h}:{},...l?{variant:l}:{}}}function hr(t){if(!Array.isArray(t))return[];let a=[];for(let o of t){if(a.length>=ms)break;let c=$s(o);c&&a.push(c)}return a}function ks(t){if(!wn(t))return null;let a=Re(t.id,64),o=Re(t.title,80),c=Re(t.caption),h=yi(t.mediaId),l=yi(t.posterMediaId),r=xs(t.status),m=t.media==="video"||t.media==="image"||t.media==="audio"?t.media:void 0,L=yi(t.jobId),w=hr(t.actions);return!h&&!o&&!c&&!r&&!L&&!w.length?null:{...a?{id:a}:{},...o?{title:o}:{},...c?{caption:c}:{},...h?{mediaId:h}:{},...l?{posterMediaId:l}:{},...m?{media:m}:{},...r?{status:r}:{},...L?{jobId:L}:{},...w.length?{actions:w}:{}}}function xn(t){if(!wn(t))return null;let a=[];if(Array.isArray(t.items))for(let m of t.items){if(a.length>=bs)break;let L=ks(m);L&&a.push(L)}let o=hr(t.actions),c=Re(t.title,80),h=Re(t.caption);if(!a.length&&!o.length)return null;let l=t.layout==="grid"||t.layout==="list"||t.layout==="carousel"?t.layout:"strip",r=typeof t.aspect=="string"&&hs.includes(t.aspect)?t.aspect:"square";return{...c?{title:c}:{},...h?{caption:h}:{},layout:l,aspect:r,items:a,actions:o}}function yn(t){let a=new Set;for(let o of t.items)o.mediaId&&a.add(o.mediaId),o.posterMediaId&&a.add(o.posterMediaId);return[...a]}var ki="ai-widget-live";function br(t,a){if(typeof window<"u")try{window.dispatchEvent(new CustomEvent(ki,{detail:{accountId:t,domains:a}}))}catch{}if(!(typeof BroadcastChannel>"u"))try{let o=new BroadcastChannel(ki);o.postMessage({accountId:t,domains:a}),o.close()}catch{}}function $n(t){if(typeof BroadcastChannel>"u")return()=>{};let a=new BroadcastChannel(ki),o=c=>{let h=c.data;h&&typeof h.accountId=="string"&&t({accountId:h.accountId,domains:Array.isArray(h.domains)?h.domains:void 0})};return a.addEventListener("message",o),()=>{a.removeEventListener("message",o),a.close()}}function mr(t){if(typeof fetch>"u")return()=>{};let a=!1,o=null,c=1e3,h=async()=>{if(a)return;o=new AbortController;try{let r=await t.getToken(),m=await fetch(t.url,{headers:r?{authorization:`Bearer ${r}`}:{},credentials:"include",signal:o.signal});if(!m.ok||!m.body)throw new Error(`live ${m.status}`);c=1e3;let L=m.body.getReader(),w=new TextDecoder,$="";for(;;){let{value:j,done:z}=await L.read();if(z||a)break;$+=w.decode(j,{stream:!0});let q;for(;(q=$.indexOf(`
|
|
7
|
+
|
|
8
|
+
`))>=0;){let V=$.slice(0,q);$=$.slice(q+2);let F=V.split(`
|
|
9
|
+
`).find(D=>D.startsWith("data:"));if(F)try{let D=JSON.parse(F.slice(5).trim());D&&typeof D.accountId=="string"&&t.onChange(D.accountId,Array.isArray(D.domains)?D.domains:void 0)}catch{}}}}catch{}if(a)return;let l=c;c=Math.min(c*2,3e4),setTimeout(h,l)};return h(),()=>{a=!0,o?.abort()}}var Cs={"&":"&","<":"<",">":">",'"':""","'":"'"};function tt(t){return t.replace(/[&<>"']/g,a=>Cs[a])}function Ts(t){let a=t.trim();return/^(https?:\/\/|mailto:)/i.test(a)||/^[/#]/.test(a)?a:null}function Bt(t){let a=[],o=t.replace(/`([^`]+)`/g,(c,h)=>(a.push(`<code>${h}</code>`),`\0C${a.length-1}\0`));return o=o.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(c,h,l)=>{let r=Ts(l);return r?`<a href="${tt(r)}" target="_blank" rel="noopener noreferrer">${h}</a>`:h}),o=o.replace(/(\*\*|__)(?=\S)([\s\S]+?\S)\1/g,"<strong>$2</strong>"),o=o.replace(/(^|[^*_])([*_])(?=\S)([\s\S]+?\S)\2(?![*_])/g,"$1<em>$3</em>"),o=o.replace(/~~(?=\S)([\s\S]+?\S)~~/g,"<del>$1</del>"),o=o.replace(/C(\d+)/g,(c,h)=>a[Number(h)]??""),o}function vr(t){return t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(a=>a.trim())}var wr=/^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/,Ls=/^F(\d+)$/;function Ci(t){if(!t)return"";let a=[],c=t.replace(/```[^\n]*\n?([\s\S]*?)```/g,(w,$)=>{let j=tt($.replace(/\n$/,""));return a.push(`<pre class="md-pre"><code>${j}</code></pre>`),`
|
|
10
|
+
\0F${a.length-1}\0
|
|
11
|
+
`}).split(/\r?\n/),h=[],l=0,r=w=>w.trim().length===0,m=w=>{let $=w.trim().match(Ls);return $?Number($[1]):null},L=(w,$)=>/^(#{1,6})\s+/.test(w)||/^\s*>/.test(w)||/^\s*([-*+]|\d+[.)])\s+/.test(w)||/^\s*([-*_])(\s*\1){2,}\s*$/.test(w)||m(w)!==null||w.includes("|")&&$+1<c.length&&wr.test(c[$+1]);for(;l<c.length;){let w=c[l];if(r(w)){l++;continue}let $=m(w);if($!==null){h.push(a[$]??""),l++;continue}let j=w.match(/^(#{1,6})\s+(.*)$/);if(j){let F=j[1].length;h.push(`<h${F}>${Bt(tt(j[2].trim()))}</h${F}>`),l++;continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(w)){h.push("<hr>"),l++;continue}if(w.includes("|")&&l+1<c.length&&wr.test(c[l+1])){let F=vr(w);l+=2;let D=[];for(;l<c.length&&c[l].includes("|")&&!r(c[l]);)D.push(vr(c[l])),l++;let le=F.map(Oe=>`<th>${Bt(tt(Oe))}</th>`).join(""),ge=D.map(Oe=>`<tr>${Oe.map(fe=>`<td>${Bt(tt(fe))}</td>`).join("")}</tr>`).join("");h.push(`<table class="md-table"><thead><tr>${le}</tr></thead><tbody>${ge}</tbody></table>`);continue}if(/^\s*>/.test(w)){let F=[];for(;l<c.length&&/^\s*>/.test(c[l]);)F.push(c[l].replace(/^\s*>\s?/,"")),l++;h.push(`<blockquote>${Ci(F.join(`
|
|
12
|
+
`))}</blockquote>`);continue}let z=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/,q=w.match(z);if(q){let F=/\d/.test(q[2]),D=[];for(;l<c.length;){let ge=c[l].match(z);if(ge){D.push(`<li>${Bt(tt(ge[3]))}</li>`),l++;continue}if(r(c[l])&&l+1<c.length&&z.test(c[l+1])){l++;continue}break}let le=F?"ol":"ul";h.push(`<${le}>${D.join("")}</${le}>`);continue}let V=[];for(;l<c.length&&!r(c[l])&&!L(c[l],l);)V.push(c[l].trim()),l++;V.length&&h.push(`<p>${Bt(tt(V.join(`
|
|
13
|
+
`))).replace(/\n/g,"<br>")}</p>`)}return h.join("")}var e="sgiant-aiw";function xr(t){if(!t)return null;let a=t;if(a.startsWith("data:")&&(a=a.slice(5).trim()),!a||a==="[DONE]")return null;try{return JSON.parse(a)}catch{return null}}function Ti(t){return t==="image"?"\u{1F5BC}":t==="video"?"\u{1F3AC}":t==="audio"?"\u{1F3B5}":"\u{1F4C4}"}function d(t,a){let o=document.createElement(t);return o.className=a,t==="button"&&o.classList.add(`${e}-btn`),o}function yr(t){let a=new Date(t);if(isNaN(a.getTime()))return"bucketOlder";let o=new Date,c=new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime(),h=864e5,l=a.getTime();return l>=c?"bucketToday":l>=c-h?"bucketYesterday":l>=c-6*h?"bucketWeek":l>=c-29*h?"bucketMonth":"bucketOlder"}function $r(t){let a=new Date(t);if(isNaN(a.getTime()))return"";let o=Date.now()-a.getTime(),c=6e4,h=36e5,l=864e5,r=7*l;return o<h?`${Math.max(1,Math.floor(o/c))}m ago`:o<l?`${Math.floor(o/h)}h ago`:o<r?`${Math.floor(o/l)}d ago`:o<30*l?`${Math.floor(o/r)}w ago`:a.toLocaleDateString()}function kr(t){return t.replace(/`+/g,"").replace(/[*~]/g,"").replace(/^#{1,6}\s*/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/\|/g," ")}function G(t){return t.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}function Cr(t){let a=(t??"").trim();return/<!doctype|<html[\s>]/i.test(a)?a:`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>*{box-sizing:border-box}body{margin:0;padding:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;color:#0f172a}</style></head><body>${a}</body></html>`}function nt(t,a,o,c){if(c&&c.length){let l=d("div",`${e}-atts ${e}-${a}`);for(let r of c){let m=d("span",`${e}-att`);m.title=`${r.filename} (${r.contentType})`,m.textContent=`${Ti(r.kind)} ${r.filename}`,l.appendChild(m)}t.appendChild(l)}let h=d("div",`${e}-msg ${e}-${a}`);return h.textContent=o,!o&&c&&c.length&&(h.style.display="none"),t.appendChild(h),h}var Tr=`<svg width="0" height="0" style="position:absolute" aria-hidden="true"><defs>
|
|
14
|
+
<linearGradient id="${e}-av-sweep" x1="0" y1="1" x2="1" y2="0">
|
|
15
|
+
<stop offset="0%" stop-color="#60C7C8"/><stop offset="55%" stop-color="#FBAA34"/><stop offset="100%" stop-color="#FA712D"/>
|
|
16
|
+
</linearGradient></defs></svg>`,Lr=`<svg viewBox="0 0 24 24" class="${e}-ayca" aria-hidden="true"><path class="${e}-av-mark" d="M20.4 14.5A8.6 8.6 0 0 1 9.5 3.6 8.6 8.6 0 1 0 20.4 14.5Z"/></svg>`,Ar='<svg viewBox="0 0 24 24" width="17" height="17" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3v5h5"/><path d="M3.05 13A9 9 0 1 0 6 5.3L3 8"/><path d="M12 7v5l3 2"/></svg>',Li='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>',Er='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 14h6v6"/><path d="M20 10h-6V4"/><path d="M14 10l7-7"/><path d="M3 21l7-7"/></svg>',kn='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><polygon points="16.2 7.8 13.4 13.4 7.8 16.2 10.6 10.6 16.2 7.8"/></svg>',Sr='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="10" y1="4" x2="10" y2="20"/></svg>',Ai='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>',Mr='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',Ir='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" y1="22" x2="4" y2="15"/></svg>',Hr='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>',Rr='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.73 21a2 2 0 0 1-3.46 0"/><path d="M18.63 13A17.9 17.9 0 0 1 18 8"/><path d="M6.26 6.26A6 6 0 0 0 6 8c0 7-3 9-3 9h14"/><path d="M18 8a6 6 0 0 0-9.33-5"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',Or='<svg viewBox="0 0 24 24" width="17" height="17" fill="currentColor" aria-hidden="true"><circle cx="12" cy="5" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="12" cy="19" r="1.7"/></svg>',Nr='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.44 11.05l-9.19 9.19a5.5 5.5 0 0 1-7.78-7.78l9.19-9.19a3.5 3.5 0 0 1 4.95 4.95l-9.2 9.19a1.5 1.5 0 0 1-2.12-2.12l8.49-8.49"/></svg>',Pr='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg>',Br='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 2v6h6"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L3 8"/></svg>',jr='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>',Fr='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>',Cn='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"/></svg>',Tn='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 14V2"/><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"/></svg>';function _r(t){let{switchBranch:a,getThreadId:o,vote:c,voteUpLabel:h,voteDownLabel:l}=t;function r(L){let w=d("div",`${e}-branchnav`),$=d("button",`${e}-branch-btn`);if($.type="button",$.setAttribute("aria-label","Previous version"),$.innerHTML=jr,$.disabled=!L.prevLeaf,L.prevLeaf){let q=L.prevLeaf;$.addEventListener("click",()=>void a(q))}let j=d("span",`${e}-branch-count`);j.textContent=`${L.index}/${L.count}`;let z=d("button",`${e}-branch-btn`);if(z.type="button",z.setAttribute("aria-label","Next version"),z.innerHTML=Fr,z.disabled=!L.nextLeaf,L.nextLeaf){let q=L.nextLeaf;z.addEventListener("click",()=>void a(q))}return w.appendChild($),w.appendChild(j),w.appendChild(z),w}function m(L,w){let $=d("div",`${e}-votes`),j=0,z=d("button",`${e}-msgact ${e}-vote`),q=d("button",`${e}-msgact ${e}-vote`);z.type="button",q.type="button",z.setAttribute("aria-label",h??"Helpful"),q.setAttribute("aria-label",l??"Not helpful"),z.title=h??"Helpful",q.title=l??"Not helpful",z.innerHTML=Cn,q.innerHTML=Tn;let V=()=>{z.classList.toggle(`${e}-vote-on`,j===1),q.classList.toggle(`${e}-vote-on`,j===-1)},F=D=>{if(!c)return;let le=j===D?0:D,ge=j;j=le,V(),c({threadId:o()??"",messageId:L,value:le,...w?{model:w}:{}}).catch(()=>{j=ge,V()})};return z.addEventListener("click",()=>F(1)),q.addEventListener("click",()=>F(-1)),$.appendChild(z),$.appendChild(q),$}return{buildBranchNav:r,buildVoteButtons:m}}function zr(t){let{L:a,log:o,scrollDown:c,send:h,richDisposers:l,dispatchAction:r,subscribeJob:m,showPaneWidget:L,input:w,opts:$}=t;function j(v){let A=d("div",`${e}-widget`);if(v.title){let S=d("div",`${e}-widget-title`);S.textContent=v.title,A.appendChild(S)}let E=v.kind??(v.rows?"table":v.items?"kpis":"list");if(E==="stat"){let S=d("div",`${e}-widget-stat`);if(S.textContent=String(v.value??""),A.appendChild(S),v.caption){let k=d("div",`${e}-widget-cap`);k.textContent=v.caption,A.appendChild(k)}if(v.delta){let k=d("div",`${e}-widget-delta`);k.textContent=v.delta,A.appendChild(k)}}else if(E==="kpis"){let S=d("div",`${e}-widget-kpis`);for(let k of(v.items??[]).slice(0,8)){let H=d("div",`${e}-kpi`),P=d("div",`${e}-kpi-v`);P.textContent=String(k.value??"");let R=d("div",`${e}-kpi-l`);if(R.textContent=k.label??"",H.append(P,R),k.delta){let B=d("div",`${e}-kpi-d`);B.textContent=k.delta,H.appendChild(B)}S.appendChild(H)}A.appendChild(S)}else if(E==="table"&&v.rows){let S=document.createElement("table");if(S.className=`${e}-widget-table`,v.columns?.length){let H=S.createTHead().insertRow();for(let P of v.columns){let R=document.createElement("th");R.textContent=String(P),H.appendChild(R)}}let k=S.createTBody();for(let H of v.rows.slice(0,30)){let P=k.insertRow();for(let R of H)P.insertCell().textContent=String(R)}A.appendChild(S)}else{let S=d("ul",`${e}-widget-list`);for(let k of(v.lines??[]).slice(0,30)){let H=document.createElement("li");H.textContent=k,S.appendChild(H)}A.appendChild(S)}o.appendChild(A),c(!0)}function z(v){return v==="pending"?a("uiStatusPending"):v==="running"?a("uiStatusRunning"):v==="ready"?a("uiStatusReady"):v==="failed"?a("uiStatusFailed"):v}function q(v,A){let E=d("span",`${e}-ui-act`),S=v.variant==="primary"?` ${e}-ui-btn-primary`:v.variant==="danger"?` ${e}-ui-btn-danger`:"",k=d("button",`${e}-ui-btn${S}`);k.type="button";let H=v.label||v.name;k.textContent=H;let P={...v.data??{},...A?{itemId:A}:{}},R=async()=>{if(k.disabled=!0,v.name===Pt){h((v.data?.text||H).trim());return}try{let B=await r(v.name,P);k.textContent=typeof B=="string"&&B||a("actionDone",{label:H})}catch{k.disabled=!1,k.textContent=`${H} \u2014 ${a("tryAgain")}`}};return k.addEventListener("click",()=>{if(!v.confirm){R();return}E.textContent="";let B=d("span",`${e}-ui-confirm-q`);B.textContent=v.confirm;let oe=d("button",`${e}-ui-btn`);oe.type="button",oe.textContent=a("confirm");let X=d("button",`${e}-ui-btn-ghost`);X.type="button",X.textContent=a("cancel");let J=()=>{E.textContent="",E.appendChild(k)};oe.addEventListener("click",()=>{J(),R()}),X.addEventListener("click",J),E.append(B,oe,X)}),E.appendChild(k),E}function V(v){return`${e}-ui-badge ${e}-ui-badge-${v==="pending"||v==="running"||v==="ready"||v==="failed"?v:"other"}`}function F(v){return v==="done"?"ready":v==="failed"||v==="cancelled"?"failed":v==="queued"?"pending":"running"}function D(v,A){let E=v.querySelector(`.${e}-ui-media`);if(!E)return;let S=v.querySelector(`.${e}-ui-badge`);if(S){let H=F(A.status);S.className=V(H),S.textContent=z(H)}let k=A.resultMediaId;!k||E.dataset.mid===k||(E.dataset.mid=k,Oe([k],v))}function le(v){let A=d("div",`${e}-ui-tile`),E=d("div",`${e}-ui-media`);v.mediaId&&(E.dataset.mid=v.mediaId,v.posterMediaId&&(E.dataset.poster=v.posterMediaId),v.media&&(E.dataset.kind=v.media));let S=d("span",`${e}-ui-media-ph`);S.textContent=v.mediaId?"":a("uiMediaPending"),E.appendChild(S);let k=v.status??(v.jobId?"running":void 0);if(k){let H=d("span",V(k));H.textContent=z(k),E.appendChild(H)}if(A.appendChild(E),v.jobId&&m({kind:"job",id:v.jobId},A,H=>D(A,H)),v.title){let H=d("div",`${e}-ui-tile-title`);H.textContent=v.title,A.appendChild(H)}if(v.caption){let H=d("div",`${e}-ui-tile-cap`);H.textContent=v.caption,A.appendChild(H)}if(v.actions?.length){let H=d("div",`${e}-ui-tile-actions`);for(let P of v.actions)H.appendChild(q(P,v.id));A.appendChild(H)}return A}function ge(v){return/\.(mp4|webm|mov|m4v)(\?|#|$)/i.test(v)}async function Oe(v,A){let E={};if(v.length&&$.resolveMediaUrls)try{E=await $.resolveMediaUrls(v)??{}}catch{E={}}let S=A.querySelectorAll(`.${e}-ui-media`);for(let k of Array.from(S)){let H=k.dataset.mid;if(!H)continue;let P=E[H],R=k.querySelector(`.${e}-ui-media-ph`);if(!P){R&&(R.textContent=a("uiMediaMissing"));continue}let B=k.dataset.kind?k.dataset.kind:ge(P)?"video":"image",oe=B==="video",X=B==="audio",J=d(X?"audio":oe?"video":"img",`${e}-ui-media-el`);if(J.src=P,oe||X){if(J.controls=!0,J.preload="metadata",oe){J.playsInline=!0;let Z=k.dataset.poster?E[k.dataset.poster]:"";Z&&(J.poster=Z)}}else J.loading="lazy",J.alt="";J.addEventListener("error",()=>{J.remove();let Z=d("span",`${e}-ui-media-ph`);Z.textContent=a("uiMediaMissing"),k.appendChild(Z)}),R?.remove(),k.insertBefore(J,k.firstChild)}}function fe(v,A){let E=d("div",`${e}-ui-carousel`),S=d("div",`${e}-ui-carousel-stage`);S.appendChild(v),E.appendChild(S);let k=0,H=[],P=()=>{v.style.transform=`translateX(-${k*100}%)`,H.forEach((J,Z)=>J.classList.toggle(`${e}-ui-dot-on`,Z===k)),oe.textContent=`${k+1}/${A}`},R=J=>{k=(k+J+A)%A,P()},B=J=>{let Z=d("button",`${e}-ui-arrow ${e}-ui-arrow-${J}`);return Z.type="button",Z.setAttribute("aria-label",a(J==="left"?"prev":"next")),Z.textContent=J==="left"?"\u2039":"\u203A",Z.addEventListener("click",me=>{me.preventDefault(),me.stopPropagation(),R(J==="left"?-1:1)}),Z};S.append(B("left"),B("right"));let oe=d("span",`${e}-ui-counter`);S.appendChild(oe);let X=d("div",`${e}-ui-dots`);for(let J=0;J<A;J++){let Z=d("button",`${e}-ui-dot`);Z.type="button",Z.setAttribute("aria-label",`${J+1}`),Z.addEventListener("click",me=>{me.preventDefault(),me.stopPropagation(),k=J,P()}),H.push(Z),X.appendChild(Z)}return S.appendChild(X),P(),E}function jt(v){let A=xn(v);if(!A)return;let E=d("div",`${e}-ui`);if(A.title){let S=d("div",`${e}-ui-title`);S.textContent=A.title,E.appendChild(S)}if(A.caption){let S=d("div",`${e}-ui-cap`);S.textContent=A.caption,E.appendChild(S)}if(A.items.length){let S=d("div",`${e}-ui-items ${e}-ui-${A.layout} ${e}-ui-a-${A.aspect}`);for(let k of A.items)S.appendChild(le(k));A.layout==="carousel"&&A.items.length>1?E.appendChild(fe(S,A.items.length)):E.appendChild(S)}if(A.actions.length){let S=d("div",`${e}-ui-actions`);for(let k of A.actions)S.appendChild(q(k));E.appendChild(S)}o.appendChild(E),c(!0),Oe(yn(A),E)}function rt(v,A,E){if(L(v,A,E)){let R=d("div",`${e}-job-mirrored`);R.textContent=a("jobWatchingInPane"),o.appendChild(R),c(!0);return}if($.renderDataWidget){let R=d("div",`${e}-widget ${e}-widget-host`);o.appendChild(R);let B=$.renderDataWidget(R,v,A,E);B&&l.push(B),c(!0);return}if($.renderChartFallback){let R=d("div",`${e}-widget ${e}-widget-host`);o.appendChild(R);try{let B=$.renderChartFallback(R,v,A,E);B&&l.push(B),c(!0);return}catch{R.remove()}}let S=v?.title,k=Array.isArray(A)?A:[];if(v?.chartType==="kpi"&&k[0]){let R=k[0],B=Object.keys(R),oe=B[B.length-1];j({kind:"stat",title:S,value:String(R[oe]??""),caption:oe});return}if(!k.length){j({kind:"list",title:S,lines:["(no data)"]});return}let H=Object.keys(k[0]),P=k.slice(0,30).map(R=>H.map(B=>R[B]==null?"":String(R[B])));j({kind:"table",title:S,columns:H,rows:P})}function Ft(v){let A=(Array.isArray(v.options)?v.options:[]).map(R=>String(R).trim()).filter(Boolean).slice(0,8);if(!A.length)return;let E=v.multi===!0,S=d("div",`${e}-chips`),k=new Set,H=!1,P=R=>{H||!R.trim()||(H=!0,S.querySelectorAll("button").forEach(B=>B.disabled=!0),h(R.trim()))};for(let R of A){let B=d("button",`${e}-chip`);B.type="button",B.textContent=R,B.addEventListener("click",()=>{if(!H){if(!E){P(R);return}k.has(R)?(k.delete(R),B.classList.remove(`${e}-chip-on`)):(k.add(R),B.classList.add(`${e}-chip-on`))}}),S.appendChild(B)}if(v.other!==!1){let R=d("button",`${e}-chip ${e}-chip-other`);R.type="button",R.textContent=a("otherOption"),R.addEventListener("click",()=>w.focus()),S.appendChild(R)}if(E){let R=d("button",`${e}-chip ${e}-chip-send`);R.type="button",R.textContent=a("send"),R.addEventListener("click",()=>{let B=A.filter(oe=>k.has(oe));B.length&&P(B.join(", "))}),S.appendChild(R)}o.appendChild(S),c(!0)}function _t(v){let A=d("div",`${e}-preview`),E=d("div",`${e}-preview-bar`),S=d("span",`${e}-preview-dots`);S.innerHTML="<i></i><i></i><i></i>";let k=d("span",`${e}-preview-title`);k.textContent=v.title||a("preview"),E.append(S,k);let H=d("iframe",`${e}-preview-frame`);H.setAttribute("sandbox","allow-same-origin"),H.setAttribute("title",v.title||a("preview")),H.srcdoc=Cr(v.html),A.append(E,H),o.appendChild(A),c(!0)}function bt(v){let A=v.data?.target??"this control";if(v.name==="fill"){let E=v.data?.value??"",S=E.length>40?`${E.slice(0,40)}\u2026`:E;return S?`Type \u201C${S}\u201D into ${A}?`:`Fill ${A} for you?`}return`Click ${A} for you?`}return{renderWidget:j,renderUiCard:jt,renderServerWidget:rt,renderChips:Ft,renderPreview:_t,operateConfirmText:bt}}function Ln(t){return Object.entries(t).filter(([a])=>a!=="id").map(([a,o])=>`${a}: ${Dr(o)}`).join(`
|
|
17
|
+
`)}function Dr(t,a=0){if(t==null)return"\u2014";if(Array.isArray(t))return t.length?a>0?`${t.length} items`:t.map(o=>`
|
|
18
|
+
\u2022 ${Dr(o,a+1)}`).join(""):"(none)";if(typeof t=="object"){let o=t,c=["title","name","label","key","id"].map(r=>typeof o[r]=="string"?o[r]:"").find(Boolean),h=typeof o.prompt=="string"?o.prompt:typeof o.caption=="string"?o.caption:typeof o.description=="string"?o.description:"";if(c||h)return[c,h&&`\u2014 ${h.slice(0,90)}`].filter(Boolean).join(" ");let l=Object.keys(o);return l.length?`{${l.slice(0,4).join(", ")}}`:"{}"}return String(t)}var qr=!1,Ei="#04191b";function Wr(){try{let t=getComputedStyle(document.documentElement),a=/^-?[\d.]+\s+[\d.]+%\s+[\d.]+%$/;return["--input","--ring","--card","--foreground","--muted-foreground","--primary-foreground"].every(c=>a.test(t.getPropertyValue(c).trim()))?t.getPropertyValue("--radius").trim().length>0:!1}catch{return!1}}var Ur=(t,a)=>`
|
|
19
|
+
${t},${a}{--aiw-accent-ink:var(--aiw-accent-ink-dark,var(--aiw-accent));--aiw-surface:#161616;--aiw-surface-raised:#1d1d1d;--aiw-surface-2:#2c2c2c;--aiw-bg:#101010;--aiw-text:#eee;--aiw-text-2:#ddd;--aiw-muted:#9b9b9b;--aiw-border:#2a2a2a;--aiw-border-strong:#444;--aiw-border-soft:#262626;--aiw-danger-bg:#231613;--aiw-danger-border:#5a2c1d;--aiw-danger-text:#ff9b7a;--aiw-danger-text-2:#d3a08d;--aiw-ok-bg:#122017;--aiw-ok-border:#2c4d36;--aiw-ok-text:#7fd39a}
|
|
20
|
+
${a} .${e}-assistant code{background:rgba(255,255,255,.1)}
|
|
21
|
+
${a} .${e}-assistant blockquote{color:#aaa;border-left-color:color-mix(in srgb,var(--aiw-accent) 53%,transparent)}
|
|
22
|
+
${a} .${e}-assistant table.md-table th{color:#aaa;border-bottom-color:#2a2a2a}
|
|
23
|
+
${a} .${e}-assistant table.md-table td{border-bottom-color:#222}
|
|
24
|
+
${a} .${e}-assistant hr{border-top-color:#2a2a2a}
|
|
25
|
+
${a} .${e}-pane-frame{box-shadow:0 1px 4px rgba(0,0,0,.4)}
|
|
26
|
+
${a}.${e}-advanced .${e}-chatcol{border-right-color:#262626}
|
|
27
|
+
${a}.${e}-advanced.${e}-pane-collapsed .${e}-chatcol{border-right:0}
|
|
28
|
+
`;function Vr(t){if(qr)return;qr=!0;let a=Ur(`.dark .${e}-bubble`,`.dark .${e}-panel`),o=Ur(`.${e}-bubble:not(.${e}-host-tokens)`,`.${e}-panel:not(.${e}-host-tokens)`),c=`
|
|
29
|
+
/* Theme tokens \u2014 every color in this sheet reads from these. Light defaults
|
|
30
|
+
here; the dark media block below only REDEFINES tokens; explicit host
|
|
31
|
+
overrides (accent/gradient/theme) land INLINE on the roots and win over
|
|
32
|
+
both, so a themed host is never surprised by the OS color scheme. */
|
|
33
|
+
/* Status surfaces (error card, failed job, flag notes) are TOKENS, not literal
|
|
34
|
+
* colours. They used to be hardcoded light hexes with no dark counterpart, so
|
|
35
|
+
* in dark mode a failed job painted #fdf3f3 (near-white) while its title stayed
|
|
36
|
+
* var(--aiw-text) = #eee \u2014 white on white, i.e. invisible. Same class of bug
|
|
37
|
+
* left the error card's rust text on its own near-black background. Anything
|
|
38
|
+
* that needs a red/green surface must use these four vars so the dark override
|
|
39
|
+
* below reaches it automatically.
|
|
40
|
+
*
|
|
41
|
+
* NOTE: this whole sheet is a JS template literal \u2014 no backticks in here.
|
|
42
|
+
* --aiw-muted is a CONTRAST FLOOR, not a shade preference. It was #888,
|
|
43
|
+
* which measures 3.54:1 on this sheet's own white surface \u2014 under the 4.5:1
|
|
44
|
+
* body-text minimum, on the token carrying timestamps, job states and event
|
|
45
|
+
* detail. #6e6e6e clears it against every surface the widget paints
|
|
46
|
+
* (5.10:1 on #fff, 4.76:1 on the darkest, #f7f7f8). The dark counterpart
|
|
47
|
+
* (#9b9b9b) already passes at 6.51:1 / 5.02:1 and is unchanged. Anything
|
|
48
|
+
' * lighter than this in light mode is a regression, not a restyle.
|
|
49
|
+
*
|
|
50
|
+
* --aiw-header-bg / --aiw-header-fg are the HEADER's own pair, and they exist
|
|
51
|
+
* because the bar is not an accent-filled control. Its buttons read
|
|
52
|
+
* --aiw-accent-contrast, which #307 correctly made DERIVED from the accent
|
|
53
|
+
* ("white on the teal every host actually passes is 2.00:1"). Against the teal
|
|
54
|
+
* all three of our apps pass, that derivation returns brand navy #151D2F \u2014
|
|
55
|
+
* which is the header background. Navy on navy: 1.00:1, an invisible toolbar,
|
|
56
|
+
* shipped and reported from the product. A token means "readable on the
|
|
57
|
+
* ACCENT"; the header is not the accent. Cream on navy is 15.66:1.
|
|
58
|
+
*
|
|
59
|
+
* These two deliberately do NOT flip with the colour scheme, and neither does
|
|
60
|
+
* the bar. --aiw-surface does, which is how the active-icon chip came to paint
|
|
61
|
+
* #161616 on #151D2F in dark mode. */
|
|
62
|
+
.${e}-bubble,.${e}-panel{${sr()}--aiw-font-3xs:10px;--aiw-font-2xs:11px;--aiw-font-xs:12px;--aiw-font-sm:13px;--aiw-font-md:14px;--aiw-font-lg:15px;--aiw-font-xl:16px;--aiw-font-2xl:18px;--aiw-font-3xl:30px;--aiw-radius-2xs:2px;--aiw-radius-xs:4px;--aiw-radius-sm:6px;--aiw-radius-md:8px;--aiw-radius-lg:10px;--aiw-radius-xl:12px;--aiw-radius-2xl:14px;--aiw-radius-3xl:18px;--aiw-radius-pill:999px;--aiw-accent:#6d28d9;--aiw-accent-contrast:#fff;--aiw-accent-ink:var(--aiw-accent-ink-light,var(--aiw-accent));--aiw-header-bg:#151D2F;--aiw-header-fg:#FCF7E3;--aiw-gradient:linear-gradient(135deg,var(--aiw-accent),var(--aiw-accent));--aiw-surface:#fff;--aiw-surface-raised:#fff;--aiw-surface-2:#f7f7f8;--aiw-bg:#fafafa;--aiw-text:#111;--aiw-text-2:#555;--aiw-muted:#6e6e6e;--aiw-border:#e6e6e6;--aiw-border-strong:#ddd;--aiw-border-soft:#f0f0f0;--aiw-danger-bg:#fff6f2;--aiw-danger-border:#f3c5b6;--aiw-danger-text:#b23b18;--aiw-danger-text-2:#8a5648;--aiw-ok-bg:#f2fbf5;--aiw-ok-border:#bfe3c8;--aiw-ok-text:#2f7d43}
|
|
63
|
+
@keyframes ${e}-spin{to{transform:rotate(360deg)}}
|
|
64
|
+
@keyframes ${e}-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
|
|
65
|
+
@keyframes ${e}-blink{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
|
|
66
|
+
@keyframes ${e}-richin{from{opacity:.15;transform:translateY(3px)}to{opacity:1;transform:none}}
|
|
67
|
+
.${e}-rich-in{animation:${e}-richin var(--duration-base) var(--ease-out)}
|
|
68
|
+
@keyframes ${e}-tokin{from{opacity:0;filter:blur(5px)}to{opacity:1;filter:blur(0)}}
|
|
69
|
+
.${e}-tok{animation:${e}-tokin var(--duration-base) var(--ease-out) forwards}
|
|
70
|
+
.${e}-activity{align-self:flex-start;display:inline-flex;align-items:center;gap:7px;max-width:92%;border:1px solid color-mix(in srgb,var(--aiw-accent) 15%,transparent);background:color-mix(in srgb,var(--aiw-accent) 5%,transparent);border-radius:var(--aiw-radius-lg);padding:5px 10px;font-size:var(--aiw-font-xs);font-weight:500;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
71
|
+
.${e}-activity-done{opacity:.72}
|
|
72
|
+
.${e}-act-label{color:var(--aiw-text-2)}
|
|
73
|
+
.${e}-act-agent{flex:0 0 auto;font-size:var(--aiw-font-3xs);font-weight:700;letter-spacing:.3px;text-transform:uppercase;color:var(--aiw-accent-ink);background:color-mix(in srgb,var(--aiw-accent) 12%,transparent);border:1px solid color-mix(in srgb,var(--aiw-accent) 24%,transparent);border-radius:var(--aiw-radius-sm);padding:1px 6px}
|
|
74
|
+
.${e}-act-model{flex:0 0 auto;font-size:var(--aiw-font-3xs);font-weight:600;letter-spacing:.2px;color:var(--aiw-muted);background:#9aa0a614;border:1px solid #9aa0a630;border-radius:var(--aiw-radius-sm);padding:1px 5px;font-variant-numeric:tabular-nums}
|
|
75
|
+
.${e}-act-spin{width:11px;height:11px;flex:0 0 auto;border-radius:50%;border:2px solid color-mix(in srgb,var(--aiw-accent) 27%,transparent);border-top-color:var(--aiw-accent);animation:${e}-spin .7s linear infinite}
|
|
76
|
+
.${e}-act-ok{color:var(--aiw-ok-text);font-weight:700}
|
|
77
|
+
.${e}-act-x{color:var(--aiw-danger-text);font-weight:700}
|
|
78
|
+
.${e}-job{align-self:flex-start;display:flex;flex-direction:column;gap:6px;max-width:92%;min-width:min(260px,100%);border:1px solid color-mix(in srgb,var(--aiw-accent) 18%,transparent);background:color-mix(in srgb,var(--aiw-accent) 5%,transparent);border-radius:var(--aiw-radius-xl);padding:9px 11px;font-size:var(--aiw-font-xs);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
79
|
+
.${e}-job-done{opacity:.85}
|
|
80
|
+
.${e}-job-failed{border-color:var(--aiw-danger-border);background:var(--aiw-danger-bg)}
|
|
81
|
+
.${e}-job-head{display:flex;align-items:center;gap:7px}
|
|
82
|
+
.${e}-job-title{font-weight:600;color:var(--aiw-text)}
|
|
83
|
+
.${e}-job-state{margin-left:auto;font-size:var(--aiw-font-3xs);font-weight:700;letter-spacing:.3px;text-transform:uppercase;color:var(--aiw-muted)}
|
|
84
|
+
.${e}-job-counts{color:var(--aiw-text-2);font-variant-numeric:tabular-nums}
|
|
85
|
+
.${e}-job-bar{height:4px;border-radius:var(--aiw-radius-2xs);background:color-mix(in srgb,var(--aiw-accent) 14%,transparent);overflow:hidden}
|
|
86
|
+
/* scaleX, not width (#309). Animating width reflows on every frame; a
|
|
87
|
+
transform is composited. transform-origin:left so it grows from the start of
|
|
88
|
+
the track rather than its middle. */
|
|
89
|
+
.${e}-job-bar>i{display:block;height:100%;width:100%;transform-origin:left;background:var(--aiw-accent);transition:transform var(--duration-base) var(--ease-out)}
|
|
90
|
+
.${e}-job-detail{color:var(--aiw-muted);font-size:var(--aiw-font-2xs);word-break:break-word}
|
|
91
|
+
.${e}-job-mirrored{color:var(--aiw-muted);font-size:var(--aiw-font-2xs);font-style:italic}
|
|
92
|
+
.${e}-pane-widget{width:100%;height:100%;overflow:auto;background:var(--aiw-surface);border-radius:var(--aiw-radius-xl);padding:16px;box-sizing:border-box}
|
|
93
|
+
.${e}-job-flow{list-style:none;margin:6px 0 0;padding:0 0 0 2px;display:flex;flex-direction:column;gap:3px}
|
|
94
|
+
.${e}-job-ev{position:relative;padding-left:12px;color:var(--aiw-text-2);font-size:var(--aiw-font-2xs);line-height:1.35;word-break:break-word}
|
|
95
|
+
.${e}-job-ev::before{content:"";position:absolute;left:0;top:6px;width:5px;height:5px;border-radius:50%;background:var(--aiw-muted)}
|
|
96
|
+
.${e}-job-ev-decision{color:var(--aiw-text)}
|
|
97
|
+
.${e}-job-ev-decision::before{background:var(--aiw-accent,currentColor)}
|
|
98
|
+
.${e}-job-ev-problem{color:var(--aiw-danger-text)}
|
|
99
|
+
.${e}-job-ev-problem::before{background:currentColor}
|
|
100
|
+
.${e}-job-flow-all{margin-top:4px}
|
|
101
|
+
.${e}-job-flow-all>summary{cursor:pointer;color:var(--aiw-muted);font-size:var(--aiw-font-2xs);user-select:none}
|
|
102
|
+
.${e}-replay-note{align-self:flex-start;display:inline-flex;align-items:center;border:1px dashed var(--aiw-border-strong);border-radius:var(--aiw-radius-md);padding:4px 10px;font-size:var(--aiw-font-xs);color:var(--aiw-muted);background:var(--aiw-bg)}
|
|
103
|
+
.${e}-flag-note{align-self:center;border-style:solid;border-color:var(--aiw-danger-border);color:var(--aiw-danger-text);background:var(--aiw-danger-bg);font-weight:600}
|
|
104
|
+
.${e}-flag-ok{border-color:var(--aiw-ok-border);color:var(--aiw-ok-text);background:var(--aiw-ok-bg)}
|
|
105
|
+
.${e}-usage{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;margin-top:-4px;padding:0 2px;font-size:var(--aiw-font-3xs);color:var(--aiw-muted);font-variant-numeric:tabular-nums}
|
|
106
|
+
.${e}-usage-pill{display:inline-flex;align-items:center;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-sm);padding:0 5px;line-height:16px}
|
|
107
|
+
.${e}-usage-sep{opacity:.5}
|
|
108
|
+
@keyframes ${e}-pulse{0%{box-shadow:0 0 0 0 rgba(96,199,200,.5)}70%{box-shadow:0 0 0 12px rgba(96,199,200,0)}100%{box-shadow:0 0 0 0 rgba(96,199,200,0)}}
|
|
109
|
+
@keyframes ${e}-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-2.5px)}}
|
|
110
|
+
@keyframes ${e}-blink2{0%,90%,100%{transform:scaleY(1)}95%{transform:scaleY(.12)}}
|
|
111
|
+
/* The crescent (#305). No float loop, no drop-shadow glow: those were two of
|
|
112
|
+
the eight effects the launcher stacked at rest, and a control that is loud at
|
|
113
|
+
rest has nothing left to say when a reply is waiting. */
|
|
114
|
+
.${e}-ayca{display:block;width:100%;height:100%;overflow:visible}
|
|
115
|
+
/* THE INVERSION, in two rules. Light ground: navy disc, gradient mark. Ink
|
|
116
|
+
ground: cream disc, navy mark. Nothing else needs to know about grounds. */
|
|
117
|
+
.${e}-av-mark{fill:url(#${e}-av-sweep)}
|
|
118
|
+
.${e}-on-ink .${e}-av-mark{fill:#151D2F}
|
|
119
|
+
/* THE OBJECT INVERTS, not just the mark. Inverting only the fill left a navy
|
|
120
|
+
mark on a navy disc \u2014 invisible, and precisely the failure the rule exists to
|
|
121
|
+
prevent: "a navy pebble on a navy section is a hole with a moon in it". Found
|
|
122
|
+
by looking at it on the dark marketing hero, where the class was correct and
|
|
123
|
+
the result was still nothing. */
|
|
124
|
+
/* The ink variant carries a heavier shadow (it has less to push against) and a
|
|
125
|
+
HAIRLINE of the opposite value. The hairline is what makes a stale ground
|
|
126
|
+
reading survivable: a cream disc that ends up over white is 1.06:1 and
|
|
127
|
+
effectively gone, and the ground under a fixed launcher genuinely changes as
|
|
128
|
+
the reader scrolls. One pixel of navy is enough to keep it an object. */
|
|
129
|
+
.${e}-bubble.${e}-on-ink{background:#FCF7E3;box-shadow:0 8px 24px rgba(0,0,0,.45),0 0 0 1px rgba(21,29,47,.55)}
|
|
130
|
+
.${e}-bubble.${e}-on-ink .${e}-bubble-label{color:#151D2F}
|
|
131
|
+
.${e}-bubble.${e}-on-ink .${e}-bubble-dot{box-shadow:0 0 0 2px #FCF7E3}
|
|
132
|
+
.${e}-eyes{transform-origin:24px 23px;animation:${e}-blink2 5.5s ease-in-out infinite}
|
|
133
|
+
/* The collapsed launcher is a real, recognisable FAB: a circular surface chip
|
|
134
|
+
with a soft shadow and a hairline ring, the animated mascot centred inside.
|
|
135
|
+
Without the chip the mascot floated as a formless gradient blob that did not
|
|
136
|
+
read as "a chat" at all \u2014 the reported "I can't see any chatbox" (#88): the
|
|
137
|
+
widget was mounted and working, just invisible as an affordance. */
|
|
138
|
+
/* Layering: the widget sits ABOVE page content and content-level overlays
|
|
139
|
+
(viewers/drawers, z<=40) but BELOW the app's Radix modals (z-50) \u2014 a dialog
|
|
140
|
+
the user opens must cover the chat, not hide behind it. The old max-int
|
|
141
|
+
z-index put the chat over every modal. */
|
|
142
|
+
/* THE LAUNCHER AT REST IS STILL. It is a navy disc carrying the gradient
|
|
143
|
+
crescent \u2014 the object straddles navy, per the ground rule above \u2014 with one
|
|
144
|
+
shadow to lift it off the page. The gradient RING is gone with the glow and
|
|
145
|
+
the float: the mark already carries the brand, and the ring was a third
|
|
146
|
+
place saying the same thing. #88 ("I can't see any chatbox") is answered by
|
|
147
|
+
the disc's own contrast (navy on white is 16.82:1) and, on a first visit, by
|
|
148
|
+
the named pill below \u2014 a word rather than a puzzle. */
|
|
149
|
+
.${e}-bubble{position:fixed;bottom:18px;${t}:18px;z-index:48;width:56px;height:56px;border:none;border-radius:50%;background:#151D2F;color:#FCF7E3;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:9px;padding:0;box-shadow:0 6px 20px rgba(21,29,47,.22);transition:transform var(--duration-fast,150ms) var(--ease-out),box-shadow var(--duration-fast,150ms) var(--ease-out)}
|
|
150
|
+
/* 26 in 56. The mark was 34 at first and the object read flat \u2014 a disc with a
|
|
151
|
+
shape stamped on it rather than a mark sitting in space. The ratio is the
|
|
152
|
+
richness here, not an effect. */
|
|
153
|
+
.${e}-bubble .${e}-ayca{width:26px;height:26px;transition:transform var(--duration-base,300ms) var(--ease-out)}
|
|
154
|
+
.${e}-bubble:active{transform:translateY(0) scale(.96)}
|
|
155
|
+
/* The first-visit variant: a word, not a puzzle. Collapses to the pebble once
|
|
156
|
+
the reader has opened it. */
|
|
157
|
+
.${e}-bubble-pill{width:auto;height:48px;border-radius:var(--aiw-radius-pill);padding:0 18px 0 14px}
|
|
158
|
+
.${e}-bubble-pill .${e}-ayca{width:22px;height:22px}
|
|
159
|
+
.${e}-bubble-pill .${e}-bubble-label{display:block}
|
|
160
|
+
.${e}-bubble-label{display:none;font:inherit;font-size:var(--aiw-font-md);font-weight:600;white-space:nowrap}
|
|
161
|
+
/* Only TWO of the six states move, which is what makes movement mean
|
|
162
|
+
something again. */
|
|
163
|
+
.${e}-bubble-unread{animation:${e}-pulse var(--duration-slow,420ms) var(--ease-out) 1}
|
|
164
|
+
.${e}-bubble-working .${e}-ayca{animation:${e}-breathe 2.4s var(--ease-in-out) infinite}
|
|
165
|
+
.${e}-bubble-offline{opacity:.72}
|
|
166
|
+
/* A DOT, not the count badge in grey. It reuses the same element, and the
|
|
167
|
+
count's geometry (18px min-width plus 5px of padding, sized for two digits)
|
|
168
|
+
renders an empty string as a wide lozenge \u2014 which reads as a broken badge
|
|
169
|
+
rather than a status light. */
|
|
170
|
+
.${e}-bubble-offline .${e}-bubble-dot{min-width:0;width:10px;height:10px;padding:0;top:4px;background:var(--aiw-muted);box-shadow:0 0 0 2px #151D2F}
|
|
171
|
+
.${e}-bubble-offline.${e}-on-ink .${e}-bubble-dot{box-shadow:0 0 0 2px #FCF7E3}
|
|
172
|
+
.${e}-bubble-parked{width:40px;height:40px;opacity:.6}
|
|
173
|
+
.${e}-bubble-parked .${e}-ayca{width:20px;height:20px}
|
|
174
|
+
/* The unread count and the offline dot \u2014 one badge element, two looks. */
|
|
175
|
+
.${e}-bubble-dot{position:absolute;top:2px;${t==="left"?"right":"left"}:2px;min-width:18px;height:18px;padding:0 5px;border-radius:var(--aiw-radius-pill);background:#FA712D;color:#FCF7E3;font-size:var(--aiw-font-2xs);font-weight:700;line-height:18px;text-align:center;box-shadow:0 0 0 2px #151D2F}
|
|
176
|
+
@keyframes ${e}-breathe{0%,100%{opacity:1}50%{opacity:.55}}
|
|
177
|
+
/* GATED. There was no hover:hover query anywhere in this widget, so on a
|
|
178
|
+
touchscreen the lift-and-scale stuck after the tap. The file already carries
|
|
179
|
+
a correct hover:none block for the per-message actions \u2014 the launcher was
|
|
180
|
+
simply never given the same treatment. Lift only; the scale went with it,
|
|
181
|
+
because a control that grows under the cursor is a third thing saying "I am
|
|
182
|
+
interactive" after the shadow and the pointer. */
|
|
183
|
+
@media (hover: hover) and (pointer: fine){
|
|
184
|
+
.${e}-bubble:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(21,29,47,.3)}
|
|
185
|
+
.${e}-bubble:hover .${e}-ayca{transform:rotate(-12deg)}
|
|
186
|
+
}
|
|
187
|
+
.${e}-bubble-av{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}
|
|
188
|
+
.${e}-av-img{width:100%;height:100%;object-fit:cover;border-radius:50%}
|
|
189
|
+
.${e}-bubble svg{width:26px;height:26px}
|
|
190
|
+
.${e}-panel{position:fixed;bottom:20px;${t}:20px;z-index:48;width:368px;max-width:calc(100vw - 32px);height:540px;max-height:calc(100vh - 40px);background:var(--aiw-surface);color:var(--aiw-text);border-radius:var(--aiw-radius-3xl);box-shadow:0 18px 52px rgba(0,0,0,.32);display:flex;flex-direction:column;overflow:hidden;font-family:system-ui,-apple-system,sans-serif;animation:${e}-rise var(--duration-fast) var(--ease-out);}
|
|
191
|
+
/* NAVY, with the sweep as a 2px rule under it (#305). It was the gradient bar
|
|
192
|
+
itself, which is why the avatar needed an rgba(12,17,30,.55) scrim to survive
|
|
193
|
+
\u2014 a scrim over a gradient is a patch, not a decision. On navy the mark
|
|
194
|
+
inverts by the rule above and the scrim is unnecessary, so it is gone. */
|
|
195
|
+
.${e}-header{background:var(--aiw-header-bg);color:var(--aiw-header-fg);border-bottom:2px solid transparent;border-image:var(--aiw-gradient) 1;padding:12px 14px;display:flex;align-items:center;gap:10px}
|
|
196
|
+
/* Drag-to-reposition. touch-action:none is what makes this work on a
|
|
197
|
+
touchscreen \u2014 without it the browser claims the gesture as a scroll and the
|
|
198
|
+
panel never moves. user-select:none stops the title being selected mid-drag. */
|
|
199
|
+
/* Question card \u2014 the assistant asking the human to decide. Visually distinct
|
|
200
|
+
from a proposal card: this one BLOCKS progress until answered, so it should
|
|
201
|
+
read as something needing you, not as another message. */
|
|
202
|
+
.${e}-question{margin:8px 0;padding:12px;border-radius:var(--aiw-radius-xl);background:var(--aiw-surface-raised);border:1px solid var(--aiw-border);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
203
|
+
.${e}-question-critical{border-color:var(--aiw-danger-text);box-shadow:0 0 0 1px color-mix(in srgb,var(--aiw-danger-text) 25%,transparent)}
|
|
204
|
+
.${e}-question-title{font-size:var(--aiw-font-md);font-weight:600;margin-bottom:4px;color:var(--aiw-text)}
|
|
205
|
+
.${e}-question-ctx{font-size:var(--aiw-font-xs);color:var(--aiw-muted);margin-bottom:8px;line-height:1.45}
|
|
206
|
+
.${e}-question-opts{display:flex;flex-direction:column;gap:6px}
|
|
207
|
+
.${e}-question-opt{display:flex;flex-direction:column;gap:2px;text-align:left;padding:9px 11px;border-radius:var(--aiw-radius-md);border:1px solid var(--aiw-border);background:var(--aiw-surface);color:var(--aiw-text);cursor:pointer;font:inherit;transition:border-color .14s ease,background .14s ease}
|
|
208
|
+
.${e}-question-opt:hover{border-color:var(--aiw-accent);background:var(--aiw-surface-raised)}
|
|
209
|
+
.${e}-question-opt-on{border-color:var(--aiw-accent);background:var(--aiw-surface-raised)}
|
|
210
|
+
.${e}-question-opt-label{font-size:var(--aiw-font-sm);font-weight:600}
|
|
211
|
+
.${e}-question-opt-desc{font-size:var(--aiw-font-xs);color:var(--aiw-muted);line-height:1.4}
|
|
212
|
+
.${e}-question-free{display:flex;gap:6px;margin-top:2px}
|
|
213
|
+
.${e}-question-input{flex:1 1 auto;min-width:0;padding:9px 11px;border-radius:var(--aiw-radius-md);border:1px solid var(--aiw-border);background:var(--aiw-surface);color:var(--aiw-text);font:inherit;font-size:var(--aiw-font-sm)}
|
|
214
|
+
.${e}-question-send{padding:9px 14px;border-radius:var(--aiw-radius-md);border:none;background:var(--aiw-accent);color:var(--aiw-accent-contrast);font:inherit;font-size:var(--aiw-font-sm);font-weight:600;cursor:pointer;margin-top:6px}
|
|
215
|
+
/* A multi-select confirm with nothing picked has nothing to send \u2014 it says so
|
|
216
|
+
rather than looking clickable and doing nothing. */
|
|
217
|
+
.${e}-question-send:disabled{opacity:.5;cursor:not-allowed}
|
|
218
|
+
.${e}-question-err{margin-top:8px;font-size:var(--aiw-font-xs);line-height:1.45;color:var(--aiw-danger-text)}
|
|
219
|
+
/* Answered: collapsed to the decision, so the transcript reads as a
|
|
220
|
+
conversation rather than a dead form. */
|
|
221
|
+
.${e}-question-done{border-style:dashed;opacity:.75}
|
|
222
|
+
.${e}-question-answer{font-size:var(--aiw-font-sm);color:var(--aiw-text-2)}
|
|
223
|
+
.${e}-question-answer::before{content:"\u2713 ";color:var(--aiw-accent-ink)}
|
|
224
|
+
.${e}-draggable{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
|
|
225
|
+
.${e}-draggable:active{cursor:grabbing}
|
|
226
|
+
/* Controls inside the header keep normal behaviour \u2014 the drag handler ignores
|
|
227
|
+
them, and this keeps the cursor honest about that. */
|
|
228
|
+
.${e}-draggable button,.${e}-draggable a{cursor:pointer;touch-action:auto}
|
|
229
|
+
/* Advanced view is a fixed edge-to-edge layout \u2014 dragging is disabled there
|
|
230
|
+
(the pointerdown handler bails), so drop the grab affordance too. */
|
|
231
|
+
.${e}-advanced .${e}-draggable{cursor:default}
|
|
232
|
+
/* Cream disc on the navy header \u2014 the ink half of the inversion. The scrim it
|
|
233
|
+
used to carry is gone; see the header rule. */
|
|
234
|
+
.${e}-avatar{position:relative;width:38px;height:38px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#FCF7E3}
|
|
235
|
+
.${e}-avatar .${e}-ayca{width:34px;height:34px}
|
|
236
|
+
.${e}-hname{display:flex;flex-direction:column;line-height:1.15;min-width:0;flex:1 1 auto}
|
|
237
|
+
.${e}-title{font-weight:700;font-size:var(--aiw-font-lg);letter-spacing:.04em}
|
|
238
|
+
.${e}-sub{font-size:var(--aiw-font-2xs);opacity:.85}
|
|
239
|
+
.${e}-metachip{align-self:flex-start;margin-top:3px;font-size:var(--aiw-font-3xs);font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:1px 6px;border-radius:var(--aiw-radius-sm);background:rgba(255,255,255,.22);color:var(--aiw-accent-contrast);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
|
|
240
|
+
.${e}-close{background:color-mix(in srgb,var(--aiw-header-fg) 15%,transparent);border:none;color:var(--aiw-header-fg);font-size:var(--aiw-font-2xl);line-height:1;width:26px;height:26px;border-radius:var(--aiw-radius-md);cursor:pointer;flex:0 0 auto}
|
|
241
|
+
.${e}-log{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--aiw-bg);scrollbar-width:thin}
|
|
242
|
+
.${e}-log:focus-visible{outline:none}
|
|
243
|
+
.${e}-log::-webkit-scrollbar{width:8px}
|
|
244
|
+
.${e}-log::-webkit-scrollbar-thumb{background:rgba(0,0,0,.18);border-radius:var(--aiw-radius-md)}
|
|
245
|
+
@keyframes ${e}-caret{0%,55%{opacity:.85}55.01%,100%{opacity:0}}
|
|
246
|
+
.${e}-streaming::after{content:"";display:inline-block;width:2px;height:1.05em;margin-left:1px;border-radius:var(--aiw-radius-2xs);background:var(--aiw-accent);vertical-align:-2px;animation:${e}-caret 1.1s steps(1) infinite}
|
|
247
|
+
.${e}-msg{max-width:85%;padding:9px 12px;border-radius:var(--aiw-radius-2xl);font-size:var(--aiw-font-md);line-height:1.45;white-space:pre-wrap;word-break:break-word;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
248
|
+
.${e}-msg.${e}-user{align-self:flex-end;background:var(--aiw-user-bg,color-mix(in srgb,var(--aiw-accent) 76%,${Ei}));color:var(--aiw-user-contrast,#fff);border-bottom-right-radius:4px}
|
|
249
|
+
.${e}-assistant{align-self:flex-start;background:var(--aiw-surface-raised);color:var(--aiw-text);border:1px solid var(--aiw-border);border-bottom-left-radius:4px}
|
|
250
|
+
.${e}-assistant p{margin:0 0 8px}.${e}-assistant>:last-child{margin-bottom:0}
|
|
251
|
+
.${e}-assistant h1,.${e}-assistant h2,.${e}-assistant h3,.${e}-assistant h4{margin:10px 0 6px;font-weight:700;line-height:1.25}
|
|
252
|
+
.${e}-assistant h1{font-size:var(--aiw-font-xl)}.${e}-assistant h2{font-size:var(--aiw-font-xl)}.${e}-assistant h3{font-size:var(--aiw-font-md)}.${e}-assistant h4{font-size:var(--aiw-font-sm)}
|
|
253
|
+
.${e}-assistant ul,.${e}-assistant ol{margin:6px 0;padding-left:20px}
|
|
254
|
+
.${e}-assistant li{line-height:1.45;margin:2px 0}
|
|
255
|
+
.${e}-assistant a{color:var(--aiw-accent-ink);text-decoration:underline;text-underline-offset:2px}
|
|
256
|
+
.${e}-assistant code{background:rgba(0,0,0,.06);border-radius:var(--aiw-radius-sm);padding:1px 5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:var(--aiw-font-xs)}
|
|
257
|
+
.${e}-assistant pre.md-pre{background:#0d1117;color:#e6edf3;border-radius:var(--aiw-radius-lg);padding:10px 12px;overflow:auto;margin:8px 0}
|
|
258
|
+
.${e}-assistant pre.md-pre code{background:none;padding:0;color:inherit;font-size:var(--aiw-font-xs);white-space:pre}
|
|
259
|
+
.${e}-assistant blockquote{margin:8px 0;padding:2px 12px;border-left:3px solid color-mix(in srgb,var(--aiw-accent) 40%,transparent);color:var(--aiw-text-2)}
|
|
260
|
+
.${e}-assistant hr{border:none;border-top:1px solid var(--aiw-border);margin:10px 0}
|
|
261
|
+
.${e}-assistant table.md-table{width:100%;border-collapse:collapse;font-size:var(--aiw-font-xs);margin:8px 0}
|
|
262
|
+
.${e}-assistant table.md-table th{text-align:left;font-weight:700;color:var(--aiw-text-2);border-bottom:1px solid var(--aiw-border);padding:5px 8px}
|
|
263
|
+
.${e}-assistant table.md-table td{border-bottom:1px solid var(--aiw-border-soft);padding:5px 8px}
|
|
264
|
+
.${e}-assistant strong{font-weight:700}.${e}-assistant del{opacity:.7}
|
|
265
|
+
.${e}-widget-host{padding:8px}
|
|
266
|
+
.${e}-typing{align-self:flex-start;display:flex;gap:4px;padding:10px 12px}
|
|
267
|
+
.${e}-typing span{width:7px;height:7px;border-radius:50%;background:var(--aiw-accent);animation:${e}-blink 1.2s infinite}
|
|
268
|
+
.${e}-typing span:nth-child(2){animation-delay:.2s}
|
|
269
|
+
.${e}-typing span:nth-child(3){animation-delay:.4s}
|
|
270
|
+
.${e}-error{align-self:stretch;border:1px solid var(--aiw-danger-border);background:var(--aiw-danger-bg);border-radius:var(--aiw-radius-2xl);padding:11px 12px;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
271
|
+
.${e}-error-text{font-size:var(--aiw-font-sm);font-weight:600;color:var(--aiw-danger-text)}
|
|
272
|
+
.${e}-error-detail{font-size:var(--aiw-font-2xs);color:var(--aiw-danger-text-2);margin-top:3px;word-break:break-word}
|
|
273
|
+
.${e}-error-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
|
|
274
|
+
.${e}-error-btn{border:1px solid var(--aiw-danger-border);background:var(--aiw-surface);color:var(--aiw-danger-text);border-radius:var(--aiw-radius-md);padding:6px 12px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer}
|
|
275
|
+
.${e}-error-retry{background:var(--aiw-accent);border-color:var(--aiw-accent);color:var(--aiw-accent-contrast)}
|
|
276
|
+
.${e}-error-btn:disabled{opacity:.6;cursor:default}
|
|
277
|
+
/* Quality prompt (#299) \u2014 the widget asking, rather than waiting to be told.
|
|
278
|
+
Reads as a quiet aside, not an alert: it must never look like the error card,
|
|
279
|
+
because on a slow-but-good answer nothing has gone wrong. */
|
|
280
|
+
.${e}-quality{align-self:stretch;border:1px solid var(--aiw-border);background:var(--aiw-surface-2);border-radius:var(--aiw-radius-2xl);padding:11px 12px;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
281
|
+
.${e}-quality-title{font-size:var(--aiw-font-xs);font-weight:600;color:var(--aiw-text);line-height:1.35}
|
|
282
|
+
.${e}-quality-row{display:flex;align-items:center;gap:8px;margin-top:9px;flex-wrap:wrap}
|
|
283
|
+
.${e}-quality-reason{flex:1 1 160px;min-width:0;border:1px solid var(--aiw-border);background:var(--aiw-surface);color:var(--aiw-text);border-radius:var(--aiw-radius-md);padding:7px 10px;font:inherit;font-size:var(--aiw-font-xs)}
|
|
284
|
+
.${e}-quality-reason::placeholder{color:var(--aiw-text-3)}
|
|
285
|
+
.${e}-quality-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
|
|
286
|
+
.${e}-quality-send{border:1px solid var(--aiw-accent);background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-radius:var(--aiw-radius-md);padding:6px 12px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer}
|
|
287
|
+
.${e}-quality-send:disabled{opacity:.6;cursor:default}
|
|
288
|
+
.${e}-quality-dismiss{border:1px solid var(--aiw-border);background:var(--aiw-surface);color:var(--aiw-text-2);border-radius:var(--aiw-radius-md);padding:6px 12px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer}
|
|
289
|
+
/* Answered state: the card collapses to a single line of thanks. */
|
|
290
|
+
.${e}-quality-done{font-size:var(--aiw-font-xs);color:var(--aiw-text-2);font-weight:500}
|
|
291
|
+
.${e}-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 0;background:var(--aiw-surface)}
|
|
292
|
+
.${e}-suggestion{border:1px solid color-mix(in srgb,var(--aiw-accent) 20%,transparent);background:color-mix(in srgb,var(--aiw-accent) 5%,transparent);color:var(--aiw-accent-ink);border-radius:var(--aiw-radius-pill);padding:6px 11px;font-size:var(--aiw-font-xs);font-weight:500;line-height:1.2;cursor:pointer;transition:background .15s ease,border-color .15s ease;text-align:left}
|
|
293
|
+
.${e}-suggestion:hover{background:color-mix(in srgb,var(--aiw-accent) 10%,transparent);border-color:color-mix(in srgb,var(--aiw-accent) 40%,transparent)}
|
|
294
|
+
.${e}-form{display:flex;gap:8px;padding:10px;border-top:1px solid var(--aiw-border);background:var(--aiw-surface)}
|
|
295
|
+
.${e}-input{flex:1;background:var(--aiw-surface);color:var(--aiw-text);border:1px solid var(--aiw-border-strong);border-radius:var(--aiw-radius-lg);padding:10px 12px;font-size:var(--aiw-font-md);outline:none}
|
|
296
|
+
.${e}-meter{padding:7px 12px 0;background:var(--aiw-surface)}
|
|
297
|
+
.${e}-meter-bar{height:4px;border-radius:var(--aiw-radius-pill);background:var(--aiw-surface-2);overflow:hidden}
|
|
298
|
+
.${e}-meter-bar>span{display:block;height:100%;width:100%;transform-origin:left;border-radius:var(--aiw-radius-pill);background:linear-gradient(90deg,var(--aiw-accent),#FBAA34);transition:transform var(--duration-base) var(--ease-out)}
|
|
299
|
+
.${e}-meter-row{display:flex;justify-content:space-between;gap:8px;margin-top:3px;font-size:var(--aiw-font-3xs);color:var(--aiw-muted)}
|
|
300
|
+
.${e}-status{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 12px;font-size:var(--aiw-font-2xs);background:var(--aiw-surface);border-top:1px solid var(--aiw-border-soft)}
|
|
301
|
+
.${e}-status-role{display:inline-flex;align-items:center;padding:2px 8px;border-radius:var(--aiw-radius-pill);font-weight:600;color:var(--aiw-accent-ink);background:color-mix(in srgb,var(--aiw-accent) 10%,transparent)}
|
|
302
|
+
.${e}-status-credits{font-weight:600;color:var(--aiw-text-2);font-variant-numeric:tabular-nums}
|
|
303
|
+
.${e}-status-credits-val{display:inline-block;transition:color .2s ease}
|
|
304
|
+
.${e}-credits-live{color:var(--aiw-accent-ink)}
|
|
305
|
+
.${e}-cta{display:flex;justify-content:center;padding:6px 0 2px}
|
|
306
|
+
.${e}-cta-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--aiw-radius-pill);padding:9px 18px;font-size:var(--aiw-font-sm);font-weight:600;color:var(--aiw-accent-contrast);text-decoration:none;background:linear-gradient(90deg,var(--aiw-accent),#FBAA34);box-shadow:0 4px 14px color-mix(in srgb,var(--aiw-accent) 25%,transparent)}
|
|
307
|
+
.${e}-lead{align-self:stretch;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-2xl);padding:11px 12px;background:var(--aiw-surface-raised);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
308
|
+
.${e}-form-title{font-size:var(--aiw-font-sm);font-weight:600;margin-bottom:8px}
|
|
309
|
+
.${e}-lead-form{display:flex;flex-direction:column;gap:8px}
|
|
310
|
+
/* \u2500\u2500 Form controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
311
|
+
Everything the chat can draw as an input goes through ONE token layer
|
|
312
|
+
(--aiw-field-*) instead of its own hexes and radii, and that layer is
|
|
313
|
+
remapped below to the platform's semantic control variables when the host
|
|
314
|
+
page has them. The geometry (40px tall, 12px inline padding, 14px text, a
|
|
315
|
+
recessed inner shadow, a 2px focus ring) MIRRORS the host design system's
|
|
316
|
+
input.tsx \u2014 the widget is vanilla DOM in a detached root and cannot import
|
|
317
|
+
the React primitive, so the numbers are copied deliberately; that file is the
|
|
318
|
+
source of truth if they ever move. */
|
|
319
|
+
.${e}-bubble,.${e}-panel{--aiw-field-bg:var(--aiw-surface);--aiw-field-fg:var(--aiw-text);--aiw-field-border:var(--aiw-border-strong);--aiw-field-placeholder:var(--aiw-muted);--aiw-field-ring:var(--aiw-accent);--aiw-field-ring-fg:var(--aiw-accent-contrast);--aiw-field-radius:10px}
|
|
320
|
+
/* Host-token mode. Added at mount only when the page really defines our
|
|
321
|
+
variables, so a customer site that happens to own an --input cannot repaint
|
|
322
|
+
the chat's controls. Values stay as var() references, never snapshots, so the
|
|
323
|
+
app's dark-mode class keeps driving them after mount. */
|
|
324
|
+
.${e}-bubble.${e}-host-tokens,.${e}-panel.${e}-host-tokens{--aiw-field-bg:hsl(var(--card));--aiw-field-fg:hsl(var(--foreground));--aiw-field-border:hsl(var(--input));--aiw-field-placeholder:hsl(var(--muted-foreground));--aiw-field-ring:hsl(var(--ring));--aiw-field-ring-fg:hsl(var(--primary-foreground));--aiw-field-radius:calc(var(--radius) - 2px)}
|
|
325
|
+
.${e}-field{width:100%;box-sizing:border-box;min-height:40px;padding:8px 12px;font-family:inherit;font-size:var(--aiw-font-md);line-height:1.45;color:var(--aiw-field-fg);background:var(--aiw-field-bg);border:1px solid var(--aiw-field-border);border-radius:var(--aiw-field-radius);outline:none;box-shadow:inset 0 1px 2px 0 color-mix(in srgb,var(--aiw-field-fg) 5%,transparent);transition:border-color .15s ease,box-shadow .15s ease}
|
|
326
|
+
.${e}-field::placeholder{color:var(--aiw-field-placeholder);opacity:1}
|
|
327
|
+
.${e}-field:hover:not(:disabled){border-color:color-mix(in srgb,var(--aiw-field-border) 70%,var(--aiw-field-fg))}
|
|
328
|
+
.${e}-field:focus{border-color:var(--aiw-field-ring);box-shadow:0 0 0 2px var(--aiw-field-ring)}
|
|
329
|
+
.${e}-field:disabled{opacity:.5;cursor:not-allowed}
|
|
330
|
+
textarea.${e}-field{min-height:76px;resize:vertical}
|
|
331
|
+
/* The native select arrow is drawn by the OS and ignores our palette \u2014 in dark
|
|
332
|
+
mode it renders a black-on-dark wedge. Draw our own instead. */
|
|
333
|
+
select.${e}-field{appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:32px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:15px}
|
|
334
|
+
/* Options are drawn by the OS popup, which does NOT inherit the panel \u2014 without
|
|
335
|
+
this a dark-mode select opens as black text on a black list. */
|
|
336
|
+
.${e}-field option{background:var(--aiw-field-bg);color:var(--aiw-field-fg)}
|
|
337
|
+
.${e}-field-group{display:flex;flex-direction:column;gap:6px}
|
|
338
|
+
/* "This is the field that's holding you up." An outline rather than a border so
|
|
339
|
+
it lands the same on a bare input, a checkbox row and a radio GROUP \u2014 the
|
|
340
|
+
three shapes buildField can hand back. */
|
|
341
|
+
.${e}-field-invalid{outline:1px solid var(--aiw-danger-text);outline-offset:2px;border-radius:var(--aiw-field-radius)}
|
|
342
|
+
.${e}-form-err,.${e}-proposal-err{font-size:var(--aiw-font-xs);line-height:1.45;color:var(--aiw-danger-text)}
|
|
343
|
+
.${e}-field-check{display:flex;align-items:center;gap:8px;font-size:var(--aiw-font-sm);line-height:1.4;color:var(--aiw-field-fg);cursor:pointer}
|
|
344
|
+
.${e}-field-check-label{min-width:0}
|
|
345
|
+
.${e}-check{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;width:16px;height:16px;margin:0;box-sizing:border-box;background:var(--aiw-field-bg);border:1px solid var(--aiw-field-border);border-radius:var(--aiw-radius-xs);cursor:pointer;outline:none;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}
|
|
346
|
+
.${e}-check[type=radio]{border-radius:50%}
|
|
347
|
+
.${e}-check:hover:not(:disabled){border-color:color-mix(in srgb,var(--aiw-field-border) 70%,var(--aiw-field-fg))}
|
|
348
|
+
.${e}-check:focus-visible{border-color:var(--aiw-field-ring);box-shadow:0 0 0 2px var(--aiw-field-ring)}
|
|
349
|
+
.${e}-check:checked{background:var(--aiw-field-ring);border-color:var(--aiw-field-ring)}
|
|
350
|
+
/* Tick + dot are drawn from borders rather than a glyph so they scale with the
|
|
351
|
+
box and take the accent's contrast colour in both schemes. */
|
|
352
|
+
.${e}-check[type=checkbox]:checked::after{content:"";position:absolute;left:4.5px;top:1.5px;width:4px;height:8px;border:solid var(--aiw-field-ring-fg);border-width:0 2px 2px 0;transform:rotate(45deg)}
|
|
353
|
+
.${e}-check[type=radio]:checked::after{content:"";position:absolute;left:3.5px;top:3.5px;width:7px;height:7px;border-radius:50%;background:var(--aiw-field-ring-fg)}
|
|
354
|
+
.${e}-check:disabled{opacity:.5;cursor:not-allowed}
|
|
355
|
+
.${e}-lead-btn{border:none;background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-radius:var(--aiw-radius-lg);padding:10px 16px;font-size:var(--aiw-font-md);font-weight:600;cursor:pointer}
|
|
356
|
+
.${e}-lead-btn:disabled{opacity:.6;cursor:default}
|
|
357
|
+
.${e}-lead-ok{font-size:var(--aiw-font-sm);font-weight:600;color:var(--aiw-accent-ink)}
|
|
358
|
+
.${e}-input:focus{border-color:var(--aiw-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--aiw-accent) 13%,transparent)}
|
|
359
|
+
.${e}-send{border:none;background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-radius:var(--aiw-radius-lg);padding:0 16px;font-size:var(--aiw-font-md);font-weight:600;cursor:pointer}
|
|
360
|
+
.${e}-send:disabled{opacity:.5;cursor:default}
|
|
361
|
+
.${e}-attach{flex:0 0 auto;display:flex;align-items:center;justify-content:center;border:1px solid var(--aiw-border-strong);background:var(--aiw-surface);border-radius:var(--aiw-radius-lg);width:38px;line-height:1;cursor:pointer;color:var(--aiw-text-2);transition:border-color .12s,color .12s,background .12s}
|
|
362
|
+
.${e}-attach:hover{border-color:var(--aiw-accent);color:var(--aiw-accent-ink)}
|
|
363
|
+
.${e}-attach:disabled{opacity:.5;cursor:default}
|
|
364
|
+
.${e}-attbar{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 0;background:var(--aiw-surface)}
|
|
365
|
+
.${e}-artifacts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 10px 0;background:var(--aiw-surface)}
|
|
366
|
+
.${e}-artifacts-title{font-size:var(--aiw-font-2xs);font-weight:600;color:var(--aiw-muted)}
|
|
367
|
+
.${e}-artifact{display:inline-flex;align-items:center;gap:6px;max-width:200px;border:1px solid var(--aiw-border);background:var(--aiw-surface-2);border-radius:var(--aiw-radius-md);padding:3px 8px;font-size:var(--aiw-font-2xs);color:var(--aiw-text-2);white-space:nowrap}
|
|
368
|
+
.${e}-artifact-name{overflow:hidden;text-overflow:ellipsis;max-width:130px}
|
|
369
|
+
.${e}-artifact-save{border:none;background:transparent;color:#0b6cff;font-size:var(--aiw-font-2xs);font-weight:600;cursor:pointer;padding:0}
|
|
370
|
+
.${e}-artifact-save:disabled{color:var(--aiw-muted);cursor:default}
|
|
371
|
+
.${e}-att{display:inline-flex;align-items:center;gap:5px;max-width:180px;border:1px solid var(--aiw-border);background:var(--aiw-surface-2);border-radius:var(--aiw-radius-md);padding:3px 8px;font-size:var(--aiw-font-xs);color:var(--aiw-text-2);white-space:nowrap}
|
|
372
|
+
.${e}-att>span{overflow:hidden;text-overflow:ellipsis}
|
|
373
|
+
.${e}-atts{display:flex;flex-wrap:wrap;gap:6px;max-width:92%}
|
|
374
|
+
.${e}-atts.${e}-user{align-self:flex-end;justify-content:flex-end}
|
|
375
|
+
.${e}-att-x{border:none;background:transparent;color:var(--aiw-muted);font-size:var(--aiw-font-lg);line-height:1;cursor:pointer;padding:0 0 0 2px}
|
|
376
|
+
.${e}-att-x:hover{color:#e11}
|
|
377
|
+
.${e}-att-err{border-color:var(--aiw-danger-border);background:var(--aiw-danger-bg);color:var(--aiw-danger-text)}
|
|
378
|
+
.${e}-msgactions{display:inline-flex;align-items:center;gap:6px;margin-top:3px;color:var(--aiw-muted);opacity:.55;transition:opacity .15s ease}
|
|
379
|
+
.${e}-msgactions:hover,.${e}-msgactions:focus-within{opacity:1}
|
|
380
|
+
/* User edit sits at the message's bottom-RIGHT, hugging the bubble edge, and is
|
|
381
|
+
HIDDEN until the user hovers their message (or the row/button itself) \u2014 an
|
|
382
|
+
always-visible bordered pencil floating under every user turn read as a stray
|
|
383
|
+
box. Its row is the immediate next sibling of the user bubble, so a hover-plus
|
|
384
|
+
sibling selector reveals it; the row's own :hover/:focus-within keeps it up
|
|
385
|
+
while you reach the
|
|
386
|
+
button across the small gap. Higher specificity than the base .msgactions:hover
|
|
387
|
+
rule so it wins the cascade. */
|
|
388
|
+
.${e}-msgactions.${e}-user{align-self:flex-end;justify-content:flex-end;padding-right:2px;opacity:0}
|
|
389
|
+
.${e}-msg.${e}-user:hover + .${e}-msgactions.${e}-user,.${e}-msgactions.${e}-user:hover,.${e}-msgactions.${e}-user:focus-within{opacity:1}
|
|
390
|
+
/* HOVER IS NOT A UNIVERSAL INPUT. On a touch device there is no hover state
|
|
391
|
+
to enter, so opacity 0 revealed only on hover meant Edit and Copy did not
|
|
392
|
+
EXIST on a phone \u2014 the widget's mobile layout is a full-screen sheet, i.e.
|
|
393
|
+
the case where they matter most. hover:none is the honest test (it asks
|
|
394
|
+
what the primary pointer can do, not how wide the screen is), and the
|
|
395
|
+
answer there is: always visible, just quiet.
|
|
396
|
+
NOTE: this whole sheet is a JS template literal, so no backticks. */
|
|
397
|
+
@media (hover:none){
|
|
398
|
+
.${e}-msgactions.${e}-user{opacity:.75}
|
|
399
|
+
}
|
|
400
|
+
.${e}-msgactions.${e}-assistant{align-self:flex-start}
|
|
401
|
+
.${e}-msgact{display:inline-flex;align-items:center;gap:4px;border:none;background:transparent;color:inherit;border-radius:var(--aiw-radius-sm);padding:2px 5px;font-size:var(--aiw-font-2xs);font-weight:500;cursor:pointer;line-height:1}
|
|
402
|
+
.${e}-msgact:hover{color:var(--aiw-accent-ink);background:color-mix(in srgb,var(--aiw-accent) 7%,transparent)}
|
|
403
|
+
/* Icon-only variant (edit) \u2014 a small, quiet chip (subtle surface + border) that
|
|
404
|
+
is revealed on message hover, then tints ACCENT (not a hard white-on-accent
|
|
405
|
+
fill) on its own hover so it reads as an affordance, not a loud button. */
|
|
406
|
+
.${e}-msgact-icon{padding:5px;border-radius:var(--aiw-radius-md);color:var(--aiw-muted);background:color-mix(in srgb,var(--aiw-surface) 92%,transparent);border:1px solid var(--aiw-border);transition:color .15s ease,background .15s ease,border-color .15s ease}
|
|
407
|
+
.${e}-msgact-icon:hover{color:var(--aiw-accent-ink);background:color-mix(in srgb,var(--aiw-accent) 12%,transparent);border-color:color-mix(in srgb,var(--aiw-accent) 45%,transparent)}
|
|
408
|
+
.${e}-msgact-icon svg{width:15px;height:15px}
|
|
409
|
+
/* Per-message vote (thumbs) \u2014 light icon buttons; the chosen vote stays lit. */
|
|
410
|
+
/* \u2500\u2500 Accessibility floor (#308) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
411
|
+
ONE focus rule for all 40 buttons, on a base class every one of them carries.
|
|
412
|
+
Nothing in this sheet ever REMOVED a button's ring \u2014 there is no outline:none
|
|
413
|
+
on one \u2014 so this was never a keyboard trap. It is that the ring was never
|
|
414
|
+
designed and never measured against a surface the host is explicitly allowed
|
|
415
|
+
to repaint (the theme option), and "whatever the UA draws" is not an answer we can
|
|
416
|
+
ship to a third party once the widget is public (#306).
|
|
417
|
+
|
|
418
|
+
Two-toned so it holds on ANY ground: the accent fills the offset gap and a
|
|
419
|
+
fixed dark ring sits outside it, so the pair cannot vanish into either a
|
|
420
|
+
light or a dark panel. Same construction the design house prescribes for a
|
|
421
|
+
brand ring that fails on one theme. */
|
|
422
|
+
.${e}-btn:focus-visible{outline:2px solid var(--aiw-accent);outline-offset:2px;box-shadow:0 0 0 4px #151D2F}
|
|
423
|
+
/* A hit area of at least 24x24 (WCAG 2.2 AA) WITHOUT changing the drawn size \u2014
|
|
424
|
+
a transparent ::before costs nothing visually, so a 20px vote button and a
|
|
425
|
+
6px carousel dot stay exactly as designed.
|
|
426
|
+
|
|
427
|
+
The GAPS below grow with them, and that is not cosmetic. WCAG's spacing
|
|
428
|
+
exception only holds when a 24px circle centred on each target does not
|
|
429
|
+
intersect its neighbour's, so the gap has to put the CENTRES 24px apart.
|
|
430
|
+
Enlarging a hit area without doing that just makes two controls fight over
|
|
431
|
+
the same pixels, which is worse than the small target was. */
|
|
432
|
+
.${e}-tap::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:24px;height:24px}
|
|
433
|
+
/* 20px drawn + 4px gap = centres 24px apart. */
|
|
434
|
+
.${e}-votes{display:inline-flex;align-items:center;gap:4px}
|
|
435
|
+
/* 20x20 drawn (14px icon + 3px padding); the .-tap ::before takes the TARGET
|
|
436
|
+
to 24x24. The chat-quality control (#299) being the smallest thing in the
|
|
437
|
+
widget was the sharpest finding in the audit. */
|
|
438
|
+
.${e}-vote{position:relative;padding:3px;border-radius:var(--aiw-radius-sm);color:var(--aiw-muted);background:transparent}
|
|
439
|
+
.${e}-vote::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:24px;height:24px}
|
|
440
|
+
.${e}-vote:hover{color:var(--aiw-accent-ink);background:color-mix(in srgb,var(--aiw-accent) 10%,transparent)}
|
|
441
|
+
.${e}-vote-on{color:var(--aiw-accent-ink)}
|
|
442
|
+
.${e}-vote svg{width:14px;height:14px;display:block}
|
|
443
|
+
.${e}-branchnav{display:inline-flex;align-items:center;gap:2px;color:inherit;font-variant-numeric:tabular-nums}
|
|
444
|
+
.${e}-branch-btn{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:inherit;border-radius:var(--aiw-radius-sm);padding:2px;cursor:pointer;line-height:1}
|
|
445
|
+
.${e}-branch-btn:hover:not(:disabled){color:var(--aiw-accent-ink)}
|
|
446
|
+
.${e}-branch-btn:disabled{opacity:.35;cursor:default}
|
|
447
|
+
.${e}-branch-count{font-size:var(--aiw-font-2xs);padding:0 2px}
|
|
448
|
+
.${e}-edit{display:flex;flex-direction:column;gap:6px;max-width:94%;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
449
|
+
.${e}-edit.${e}-user{align-self:stretch}
|
|
450
|
+
/* Edit mode keeps the USER BUBBLE look (same fill + radius), so clicking edit
|
|
451
|
+
doesn't swap the message for a different-looking box \u2014 just a subtle focus
|
|
452
|
+
ring, matching the inline-edit request. */
|
|
453
|
+
.${e}-edit-input{width:100%;background:color-mix(in srgb,var(--aiw-accent) 76%,#04191b);color:#fff;caret-color:#fff;box-sizing:border-box;border:1.5px solid transparent;border-radius:var(--aiw-radius-2xl);padding:9px 12px;font-size:var(--aiw-font-md);line-height:1.45;font-family:inherit;resize:none;outline:none;transition:border-color .15s ease,box-shadow .15s ease}
|
|
454
|
+
.${e}-edit-input::placeholder{color:rgba(255,255,255,.6)}
|
|
455
|
+
.${e}-edit-input:focus{border-color:rgba(255,255,255,.55);box-shadow:0 0 0 3px color-mix(in srgb,var(--aiw-accent) 28%,transparent)}
|
|
456
|
+
.${e}-edit-actions{display:flex;justify-content:flex-end;gap:6px}
|
|
457
|
+
.${e}-edit-cancel{border:none;background:transparent;color:var(--aiw-muted);border-radius:var(--aiw-radius-pill);padding:5px 11px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer}
|
|
458
|
+
.${e}-edit-cancel:hover{background:var(--aiw-surface-2)}
|
|
459
|
+
.${e}-edit-save{border:none;background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-radius:var(--aiw-radius-pill);padding:5px 13px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer}
|
|
460
|
+
.${e}-edit-save:hover{opacity:.92}
|
|
461
|
+
.${e}-hactions{display:flex;align-items:center;gap:4px;flex:0 0 auto}
|
|
462
|
+
.${e}-icon{background:color-mix(in srgb,var(--aiw-header-fg) 15%,transparent);border:none;color:var(--aiw-header-fg);width:26px;height:26px;border-radius:var(--aiw-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
|
|
463
|
+
.${e}-icon:hover{background:color-mix(in srgb,var(--aiw-header-fg) 28%,transparent)}
|
|
464
|
+
.${e}-icon-on{background:var(--aiw-header-fg);color:var(--aiw-header-bg)}
|
|
465
|
+
.${e}-icon-on:hover{background:var(--aiw-header-fg)}
|
|
466
|
+
.${e}-morewrap{position:relative;display:inline-flex}
|
|
467
|
+
.${e}-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:6;display:flex;flex-direction:column;min-width:212px;padding:6px;background:var(--aiw-surface-raised);color:var(--aiw-text);border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-xl);box-shadow:0 12px 34px rgba(15,23,42,.18);
|
|
468
|
+
/* A TRANSITION, not a keyframe, and anchored at the trigger (#309). It was
|
|
469
|
+
an entrance KEYFRAME with no transform-origin, so it grew from its own centre
|
|
470
|
+
instead of from the button that opened it \u2014 and because keyframes RESTART
|
|
471
|
+
while transitions RETARGET, a fast open-close-open stuttered. It stays in the
|
|
472
|
+
DOM (display was toggled), which is exactly the rapidly-retriggered case
|
|
473
|
+
house law names.
|
|
474
|
+
visibility rather than display because display is not animatable; it
|
|
475
|
+
flips discretely at the end of the transition, which is what keeps a closed
|
|
476
|
+
menu out of the tab order. */
|
|
477
|
+
transform-origin:top right;transform:translateY(-4px) scale(.98);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}
|
|
478
|
+
.${e}-menu-open{transform:none;opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
|
|
479
|
+
.${e}-menu::before{content:"";position:absolute;top:-5px;right:14px;width:10px;height:10px;background:var(--aiw-surface-raised);border-left:1px solid var(--aiw-border);border-top:1px solid var(--aiw-border);transform:rotate(45deg)}
|
|
480
|
+
.${e}-menu-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:none;background:transparent;color:var(--aiw-text-2);border-radius:var(--aiw-radius-md);padding:9px 10px;font-size:var(--aiw-font-sm);font-weight:500;cursor:pointer;line-height:1.2}
|
|
481
|
+
.${e}-menu-item:hover{background:color-mix(in srgb,var(--aiw-accent) 7%,transparent);color:var(--aiw-accent-ink)}
|
|
482
|
+
.${e}-menu-item:disabled{opacity:.5;cursor:default}
|
|
483
|
+
.${e}-menu-ico{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;color:var(--aiw-text-2)}
|
|
484
|
+
.${e}-menu-item:hover .${e}-menu-ico,.${e}-menu-item-on .${e}-menu-ico{color:var(--aiw-accent-ink)}
|
|
485
|
+
.${e}-menu-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
486
|
+
.${e}-menu-state{flex:0 0 auto;font-size:var(--aiw-font-3xs);font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--aiw-muted);background:var(--aiw-surface-2);border-radius:var(--aiw-radius-pill);padding:2px 7px}
|
|
487
|
+
.${e}-menu-item-on .${e}-menu-state{color:var(--aiw-accent-contrast);background:var(--aiw-accent)}
|
|
488
|
+
.${e}-autonav{align-self:flex-start;display:inline-flex;align-items:center;gap:7px;border:1px solid color-mix(in srgb,var(--aiw-accent) 20%,transparent);background:color-mix(in srgb,var(--aiw-accent) 6%,transparent);color:var(--aiw-accent-ink);border-radius:var(--aiw-radius-lg);padding:8px 12px;font-size:var(--aiw-font-sm);font-weight:600;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
489
|
+
.${e}-expanded{width:min(760px,calc(100vw - 32px));height:calc(100vh - 40px)}
|
|
490
|
+
.${e}-expanded .${e}-msg{max-width:min(75%,62ch)}
|
|
491
|
+
/* Advanced view \u2014 chat column + drivable app pane. The chat column always wraps
|
|
492
|
+
the chat (fills the panel in normal mode); the pane only shows in advanced. */
|
|
493
|
+
.${e}-chatcol{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;min-width:0;height:100%}
|
|
494
|
+
.${e}-pane{display:none;flex-direction:column;min-width:0;min-height:0;background:var(--aiw-bg)}
|
|
495
|
+
.${e}-advbtn-on{background:rgba(255,255,255,.34)}
|
|
496
|
+
/* Advanced view IS the wide view (owns the screen), so the plain "wide" toggle
|
|
497
|
+
is redundant here \u2014 hide it and leave advanced/exit + close. */
|
|
498
|
+
.${e}-advanced .${e}-expand{display:none}
|
|
499
|
+
/* Fullscreen toggle only makes sense in advanced view \u2014 hidden otherwise. */
|
|
500
|
+
.${e}-fullbtn{display:none}
|
|
501
|
+
.${e}-advanced .${e}-fullbtn{display:flex}
|
|
502
|
+
.${e}-advanced{width:calc(100vw - 40px);max-width:1240px;height:calc(100vh - 40px);flex-direction:row;align-items:stretch}
|
|
503
|
+
/* Fullscreen: drop the inset margins, width cap and radius so advanced view
|
|
504
|
+
fills the whole viewport edge-to-edge. Two classes \u2192 wins over .advanced. */
|
|
505
|
+
.${e}-advanced.${e}-advanced-full{inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;border-radius:0}
|
|
506
|
+
.${e}-advanced .${e}-chatcol{flex:0 0 var(--aiw-chatw,400px);min-width:320px;border-right:1px solid var(--aiw-border)}
|
|
507
|
+
.${e}-advanced .${e}-pane{display:flex;flex:1 1 auto}
|
|
508
|
+
.${e}-advanced.${e}-pane-collapsed .${e}-chatcol{flex:1 1 auto;min-width:0;max-width:none;border-right:0}
|
|
509
|
+
/* Draggable divider between chat + app pane. Hidden unless advanced & expanded.
|
|
510
|
+
A thin bar with a wider invisible hit-area; brightens on hover/drag. */
|
|
511
|
+
.${e}-resizer{display:none}
|
|
512
|
+
.${e}-advanced .${e}-resizer{display:block;flex:0 0 6px;align-self:stretch;cursor:col-resize;background:var(--aiw-border);touch-action:none;position:relative;transition:background .15s}
|
|
513
|
+
.${e}-advanced .${e}-resizer::after{content:"";position:absolute;top:0;bottom:0;left:-4px;right:-4px}
|
|
514
|
+
.${e}-advanced .${e}-resizer:hover,.${e}-resizing .${e}-resizer{background:var(--aiw-accent,#6366f1)}
|
|
515
|
+
.${e}-advanced.${e}-pane-collapsed .${e}-resizer{display:none}
|
|
516
|
+
/* While dragging: kill text selection + let pointer events pass over the iframe
|
|
517
|
+
(an iframe would otherwise swallow the drag and drop the pointer). */
|
|
518
|
+
.${e}-resizing{user-select:none}
|
|
519
|
+
.${e}-resizing .${e}-pane-frame{pointer-events:none}
|
|
520
|
+
/* Collapsed: the pane shrinks to a thin strip that still shows the toggle (so it
|
|
521
|
+
can be re-opened), and its url + framed body hide. */
|
|
522
|
+
.${e}-advanced.${e}-pane-collapsed .${e}-pane{flex:0 0 40px;min-height:0}
|
|
523
|
+
.${e}-pane-collapsed .${e}-pane-body{display:none}
|
|
524
|
+
.${e}-pane-collapsed .${e}-pane-url{display:none}
|
|
525
|
+
.${e}-pane-collapsed .${e}-pane-bar{padding:6px 5px}
|
|
526
|
+
.${e}-pane-collapsed .${e}-pane-collapse{transform:rotate(180deg)}
|
|
527
|
+
.${e}-pane-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--aiw-border);background:var(--aiw-surface-2);flex:0 0 auto}
|
|
528
|
+
.${e}-pane-url{font-size:var(--aiw-font-2xs);color:var(--aiw-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
|
|
529
|
+
/* Padded gutter around the driven app so it reads as an inset "screen". */
|
|
530
|
+
.${e}-pane-body{flex:1 1 auto;min-width:0;min-height:0;display:flex;padding:12px}
|
|
531
|
+
.${e}-pane-frame{flex:1 1 auto;width:100%;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-xl);background:var(--aiw-surface);min-height:0;box-shadow:0 1px 4px rgba(15,23,42,.07)}
|
|
532
|
+
/* Narrow: stack the app pane on top and the chat (with composer) below. */
|
|
533
|
+
@media (max-width:820px){
|
|
534
|
+
.${e}-advanced{flex-direction:column-reverse}
|
|
535
|
+
.${e}-advanced .${e}-chatcol{flex:1 1 auto;min-width:0;max-width:none;border-right:0;border-top:1px solid var(--aiw-border)}
|
|
536
|
+
.${e}-advanced .${e}-pane{flex:1 1 auto;min-height:38%}
|
|
537
|
+
/* Stacked layout: the horizontal divider doesn't apply. */
|
|
538
|
+
.${e}-advanced .${e}-resizer{display:none}
|
|
539
|
+
.${e}-pane-body{padding:8px}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.${e}-history{position:absolute;inset:0;background:var(--aiw-surface);display:flex;flex-direction:column;z-index:5;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
543
|
+
.${e}-history-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--aiw-border);font-weight:600;font-size:var(--aiw-font-md)}
|
|
544
|
+
.${e}-history-back{border:1px solid var(--aiw-border-strong);background:var(--aiw-surface-raised);border-radius:var(--aiw-radius-md);padding:5px 11px;font-size:var(--aiw-font-xs);font-weight:600;cursor:pointer;color:var(--aiw-text-2)}
|
|
545
|
+
.${e}-history-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:4px;font-size:var(--aiw-font-sm);color:var(--aiw-text-2)}
|
|
546
|
+
.${e}-history-sep{padding:8px 4px 2px;font-size:var(--aiw-font-3xs);font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--aiw-muted)}
|
|
547
|
+
.${e}-history-item{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;border:1px solid var(--aiw-border);background:var(--aiw-surface-raised);border-radius:var(--aiw-radius-lg);padding:10px 12px;cursor:pointer;width:100%}
|
|
548
|
+
.${e}-history-item:hover{border-color:var(--aiw-accent);background:color-mix(in srgb,var(--aiw-accent) 4%,transparent)}
|
|
549
|
+
.${e}-history-title{font-weight:600;color:var(--aiw-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
550
|
+
.${e}-history-date{font-size:var(--aiw-font-2xs);color:var(--aiw-muted);flex:0 0 auto}
|
|
551
|
+
.${e}-history-star{font-size:var(--aiw-font-lg);line-height:1;color:#cbcbcb;flex:0 0 auto;padding:0 2px;cursor:pointer}
|
|
552
|
+
.${e}-history-star:hover{color:#f59e0b}
|
|
553
|
+
.${e}-widget{align-self:stretch;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-2xl);padding:12px;background:var(--aiw-surface-raised);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
554
|
+
.${e}-widget-title{font-size:var(--aiw-font-xs);font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--aiw-muted);margin-bottom:8px}
|
|
555
|
+
.${e}-widget-stat{font-size:var(--aiw-font-3xl);font-weight:800;line-height:1.1;color:var(--aiw-text)}
|
|
556
|
+
.${e}-widget-cap{font-size:var(--aiw-font-sm);color:var(--aiw-text-2);margin-top:2px}
|
|
557
|
+
.${e}-widget-delta{font-size:var(--aiw-font-xs);font-weight:600;color:var(--aiw-accent-ink);margin-top:4px}
|
|
558
|
+
.${e}-widget-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}
|
|
559
|
+
/* Composed UI cards ([[ui:\u2026]]) \u2014 tiles the assistant lays out itself. */
|
|
560
|
+
.${e}-ui{align-self:stretch;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-2xl);padding:12px;background:var(--aiw-surface-raised);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
561
|
+
.${e}-ui-title{font-size:var(--aiw-font-xs);font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--aiw-muted);margin-bottom:6px}
|
|
562
|
+
.${e}-ui-cap{font-size:var(--aiw-font-sm);color:var(--aiw-text-2);margin-bottom:10px}
|
|
563
|
+
/* A strip SCROLLS rather than shrinking its tiles: squeezing eight scenes into
|
|
564
|
+
a 340px panel makes every one of them too small to judge, which defeats the
|
|
565
|
+
point of showing them. Snap points keep the scroll landing on whole tiles. */
|
|
566
|
+
.${e}-ui-strip{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px;-webkit-overflow-scrolling:touch}
|
|
567
|
+
.${e}-ui-strip>.${e}-ui-tile{flex:0 0 132px;scroll-snap-align:start}
|
|
568
|
+
/* Carousel: one item at a time. The track is the same tile row, translated. */
|
|
569
|
+
/* ONE number governs the carousel's geometry, because the controls have to be
|
|
570
|
+
anchored to the MEDIA and nothing else knows how tall that is.
|
|
571
|
+
Two real defects came from not having it: a 9:16 scene box computed from the
|
|
572
|
+
panel width was 558px tall in a 368px panel \u2014 one empty scene taller than the
|
|
573
|
+
whole visible chat, with the paging pushed off screen \u2014 and the dots, pinned
|
|
574
|
+
to the card's BOTTOM, painted over the caption instead of over the picture. */
|
|
575
|
+
.${e}-ui-carousel{position:relative;--aiw-cmedia:min(38vh,300px)}
|
|
576
|
+
/* Height leads, width follows from the aspect \u2014 so a portrait scene stays
|
|
577
|
+
portrait instead of being letterboxed or cropped to fit a cap. */
|
|
578
|
+
.${e}-ui-carousel .${e}-ui-media{height:var(--aiw-cmedia);width:auto;max-width:100%;margin:0 auto}
|
|
579
|
+
.${e}-ui-carousel-stage{position:relative;overflow:hidden;border-radius:var(--aiw-radius-lg)}
|
|
580
|
+
.${e}-ui-carousel .${e}-ui-items{display:flex;gap:0;transition:transform .25s ease;overflow:visible}
|
|
581
|
+
.${e}-ui-carousel .${e}-ui-tile{flex:0 0 100%;min-width:100%}
|
|
582
|
+
.${e}-ui-arrow{position:absolute;top:calc(var(--aiw-cmedia) / 2 - 15px);z-index:2;display:flex;height:30px;width:30px;align-items:center;justify-content:center;border:0;border-radius:var(--aiw-radius-pill);background:rgba(0,0,0,.5);color:#fff;font-size:var(--aiw-font-lg);line-height:1;cursor:pointer}
|
|
583
|
+
.${e}-ui-arrow:hover{background:rgba(0,0,0,.7)}
|
|
584
|
+
.${e}-ui-arrow-left{left:6px}
|
|
585
|
+
.${e}-ui-arrow-right{right:6px}
|
|
586
|
+
.${e}-ui-counter{position:absolute;right:8px;top:8px;z-index:2;padding:2px 8px;border-radius:var(--aiw-radius-pill);background:rgba(0,0,0,.55);color:#fff;font-size:var(--aiw-font-3xs);font-weight:700}
|
|
587
|
+
/* gap 5px -> 18px: 6px dots with 18px between them put the centres 24px apart,
|
|
588
|
+
which is what the WCAG 2.2 spacing exception actually requires (#308). */
|
|
589
|
+
.${e}-ui-dots{position:absolute;left:0;right:0;top:calc(var(--aiw-cmedia) - 14px);bottom:auto;z-index:2;display:flex;justify-content:center;gap:18px}
|
|
590
|
+
/* 6x6 drawn, real <button>s. Same treatment: the dot stays 6px, the target is 24. */
|
|
591
|
+
.${e}-ui-dot{position:relative;height:6px;width:6px;padding:0;border:0;border-radius:var(--aiw-radius-pill);background:rgba(255,255,255,.55);cursor:pointer}
|
|
592
|
+
.${e}-ui-dot::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:24px;height:24px}
|
|
593
|
+
/* The active dot widens to a pill. NO transition on that width (#309): house
|
|
594
|
+
law allows transform and opacity, and scaleX on a 6px circle distorts the
|
|
595
|
+
round cap into an ellipse \u2014 so the honest answer is to change instantly
|
|
596
|
+
rather than animate the wrong property or fake it with the right one. */
|
|
597
|
+
.${e}-ui-dot-on{width:16px;background:#fff}
|
|
598
|
+
.${e}-ui-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
|
|
599
|
+
.${e}-ui-list{display:flex;flex-direction:column;gap:8px}
|
|
600
|
+
.${e}-ui-list>.${e}-ui-tile{display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:start}
|
|
601
|
+
.${e}-ui-list .${e}-ui-media{grid-row:span 3}
|
|
602
|
+
.${e}-ui-media{position:relative;aspect-ratio:1;border-radius:var(--aiw-radius-lg);overflow:hidden;background:var(--aiw-surface-2);border:1px solid var(--aiw-border-soft);display:flex;align-items:center;justify-content:center}
|
|
603
|
+
.${e}-ui-a-portrait .${e}-ui-media{aspect-ratio:4/5}
|
|
604
|
+
.${e}-ui-a-story .${e}-ui-media{aspect-ratio:9/16}
|
|
605
|
+
.${e}-ui-a-landscape .${e}-ui-media,.${e}-ui-a-wide .${e}-ui-media{aspect-ratio:16/9}
|
|
606
|
+
.${e}-ui-media-el{width:100%;height:100%;object-fit:cover;display:block}
|
|
607
|
+
/* An audio tile has nothing to LOOK at, so the box stops pretending to be a
|
|
608
|
+
picture: no forced aspect ratio, and the player sits at its natural height
|
|
609
|
+
instead of being stretched to fill a square. */
|
|
610
|
+
.${e}-ui-media:has(> audio.${e}-ui-media-el){aspect-ratio:auto;padding:8px}
|
|
611
|
+
audio.${e}-ui-media-el{height:auto;object-fit:unset}
|
|
612
|
+
.${e}-ui-media-ph{font-size:var(--aiw-font-2xs);color:var(--aiw-muted);text-align:center;padding:0 6px}
|
|
613
|
+
.${e}-ui-badge{position:absolute;left:6px;top:6px;padding:2px 7px;border-radius:var(--aiw-radius-pill);font-size:var(--aiw-font-3xs);font-weight:700;letter-spacing:.02em;background:rgba(0,0,0,.55);color:#fff;backdrop-filter:blur(4px)}
|
|
614
|
+
.${e}/* The two FILLED badges stay literal on purpose, and are not the bypass the
|
|
615
|
+
audit counted. They are opaque chips carrying the base rule's white text
|
|
616
|
+
(5.43:1 and 7.54:1), so they neither flip with the scheme nor need to:
|
|
617
|
+
--aiw-ok-bg / --aiw-danger-bg are PALE SURFACES for cards, and pouring one
|
|
618
|
+
into a filled pill would put pale text on a pale fill. Same reasoning as the
|
|
619
|
+
preview chrome's traffic-light dots. */
|
|
620
|
+
-ui-badge-ready{background:#16794a}
|
|
621
|
+
.${e}-ui-badge-running{background:var(--aiw-accent);color:var(--aiw-accent-contrast)}
|
|
622
|
+
.${e}-ui-badge-failed{background:#a32020}
|
|
623
|
+
.${e}-ui-tile-title{font-size:var(--aiw-font-xs);font-weight:600;color:var(--aiw-text);margin-top:6px;line-height:1.25}
|
|
624
|
+
.${e}-ui-tile-cap{font-size:var(--aiw-font-2xs);color:var(--aiw-text-2);margin-top:2px;line-height:1.3}
|
|
625
|
+
.${e}-ui-tile-actions,.${e}-ui-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
|
|
626
|
+
.${e}-ui-actions{margin-top:10px}
|
|
627
|
+
.${e}-ui-act{display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px}
|
|
628
|
+
.${e}-ui-btn{padding:5px 10px;border-radius:var(--aiw-radius-md);border:1px solid var(--aiw-border-strong);background:var(--aiw-bg);color:var(--aiw-text);font-size:var(--aiw-font-2xs);font-weight:600;cursor:pointer}
|
|
629
|
+
.${e}-ui-btn:hover{background:var(--aiw-surface-2)}
|
|
630
|
+
.${e}-ui-btn:disabled{opacity:.5;cursor:default}
|
|
631
|
+
.${e}-ui-btn-primary{background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-color:transparent}
|
|
632
|
+
.${e}-ui-btn-danger{color:var(--aiw-danger-text);border-color:color-mix(in srgb,var(--aiw-danger-text) 40%,transparent)}
|
|
633
|
+
.${e}-ui-btn-ghost{padding:5px 8px;border-radius:var(--aiw-radius-md);border:1px solid transparent;background:transparent;color:var(--aiw-muted);font-size:var(--aiw-font-2xs);font-weight:600;cursor:pointer}
|
|
634
|
+
.${e}-ui-confirm-q{font-size:var(--aiw-font-2xs);color:var(--aiw-text-2)}
|
|
635
|
+
.${e}-preview{align-self:stretch;border:1px solid var(--aiw-border);border-radius:var(--aiw-radius-2xl);overflow:hidden;background:var(--aiw-surface);animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
636
|
+
.${e}-preview-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--aiw-border-soft)}
|
|
637
|
+
.${e}-preview-dots{display:inline-flex;gap:4px}
|
|
638
|
+
.${e}-preview-dots i{width:9px;height:9px;border-radius:50%;background:#e2e2e2}
|
|
639
|
+
.${e}-preview-dots i:nth-child(1){background:#ff5f57}
|
|
640
|
+
.${e}-preview-dots i:nth-child(2){background:#febc2e}
|
|
641
|
+
.${e}-preview-dots i:nth-child(3){background:#28c840}
|
|
642
|
+
.${e}-preview-title{font-size:var(--aiw-font-xs);font-weight:600;color:var(--aiw-muted)}
|
|
643
|
+
.${e}-preview-frame{display:block;width:100%;height:340px;border:0;background:var(--aiw-surface)}
|
|
644
|
+
.${e}-proposal-media{display:block;width:100%;max-height:200px;object-fit:cover;border-radius:var(--aiw-radius-xl);border:1px solid var(--aiw-border);background:var(--aiw-surface-2)}
|
|
645
|
+
.${e}-proposal-media-holder{position:relative}
|
|
646
|
+
/* NOT --aiw-accent-contrast: this badge sits on 60% black over an image, not on
|
|
647
|
+
the accent, so it must stay light whatever the accent resolves to. Reading the
|
|
648
|
+
accent token here would have turned it navy-on-black the moment #307 made the
|
|
649
|
+
contrast derived. */
|
|
650
|
+
.${e}-proposal-media-badge{position:absolute;left:8px;bottom:8px;padding:2px 8px;border-radius:var(--aiw-radius-pill);background:rgba(0,0,0,.6);color:#FCF7E3;font-size:var(--aiw-font-2xs);font-weight:600}
|
|
651
|
+
.${e}-chips{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 10px}
|
|
652
|
+
.${e}-chip{padding:8px 14px;border-radius:var(--aiw-radius-pill);border:1px solid color-mix(in srgb,var(--aiw-accent) 35%,transparent);background:color-mix(in srgb,var(--aiw-accent) 7%,transparent);color:var(--aiw-accent-ink);font-size:var(--aiw-font-sm);font-weight:600;cursor:pointer;transition:background .12s,color .12s,border-color .12s}
|
|
653
|
+
.${e}-chip:hover{background:color-mix(in srgb,var(--aiw-accent) 14%,transparent)}
|
|
654
|
+
.${e}-chip-on,.${e}-chip-send{background:var(--aiw-accent);color:var(--aiw-accent-contrast);border-color:transparent}
|
|
655
|
+
.${e}-chip-send:hover{background:var(--aiw-accent)}
|
|
656
|
+
.${e}-chip-other{border-style:dashed;background:transparent;color:var(--aiw-muted);border-color:var(--aiw-border-strong)}
|
|
657
|
+
.${e}-chip:disabled{opacity:.45;cursor:default}
|
|
658
|
+
.${e}-kpi{border:1px solid var(--aiw-border-soft);border-radius:var(--aiw-radius-lg);padding:8px 10px;background:var(--aiw-bg)}
|
|
659
|
+
.${e}-kpi-v{font-size:var(--aiw-font-2xl);font-weight:700;color:var(--aiw-text)}
|
|
660
|
+
.${e}-kpi-l{font-size:var(--aiw-font-2xs);color:var(--aiw-muted);margin-top:1px}
|
|
661
|
+
.${e}-kpi-d{font-size:var(--aiw-font-2xs);font-weight:600;color:var(--aiw-accent-ink);margin-top:2px}
|
|
662
|
+
.${e}-widget-table{width:100%;border-collapse:collapse;font-size:var(--aiw-font-xs)}
|
|
663
|
+
.${e}-widget-table th{text-align:left;font-weight:700;color:var(--aiw-text-2);border-bottom:1px solid var(--aiw-border);padding:6px 8px}
|
|
664
|
+
.${e}-widget-table td{border-bottom:1px solid var(--aiw-border-soft);padding:6px 8px;color:var(--aiw-text)}
|
|
665
|
+
.${e}-widget-list{margin:0;padding-left:18px;font-size:var(--aiw-font-sm);color:var(--aiw-text);display:flex;flex-direction:column;gap:3px}
|
|
666
|
+
.${e}-nav{align-self:flex-start;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
667
|
+
.${e}-nav-btn{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--aiw-accent);background:color-mix(in srgb,var(--aiw-accent) 6%,transparent);color:var(--aiw-accent-ink);border-radius:var(--aiw-radius-lg);padding:9px 14px;font-size:var(--aiw-font-sm);font-weight:600;cursor:pointer}
|
|
668
|
+
.${e}-nav-btn:hover{background:color-mix(in srgb,var(--aiw-accent) 11%,transparent)}
|
|
669
|
+
.${e}-nav-btn:disabled{opacity:.7;cursor:default}
|
|
670
|
+
.${e}-proposal{align-self:stretch;border:1px solid color-mix(in srgb,var(--aiw-accent) 20%,transparent);background:color-mix(in srgb,var(--aiw-accent) 4%,transparent);border-radius:var(--aiw-radius-2xl);padding:12px;display:flex;flex-direction:column;gap:8px;animation:${e}-rise var(--duration-fast) var(--ease-out)}
|
|
671
|
+
.${e}-proposal-title{font-size:var(--aiw-font-sm);font-weight:700}
|
|
672
|
+
.${e}-proposal-edit{display:flex;flex-direction:column;gap:4px}
|
|
673
|
+
.${e}-proposal-edit-label{font-size:var(--aiw-font-2xs);font-weight:600;color:var(--aiw-text-2)}
|
|
674
|
+
.${e}-proposal-summary{font-size:var(--aiw-font-xs);color:var(--aiw-text-2);white-space:pre-wrap;line-height:1.45}
|
|
675
|
+
/* Storyboard plan inside a confirm card: one row per shot, so the thing the
|
|
676
|
+
renders are bought from is READ rather than skimmed as a paragraph. */
|
|
677
|
+
/* Two lines of the prompt: enough to judge the shot, not so much that four of
|
|
678
|
+
them bury the buttons under the fold. */
|
|
679
|
+
.${e}-proposal-ok{font-size:var(--aiw-font-sm);font-weight:600;color:var(--aiw-ok-text);display:inline-flex;align-items:center;gap:6px}
|
|
680
|
+
.${e}-confirm-q{font-size:var(--aiw-font-sm);color:var(--aiw-text-2);margin-bottom:8px}
|
|
681
|
+
.${e}-confirm-row{display:flex;gap:8px}
|
|
682
|
+
.${e}-confirm-no{border:1px solid var(--aiw-border-strong);background:var(--aiw-surface-raised);color:var(--aiw-text-2);border-radius:var(--aiw-radius-lg);padding:9px 14px;font-size:var(--aiw-font-sm);font-weight:600;cursor:pointer}
|
|
683
|
+
${a}
|
|
684
|
+
@media (prefers-color-scheme:dark){${o}}
|
|
685
|
+
|
|
686
|
+
@keyframes ${e}-sheetup{from{transform:translateY(100%)}to{transform:translateY(0)}}
|
|
687
|
+
/* On phones the panel becomes a full-width bottom sheet (slides up from the
|
|
688
|
+
bottom edge, ~90% of the dynamic viewport, rounded top, grab handle) so the
|
|
689
|
+
chat is comfortably usable instead of a cramped corner card. */
|
|
690
|
+
/* A phone in LANDSCAPE is about 844x390 \u2014 wider than 640, so the desktop
|
|
691
|
+
corner card applied and max-height:calc(100vh - 40px) clamped it to 350px
|
|
692
|
+
tall. Header and composer take ~120 of that, leaving ~230px of message log
|
|
693
|
+
in the exact posture where the soft keyboard also appears (#309).
|
|
694
|
+
Short viewport AND coarse pointer, not short alone: a short desktop window
|
|
695
|
+
is not a phone, and a full-screen sheet there would be wrong. */
|
|
696
|
+
@media (max-width:640px),(max-height:520px) and (pointer:coarse){
|
|
697
|
+
/* z-index: the desktop 48 sits deliberately BELOW the app's Radix modals
|
|
698
|
+
(z-50) so a dialog covers the chat. That rule did not anticipate page
|
|
699
|
+
CHROME at the same level: the marketing site's header is
|
|
700
|
+
"fixed inset-x-0 top-0 z-50", so it painted over the top 66px of the
|
|
701
|
+
full-screen sheet \u2014 its logo, locale switcher and hamburger landing on
|
|
702
|
+
top of the widget's own avatar and buttons (reported 2026-08-07).
|
|
703
|
+
A full-screen sheet covers the viewport and IS the modal surface while
|
|
704
|
+
it is open, so here \u2014 and only here \u2014 it outranks host chrome. */
|
|
705
|
+
.${e}-panel{inset:0;z-index:51;width:100%;max-width:100%;height:100vh;height:100dvh;max-height:none;border-radius:0;animation:${e}-sheetup var(--duration-base) var(--ease-out);transition:none}
|
|
706
|
+
.${e}-expanded{width:100%;max-width:100%;height:100vh;height:100dvh}
|
|
707
|
+
.${e}-expanded .${e}-msg{max-width:86%}
|
|
708
|
+
/* Give the title its own full-width row: avatar + actions share the top row,
|
|
709
|
+
the name/subtitle drop to a dedicated line below so the title never gets
|
|
710
|
+
squeezed by the action buttons on narrow phones. */
|
|
711
|
+
.${e}-header{position:relative;padding-top:calc(14px + env(safe-area-inset-top));display:grid;grid-template-columns:auto 1fr;grid-template-areas:"avatar actions" "name name";align-items:center;gap:8px 10px;touch-action:none}
|
|
712
|
+
.${e}-header::before{content:"";position:absolute;top:calc(5px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:38px;height:4px;border-radius:var(--aiw-radius-xs);background:color-mix(in srgb,var(--aiw-header-fg) 55%,transparent)}
|
|
713
|
+
.${e}-avatar{grid-area:avatar}
|
|
714
|
+
.${e}-hactions{grid-area:actions;justify-self:end}
|
|
715
|
+
.${e}-hname{grid-area:name}
|
|
716
|
+
.${e}-title{font-size:var(--aiw-font-xl)}
|
|
717
|
+
.${e}-log{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
|
|
718
|
+
.${e}-form{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
|
|
719
|
+
/* iOS auto-zooms the page when a focused field is under 16px, and the zoom
|
|
720
|
+
is what then makes the sheet scroll sideways. 16px is the threshold, not
|
|
721
|
+
a preference \u2014 do not lower it. text-size-adjust stops iOS inflating the
|
|
722
|
+
rest of the text to compensate. */
|
|
723
|
+
.${e}-input,.${e}-edit-input,.${e}-question-input,
|
|
724
|
+
.${e}-lead-form input,.${e}-lead-form textarea{font-size:var(--aiw-font-xl)}
|
|
725
|
+
.${e}-panel{-webkit-text-size-adjust:100%;text-size-adjust:100%}
|
|
726
|
+
/* While the soft keyboard is up it covers the home indicator, but iOS keeps
|
|
727
|
+
reporting safe-area-inset-bottom as if it were still there \u2014 leaving a
|
|
728
|
+
dead band under the composer. The keyboard handler sets this flag. */
|
|
729
|
+
.${e}-panel.${e}-kb .${e}-form{padding-bottom:10px}
|
|
730
|
+
.${e}-panel.${e}-kb .${e}-log{padding-bottom:14px}
|
|
731
|
+
.${e}-bubble{bottom:16px;${t}:16px}
|
|
732
|
+
/* Expand/restore is meaningless once the sheet is full-screen \u2014 hide it. */
|
|
733
|
+
.${e}-expand{display:none}
|
|
734
|
+
}
|
|
735
|
+
/* \u2500\u2500 Reduced motion, gated at the KEYFRAME (#308) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
736
|
+
This used to name eleven selectors. Twenty-two were animated, four of the
|
|
737
|
+
eleven carried no animation at all, and the list could only ever fall further
|
|
738
|
+
behind \u2014 the shared rise keyframe alone has sixteen consumers.
|
|
739
|
+
|
|
740
|
+
Redefining the keyframes reaches every consumer, including ones added later
|
|
741
|
+
by someone who never reads this block. That is the difference between a rule
|
|
742
|
+
and a list.
|
|
743
|
+
|
|
744
|
+
NOT all the way to zero, per house law: entrances keep their fade so spatial
|
|
745
|
+
continuity survives, and lose only the movement. The spinner keeps turning
|
|
746
|
+
because it reports STATE \u2014 a still spinner says "stuck", which is a worse
|
|
747
|
+
answer than a moving one. Purely decorative loops stop entirely.
|
|
748
|
+
|
|
749
|
+
One thing CSS cannot reach: the launcher blob is SMIL animate elements, and
|
|
750
|
+
animation:none has no authority over SMIL. #305 removes it by drawing a
|
|
751
|
+
static mark; noted so the two issues do not both try. */
|
|
752
|
+
@media (prefers-reduced-motion:reduce){
|
|
753
|
+
@keyframes ${e}-rise{from{opacity:0}to{opacity:1}}
|
|
754
|
+
@keyframes ${e}-richin{from{opacity:0}to{opacity:1}}
|
|
755
|
+
@keyframes ${e}-tokin{from{opacity:0}to{opacity:1}}
|
|
756
|
+
@keyframes ${e}-sheetup{from{opacity:0}to{opacity:1}}
|
|
757
|
+
@keyframes ${e}-float{0%,100%{transform:none}}
|
|
758
|
+
@keyframes ${e}-pulse{0%,100%{opacity:1}}
|
|
759
|
+
@keyframes ${e}-blink{0%,100%{opacity:1}}
|
|
760
|
+
@keyframes ${e}-blink2{0%,100%{opacity:1}}
|
|
761
|
+
@keyframes ${e}-caret{0%,100%{opacity:1}}
|
|
762
|
+
/* -breathe is the launcher's working state (#305). It is a STATUS signal, like
|
|
763
|
+
the spinner, so stillness would say 'idle' when a turn is running \u2014 but it is
|
|
764
|
+
also a loop in the corner of every page, which the spinner is not. Slowed and
|
|
765
|
+
shallowed rather than stopped: it still reads as alive, at a fraction of the
|
|
766
|
+
amplitude. */
|
|
767
|
+
@keyframes ${e}-breathe{0%,100%{opacity:1}50%{opacity:.88}}
|
|
768
|
+
.${e}-log{scroll-behavior:auto}
|
|
769
|
+
}
|
|
770
|
+
`,h=document.createElement("style");h.setAttribute("data-sgiant-aiw",""),h.textContent=c,document.head.appendChild(h)}var it={questionConfirm:"Send",questionPlaceholder:"Type your answer\u2026",questionSendFailed:"Couldn't send your answer \u2014 wait for the current reply to finish, then try again.",openBubble:"Open {name}",openBubbleUnread:"Open {name} \u2014 {count} unread",panelAria:"{name} chat",newChat:"New chat",pastConversations:"Past conversations",threadAnswering:"Answering\u2026",streamLostRecovering:"Connection lost \u2014 still working on the reply; it will appear here when ready.",history:"History",moreOptions:"More options",more:"More",expandChat:"Expand chat",expand:"Expand",restore:"Restore",restoreChat:"Restore chat size",closeChat:"Close chat",conversation:"Conversation",on:"On",off:"Off",downloadChat:"Download chat (.txt)",flagConversation:"Flag this conversation",flagConversationHint:"Flag this conversation for review",flagSendFirst:"Send a message first \u2014 then you can flag this chat.",flagPrompt:"Flag this conversation \u2014 why? (reason is logged for review)",flagged:"\u{1F6A9} Conversation flagged for review \u2713",flagFailed:"Couldn't flag: {msg}",flagFailedGeneric:"please try again",notificationSound:"Notification sound",soundOnHint:"Chime when a reply arrives \u2014 click to mute",soundOffHint:"Muted \u2014 click to enable the reply chime",autoNavigate:"Auto-navigate",autoNavOnHint:"Copilot opens pages for you \u2014 click to turn off",autoNavOffHint:"Copilot asks before opening pages \u2014 click to turn on",roleTalk:"Talk",roleAnalytics:"Analytics",creditsSuffix:" credits",askAnything:"Ask {name} anything\u2026",messageAria:"Message {name}",send:"Send",removeAttachment:"Remove {file}",attachFile:"Attach a file",attachFileHint:"Attach images, PDFs or documents",jobTitleCoder:"Working on a code task",jobTitleReport:"Generating the report",jobTitleFallback:"Background job",jobQueued:"Queued",jobRunning:"Running",jobDone:"Finished",jobFailed:"Failed",jobCancelled:"Cancelled",jobCancel:"Cancel",jobCancelling:"Cancelling\u2026",jobProgress:"{done} of {total}",jobProgressOpen:"{done} so far",jobOpenResult:"Open the result",jobFlowAll:"Show all {count} steps",jobWatchingInPane:"Following along in the panel \u2192",paneBackToPage:"Back to the page",paneShowingWidget:"Result",jobUnreachable:"Still running in the background \u2014 check back shortly",jobEvCancelled:"Cancelled",jobEvCancelledBeforeStart:"Cancelled before it started",jobEvInterrupted:"Interrupted by a restart \u2014 not retried automatically",proposalGeneric:"Apply this change?",artifactsTitle:"This chat's files:",artifactSave:"Save",artifactSaving:"Saving\u2026",apply:"Apply",dismiss:"Dismiss",applying:"Applying\u2026",applied:"Applied",openReport:"Open the report",tryAgain:"Try again",close:"Close",loading:"Loading\u2026",noConversations:"No past conversations yet.",untitledConversation:"Untitled conversation",star:"Star this conversation",unstar:"Unstar",historyLoadFailed:"Couldn't load history \u2014 try again.",bucketToday:"Today",bucketYesterday:"Yesterday",bucketWeek:"Earlier this week",bucketMonth:"This month",bucketOlder:"Older",submit:"Submit",sending:"Sending\u2026",requiredFields:"Please fill in the highlighted fields first.",done:"Done \u2713",preview:"Preview",otherOption:"+ Other\u2026",confirm:"Confirm",cancel:"Cancel",errorSnag:"{name} hit a snag and couldn't answer. Please try again.",reportIssue:"Report issue",reporting:"Reporting\u2026",reported:"Reported \u2713 \u2014 our team will look into it",reportFailed:"Couldn't report \u2014 try later",qualitySlowTitle:"That took a while \u2014 was the answer worth it?",qualityFailedTitle:"That didn't work \u2014 what were you trying to do?",qualityReasonPlaceholder:"Anything you'd add? (optional)",qualityFailedPlaceholder:"What were you trying to do?",qualitySend:"Send",qualityDismiss:"No thanks",qualityThanks:"Thanks \u2014 noted \u2713",meterTokensLeft:"{count} free tokens left",meterFreePreview:"Free preview",meterUsedThisSession:"{count} used this session",signupCta:"Sign up \u2014 14 days free",uiStatusPending:"Waiting",uiStatusRunning:"Working\u2026",uiStatusReady:"Ready",uiStatusFailed:"Failed",uiMediaPending:"Not made yet",uiMediaMissing:"Unavailable",prev:"Previous",next:"Next",actionOpening:"Opening {label}\u2026",actionDone:"{label} \u2713",actionOpenFailed:"Couldn't open {label}",actionRunFailed:"Couldn't run {label}",actionRetry:"{label} \u2014 try again",actionShownOnPage:"Shown on the page",actionDoneOnPage:"Done on the page",actionPageFailed:"Couldn't do that on the page",actionOpened:"Opened",threadOpenFailed:"Couldn't open that conversation."};function Jr(t){let a={};for(let o of Object.keys(it))a[o]=t(`chatWidget.${o}`,it[o]);return a}var Kr="__root__";function Si(t,a,o,c=0){let h=o.get(t);if(h)return h;let l=a.get(t);if(!l||l.length===0||c>1e3)return o.set(t,t),t;let r=l[l.length-1],m=r?.id?Si(r.id,a,o,c+1):t;return o.set(t,m),m}function As(t,a){let o=new Map;for(let r of t){let m=r.parentId??Kr,L=o.get(m);L?L.push(r):o.set(m,[r])}for(let r of o.values())r.sort((m,L)=>(m.createdAt??"").localeCompare(L.createdAt??""));let c=new Map,h=new Map;for(let r of t)r.id&&h.set(r.id,r);let l=new Map;for(let r of a){let m=h.get(r);if(!m)continue;let L=o.get(m.parentId??Kr)??[];if(L.length<2)continue;let w=L.findIndex(z=>z.id===r);if(w<0)continue;let $=L[w-1],j=L[w+1];l.set(r,{index:w+1,count:L.length,...$?.id?{prevLeaf:Si($.id,o,c)}:{},...j?.id?{nextLeaf:Si(j.id,o,c)}:{}})}return l}function Yr(t){let a=t.activePath&&t.activePath.length>0?t.activePath:null,o=a?new Set(a):null,c=a?As(t.messages??[],a):null,h=[];for(let l of t.messages??[])if(!(o&&l.id&&!o.has(l.id))&&(l.role==="user"||l.role==="assistant")&&l.content.trim()){let r={role:l.role,content:l.content,...l.id?{id:l.id}:{},...l.parentId!==void 0?{parentId:l.parentId}:{},...l.inputTokens?{inputTokens:l.inputTokens}:{},...l.outputTokens?{outputTokens:l.outputTokens}:{},...l.id&&c?.has(l.id)?{branch:c.get(l.id)}:{}};h.push({t:l.createdAt??"",item:r})}for(let l of t.artifacts??[])if(!(o&&l.messageId&&!o.has(l.messageId))){if(l.kind==="widget"){let r=l.payload??{};if(!r.spec)continue;h.push({t:l.createdAt??"",item:{kind:"widget",spec:r.spec,rows:r.rows??[],comparisonRows:r.comparisonRows??null}})}else if(l.kind==="activity"){let r=l.payload??{};if(!r.label)continue;let m=r.status!=="error"&&typeof r.reportId=="string"&&r.reportId?r.reportId:void 0;h.push({t:l.createdAt??"",item:{kind:"activity",label:r.label,status:r.status??"ok",agent:r.agent,model:r.model,...m?{reportId:m}:{}}})}}return h.sort((l,r)=>l.t.localeCompare(r.t)),h.map(l=>l.item)}var ht="[[collect-email]]";function An(t){return["true","1","yes","on"].includes((t??"").trim().toLowerCase())}function Gr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function Xr(t){return Array.isArray(t)?t.filter(a=>!!a&&typeof a=="object"&&typeof a.arg=="string"&&!!a.arg).slice(0,6):[]}function Mi(t){let a=re(t,"form");if(!a)return null;let{spec:o}=a;return!o||typeof o.action!="string"||!Array.isArray(o.fields)?null:a}function Qr(t){let a=t,o=[],c=[],h=[];for(let r=0;r<8;r++){let m=re(a,"navigate");if(!m)break;a=m.stripped,m.spec.path?h.push(m.spec):o.push(`\u2197 ${m.spec.label||"Open page"}`)}for(let r=0;r<8;r++){let m=re(a,"action");if(!m)break;a=m.stripped,o.push(`\u2022 ${m.spec.label||m.spec.name}`)}for(let r=0;r<8;r++){let m=re(a,"widget");if(!m)break;a=m.stripped,o.push(`\u25A6 ${m.spec.title||"widget"}`)}for(let r=0;r<4;r++){let m=re(a,"ui");if(!m)break;a=m.stripped,c.push(m.spec)}for(let r=0;r<3;r++){let m=re(a,"preview");if(!m)break;a=m.stripped,o.push(`[preview] ${m.spec.title||"Preview"}`)}for(let r=0;r<4;r++){let m=re(a,"chips");if(!m)break;a=m.stripped,o.push("\u{1F4AC} options offered")}let l=Mi(a);return l&&(a=l.stripped,o.push(`\u{1F4DD} ${l.spec.title||"Form"} \u2014 submitted`)),a.includes(ht)&&(a=a.replace(ht,"").trim(),o.push("\u{1F4DD} Form \u2014 submitted")),{clean:a,notes:o,navs:h,uis:c}}function Ii(t){let a=t.type??"text";if(a==="checkbox"){let c=d("label",`${e}-field-check`),h=d("input",`${e}-check`);h.type="checkbox",h.checked=An(t.value),t.required&&(h.required=!0),c.appendChild(h);let l=d("span",`${e}-field-check-label`);return l.textContent=t.label??t.placeholder??t.name,c.appendChild(l),{node:c,selfLabelled:!0,read:()=>h.checked?"true":"false"}}if(a==="radio"&&t.options?.length){let c=d("div",`${e}-field-group`),h=`${e}-${t.name}-${Math.random().toString(36).slice(2,9)}`;for(let l of t.options){let r=d("label",`${e}-field-check`),m=d("input",`${e}-check`);m.type="radio",m.name=h,m.value=l,t.required&&(m.required=!0),l===t.value&&(m.checked=!0),r.appendChild(m);let L=d("span",`${e}-field-check-label`);L.textContent=l,r.appendChild(L),c.appendChild(r)}return{node:c,read:()=>c.querySelector("input:checked")?.value??""}}let o;if(a==="textarea")o=d("textarea",`${e}-field`);else if(a==="select"){let c=d("select",`${e}-field`);for(let h of t.options??[]){let l=document.createElement("option");l.value=h,l.textContent=h,c.appendChild(l)}o=c}else{let c=d("input",`${e}-field`);c.type=a==="number"?"number":a,o=c}return"placeholder"in o&&t.placeholder?o.placeholder=t.label?`${t.label} \u2014 ${t.placeholder}`:t.placeholder:"placeholder"in o&&t.label&&(o.placeholder=t.label),t.required&&(o.required=!0),t.value!==void 0&&(o.value=t.value),{node:o,read:()=>o.value.trim()}}function at(t){return typeof t=="string"&&t.startsWith("/")&&!t.startsWith("//")&&!t.startsWith("/\\")}async function En(t,a,o){if(!at(t))throw new Error("that navigation target is not an in-app page");if(a().length||await o(),!Rt(t,a()))throw new Error("that page is not one I can open")}function Zr(t){try{let a=new URL(t,location.origin);return a.origin===location.origin&&(a.protocol==="http:"||a.protocol==="https:")}catch{return!1}}var Ss="sgiant:open-assistant";function Ms(t){let a=t.accent??"#6d28d9",o=t.gradient??`linear-gradient(135deg,${a},${a})`,c=t.position==="bottom-left"?"left":"right",h=t.container??document.body,l=t.title??"Copilot",r=(n,i)=>{let s=t.labels?.[n]??it[n];if(i)for(let p of Object.keys(i))s=s.split(`{${p}}`).join(String(i[p]));return s},m=t.avatarUrl?`<img src="${t.avatarUrl}" alt="${l}" class="${e}-av-img"/>`:Lr,L=new AbortController,w,$=!1,j=0,z="\xB7new\xB7",q=2e4,V=new Set,F=n=>V.has(n??z);function D(){$=F(w),dt.disabled=$,typeof Z=="function"&&T.style.display==="none"&&me({state:$?"working":"resting"})}let le="",ge=[];async function Oe(){if(t.getContext)try{let i=(await t.getContext())?.navTargets;Array.isArray(i)&&(ge=i)}catch{}}let fe=t.storageNamespace||"aiw",jt=t.persistKey?`${fe}:v1:${t.persistKey}`:null,rt=t.layoutKey??t.persistKey,Ft=rt?`${fe}:open:${rt}`:null,_t=t.persistKey?`${fe}:draft:${t.persistKey}`:null;function bt(n){Nt(_t,n)}function v(){return bi(_t)}function A(n){ft(Ft,n)}let E=[],S=12*60*60*1e3;function k(){let n=bn(jt,i=>!!i&&typeof i=="object");n&&(typeof n.savedAt!="number"||Date.now()-n.savedAt>S||(w=n.threadId,Array.isArray(n.messages)&&E.push(...n.messages)))}function H(){mn(jt,{threadId:w,messages:E.slice(-40),savedAt:Date.now()})}k(),Vr(c);let P=d("button",`${e}-bubble`);P.setAttribute("aria-label",r("openBubble",{name:l})),P.innerHTML=`<span class="${e}-bubble-av">${m}</span><span class="${e}-bubble-label"></span><span class="${e}-bubble-dot" hidden></span>`;let R=`${fe}:opened`;function B(){return gt(R,!0)}function oe(){ft(R,!0)}let X={state:"resting",count:0,variant:B()?"pebble":"pill",ground:"auto"};function J(){if(X.ground!=="auto")return X.ground;try{let n=P.getBoundingClientRect(),i=document.elementsFromPoint(n.left+n.width/2,n.top+n.height/2);for(let s of i){if(s===P||P.contains(s)||T.contains(s))continue;let p=getComputedStyle(s).backgroundColor,u=/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/.exec(p);if(!u||u[4]!==void 0&&Number(u[4])<=.5)continue;let[g,f,b]=[Number(u[1]),Number(u[2]),Number(u[3])];return(.2126*g+.7152*f+.0722*b)/255<.5?"ink":"light"}}catch{}return"light"}function Z(){let n=P.querySelector(`.${e}-bubble-dot`),i=P.querySelector(`.${e}-bubble-label`);for(let s of["unread","working","offline","parked"])P.classList.toggle(`${e}-bubble-${s}`,X.state===s);if(P.classList.toggle(`${e}-bubble-pill`,X.variant==="pill"),P.classList.toggle(`${e}-on-ink`,J()==="ink"),i&&(i.textContent=X.variant==="pill"?l:""),n){let s=X.state==="unread"&&X.count>0;n.hidden=!s&&X.state!=="offline",n.textContent=s?String(X.count):""}P.setAttribute("aria-label",X.state==="unread"&&X.count>0?r("openBubbleUnread",{name:l,count:X.count}):r("openBubble",{name:l}))}function me(n){Object.assign(X,n),Z()}let T=d("div",`${e}-panel`);Wr()&&(P.classList.add(`${e}-host-tokens`),T.classList.add(`${e}-host-tokens`));let ae={...t.theme??{}};if(t.accent&&!ae.accent&&(ae.accent=t.accent),(t.gradient||t.accent)&&!ae.gradient&&(ae.gradient=o),ae.accent&&!ae["accent-contrast"]){let n=wi(ae.accent);n&&(ae["accent-contrast"]=n)}if(ae.accent)for(let[n,i]of[["light","#ffffff"],["dark","#161616"]]){let s=`accent-ink-${n}`;if(ae[s])continue;let p=cr(ae.accent,i);p&&(ae[s]=p)}if(ae.accent&&!ae["user-bg"]){let n=xi(ae.accent,Ei,.76);if(n&&(ae["user-bg"]=n,!ae["user-contrast"])){let i=wi(n);i&&(ae["user-contrast"]=i)}}for(let[n,i]of Object.entries(ae))P.style.setProperty(`--aiw-${n}`,i),T.style.setProperty(`--aiw-${n}`,i);T.style.display="none",T.setAttribute("role","dialog"),T.setAttribute("aria-label",r("panelAria",{name:l}));let Hi=rt?`${fe}:pos:${rt}`:null,eo="(max-width:640px),(max-height:520px) and (pointer:coarse)",Sn=()=>window.matchMedia(eo).matches,Ri=(n,i)=>{let s=T.offsetWidth||368,p=T.offsetHeight||540,u=Math.max(0,window.innerWidth-s),g=Math.max(0,window.innerHeight-p);return{x:Math.min(Math.max(0,n),u),y:Math.min(Math.max(0,i),g)}},zt=()=>{T.style.left=T.style.top="",T.style.right=T.style.bottom=""},Ae=n=>{if(Sn()||!n)return zt();let{x:i,y:s}=Ri(n.x,n.y);if(!Number.isFinite(i)||!Number.isFinite(s))return zt();T.style.left=`${i}px`,T.style.top=`${s}px`,T.style.right="auto",T.style.bottom="auto"},mt=()=>bn(Hi,n=>typeof n?.x=="number"&&typeof n?.y=="number"),Mn=n=>{mn(Hi,n)},be=d("div",`${e}-header`);be.classList.add(`${e}-draggable`);let Ne=null;be.addEventListener("pointerdown",n=>{if(n.target?.closest("button,a,input,select")||T.classList.contains(`${e}-advanced`))return;let i=T.getBoundingClientRect();Ne={dx:n.clientX-i.left,dy:n.clientY-i.top,id:n.pointerId},be.setPointerCapture(n.pointerId),T.style.transition="none"}),be.addEventListener("pointermove",n=>{!Ne||n.pointerId!==Ne.id||(n.preventDefault(),Ae({x:n.clientX-Ne.dx,y:n.clientY-Ne.dy}))});let Oi=n=>{if(!Ne||n.pointerId!==Ne.id)return;Ne=null,T.style.transition="";let i=T.getBoundingClientRect(),s=Ri(i.left,i.top);Ae(s),Mn(s)};be.addEventListener("pointerup",Oi),be.addEventListener("pointercancel",Oi),be.addEventListener("dblclick",n=>{n.target?.closest("button,a,input,select")||(Mn(null),Ae(null))});let Ni=()=>{let n=mt();n&&Ae(n)};window.addEventListener("resize",Ni),Ae(mt());let Pi=d("div",`${e}-avatar`);Pi.innerHTML=m;let Bi=d("div",`${e}-hname`),ji=d("span",`${e}-title`);ji.textContent=l;let Fi=d("span",`${e}-sub`);Fi.textContent=t.subtitle??"Growth assistant";let Dt=d("span",`${e}-metachip`);Dt.hidden=!0,Bi.append(ji,Fi,Dt);let De=d("div",`${e}-hactions`),vt=d("button",`${e}-icon`);vt.setAttribute("aria-label",r("newChat")),vt.title=r("newChat"),vt.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>',De.appendChild(vt);let qe=null;t.listThreads&&(qe=d("button",`${e}-icon`),qe.setAttribute("aria-label",r("pastConversations")),qe.title=r("history"),qe.innerHTML=Ar,De.appendChild(qe));let In=d("div",`${e}-morewrap`),Ee=d("button",`${e}-icon`);Ee.setAttribute("aria-label",r("moreOptions")),Ee.setAttribute("aria-haspopup","menu"),Ee.setAttribute("aria-expanded","false"),Ee.title=r("more"),Ee.innerHTML=Or;let Se=d("div",`${e}-menu`);Se.setAttribute("role","menu"),Se.classList.remove(`${e}-menu-open`),In.append(Ee,Se);let qt=!1,wt=n=>{qt=n,Se.classList.toggle(`${e}-menu-open`,n),Ee.classList.toggle(`${e}-icon-on`,n),Ee.setAttribute("aria-expanded",n?"true":"false")};Ee.addEventListener("click",n=>{n.stopPropagation(),wt(!qt)}),T.addEventListener("click",n=>{qt&&!In.contains(n.target)&&wt(!1)}),T.addEventListener("keydown",n=>{qt&&n.key==="Escape"&&(n.stopPropagation(),wt(!1))});let Ut=new Map,Ue=()=>{},xt=n=>{let i=d("button",`${e}-menu-item`);i.type="button",i.setAttribute("role","menuitem");let s=d("span",`${e}-menu-ico`),p=d("span",`${e}-menu-label`);p.textContent=n;let u=d("span",`${e}-menu-state`);return i.append(s,p,u),{btn:i,ico:s,setState:g=>{u.textContent=r(g?"on":"off"),i.classList.toggle(`${e}-menu-item-on`,g)}}},Hn=xt(r("downloadChat"));Hn.ico.innerHTML=Mr,Hn.btn.addEventListener("click",()=>{wt(!1),Ro()}),Se.appendChild(Hn.btn);let Te=t.starThread?xt(r("star")):null;if(Te&&(Te.ico.textContent="\u2606",Te.btn.addEventListener("click",()=>{if(!w||!t.starThread)return;let n=w;Te.btn.disabled=!0,t.starThread(n).then(i=>{Ut.set(n,i.starred),Ue()}).finally(()=>{Te.btn.disabled=!1})}),Se.appendChild(Te.btn),Ue=()=>{let n=w?Ut.get(w):void 0;Te.btn.hidden=!w;let i=n===!0;Te.ico.textContent=i?"\u2605":"\u2606",Te.ico.style.color=i?"#f59e0b":"";let s=Te.btn.querySelector(`.${e}-menu-label`);s&&(s.textContent=r(i?"unstar":"star"))},Ue()),t.onFlag){let n=xt(r("flagConversation"));n.ico.innerHTML=Ir,n.btn.title=r("flagConversationHint"),n.btn.addEventListener("click",()=>{if(wt(!1),!w){Dn(r("flagSendFirst"),!1);return}let i=window.prompt(r("flagPrompt"));!i||!i.trim()||(n.btn.disabled=!0,Promise.resolve(t.onFlag({reason:i.trim(),threadId:w})).then(()=>{Dn(r("flagged"),!0)}).catch(s=>{Dn(r("flagFailed",{msg:s?.message||r("flagFailedGeneric")}),!1)}).finally(()=>{n.btn.disabled=!1}))}),Se.appendChild(n.btn)}let _i=`${fe}:sound`,Pe=gt(_i),yt=xt(r("notificationSound")),zi=()=>{yt.ico.innerHTML=Pe?Hr:Rr,yt.setState(Pe),yt.btn.title=r(Pe?"soundOnHint":"soundOffHint")};zi(),yt.btn.addEventListener("click",()=>{Pe=!Pe,ft(_i,Pe),zi(),Pe&&Wt(!0)}),Se.appendChild(yt.btn);function Wt(n){if(!(!Pe&&!n))try{let i=window.AudioContext||window.webkitAudioContext,s=new i,p=s.currentTime;[[880,0],[1175,.12]].forEach(([u,g])=>{let f=s.createOscillator(),b=s.createGain();f.type="sine",f.frequency.value=u,b.gain.setValueAtTime(1e-4,p+g),b.gain.exponentialRampToValueAtTime(.12,p+g+.02),b.gain.exponentialRampToValueAtTime(1e-4,p+g+.18),f.connect(b).connect(s.destination),f.start(p+g),f.stop(p+g+.2)}),window.setTimeout(()=>void s.close().catch(()=>{}),500)}catch{}}let Di=`${fe}:autonav`,We=gt(Di);if(t.autoNavOption){let n=xt(r("autoNavigate"));n.ico.innerHTML=kn;let i=()=>{n.setState(We),n.btn.title=r(We?"autoNavOnHint":"autoNavOffHint")};i(),n.btn.addEventListener("click",()=>{We=!We,ft(Di,We),i()}),Se.appendChild(n.btn)}De.appendChild(In);let we=null;t.expandable!==!1&&(we=d("button",`${e}-icon ${e}-expand`),we.setAttribute("aria-label",r("expandChat")),we.title=r("expand"),we.innerHTML=Li,De.appendChild(we));let xe=null;t.getAdvancedUrl&&(xe=d("button",`${e}-icon ${e}-advbtn`),xe.setAttribute("aria-label",t.advancedLabel||"Advanced view"),xe.title=t.advancedLabel||"Advanced view",xe.innerHTML=Sr,De.appendChild(xe));let Vt=d("button",`${e}-close`);Vt.innerHTML="×",Vt.setAttribute("aria-label",r("closeChat")),De.appendChild(Vt),be.append(Pi,Bi,De);let N=d("div",`${e}-log`);N.setAttribute("role","log"),N.setAttribute("aria-live","polite"),N.setAttribute("aria-label",r("conversation")),N.setAttribute("tabindex","0");let Jt=!0,Rn=!1,W=n=>{n&&(Jt=!0),!(!Jt||Rn)&&(Rn=!0,requestAnimationFrame(()=>{Rn=!1,N.scrollTop=N.scrollHeight}))},$t=[],to=new Set(["widget","preview","navigate","action","chips","form"]),Kt={},qi=(n,i)=>{if(!/^[a-z][a-z0-9_-]*$/i.test(n)||to.has(n))throw new Error(`invalid or reserved directive tag: ${n}`);Kt[n]=i};for(let[n,i]of Object.entries(t.renderers??{}))qi(n,i);let On=new Map;function Nn(){On.clear();for(let n of $t.splice(0))try{n()}catch{}}function no(n){return n?n.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function Ui(n){return n.replace(/\s*✓\s*$/u,"")}function Wi(n,i,s,p,u){i=Ui(i);let g=s==="running"?`<span class="${e}-act-spin" aria-hidden="true"></span>`:s==="error"?`<span class="${e}-act-x" aria-hidden="true">\u2715</span>`:`<span class="${e}-act-ok" aria-hidden="true">\u2713</span>`,f=p?`<span class="${e}-act-agent">${G(p)}</span>`:"",b=no(u),y=b?`<span class="${e}-act-model">${G(b)}</span>`:"";n.className=`${e}-activity`+(s!=="running"?` ${e}-activity-done`:""),n.innerHTML=`${g}${f}${y}<span class="${e}-act-label">${G(i)}</span>`}function Pn(n,i,s,p,u){let g=d("div",`${e}-activity`);if(Wi(g,n,i,s,p),at(u)){let f=u,b=d("button",`${e}-act-open`);b.type="button",b.innerHTML=`<span>${G(r("openReport"))}</span> <span aria-hidden="true">\u2192</span>`,b.addEventListener("click",async()=>{b.disabled=!0;try{await Qe("navigate",{path:f})}catch{b.disabled=!1}}),g.appendChild(b)}return N.appendChild(g),g}function io(n,i,s,p,u){let g=On.get(n);if(g){Wi(g,i,s,p,u);return}let f=Pn(i,s,p,u);On.set(n,f),W()}function Vi(n){return new Promise(i=>{if(L.signal.aborted){i(!1);return}let s=setTimeout(()=>{L.signal.removeEventListener("abort",p),i(!0)},n),p=()=>{clearTimeout(s),i(!1)};L.signal.addEventListener("abort",p,{once:!0})})}let Ji=3e3,ao=30*60*1e3,ye=n=>`${n.kind}:${n.id}`,Ki=n=>n.id?{kind:n.type==="report"?"report":"job",id:n.id}:null,Yi=t.persistKey?`${fe}:jobs:${t.persistKey}`:null,ro=24*60*60*1e3,Ve=new Map,Bn=new Set,ot=new Map;function oo(n,i){let s=ye(n),p=Ve.get(s);p&&Qi(p,i);let u=ot.get(s);if(u){for(let g of u){if(!g.node.isConnected){g.seen&&u.delete(g);continue}g.seen=!0;try{g.paint(i)}catch{}}u.size||ot.delete(s)}}function Gi(n){let i=n.kind==="report"?t.getReport:t.getJob;if(!i||!n.id)return;let s=ye(n);Bn.has(s)||(Bn.add(s),(async()=>{let p=Date.now();try{for(;;){if(Date.now()-p>=ao){let g=Ve.get(s);g&&(g.className=`${e}-job ${e}-job-done`,g.textContent=r("jobUnreachable")),_n(n);return}let u;try{u=await i(n.id)}catch{if(!await Vi(Ji))return;continue}if(!u){Ve.get(s)?.remove(),Ve.delete(s),ot.delete(s),_n(n);return}if(oo(n,u),u.status==="done"||u.status==="failed"||u.status==="cancelled"){_n(n),ot.delete(s),W();return}if(!await Vi(Ji))return}}finally{Bn.delete(s)}})())}function so(n,i,s){if(!(n.kind==="report"?t.getReport:t.getJob)||!n.id)return;let u=ye(n),g=ot.get(u);g||(g=new Set,ot.set(u,g)),g.add({node:i,paint:s,seen:!1}),Gi(n)}function jn(){let n=bn(Yi,s=>Array.isArray(s));if(!n)return[];let i=Date.now()-ro;return n.filter(s=>!!s&&typeof s=="object"&&typeof s.jobId=="string"&&typeof s.threadId=="string"&&typeof s.at=="number"&&s.at>i)}function Xi(n){mn(Yi,n.length?n:null)}function Fn(n){return{kind:n.kind??"job",id:n.jobId}}function lo(n,i){let s=jn().filter(p=>ye(Fn(p))!==ye(n));s.push({jobId:n.id,kind:n.kind,threadId:i,at:Date.now()}),Xi(s)}function _n(n){Xi(jn().filter(i=>ye(Fn(i))!==ye(n)))}function co(n){return n.title?n.title:n.type==="coder"?r("jobTitleCoder"):n.type==="report"?r("jobTitleReport"):r("jobTitleFallback")}function po(n){let i=n.progress?.done??0,s=n.progress?.total??null;return s&&s>0?r("jobProgress",{done:i,total:s}):i>0?r("jobProgressOpen",{done:i}):""}function Qi(n,i){let s=i.status==="done"||i.status==="failed"||i.status==="cancelled",p=i.status==="failed";n.className=`${e}-job`+(s?` ${e}-job-done`:"")+(p?` ${e}-job-failed`:"");let u=p?`<span class="${e}-act-x" aria-hidden="true">\u2715</span>`:i.status==="done"?`<span class="${e}-act-ok" aria-hidden="true">\u2713</span>`:i.status==="cancelled"?`<span class="${e}-act-x" aria-hidden="true">\u2013</span>`:`<span class="${e}-act-spin" aria-hidden="true"></span>`,g=p?r("jobFailed"):i.status==="done"?r("jobDone"):i.status==="cancelled"?r("jobCancelled"):i.status==="queued"?r("jobQueued"):r("jobRunning"),f=po(i),b=p?i.error??"":i.progress?.label??"",y=i.progress?.total??0,x=i.progress?.done??0,C=y>0?Math.max(0,Math.min(100,Math.round(x/y*100))):0,K=!s&&i.livePath?Ki(i):null;K&&i.livePath&&Lo(ye(K),i.livePath);let pe=Ao(i.livePath),ee=pe?[]:i.events??[],ie=_=>{let ne=_.data?.code;if(typeof ne!="string"||!ne)return _.message;let de=`jobEv${ne.charAt(0).toUpperCase()}${ne.slice(1)}`;return de in it&&r(de)||_.message},O=s?Math.max(0,ee.length-3):Math.max(0,ee.length-5),Y=_=>`<li class="${e}-job-ev${_.kind==="problem"?` ${e}-job-ev-problem`:_.kind==="decision"?` ${e}-job-ev-decision`:""}">${G(ie(_))}</li>`,U=ee.length?`<ul class="${e}-job-flow">${ee.slice(O).map(Y).join("")}</ul>`+(O>0?`<details class="${e}-job-flow-all"><summary>${G(r("jobFlowAll",{count:ee.length}))}</summary><ul class="${e}-job-flow">${ee.map(Y).join("")}</ul></details>`:""):"";if(n.innerHTML=`<div class="${e}-job-head">${u}<span class="${e}-job-title">${G(co(i))}</span><span class="${e}-job-state">${G(g)}</span></div>`+(f?`<div class="${e}-job-counts">${G(f)}</div>`:"")+(y>0&&!s?`<div class="${e}-job-bar"><i style="transform:scaleX(${C/100})"></i></div>`:"")+(b?`<div class="${e}-job-detail">${G(b)}</div>`:"")+(pe?`<div class="${e}-job-mirrored">${G(r("jobWatchingInPane"))}</div>`:"")+U,i.status==="done"&&at(i.resultPath)){let _=i.resultPath,ne=d("button",`${e}-nav-btn`);ne.type="button",ne.innerHTML=`<span>${G(r("jobOpenResult"))}</span> <span aria-hidden="true">\u2192</span>`,ne.addEventListener("click",async()=>{ne.disabled=!0;try{await Qe("navigate",{path:_})}catch{ne.disabled=!1}}),n.appendChild(ne)}let ue=i.type==="report"?t.cancelReport:t.cancelJob;if(!s&&i.id&&ue){let _=i.id,ne=ue,de=d("button",`${e}-nav-btn`);de.type="button",de.innerHTML=`<span>${G(r("jobCancel"))}</span>`,de.addEventListener("click",async()=>{de.disabled=!0,de.textContent=r("jobCancelling");try{await ne(_)}catch{de.disabled=!1,de.innerHTML=`<span>${G(r("jobCancel"))}</span>`}}),n.appendChild(de)}}function uo(){return{status:"queued"}}function zn(n,i){if(!(n.kind==="report"?t.getReport:t.getJob)||!n.id||(i&&lo(n,i),Gi(n),Ve.get(ye(n))?.isConnected))return;let u=d("div",`${e}-job`);Qi(u,uo()),N.appendChild(u),Ve.set(ye(n),u),W(!0)}let Zi=new Set;function ea(n){Zi.add(ye(n)),zn(n,w)}function ta(n){if(!(t.getJob||t.getReport)||!n)return;Ve.clear();for(let s of jn())s.threadId===n&&zn(Fn(s),void 0);let i=t.listThreadJobs;i&&i(n).then(s=>{if(w===n)for(let p of s){let u=Ki(p);u&&zn(u,n)}}).catch(()=>{})}function na(n,i,s){if(s&&(n.classList.remove(`${e}-rich-in`),n.offsetWidth,n.classList.add(`${e}-rich-in`)),t.renderMarkdown){n.textContent="";let p=t.renderMarkdown(n,i);p&&$t.push(p)}else n.innerHTML=Ci(i)}function Yt(n){let{clean:i,notes:s,navs:p,uis:u}=Qr(n),g=nt(N,"assistant","");na(g,i);for(let f of s){let b=d("div",`${e}-replay-note`);b.textContent=f,N.appendChild(b)}for(let f of u)ai(f);if(t.onWidgetAction)for(let f of p)at(f.path)&&ri(f,!0);return g}function ia(n,i){let s=d("div",`${e}-usage`);return s.innerHTML=`<span class="${e}-usage-pill">\u2191 ${n.toLocaleString()}</span><span class="${e}-usage-pill">\u2193 ${i.toLocaleString()}</span><span class="${e}-usage-sep">\xB7</span><span>${(n+i).toLocaleString()} tokens</span>`,s}function Je(n,i=w){let s=i===w?Array.from(N.querySelectorAll(`.${e}-question:not(.${e}-question-done)`)):[];Nn(),N.innerHTML="",E.length=0;for(let p of n)if("kind"in p&&p.kind==="widget")qa(p.spec,p.rows,p.comparisonRows);else if("kind"in p&&p.kind==="activity")Pn(p.label,p.status,p.agent,p.model,p.reportId?t.reportHref?.(p.reportId):void 0);else if("role"in p){let u=N.lastChild;if(p.role==="assistant"?Yt(p.content):nt(N,p.role,p.content),p.role==="assistant"&&(p.inputTokens||p.outputTokens)&&N.appendChild(ia(p.inputTokens??0,p.outputTokens??0)),E.push({role:p.role,content:p.content}),t.setActiveLeaf||t.vote){let g=u?u.nextSibling:N.firstChild;bo(p,g)}}for(let p of s)N.appendChild(p);ta(i),W(!0)}let{buildBranchNav:go,buildVoteButtons:aa}=_r({switchBranch:n=>mo(n),getThreadId:()=>w,...t.vote?{vote:t.vote}:{},...t.voteUpLabel?{voteUpLabel:t.voteUpLabel}:{},...t.voteDownLabel?{voteDownLabel:t.voteDownLabel}:{}});function ra(n){let i=n;for(;i;){let s=i.nextSibling;i.remove(),i=s}}function fo(n,i,s){if($)return;let p=d("div",`${e}-edit ${e}-user`),u=d("textarea",`${e}-edit-input`);u.value=n.content,u.rows=Math.min(8,Math.max(2,n.content.split(`
|
|
771
|
+
`).length));let g=d("div",`${e}-edit-actions`),f=d("button",`${e}-edit-cancel`);f.type="button",f.textContent=t.cancelLabel??"Cancel";let b=d("button",`${e}-edit-save`);b.type="button",b.textContent=t.saveLabel??"Save & send",g.appendChild(f),g.appendChild(b),p.appendChild(u),p.appendChild(g),N.insertBefore(p,i);for(let C of s)C.style.display="none";u.focus();let y=()=>{p.remove();for(let C of s)C.style.display=""},x=()=>{let C=u.value.trim();!C||$||(p.remove(),ra(i),Ze(C,{parentId:n.parentId??null}))};f.addEventListener("click",y),b.addEventListener("click",x),u.addEventListener("keydown",C=>{C.key==="Escape"&&y(),C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),x())})}function ho(n,i,s){if(!t.vote)return;let p=d("div",`${e}-quality`),u=d("div",`${e}-quality-title`);u.textContent=r(n==="slow"?"qualitySlowTitle":"qualityFailedTitle"),p.appendChild(u);let g=n==="failed"?-1:null,f=d("div",`${e}-quality-row`);if(n==="slow"){let K=(pe,ee,ie)=>{let O=d("button",`${e}-msgact ${e}-vote`);return O.type="button",O.setAttribute("aria-label",ee),O.title=ee,O.innerHTML=ie,O.addEventListener("click",()=>{g=pe,f.querySelectorAll(`.${e}-vote`).forEach(Y=>Y.classList.remove(`${e}-vote-on`)),O.classList.add(`${e}-vote-on`)}),O};f.appendChild(K(1,t.voteUpLabel??"Helpful",Cn)),f.appendChild(K(-1,t.voteDownLabel??"Not helpful",Tn))}let b=d("input",`${e}-quality-reason`);b.type="text",b.maxLength=500,b.placeholder=r(n==="slow"?"qualityReasonPlaceholder":"qualityFailedPlaceholder"),b.setAttribute("aria-label",u.textContent),f.appendChild(b),p.appendChild(f);let y=d("div",`${e}-quality-actions`),x=d("button",`${e}-quality-send`);x.type="button",x.textContent=r("qualitySend");let C=d("button",`${e}-quality-dismiss`);C.type="button",C.textContent=r("qualityDismiss"),C.addEventListener("click",()=>p.remove()),x.addEventListener("click",()=>{let K=b.value.trim();if(g===null&&!K){p.remove();return}x.disabled=!0,t.vote({threadId:w??"",messageId:i,value:g??-1,...s?{model:s}:{},...K?{reason:K}:{}}).then(()=>{p.textContent=r("qualityThanks"),p.classList.add(`${e}-quality-done`)}).catch(()=>{x.disabled=!1})}),y.append(x,C),p.appendChild(y),N.appendChild(p),W()}let oa=new Set,sa=new Map;function bo(n,i){if(!t.setActiveLeaf&&!t.vote)return;let s=n.role==="user",p=!!t.setActiveLeaf&&!s&&typeof n.parentId=="string",u=!s&&!!t.vote&&typeof n.id=="string";if(!n.branch&&!s&&!p&&!u)return;let g=d("div",`${e}-msgactions ${e}-${n.role}`);if(n.branch&&t.setActiveLeaf&&g.appendChild(go(n.branch)),s){let f=d("button",`${e}-msgact ${e}-msgact-icon`);f.type="button";let b=t.editLabel??"Edit";f.setAttribute("aria-label",b),f.title=b,f.innerHTML=Pr,f.addEventListener("click",()=>{let y=[];for(let x=i;x&&(x instanceof HTMLElement&&y.push(x),x!==g);x=x.nextSibling);fo(n,i,y)}),g.appendChild(f)}else{if(p){let f=n.parentId,b=d("button",`${e}-msgact`);b.type="button";let y=t.regenerateLabel??"Regenerate";b.setAttribute("aria-label",y),b.innerHTML=`${Br}<span>${G(y)}</span>`,b.addEventListener("click",()=>{$||typeof f!="string"||(ra(i),Ze("",{regenerate:!0,parentId:f}))}),g.appendChild(b)}u&&g.appendChild(aa(n.id,n.model??void 0))}N.appendChild(g)}async function mo(n){if(!($||!w||!t.setActiveLeaf||!t.loadThread))try{await t.setActiveLeaf(w,n);let i=await t.loadThread(w);Je(i),H()}catch{}}function vo(){if(E.length)for(let n of E)n.role==="assistant"?Yt(n.content):nt(N,n.role,n.content,n.attachments);else t.greeting&&Yt(t.greeting);if(ta(w),w&&t.loadThread){let n=w;t.loadThread(n).then(i=>{i.length&&Je(i)}).catch(()=>{})}}N.addEventListener("scroll",()=>{Jt=N.scrollHeight-N.scrollTop-N.clientHeight<90});let da=n=>{n.addEventListener("wheel",i=>{let s=i.deltaMode===1?i.deltaY*16:i.deltaMode===2?i.deltaY*n.clientHeight:i.deltaY,p=n.scrollTop;n.scrollTop=p+s,n.scrollTop!==p&&(i.preventDefault(),i.stopPropagation())},{passive:!1})};da(N);function Dn(n,i){let s=d("div",`${e}-replay-note ${e}-flag-note${i?` ${e}-flag-ok`:""}`);s.textContent=n,N.appendChild(s),W(!0),setTimeout(()=>s.remove(),6e3)}let kt=d("div",`${e}-meter`);kt.style.display="none";let qn=0,Me=null,Un=0;function la(){if(!t.signupUrl||Me===null&&Un===0){kt.style.display="none";return}kt.style.display="block";let n=qn>0&&Me!==null?Math.max(0,Math.min(100,Me/qn*100)):100,i=Me!==null?r("meterTokensLeft",{count:Me.toLocaleString()}):r("meterFreePreview"),s=r("meterUsedThisSession",{count:Un.toLocaleString()});kt.innerHTML=`<div class="${e}-meter-bar"><span style="transform:scaleX(${n/100})"></span></div><div class="${e}-meter-row"><span>${G(i)}</span><span>${G(s)}</span></div>`}let ca=t.roleNames??{},pa=t.actionRoles??{},ua=t.toolRoles??{},st=d("div",`${e}-status`);st.style.display="none";let Wn=d("span",`${e}-status-role`),Gt=d("span",`${e}-status-credits`),Xt=d("span",`${e}-status-credits-val`);Gt.append(document.createTextNode("\u2605 "),Xt,document.createTextNode(r("creditsSuffix"))),st.append(Wn,Gt);let Ct="talk",Ie=null,Be=0,ga=!1,Ke=0;function Tt(n){Xt.textContent=Math.round(n).toLocaleString()}function fa(){if(!t.getBalance){st.style.display="none";return}st.style.display="flex",Wn.textContent=ca[Ct]??Ct,Gt.style.display=Ie===null?"none":"",Ie!==null&&!Ke&&(Be=Ie,Tt(Be))}function wo(n){Ke&&(cancelAnimationFrame(Ke),Ke=0);let i=Be,s=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(i===n||s){Be=n,Tt(n);return}let p=Math.min(900,250+Math.abs(n-i)*1.2);Xt.classList.add(`${e}-credits-live`);let u=0,g=f=>{u||(u=f);let b=Math.min(1,(f-u)/p),y=1-Math.pow(1-b,3);Be=i+(n-i)*y,Tt(Be),b<1?Ke=requestAnimationFrame(g):(Ke=0,Be=n,Tt(n),Xt.classList.remove(`${e}-credits-live`))};Ke=requestAnimationFrame(g)}async function ha(){if(t.getBalance){try{Ie=await t.getBalance()}catch{return}t.getBalance&&(st.style.display="flex",Wn.textContent=ca[Ct]??Ct,Gt.style.display=Ie===null?"none":"",Ie===null||(ga?wo(Ie):(ga=!0,Be=Ie,Tt(Ie))))}}function Vn(n){Ct=n,fa()}let ve=d("div",`${e}-suggestions`);ve.style.display="none";let Qt=d("form",`${e}-form`),se=d("input",`${e}-input`);se.placeholder=r("askAnything",{name:l}),se.setAttribute("aria-label",r("messageAria",{name:l})),se.autocomplete="off",se.value=v(),se.addEventListener("input",()=>bt(se.value));let dt=d("button",`${e}-send`);dt.type="submit",dt.textContent=r("send");let $e=d("div",`${e}-artifacts`);$e.style.display="none";let Jn=!1;async function Kn(){if(!t.listSessionArtifacts||!w){$e.style.display="none",$e.innerHTML="";return}let n=[];try{n=await t.listSessionArtifacts(w)}catch{return}if($e.innerHTML="",!n.length){$e.style.display="none";return}$e.style.display="flex";let i=d("span",`${e}-artifacts-title`);i.textContent=r("artifactsTitle"),$e.appendChild(i);for(let s of n){let p=d("span",`${e}-artifact`),u=d("span",`${e}-artifact-name`);if(u.textContent=s.label||s.filename,u.title=s.filename,p.appendChild(u),t.onApplyProposal){let g=d("button",`${e}-artifact-save`);g.type="button",g.textContent=r("artifactSave"),g.addEventListener("click",async()=>{if(!Jn){Jn=!0,g.textContent=r("artifactSaving"),g.disabled=!0;try{await t.onApplyProposal("save_artifact_to_assets",{mediaId:s.id}),p.remove(),$e.querySelector(`.${e}-artifact`)||($e.style.display="none")}catch{g.textContent=r("tryAgain"),g.disabled=!1}finally{Jn=!1}}}),p.appendChild(g)}$e.appendChild(p)}}let Ye=[],He=d("div",`${e}-attbar`);He.style.display="none";let ke=null,Ce=null;function Yn(){He.innerHTML="",He.style.display=Ye.length?"flex":"none",Ye.forEach((n,i)=>{let s=d("span",`${e}-att ${e}-att-staged`);s.title=`${n.filename} (${n.contentType})`;let p=d("span","");p.textContent=`${Ti(n.kind)} ${n.filename}`;let u=d("button",`${e}-att-x`);u.type="button",u.textContent="\xD7",u.setAttribute("aria-label",r("removeAttachment",{file:n.filename})),u.addEventListener("click",()=>{Ye.splice(i,1),Yn()}),s.append(p,u),He.appendChild(s)})}let xo=26214400,yo=n=>/^(video|audio)\//i.test(n.type)?104857600:xo,$o=n=>`${Math.round(n/(1024*1024))} MB`;function ko(n){let i=d("span",`${e}-att ${e}-att-err`);i.textContent=`\u26A0 ${n}`,He.appendChild(i),He.style.display="flex",setTimeout(()=>{i.remove(),He.children.length||(He.style.display="none")},4e3)}async function ba(n){let i=t.getUploadEndpoint?.()??t.uploadEndpoint;if(!(!n||!i)){ke&&(ke.disabled=!0);try{let s=t.getToken?await t.getToken():t.token;for(let p of Array.from(n).slice(0,6)){if(Ye.length>=6)break;let u=yo(p);if(p.size>u){ko(`"${p.name}" is too large (max ${$o(u)})`);continue}let g=new FormData;g.append("file",p),g.append("session","1"),w&&g.append("threadId",w);let f=await fetch(i,{method:"POST",headers:s?{authorization:`Bearer ${s}`}:{},credentials:t.withCredentials?"include":"same-origin",body:g});if(!f.ok)continue;let b=await f.json();if(!b.media)continue;let y=b.media.contentType||p.type||"";Ye.push({mediaId:b.media.id,kind:y.startsWith("image/")?"image":y.includes("pdf")?"pdf":"doc",filename:b.media.filename,contentType:y}),Yn()}}catch{}finally{ke&&(ke.disabled=!1),Ce&&(Ce.value="")}}}t.uploadEndpoint||t.getUploadEndpoint?(Ce=d("input",""),Ce.type="file",Ce.multiple=!0,Ce.accept="image/*,video/*,audio/*,.svg,application/pdf,.doc,.docx,.xls,.xlsx,.csv,.txt,.md,.json,.yaml,.yml",Ce.style.display="none",Ce.addEventListener("change",()=>void ba(Ce.files)),ke=d("button",`${e}-attach`),ke.type="button",ke.innerHTML=Nr,ke.setAttribute("aria-label",r("attachFile")),ke.title=r("attachFileHint"),ke.addEventListener("click",()=>Ce.click()),se.addEventListener("paste",n=>{let i=n.clipboardData?.files;i&&i.length&&(n.preventDefault(),ba(i))}),Qt.append(ke,se,dt,Ce)):Qt.append(se,dt);let ma=d("div",`${e}-chatcol`);ma.append(be,N,kt,st,ve,$e,He,Qt);let lt=d("div",`${e}-pane`);if(T.append(ma,lt),fa(),!document.getElementById(`${e}-av-g`)){let n=document.createElement("div");n.style.cssText="position:absolute;width:0;height:0;overflow:hidden",n.innerHTML=Tr,h.append(n)}h.append(P,T);let va=()=>{j++,w=void 0,Ue(),E.length=0,H(),Nn(),N.innerHTML="",t.greeting&&Yt(t.greeting),D(),ii(),Kn()},ct=(n,i)=>{oe(),me({variant:"pebble",state:"resting",count:0}),T.style.display="flex",T.style.transform="",Ae(mt());let s=T.getBoundingClientRect();(s.right<40||s.bottom<40||s.left>window.innerWidth-40||s.top>window.innerHeight-40)&&(Mn(null),Ae(null)),P.style.display="none",Jt=!0,i&&va(),N.scrollTop=N.scrollHeight,typeof n=="string"&&n.trim()&&(i||!se.value.trim())&&(se.value=n,bt(se.value)),se.focus(),To(),ha(),ii(),A(!0)},Zt=()=>{wa(),T.style.display="none",T.style.transform="",T.style.transition="",T.style.height="",T.style.left=T.style.top="",T.style.right=T.style.bottom="",T.classList.remove(`${e}-kb`),P.style.display="flex",A(!1)},Co=()=>T.style.display==="none"?ct():Zt();P.addEventListener("click",ct),Vt.addEventListener("click",Zt);let en=null,To=()=>{let n=window.visualViewport;if(!n||en)return;let i=()=>{if(!Sn()||T.style.display==="none"){T.style.height="",T.style.bottom="",T.classList.remove(`${e}-kb`),Ae(mt());return}T.style.height=`${n.height}px`,T.style.top=`${n.offsetTop}px`,T.style.bottom="auto",T.classList.toggle(`${e}-kb`,n.height<window.innerHeight-80)};i(),n.addEventListener("resize",i),n.addEventListener("scroll",i),en=()=>{n.removeEventListener("resize",i),n.removeEventListener("scroll",i)}},wa=()=>{en?.(),en=null},tn=0,nn=!1;be.addEventListener("touchstart",n=>{!Sn()||n.touches.length!==1||(tn=n.touches[0].clientY,nn=!0,T.style.transition="none")},{passive:!0}),be.addEventListener("touchmove",n=>{if(!nn)return;let i=n.touches[0].clientY-tn;i>0&&(T.style.transform=`translateY(${i}px)`)},{passive:!0});let xa=n=>{if(!nn)return;nn=!1;let i=(n.changedTouches[0]?.clientY??tn)-tn;T.style.transition="transform var(--duration-fast) var(--ease-out)",i>110?(T.style.transform="translateY(100%)",window.setTimeout(Zt,230)):T.style.transform=""};be.addEventListener("touchend",xa,{passive:!0}),be.addEventListener("touchcancel",xa,{passive:!0});let Ge=!1,ya=n=>{Ge=n,T.classList.toggle(`${e}-expanded`,Ge),we&&(we.innerHTML=Ge?Er:Li,we.setAttribute("aria-label",r(Ge?"restoreChat":"expandChat")),we.title=r(Ge?"restore":"expand"))};we&&we.addEventListener("click",()=>{ya(!Ge),W(!0)});let ce=!1,$a=!1,Gn=!1,je=null,pt=null,Lt=null,At=null,ka=t.persistKey?`${fe}:adv:${t.persistKey}`:"",Ca=()=>{ft(ka,ce)},Ta=n=>{if(!Lt)return;let i=n;try{let s=new URL(n,location.href);i=s.pathname+s.search}catch{}Lt.textContent=i},ut=null,an=!1,Xn=()=>{try{return pt?.contentWindow?.location?.pathname??null}catch{return null}},rn=n=>{if(pt&&Zr(n)){try{ut=new URL(n,location.origin).pathname}catch{ut=null}pt.src=n,Ta(n)}},Qn=new Set,Lo=(n,i)=>{!pt||!t.getAdvancedUrl||ur({advanced:ce,canNavigate:!0,userConfirmedThisSession:Zi.has(n),userDriven:an,alreadyFollowed:Qn.has(n),path:i,currentPath:Xn()??ut})&&(Qn.add(n),rn(t.getAdvancedUrl(i)))},Ao=n=>gr({advanced:ce,livePath:n,currentPath:Xn()??ut}),La=n=>{if(Gn=n,T.classList.toggle(`${e}-pane-collapsed`,n),At){let i=n?t.expandPaneLabel||"Show page":t.collapsePaneLabel||"Hide page";At.setAttribute("aria-label",i),At.title=i}},Aa=()=>{lt.innerHTML="";let n=d("div",`${e}-pane-bar`),i=d("button",`${e}-icon ${e}-pane-collapse`);i.type="button",i.setAttribute("aria-label",t.collapsePaneLabel||"Hide page"),i.title=t.collapsePaneLabel||"Hide page",i.innerHTML=Ai,i.addEventListener("click",()=>La(!Gn)),At=i,Lt=d("div",`${e}-pane-url`),n.append(i,Lt);let s=d("iframe",`${e}-pane-frame`);s.setAttribute("title",t.advancedLabel||"App preview"),s.addEventListener("load",()=>{let u=Xn();if(u){if(Ta(u),ut===null){an=!0;return}u!==ut&&(an=!0)}});let p=d("div",`${e}-pane-body`);p.append(s),lt.append(n,p),pt=s,je=nr(s,{targetOrigin:t.advancedOrigin||location.origin})},Zn=()=>{je?.destroy(),je=null,pt=null,Lt=null,At=null,Ea(),lt.innerHTML=""},ei=null,Ea=()=>{let n=ei;if(ei=null,!!n)try{n()}catch{}},ti=!1,Sa=()=>{ti&&(ti=!1,Ea(),Aa(),t.getAdvancedUrl&&rn(t.getAdvancedUrl()))},Eo=(n,i,s)=>{if(!ce||!t.renderDataWidget)return!1;Zn(),ti=!0;let p=d("div",`${e}-pane-bar`),u=d("button",`${e}-icon`);u.type="button",u.setAttribute("aria-label",r("paneBackToPage")),u.title=r("paneBackToPage"),u.innerHTML=Ai,u.addEventListener("click",()=>Sa());let g=d("div",`${e}-pane-url`);g.textContent=r("paneShowingWidget"),p.append(u,g);let f=d("div",`${e}-pane-body`),b=d("div",`${e}-pane-widget`);f.append(b),lt.append(p,f);try{let y=t.renderDataWidget(b,n,i,s);y&&(ei=y)}catch{return Sa(),!1}return!0},Ma=()=>{if(!xe)return;xe.classList.toggle(`${e}-advbtn-on`,ce);let n=ce?t.exitAdvancedLabel||"Exit advanced view":t.advancedLabel||"Advanced view";xe.setAttribute("aria-label",n),xe.title=n},Ia=n=>{$a=n,T.classList.toggle(`${e}-advanced-full`,n)},ni=t.persistKey?`${fe}:advw:${t.persistKey}`:"",Xe=d("div",`${e}-resizer`);Xe.setAttribute("role","separator"),Xe.setAttribute("aria-orientation","vertical");let Ha=t.resizeLabel||"Resize panels";Xe.setAttribute("aria-label",Ha),Xe.title=Ha,T.insertBefore(Xe,lt);let So=n=>{let i=T.getBoundingClientRect().width||900,s=Math.max(360,i-360);return Math.round(Math.min(Math.max(n,320),s))},Ra=(n,i)=>{let s=So(n);T.style.setProperty("--aiw-chatw",`${s}px`),i&&Nt(ni,String(s))},Mo=()=>{let n=bi(ni);n&&Ra(parseInt(n,10),!1)},on=!1,Oa=n=>{on&&Ra(n.clientX-T.getBoundingClientRect().left,!0)},Na=()=>{on&&(on=!1,T.classList.remove(`${e}-resizing`),window.removeEventListener("pointermove",Oa),window.removeEventListener("pointerup",Na))};Xe.addEventListener("pointerdown",n=>{!ce||Gn||(n.preventDefault(),on=!0,T.classList.add(`${e}-resizing`),window.addEventListener("pointermove",Oa),window.addEventListener("pointerup",Na))}),Xe.addEventListener("dblclick",()=>{T.style.removeProperty("--aiw-chatw"),Nt(ni,null)});let sn=()=>{ce||!t.getAdvancedUrl||(ce=!0,La(!1),T.classList.add(`${e}-advanced`),zt(),Ia(!0),Mo(),Ge&&ya(!1),Aa(),an=!1,Qn.clear(),rn(t.getAdvancedUrl()),Ma(),Ca(),W(!0))},Io=()=>{ce&&(ce=!1,$a&&Ia(!1),T.classList.remove(`${e}-advanced`,`${e}-pane-collapsed`),Ae(mt()),Zn(),Ma(),Ca(),W(!0))};xe&&xe.addEventListener("click",()=>ce?Io():sn());let Qe=async(n,i)=>{if(n==="navigate"&&await En(i.path,()=>ge,Oe),ce&&je){if(et(n)||ze(n)){let u=await je.act(n,{target:i.target??"",...i.value!==void 0?{value:i.value}:{}});return u.ok?r("actionShownOnPage"):u.message||r("actionPageFailed")}let s=n==="navigate"?i.path??null:t.resolveActionPath?.(n,i)??null,p=at(s)?s:null;if(p!=null&&t.getAdvancedUrl)return rn(t.getAdvancedUrl(p)),r("actionOpened")}return t.onWidgetAction?t.onWidgetAction(n,i):void 0};qe&&t.listThreads&&qe.addEventListener("click",()=>void Oo()),vt.addEventListener("click",()=>{va(),se.focus()});let Pa=0;async function ii(){let n=!$&&!E.some(u=>u.role==="user");if(!t.getSuggestions||!n){ve.style.display="none",ve.innerHTML="";return}let i=++Pa,s=[];try{s=await t.getSuggestions()??[]}catch{s=[]}if(i!==Pa)return;let p=!$&&!E.some(u=>u.role==="user");if(s=s.filter(u=>u&&u.trim()).slice(0,4),ve.innerHTML="",!s.length||!p){ve.style.display="none";return}for(let u of s){let g=d("button",`${e}-suggestion`);g.type="button",g.textContent=u,g.addEventListener("click",()=>{ve.style.display="none",ve.innerHTML="",Ze(u)}),ve.appendChild(g)}ve.style.display="flex",W(!0)}function Ho(){if(!t.signupUrl)return;let n=d("div",`${e}-cta`),i=document.createElement("a");i.className=`${e}-cta-btn`,i.href=t.signupUrl,i.textContent=r("signupCta"),n.appendChild(i),N.appendChild(n),W(!0)}function Ro(){let n=E.filter(f=>f.content.trim().length>0);if(n.length===0)return;let i=n.map(f=>`${f.role==="user"?"You":l}:
|
|
772
|
+
${f.content}
|
|
773
|
+
`),s="\uFEFF"+[`${l} \u2014 conversation`,"=".repeat(40),"",...i].join(`
|
|
774
|
+
`),p=new Blob([s],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(p),g=document.createElement("a");g.href=u,g.download="copilot-conversation.txt",document.body.appendChild(g),g.click(),g.remove(),URL.revokeObjectURL(u)}async function Oo(){if(!t.listThreads)return;let n=d("div",`${e}-history`),i=d("div",`${e}-history-head`);i.textContent=r("pastConversations");let s=d("button",`${e}-history-back`);s.textContent=r("close"),s.addEventListener("click",()=>n.remove()),i.appendChild(s);let p=d("div",`${e}-history-list`);p.textContent=r("loading"),da(p),n.append(i,p),T.appendChild(n);try{let u=await t.listThreads();if(p.innerHTML="",!u.length){p.textContent=r("noConversations");return}let g="";for(let f of u.slice(0,50)){if(f.updatedAt){let x=yr(f.updatedAt);if(x!==g){g=x;let C=d("div",`${e}-history-sep`);C.textContent=r(x),p.appendChild(C)}}let b=d("button",`${e}-history-item`),y=d("span",`${e}-history-title`);if(y.textContent=f.title||r("untitledConversation"),b.appendChild(y),F(f.id)){let x=d("span",`${e}-act-spin`);x.title=r("threadAnswering"),x.setAttribute("aria-label",r("threadAnswering")),b.appendChild(x)}if(f.updatedAt){let x=d("span",`${e}-history-date`);x.textContent=$r(f.updatedAt),b.appendChild(x)}if(t.starThread){let x=d("span",`${e}-history-star`),C=!!f.starred;Ut.set(f.id,C);let K=()=>{x.textContent=C?"\u2605":"\u2606",x.style.color=C?"#f59e0b":"",x.title=r(C?"unstar":"star")};K(),x.addEventListener("click",pe=>{pe.stopPropagation();let ee=C;C=!C,K(),t.starThread(f.id).then(ie=>{C=ie.starred,Ut.set(f.id,C),Ue(),K()},()=>{C=ee,K()})}),b.appendChild(x)}b.addEventListener("click",()=>void Ba(f.id,n)),p.appendChild(b)}}catch{p.textContent=r("historyLoadFailed")}}async function Ba(n,i){if(t.loadThread)try{let s=await t.loadThread(n);j++,Je(s,n),w=n,Ue(),D(),H(),Kn(),i?.remove()}catch{i?i.querySelector(`.${e}-history-list`).textContent=r("threadOpenFailed"):Pn(r("historyLoadFailed"),"error")}}let ja=n=>{let i=n.detail;if(i?.threadId){ct(),Ba(i.threadId),i?.advanced&&sn();return}ct(i?.prompt,i?.newChat),i?.advanced&&sn()};t.openEventName&&window.addEventListener(t.openEventName,ja),ii(),gt(Ft)&&(ct(),gt(ka)&&sn()),Qt.addEventListener("submit",n=>{n.preventDefault();let i=se.value.trim();!i&&Ye.length===0||$||(se.value="",bt(""),Ze(i))});function No(n){let i=n;for(let[g,f]of Object.entries(Kt))for(let b=0;b<4;b++){let y=re(i,g);if(!y)break;i=y.stripped;let x=d("div",`${e}-widget ${e}-custom`);N.appendChild(x);try{let C=f(x,y.spec);C&&$t.push(C)}catch{x.remove()}W(!0)}for(let g=0;g<6;g++){let f=re(i,"widget");if(!f)break;i=f.stripped,Da(f.spec)}for(let g=0;g<4;g++){let f=re(i,"ui");if(!f)break;i=f.stripped,ai(f.spec)}for(let g=0;g<3;g++){let f=re(i,"preview");if(!f||typeof f.spec.html!="string")break;i=f.stripped,Ua(f.spec)}let s=re(i,"navigate");s&&(i=s.stripped,t.onWidgetAction&&s.spec.path&&at(s.spec.path)&&ri(s.spec));for(let g=0;g<4;g++){let f=re(i,"action");if(!f)break;i=f.stripped,t.onWidgetAction&&f.spec.name&&Do(f.spec)}let p=re(i,"chips");p&&Array.isArray(p.spec.options)&&(i=p.stripped,_o(p.spec));let u=Mi(i);if(u)i=u.stripped,(t.onWidgetAction||t.onLead)&&za(u.spec);else if(i.includes(ht)){if(i=i.replace(ht,"").trim(),!(t.onLead||t.onWidgetAction))return Fa(i);za({action:"lead",fields:[{name:"email",type:"email",placeholder:"you@company.com",required:!0}],submit:r("send")})}return i=Fa(i),i}function Fa(n){if(!t.onWidgetAction||!ge.length)return n;let i=ge.filter(g=>typeof g.path=="string"&&!!g.path&&typeof g.title=="string"&&!!g.title&&!g.action);if(!i.length)return n;let s=/^[\s>*+\-•·–—↗→▶►]*\s*(?:open|go to|goto|visit|view|see|aç|git|görüntüle)?\s+/i,p=[],u=0;for(let g of n.split(`
|
|
775
|
+
`)){let f=g.trim();if(u<2&&f&&f.length<=60){let b=f.replace(s,"").replace(/\s+(?:page|sayfası|sayfasına)$/i,"").replace(/[.:;;→↗\s]+$/u,"").trim().toLowerCase(),y=i.find(x=>{let C=x.title.toLowerCase();return b===C||b===`the ${C}`});if(y){ri({path:y.path,label:y.title}),u+=1;continue}}p.push(g)}return p.join(`
|
|
776
|
+
`)}let Po=t.proposalTitles??{},Bo=(n,i)=>t.proposalSummary?.(n,i)||Ln(i);function jo(n){let i=d("div",`${e}-question`);n.critical&&i.classList.add(`${e}-question-critical`);let s=d("div",`${e}-question-title`);if(s.textContent=n.prompt,i.appendChild(s),n.context){let f=d("div",`${e}-question-ctx`);f.textContent=n.context,i.appendChild(f)}let p=f=>{i.innerHTML="",i.classList.add(`${e}-question-done`);let b=d("div",`${e}-question-answer`);b.textContent=f,i.appendChild(b)},u=d("div",`${e}-question-err`);u.textContent=r("questionSendFailed"),u.style.display="none";let g=(f,b)=>{let y=f.map(C=>n.options?.find(K=>K.id===C)?.label??C).filter(Boolean),x=y.length?y.join(", "):(b??"").trim();if(x){if($){u.style.display="";return}t.onAnswer?.({questionId:n.questionId,optionIds:f,text:b}),Ze(x),p(x)}};if(n.options?.length){let f=d("div",`${e}-question-opts`),b=new Set,y=n.multi?d("button",`${e}-question-send`):null;y&&(y.type="button",y.textContent=r("questionConfirm"),y.disabled=!0,y.addEventListener("click",()=>g([...b])));for(let x of n.options){let C=d("button",`${e}-question-opt`);C.type="button";let K=d("span",`${e}-question-opt-label`);if(K.textContent=x.label,C.appendChild(K),x.description){let pe=d("span",`${e}-question-opt-desc`);pe.textContent=x.description,C.appendChild(pe)}C.addEventListener("click",()=>{if(!n.multi){g([x.id]);return}b.has(x.id)?b.delete(x.id):b.add(x.id),C.classList.toggle(`${e}-question-opt-on`,b.has(x.id)),y&&(y.disabled=b.size===0)}),f.appendChild(C)}i.appendChild(f),y&&i.appendChild(y)}else{let f=d("div",`${e}-question-free`),b=d("input",`${e}-question-input`);b.type="text",b.placeholder=r("questionPlaceholder");let y=d("button",`${e}-question-send`);y.type="button",y.textContent=r("questionConfirm");let x=()=>{let C=b.value.trim();C&&g([],C)};y.addEventListener("click",x),b.addEventListener("keydown",C=>{C.key==="Enter"&&x()}),f.appendChild(b),f.appendChild(y),i.appendChild(f)}i.appendChild(u),N.appendChild(i),W(!0)}function _a(n,i,s,p=[],u,g){let f=d("div",`${e}-proposal ${e}-proposal-pending`),b=d("div",`${e}-proposal-title`),y=[];if(s){let O=d("span",`${e}-act-agent`);O.textContent=s,O.style.marginRight="6px",b.appendChild(O)}b.appendChild(document.createTextNode(Po[n]??r("proposalGeneric"))),f.appendChild(b);let x;if(n==="add_scraped_media"){let O=typeof i.url=="string"?i.url:"";if(O&&i.type==="video"){let Y=d("video",`${e}-proposal-media`);Y.src=O,Y.controls=!0,Y.preload="metadata",Y.playsInline=!0,typeof i.poster=="string"&&i.poster&&(Y.poster=String(i.poster)),f.appendChild(Y)}else if(O){let Y=d("img",`${e}-proposal-media`);Y.src=O,Y.loading="lazy",Y.alt=typeof i.alt=="string"&&i.alt?String(i.alt):"Web image preview",f.appendChild(Y)}}for(let O of p){let Y=d("label",`${e}-proposal-edit`),U=Ii({name:O.arg,...O.type?{type:O.type}:{},...O.label?{label:O.label}:{},...O.options?{options:O.options}:{},...O.required?{required:O.required}:{},value:Gr(i[O.arg])?String(i[O.arg]):"",...O.placeholder?{placeholder:O.placeholder}:{}});if(O.label&&!U.selfLabelled){let ue=d("span",`${e}-proposal-edit-label`);ue.textContent=O.label,Y.appendChild(ue)}Y.appendChild(U.node),f.appendChild(Y),y.push({arg:O.arg,type:O.type??"text",required:!!O.required,read:U.read,node:U.node})}let C=Bo(n,i);if(C){let O=d("div",`${e}-proposal-summary`);O.textContent=C,f.appendChild(O)}let K=d("div",`${e}-proposal-err`);K.textContent=r("requiredFields"),K.style.display="none",y.length&&f.appendChild(K);let pe=d("div",`${e}-confirm-row`),ee=d("button",`${e}-nav-btn`);ee.type="button",ee.textContent=r("apply");let ie=d("button",`${e}-confirm-no`);ie.type="button",ie.textContent=r("dismiss"),ie.addEventListener("click",()=>{x?.(),f.remove()}),ee.addEventListener("click",async()=>{let O={...i},Y=[];for(let U of y){U.node.classList.remove(`${e}-field-invalid`);let ue=U.read();if(U.type==="checkbox"){let _=An(ue);if(U.required&&!_){Y.push(U.node);continue}O[U.arg]=_;continue}if(!ue){if(U.required){Y.push(U.node);continue}delete O[U.arg];continue}if(U.type==="number"){let _=Number(ue);O[U.arg]=Number.isFinite(_)?_:ue;continue}O[U.arg]=ue}if(Y.length){for(let U of Y)U.classList.add(`${e}-field-invalid`);K.style.display="";return}K.style.display="none",ee.disabled=!0,ee.textContent=r("applying");try{let U=await t.onApplyProposal(n,w?{...O,threadId:w}:O,u||g?{...u?{accountId:u}:{},...g?{artifactId:g}:{}}:void 0),ue=typeof U=="string"?U:U?.message,_=U&&typeof U=="object"?U.jobId:void 0;x?.(),f.classList.remove(`${e}-proposal-pending`),f.innerHTML="";let ne=d("div",`${e}-proposal-ok`);ne.innerHTML=`<span class="${e}-act-ok" aria-hidden="true">\u2713</span><span>${G(Ui(ue||r("applied")))}</span>`,f.appendChild(ne);let de=U&&typeof U=="object"?U.reportId:void 0;de?ea({kind:"report",id:de}):_&&ea({kind:"job",id:_});let Le=de?t.reportHref?.(de):void 0;if(Le){let St=d("a",`${e}-proposal-link`);St.href=Le,St.textContent=r("openReport"),ne.appendChild(St)}}catch{ee.disabled=!1,ee.textContent=r("tryAgain")}}),pe.append(ee,ie),f.appendChild(pe),N.appendChild(f),W(!0)}async function Fo(n,i){if(t.loadThread){V.add(n),D();try{for(let s=0;s<90&&!L.signal.aborted;s++){if(await new Promise(f=>setTimeout(f,1e4)),L.signal.aborted)return;let p;try{p=await t.loadThread(n)}catch{continue}let u=p.filter(f=>"role"in f),g=u[u.length-1];if(!(!g||g.role!=="assistant")){if(i!==null){let f=[...u].reverse().find(b=>b.role==="user");if(!f||f.content.trim()!==i.trim())continue}V.delete(n),D(),w===n&&(Je(p,n),Wt(),W(),H());return}}}finally{V.delete(n),D()}}}async function Ze(n,i){let s=i?.regenerate===!0,p=j,u=w,g=()=>j===p&&!L.signal.aborted;V.add(u??z),D(),s||(le=n);let f=Ye.splice(0);Yn(),ve.style.display="none",ve.innerHTML="",dt.disabled=!0,Vn("talk"),s||(nt(N,"user",n,f.length?f:void 0),E.push({role:"user",content:n,...f.length?{attachments:f}:{}})),H();let b=d("div",`${e}-typing`);b.innerHTML="<span></span><span></span><span></span>",N.appendChild(b),W(!0);let y=null,x="",C=!1,K=[],pe=0,ee=0,ie=null,O,Y,U=Date.now(),ue=!1,_=0,ne=M=>{let te=y,Q=M?x:x.slice(0,_);return x=M?"":x.slice(_),_=0,te?(y=null,te.classList.remove(`${e}-streaming`),Q.trim()?(M&&(Q=No(Q)),E.push({role:"assistant",content:Q}),T.style.display==="none"&&me({state:"unread",count:X.count+1}),na(te,Q,!0),te):(te.remove(),null)):null},de=M=>M==="widget"||M==="ui"||M==="preview"||Kt[M]?"now":M==="navigate"||M==="action"||M==="chips"||M==="form"?"later":null,Le=M=>{if(!M)return;y||(b.remove(),y=nt(N,"assistant",""),y.classList.add(`${e}-streaming`));let te=kr(M);if(te){let Q=d("span",`${e}-tok`);Q.textContent=te,y.appendChild(Q)}},St=(M,te)=>{let Q=Kt[M];if(Q){let he=d("div",`${e}-widget ${e}-custom`);N.appendChild(he);try{let _e=Q(he,te);_e&&$t.push(_e)}catch{he.remove()}W(!0);return}if(M==="widget"){Da(te);return}if(M==="ui"){ai(te);return}let Fe=te;typeof Fe.html=="string"&&Ua(Fe)},Uo=()=>{for(;;){let M=x.slice(_);if(!M)return;let te=M.indexOf("[[");if(te<0){let cn=M.endsWith("[")?M.length-1:M.length;Le(M.slice(0,cn)),_+=cn;return}if(te>0){Le(M.slice(0,te)),_+=te;continue}let Q=/^\[\[([a-z-]{1,24})(:|\]\])?/i.exec(M);if(!Q){if(M.length<=2)return;Le("[["),_+=2;continue}if(!Q[2]&&M.length===2+Q[1].length)return;if(Q[2]==="]]"){if(`[[${Q[1]}]]`===ht){_+=Q[0].length;continue}Le("[["),_+=2;continue}if(!Q[2]){Le("[["),_+=2;continue}let Fe=de(Q[1]);if(!Fe){Le("[["),_+=2;continue}let he=re(M,Q[1]);if(!he||he.start!==0){if(M.length>2e4){Le("[["),_+=2;continue}return}if(Fe==="later"){_+=he.end;continue}let _e=M.slice(he.end);x=x.slice(0,_),ne(!1),St(Q[1],he.spec),x=_e,_=0}};try{let M=t.getToken?await t.getToken():t.token,te=t.getContext?await t.getContext():void 0,Q=ce&&je&&te&&typeof te=="object"?{...te,path:je.getPath()??te.path,uiTargets:je.getTargets()}:te,Fe=Q?.navTargets;Array.isArray(Fe)&&(ge=Fe);let he=await fetch(t.endpoint,{method:"POST",headers:{"content-type":"application/json",...M?{authorization:`Bearer ${M}`}:{}},credentials:t.withCredentials?"include":"same-origin",signal:L.signal,body:JSON.stringify({...t.extraBody??{},...Q?{pageContext:Q}:{},accountId:t.getAccountScope?.()??t.accountId??"",threadId:w,content:n,...f.length?{attachments:f.map(_e=>_e.mediaId)}:{},...i?.parentId!==void 0?{parentId:i.parentId}:{},...i?.regenerate?{regenerate:!0}:{}})});if(!he.ok||!he.body)ie=`Server error (${he.status}).`;else{let _e=he.body.getReader(),cn=new TextDecoder,Mt="";for(;;){let{done:Ko,value:Yo}=await _e.read();if(Ko)break;Mt+=cn.decode(Yo,{stream:!0});let di;for(;(di=Mt.indexOf(`
|
|
777
|
+
`))>=0;){let Go=Mt.slice(0,di).trim();Mt=Mt.slice(di+1);let I=xr(Go);if(!I)continue;I.threadId&&(u!==I.threadId&&(V.delete(u??z),u=I.threadId,V.add(u)),g()&&(w=I.threadId,Ue()));let Ka=I.text??I.d;if(Ka&&g()&&(x+=Ka,C=!0,Uo(),W()),I.type==="widget"&&g()&&(b.remove(),ne(!1),qa(I.spec,I.rows,I.comparisonRows),C=!0),I.type==="activity"&&I.label&&I.status&&g()&&(b.remove(),I.status==="running"&&(ne(!1),I.name&&ua[I.name]&&Vn(ua[I.name])),io(I.callId??I.label,I.label,I.status,I.agent,I.model),C=!0),I.type==="question"&&I.questionId&&I.prompt&&g()&&(b.remove(),ne(!1),jo(I),C=!0),I.type==="tool_proposal"&&I.name&&t.onApplyProposal&&(K.push({name:I.name,args:I.args??{},agent:I.agent,fields:Xr(I.fields),accountId:I.accountId,artifactId:I.artifactId}),C=!0),I.type==="quota"&&(typeof I.granted=="number"&&(qn=I.granted),typeof I.remaining=="number"&&(Me=I.remaining),la(),I.exhausted&&Ho()),I.type==="usage"){pe+=I.inputTokens??0,ee+=I.outputTokens??0;let Ya=(I.inputTokens??0)+(I.outputTokens??0);Un+=Ya,Me!==null&&(Me=Math.max(0,Me-Ya)),la()}I.type==="meta"&&I.isStaff&&I.modelLabel&&(Dt.textContent=I.modelLabel,Dt.hidden=!1),I.type==="done"&&(I.messageId&&(O=I.messageId),I.model&&(Y=I.model)),I.type==="error"&&I.message&&(ie=I.message)}}}}catch(M){ue=!0,ie=M.message||"Network error."}finally{V.delete(u??z),D(),g()&&se.focus(),ha(),w===u&&Kn()}if(ue&&u&&t.loadThread){b.remove(),g()&&oi(r("streamLostRecovering")),Fo(u,s?null:n);return}if(!g()){if(b.remove(),u&&w===u&&t.loadThread){try{Je(await t.loadThread(u),u)}catch{}for(let M of K)_a(M.name,M.args,M.agent,M.fields,M.accountId,M.artifactId);Wt(),W(),H()}return}b.remove();let Va=ne(!0);for(let M of K)_a(M.name,M.args,M.agent,M.fields,M.accountId,M.artifactId);if(K.length&&W(),!C)ie?oi(ie):(nt(N,"assistant","(no response)"),W(!0));else{if(ie&&oi(ie),pe+ee>0){let M=ia(pe,ee);Va?Va.insertAdjacentElement("afterend",M):N.appendChild(M)}Wt(),W()}H();let Wo=!!N.querySelector(`.${e}-proposal-pending`),Vo=!!N.querySelector(`.${e}-error`);if(u&&t.loadThread&&t.setActiveLeaf&&!Wo&&!Vo)try{let M=await t.loadThread(u);g()&&Je(M,u)}catch{}else if(O&&t.vote&&C&&g()){let M=d("div",`${e}-msgactions ${e}-assistant`);M.appendChild(aa(O,Y)),N.appendChild(M),W()}let ln=u??z,Ja=(sa.get(ln)??0)+1;sa.set(ln,Ja);let Jo=Date.now()-U;g()&&O&&t.vote&&Ja>1&&!oa.has(ln)&&(ie||Jo>=q)&&(oa.add(ln),ho(ie?"failed":"slow",O,Y))}function za(n){let i=d("div",`${e}-lead`);if(n.title){let f=d("div",`${e}-form-title`);f.textContent=n.title,i.appendChild(f)}let s=d("form",`${e}-lead-form`),p=[];for(let f of n.fields.slice(0,8)){let b=Ii(f);s.appendChild(b.node),p.push({name:f.name,get:b.read,required:!!f.required,boolish:f.type==="checkbox",node:b.node})}let u=d("div",`${e}-form-err`);u.textContent=r("requiredFields"),u.style.display="none",s.appendChild(u);let g=d("button",`${e}-lead-btn`);g.type="submit",g.textContent=n.submit??r("submit"),s.appendChild(g),i.appendChild(s),N.appendChild(i),W(!0),s.addEventListener("submit",async f=>{f.preventDefault();let b={};for(let x of p)b[x.name]=x.get();let y=p.filter(x=>{if(!x.required)return!1;let C=b[x.name];return x.boolish?!An(C):!C});for(let x of p)x.node.classList.toggle(`${e}-field-invalid`,y.includes(x));if(y.length){u.style.display="";let x=y[0]?.node;(x?.matches("input,select,textarea")?x:x?.querySelector("input,select,textarea"))?.focus();return}u.style.display="none",g.disabled=!0,g.textContent=r("sending");try{let x;t.onWidgetAction?x=await t.onWidgetAction(n.action,b):t.onLead&&n.action==="lead"&&await t.onLead({email:b.email??"",context:le}),i.innerHTML="";let C=d("div",`${e}-lead-ok`);C.textContent=typeof x=="string"&&x||r("done"),i.appendChild(C)}catch{g.disabled=!1,g.textContent=r("tryAgain")}})}let{renderWidget:Da,renderUiCard:ai,renderServerWidget:qa,renderChips:_o,renderPreview:Ua,operateConfirmText:zo}=zr({L:r,log:N,scrollDown:W,send:Ze,richDisposers:$t,dispatchAction:Qe,subscribeJob:so,showPaneWidget:Eo,input:se,opts:t});function ri(n,i=!1){let s=d("div",`${e}-nav`),p=n.label||"Open page";if((We||ce)&&!i){let g=d("div",`${e}-autonav`);g.innerHTML=`${kn}<span>${G(r("actionOpening",{label:p}))}</span>`,s.appendChild(g),N.appendChild(s),W(!0),Promise.resolve(Qe("navigate",{path:n.path})).then(f=>{g.querySelector("span").textContent=typeof f=="string"&&f||r("actionDone",{label:p})},()=>{g.querySelector("span").textContent=r("actionOpenFailed",{label:p})});return}let u=d("button",`${e}-nav-btn`);u.type="button",u.innerHTML=`<span>${G(p)}</span> <span aria-hidden="true">\u2192</span>`,u.addEventListener("click",async()=>{u.disabled=!0;try{let g=await Qe("navigate",{path:n.path});u.innerHTML=`<span>${G(typeof g=="string"&&g||r("actionDone",{label:p}))}</span>`}catch{u.disabled=!1,u.innerHTML=`<span>${G(r("actionRetry",{label:p}))}</span>`}}),s.appendChild(u),N.appendChild(s),W(!0)}function Do(n){pa[n.name]&&Vn(pa[n.name]);let i=d("div",`${e}-nav`);if(ze(n.name)&&!n.confirm&&(n={...n,confirm:zo(n)}),(We||ce)&&hn(n.name)&&!n.confirm){let g=n.label||"Opening\u2026",f=d("div",`${e}-autonav`);f.innerHTML=`${kn}<span>${G(r("actionOpening",{label:g}))}</span>`,i.appendChild(f),N.appendChild(i),W(!0),Promise.resolve(Qe(n.name,n.data??{})).then(b=>{f.querySelector("span").textContent=typeof b=="string"&&b||r("actionDone",{label:g})},()=>{f.querySelector("span").textContent=r("actionRunFailed",{label:g})});return}let s=d("button",`${e}-nav-btn`);s.type="button";let p=n.label||"Run";s.innerHTML=`<span>${G(p)}</span>`;let u=async()=>{s.disabled=!0;try{let g=await Qe(n.name,n.data??{});s.innerHTML=`<span>${G(typeof g=="string"&&g||r("actionDone",{label:p}))}</span>`}catch{s.disabled=!1,s.innerHTML=`<span>${G(r("actionRetry",{label:p}))}</span>`}};s.addEventListener("click",()=>{if(n.confirm){i.innerHTML="";let g=d("div",`${e}-confirm-q`);g.textContent=n.confirm;let f=d("div",`${e}-confirm-row`),b=d("button",`${e}-nav-btn`);b.type="button",b.textContent=r("confirm");let y=d("button",`${e}-confirm-no`);y.type="button",y.textContent=r("cancel"),b.addEventListener("click",()=>{i.innerHTML="",i.appendChild(s),s.innerHTML=`<span>${G(p)}</span>`,u()}),y.addEventListener("click",()=>i.remove()),f.append(b,y),i.append(g,f),W(!0)}else u()}),i.appendChild(s),N.appendChild(i),W(!0)}function oi(n){let i=d("div",`${e}-error`),s=d("div",`${e}-error-text`);s.textContent=r("errorSnag",{name:l});let p=d("div",`${e}-error-detail`);p.textContent=n;let u=d("div",`${e}-error-actions`),g=d("button",`${e}-error-btn ${e}-error-retry`);if(g.setAttribute("type","button"),g.textContent=r("tryAgain"),g.addEventListener("click",()=>{i.remove(),le&&Ze(le)}),u.appendChild(g),t.onReportIssue){let f=d("button",`${e}-error-btn`);f.setAttribute("type","button"),f.textContent=r("reportIssue"),f.addEventListener("click",async()=>{f.disabled=!0,f.textContent=r("reporting");try{await t.onReportIssue({error:n,lastUserMessage:le,threadId:w}),f.textContent=r("reported")}catch{f.textContent=r("reportFailed"),f.disabled=!1}}),u.appendChild(f)}i.append(s,p,u),N.appendChild(i),W(!0)}let qo=$n(n=>{let i=t.getAccountScope?.()??t.accountId;i&&n.accountId&&n.accountId!==i||n.domains?.includes("ai")&&($||!w||!t.loadThread||N.querySelector(`.${e}-proposal-pending`)||t.loadThread(w).then(s=>Je(s)).catch(()=>{}))});vo();let Et=()=>{typeof navigator>"u"||(navigator.onLine?X.state==="offline"&&me({state:"resting"}):me({state:"offline"}))};window.addEventListener("online",Et),window.addEventListener("offline",Et),Et();let si=0,Wa=null,dn=()=>{window.clearTimeout(si),si=window.setTimeout(()=>{if(X.ground!=="auto")return;let n=J();n!==Wa&&(Wa=n,Z())},140)};return window.addEventListener("scroll",dn,{passive:!0}),window.addEventListener("resize",dn,{passive:!0}),Z(),{open:ct,close:Zt,toggle:Co,registerRenderer:qi,setLauncher:me,destroy(){L.abort(),qo(),t.openEventName&&window.removeEventListener(t.openEventName,ja),window.removeEventListener("resize",Ni),window.removeEventListener("online",Et),window.removeEventListener("offline",Et),window.removeEventListener("scroll",dn),window.removeEventListener("resize",dn),window.clearTimeout(si),wa(),Nn(),Zn(),P.remove(),T.remove()}}}return ns(Is);})();
|
|
778
|
+
//# sourceMappingURL=sgiant-ai-widget.global.js.map
|