@aquera/data-visualizer-sdk 0.0.1 → 0.0.3

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/chunk-6B33KNVC.js DELETED
@@ -1,13 +0,0 @@
1
- import{A as ue,Ba as Ze,C as Bt,D as Ut,E as Wt,Fa as mn,G as Fe,Ga as et,Ha as hn,I as Gt,J as jt,K as Ht,L as Yt,M as Qt,N as Kt,O as Te,P as Xt,Q as Jt,R as Zt,S as en,T as tn,V as nn,W as Oe,X as qe,Z as De,_ as Ee,a as mt,b as ht,ba as Ie,ca as Ve,d as Mt,da as ze,e as St,ea as Re,fa as Ne,g as ne,ga as $e,h as _e,ha as Le,i as Ft,ia as Be,j as Tt,ja as on,ka as an,l as Ot,la as rn,m as qt,ma as sn,n as Dt,p as Et,pa as ln,qa as dn,r as It,ra as cn,s as Vt,sa as Je,t as zt,ta as pn,u as Rt,ua as ge,v as Nt,va as _n,w as K,wa as un,x as $t,xa as oe,y as ie,ya as gn,z as Lt}from"./chunk-JXQ2DURN.js";import{$b as vt,Ab as w,Eb as g,Gb as r,Ja as Qe,Jb as yt,Ka as Pe,Kb as ce,La as l,Lb as pe,N as le,Ob as Me,Pb as te,Qb as H,Rb as Xe,S as $,Sb as p,Tb as A,Ub as T,Vb as J,X as _,Y as u,ab as de,ac as Ce,cc as wt,ea as ft,ec as kt,fb as bt,fc as At,ha as Ct,ia as x,jc as D,la as Ae,lb as q,mb as f,mc as Se,nb as C,nc as Pt,ob as re,p as I,pa as xt,qb as V,rb as z,sb as y,tb as s,ub as d,vb as h,zb as Ke}from"./chunk-F6ZDDRJ7.js";import{a as b,b as P,d as ke}from"./chunk-ZW5NV4UO.js";function fn(){return{baseUrl:K.baseUrl??"",mcpUrl:K.MCP_URL??"",adminApiUrl:K.ADMIN_API_URL??"",utilitiesUrl:K.UTILITIES_ENGINE_URL??"",proxyUrl:K.PROXY_BASEAPI_URL??"",tokenizedOrigins:[K.baseUrl,K.ADMIN_API_URL,K.MCP_URL,K.UTILITIES_ENGINE_URL,K.PROXY_BASEAPI_URL].filter(i=>!!i),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,onUnauthorized:null,ssoEnabled:K.SSO_ENABLED??!1,features:{mcpGateway:K.MCP_GATEWAY_ENABLED??!1,forecast:!0,connections:!0,attachments:!0,stories:!1,promptGallery:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:Hn(),routing:"none",initial:{dashboardId:null,conversationId:null}}}function Hn(){return{composerPlaceholder:"Ask anything about your workforce data\u2026",welcomeTitle:"What would you like to ask?",welcomeSubtitle:"Ask anything about your workforce data.",dropFilesOverlay:"Drop images or Excel files to attach",replyButton:"Reply",defineItButton:"Define it",submitAnswersButton:"Submit answers",givePlanButton:"Give me the plan \u2192",somethingElseButton:"Something else? Tell me what to do \u2192",chatDraftPlaceholderWidget:"Tell me what to check instead\u2026",chatDraftPlaceholderClarification:"Tell me more\u2026",filterValuePlaceholder:"Value\u2026",promptGallerySearchPlaceholder:"Search prompts\u2026",promptGalleryLabel:"Prompt gallery",noPromptsMatch:"No prompts match",noPromptsYet:"No prompts yet.",noChoiceOptions:"No options available to choose from.",noChartTypesFit:"No other chart types fit this widget's data.",noFilterableFields:"No filterable fields found for this chart's data.",dashboardNamePlaceholder:"Enter a name\u2026",saveDashboardDialogLabel:"Save as dashboard",saveDashboardButton:"Save dashboard",cancelButton:"Cancel",applyButton:"Apply",forecastSettingsLabel:"Forecast settings",forecastButton:"Forecast",removeForecastButton:"Remove forecast",newConversationLabel:"New conversation",newDashboardLabel:"New dashboard",noConversationsYet:"No conversations yet",noDashboardsYet:"No dashboards yet",noDatasetsFound:"No datasets found",noPipelinesFound:"No pipelines found",createAlertButton:"Create alert",addToLibraryButton:"Add to library",addToDashboardButton:"Add to dashboard",addToCurrentDashboardButton:"Add to current dashboard",addToStoryButton:"Add to Story",publishAsDashboardButton:"Publish as a new dashboard",viewButton:"View",recomputeButton:"Recompute",connectionsTitle:"Connections",connectionsBreadcrumbHome:"Ask Aquera",registerConnectionTitle:"Register connection",registerConnectionButton:"Register connection",registerAndTestButton:"Register & test",registeringButton:"Registering\u2026",testConnectionButton:"Test",loadingConnections:"Loading connections\u2026",noConnectionsTitle:"No connections yet",noConnectionsSub:"Register a connection to start using Ask Aquera with your data source.",connectionNamePlaceholder:"Primary",displayNamePlaceholder:"My workforce data",errors:{assistantErrorFallback:"Failed to generate a response. Please try again.",connectionTestFailedFallback:"Connection failed",couldntForecastWidget:"Couldn't forecast this widget.",couldntLoadDatasetsOrPipelines:"Failed to load datasets / pipelines",couldntOpenConversation:"Couldn't open that conversation. Please try again.",couldntDeleteConversation:"Couldn't delete that conversation. Please try again.",couldntCreateDashboard:"Couldn't create the dashboard. Please try again.",couldntRenameConversation:"Couldn't rename that conversation. Please try again.",tooManyExcelAttachments:"You can attach up to 10 Excel files.",tooManyNonExcelAttachments:"You can attach only one non-Excel file.",unsupportedFileType:"isn't a supported file type.",fileTooLarge:"is larger than 10 MB.",couldntUpdateForecast:"Couldn't update that forecast. Please try again.",couldntSaveToLibrary:"Couldn't save that to your widget library. Please try again.",couldntApplyFilter:"Couldn't apply that filter. Please try again.",couldntAddToDashboard:"Couldn't add this to the dashboard. Please try again.",couldntPublishDashboard:"Couldn't publish the dashboard. Please try again.",couldntRenameDashboard:"Couldn't rename the dashboard. Please try again.",couldntGenerateSummary:"Failed to generate summary.",couldntSaveDashboard:"Couldn't save the dashboard. Please try again.",chartTypeChangeFailed:"Chart type change failed"}}}var Cn=Dt("dvz-ask",fn);function E(){return Cn.read()}function tt(i){let t=fn(),e=P(b(b({},t),me(i)),{features:b(b({},t.features),me(i.features??{})),ui:b(b({},t.ui),me(i.ui??{})),copy:P(b(b({},t.copy),me(i.copy??{})),{errors:b(b({},t.copy.errors),me(i.copy?.errors??{}))}),initial:b(b({},t.initial),me(i.initial??{})),headers:b(b({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),Cn.write(e)}async function Ue(){return Et(E())}function me(i){let t={};for(let[e,n]of Object.entries(i))n!==void 0&&(t[e]=n);return t}var se=class i{http=$(_e);tokenStore=$(ie);get customerId(){return this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,c,m,k){let S=`${E().baseUrl}/api/customers/${this.customerId}/products/${ue()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,M=(o??[]).filter(v=>v&&v.value!=null&&String(v.value).trim()!=="");return M.length&&(S+=`&filters=${encodeURIComponent(JSON.stringify(M))}`),a&&Object.keys(a).length&&(S+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),m&&m.length&&(S+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(m))}`),c&&(S+=`&dashboardId=${encodeURIComponent(c)}`),k&&(S+=`&conversationId=${encodeURIComponent(k)}`),I(this.http.get(S))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=le({token:i,factory:i.\u0275fac,providedIn:"root"})};var nt=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],xn=10*1024*1024,it=1,ot=10,Yn=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function at(i,t){return Yn.includes(t)||/\.(xls|xlsx)$/i.test(i)}var he=class i{http=$(_e);tokenStore=$(ie);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return E().customerId??this.tokenStore.tenantId()??""}get productId(){return E().productId??ue()}get baseUrl(){return`${E().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}mcpGatewayUrl(){return`${E().baseUrl}/dviz-mcp`}async callMcpTool(t,e={},n){let o=this.customerId,a=this.productId,c=b({},n);o!==this.lastSentCustomerId&&(c.customerId=o),a!==this.lastSentProductId&&(c.productId=a);let m;try{m=await I(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:c})),this.lastSentCustomerId=o,this.lastSentProductId=a}catch(S){throw S instanceof ne?new Error(S.error?.error?.message||S.error?.message||S.message):S}if(m.error)throw new Error(m.error.message);let k=m.result;if(k?.isError)throw new Error(k.structuredContent?.error?.message??k.content?.[0]?.text??`${t} failed`);return k?.structuredContent??{}}async listConversations(t=30){return!this.customerId||!this.productId?[]:E().features.mcpGateway?(await this.callMcpTool("listConversations",{limit:t,status:"active"}))?.conversations??[]:(await I(this.http.get(`${this.baseUrl}/conversations?limit=${t}&status=active`)))?.data??[]}async getConversation(t){if(!t)return null;if(!E().features.mcpGateway){let m=await I(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!m?.data)return null;let a=m.data,{messages:k}=a;return{conversation:ke(a,["messages"]),messages:k??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let c=e.conversation,{messages:n}=c;return{conversation:ke(c,["messages"]),messages:n??[]}}async updateConversation(t,e){await I(this.http.patch(`${this.baseUrl}/conversations/${t}`,e))}async deleteConversation(t){if(!E().features.mcpGateway){await I(this.http.delete(`${this.baseUrl}/conversations/${t}`));return}await this.callMcpTool("deleteConversation",{conversationId:t})}async streamChat(t,e,n,o,a,c,m,k){return c?.length||!E().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,c,m,k):this.sendChatViaGateway(t,e,n,o,a)}async sendChatViaGateway(t,e,n,o,a){let c={message:e};t&&(c.conversationId=t),o&&(c.connectionId=o);let m=Date.now(),k=new URL(this.mcpGatewayUrl());k.searchParams.set("customerId",this.customerId),k.searchParams.set("productId",this.productId);let S=this.tokenStore.accessToken()??"",M=!1,v=!1,N=F=>{switch(M=!0,F?.kind){case"text":n.onText(F.text??"");break;case"toolCall":n.onToolStart(F.toolId,F.uiLabel??"");break;case"toolResult":n.onToolResult(F.toolId,F.uiDetail??"",!!F.error);break;case"data":{let O=F.payload;O?.data_type==="adhoc_viz"?n.onDataPart(O):O?.data_type==="dashboard_title"?n.onDashboardTitle?.(O.data?.title??""):O?.data_type==="choice"?n.onChoice?.(O.data):O?.data_type==="layout_patch"&&n.onLayoutPatch?.(O.data);break}case"error":n.onError(F.message??"Unknown error");break}},X=F=>{if(F?.isError){let L=F.structuredContent?.error?.message??F.content?.[0]?.text??"askAquera failed";n.onError(L),n.onFinish("error",t??""),v=!0;return}let O=F?.structuredContent??{};if(!M){n.onText(O.responseText??O.text??""),O.dashboardTitle&&n.onDashboardTitle?.(O.dashboardTitle);let L=O.widget?[O.widget]:O.widgets??[];for(let G of L)n.onDataPart({type:"data",data_type:"adhoc_viz",version:1,data:G})}n.onFinish("stop",O.conversationId??t??""),v=!0},Y=F=>{if(F.method==="notifications/gateway/stream"){N(F.params??{});return}if(F.id===m){if(F.error){n.onError(F.error.message??"askAquera failed"),n.onFinish("error",t??""),v=!0;return}X(F.result)}},B;try{B=await fetch(k.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${S}`},body:JSON.stringify({jsonrpc:"2.0",id:m,method:"tools/call",params:{name:"askAquera",arguments:c}}),signal:a})}catch(F){if(F instanceof DOMException&&F.name==="AbortError")throw F;n.onError(F instanceof Error?F.message:String(F)),n.onFinish("error",t??"");return}if(!B.ok){let F=await B.text().catch(()=>B.statusText);n.onError(`Request failed (${B.status}): ${F}`),n.onFinish("error",t??"");return}if(!(B.headers.get("content-type")??"").includes("text/event-stream")||!B.body){let F=await B.json().catch(()=>null);if(!F){n.onError("Invalid response from server"),n.onFinish("error",t??"");return}Y(F);return}let ae=B.body.getReader(),R=new TextDecoder,Q="";for(;;){let{done:F,value:O}=await ae.read();if(F)break;Q+=R.decode(O,{stream:!0});let L=Q.split(`
2
-
3
- `);Q=L.pop()??"";for(let G of L){let j=G.split(`
4
- `).find(U=>U.startsWith("data:"));if(j){try{Y(JSON.parse(j.slice(5).trim()))}catch{}if(v)return}}}v||(n.onError("Stream ended unexpectedly"),n.onFinish("error",t??""))}async streamChatViaSse(t,e,n,o,a,c,m,k){let S=this.tokenStore.accessToken()??"",M=`${this.baseUrl}/v1/conversations/chat`,v={message:e};t&&(v.conversationId=t),o&&(v.connectionId=o),c?.length&&(v.attachments=c),m&&(v.isPipeline=!0),k&&(v.dashboardId=k);let N=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${S}`},body:JSON.stringify(v),signal:a});if(!N.ok){let W=await N.text().catch(()=>N.statusText);n.onError(`Request failed (${N.status}): ${W}`);return}if(!N.body){n.onError("No response body received");return}let X=N.body.getReader(),Y=new TextDecoder,B="";for(;;){let{done:W,value:ae}=await X.read();if(W)break;B+=Y.decode(ae,{stream:!0});let R=B.split(`
5
- `);B=R.pop()??"";for(let Q of R){let F=Q.trim();F&&this.parseLine(F,n)}}B.trim()&&this.parseLine(B.trim(),n)}async getSuggestedPrompts(t,e){if(!this.customerId||!this.productId)return{widgetSuggestions:[],conversationStarters:[]};let n={};return t&&(n.connectionId=t),e&&(n.isPipeline="true"),E().features.mcpGateway?await this.callMcpTool("getSuggestedPrompts",{},n)??{widgetSuggestions:[],conversationStarters:[]}:(await I(this.http.get(`${this.baseUrl}/conversations/suggested-prompts`,{params:n})))?.data??{widgetSuggestions:[],conversationStarters:[]}}async listDashboards(t=20){return!this.customerId||!this.productId?[]:E().features.mcpGateway?(await this.callMcpTool("listDashboards",{limit:t,published:"all"}))?.dashboards??[]:(await I(this.http.get(`${this.baseUrl}/dashboards?limit=${t}`)))?.data??[]}async getDashboard(t){if(!t)return null;if(!E().features.mcpGateway){let n=await I(this.http.get(`${this.baseUrl}/dashboards/${t}`));return n?.data??n??null}return(await this.callMcpTool("getDashboard",{dashboardId:t}))?.dashboard??null}async listDashboardsForConversation(t){if(!t||!this.customerId||!this.productId)return[];if(!E().features.mcpGateway){let n=await I(this.http.get(`${this.baseUrl}/dashboards?conversationId=${encodeURIComponent(t)}`)),o=n?.data??n;return Array.isArray(o)?o:[]}return(await this.callMcpTool("listDashboards",{conversationId:t,published:"all"}))?.dashboards??[]}async changeAdhocChartType(t,e){let n;try{n=await I(this.http.post(`${this.baseUrl}/conversations/change-type`,{widgetConfig:t,newChartType:e}))}catch(o){throw o instanceof ne?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Chart type change failed");return n.chart}async listAdhocFilterFields(t){let e;try{e=await I(this.http.post(`${this.baseUrl}/conversations/filter-fields`,{widgets:t}))}catch(n){throw n instanceof ne?new Error(n.error?.error||n.message):n}if(e?.success===!1)throw new Error(e?.error||"Could not load filter fields");return e?.fields??[]}async fetchAdhocFilterValues(t,e,n=""){let o;try{o=await I(this.http.post(`${this.baseUrl}/conversations/filter-values`,{widgets:t,field:e,prefix:n}))}catch(a){throw a instanceof ne?new Error(a.error?.error||a.message):a}if(o?.success===!1)throw new Error(o?.error||"Could not load filter values");return{field:e,values:o?.values??[],complete:o?.complete??!0}}async applyAdhocFilter(t,e){let n;try{n=await I(this.http.post(`${this.baseUrl}/conversations/filter-apply`,{widgetConfig:t,filters:e}))}catch(o){throw o instanceof ne?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Filter could not be applied");return n.chart}async filterSuggest(t,e,n,o="draft"){let a=n.filter(k=>!!k.id).map(k=>({widgetId:k.id})),c;try{c=await I(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(k){throw k instanceof ne?new Error(k.error?.error||k.message):k}if(c?.success===!1)throw new Error(c.error||"Request failed");let m=c?.data??{completions:[],suggestions:[]};return{nextToken:m.nextToken,completions:Array.isArray(m.completions)?m.completions:[],suggestions:Array.isArray(m.suggestions)?m.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,c){let m=await new Promise((X,Y)=>{let B=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,dn(t,e,c)).subscribe({next:W=>X(W),error:W=>{Y(W instanceof ne?new Error(W.error?.error||W.message):W)}});if(a){if(a.aborted){B.unsubscribe();let W=new Error("Aborted");W.name="AbortError",Y(W);return}a.addEventListener("abort",()=>{B.unsubscribe();let W=new Error("Aborted");W.name="AbortError",Y(W)},{once:!0})}});if(m?.success===!1)throw new Error(m.error||"Request failed");let k=m?.data??m,S=Array.isArray(k)?k:k?.widgets;if(!Array.isArray(S))throw new Error("Invalid response from apply-filters API");let M=!Array.isArray(k)&&Array.isArray(k?.resolvedFilters)?k.resolvedFilters:[],v=!Array.isArray(k)&&typeof k?.filterExplanation=="string"?k.filterExplanation:typeof m?.filterExplanation=="string"?m.filterExplanation:null,N=v&&v.trim()?v.trim():null;return{widgets:S,resolvedFilters:M,filterExplanation:N}}async uploadAttachment(t,e){let n=this.tokenStore.accessToken()??"",o=new FormData;o.append("file",t,t.name);let a=await fetch(`${this.baseUrl}/uploads`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:o,signal:e?.signal});if(!a.ok){let k=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${k}`)}let c=await a.json().catch(()=>null),m=c?.data?.key??c?.key;if(!m)throw new Error("Upload failed: malformed response");return{key:m}}async createDashboard(t){let a=t,{published:e}=a,n=ke(a,["published"]);return E().features.mcpGateway?(await this.callMcpTool("createDashboard",b(b({},n),e?{published:!0}:{}))).dashboard:(await I(this.http.post(`${this.baseUrl}/dashboards${e?"?published=true":""}`,n))).data}async publishDashboard(t){return E().features.mcpGateway?(await this.callMcpTool("publishDashboard",{dashboardId:t}))?.publishedDashboardId??t:(await I(this.http.post(`${this.baseUrl}/dashboards/${t}/publish`,{})))?.data?.publishedDashboardId??t}async deleteDashboard(t){if(!E().features.mcpGateway){await I(this.http.delete(`${this.baseUrl}/dashboards/${t}`));return}await this.callMcpTool("deleteDashboard",{dashboardId:t})}async register(t){return(await I(this.http.post(`${E().baseUrl}/api/customers/${this.customerId}/workforce/register`,t))).data}async listConnections(){return!this.customerId||!this.productId?[]:(await I(this.http.get(`${this.baseUrl}/connections`)))?.data??[]}async listDatasets(){return!this.customerId||!this.productId?[]:((await I(this.http.get(`${this.baseUrl}/connections/datasets`)))?.data??[]).map(e=>({id:e.id,name:e.name}))}async listPipelines(){if(!this.customerId||!this.productId)return[];let t=`${E().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/applications/orchestrations/v2?startIndex=0&limit=100`;return((await I(this.http.get(t)))?.data??[]).map(n=>({id:n.publicOrchestrationGuid??n.guid??n.id??"",name:n.name})).filter(n=>n.id)}async createConnection(t,e){return(await I(this.http.post(`${this.baseUrl}/connections`,{name:t,config:e}))).data}async updateConnection(t,e){return(await I(this.http.put(`${this.baseUrl}/connections/${t}`,e))).data}async testConnection(t){return(await I(this.http.post(`${this.baseUrl}/connections/${t}/test`,{}))).data}async deleteConnection(t){await I(this.http.delete(`${this.baseUrl}/connections/${t}`))}parseLine(t,e){let n=t.indexOf(":");if(n===-1)return;let o=t.slice(0,n),a;try{a=JSON.parse(t.slice(n+1))}catch{return}switch(o){case"f":break;case"0":e.onText(a.text??"");break;case"9":{let c=a;e.onToolStart(c.toolCallId,c.uiLabel??c.toolName??"");break}case"a":{let c=a;e.onToolResult(c.toolCallId,c.result?.uiDetail??"",c.result?.error??!1);break}case"2":{let c=a;c.data_type==="adhoc_viz"?e.onDataPart(c):c.data_type==="dashboard_title"?e.onDashboardTitle?.(c.data?.title??""):c.data_type==="choice"?e.onChoice?.(c.data):c.data_type==="layout_patch"&&e.onLayoutPatch?.(c.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let c=a;e.onFinish(c.finishReason??"stop",c.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=le({token:i,factory:i.\u0275fac,providedIn:"root"})};function bn({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function yn(i,t,e){let n=e||"Working",o=i.map(c=>c.id==="thinking"&&c.status==="running"?P(b({},c),{status:"done"}):c),a=o.findIndex(c=>c.status==="running"&&c.baseLabel===n);if(a>=0){let c=o[a],m=[...o];return m[a]=P(b({},c),{callIds:[...c.callIds,t],pending:c.pending+1}),m}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function vn(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return P(b({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function rt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var wn=i=>P(b({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function kn(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?wn(n):n):[...i,wn(e(t))]}var We=class i{http=$(_e);tokenStore=$(ie);get apiUrl(){let t=this.tokenStore.tenantId()??"";return`${E().baseUrl}/api/customers/${t}/products/${ue()}/workforcebot/forecast`}cachedContext=null;context(){return this.cachedContext?this.cachedContext:(this.cachedContext=I(this.http.get(`${this.apiUrl}/context`)).catch(t=>(console.info('[ask-aquera] forecast context unavailable \u2014 "forecast this" will not be claimed.',t),null)),this.cachedContext)}async compute(t){try{return await I(this.http.post(`${this.apiUrl}/compute`,t))}catch(e){let n=e,o=n?.error?.error;throw Object.assign(new Error(o||`Forecast failed (HTTP ${n?.status??"?"})`),{status:n?.status,code:n?.error?.code,isRefusal:n?.status===422})}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=le({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qn=[/\bforecast(?:ing|s|ed)?\b/i,/\bpredict(?:ion|ions|ive|s|ed)?\b/i,/\bproject(?:ion|ions|ed)\b/i,/\bproject\s+(?:our|the|this|that|my|its|their|his|her|forward)\b/i,/\bproject\s+\w+(?:\s+\w+)?\s+forward\b/i,/\bextrapolat\w*/i,/\bnext\s+(?:week|month|quarter|year|\d+\s+(?:weeks?|months?|quarters?|years?))\b/i,/\bby\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i,/\bby\s+Q[1-4]\b/i,/\bthrough\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year)\b/i,/\bhow\s+many\s+\w+\s+will\s+we\b/i,/\bwhat\s+will\s+\w+\s+(?:be|look\s+like)\b/i,/\btrend\s+(?:this\s+)?forward\b/i,/\brun[-\s]?rate\s+to\b/i],Kn=[/\bforecast\s+(?:this|that|it)\b/i,/\bextend\s+(?:this|that|it)\b/i,/\bproject\s+(?:this|that|it)\s+forward\b/i,/\btrend\s+(?:this|that|it)\s+forward\b/i,/\b(?:this|that)\s+chart\b/i,/\bsame\s+chart\b/i],Xn={Weekly:{week:1,month:4,quarter:13,year:52},Monthly:{week:1,month:1,quarter:3,year:12},Quarterly:{week:1,month:1,quarter:1,year:4},Yearly:{week:1,month:1,quarter:1,year:1}},Jn=[[/\b(?:weekly|by\s+week|per\s+week|week\s+over\s+week)\b/i,"Weekly"],[/\b(?:monthly|by\s+month|per\s+month|month\s+over\s+month)\b/i,"Monthly"],[/\b(?:quarterly|by\s+quarter|per\s+quarter)\b/i,"Quarterly"],[/\b(?:yearly|annually|annual|per\s+year)\b|\bby\s+year\b(?!\s*-?\s*end)/i,"Yearly"]];function st(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=Kn.some(m=>m.test(n)),a=Zn(n,Qn);if(!a&&!o)return null;let c=ei(n);return{extendsExisting:o,metric:ti(n,t),horizon:ni(n,c??t.defaults.granularity,e),granularity:c,trigger:a||"refers to an existing chart"}}function Zn(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function ei(i){for(let[t,e]of Jn)if(t.test(i))return e}function ti(i,t){let e=i.toLowerCase();return t.metrics.flatMap(o=>[o.label,...o.aliases].map(a=>({id:o.id,alias:a.toLowerCase()}))).sort((o,a)=>a.alias.length-o.alias.length).find(o=>e.includes(o.alias))?.id}function ni(i,t,e){let n=Xn[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let m=Number(o[1]),k=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(m*n[k]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let m=a[1].toLowerCase();return Math.max(1,n[m])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return ii(t,e);let c=/\bby\s+Q([1-4])\b/i.exec(i);if(c)return oi(t,Number(c[1]),e)}function ii(i,t){let e=12-(t.getMonth()+1);return Math.max(1,An(e,i))}function oi(i,t,e){let n=Math.floor(e.getMonth()/3)+1,o=t>=n?t-n:4-n+t,a=Math.max(1,o*3);return Math.max(1,An(a,i))}function An(i,t){switch(t){case"Weekly":return Math.round(i*4.345);case"Quarterly":return Math.max(1,Math.round(i/3));case"Yearly":return Math.max(1,Math.round(i/12));default:return i}}var ai=new Set(["line","area","spline","areaspline"]),lt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",Z="(?:19|20)\\d{2}",Pn="(?:0?[1-9]|[12]\\d|3[01])",dt="(?:0?[1-9]|1[0-2])",ri=[new RegExp(`^${Z}[-/.]${dt}(?:[-/.]${Pn})?$`,"i"),new RegExp(`^${Pn}[-/.]${dt}[-/.]${Z}$`,"i"),new RegExp(`^${dt}[-/.]${Z}$`,"i"),new RegExp(`^${Z}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${Z}$`,"i"),new RegExp(`^${lt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${lt}[\\s-]*${Z}$`,"i"),new RegExp(`^${Z}[\\s-]*${lt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${Z}$`,"i"),new RegExp(`^${Z}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${Z}$`)];function si(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>ri.some(o=>o.test(n))).length/t.length>=.8}var li=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],Sn=3;function Ge(i){return i?.config?.chart??i?.chart??{}}function Fn(i){let t=Ge(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function je(i){let t=Ge(i),e=String(t?.type??"").toLowerCase();if(!ai.has(e))return!1;let n=di(i);if(!n||n.values.length<Sn)return!1;let o=Dn(t);return o.length?si(o):!!n.times?.length}function di(i){let t=Ge(i),e=qn(t);if(!e.length)return null;let n=e.find(o=>!En(o.name))??e[0];return On(t,n)}function Tn(i){let t=Ge(i),e=qn(t).filter(o=>!En(o.name)),n=[];return e.forEach((o,a)=>{let c=On(t,o);c&&n.push(P(b({},c),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function On(i,t){let e=pi(t.data),n=e.map(c=>c.value);if(n.length<Sn)return null;let o=e.every(c=>c.time!==void 0)?e.map(c=>c.time):void 0,a=Dn(i).slice(0,n.length);return b({labels:a.length===n.length?a:o?o.map(c=>ci(c)):n.map((c,m)=>String(m+1)),values:n},o?{times:o}:{})}function ci(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function qn(i){let t=i?.options?.series;if(Array.isArray(t)&&t.length)return t.filter(n=>Array.isArray(n?.data)).map(n=>({name:String(n.name??""),data:n.data}));let e=i?.data;return Array.isArray(e)&&e.length?e.every(n=>typeof n=="number"||n===null)?[{name:"",data:e}]:e.filter(n=>Array.isArray(n?.data)||Array.isArray(n?.actual)).map(n=>({name:String(n.name??""),data:Array.isArray(n.actual)?n.actual:n.data})):[]}function Dn(i){let t=i?.categories;if(Array.isArray(t)&&t.length)return t.map(String);let e=i?.options?.xAxis?.categories;return Array.isArray(e)&&e.length?e.map(String):[]}function En(i){return li.some(t=>t.test(i))}function pi(i){let t=[];for(let e of i){let n=_i(e);if(n===null)break;t.push(n)}return t}function _i(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return b({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return b({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var pt={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},ct={Weekly:{plural:"weeks",singular:"week",adjective:"weekly"},Monthly:{plural:"months",singular:"month",adjective:"monthly"},Quarterly:{plural:"quarters",singular:"quarter",adjective:"quarterly"},Yearly:{plural:"years",singular:"year",adjective:"yearly"}},Mn=4;function ui(i,t,e){let n=pt[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function In(i,t,e){return e.map(n=>{let o=ct[n]??ct.Monthly,a=ui(t,i,n);return a===null?{value:n,enabled:!1,fittedPeriods:0,maxHorizon:0,label:o,reason:`needs ${o.adjective} data, but this series is ${ct[i]?.adjective??i.toLowerCase()}`}:a<Mn?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${Mn}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function Vn(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=pt[t]?.[e],a=pt[e]?.[t],c=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(c),n))}var gi="#2970FF",zn="#7A5AF8";var Rn={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},Nn={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function mi(i,t){if(i.times?.length===i.values.length)return i.times;let e=Date.now(),n=i.values.length;return i.values.map((o,a)=>Math.round(e-(n-1-a)*t))}function $n(i,t){let e=new Date(i);switch(t){case"Weekly":return e.toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"});case"Quarterly":return`Q${Math.floor(e.getMonth()/3)+1} ${e.getFullYear()}`;case"Yearly":return String(e.getFullYear());default:return e.toLocaleDateString("en-US",{month:"short",year:"numeric"})}}function Ln(i,t){let e=Rn[i.granularity]??Rn.Monthly,n=mi(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((v,N)=>Math.round(o+(N+1)*e)),c=t.length>0,m=[...n.map(v=>$n(v,i.granularity)),...c?a.map(v=>$n(v,i.granularity)):[]],k=(i.series?.length??0)>1,S=k?i.series.map(v=>b({name:v.note?`${v.name} \xB7 ${v.note}`:v.name,actual:v.values},v.points?.length?{projected:v.points.map(N=>N.value),interval:v.points.map(N=>[N.low,N.high])}:{})):[b({name:"Actuals",color:gi,actual:i.history.values},c?{projected:t.map(v=>v.value),interval:t.map(v=>[v.low,v.high])}:{})],M={type:"line",enableForecasting:!0,categories:m,data:S,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:Nn[i.granularity]??Nn.Monthly,projection:P(b({start:null},k?{}:{color:zn}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:P(b({name:`${i.confidence}% confidence`},k?{}:{color:zn}),{opacity:.16,level:i.confidence})}),legend:{show:!0},height:"400px",loading:!1,options:{}};return{title:i.chartTitle,componentName:"nile-line-chart",widgetType:"chart",config:{aq:{chartTitle:i.chartTitle,chartSubtitle:i.chartSubtitle},chart:M},queryMeta:{sql:`-- forecast:${i.metric}`}}}function _t(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=b({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?be(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",c=hi(i,t),m=i.skipped??[],k=(i.meta??[]).map(S=>({label:S.label,value:be(S.value,o)}));return m.length&&c.length>1&&k.push({label:"Series",value:`${c.length-m.length} of ${c.length} forecast \u2014 ${m.map(S=>S.name).join(", ")} left as history`}),{chart:fi(i,e,c),answer:a,meta:k,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function hi(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=c=>String(c??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(c=>[n(c.name??""),c])),a=e.map(c=>({name:c.name,values:c.history?.values??o.get(n(c.name))?.values??[],points:i.guardrails?.passed?c.points??[]:[]}));for(let c of i.skipped??[]){let m=o.get(n(c.name));m?.values?.length&&a.push({name:c.name,values:m.values,note:"not forecast"})}return a}function fi(i,t,e=[]){return Ln(e.length?P(b({},i),{series:e}):i,t)}function be(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function ut(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return Fn(t)?!1:je(t)}var xi=["aqChat"],bi=["artifactGrid"],yi=["composerEl"],vi=["aiExecutiveSummary"],wi=()=>[1,2,3,4],gt=()=>[],ee=(i,t)=>t.id,Wn=(i,t)=>t.label,ki=(i,t)=>t.key,Gn=(i,t)=>t.component,Ai=(i,t)=>t.name,He=(i,t)=>t.value,Pi=(i,t)=>t.action;function Mi(i,t){if(i&1){let e=w();s(0,"button",28),g("click",function(){_(e);let o=r();return u(o.addReplyQuote())}),h(1,"nile-glyph",29),p(2),d()}if(i&2){let e=t,n=r();te("top",e.top,"px")("left",e.left,"px"),H("reply-badge--below",!e.above),l(2),T(" ",n.copy().replyButton," ")}}function Si(i,t){if(i&1){let e=w();s(0,"input",52),g("input",function(o){_(e);let a=r(2);return u(a.titleDraft.set(o.target.value))})("keydown.enter",function(){_(e);let o=r(2);return u(o.commitTitle())})("keydown.escape",function(){_(e);let o=r(2);return u(o.cancelEditTitle())}),d(),s(1,"nile-lite-tooltip",53)(2,"button",54),g("click",function(){_(e);let o=r(2);return u(o.commitTitle())}),h(3,"nile-glyph",55),d()()}if(i&2){let e=r(2);y("value",e.titleDraft())}}function Fi(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",57)(1,"button",58),g("click",function(){_(e);let o=r(3);return u(o.startEditTitle())}),h(2,"nile-glyph",59),d()()}}function Ti(i,t){if(i&1&&(s(0,"span",56),p(1),d(),f(2,Fi,3,0,"nile-lite-tooltip",57)),i&2){let e=r(2);l(),A(e.activeConversationTitle()),l(),C(e.activeConversationId()?2:-1)}}function Oi(i,t){if(i&1){let e=w();s(0,"span",32),h(1,"nile-glyph",60),s(2,"span",61),p(3),d(),s(4,"button",62),g("click",function(){_(e);let o=r(2);return u(o.clearScope())}),h(5,"nile-glyph",63),d()()}if(i&2){let e=t;l(),y("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),l(2),J("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function qi(i,t){i&1&&(s(0,"div",42),h(1,"nile-skeleton-loader",64)(2,"nile-skeleton-loader",65),d())}function Di(i,t){i&1&&h(0,"nile-glyph",68)}function Ei(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectScope("dataset",o))}),s(1,"span",67),p(2),d(),f(3,Di,1,0,"nile-glyph",68),d()}if(i&2){let e,n=t.$implicit,o=r(3);l(2),A(n.name),l(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Ii(i,t){if(i&1&&(s(0,"div",66),p(1),d()),i&2){let e=r(3);l(),A(e.copy().noDatasetsFound)}}function Vi(i,t){if(i&1&&V(0,Ei,4,2,"nile-menu-item",null,ee,!1,Ii,2,1,"div",66),i&2){let e=r(2);z(e.datasets())}}function zi(i,t){i&1&&(s(0,"div",42),h(1,"nile-skeleton-loader",64)(2,"nile-skeleton-loader",65),d())}function Ri(i,t){i&1&&h(0,"nile-glyph",68)}function Ni(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectScope("pipeline",o))}),s(1,"span",67),p(2),d(),f(3,Ri,1,0,"nile-glyph",68),d()}if(i&2){let e,n=t.$implicit,o=r(3);l(2),A(n.name),l(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function $i(i,t){if(i&1&&(s(0,"div",66),p(1),d()),i&2){let e=r(3);l(),A(e.copy().noPipelinesFound)}}function Li(i,t){if(i&1&&V(0,Ni,4,2,"nile-menu-item",null,ee,!1,$i,2,1,"div",66),i&2){let e=r(2);z(e.pipelines())}}function Bi(i,t){if(i&1&&(s(0,"nile-menu-item",69)(1,"div",70),h(2,"nile-skeleton-loader",71),s(3,"div",72),h(4,"nile-skeleton-loader",73),d()()()),i&2){let e=t.$implicit;l(3),te("max-width",e,"px")}}function Ui(i,t){if(i&1&&V(0,Bi,5,2,"nile-menu-item",69,re),i&2){let e=r(2);z(e.menuSkeletonRows)}}function Wi(i,t){i&1&&h(0,"nile-glyph",76)}function Gi(i,t){if(i&1){let e=w();s(0,"nile-glyph",78),g("click",function(o){_(e);let a=r().$implicit,c=r(3);return u(c.deleteConversation(o,a.id))}),d()}}function ji(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectConversation(o.id))}),s(1,"div",70),h(2,"nile-glyph",75),s(3,"span",72),p(4),d(),f(5,Wi,1,0,"nile-glyph",76)(6,Gi,1,0,"nile-glyph",77),d()()}if(i&2){let e=t.$implicit,n=r(3);l(4),A(e.title||"Untitled"),l(),C(e.id===n.activeConversationId()?5:6)}}function Hi(i,t){if(i&1&&(s(0,"div",74),p(1),d()),i&2){let e=r(3);l(),A(e.copy().noConversationsYet)}}function Yi(i,t){if(i&1&&V(0,ji,7,2,"nile-menu-item",null,ee,!1,Hi,2,1,"div",74),i&2){let e=r(2);z(e.conversations())}}function Qi(i,t){if(i&1&&(s(0,"nile-menu-item",69)(1,"div",83),h(2,"nile-skeleton-loader",71),s(3,"div",84),h(4,"nile-skeleton-loader",73),d(),s(5,"div",85),h(6,"nile-skeleton-loader",86),d()()()),i&2){let e=t.$implicit;l(3),te("max-width",e,"px")}}function Ki(i,t){if(i&1&&V(0,Qi,7,2,"nile-menu-item",69,re),i&2){let e=r(3);z(e.menuSkeletonRows)}}function Xi(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(4);return u(a.openRelatedDashboard(o.id))}),s(1,"div",83),h(2,"nile-glyph",87),s(3,"span",84),p(4),d(),s(5,"span",85),p(6),d()()()}if(i&2){let e=t.$implicit;l(4),A(e.name||"Untitled"),l(2),J("",e.widgetCount," widget",e.widgetCount===1?"":"s")}}function Ji(i,t){if(i&1&&(s(0,"div",74),p(1),d()),i&2){let e=r(4);l(),A(e.copy().noDashboardsYet)}}function Zi(i,t){if(i&1&&V(0,Xi,7,3,"nile-menu-item",null,ee,!1,Ji,2,1,"div",74),i&2){let e=r(3);z(e.nonAutoDashboards())}}function eo(i,t){if(i&1){let e=w();s(0,"nile-dropdown",79),g("nile-hide",function(){_(e);let o=r(2);return u(o.showRelatedDashboards.set(!1))}),s(1,"nile-lite-tooltip",80)(2,"button",81),g("click",function(){_(e);let o=r(2);return u(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),h(3,"nile-glyph",82),d()(),s(4,"nile-menu")(5,"nile-menu-item",48),g("click",function(){_(e);let o=r(2);return u(o.openNewDashboard())}),h(6,"nile-glyph",49),p(7),d(),f(8,Ki,2,0)(9,Zi,3,1),d()()}if(i&2){let e=r(2);y("open",e.showRelatedDashboards()),l(7),T(" ",e.copy().newDashboardLabel," "),l(),C(e.dashboardsLoading()?8:9)}}function to(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",51)(1,"button",88),g("click",function(){_(e);let o=r(2);return u(o.openGallery())}),h(2,"nile-glyph",89),d()()}}function no(i,t){if(i&1){let e=w();s(0,"header",9)(1,"div",30),f(2,Si,4,1)(3,Ti,3,2),d(),s(4,"div",31),f(5,Oi,6,3,"span",32),s(6,"nile-dropdown",33),g("nile-hide",function(){_(e);let o=r();return u(o.closeScopeMenu())}),s(7,"nile-lite-tooltip",34)(8,"button",35),g("click",function(){_(e);let o=r();return u(o.openScopeMenu())}),h(9,"nile-glyph",36),d()(),s(10,"nile-menu")(11,"nile-menu-item")(12,"nile-dropdown",37)(13,"span",38),h(14,"nile-glyph",39),s(15,"span",40),p(16,"Dataset"),d(),h(17,"nile-glyph",41),d(),s(18,"nile-menu"),f(19,qi,3,0,"div",42)(20,Vi,3,1),d()()(),s(21,"nile-menu-item")(22,"nile-dropdown",37)(23,"span",38),h(24,"nile-glyph",43),s(25,"span",40),p(26,"Pipeline"),d(),h(27,"nile-glyph",41),d(),s(28,"nile-menu"),f(29,zi,3,0,"div",42)(30,Li,3,1),d()()()()(),s(31,"nile-dropdown",44),g("nile-hide",function(){_(e);let o=r();return u(o.showConversationPicker.set(!1))}),s(32,"nile-lite-tooltip",45)(33,"button",46),g("click",function(){_(e);let o=r();return u(o.showConversationPicker.set(!o.showConversationPicker()))}),h(34,"nile-glyph",47),d()(),s(35,"nile-menu")(36,"nile-menu-item",48),g("click",function(){_(e);let o=r();return u(o.newConversation())}),h(37,"nile-glyph",49),p(38),d(),f(39,Ui,2,0)(40,Yi,3,1),d()(),f(41,eo,10,3,"nile-dropdown",50),f(42,to,3,0,"nile-lite-tooltip",51),d()()}if(i&2){let e,n=r();l(2),C(n.editingTitle()?2:3),l(3),C((e=n.features().connections&&n.selectedScope())?5:-1,e),l(),y("open",n.showScopePicker()),l(13),C(n.scopeLoading()?19:20),l(10),C(n.scopeLoading()?29:30),l(2),y("open",n.showConversationPicker()),l(2),y("disabled",n.isStreaming()),l(5),T(" ",n.copy().newConversationLabel," "),l(),C(n.conversationsLoading()?39:40),l(2),C(n.features().dashboardsMenu?41:-1),l(),C(n.features().promptGallery?42:-1)}}function io(i,t){i&1&&(s(0,"div",98),h(1,"nile-skeleton-loader",99),s(2,"div",100),h(3,"nile-skeleton-loader",73),d()())}function oo(i,t){i&1&&(s(0,"div",97),V(1,io,4,0,"div",98,re),d()),i&2&&(l(),z(Ce(0,wi)))}function ao(i,t){if(i&1&&(s(0,"span",107),p(1),d()),i&2){let e=r().$implicit;l(),A(e.badge)}}function ro(i,t){if(i&1){let e=w();s(0,"button",104),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.onWelcomePromptPick(o))}),h(1,"nile-glyph",105),s(2,"span",106),p(3),d(),f(4,ao,2,1,"span",107),d()}if(i&2){let e=t.$implicit;H("prompt-card--ai",e.tone==="ai"),l(),q("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680"),l(2),A(e.label),l(),C(e.badge?4:-1)}}function so(i,t){if(i&1){let e=w();s(0,"div",103)(1,"button",108),g("click",function(){_(e);let o=r(3);return u(o.openGallery())}),h(2,"nile-glyph",109),s(3,"span"),p(4),d()()()}if(i&2){let e=r(3);l(4),A(e.copy().promptGalleryLabel)}}function lo(i,t){if(i&1&&(s(0,"div",101),V(1,ro,5,6,"button",102,Wn),d(),f(3,so,5,1,"div",103)),i&2){let e=r(2);l(),z(e.welcomePromptCards()),l(2),C(e.features().promptGallery?3:-1)}}function co(i,t){if(i&1&&(s(0,"div",10)(1,"div",90)(2,"div",91),h(3,"nile-glyph",92),d(),s(4,"h2",93),p(5),d(),s(6,"p",94),p(7),d(),s(8,"div",95),Ke(9,96),d(),f(10,oo,3,1,"div",97)(11,lo,4,1),d()()),i&2){let e=r(),n=Me(8);l(5),A(e.copy().welcomeTitle),l(2),A(e.copy().welcomeSubtitle),l(2),y("ngTemplateOutlet",n),l(),C(e.welcomePromptCards().length?11:10)}}function po(i,t){i&1&&(s(0,"div",112),h(1,"nile-skeleton-loader",113),d(),s(2,"div",114),h(3,"nile-skeleton-loader",115)(4,"nile-skeleton-loader",116)(5,"nile-skeleton-loader",117),d(),s(6,"div",112),h(7,"nile-skeleton-loader",118),d(),s(8,"div",114),h(9,"nile-skeleton-loader",119)(10,"nile-skeleton-loader",120),d())}function _o(i,t){if(i&1&&(s(0,"div",122),h(1,"nile-glyph",124),s(2,"span",125),p(3),d()()),i&2){let e=r(2).$implicit;l(3),A(e.quotedText)}}function uo(i,t){if(i&1&&(s(0,"div",126),h(1,"nile-glyph",127),s(2,"span",128),p(3),d()()),i&2){let e=t.$implicit;l(),q("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),q("title",e.name),l(),A(e.name)}}function go(i,t){if(i&1&&(s(0,"div",123),V(1,uo,4,3,"div",126,ki),d()),i&2){let e=r(2).$implicit;l(),z(e.attachments??Ce(0,gt))}}function mo(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",121),f(1,_o,4,1,"div",122),p(2),f(3,go,3,1,"div",123),d()),i&2){let e=r().$implicit;y("role","user"),l(),C(e.quotedText?1:-1),l(),T(" ",e.text," "),l(),C(e.attachments!=null&&e.attachments.length?3:-1)}}function ho(i,t){if(i&1&&h(0,"nile-ai-steps",129),i&2){let e=r(2).$implicit;y("steps",e.tools)}}function fo(i,t){if(i&1&&h(0,"nile-ai-token-stream",139),i&2){let e=r(4).$implicit,n=r(3);y("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function Co(i,t){if(i&1&&h(0,"nile-markdown",140),i&2){let e=r(4).$implicit,n=r(3);y("value",n.cleanText(e.text))}}function xo(i,t){if(i&1&&f(0,fo,1,2,"nile-ai-token-stream",139)(1,Co,1,1,"nile-markdown",140),i&2){let e=r(3).$implicit;C(e.isStreaming?0:1)}}function bo(i,t){if(i&1&&(s(0,"span",148),p(1),d()),i&2){let e=r().$implicit;l(),A(e.hint)}}function yo(i,t){if(i&1&&(s(0,"span"),p(1),d()),i&2){let e=r().$implicit;Xe("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),l(),A(e.text)}}function vo(i,t){if(i&1&&f(0,yo,2,3,"span",150),i&2){let e=t.$implicit;C(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function wo(i,t){if(i&1&&(s(0,"span",149),V(1,vo,1,1,null,null,re),d()),i&2){let e=r().$implicit;l(),z(e.meta)}}function ko(i,t){if(i&1&&(s(0,"nile-radio",145)(1,"span",146)(2,"span",147),p(3),d(),f(4,bo,2,1,"span",148),f(5,wo,3,0,"span",149),d()()),i&2){let e=t.$implicit,n=t.$index,o=r(2).$implicit,a=r(3).$implicit,c=r(3);H("choice-card--chosen",(o.selected||o.draftSelection)===e.id)("choice-card--locked",!!o.selected||c.isStreaming()),q("name","choice-"+a.id+"-"+n)("value",e.id)("checked",(o.selected||o.draftSelection)===e.id?"":null)("disabled",o.selected||c.isStreaming()?"":null),l(3),A(e.label),l(),C(e.hint?4:-1),l(),C(e.meta!=null&&e.meta.length?5:-1)}}function Ao(i,t){if(i&1){let e=w();s(0,"nile-radio-group",143),g("nile-change",function(o){_(e);let a=r().$implicit,c=r(3).$implicit,m=r(3);return u(m.onChoiceChange(c,a,o.detail.value))}),V(1,ko,6,11,"nile-radio",144,ee),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,c=r(3);q("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||c.isStreaming()?"":null),l(),z(n.options)}}function Po(i,t){if(i&1&&(s(0,"p",142),p(1),d()),i&2){let e=r(7);l(),A(e.copy().noChoiceOptions)}}function Mo(i,t){if(i&1&&p(0),i&2){let e=r(3).$implicit;T(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function So(i,t){if(i&1&&p(0),i&2){let e=r(9);T(" ",e.copy().somethingElseButton," ")}}function Fo(i,t){if(i&1){let e=w();s(0,"button",153),g("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(3);return u(c.requestPlan(a,o))}),p(1),d()}if(i&2){let e=r(9);y("disabled",e.isStreaming()),l(),T(" ",e.copy().givePlanButton," ")}}function To(i,t){if(i&1){let e=w();s(0,"div",151)(1,"button",153),g("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(3);return u(c.openChatDraft(a,o))}),f(2,Mo,1,1)(3,So,1,1),d(),f(4,Fo,2,2,"button",154),d()}if(i&2){let e=r(2).$implicit,n=r(6);l(),y("disabled",n.isStreaming()),l(),C(e.chatDraftText!=null&&e.chatDraftText.trim()?2:3),l(2),C(e.kind==="clarification"?4:-1)}}function Oo(i,t){if(i&1){let e=w();s(0,"div",152)(1,"span",155),p(2,"Something else"),d(),s(3,"div",156)(4,"nile-input",157),g("nile-input",function(o){_(e);let a=r(2).$implicit,c=r(3).$implicit,m=r(3);return u(m.onChatDraftTextChange(c,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(3);return u(c.defineChatDraft(a,o))}),d(),s(5,"nile-button",19),g("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(3);return u(c.defineChatDraft(a,o))}),p(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(6);l(4),y("value",e.chatDraftText??""),q("placeholder",e.kind==="widget_clarification"?n.copy().chatDraftPlaceholderWidget:n.copy().chatDraftPlaceholderClarification)("disabled",n.isStreaming()?"":null),l(),q("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),l(),T(" ",n.copy().defineItButton," ")}}function qo(i,t){if(i&1&&f(0,To,5,3,"div",151)(1,Oo,7,5,"div",152),i&2){let e=r().$implicit;C(e.chatOpen?1:0)}}function Do(i,t){if(i&1&&(s(0,"div",132),f(1,Ao,3,4,"nile-radio-group",141)(2,Po,2,1,"p",142),f(3,qo,2,1),d()),i&2){let e=t.$implicit;l(),C(e.options.length?1:2),l(2),C((e.kind==="widget_clarification"||e.kind==="clarification")&&!e.selected&&e.options.length?3:-1)}}function Eo(i,t){if(i&1){let e=w();s(0,"div",133)(1,"nile-button",19),g("click",function(){_(e);let o=r(3).$implicit,a=r(3);return u(a.submitChoices(o))}),p(2),d()()}if(i&2){let e=r(3).$implicit,n=r(3);l(),q("disabled",!n.hasPendingDraft(e)||n.isStreaming()?"":null),l(),T(" ",n.copy().submitAnswersButton," ")}}function Io(i,t){i&1&&(s(0,"span",159),h(1,"span",169),p(2,"Live "),d())}function Vo(i,t){i&1&&(s(0,"div",174),h(1,"nile-spinner",177),s(2,"span"),p(3,"Loading chart types\u2026"),d()())}function zo(i,t){if(i&1&&(s(0,"p",175),p(1),d()),i&2){let e=r(8);l(),A(e.copy().noChartTypesFit)}}function Ro(i,t){i&1&&h(0,"nile-spinner",177)}function No(i,t){if(i&1&&h(0,"nile-glyph",182),i&2){let e=r().$implicit,n=r(10);y("name",n.chartTypeIcon(e.type))}}function $o(i,t){if(i&1){let e=w();s(0,"button",181),g("click",function(){let o=_(e).$implicit,a=r(10);return u(a.selectInlineChartType(o.component))}),f(1,Ro,1,0,"nile-spinner",177)(2,No,1,1,"nile-glyph",182),s(3,"span"),p(4),d()()}if(i&2){let e=t.$implicit,n=r(10);q("disabled",n.inlineChartTypeApplying()?"":null),l(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),A(e.label)}}function Lo(i,t){if(i&1&&(s(0,"p",178),p(1,"Recommended"),d(),s(2,"div",179),V(3,$o,5,3,"button",180,Gn),d()),i&2){let e=r(9);l(3),z(e.inlineSensibleChartTypes())}}function Bo(i,t){i&1&&h(0,"nile-spinner",177)}function Uo(i,t){if(i&1&&h(0,"nile-glyph",182),i&2){let e=r().$implicit,n=r(10);y("name",n.chartTypeIcon(e.type))}}function Wo(i,t){if(i&1){let e=w();s(0,"button",184),g("click",function(){let o=_(e).$implicit,a=r(10);return u(a.selectInlineChartType(o.component))}),f(1,Bo,1,0,"nile-spinner",177)(2,Uo,1,1,"nile-glyph",182),s(3,"span"),p(4),d()()}if(i&2){let e=t.$implicit,n=r(10);q("disabled",n.inlineChartTypeApplying()?"":null),l(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),A(e.label)}}function Go(i,t){if(i&1&&(s(0,"p",178),p(1,"Other types"),d(),s(2,"div",179),V(3,Wo,5,3,"button",183,Gn),d()),i&2){let e=r(9);l(3),z(e.inlineOtherChartTypes())}}function jo(i,t){if(i&1&&(f(0,Lo,5,0),f(1,Go,5,0)),i&2){let e=r(8);C(e.inlineSensibleChartTypes().length>0?0:-1),l(),C(e.inlineOtherChartTypes().length>0?1:-1)}}function Ho(i,t){if(i&1&&(s(0,"p",176),p(1),d()),i&2){let e=r(8);l(),A(e.inlineChartTypeError())}}function Yo(i,t){if(i&1){let e=w();s(0,"nile-dropdown",170),g("nile-hide",function(){_(e);let o=r(7);return u(o.closeInlineChartTypePicker())}),s(1,"button",171),g("click",function(o){_(e);let a=r(4).$implicit,c=r(3);return o.stopPropagation(),u(c.toggleInlineChartTypePicker(a.charts[0]))}),h(2,"nile-glyph",172),d(),s(3,"div",173),f(4,Vo,4,0,"div",174)(5,zo,2,1,"p",175)(6,jo,2,2),f(7,Ho,2,1,"p",176),d()()}if(i&2){let e=r(4).$implicit,n=r(3);y("open",n.inlineChartTypePickerFor()===e.charts[0]),l(4),C(n.inlineChartTypeLoading()?4:n.inlineChartTypeOptions().length===0?5:6),l(3),C(n.inlineChartTypeError()?7:-1)}}function Qo(i,t){if(i&1&&(s(0,"span",187),p(1),d()),i&2){let e=r(5).$implicit,n=r(3);l(),A(n.inlineActiveFilters(e.charts[0]).length)}}function Ko(i,t){if(i&1){let e=w();s(0,"span",190),p(1),s(2,"button",191),g("click",function(){let o=_(e).$implicit,a=r(6).$implicit,c=r(3);return u(c.removeInlineFilter(a.charts[0],o.id))}),h(3,"nile-glyph",192),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(3);l(),T(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),l(),q("disabled",o.inlineFilterApplying()?"":null)}}function Xo(i,t){if(i&1&&(s(0,"div",189),V(1,Ko,4,2,"span",190,ee),d()),i&2){let e=r(5).$implicit,n=r(3);l(),z(n.inlineActiveFilters(e.charts[0]))}}function Jo(i,t){i&1&&(s(0,"div",174),h(1,"nile-spinner",177),s(2,"span"),p(3,"Loading filterable fields\u2026"),d()())}function Zo(i,t){if(i&1&&(s(0,"p",176),p(1),d()),i&2){let e=r(8);l(),A(e.inlineFilterFieldsError())}}function ea(i,t){if(i&1&&(s(0,"p",175),p(1),d()),i&2){let e=r(8);l(),A(e.copy().noFilterableFields)}}function ta(i,t){if(i&1&&(s(0,"option",195),p(1),d()),i&2){let e=t.$implicit;y("value",e.name),l(),A(e.label)}}function na(i,t){if(i&1&&(s(0,"option",195),p(1),d()),i&2){let e=t.$implicit;y("value",e.value),l(),A(e.label)}}function ia(i,t){i&1&&(s(0,"div",174),h(1,"nile-spinner",196),s(2,"span"),p(3,"Loading values\u2026"),d()())}function oa(i,t){if(i&1){let e=w();s(0,"input",200),g("ngModelChange",function(o){_(e);let a=r(10);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(3);return u(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(10);y("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function aa(i,t){if(i&1){let e=w();s(0,"span",202),p(1,"and"),d(),s(2,"input",201),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(11);l(2),y("ngModel",e.inlineFilterBuilderValue2())}}function ra(i,t){if(i&1){let e=w();s(0,"input",201),g("ngModelChange",function(o){_(e);let a=r(10);return u(a.inlineFilterBuilderValue.set(o))}),d(),f(1,aa,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(3);y("ngModel",o.inlineFilterBuilderValue()),l(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function sa(i,t){if(i&1){let e=w();s(0,"span",202),p(1,"and"),d(),s(2,"input",204),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(11);l(2),y("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function la(i,t){if(i&1){let e=w();s(0,"input",203),g("ngModelChange",function(o){_(e);let a=r(10);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(3);return u(a.addInlineFilter(o.charts[0]))}),d(),f(1,sa,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(3);y("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),l(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function da(i,t){if(i&1){let e=w();s(0,"label",205)(1,"input",206),g("change",function(){let o=_(e).$implicit,a=r(11);return u(a.toggleInlineFilterMultiValue(o.value))}),d(),s(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(11);l(),y("checked",n.inlineFilterBuilderValues().includes(e.value)),l(2),J("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function ca(i,t){if(i&1&&(s(0,"div",198),V(1,da,4,3,"label",205,He),d()),i&2){let e=r(10);l(),z(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function pa(i,t){if(i&1&&(s(0,"option",195),p(1),d()),i&2){let e=t.$implicit;y("value",e.value),l(),J("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function _a(i,t){if(i&1){let e=w();s(0,"select",194),g("ngModelChange",function(o){_(e);let a=r(10);return u(a.inlineFilterBuilderValue.set(o))}),s(1,"option",207),p(2,"Select\u2026"),d(),V(3,pa,2,3,"option",195,He),d()}if(i&2){let e=r(10);y("ngModel",e.inlineFilterBuilderValue()),l(3),z(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function ua(i,t){if(i&1&&f(0,oa,1,2,"input",197)(1,ra,2,2)(2,la,2,3)(3,ca,3,0,"div",198)(4,_a,5,1,"select",199),i&2){let e,n=r(6).$implicit,o=r(3);C((e=(e=o.inlineFilterSelectedOperator(n.charts[0]))==null?null:e.valueKind)==="text"?0:e==="date"?1:e==="number"?2:e==="multi-select"?3:e==="select"?4:-1)}}function ga(i,t){if(i&1&&(s(0,"p",176),p(1),d()),i&2){let e=r(9);l(),A(e.inlineFilterApplyError())}}function ma(i,t){if(i&1){let e=w();s(0,"div",193)(1,"select",194),g("ngModelChange",function(o){_(e);let a=r(5).$implicit,c=r(3);return u(c.onInlineFilterFieldChange(a.charts[0],o))}),V(2,ta,2,2,"option",195,Ai),d(),s(4,"select",194),g("ngModelChange",function(o){_(e);let a=r(8);return u(a.onInlineFilterOperatorChange(o))}),V(5,na,2,2,"option",195,He),d(),f(7,ia,4,0,"div",174)(8,ua,5,1),s(9,"nile-button",18),g("click",function(){_(e);let o=r(5).$implicit,a=r(3);return u(a.addInlineFilter(o.charts[0]))}),p(10," Add filter "),d()(),f(11,ga,2,1,"p",176)}if(i&2){let e=r(5).$implicit,n=r(3);l(),y("ngModel",n.inlineFilterBuilderFieldId()),l(),z(n.inlineFilterFields(e.charts[0])),l(2),y("ngModel",n.inlineFilterBuilderOperator()),l(),z(n.inlineFilterOperators(e.charts[0])),l(2),C(n.inlineFilterValuesLoading()?7:8),l(2),q("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),l(2),C(n.inlineFilterApplyError()?11:-1)}}function ha(i,t){if(i&1){let e=w();s(0,"nile-dropdown",170),g("nile-hide",function(){_(e);let o=r(7);return u(o.closeInlineFilterBuilder())}),s(1,"button",185),g("click",function(o){_(e);let a=r(4).$implicit,c=r(3);return o.stopPropagation(),u(c.toggleInlineFilterPicker(a.charts[0]))}),h(2,"nile-glyph",186),f(3,Qo,2,1,"span",187),d(),s(4,"div",188)(5,"p",175),p(6,"Filters this preview only \u2014 nothing is saved."),d(),f(7,Xo,3,0,"div",189),f(8,Jo,4,0,"div",174)(9,Zo,2,1,"p",176)(10,ea,2,1,"p",175)(11,ma,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(3);y("open",n.inlineFilterPickerFor()===e.charts[0]),l(3),C(n.inlineActiveFilters(e.charts[0]).length>0?3:-1),l(4),C(n.inlineActiveFilters(e.charts[0]).length>0?7:-1),l(),C(n.inlineFilterFieldsLoading()?8:n.inlineFilterFieldsError()?9:n.inlineFilterFields(e.charts[0]).length===0?10:11)}}function fa(i,t){if(i&1&&(s(0,"span",208)(1,"span",209),p(2),d(),s(3,"span",210),p(4),d()()),i&2){let e=t.$implicit;l(2),T("",e.label,":"),l(2),A(e.value)}}function Ca(i,t){if(i&1&&(s(0,"div",161),V(1,fa,5,2,"span",208,Wn),d()),i&2){let e=r(4).$implicit;l(),z(e.forecastMeta??Ce(0,gt))}}function xa(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",163)(1,"nile-button",18),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.forecastFromChart(o))}),h(2,"nile-glyph",211),p(3),d()()}if(i&2){let e=r(7);l(3),T(" ",e.copy().forecastButton," ")}}function ba(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",164)(1,"nile-button",18),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.removeForecastFromChart(o))}),h(2,"nile-glyph",212),p(3),d()()}if(i&2){let e=r(7);l(3),T(" ",e.copy().removeForecastButton," ")}}function ya(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",165)(1,"nile-button",18),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.createAlertFromChart(o.charts[0]))}),h(2,"nile-glyph",213),p(3),d()()}if(i&2){let e=r(4).$implicit,n=r(3);y("content",n.canCreateAlert(e.charts[0])?"Create an alert on this chart":"Pick a dataset or pipeline to create an alert"),l(),q("disabled",n.canCreateAlert(e.charts[0])?null:""),l(2),T(" ",n.copy().createAlertButton," ")}}function va(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(5).$implicit,c=r(3);return u(c.addInlineToExisting(a.charts,o.id))}),h(1,"nile-glyph",217),p(2),d()}if(i&2){let e=t.$implicit;l(2),T(" ",e.name||"Untitled"," ")}}function wa(i,t){if(i&1){let e=w();s(0,"nile-dropdown",214),g("nile-hide",function(){_(e);let o=r(7);return u(o.inlinePickerFor.set(null))}),s(1,"nile-button",215),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.inlinePickerFor.set(a.inlinePickerFor()===o.id?null:o.id))}),h(2,"nile-glyph",216),p(3),d(),s(4,"nile-menu"),V(5,va,3,1,"nile-menu-item",null,ee),h(7,"nile-divider"),s(8,"nile-menu-item",48),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.addInlineWidget(o.charts))}),h(9,"nile-glyph",49),p(10),d()()()}if(i&2){let e=r(4).$implicit,n=r(3);y("open",n.inlinePickerFor()===e.id),l(),q("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),l(2),T(" ",n.copy().addToDashboardButton," "),l(2),z(n.nonAutoDashboards()),l(5),T(" ",n.copy().newDashboardLabel," ")}}function ka(i,t){if(i&1){let e=w();s(0,"nile-button",19),g("click",function(){_(e);let o=r(4).$implicit,a=r(3);return u(a.addInlineDefault(o.charts))}),h(1,"nile-glyph",216),p(2),d()}if(i&2){let e=r(7);q("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),l(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Aa(i,t){if(i&1){let e=w();s(0,"div",134)(1,"div")(2,"shared-nile-chart-widget",158),f(3,Io,3,0,"span",159),f(4,Yo,8,3,"nile-dropdown",160),f(5,ha,12,4,"nile-dropdown",160),d()(),f(6,Ca,3,1,"div",161),s(7,"div",162),f(8,xa,4,1,"nile-lite-tooltip",163),f(9,ba,4,1,"nile-lite-tooltip",164),f(10,ya,4,3,"nile-lite-tooltip",165),s(11,"nile-button",18),g("click",function(){_(e);let o=r(3).$implicit,a=r(3);return u(a.addToLibrary(o.charts[0]))}),h(12,"nile-glyph",166),p(13),d(),f(14,wa,11,5,"nile-dropdown",167)(15,ka,3,3,"nile-button",168),d()()}if(i&2){let e=r(3).$implicit,n=r(3);l(),Xe(n.inlineChartClass(e.charts[0])),l(),y("config",n.inlineDisplayConfig(e.charts[0]))("loading",!!e.forecastRecomputing)("conversationId",n.activeConversationId()),l(),C(e.forecast?3:-1),l(),C(n.isFilterChart(e.charts[0])?-1:4),l(),C(n.isFilterChart(e.charts[0])?-1:5),l(),C(e.forecastMeta!=null&&e.forecastMeta.length?6:-1),l(2),C(n.canForecastChart(e)?8:-1),l(),C(n.canRemoveForecast(e)?9:-1),l(),C(n.isFilterChart(e.charts[0])?-1:10),l(3),T(" ",n.copy().addToLibraryButton," "),l(),C(!n.builderOpen()&&n.nonAutoDashboards().length>1?14:15)}}function Pa(i,t){if(i&1){let e=w();s(0,"div",218),g("click",function(){_(e);let o=r(3).$implicit,a=r(3);return u(a.openArtifact(o.charts,o.id))}),s(1,"div",219),h(2,"nile-glyph",220),d(),s(3,"div",221)(4,"span",222),p(5),d(),s(6,"span",223),p(7),d()(),s(8,"nile-button",19),g("click",function(o){_(e);let a=r(3).$implicit,c=r(3);return o.stopPropagation(),u(c.openArtifact(a.charts,a.id))}),p(9),h(10,"nile-glyph",224),d()()}if(i&2){let e=r(3).$implicit,n=r(3);l(5),A(e.dashboardTitle||e.charts[0].title),l(2),J("Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""),l(2),T(" ",n.copy().viewButton," ")}}function Ma(i,t){if(i&1){let e=w();s(0,"div",136),h(1,"nile-glyph",225),s(2,"span",226),p(3),d(),s(4,"button",227),g("click",function(){_(e);let o=r(3).$implicit,a=r(3);return u(a.recomputeStoredForecast(o))}),p(5),d()()}if(i&2){let e=r(3).$implicit,n=r(3);l(3),A(n.restoredForecastLabel(e)),l(),y("disabled",n.isStreaming()),l(),T(" ",n.copy().recomputeButton," ")}}function Sa(i,t){if(i&1&&h(0,"nile-glyph",230),i&2){let e=r().$implicit;q("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680")}}function Fa(i,t){if(i&1&&(s(0,"span",232),p(1),d()),i&2){let e=r().$implicit;l(),A(e.badge)}}function Ta(i,t){if(i&1){let e=w();s(0,"button",229),g("click",function(){let o=_(e).$implicit,a=r(4).$implicit,c=r(3);return u(c.onFollowUp(o,a))}),f(1,Sa,1,2,"nile-glyph",230),s(2,"span",231),p(3),d(),f(4,Fa,2,1,"span",232),d()}if(i&2){let e=t.$implicit,n=r(7);H("follow-up--ai",e.tone==="ai"),y("disabled",n.isStreaming()),l(),C(e.icon?1:-1),l(2),A(e.label),l(),C(e.badge?4:-1)}}function Oa(i,t){if(i&1&&(s(0,"div",137),V(1,Ta,5,6,"button",228,Pi),d()),i&2){let e=r(3).$implicit;l(),z(e.followUps??Ce(0,gt))}}function qa(i,t){if(i&1&&(s(0,"div",138),h(1,"nile-glyph",233),s(2,"span",234),p(3),d()()),i&2){let e=r(6);l(3),A(e.copy().errors.assistantErrorFallback)}}function Da(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",130)(1,"div",131),f(2,xo,2,1),V(3,Do,4,2,"div",132,re),f(5,Eo,3,2,"div",133),f(6,Aa,16,14,"div",134)(7,Pa,11,4,"div",135),f(8,Ma,6,3,"div",136),f(9,Oa,3,1,"div",137),f(10,qa,4,1,"div",138),d()()),i&2){let e=r(2).$implicit,n=r(3);y("role","ai")("hideIcon",!0),l(2),C(e.text&&!n.suppressTextFor(e)?2:-1),l(),z(e.choices),l(2),C(n.isMultiChoice(e)?5:-1),l(),C(e.charts.length===1&&!n.isDataGrid(e.charts[0])?6:e.charts.length?7:-1),l(2),C(n.isRestoredForecast(e)?8:-1),l(),C(e.followUps!=null&&e.followUps.length?9:-1),l(),C(e.hasError?10:-1)}}function Ea(i,t){if(i&1&&(f(0,ho,1,1,"nile-ai-steps",129),f(1,Da,11,8,"nile-ai-chat-bubble",130)),i&2){let e=r().$implicit;C(e.isStreaming&&(e.tools!=null&&e.tools.length)?0:-1),l(),C(e.text||e.charts.length||e.choices!=null&&e.choices.length||e.hasError?1:-1)}}function Ia(i,t){if(i&1&&(f(0,mo,4,4,"nile-ai-chat-bubble",121),f(1,Ea,2,2)),i&2){let e=t.$implicit;C(e.role==="user"?0:-1),l(),C(e.role==="assistant"?1:-1)}}function Va(i,t){if(i&1&&V(0,Ia,2,2,null,null,ee),i&2){let e=r(2);z(e.messages())}}function za(i,t){if(i&1&&(s(0,"div",111),Ke(1,96),d()),i&2){r(2);let e=Me(8);l(),y("ngTemplateOutlet",e)}}function Ra(i,t){if(i&1){let e=w();s(0,"nile-ai-chat",110,1),g("mouseup",function(o){_(e);let a=r();return u(a.onThreadMouseUp(o))}),f(2,po,11,0)(3,Va,2,0),f(4,za,2,1,"div",111),d()}if(i&2){let e=r();l(2),C(e.loadingConversation()?2:3),l(2),C(e.messages().length?4:-1)}}function Na(i,t){if(i&1&&(s(0,"div",236),h(1,"nile-glyph",243),s(2,"span"),p(3),d()()),i&2){let e=r(2);l(3),A(e.copy().dropFilesOverlay)}}function $a(i,t){if(i&1){let e=w();s(0,"div",237),h(1,"nile-glyph",29),s(2,"span",244),p(3),d(),s(4,"button",245),g("click",function(){_(e);let o=r(2);return u(o.clearReplyQuote())}),h(5,"nile-glyph",246),d()()}i&2&&(l(3),A(t))}function La(i,t){i&1&&h(0,"nile-spinner",249)}function Ba(i,t){if(i&1){let e=w();s(0,"button",252),g("click",function(){_(e);let o=r().$implicit,a=r(3);return u(a.retryAttachment(o.id))}),p(1,"Retry"),d()}}function Ua(i,t){if(i&1){let e=w();s(0,"div",248),h(1,"nile-glyph",127),s(2,"span",128),p(3),d(),f(4,La,1,0,"nile-spinner",249)(5,Ba,2,0,"button",250),s(6,"button",251),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.removeAttachment(o.id))}),h(7,"nile-glyph",246),d()()}if(i&2){let e=t.$implicit;H("aq-chip--error",e.status==="error"),l(),q("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),q("title",e.name),l(),A(e.name),l(),C(e.status==="uploading"?4:e.status==="error"?5:-1)}}function Wa(i,t){if(i&1&&(s(0,"div",238),V(1,Ua,8,6,"div",247,ee),d()),i&2){let e=r(2);l(),z(e.attachments())}}function Ga(i,t){if(i&1){let e=w();s(0,"nile-button",253),g("click",function(){_(e),r();let o=Me(5);return u(o.click())}),h(1,"nile-glyph",254),d()}if(i&2){let e=r(2);q("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function ja(i,t){if(i&1){let e=w();s(0,"div",235),g("dragenter",function(o){_(e);let a=r();return u(a.onComposerDragEnter(o))})("dragover",function(o){_(e);let a=r();return u(a.onComposerDragOver(o))})("dragleave",function(o){_(e);let a=r();return u(a.onComposerDragLeave(o))})("drop",function(o){_(e);let a=r();return u(a.onComposerDrop(o))}),f(1,Na,4,1,"div",236),f(2,$a,6,1,"div",237),f(3,Wa,3,0,"div",238),s(4,"input",239,2),g("change",function(o){_(e);let a=r();return u(a.onFilesPicked(o))}),d(),s(6,"nile-ai-prompt",240,3),g("keydown",function(o){_(e);let a=r();return u(a.onComposerKeydown(o))})("nile-change",function(o){_(e);let a=r();return u(a.inputText.set((o.detail==null?null:o.detail.value)??""))})("nile-submit",function(o){_(e);let a=r();return u(a.onComposerSubmit(o.detail==null?null:o.detail.value))})("nile-stop",function(){_(e);let o=r();return u(o.stopStream())}),s(8,"div",241),g("click",function(o){return o.stopPropagation()}),f(9,Ga,2,1,"nile-button",242),d()()()}if(i&2){let e,n=r();H("aq-composer-wrap--dragover",n.isDraggingFile()),l(),C(n.features().attachments&&n.isDraggingFile()?1:-1),l(),C((e=n.replyQuote())?2:-1,e),l(),C(n.features().attachments&&n.attachments().length?3:-1),l(),q("accept",n.acceptUploadTypes),l(2),H("aq-attach-full",n.attachAtCapacity()),y("placeholder",n.copy().composerPlaceholder)("hideModel",!0)("hideAddContext",!0)("rows",1)("speechLang","en-US")("value",n.inputText())("loading",n.isStreaming()),l(3),C(n.features().attachments?9:-1)}}function Ha(i,t){if(i&1){let e=w();s(0,"div",255),g("pointerdown",function(o){_(e);let a=r();return u(a.startChatResize(o))}),d()}if(i&2){let e=r();H("is-active",e.isResizing())}}function Ya(i,t){if(i&1){let e=w();s(0,"nile-button",18),g("click",function(){let o=_(e),a=r(2);return u(a.forecastFromChart(o))}),h(1,"nile-glyph",211),p(2),d()}if(i&2){let e=r(2);l(2),T(" ",e.copy().forecastButton," ")}}function Qa(i,t){if(i&1){let e=w();s(0,"nile-button",18),g("click",function(){_(e);let o=r(2);return u(o.openStoryPicker())}),h(1,"nile-glyph",264),p(2),d()}if(i&2){let e=r(2);q("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.copy().addToStoryButton," ")}}function Ka(i,t){if(i&1){let e=w();s(0,"nile-menu-item",48),g("click",function(){let o=_(e).$implicit,a=r(3);return a.showAddPicker.set(!1),u(a.addToExistingDashboard(o.id))}),h(1,"nile-glyph",217),p(2),d()}if(i&2){let e=t.$implicit;l(2),T(" ",e.name||"Untitled"," ")}}function Xa(i,t){if(i&1){let e=w();s(0,"nile-dropdown",214),g("nile-hide",function(){_(e);let o=r(2);return u(o.showAddPicker.set(!1))}),s(1,"nile-button",215),g("click",function(){_(e);let o=r(2);return u(o.showAddPicker.set(!o.showAddPicker()))}),h(2,"nile-glyph",216),p(3),d(),s(4,"nile-menu"),V(5,Ka,3,1,"nile-menu-item",null,ee),h(7,"nile-divider"),s(8,"nile-menu-item",48),g("click",function(){_(e);let o=r(2);return o.showAddPicker.set(!1),u(o.addArtifactToDashboard())}),h(9,"nile-glyph",49),p(10),d()()()}if(i&2){let e=r(2);y("open",e.showAddPicker()),l(),q("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.copy().addToDashboardButton," "),l(2),z(e.nonAutoDashboards()),l(5),T(" ",e.copy().newDashboardLabel," ")}}function Ja(i,t){if(i&1){let e=w();s(0,"nile-button",19),g("click",function(){_(e);let o=r(2);return u(o.addArtifactToDashboard())}),h(1,"nile-glyph",216),p(2),d()}if(i&2){let e=r(2);q("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Za(i,t){if(i&1){let e=w();s(0,"aside",13)(1,"div",256)(2,"span",257),p(3),d(),s(4,"nile-button",258),g("click",function(){_(e);let o=r();return u(o.closeArtifact())}),h(5,"nile-glyph",259),d()(),s(6,"div",260)(7,"shared-dashboard-grid",261,4),g("selectionChange",function(o){_(e);let a=r();return u(a.onSelectionChange(o))})("forecast",function(o){_(e);let a=r();return u(a.onArtifactForecast(o))})("setAlert",function(o){_(e);let a=r();return u(a.onSetAlert(o))})("filterSubmit",function(o){_(e);let a=r();return u(a.onArtifactFilterSubmit(o))})("filterChange",function(o){_(e);let a=r();return u(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){_(e);let a=r();return u(a.onDslWidgetUpdated(o))}),d()(),s(9,"div",262),f(10,Ya,3,1,"nile-button",263),f(11,Qa,3,2,"nile-button",263),s(12,"nile-button",18),g("click",function(){_(e);let o=r();return u(o.publishAsNewDashboard())}),p(13),d(),f(14,Xa,11,5,"nile-dropdown",167)(15,Ja,3,3,"nile-button",168),d()()}if(i&2){let e,n=r();l(3),A(n.artifactTitle()),l(4),y("widgets",n.artifactWidgets())("conversationId",n.activeConversationId())("editMode",!1)("selectable",!0)("canSetAlert",!0)("canAddToStory",!1)("canForecast",!0)("forecastable",n.artifactForecastable())("forecastingWidgetId",n.artifactForecastingId())("showEditDslInViewMode",!0)("widgetsLoading",n.applyingFilters())("dashboardFilters",n.activeDashboardFilters())("resolvedFilters",n.activeResolvedFilters())("applySummary",n.applySummary())("filterExplanation",n.filterExplanation()),l(3),C((e=n.artifactForecastMsg())?10:-1,e),l(),C(-1),l(),q("loading",n.committingAction()==="publish"?"":null)("disabled",n.committingAction()||!n.hasSelection()?"":null),l(),T(" ",n.copy().publishAsDashboardButton," "),l(),C(!n.builderOpen()&&n.nonAutoDashboards().length>1?14:15)}}function er(i,t){i&1&&h(0,"nile-spinner",273)}function tr(i,t){i&1&&h(0,"nile-glyph",55)}function nr(i,t){if(i&1){let e=w();s(0,"input",52),g("input",function(o){_(e);let a=r(2);return u(a.dashboardTitleDraft.set(o.target.value))})("keydown.enter",function(){_(e);let o=r(2);return u(o.commitDashboardTitle())})("keydown.escape",function(){_(e);let o=r(2);return u(o.cancelEditDashboardTitle())}),d(),s(1,"nile-lite-tooltip",53)(2,"button",272),g("click",function(){_(e);let o=r(2);return u(o.commitDashboardTitle())}),f(3,er,1,0,"nile-spinner",273)(4,tr,1,0,"nile-glyph",55),d()()}if(i&2){let e=r(2);y("value",e.dashboardTitleDraft()),l(2),y("disabled",e.renamingDashboard()),l(),C(e.renamingDashboard()?3:4)}}function ir(i,t){i&1&&h(0,"nile-skeleton-loader",267)}function or(i,t){if(i&1){let e=w();s(0,"nile-lite-tooltip",274)(1,"button",275),g("click",function(){_(e);let o=r(3);return u(o.startEditDashboardTitle())}),h(2,"nile-glyph",59),d()()}}function ar(i,t){if(i&1&&(s(0,"span",56),p(1),d(),f(2,or,3,0,"nile-lite-tooltip",274)),i&2){let e=r(2);l(),A((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),l(),C(e.builderDashboardId()?2:-1)}}function rr(i,t){if(i&1){let e=w();s(0,"section",14)(1,"header",265)(2,"div",30)(3,"nile-button",258),g("click",function(){_(e);let o=r();return u(o.closeBuilder())}),h(4,"nile-glyph",266),d(),f(5,nr,5,3)(6,ir,1,0,"nile-skeleton-loader",267)(7,ar,3,2),d(),s(8,"div",31)(9,"nile-lite-tooltip",165)(10,"button",268),g("click",function(){_(e);let o=r();return u(o.toggleBuilderFullscreen())}),h(11,"nile-glyph",269),d()(),s(12,"shared-builder-toolbar",270),g("action",function(o){_(e);let a=r();return u(a.onBuilderMenuAction(o))}),d()()(),s(13,"shared-builder-host",271),g("exitBuilder",function(){_(e);let o=r();return u(o.closeBuilder())})("executiveSummary",function(o){_(e);let a=r();return u(a.onExecutiveSummary(o))})("galleryPrompt",function(o){_(e);let a=r();return u(a.inputText.set(o))})("published",function(o){_(e);let a=r();return u(a.onBuilderPublished(o))})("publishFailed",function(o){_(e);let a=r();return u(a.onBuilderPublishFailed(o))}),d()()}if(i&2){let e=r();l(5),C(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),l(4),y("content",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),q("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),q("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),l(),y("canForecast",!0)("anyForecastOn",(e.builderRef==null?null:e.builderRef.anyForecastOn())??!1)("editMode",(e.builderRef==null?null:e.builderRef.editMode())??!0)("showFullscreen",!1)("fullscreen",e.builderFullscreen())("busy",(e.builderRef==null?null:e.builderRef.isPublishing())??!1)("showPromptGallery",!1),l(),y("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",!1)}}function sr(i,t){if(i&1){let e=w();s(0,"label",286)(1,"input",287),g("change",function(){let o=_(e).$implicit,a=r(3);return u(a.onGranularityPick(o))}),d(),s(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(2);H("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),q("title",e.reason||null),l(),y("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),l(2),A(e.value)}}function lr(i,t){i&1&&(s(0,"p",280),p(1),d()),i&2&&(l(),A(t))}function dr(i,t){if(i&1&&(s(0,"p",280),p(1),d()),i&2){let e=r();l(),A(e.granularityNote)}}function cr(i,t){if(i&1&&(s(0,"div",276)(1,"span",288),p(2,"Model"),d(),s(3,"div",289)(4,"p",290),p(5),d(),s(6,"p",291),p(7),d()()()),i&2){let e=t;l(5),A(e.title),l(2),A(e.body)}}function pr(i,t){if(i&1&&(s(0,"div",276)(1,"span",288),p(2,"Guardrails"),d(),s(3,"div",292)(4,"p",290),h(5,"nile-glyph",293),p(6),d(),s(7,"p",291),p(8),d()()()),i&2){let e=t;l(3),H("fs-card--pass",e.passed)("fs-card--warn",!e.passed),l(2),q("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"#079455":"#dc6803"),l(),T(" ",e.title," "),l(2),A(e.body)}}function _r(i,t){if(i&1){let e=w();s(0,"div",276)(1,"label",277),p(2," Horizon \u2014 "),s(3,"span",278),p(4),d()(),s(5,"input",279),g("input",function(o){_(e);let a=r(2);return u(a.onHorizonInput(o.target.value))}),d(),s(6,"p",280),p(7),d()(),s(8,"div",276)(9,"span",281),p(10,"Granularity"),d(),s(11,"div",282),V(12,sr,4,9,"label",283,He),d(),f(14,lr,2,1,"p",280)(15,dr,2,1,"p",280),d(),s(16,"div",276)(17,"label",284),p(18," Confidence interval \u2014 "),s(19,"span",278),p(20),d()(),s(21,"input",285),g("input",function(o){_(e);let a=r(2);return u(a.onConfidenceIndexInput(o.target.value))}),d(),s(22,"p",280),p(23),d()(),f(24,cr,8,2,"div",276),f(25,pr,9,8,"div",276)}if(i&2){let e,n,o,a=t,c=r(),m=r();l(4),J("",c.horizon," ",m.horizonUnit()),l(),te("--fs-fill",m.horizonFill()),y("value",c.horizon),q("max",m.horizonMax())("aria-valuetext",c.horizon+" "+m.horizonUnit()),l(2),A(m.horizonNote()),l(5),z(m.granularityChoices()),l(2),C((e=m.unavailableGranularityNote())?14:15,e),l(6),T("",c.confidence,"%"),l(),te("--fs-fill",m.confidenceFill()),y("value",m.confidenceIndex()),q("max",a.confidenceLevels.length-1)("aria-valuetext",c.confidence+"%"),l(2),A(a.confidenceNote),l(),C((n=a.modelCard)?24:-1,n),l(),C((o=a.guardrails)?25:-1,o)}}function ur(i,t){if(i&1&&f(0,_r,26,18),i&2){let e,n=r();C((e=n.forecastCopy())?0:-1,e)}}function gr(i,t){if(i&1&&(s(0,"div",299),h(1,"nile-skeleton-loader",300),s(2,"div",301),h(3,"nile-skeleton-loader",73),d()()),i&2){let e=t.$implicit;l(2),te("width",e,"px")}}function mr(i,t){if(i&1&&(s(0,"div",296),V(1,gr,4,2,"div",299,re),d()),i&2){let e=r(2);l(),z(e.gallerySkeletonRows)}}function hr(i,t){if(i&1){let e=w();s(0,"nile-ai-prompts",302),g("nile-item-click",function(o){_(e);let a=r(2);return u(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);y("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function fr(i,t){if(i&1&&(s(0,"div",298),p(1),d()),i&2){let e=r(2);l(),J("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function Cr(i,t){if(i&1&&(s(0,"div",298),p(1),d()),i&2){let e=r(2);l(),A(e.copy().noPromptsYet)}}function xr(i,t){if(i&1){let e=w();s(0,"nile-input",294),g("nile-input",function(o){_(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),h(1,"nile-glyph",295),d(),f(2,mr,3,0,"div",296)(3,hr,1,3,"nile-ai-prompts",297)(4,fr,2,2,"div",298)(5,Cr,2,1,"div",298)}if(i&2){let e=r();y("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),l(2),C(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function br(i,t){if(i&1){let e=w();s(0,"app-alert-drawer",303),g("closed",function(){_(e);let o=r();return u(o.onAlertClosed())})("saved",function(){_(e);let o=r();return u(o.onAlertClosed())}),d()}if(i&2){let e,n=r();y("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function yr(i,t){i&1&&h(0,"nile-executive-summary",26,5)}function vr(i,t){if(i&1){let e=w();s(0,"app-story-picker-drawer",304),g("closed",function(){_(e);let o=r();return u(o.closeStoryPicker())})("added",function(){_(e);let o=r();return u(o.onAddedToStory())}),d()}if(i&2){let e=r();y("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function fe(){return Math.random().toString(36).slice(2)}var wr=4,kr="forecast-settings",Ar="forecast-this";function Bn(i){return{id:i.id,role:i.role,text:i.content,charts:(i.charts??[]).map(t=>{let e=t;return{title:e.title??"Chart",componentName:e.componentName??"",config:t}}),dashboardTitle:i.dashboardTitle??void 0,forecastSpec:i.forecastSpec??void 0,choices:i.choices??void 0,isStreaming:!1,hasError:!1}}var ye=class i{alertDrawerOpen=x(!1);alertWidget=x(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=D(()=>{let t=et(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(P(b({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=$(he);tokenStore=$(ie);features(){return E().features}copy(){return E().copy}showHeader(){return E().ui.header}zone=$(ft);route=$(It);router=$(Vt);dashboardState=$(_n);publishRepo=$(oe);globalWidget=$(gn);forecastApi=$(We);forecastService=$(Ht);loading=x(!0);conversations=x([]);activeConversationId=x(null);conversationConnectionId=x(null);messages=x([]);inputText=x("");isStreaming=x(!1);streamAbort=null;suggestions=x([]);suggestionsLoading=x(!0);suggestionsSeq=0;showConversationPicker=x(!1);showRelatedDashboards=x(!1);loadingConversation=x(!1);editingTitle=x(!1);titleDraft=x("");editingDashboardTitle=x(!1);dashboardTitleDraft=x("");renamingDashboard=x(!1);conversationsLoading=x(!0);dashboardsLoading=x(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];savingDashboard=x(!1);committingAction=x(null);conversationDashboards=x([]);nonAutoDashboards=D(()=>this.conversationDashboards().filter(t=>!t.isAutoGenerated));showAddPicker=x(!1);inlinePickerFor=x(null);inlineChartTypePickerFor=x(null);inlineChartTypeOptions=x([]);inlineChartTypeLoading=x(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=x(!1);inlineChartTypeError=x(null);inlineFilterPickerFor=x(null);showScopePicker=x(!1);datasets=x([]);pipelines=x([]);scopeLoading=x(!1);selectedScope=x(null);scopeListsLoaded=!1;saveDialogOpen=x(!1);saveDashboardName=x("");galleryOpen=x(!1);gallerySearch=x("");filteredGalleryPrompts=D(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=D(()=>{let t=this.forecastContext();return this.suggestions().slice(0,wr).map(e=>(E().features.forecast&&t?!!st(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=D(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=x(null);activeArtifactRaw=x([]);activeArtifact=D(()=>{let t=this.artifactSourceMsgId();if(t){let e=this.messages().find(n=>n.id===t);if(e)return e.charts}return this.activeArtifactRaw()});artifactOpen=D(()=>this.activeArtifact().length>0);artifactTitle=D(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Preview")});isFilterChart(t){if(!t)return!1;let e=t.config??{};return Je({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=D(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>P(b({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=ge(e);return pn(n)});filterOverlay=x(new Map);forecastOverlay=x(new Map);artifactForecastable=x({});artifactForecastingId=x(null);artifactWidgets=D(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),c=a?P(b({},o),{config:a.config,edited:a.edited}):o,m=n.get(o.id);return m?P(b({},c),{config:m}):c})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1){this.showToast("info",n.guardrails.body||"This chart can\u2019t be forecast.");return}n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch(n){this.showToast("error",this.extractMessage(n,this.copy().errors.couldntForecastWidget))}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=x(!1);activeDashboardFilters=x(null);activeResolvedFilters=x(null);applySummary=x(null);filterExplanation=x(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=x([]);hasSelection=D(()=>this.selectedWidgetIds().length>0);selectedArtifactCharts=D(()=>{let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});builderOpen=x(!1);builderDashboardId=x(null);builderPreseeded=x(!1);builderFullscreen=x(!1);chatPaneWidth=x(null);isResizing=x(!1);layoutMode=D(()=>bn({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=D(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=D(()=>this.tokenStore.tenantId()??"");attachments=x([]);uploadsInFlight=D(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=D(()=>this.attachments().filter(t=>at(t.name,t.contentType)).length);nonExcelCount=D(()=>this.attachments().length-this.excelCount());attachAtCapacity=D(()=>this.nonExcelCount()>=it&&this.excelCount()>=ot);acceptUploadTypes=[...nt,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=x(!1);canSend=D(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=x(null);replyQuote=x(null);activeConversation=D(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=x(null);activeConversationTitle=D(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){Ae(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(c=>{if(a!==this.suggestionsSeq)return;let m=[...c.widgetSuggestions??[],...c.conversationStarters??[]];this.suggestions.set(m.length?m:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t))}async ngOnInit(){try{this.conversationsLoading.set(!0);let e=await this.svc.listConversations().catch(()=>[]);this.conversations.set(e)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards();let t=this.route.snapshot.paramMap.get("id");t&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.route.snapshot.queryParamMap.get("summary")==="1"?this.onExecutiveSummary(t).then(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(t))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(c=>c.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(Bn)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}}streamSpeed=[6,18];openScopeMenu(){let t=!this.showScopePicker();this.showScopePicker.set(t),t&&this.loadScopeLists()}async loadScopeLists(){if(!this.scopeListsLoaded){this.scopeListsLoaded=!0,this.scopeLoading.set(!0);try{let[t,e]=await Promise.allSettled([this.svc.listDatasets(),this.svc.listPipelines()]);t.status==="fulfilled"&&this.datasets.set(t.value),e.status==="fulfilled"&&this.pipelines.set(e.value);let n=[t,e].filter(o=>o.status==="rejected");n.length>0&&(this.scopeListsLoaded=!1,n.length===2&&this.showToast("error",this.extractMessage(n[0].reason,this.copy().errors.couldntLoadDatasetsOrPipelines)))}finally{this.scopeLoading.set(!1)}}}selectScope(t,e){this.selectedScope.set({kind:t,id:e.id,name:e.name}),this.showScopePicker.set(!1)}clearScope(){this.selectedScope.set(null)}dashboardSource(){return et(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t){if(this.showConversationPicker.set(!1),t!==this.activeConversationId()){this.loading.set(!0),this.loadingConversation.set(!0);try{let e=await this.svc.getConversation(t);if(!e)return;this.activeConversationId.set(t),this.conversationConnectionId.set(e.conversation.connectionId??null),this.messages.set(e.messages.map(Bn)),this.loadConversationDashboards(),this.scrollToBottom()}catch(e){this.showToast("error",this.extractMessage(e,this.copy().errors.couldntOpenConversation))}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch(n){this.showToast("error",this.extractMessage(n,this.copy().errors.couldntDeleteConversation))}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(P(b({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch(t){this.showToast("error",this.extractMessage(t,this.copy().errors.couldntCreateDashboard))}finally{this.savingDashboard.set(!1)}}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?P(b({},o),{title:e}):o))}catch(n){this.showToast("error",this.extractMessage(n,this.copy().errors.couldntRenameConversation))}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=at(t.name,t.type);if(e&&this.excelCount()>=ot){this.showToast("error",this.copy().errors.tooManyExcelAttachments);return}if(!e&&this.nonExcelCount()>=it){this.showToast("error",this.copy().errors.tooManyNonExcelAttachments);return}if(!e&&!nt.includes(t.type)){this.showToast("error",`"${t.name}" ${this.copy().errors.unsupportedFileType}`);return}if(t.size>xn){this.showToast("error",`"${t.name}" ${this.copy().errors.fileTooLarge}`);return}if(this.attachments().some(m=>m.name===t.name&&m.size===t.size&&m.file?.lastModified===t.lastModified)){this.showToast("info",`"${t.name}" is already attached.`);return}let o=fe(),a=new AbortController,c={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(m=>[...m,c]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?b(b({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(c=>c===e?P(b({},c),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):c)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?P(b({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[];this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>{if(o.selected)return o;let a=o.chatDraftText?.trim();if(a)return e.push(this.chatDraftReply(o,a)),P(b({},o),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!o.draftSelection)return o;let c=o.options.find(m=>m.id===o.draftSelection);return c&&e.push(c.reply??c.label),P(b({},o),{selected:o.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
6
- `)),this.sendMessage())}subjectIdOf(t){let e=t.options[0]?.id??"";return e.includes("::")?e.slice(0,e.lastIndexOf("::")):e}chatDraftReply(t,e){return t.kind==="widget_clarification"?`For "${this.subjectIdOf(t)}": ${e}`:e}requestPlan(t,e){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?P(b({},o),{selected:"__plan__"}):o)})),this.inputText.set("Give me the plan"),this.sendMessage())}openChatDraft(t,e){this.isStreaming()||e.selected||this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?P(b({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?P(b({},a),{chatDraftText:n}):a)}))}defineChatDraft(t,e){let n=e.chatDraftText?.trim();if(!(!n||this.isStreaming())){if(this.isMultiChoice(t)){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?P(b({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?P(b({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}static TEXT_REDUNDANT_CHOICE_KINDS=new Set(["index","clarification","widget_clarification"]);suppressTextFor(t){let e=t.choices;return!!e?.length&&e.every(n=>!!n.kind&&i.TEXT_REDUNDANT_CHOICE_KINDS.has(n.kind))}onThreadMouseUp(t){let e=t.composedPath();if(e.some(M=>M instanceof HTMLElement&&M.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(M=>M instanceof HTMLElement&&M.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let c=46,m=Math.min(Math.max(t.clientX,c+8),window.innerWidth-c-8),S=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:m,above:S})}onTextSelectionChange(){if(!this.quoteBadge())return;let t=document.getSelection();(!t||!t.toString().trim())&&this.quoteBadge.set(null)}hideQuoteBadge(){this.quoteBadge.set(null)}addReplyQuote(){let t=this.quoteBadge();t&&(this.replyQuote.set(t.text),this.quoteBadge.set(null),document.getSelection()?.removeAllRanges(),this.composerRef?.nativeElement?.focus?.())}clearReplyQuote(){this.replyQuote.set(null)}forecastContext=x(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=E().features.forecast?st(t,e):null;if(!n)return!1;let o=n.extendsExisting?this.findForecastTarget():null;return n.extendsExisting&&!o||!o?!1:this.forecastChartMessage(o,t,{metric:n.metric,horizon:n.horizon,granularity:n.granularity})}forecastChartMessage(t,e,n={}){let o=this.forecastContext();if(!o)return!1;let a=Tn(t.charts[0]?.config);if(!a.length)return!1;let c={metric:n.metric??o.metrics[0]?.id??"headcount",horizon:n.horizon??o.defaults.horizon,granularity:n.granularity??o.defaults.granularity,confidence:o.defaults.confidence,series:a,sourceGranularity:o.defaults.granularity},m=t.charts[0]?.config??{};return this.runForecast(e,c,{queryMeta:m.queryMeta,dataSourceId:m.dataSourceId},{chartMsgId:t.id}),!0}forecastableMsgs=new Map;canForecastChart(t){if(!this.forecastContext())return!1;let e=this.forecastableMsgs.get(t.id);if(e!==void 0)return e;let n=ut(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=D(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&ut(e)?e:null});isRestoredForecast(t){return!!t.forecastSpec&&!t.charts.length&&!t.forecastRecomputing}restoredForecastLabel(t){let e=t.forecastSpec;if(!e)return"";let o={Weekly:"weeks",Monthly:"months",Quarterly:"quarters",Yearly:"years"}[e.granularity]??"periods",a=e.computedAt?new Date(e.computedAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):null;return`${e.horizon} ${o} ahead at ${e.confidence}% confidence`+(a?` \xB7 computed ${a}`:"")}recomputeStoredForecast(t){let e=t.forecastSpec;if(!e||this.isStreaming())return;let n=this.findForecastTarget();if(!n){this.showToast("info","The chart this forecast was built on isn\u2019t in view any more.");return}this.forecastChartMessage(n,`Forecast ${e.horizon} ${e.granularity.toLowerCase()} periods ahead`,{metric:e.metric,horizon:e.horizon,granularity:e.granularity})}canRemoveForecast(t){return!!t.forecast&&!!t.preForecastCharts?.length&&!t.forecastRecomputing}removeForecastFromChart(t){this.canRemoveForecast(t)&&(this.updateAssistantMsg(t.id,{charts:t.preForecastCharts??[],preForecastCharts:void 0,forecast:!1,forecastMeta:void 0}),this.forecastChartMsgId===t.id&&(this.forecastTurnMsgId&&this.updateAssistantMsg(this.forecastTurnMsgId,{followUps:[]}),this.forecastChartMsgId=null,this.forecastTurnMsgId=null,this.lastForecastRequest=null,this.forecastSettingsOpen.set(!1),this.appliedForecastSettings.set(null)))}forecastFromChart(t){this.isStreaming()||this.forecastChartMessage(t,"Forecast this chart")||this.showToast("info","This chart doesn\u2019t have a series I can project.")}findForecastTarget(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!(n.role!=="assistant"||n.charts.length!==1)&&je(n.charts[0].config))return n}return null}async recomputeForecastInPlace(t,e,n){this.isStreaming.set(!0),this.updateAssistantMsg(t,{forecastRecomputing:!0,hasError:!1});try{let o=await this.forecastApi.compute(e),a=_t(o,e.series??[]);this.lastForecastRequest=P(b({},e),{horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.appliedForecastSettings.set({horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.forecastMaxHorizon.set(a.maxHorizon),this.forecastFitted.set({periods:o.fittedPeriods,granularity:o.sourceGranularity}),this.forecastGuardrails.set(o.guardrails),this.forecastModelCard.set(o.modelCard),n.queryMeta&&(a.chart.queryMeta=n.queryMeta),n.dataSourceId&&(a.chart.dataSourceId=n.dataSourceId),a.chart.config&&(a.chart.config.forecast={enabled:!0,horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.updateAssistantMsg(t,{forecastRecomputing:!1,charts:[{title:a.chart.title,componentName:a.chart.componentName,config:a.chart}],forecastMeta:a.meta}),this.forecastTurnMsgId&&this.forecastTurnMsgId!==t?this.updateAssistantMsg(this.forecastTurnMsgId,{text:a.answer,followUps:o.followUps}):this.updateAssistantMsg(t,{text:a.answer,followUps:o.followUps})}catch(o){let a=o;a?.isRefusal&&a.message?(this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.updateAssistantMsg(this.forecastTurnMsgId??t,{text:a.message})):(console.error("[ask-aquera] forecast recompute failed",o),this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.showToast("error",this.copy().errors.couldntUpdateForecast))}finally{this.isStreaming.set(!1)}}async runForecast(t,e,n={},o={}){if(this.isStreaming())return;let a=M=>!!M&&this.messages().some(v=>v.id===M);if(o.inPlace&&a(this.forecastChartMsgId)){let M=this.messages().find(v=>v.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??M.queryMeta,dataSourceId:n.dataSourceId??M.dataSourceId})}let c=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let m={id:fe(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},k=fe(),S={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(M=>[...M,m,{id:k,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[S]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let M=await this.forecastApi.compute(b(b({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),v=_t(M,e.series??[]);this.lastForecastRequest=b(b(P(b({},e),{horizon:v.horizon,granularity:v.granularity,confidence:v.confidence}),M.historyQuery?.sql?{historySql:M.historyQuery.sql}:{}),M.cohortQuery?.sql?{cohortSql:M.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:v.horizon,granularity:v.granularity,confidence:v.confidence}),this.forecastMaxHorizon.set(v.maxHorizon),this.forecastFitted.set({periods:M.fittedPeriods,granularity:M.sourceGranularity}),this.forecastGuardrails.set(M.guardrails),this.forecastModelCard.set(M.modelCard),M.conversationTitle&&this.forecastTitle.set(M.conversationTitle),n.queryMeta&&(v.chart.queryMeta=n.queryMeta),n.dataSourceId&&(v.chart.dataSourceId=n.dataSourceId),v.chart.config&&(v.chart.config.forecast={enabled:!0,horizon:v.horizon,granularity:v.granularity,confidence:v.confidence});let N={title:v.chart.title,componentName:v.chart.componentName,config:v.chart},X=c??k;if(this.forecastChartMsgId=X,this.forecastTurnMsgId=k,c){let Y=this.messages().find(B=>B.id===c);this.updateAssistantMsg(c,b({charts:[N],forecastMeta:v.meta,forecast:!0},Y?.preForecastCharts?.length?{}:{preForecastCharts:Y?.charts??[]})),this.updateAssistantMsg(k,{isStreaming:!1,thinking:void 0,tools:[],text:v.answer,followUps:M.followUps})}else this.updateAssistantMsg(k,{isStreaming:!1,thinking:void 0,tools:[],text:v.answer,charts:[N],forecastMeta:v.meta,followUps:M.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(M){let v=M;v?.isRefusal&&v.message?this.updateAssistantMsg(k,{isStreaming:!1,thinking:void 0,tools:[],text:v.message}):(console.error("[ask-aquera] forecast failed",M),this.updateAssistantMsg(k,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=P(b(b({},n),t),{filters:b(b({},n.filters),t.filters)});(t.metric!==void 0&&t.metric!==n.metric||t.granularity!==void 0&&t.granularity!==n.granularity||t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{}))&&(o.historySql=void 0),t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{})&&(o.cohortSql=void 0),this.runForecast(e,o,{},{inPlace:!0})}onFollowUp(t,e){if(!t.action||this.isStreaming())return;if(t.action===Ar){let a=e?.charts?.length?e:this.findForecastTarget();(!a||!this.forecastChartMessage(a,t.label))&&this.showToast("info","This chart doesn\u2019t have a series I can project.");return}let[n,o]=t.action.split(":");if(o&&this.lastForecastRequest){if(n==="horizon"){this.refineForecast({horizon:Number(o)},t.label);return}if(n==="granularity"){this.refineForecast({granularity:o},t.label);return}if(n==="metric"){this.refineForecast({metric:o,series:void 0},t.label);return}if(n==="org"||n==="location"||n==="jobFamily"){this.refineForecast({filters:{[n]:o},series:void 0},t.label);return}}if(t.action===kr){this.openForecastSettings();return}this.showToast("info",`"${t.label}" needs a forecast on screen to refine.`)}forecastSettingsOpen=x(!1);forecastDraft=x(null);appliedForecastSettings=x(null);forecastMaxHorizon=x(null);forecastGuardrails=x(null);forecastModelCard=x(null);forecastFitted=x(null);granularityChoices=D(()=>{let t=this.forecastCopy(),e=this.forecastContext();if(!e)return[];let n=this.forecastFitted(),o=n?.granularity??e.defaults.granularity,a=n?.periods??0;return In(o,a,e.granularityOptions)});draftGranularity=D(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=D(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=D(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=D(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=D(()=>{let t=this.draftGranularity();if(!t)return"";let e=t.maxHorizon===1?t.label.singular:t.label.plural;return`Capped at ${t.maxHorizon} ${e} for this series (\xBD of ${t.fittedPeriods} ${t.label.plural} of history).`});forecastCopy=D(()=>{let t=this.forecastContext();if(!t)return null;let e=this.forecastFitted(),n={maxHorizon:this.forecastMaxHorizon()??"",sourceGranularity:(e?.granularity??t.defaults.granularity).toLowerCase(),historyPeriods:e?.periods??""};return{granularityNote:be(t.copy?.granularityNote??"",n),confidenceNote:be(t.copy?.confidenceNote??"",n),guardrails:this.forecastGuardrails(),modelCard:this.forecastModelCard(),confidenceLevels:t.confidenceLevels,granularityOptions:t.granularityOptions,maxHorizon:this.forecastMaxHorizon()??0}});openForecastSettings(){let t=this.appliedForecastSettings(),e=this.forecastContext(),n=t??(e?{horizon:e.defaults.horizon,granularity:e.defaults.granularity,confidence:e.defaults.confidence}:null);n&&(this.forecastDraft.set(n),this.forecastSettingsOpen.set(!0))}closeForecastSettings(){this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null)}patchForecastDraft(t){this.forecastDraft.update(e=>e&&b(b({},e),t))}onHorizonInput(t){let e=Number(t);Number.isFinite(e)&&this.patchForecastDraft({horizon:Math.max(1,Math.min(e,this.horizonMax()))})}onGranularityPick(t){let e=this.forecastDraft();!e||!t.enabled||e.granularity===t.value||this.patchForecastDraft({granularity:t.value,horizon:Vn(e.horizon,e.granularity,t.value,t.maxHorizon)})}onConfidenceIndexInput(t){let e=this.forecastCopy()?.confidenceLevels??[],n=Number(t);!e.length||!Number.isFinite(n)||this.patchForecastDraft({confidence:e[Math.max(0,Math.min(n,e.length-1))]})}confidenceIndex=D(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=D(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=D(()=>{let t=this.forecastCopy()?.confidenceLevels.length??1;return`${t>1?this.confidenceIndex()/(t-1)*100:100}%`});applyForecastSettings(){let t=this.forecastDraft();if(!t||(this.appliedForecastSettings.set(t),this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null),!this.lastForecastRequest))return;let e=t.granularity!==this.lastForecastRequest.granularity;this.refineForecast(b({horizon:t.horizon,granularity:t.granularity,confidence:t.confidence},e?{series:void 0}:{}),`Recompute at ${t.horizon} ${t.granularity.toLowerCase()} periods, ${t.confidence}% confidence`)}async sendMessage(){if(!this.canSend())return;let t=this.replyQuote()??void 0;this.replyQuote.set(null);let e=this.inputText().trim();if(!this.attachments().length&&!t&&this.routeForecastIntent(e))return;this.inputText.set("");let n=t?`> ${t.replace(/\n/g,`
7
- > `)}
8
-
9
- ${e}`:e,a=this.attachments().filter(R=>R.status==="ready").map(R=>({key:R.key,name:R.name,contentType:R.contentType,size:R.size}));this.attachments.set([]);let c={id:fe(),role:"user",text:e,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.messages.update(R=>[...R,c]);let m=fe();this.messages.update(R=>[...R,{id:m,role:"assistant",text:"",thinking:"Thinking",charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"thinking",callIds:["thinking"],pending:1,baseLabel:"Thinking",label:"Thinking",status:"running"}]}]),this.isStreaming.set(!0);let k=new AbortController;this.streamAbort=k,this.scrollToBottom();let S="",M="Thinking",v=[],N=!1,X=!1,Y=!1,B=new Set,W=R=>{let Q=R?.queryMeta,F=Q?.sql??(Q?.dsl?JSON.stringify(Q.dsl):R?.title??"");return`${R?.componentName??""}|${F}`},ae=()=>{if(N||v.length===0)return;N=!0;let R=v.splice(0);this.updateAssistantMsg(m,Q=>({charts:[...Q.charts,...R]})),this.scrollToBottom()};try{let R=this.selectedScope(),Q=R?R.id:null,F=R?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:O=>{S+=O,!N&&v.length>=1&&this.zone.run(()=>ae())},onToolStart:(O,L)=>{S="",M=L||"Working",this.zone.run(()=>{this.updateAssistantMsg(m,G=>({thinking:M,tools:yn(G.tools??[],O,M)}))})},onToolResult:(O,L,G)=>{this.zone.run(()=>{this.updateAssistantMsg(m,j=>({tools:vn(j.tools??[],O,L,G)}))})},onDataPart:O=>{if(O.data_type==="adhoc_viz"&&O.data){let L={title:O.data.title??"Chart",componentName:O.data.componentName??"",config:O.data};this.zone.run(()=>{if(N){this.updateAssistantMsg(m,G=>({charts:[...G.charts,L]})),this.scrollToBottom();return}v.push(L),v.length>=2&&ae()})}},onDashboardTitle:O=>{O&&this.zone.run(()=>this.updateAssistantMsg(m,{dashboardTitle:O}))},onChoice:O=>{O?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(m,L=>({choices:[...L.choices??[],O]})))},onLayoutPatch:O=>{let L=new Map((O?.layouts??[]).map(j=>[j.id,j.layout]));if(!L.size)return;let G=j=>{let U=j?.id;return U?L.get(U):void 0};for(let j of v){let U=G(j.config);U&&(j.config=P(b({},j.config),{layout:U}))}this.zone.run(()=>this.updateAssistantMsg(m,j=>({charts:j.charts.map(U=>{let we=G(U.config);return we?P(b({},U),{config:P(b({},U.config),{layout:we})}):U})})))},onError:()=>{X=!0},onFinish:(O,L)=>{Y=!0,this.zone.run(()=>{ae(),this.updateAssistantMsg(m,{isStreaming:!1,thinking:void 0,text:S}),this.isStreaming.set(!1);let G=this.messages().find(U=>U.id===m);rt({finishReason:O,sawError:X,producedContent:!!(G?.text||G?.charts.length||G?.choices?.length)})&&this.showStreamError(m),L&&!this.activeConversationId()&&(this.activeConversationId.set(L),this.conversationsLoading.set(!0),this.svc.listConversations().then(U=>{this.conversations.set(U);let we=U.find(jn=>jn.id===L);this.conversationConnectionId.set(we?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(U=>U.id===m)?.charts.length||this.scrollToBottom()})}},Q,k.signal,a,F,this.builderDashboardId())}catch(R){k.signal.aborted||R instanceof DOMException&&R.name==="AbortError"||this.zone.run(()=>this.showStreamError(m))}finally{this.zone.run(()=>{!Y&&rt({sawError:X,producedContent:!1})&&this.showStreamError(m),this.updateAssistantMsg(m,{isStreaming:!1,thinking:void 0}),this.streamAbort===k&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>kn(e,t,n=>({id:n,role:"assistant",text:"",charts:[],isStreaming:!1,hasError:!1}))),this.isStreaming.set(!1)}stopStream(){this.messages.update(t=>t.map(e=>e.isStreaming?P(b({},e),{isStreaming:!1,thinking:void 0,tools:[]}):e)),this.streamAbort?.abort(),this.isStreaming.set(!1)}openArtifact(t,e){this.artifactSourceMsgId.set(e??null),this.activeArtifactRaw.set(e?[]:t),this.forecastOverlay.set(new Map),this.loadArtifactForecastable();let n=this.mostRecentDashboardTitle(),o=t.find(a=>!this.isFilterChart(a));this.saveDashboardName.set(n||o?.title||t[0]?.title||"My Dashboard"),this.resetArtifactFilterState()}addInlineWidget(t){this.inlinePickerFor.set(null),this.addArtifactToDashboard(t)}addInlineToExisting(t,e){this.inlinePickerFor.set(null),this.addToExistingDashboard(e,t)}addInlineDefault(t){let e=this.nonAutoDashboards();if(!this.builderOpen()&&e.length===1){this.addInlineToExisting(t,e[0].id);return}this.addInlineWidget(t)}async addToLibrary(t){try{await this.globalWidget.add(this.artifactToWidget(t)),this.showToast("success","Saved to your widget library.")}catch(e){this.showToast("error",this.extractMessage(e,this.copy().errors.couldntSaveToLibrary))}}onSelectionChange(t){this.selectedWidgetIds.set(t)}pickGalleryPrompt(t){this.inputText.set(t),this.closeGallery()}onWelcomePromptPick(t){this.isStreaming()||(this.inputText.set(t.label),this.sendMessage())}onGalleryPromptPick(t){t?.key&&this.pickGalleryPrompt(t.key)}openGallery(){this.gallerySearch.set(""),this.galleryOpen.set(!0)}closeGallery(){this.galleryOpen.set(!1),this.gallerySearch.set("")}closeArtifact(){this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([]),this.saveDialogOpen.set(!1),this.showAddPicker.set(!1),this.selectedWidgetIds.set([]),this.resetArtifactFilterState()}resetArtifactFilterState(){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear()}buildActiveFilters(t){return on(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(o=>o.type==="attribute"&&o.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}onArtifactFilterChange(t){let e=this.builderDashboardId();!e||!t.widgetId||!t.controlId||this.fetchFilterSuggestionsOnce(e,t.widgetId,t.controlId)}fetchFilterSuggestionsOnce(t,e,n){let o=this.filterSuggestCache.get(e);if(o){this.artifactGridRef?.patchFilterSuggestions(e,n,o);return}this.filterSuggestInflight.has(e)||(this.filterSuggestInflight.add(e),(async()=>{try{let a=await this.svc.filterSuggest(t,"",this.artifactWidgets(),"draft"),c=this.normalizeFilterSuggestions(a);if(!c.length)return;this.filterSuggestCache.set(e,c),this.artifactGridRef?.patchFilterSuggestions(e,n,c)}catch(a){console.warn("[ask-aquera] filter suggest failed",a)}finally{this.filterSuggestInflight.delete(e)}})())}normalizeFilterSuggestions(t){let e=Array.isArray(t.suggestions)?[...t.suggestions]:[];if(!e.length){t.nextToken&&e.push({id:t.nextToken.value,label:t.nextToken.label,type:"attribute"});for(let n of t.completions??[])e.push({label:n,type:"suggestion"})}return e}async onArtifactFilterSubmit(t){let e=this.builderDashboardId();if(!e)return;if(this.isEmptyFilters(t.filters)){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map);return}let n=this.artifactWidgets().filter(c=>!Je(c));if(!n.length)return;this.applyFiltersAbort?.abort();let o=new AbortController;this.applyFiltersAbort=o;let a=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:c,resolvedFilters:m,filterExplanation:k}=await this.svc.applyFilters(n,t.filters,e,"draft",o.signal,{mode:t.mode,prompt:t.prompt});if(a!==this.applyFiltersSeq)return;this.applyFilterResultsToOverlay(c),this.activeDashboardFilters.set(t.filters),this.activeResolvedFilters.set(m),this.applySummary.set(ln(c,this.buildActiveFilters(t.filters))),this.filterExplanation.set(k)}catch(c){if(c?.name==="AbortError"||a!==this.applyFiltersSeq)return;console.error("[ask-aquera] apply filters failed",c),this.showToast("error",this.extractMessage(c,this.copy().errors.couldntApplyFilter))}finally{a===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}onDslWidgetUpdated(t){t?.id&&this.filterOverlay.update(e=>{let n=new Map(e);return n.set(t.id,{config:t.config,edited:n.get(t.id)?.edited}),n})}applyFilterResultsToOverlay(t){let e=this.baseArtifactWidgets(),n=new Set,o=new Map;t.forEach((a,c)=>{let m;if(a.title&&(m=e.find(k=>k.title===a.title&&!n.has(k.id))),!m){let k=e[c];m=k&&!n.has(k.id)?k:void 0}m&&(n.add(m.id),o.set(m.id,{config:a.config,edited:a.edited}))}),this.filterOverlay.set(o)}artifactToWidget(t){let e=t.config??{};return{title:e.title??t.title,componentName:e.componentName??t.componentName,widgetType:e.widgetType??"chart",config:e.config??e,summary:e.summary,queryMeta:e.queryMeta,dataSourceId:e.dataSourceId??void 0,drilldownBy:Array.isArray(e.drilldownBy)?e.drilldownBy:[],layout:e.layout}}loadConversationDashboards(){this.dashboardsLoading.set(!0),this.svc.listDashboards(100).then(t=>this.conversationDashboards.set(t)).catch(()=>this.conversationDashboards.set([])).finally(()=>this.dashboardsLoading.set(!1))}storyPickerOpen=x(!1);storyPickerWidget=x(null);openStoryPicker(t=this.selectedArtifactCharts()){let e=t.find(n=>!this.isFilterChart(n))??t[0];e&&(this.storyPickerWidget.set(b({id:"artifact"},this.artifactToWidget(e))),this.storyPickerOpen.set(!0))}closeStoryPicker(){this.storyPickerOpen.set(!1),this.storyPickerWidget.set(null)}onAddedToStory(){this.closeStoryPicker()}async addToExistingDashboard(t,e=this.selectedArtifactCharts()){if(!(!e.length||this.committingAction())){this.savingDashboard.set(!0),this.committingAction.set("add");try{let n=await this.publishRepo.fetchDashboard(t);this.dashboardState.replaceDashboard(n);let o=ge(e.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(o),this.publishRepo.saveDraft(t,this.dashboardState.snapshot).catch(()=>{}),this.builderPreseeded.set(!0),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.closeArtifact()}catch(n){this.showToast("error",this.extractMessage(n,this.copy().errors.couldntAddToDashboard))}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}openSaveDialog(){this.saveDialogOpen.set(!0)}newDashboardName(t){let e=this.artifactSourceMsgId(),n=e?this.messages().find(a=>a.id===e)?.dashboardTitle:void 0,o=t.find(a=>!this.isFilterChart(a));return n?.trim()||o?.title?.trim()||"Untitled Dashboard"}async addArtifactToDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){if(this.builderOpen()&&this.builderDashboardId()){let e=ge(t.map(n=>this.artifactToWidget(n)));this.dashboardState.addWidgets(e),this.closeArtifact(),this.showToast("success","Added to your dashboard.");return}this.savingDashboard.set(!0),this.committingAction.set("add");try{let e=this.newDashboardName(t);this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(e);let n=ge(t.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(n);let o=await this.svc.createDashboard(P(b({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:this.dashboardState.snapshot.widgets}));this.dashboardState.setDashboardId(o.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(o.id),this.builderOpen.set(!0),this.closeArtifact()}catch(e){this.showToast("error",this.extractMessage(e,this.copy().errors.couldntCreateDashboard))}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}async publishAsNewDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){this.savingDashboard.set(!0),this.committingAction.set("publish");try{let e=this.newDashboardName(t),n=ge(t.map(o=>b({id:fe()},this.artifactToWidget(o))));await this.svc.createDashboard(P(b({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:n,published:!0})),this.showToast("success",`Published "${e}" as a new dashboard`),this.closeArtifact()}catch(e){this.showToast("error",this.extractMessage(e,this.copy().errors.couldntPublishDashboard))}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}closeBuilder(){this.builderOpen.set(!1),this.builderDashboardId.set(null),this.builderFullscreen.set(!1),this.dashboardState.resetDashboard()}toggleBuilderFullscreen(){this.builderFullscreen.update(t=>!t)}static MIN_CHAT_WIDTH=320;static MIN_BUILDER_WIDTH=360;resizeShell=null;startChatResize(t){t.preventDefault();let e=t.target.closest(".aq-shell");if(!e)return;let n=e.getBoundingClientRect();this.resizeShell={left:n.left,width:n.width},this.isResizing.set(!0),window.addEventListener("pointermove",this.onChatResizeMove),window.addEventListener("pointerup",this.onChatResizeEnd,{once:!0})}onChatResizeMove=t=>{let e=this.resizeShell;if(!e)return;let n=Math.max(i.MIN_CHAT_WIDTH,e.width-i.MIN_BUILDER_WIDTH),o=Math.min(i.MIN_CHAT_WIDTH,n),a=Math.max(o,Math.min(t.clientX-e.left,n));this.chatPaneWidth.set(a)};onChatResizeEnd=()=>{this.resizeShell=null,this.isResizing.set(!1),window.removeEventListener("pointermove",this.onChatResizeMove),window.removeEventListener("pointerup",this.onChatResizeEnd)};startEditDashboardTitle(){this.builderDashboardId()&&(this.dashboardTitleDraft.set(this.builderRef?.dashboardName()??""),this.editingDashboardTitle.set(!0))}cancelEditDashboardTitle(){this.editingDashboardTitle.set(!1)}async commitDashboardTitle(){if(!this.editingDashboardTitle()||this.renamingDashboard())return;let t=this.dashboardTitleDraft().trim();if(!t){this.editingDashboardTitle.set(!1);return}this.renamingDashboard.set(!0);try{await this.builderRef?.renameTo(t),this.editingDashboardTitle.set(!1)}catch(e){this.showToast("error",this.extractMessage(e,this.copy().errors.couldntRenameDashboard))}finally{this.renamingDashboard.set(!1)}}onBuilderMenuAction(t){if(t==="fullscreen"){this.toggleBuilderFullscreen();return}if(t==="promptGallery"){this.openGallery();return}this.builderRef?.onMenuAction(t)}onBuilderPublished(t){this.showToast("success",`Dashboard "${t}" published`)}onBuilderPublishFailed(t){this.showToast("error",nn(t,this.copy().errors.couldntPublishDashboard))}async onExecutiveSummary(t){if(this.isStreaming())return;if(t&&await this.restoreThreadForDashboard(t),!this.activeConversationId()){this.showToast("info","This dashboard has no conversation to summarise yet.");return}let e=this.builderRef?.dashboardName?.(),n=this.aiExecutiveSummaryEl?.nativeElement;n&&(n.config={summary:"",buttonLabel:"Executive Summary",buttonVariant:"secondary",drawerLabel:e?`${e} Summary`:"Dashboard Summary",typingSpeed:5,closeOnEscape:!0},n.loading=!0,n.show?.()),this.isStreaming.set(!0);let o="";try{await this.svc.streamChat(this.activeConversationId(),"Give me an executive summary of this dashboard.",{onText:a=>{o+=a},onToolStart:()=>{},onToolResult:()=>{},onDataPart:()=>{},onError:()=>{},onFinish:()=>{let a=this.aiExecutiveSummaryEl?.nativeElement;a&&(a.config=P(b({},a.config??{}),{summary:o}),a.loading=!1,a.open&&a.startTyping?.())}},void 0,void 0,void 0,void 0,t)}catch(a){let c=this.aiExecutiveSummaryEl?.nativeElement;c&&(c.loading=!1),this.showToast("error",this.extractMessage(a,this.copy().errors.couldntGenerateSummary))}finally{this.isStreaming.set(!1)}}async confirmSaveDashboard(){let t=this.saveDashboardName().trim();if(!t||this.savingDashboard())return;let e=this.activeArtifact().map(n=>n.config);this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(P(b({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:e}));await this.svc.publishDashboard(n.id),this.showToast("success",`Dashboard "${n.name}" published`),this.closeArtifact()}catch(n){this.showToast("error",this.extractMessage(n,this.copy().errors.couldntSaveDashboard))}finally{this.savingDashboard.set(!1)}}ngOnDestroy(){this.streamAbort?.abort(),this.onChatResizeEnd()}onComposerSubmit(t){typeof t=="string"&&this.inputText.set(t),this.sendMessage()}onComposerKeydown(t){t.key!=="Enter"||t.shiftKey||t.metaKey||t.ctrlKey||t.isComposing||(t.preventDefault(),t.stopPropagation(),this.onComposerSubmit(this.inputText()))}isDataGrid(t){let e=(t.componentName??"").toLowerCase();return e.includes("data-grid")||e.includes("datagrid")}inlineChartClass(t){if(!((t.componentName??"").toLowerCase().includes("kpi")||t.config?.config?.chart?.type==="kpi"))return"inline-widget__chart";let n=t.config?.config?.chart?.sparkline;return`inline-widget__chart inline-widget__chart--kpi${Array.isArray(n)&&n.length>=2?" inline-widget__chart--kpi-spark":""}`}inlineFilters=new Map;inlineFilterSeq=0;inlineChartFallbackIds=new WeakMap;inlineChartFallbackIdSeq=0;inlineChartKey(t){let e=t.config?.id;if(e!=null)return String(e);let n=this.inlineChartFallbackIds.get(t);return n||(n=`chart-${++this.inlineChartFallbackIdSeq}`,this.inlineChartFallbackIds.set(t,n)),n}inlineChartRawConfig(t){return t.config?.config?.chart}toggleInlineChartTypePicker(t){if(this.inlineChartTypePickerFor()===t){this.closeInlineChartTypePicker();return}this.openInlineChartTypePicker(t)}toggleInlineFilterPicker(t){if(this.inlineFilterPickerFor()===t){this.closeInlineFilterBuilder();return}this.openInlineFilterBuilder(t)}inlineDisplayConfig(t){let e=this.inlineFilterResult.get(this.inlineChartKey(t));return e?e?.config:t.config?.config}inlineChartTypeApplyingComponent=x(null);chartTypeIcon(t){return en(t)}inlineSensibleChartTypes(){return this.inlineChartTypeOptions().filter(t=>t.sensible)}inlineOtherChartTypes(){return this.inlineChartTypeOptions().filter(t=>!t.sensible)}async openInlineChartTypePicker(t){let e=++this.inlineChartTypePickerSeq;this.inlineChartTypePickerFor.set(t),this.inlineChartTypeError.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeLoading.set(!0);try{let n=t.config,o=await this.publishRepo.listChartTypes({id:n?.id??t.title,componentName:t.componentName,queryMeta:n?.queryMeta,config:n?.config});if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeOptions.set(o.filter(a=>a.component!==t.componentName))}catch(n){if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeError.set(n instanceof Error?n.message:"Could not load chart types")}finally{e===this.inlineChartTypePickerSeq&&this.inlineChartTypeLoading.set(!1)}}closeInlineChartTypePicker(){this.inlineChartTypePickerFor.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeError.set(null)}async selectInlineChartType(t){let e=this.inlineChartTypePickerFor();if(!(!e||this.inlineChartTypeApplying())){this.inlineChartTypeApplying.set(!0),this.inlineChartTypeApplyingComponent.set(t),this.inlineChartTypeError.set(null);try{let n=await this.svc.changeAdhocChartType(e.config,t);this.replaceInlineChart(e,n),this.closeInlineChartTypePicker()}catch(n){this.inlineChartTypeError.set(n instanceof Error?n.message:this.copy().errors.chartTypeChangeFailed)}finally{this.inlineChartTypeApplying.set(!1),this.inlineChartTypeApplyingComponent.set(null)}}}replaceInlineChart(t,e){let n=this.inlineChartKey(t);this.inlineFilters.delete(n),this.inlineFilterFieldsCache.delete(n),this.inlineFilterBaseConfig.delete(n),this.inlineFilterResult.delete(n);let o={title:e.title??t.title,componentName:e.componentName??"",config:e};this.messages.update(a=>a.map(c=>P(b({},c),{charts:c.charts.map(m=>m===t?o:m)})))}inlineFilterBuilderFieldId=x(null);inlineFilterBuilderOperator=x(null);inlineFilterBuilderValue=x("");inlineFilterBuilderValue2=x("");inlineFilterBuilderValues=x([]);inlineFilterFieldsLoading=x(!1);inlineFilterFieldsError=x(null);inlineFilterValuesLoading=x(!1);inlineFilterApplying=x(!1);inlineFilterApplyError=x(null);inlineFilterFieldsCache=new Map;inlineFilterValuesCache=new Map;inlineFilterBaseConfig=new Map;inlineFilterResult=new Map;toggleInlineFilterMultiValue(t){this.inlineFilterBuilderValues.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}resetInlineFilterBuilderValues(){this.inlineFilterBuilderValue.set(""),this.inlineFilterBuilderValue2.set(""),this.inlineFilterBuilderValues.set([])}async openInlineFilterBuilder(t){this.inlineFilterPickerFor.set(t),this.inlineFilterApplyError.set(null);let e=this.inlineChartKey(t);if(!this.inlineFilterFieldsCache.has(e)){this.inlineFilterFieldsLoading.set(!0),this.inlineFilterFieldsError.set(null);try{let o=await this.svc.listAdhocFilterFields([t.config]);this.inlineFilterFieldsCache.set(e,o)}catch(o){this.inlineFilterFieldsError.set(o instanceof Error?o.message:"Could not load filter fields")}finally{this.inlineFilterFieldsLoading.set(!1)}}let n=this.inlineFilterFields(t)[0];this.inlineFilterBuilderFieldId.set(n?.name??null),this.inlineFilterBuilderOperator.set(n?Te(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}closeInlineFilterBuilder(){this.inlineFilterPickerFor.set(null)}inlineFilterFields(t){return this.inlineFilterFieldsCache.get(this.inlineChartKey(t))??[]}inlineFilterSelectedField(t){return this.inlineFilterFields(t).find(e=>e.name===this.inlineFilterBuilderFieldId())}async ensureInlineFilterValuesLoaded(t,e){let n=`${this.inlineChartKey(t)}::${e.name}`;if(!(!Xt(e.type)||this.inlineFilterValuesCache.has(n))){this.inlineFilterValuesLoading.set(!0);try{let o=await this.svc.fetchAdhocFilterValues([t.config],e.name);this.inlineFilterValuesCache.set(n,o.values)}catch{this.inlineFilterValuesCache.set(n,[])}finally{this.inlineFilterValuesLoading.set(!1)}}}inlineFilterValuesFor(t){let e=this.inlineFilterPickerFor();return!t||!e?[]:this.inlineFilterValuesCache.get(`${this.inlineChartKey(e)}::${t}`)??[]}onInlineFilterFieldChange(t,e){this.inlineFilterBuilderFieldId.set(e);let n=this.inlineFilterFields(t).find(o=>o.name===e);this.inlineFilterBuilderOperator.set(n?Te(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}onInlineFilterOperatorChange(t){this.inlineFilterBuilderOperator.set(t),this.resetInlineFilterBuilderValues()}inlineFilterOperators(t){let e=this.inlineFilterSelectedField(t);return e?Te(e.type):[]}inlineFilterSelectedOperator(t){return this.inlineFilterOperators(t).find(e=>e.value===this.inlineFilterBuilderOperator())}inlineActiveFilters(t){return this.inlineFilters.get(this.inlineChartKey(t))??[]}inlineFilterChipLabel(t,e){let n=this.inlineFilterFields(t).find(o=>o.name===e.fieldId);return Zt(e,n?.label??e.fieldId,n?.type??"string")}async reapplyInlineFilters(t,e,n){if(!n.length)return this.inlineFilterResult.delete(e),this.inlineFilterBaseConfig.delete(e),!0;let o=this.inlineFilterBaseConfig.get(e)??t.config;this.inlineFilterApplying.set(!0),this.inlineFilterApplyError.set(null);try{let a=n.map(Jt),c=await this.svc.applyAdhocFilter(o,a);return this.inlineFilterBaseConfig.set(e,o),this.inlineFilterResult.set(e,c),!0}catch(a){return this.inlineFilterApplyError.set(a instanceof Error?a.message:"Filter could not be applied"),!1}finally{this.inlineFilterApplying.set(!1)}}async addInlineFilter(t){let e=this.inlineFilterBuilderFieldId(),n=this.inlineFilterBuilderOperator();if(!e||!n||this.inlineFilterApplying())return;let o=this.inlineFilterOperators(t).find(S=>S.value===n);if(!o)return;let a;if(o.valueKind==="none")a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n};else if(o.valueKind==="multi-select"){let S=this.inlineFilterBuilderValues();if(S.length===0)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,values:[...S]}}else{let S=this.inlineFilterBuilderValue().trim();if(!S)return;let M=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!M)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:S,value2:M}}let c=this.inlineChartKey(t),m=[...this.inlineFilters.get(c)??[],a];await this.reapplyInlineFilters(t,c,m)&&(this.inlineFilters.set(c,m),this.resetInlineFilterBuilderValues())}async removeInlineFilter(t,e){if(this.inlineFilterApplying())return;let n=this.inlineChartKey(t),o=(this.inlineFilters.get(n)??[]).filter(c=>c.id!==e);await this.reapplyInlineFilters(t,n,o)&&(o.length?this.inlineFilters.set(n,o):this.inlineFilters.delete(n))}async clearInlineFilters(t){if(this.inlineFilterApplying())return;let e=this.inlineChartKey(t);await this.reapplyInlineFilters(t,e,[]),this.inlineFilters.delete(e)}cleanText(t){return t.replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/^\s*[-*]\s+/gm,"\u2022 ").replace(/\n{3,}/g,`
10
-
11
- `).replace(/\[[\w\s]+\]\.\[[\w\s]+\]/g,"").replace(/\b(gold|dbo|public|silver|bronze)\.\w+/gi,"").replace(/\b(the\s+)?(gold|dbo|public|silver|bronze)\s+(schema|database)\b/gi,"the database").replace(/\b(found|analyzed|using|from|in)\s+\d+\s+tables?\b/gi,"").replace(/\b\d+\s+tables?\s+(found|available|returned|in the schema)\b/gi,"").replace(/\b(the\s+)?[\w]+\s+table\b/gi,e=>/[A-Z_]/.test(e)?"":e).replace(/\b(table|view)\s+(named|called)\s+[\w[\]."'`]+/gi,"").replace(/\(\s*\)/g,"").replace(/,\s*,/g,",").replace(/ {2,}/g," ").replace(/\n /g,`
12
- `).trim()}updateAssistantMsg(t,e){this.messages.update(n=>n.map(o=>{if(o.id!==t)return o;let a=typeof e=="function"?e(o):e;return"charts"in a&&this.forecastableMsgs.delete(t),b(b({},o),a)}))}scrollToBottom(){setTimeout(()=>this.aqChatEl?.nativeElement?.scrollToBottom?.("auto"),100)}showToast(t,e){if(t==="error"&&Oe(e))return;let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),qe()}extractMessage(t,e){return Ee(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=de({type:i,selectors:[["app-ask-aquera-page"]],viewQuery:function(e,n){if(e&1&&yt(xi,5)(Ze,5)(bi,5)(yi,5)(vi,5),e&2){let o;ce(o=pe())&&(n.aqChatEl=o.first),ce(o=pe())&&(n.builderRef=o.first),ce(o=pe())&&(n.artifactGridRef=o.first),ce(o=pe())&&(n.composerRef=o.first),ce(o=pe())&&(n.aiExecutiveSummaryEl=o.first)}},hostBindings:function(e,n){e&1&&g("dragover",function(a){return a.preventDefault()},Qe)("drop",function(a){return a.preventDefault()},Qe)("selectionchange",function(){return n.onTextSelectionChange()},Pe)("wheel",function(){return n.hideQuoteBadge()},Pe)("keydown.escape",function(){return n.hideQuoteBadge()},Pe)},features:[vt([Fe(se),Gt(oe),jt(oe),Kt(oe),Yt(oe),Qt(oe),tn(oe),rn(()=>null)])],decls:35,vars:35,consts:[["composerTpl",""],["aqChat",""],["fileInput",""],["composerEl",""],["artifactGrid",""],["aiExecutiveSummary",""],[1,"aq-shell"],["type","button",1,"reply-badge",3,"reply-badge--below","top","left"],[1,"aq-chat-pane"],[1,"wfb-header"],[1,"welcome-wrap"],[1,"aq-chat"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"is-active"],[1,"aq-artifact-pane"],[1,"aq-builder-pane"],[3,"nile-request-close","nile-hide","label"],["label","Dashboard name",3,"nile-input","keydown.enter","placeholder","value"],["slot","footer",1,"wfb-save-dialog__actions"],["variant","secondary","size","small",3,"click"],["variant","primary","size","small",3,"click"],["placement","end",1,"forecast-drawer",3,"nile-request-close","nile-hide","label","open"],["slot","label",1,"forecast-drawer__label"],["name","ng-stars-02","method","stroke","size","16","color","#7a5af8",1,"forecast-drawer__mark"],["slot","footer",1,"fs-actions"],["placement","end",1,"prompt-gallery-drawer",3,"nile-request-close","nile-hide","label","open"],[3,"open","widget","dashboardId","source","sourceName","authoringMode"],[1,"ai-executive-summary"],[3,"open","widget"],["type","button",1,"reply-badge",3,"click"],["name","ng-reply","method","stroke","size","14"],[1,"wfb-header__left"],[1,"wfb-header__right"],[1,"aq-scope-chip"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"nile-hide","open"],["slot","trigger","content","Add dataset or pipeline"],["type","button","aria-label","Add dataset or pipeline",1,"aq-header-action",3,"click"],["name","ng-plus","method","stroke","size","18"],["hoist","","placement","right-start","stay-open-on-select",""],["slot","trigger",1,"scope-branch"],["name","ng-database","method","stroke","size","14",1,"scope-branch__icon"],[1,"scope-branch__label"],["name","ng-chevron-right","method","stroke","size","14",1,"scope-branch__arrow"],[1,"scope-menu__loading"],["name","ng-dataflow-04","method","stroke","size","14",1,"scope-branch__icon"],["placement","bottom-end","distance","6",1,"conv-dropdown",3,"nile-hide","open"],["slot","trigger","content","Conversations"],["type","button","aria-label","Conversations",1,"aq-header-action",3,"click","disabled"],["name","ng-messages-square","method","stroke","size","18"],[3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#2970ff"],["placement","bottom-end","distance","6",1,"related-dropdown",3,"open"],["content","Prompt gallery"],["autofocus","",1,"conv-title-input",3,"input","keydown.enter","keydown.escape","value"],["content","Save name"],["type","button","aria-label","Save name",1,"aq-header-action",3,"click"],["name","ng-check","method","stroke","size","18","color","#2970ff"],[1,"wfb-header__title"],["content","Rename conversation"],["type","button","aria-label","Rename conversation",1,"aq-header-action",3,"click"],["name","ng-edit-02","method","stroke","size","16"],["method","stroke","size","12",1,"aq-scope-chip__icon",3,"name"],[1,"aq-scope-chip__text"],["type","button","aria-label","Clear scope",1,"aq-scope-chip__clear",3,"click"],["name","ng-x-close","method","stroke","size","12"],["variant","text","width","160","height","14"],["variant","text","width","120","height","14"],[1,"scope-menu__empty"],[1,"scope-item__name"],["slot","suffix","name","ng-check","method","stroke","size","14","color","#2970ff"],["aria-hidden","true",1,"menu-skeleton-item"],[1,"conv-item"],["variant","rounded","width","14","height","14","border-radius","4px"],[1,"conv-item__title"],["variant","text","width","100%","height","14"],[1,"menu-empty"],["name","ng-message-square","method","stroke","size","14",1,"conv-item__icon"],["name","ng-check","method","stroke","size","14","color","#2970ff",1,"conv-item__check"],["name","ng-trash-01","method","stroke","size","14","color","currentColor",1,"conv-item__delete"],["name","ng-trash-01","method","stroke","size","14","color","currentColor",1,"conv-item__delete",3,"click"],["placement","bottom-end","distance","6",1,"related-dropdown",3,"nile-hide","open"],["slot","trigger","content","Dashboards"],["type","button","aria-label","Dashboards",1,"aq-header-action",3,"click"],["name","ng-grid-01","method","stroke","size","18"],[1,"related-item"],[1,"related-item__name"],[1,"related-item__meta"],["variant","text","width","58","height","12"],["name","ng-bar-chart-square-02","method","stroke","size","14","color","#667085",1,"related-item__icon"],["type","button","aria-label","Prompt gallery",1,"aq-header-action",3,"click"],["name","ng-lightbulb-05","method","stroke","size","18"],[1,"welcome-section"],[1,"ai-badge","ai-badge--lg"],["name","ng-stars-02","method","stroke","size","24","color","#2970ff"],[1,"welcome-title"],[1,"welcome-sub"],[1,"welcome-composer"],[3,"ngTemplateOutlet"],["aria-hidden","true",1,"welcome-prompts-skeleton"],[1,"welcome-prompts-skeleton__item"],["variant","rounded","width","18","height","18","border-radius","4px",1,"welcome-prompts-skeleton__icon"],[1,"welcome-prompts-skeleton__label"],[1,"welcome-prompts"],["type","button",1,"prompt-card",3,"prompt-card--ai"],[1,"prompt-gallery-row"],["type","button",1,"prompt-card",3,"click"],["method","stroke","size","18",1,"prompt-card__icon"],[1,"prompt-card__label"],[1,"prompt-card__badge"],["type","button",1,"prompt-gallery-link",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],[1,"aq-chat",3,"mouseup"],["slot","footer",1,"input-area"],[1,"msg-skeleton","msg-skeleton--user"],["variant","rounded","width","260","height","44","border-radius","16px"],[1,"msg-skeleton","msg-skeleton--ai"],["variant","text","width","88%","height","18"],["variant","text","width","72%","height","18"],["variant","rectangular","width","100%","height","300","border-radius","12px"],["variant","rounded","width","190","height","44","border-radius","16px"],["variant","text","width","80%","height","18"],["variant","text","width","55%","height","18"],[1,"ai-bubble","ai-bubble--user",3,"role"],[1,"sent-quote"],[1,"aq-attachments","aq-attachments--sent"],["name","ng-text-quote","method","stroke","size","12"],[1,"sent-quote__text"],[1,"aq-chip","aq-chip--static"],["method","stroke","size","14",1,"aq-chip__icon"],[1,"aq-chip__name"],["max-visible","3",1,"ai-bubble__steps",3,"steps"],[1,"ai-bubble",3,"role","hideIcon"],[1,"ai-bubble__content"],[1,"choice-picker"],[1,"choice-picker__submit-row"],[1,"inline-widget"],[1,"chart-card"],[1,"forecast-record"],[1,"follow-ups"],["role","alert",1,"assistant-error"],[1,"assistant-text",3,"text","speedMs"],[1,"assistant-text","assistant-text--md",3,"value"],[1,"choice-picker__group"],[1,"choice-picker__empty"],[1,"choice-picker__group",3,"nile-change"],[1,"choice-card",3,"choice-card--chosen","choice-card--locked"],[1,"choice-card"],[1,"choice-card__label"],[1,"choice-card__name"],[1,"choice-card__hint"],[1,"choice-card__meta"],[3,"class"],[1,"choice-picker__footer-actions"],[1,"choice-picker__chat-draft"],["type","button",1,"choice-picker__chat-link",3,"click","disabled"],["type","button",1,"choice-picker__chat-link",3,"disabled"],[1,"choice-picker__chat-draft-label"],[1,"choice-picker__chat-draft-row"],[1,"choice-picker__chat-draft-input",3,"nile-input","keydown.enter","value"],[3,"config","loading","conversationId"],[1,"chart-live"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"open"],[1,"forecast-meta"],[1,"inline-widget__actions"],["content","Project this series forward"],["content","Put the measured chart back"],[3,"content"],["slot","prefix","name","ng-library","method","stroke","size","14"],["placement","top-end","distance","6",3,"open"],["variant","primary","size","small"],[1,"chart-live__dot"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"nile-hide","open"],["slot","trigger","type","button","aria-label","Change chart type",1,"widget-header-btn",3,"click"],["name","ng-chart-bar","method","stroke","size","16"],[1,"type-picker__panel"],[1,"inline-action__loading"],[1,"inline-action__hint"],[1,"inline-action__error"],["size","16"],[1,"type-picker__section"],[1,"type-picker__grid"],["type","button",1,"type-picker__tile","type-picker__tile--sensible"],["type","button",1,"type-picker__tile","type-picker__tile--sensible",3,"click"],["method","stroke","size","16",3,"name"],["type","button",1,"type-picker__tile"],["type","button",1,"type-picker__tile",3,"click"],["slot","trigger","type","button","aria-label","Manage filters",1,"widget-header-btn",3,"click"],["name","ng-filter-lines","method","stroke","size","16"],[1,"widget-header-btn__badge"],[1,"filter-builder__panel"],[1,"filter-builder__active"],[1,"filter-builder__chip"],["type","button",1,"filter-builder__chip-remove",3,"click"],["name","ng-x-close","method","stroke","size","10"],[1,"filter-builder__form"],[1,"filter-builder__select",3,"ngModelChange","ngModel"],[3,"value"],["size","14"],["type","text",1,"filter-builder__input",3,"placeholder","ngModel"],[1,"filter-builder__multi"],[1,"filter-builder__select",3,"ngModel"],["type","text",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","date",1,"filter-builder__input",3,"ngModelChange","ngModel"],[1,"filter-builder__and"],["type","number",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","number",1,"filter-builder__input",3,"ngModelChange","placeholder","ngModel"],[1,"filter-builder__multi-item"],["type","checkbox",3,"change","checked"],["value","","disabled",""],[1,"forecast-meta__item"],[1,"forecast-meta__label"],[1,"forecast-meta__value"],["slot","prefix","name","ng-trend-up-01","method","stroke","size","14","color","#7a5af8"],["slot","prefix","name","ng-trending-down","method","stroke","size","14"],["slot","prefix","name","ng-bell-01","method","stroke","size","14"],["placement","top-end","distance","6",3,"nile-hide","open"],["slot","trigger","variant","primary","size","small","caret","",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#fff"],["slot","prefix","name","ng-bar-chart-square-02","method","stroke","size","14"],[1,"chart-card",3,"click"],[1,"chart-card__icon"],["name","ng-bar-chart-square-02","method","stroke","size","18","color","#2970ff"],[1,"chart-card__body"],[1,"chart-card__title"],[1,"chart-card__meta"],["slot","suffix","name","ng-chevron-right","method","stroke","size","14","color","#fff"],["name","clock-rewind","method","stroke","size","13","color","#717680",1,"forecast-record__icon"],[1,"forecast-record__text"],["type","button",1,"forecast-record__action",3,"click","disabled"],["type","button",1,"follow-up",3,"follow-up--ai","disabled"],["type","button",1,"follow-up",3,"click","disabled"],["method","stroke","size","14",1,"follow-up__icon"],[1,"follow-up__label"],[1,"follow-up__badge"],["name","ng-alert-circle","method","stroke","size","16",1,"assistant-error__icon"],[1,"assistant-error__text"],[1,"aq-composer-wrap",3,"dragenter","dragover","dragleave","drop"],[1,"aq-drop-overlay"],[1,"reply-quote"],[1,"aq-attachments"],["type","file","multiple","","hidden","",3,"change"],[1,"aq-composer",3,"keydown","nile-change","nile-submit","nile-stop","placeholder","hideModel","hideAddContext","rows","speechLang","value","loading"],["slot","toolbar-extras",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn"],["name","ng-upload-cloud-02","method","stroke","size","20"],[1,"reply-quote__text"],["type","button","aria-label","Remove quote",1,"reply-quote__dismiss",3,"click"],["name","ng-x","method","stroke","size","12"],[1,"aq-chip",3,"aq-chip--error"],[1,"aq-chip"],["size","12",1,"aq-chip__spin"],["type","button",1,"aq-chip__retry"],["type","button","aria-label","Remove attachment",1,"aq-chip__remove",3,"click"],["type","button",1,"aq-chip__retry",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn",3,"click"],["name","ng-paperclip","method","stroke","size","16"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"pointerdown"],[1,"aq-artifact-pane__header"],[1,"aq-artifact-pane__title"],["circle","","variant","ghost","size","small",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"aq-artifact-pane__body"],[3,"selectionChange","forecast","setAlert","filterSubmit","filterChange","dslWidgetUpdated","widgets","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation"],[1,"aq-artifact-pane__actions"],["variant","secondary","size","small"],["slot","prefix","name","ng-book-open-text","method","stroke","size","14"],[1,"wfb-header","aq-builder-pane__header"],["name","ng-arrow-left","method","stroke","size","16"],["variant","text","width","180","height","16"],["type","button",1,"aq-header-action",3,"click"],["method","stroke","size","18"],[3,"action","canForecast","anyForecastOn","editMode","showFullscreen","fullscreen","busy","showPromptGallery"],[3,"exitBuilder","executiveSummary","galleryPrompt","published","publishFailed","dashboardId","preseeded","galleryPrompts","canAddToStory"],["type","button","aria-label","Save dashboard name",1,"aq-header-action",3,"click","disabled"],["size","14",1,"aq-header-action__spinner"],["content","Rename dashboard"],["type","button","aria-label","Rename dashboard",1,"aq-header-action",3,"click"],[1,"fs-section"],["for","fs-horizon",1,"fs-label"],[1,"fs-label__value"],["id","fs-horizon","type","range","min","1","step","1",1,"fs-slider",3,"input","value"],[1,"fs-hint"],["id","fs-gran-label",1,"fs-label"],["role","radiogroup","aria-labelledby","fs-gran-label",1,"fs-segmented"],[1,"fs-segment",3,"fs-segment--on","fs-segment--off"],["for","fs-confidence",1,"fs-label"],["id","fs-confidence","type","range","min","0","step","1",1,"fs-slider","fs-slider--ai",3,"input","value"],[1,"fs-segment"],["type","radio","name","fs-granularity",1,"fs-segment__input",3,"change","value","checked","disabled"],[1,"fs-label"],[1,"fs-card","fs-card--ai"],[1,"fs-card__title"],[1,"fs-card__body"],[1,"fs-card"],["method","stroke","size","14"],["type","search","clearable","",1,"prompt-gallery-search",3,"nile-input","nile-change","placeholder","value"],["slot","prefix","name","ng-search","method","stroke","size","16"],["aria-hidden","true",1,"prompt-gallery-skeleton"],[1,"prompt-gallery-prompts",3,"items","vertical","wrap"],[1,"prompt-gallery-empty"],[1,"prompt-gallery-skeleton__item"],["variant","rounded","width","16","height","16","border-radius","4px"],[1,"prompt-gallery-skeleton__label"],[1,"prompt-gallery-prompts",3,"nile-item-click","items","vertical","wrap"],[3,"closed","saved","open","widget","dashboardId","source","sourceName","authoringMode"],[3,"closed","added","open","widget"]],template:function(e,n){if(e&1&&(h(0,"wf-page-error"),s(1,"section",6),f(2,Mi,3,7,"button",7),s(3,"div",8),f(4,no,43,11,"header",9),f(5,co,12,4,"div",10)(6,Ra,5,2,"nile-ai-chat",11),bt(7,ja,10,16,"ng-template",null,0,At),d(),f(9,Ha,1,2,"div",12),f(10,Za,16,22,"aside",13),f(11,rr,14,15,"section",14),s(12,"nile-dialog",15),g("nile-request-close",function(){return n.saveDialogOpen.set(!1)})("nile-hide",function(){return n.saveDialogOpen.set(!1)}),s(13,"nile-input",16),g("nile-input",function(a){return n.saveDashboardName.set(a.detail.value)})("keydown.enter",function(){return n.confirmSaveDashboard()}),d(),s(14,"div",17)(15,"nile-button",18),g("click",function(){return n.saveDialogOpen.set(!1)}),p(16),d(),s(17,"nile-button",19),g("click",function(){return n.confirmSaveDashboard()}),p(18),d()()(),s(19,"nile-drawer",20),g("nile-request-close",function(){return n.closeForecastSettings()})("nile-hide",function(){return n.closeForecastSettings()}),s(20,"span",21),h(21,"nile-glyph",22),s(22,"span"),p(23),d()(),f(24,ur,1,1),s(25,"div",23)(26,"nile-button",18),g("click",function(){return n.closeForecastSettings()}),p(27),d(),s(28,"nile-button",19),g("click",function(){return n.applyForecastSettings()}),p(29),d()()(),s(30,"nile-drawer",24),g("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),f(31,xr,6,3),d(),f(32,br,1,6,"app-alert-drawer",25),f(33,yr,2,0,"nile-executive-summary",26),d(),f(34,vr,1,2,"app-story-picker-drawer",27)),e&2){let o,a;l(),H("aq-shell--fullscreen",n.builderFullscreen())("aq-shell--resizing",n.isResizing()),q("data-mode",n.layoutMode()),l(),C((o=n.quoteBadge())?2:-1,o),l(),te("flex-basis",n.chatPaneStyleWidth(),"px")("max-width",n.chatPaneStyleWidth(),"px"),l(),C(n.showHeader()?4:-1),l(),C(!n.loadingConversation()&&!n.messages().length?5:6),l(4),C((n.layoutMode()==="split"||n.layoutMode()==="builder")&&!n.builderFullscreen()?9:-1),l(),C(n.artifactOpen()?10:-1),l(),C(n.builderOpen()?11:-1),l(),y("label",n.copy().saveDashboardDialogLabel),q("open",n.saveDialogOpen()?"":null),l(),y("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),l(3),A(n.copy().cancelButton),l(),q("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),l(),T(" ",n.copy().saveDashboardButton," "),l(),y("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),l(4),A(n.copy().forecastSettingsLabel),l(),C((a=n.forecastDraft())?24:-1,a),l(3),A(n.copy().cancelButton),l(2),A(n.copy().applyButton),l(),y("label",n.copy().promptGalleryLabel)("open",n.galleryOpen()),l(),C(n.galleryOpen()?31:-1),l(),C(n.features().alerts?32:-1),l(),C(n.features().executiveSummary?33:-1),l(),C(-1)}},dependencies:[Mt,Be,$e,Le,Ie,Re,Ne,Ve,ze,mn,an,sn,Ze,cn,De,hn],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;font-family:var(--ng-font-family-body, "Inter", system-ui, sans-serif);background:var(--ng-colors-bg-active, #f9fafb);color:#101828}.wfb-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.aq-header-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0}.aq-header-action[_ngcontent-%COMP%]:hover, .aq-header-action[_ngcontent-%COMP%]:focus, .aq-header-action[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.aq-header-action[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.wfb-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 16px;border-bottom:1px solid #eaecf0;background:#fff;flex-shrink:0;gap:12px}.wfb-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.wfb-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.wfb-header__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.aq-scope-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;height:24px;padding:0 4px 0 8px;border-radius:999px;border:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-secondary-50);color:var(--ng-colors-text-tertiary-600);font-size:12px;font-weight:500;flex-shrink:0}.aq-scope-chip__icon[_ngcontent-%COMP%]{flex-shrink:0}.aq-scope-chip__text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-scope-chip__clear[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;flex-shrink:0}.aq-scope-chip__clear[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.scope-branch[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.scope-branch__label[_ngcontent-%COMP%]{flex:1}.scope-branch__icon[_ngcontent-%COMP%], .scope-branch__arrow[_ngcontent-%COMP%]{flex-shrink:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:8px 12px;max-width:max-content}.scope-menu__empty[_ngcontent-%COMP%]{padding:8px 12px;color:var(--ng-colors-text-tertiary-600);font-size:13px}.scope-item__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}.conv-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.conv-title-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:4px 2px 4px 6px;border-radius:6px;cursor:pointer;max-width:360px}.conv-title-btn[_ngcontent-%COMP%] .wfb-header__title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;font-weight:400;color:#344054}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f2f4f7}.conv-title-btn[_ngcontent-%COMP%]:disabled{cursor:default}.conv-title-btn__edit[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;transition:opacity .12s}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled) .conv-title-btn__edit[_ngcontent-%COMP%]{opacity:1}.conv-title-input[_ngcontent-%COMP%]{font-family:inherit;font-size:14px;font-weight:400;color:#344054;border:1px solid #2970ff;border-radius:6px;padding:4px 8px;outline:none;min-width:220px;box-shadow:0 0 0 3px #2970ff14}.header-conn-wrap[_ngcontent-%COMP%]{position:relative}.header-conn-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;background:#fff;border:1px solid #d0d5dd;border-radius:8px;font-size:12px;font-weight:500;color:#344054;cursor:pointer;transition:border-color .15s,box-shadow .15s;white-space:nowrap;max-width:200px}.header-conn-chip[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#98a2b3;box-shadow:0 1px 3px #10182814}.header-conn-chip--open[_ngcontent-%COMP%]{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff14}.header-conn-chip[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.header-conn-chip__label[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;max-width:150px}.header-conn-chip__chevron[_ngcontent-%COMP%]{flex-shrink:0;transition:transform .15s}.header-conn-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.header-conn-chip__spinner[_ngcontent-%COMP%]{width:12px;height:12px;border:1.5px solid #e0e5ef;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.header-conn-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 6px);right:0;min-width:200px;background:#fff;border:1px solid #eaecf0;border-radius:10px;box-shadow:0 8px 24px #1018281f;z-index:20;overflow:hidden}.header-conn-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:#344054;cursor:pointer;transition:background .1s}.header-conn-dropdown__item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover{background:#f9fafb}.header-conn-dropdown__item--active[_ngcontent-%COMP%]{background:#eff4ff;color:#2970ff;font-weight:500}.header-conn-dropdown__check[_ngcontent-%COMP%]{color:#2970ff;flex-shrink:0}.header-conn-dropdown__delete[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;color:#667085;transition:opacity .1s,color .1s}.header-conn-dropdown__item-title[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]{opacity:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]:hover{color:#d92d20}.header-conn-dropdown__item--new[_ngcontent-%COMP%]{color:#2970ff;font-weight:500;border-bottom:1px solid #f2f4f7;padding-bottom:10px;margin-bottom:2px}.header-new-chat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;background:transparent;border:1px solid #d0d5dd;border-radius:8px;font-size:12px;font-weight:500;color:#344054;cursor:pointer;font-family:inherit;white-space:nowrap;transition:border-color .15s,background .15s}.header-new-chat[_ngcontent-%COMP%]:hover:not(:disabled){background:#f9fafb;border-color:#98a2b3}.header-new-chat[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.ai-badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#eff4ff;flex-shrink:0}.ai-badge--sm[_ngcontent-%COMP%]{width:22px;height:22px}.ai-badge--lg[_ngcontent-%COMP%]{width:48px;height:48px}.conv-dropdown[_ngcontent-%COMP%]{margin-left:-8px}.conv-dropdown[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){padding-left:2px;padding-right:2px}.conv-dropdown[_ngcontent-%COMP%]::part(panel){width:380px;max-width:90vw;max-height:360px;overflow-y:auto;overflow-x:hidden}.related-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .2s ease,opacity .15s ease}.related-trigger[_ngcontent-%COMP%]:hover .related-trigger__label[_ngcontent-%COMP%], .related-trigger[_ngcontent-%COMP%]:focus-visible .related-trigger__label[_ngcontent-%COMP%]{max-width:120px;opacity:1}.related-dropdown[_ngcontent-%COMP%]::part(panel){width:420px;max-width:90vw;max-height:320px;overflow-y:auto;overflow-x:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]{display:block;width:100%}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base){width:100%;min-width:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:8px 12px}.menu-empty[_ngcontent-%COMP%]{padding:10px 16px;font-size:12.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.menu-skeleton-item[_ngcontent-%COMP%]{pointer-events:none}.prompt-gallery-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%}.prompt-gallery-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid #e9eaeb;border-radius:10px;background:#fff}.prompt-gallery-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-header-action__spinner[_ngcontent-%COMP%]{display:inline-flex;color:#2970ff}.related-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;min-width:0}.related-item__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#667085}.related-item__name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.related-item__meta[_ngcontent-%COMP%]{flex-shrink:0;color:#98a2b3;font-size:12px;margin-left:4px}.conv-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;min-width:0}.conv-item__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#667085}.conv-item__title[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conv-item__check[_ngcontent-%COMP%]{flex-shrink:0}.conv-item__delete[_ngcontent-%COMP%]{flex-shrink:0;color:#98a2b3;opacity:0;transition:opacity .12s,color .12s;cursor:pointer}.conv-item__delete[_ngcontent-%COMP%]:hover{color:#d92d20}nile-menu-item[_ngcontent-%COMP%]:hover .conv-item__delete[_ngcontent-%COMP%]{opacity:1}.aq-chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:block}.aq-chat[_ngcontent-%COMP%]::part(viewport){scrollbar-width:none;-ms-overflow-style:none}.aq-chat[_ngcontent-%COMP%]::part(scroll-button){display:none}.aq-chat[_ngcontent-%COMP%]::part(messages){padding:16px;display:flex;flex-direction:column;gap:16px}.aq-chat[_ngcontent-%COMP%]::part(empty){position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:auto;padding:24px 16px;box-sizing:border-box}.msg-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;align-self:flex-start}.msg-skeleton--ai[_ngcontent-%COMP%]{width:100%;max-width:100%}.msg-skeleton--user[_ngcontent-%COMP%]{align-self:flex-end;max-width:60%}nile-skeleton-loader[_ngcontent-%COMP%]::part(skeleton){background-color:#e4e7ec;opacity:1}.welcome-wrap[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;overflow:auto}.welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;margin:auto;width:100%;max-width:820px;padding:48px 16px}.welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:#181d27;letter-spacing:-.02em}.welcome-sub[_ngcontent-%COMP%]{margin:0 0 4px;font-size:14px;color:#535862;max-width:440px;line-height:1.6}.welcome-composer[_ngcontent-%COMP%]{width:100%;margin:8px auto 4px}.aq-composer[_ngcontent-%COMP%]{display:block;width:100%}.welcome-prompts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.prompt-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px 14px;border:1px solid #e9eaeb;border-radius:12px;background:#fff;cursor:pointer;text-align:left;font:inherit;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.prompt-card[_ngcontent-%COMP%]:hover{border-color:#b2ccff;box-shadow:0 1px 2px #1018280f}.prompt-card__icon[_ngcontent-%COMP%]{flex:0 0 auto}.prompt-card__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:13px;font-weight:500;line-height:1.45;color:#414651;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.prompt-card__badge[_ngcontent-%COMP%]{flex:0 0 auto;align-self:center;padding:2px 6px;border-radius:4px;background:#7a5af8;color:#fff;font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.prompt-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.prompt-card--ai[_ngcontent-%COMP%]:hover{border-color:#b9a6fb}.forecast-drawer[_ngcontent-%COMP%]{--size: 420px}.forecast-drawer[_ngcontent-%COMP%]::part(header){align-items:center;padding:0 12px 0 16px;border-bottom:1px solid #eaecf0}.forecast-drawer[_ngcontent-%COMP%]::part(title){display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:#101828}.forecast-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:22px;padding:20px 16px}.forecast-drawer[_ngcontent-%COMP%]::part(footer){border-top:1px solid #eaecf0;padding:12px 16px}.forecast-drawer__label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:#101828}.forecast-drawer__mark[_ngcontent-%COMP%]{flex:0 0 auto}.fs-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.fs-label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#414651}.fs-label__value[_ngcontent-%COMP%]{color:#5925dc}.fs-hint[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.5;color:#717680}.fs-slider[_ngcontent-%COMP%]{appearance:none;width:100%;height:6px;margin:2px 0;border-radius:3px;background:#eaecf0;cursor:pointer;background-image:linear-gradient(#2970ff,#2970ff);background-repeat:no-repeat;background-size:var(--fs-fill, 50%) 100%}.fs-slider--ai[_ngcontent-%COMP%]{background-image:linear-gradient(#7a5af8,#7a5af8)}.fs-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:#2970ff;box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-webkit-slider-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:14px;height:14px;border:2px solid #fff;border-radius:50%;background:#2970ff;box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-moz-range-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]:focus-visible{outline:2px solid #84adff;outline-offset:3px}.fs-segmented[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:3px;border:1px solid #e9eaeb;border-radius:8px;background:#f9fafb}.fs-segment[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:6px 4px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;color:#535862;white-space:nowrap;transition:background .15s ease,color .15s ease}.fs-segment__input[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.fs-segment[_ngcontent-%COMP%]:hover{color:#181d27}.fs-segment--on[_ngcontent-%COMP%]{background:#2970ff;color:#fff;font-weight:600}.fs-segment--on[_ngcontent-%COMP%]:hover{color:#fff}.fs-segment--off[_ngcontent-%COMP%]{color:#a4a7ae;cursor:not-allowed}.fs-segment--off[_ngcontent-%COMP%]:hover{color:#a4a7ae}.fs-segment[_ngcontent-%COMP%]:has(.fs-segment__input:focus-visible){outline:2px solid #84adff;outline-offset:1px}.fs-card[_ngcontent-%COMP%]{padding:12px 14px;border:1px solid #e9eaeb;border-radius:10px;background:#fcfcfd}.fs-card__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0 0 4px;font-size:12px;font-weight:600;color:#414651}.fs-card__body[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.6;color:#535862}.fs-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.fs-card--ai[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#5925dc}.fs-card--pass[_ngcontent-%COMP%]{border-color:#abefc6;background:#f6fef9}.fs-card--pass[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#067647}.fs-card--warn[_ngcontent-%COMP%]{border-color:#fedf89;background:#fffcf5}.fs-card--warn[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#b54708}.fs-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.prompt-gallery-prompts[_ngcontent-%COMP%]{width:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]::part(item-label){font-weight:500}.ai-bubble__steps[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;margin-bottom:12px;padding:12px 16px}.wfb-suggestions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:8px}.wfb-suggestions-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:12px}.suggestions-spinner[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid #e0e5ef;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.suggestions-loading-content[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:2px}.suggestions-loading-text[_ngcontent-%COMP%]{color:#667085;font-size:13px;font-style:italic}.suggestions-loading-dots[_ngcontent-%COMP%]{display:inline-flex;gap:1px}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#667085;font-size:13px;animation:_ngcontent-%COMP%_dot-fade 1.4s ease-in-out infinite}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_dot-fade{0%,80%,to{opacity:.2}40%{opacity:1}}.welcome-prompts-skeleton[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.welcome-prompts-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid #e9eaeb;border-radius:12px;background:#fff}.welcome-prompts-skeleton__icon[_ngcontent-%COMP%]{flex:0 0 auto}.welcome-prompts-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;max-width:70%}.prompt-gallery-row[_ngcontent-%COMP%]{width:100%;margin:2px auto 0;display:flex;justify-content:flex-end}.prompt-gallery-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:2px 0;cursor:pointer;font:inherit;font-size:13px;font-weight:400;color:#2970ff}.prompt-gallery-link[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.prompt-gallery-link[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{text-decoration:underline}.prompt-gallery-drawer[_ngcontent-%COMP%]{--size: calc(100vw - 248px) }.prompt-gallery-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid #eaecf0}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:#101828}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:14px}.prompt-gallery-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.prompt-gallery-empty[_ngcontent-%COMP%]{color:#717680;font-size:13px;padding:24px 4px}.prompt-gallery-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;align-content:start}.prompt-gallery-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #e9eaeb;border-radius:12px;padding:12px 16px;background:#fff;cursor:pointer;text-align:left;font:inherit;font-size:13px;font-weight:500;color:#414651;line-height:1.4;transition:border-color .18s,box-shadow .18s}.prompt-gallery-item[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a}.ai-bubble[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;margin-inline:auto}.ai-bubble__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.sent-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px;padding:6px 8px;border-radius:8px;border-left:3px solid #155eef;background:#155eef0f;color:var(--ng-colors-text-tertiary-600, #535862);font-size:12px;line-height:1.4}.sent-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:#155eef}.sent-quote__text[_ngcontent-%COMP%]{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai-bubble[_ngcontent-%COMP%]::part(thinking){border:none;padding-left:2px;font-size:12px}.ai-bubble[_ngcontent-%COMP%]::part(base), .ai-bubble[_ngcontent-%COMP%]::part(bubble){transition:max-width .22s ease,width .22s ease}.assistant-text[_ngcontent-%COMP%]{display:block;max-width:680px}.user-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;width:100%;max-width:860px;margin-inline:auto}.user-icon[_ngcontent-%COMP%]{order:2;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#f2f4f7;flex-shrink:0;margin-top:2px}.user-bubble[_ngcontent-%COMP%]{order:1;background:#2970ff;border-radius:12px 2px 12px 12px;padding:10px 14px;font-size:14px;color:#fff;max-width:70%;white-space:pre-wrap;word-break:break-word}.assistant-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:860px;margin-inline:auto}.assistant-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#eff4ff;flex-shrink:0;margin-top:2px}.assistant-body[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:760px;display:flex;flex-direction:column;gap:12px}.assistant-text[_ngcontent-%COMP%]{font-size:14px;color:#344054;line-height:1.6;margin:0;white-space:pre-wrap;word-break:break-word}.assistant-text--error[_ngcontent-%COMP%]{color:#d92d20}.assistant-text--md[_ngcontent-%COMP%]{white-space:normal;display:block}.assistant-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid #fda29b;border-radius:8px;background:#fffbfa;font-size:13px;line-height:1.5;color:#b42318}.assistant-error__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#d92d20;margin-top:1px}.assistant-error__text[_ngcontent-%COMP%]{word-break:break-word}.wfb-tools[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-tool[_ngcontent-%COMP%]{font-size:11px}.wfb-tool[_ngcontent-%COMP%]::part(content){display:inline-flex;align-items:center;gap:5px}.wfb-tool__spinner[_ngcontent-%COMP%]{width:10px;height:10px;border:1.5px solid currentColor;border-top-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;display:inline-block}.wfb-tool__detail[_ngcontent-%COMP%]{opacity:.75;font-weight:400}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.agent-trace[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:14px;margin:2px 0;padding-left:18px}.agent-trace[_ngcontent-%COMP%]:before{content:"";position:absolute;top:4px;bottom:4px;left:3px;width:2px;border-radius:1px;background:#eaecf0}.agent-trace__row[_ngcontent-%COMP%]{min-width:0}.agent-trace__text[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:1.6;color:#717680;white-space:pre-wrap;word-break:break-word}.agent-trace__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-status-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 0}.wfb-status-text[_ngcontent-%COMP%]{font-size:13px;color:#667085;font-style:italic}.wfb-typing[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;padding:6px 0}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:#98a2b3;animation:_ngcontent-%COMP%_bounce 1.2s ease-in-out infinite}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_bounce{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}.chart-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #eaecf0;border-radius:12px;background:#fff;box-shadow:0 1px 3px #1018280f;cursor:pointer;transition:border-color .15s,box-shadow .15s;width:100%;max-width:100%}.chart-card[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff14}.chart-card__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:#eff4ff;flex-shrink:0}.chart-card__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.chart-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#101828;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-card__meta[_ngcontent-%COMP%]{font-size:12px;color:#667085}.aq-composer-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;border:1px solid #d0d5dd;border-radius:20px;background:#fff;transition:border-color .12s ease,box-shadow .12s ease}.aq-composer-wrap[_ngcontent-%COMP%]:focus-within{border-color:#155eef;box-shadow:0 0 0 3px #155eef1f}.aq-composer-wrap--dragover[_ngcontent-%COMP%]{border-color:#155eef;border-style:dashed;box-shadow:0 0 0 3px #155eef1f}.aq-composer-wrap[_ngcontent-%COMP%] > .aq-attachments[_ngcontent-%COMP%]{padding:10px 14px 0}.reply-badge[_ngcontent-%COMP%]{position:fixed;z-index:1000;transform:translate(-50%,calc(-100% - 8px));display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border:none;border-radius:999px;background:var(--ng-colors-bg-primary-solid, #181d27);color:#fff;font-size:12px;font-weight:500;line-height:1;box-shadow:var(--ng-shadow-lg, 0 8px 16px rgba(16, 24, 40, .16));cursor:pointer}.reply-badge[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-primary-solid-hover, #0c0e12)}.reply-badge--below[_ngcontent-%COMP%]{transform:translate(-50%,8px)}.reply-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin:10px 14px 0;padding:8px 10px;border-radius:10px;border-left:3px solid #155eef;background:var(--ng-colors-bg-secondary, #f5f5f6);color:var(--ng-colors-text-tertiary-600, #535862);font-size:12px;line-height:1.4}.reply-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:#155eef;transform:rotate(180deg)}.reply-quote__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.reply-quote__dismiss[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:4px}.reply-quote__dismiss[_ngcontent-%COMP%]:hover{background:#0000000f}.aq-drop-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:20px;background:#eff6ffeb;color:#155eef;font-size:13px;font-weight:500;pointer-events:none}.aq-composer[_ngcontent-%COMP%]::part(base){border:0;border-radius:0;background:transparent;box-shadow:none}.aq-composer[_ngcontent-%COMP%]::part(toolbar-end){gap:6px;align-items:center}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button){background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-tertiary-600, #535862)}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button):hover{background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.aq-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.aq-attachments--sent[_ngcontent-%COMP%]{margin-top:6px}.aq-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:4px 8px;border:1px solid #eaecf0;border-radius:8px;background:#f9fafb;font-size:12px;color:#344054}.aq-chip--error[_ngcontent-%COMP%]{border-color:#fda29b;background:#fffbfa;color:#b42318}.aq-chip--static[_ngcontent-%COMP%]{background:#fff}.aq-chip__icon[_ngcontent-%COMP%]{color:#667085;flex-shrink:0}.aq-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-chip__spin[_ngcontent-%COMP%]{flex-shrink:0}.aq-chip__retry[_ngcontent-%COMP%]{border:none;background:none;padding:0;color:#b42318;font-size:12px;font-weight:600;cursor:pointer}.aq-chip__remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:none;background:none;padding:0;cursor:pointer;color:#98a2b3;flex-shrink:0}.aq-chip__remove[_ngcontent-%COMP%]:hover{color:#475467}.wfb-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px}.wfb-breadcrumb__current[_ngcontent-%COMP%]{color:#101828;font-weight:500}.wfb-preview-close[_ngcontent-%COMP%]{cursor:pointer;color:#667085}.wfb-preview-close[_ngcontent-%COMP%]:hover{color:#101828}.wfb-preview-link[_ngcontent-%COMP%]{background:none;border:none;padding:0;font-size:13px;font-weight:500;color:#2970ff;cursor:pointer;font-family:inherit}.wfb-preview-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.input-area[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 16px 18px;display:flex;justify-content:center}.chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:100%;padding:14px 16px 12px;background:#fff;border:1px solid #e9eaeb;border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1f}.voice-wave[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:22px;margin:0 8px;display:block}.input-query[_ngcontent-%COMP%]{display:block;width:100%;min-width:0;border:none;outline:none;resize:none;font:inherit;font-size:15px;line-height:1.4;color:#181d27;background:transparent;padding:6px 2px;max-height:160px;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.input-query[_ngcontent-%COMP%]::placeholder{color:#717680}.input-query[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.input-query--live[_ngcontent-%COMP%]{min-height:21px;cursor:default;text-align:left}.input-query__interim[_ngcontent-%COMP%]{font-style:italic;opacity:.55}.pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pill-toolbar__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.conn-chip-wrap[_ngcontent-%COMP%]{position:relative}.datasource-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;background:#eff4ff;border-radius:20px;font-size:12px;font-weight:500;color:#2970ff;cursor:pointer;-webkit-user-select:none;user-select:none;max-width:200px;border:1px solid transparent}.datasource-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-chip__chevron[_ngcontent-%COMP%]{transition:transform .15s;flex-shrink:0}.datasource-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.datasource-chip[_ngcontent-%COMP%]:hover:not(:disabled){background:#e0eaff}.datasource-chip[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.datasource-chip--open[_ngcontent-%COMP%]{background:#e0eaff;border-color:#b2ccff}.conn-chip-dropdown[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);left:0;min-width:200px;background:#fff;border:1px solid #e4e7ec;border-radius:10px;box-shadow:0 4px 16px #0000001a;z-index:100;overflow:hidden}.conn-chip-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:13px;color:#344054;cursor:pointer}.conn-chip-dropdown__item[_ngcontent-%COMP%]:hover{background:#f9fafb}.conn-chip-dropdown__item--active[_ngcontent-%COMP%]{background:#f5f8ff;color:#2970ff}.conn-chip-dropdown__name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conn-chip-dropdown__hint[_ngcontent-%COMP%]{font-size:11px;color:#98a2b3;flex-shrink:0}.conn-chip-dropdown__check[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;color:#2970ff}.mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:#667085;transition:color .15s}.mic-icon[_ngcontent-%COMP%]:hover{color:#344054}.mic-icon--recording[_ngcontent-%COMP%]{color:#d92d20;animation:_ngcontent-%COMP%_mic-pulse 1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1}50%{opacity:.5}}.send-icon[_ngcontent-%COMP%]{cursor:pointer;color:#2970ff;transition:opacity .15s}.send-icon--disabled[_ngcontent-%COMP%]{opacity:.35;cursor:not-allowed;pointer-events:none}.wfb-save-dialog[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#10182866;z-index:20}.wfb-save-dialog__body[_ngcontent-%COMP%]{background:#fff;border:1px solid #eaecf0;border-radius:12px;padding:20px;width:360px;display:flex;flex-direction:column;gap:12px;box-shadow:0 8px 24px #1018281f}.wfb-save-dialog__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#344054}.wfb-save-dialog__input[_ngcontent-%COMP%]{width:100%;padding:8px 12px;border:1px solid #d0d5dd;border-radius:8px;font-size:14px;font-family:inherit;color:#101828;outline:none;box-sizing:border-box}.wfb-save-dialog__input[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1a}.wfb-save-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-shell[_ngcontent-%COMP%]{--aq-header-h: 56px;display:flex;flex:1 1 auto;min-height:0;width:100%;overflow:hidden;container-type:inline-size}.aq-chat-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;transition:flex-basis .22s ease,max-width .22s ease;--aq-conversation-w: 900px}.aq-shell[data-mode=idle][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .input-area[_ngcontent-%COMP%]{width:100%;max-width:var(--aq-conversation-w);margin-left:auto;margin-right:auto}.aq-shell[data-mode=conversation][_ngcontent-%COMP%] .wfb-messages[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{margin-top:auto}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 40%;max-width:40%;margin:0}.aq-resizer[_ngcontent-%COMP%]{align-self:stretch;position:relative;cursor:col-resize;background:transparent;z-index:6;touch-action:none}.aq-resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translate(-50%);background:var(--nile-color-border, #e4e7ec)}.aq-resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:3px;background:var(--nile-color-border, #cfd4dc);transition:background .15s,height .15s}.aq-resizer[_ngcontent-%COMP%]:hover:after, .aq-resizer.is-active[_ngcontent-%COMP%]:after{background:#2970ff;height:44px}.aq-shell--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.aq-shell--resizing[_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-artifact-pane[_ngcontent-%COMP%]{transition:none}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{display:none}.aq-artifact-pane[_ngcontent-%COMP%]{flex:1 1 60%;display:flex;flex-direction:column;min-width:0;background:var(--nile-color-bg-subtle, #fbfbfd);animation:_ngcontent-%COMP%_aq-slide-in .22s ease}@keyframes _ngcontent-%COMP%_aq-slide-in{0%{transform:translate(16px);opacity:0}to{transform:translate(0);opacity:1}}.aq-artifact-pane__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 16px;border-bottom:1px solid #eaecf0;background:#fff;flex-shrink:0;gap:12px}.aq-artifact-pane__title[_ngcontent-%COMP%]{font-weight:600;font-size:14px;color:#101828;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-artifact-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:16px}.aq-artifact-pane__actions[_ngcontent-%COMP%]{padding:12px 16px;border-top:1px solid var(--nile-color-border, #e4e7ec);display:flex;justify-content:flex-end;gap:12px}.inline-widget[_ngcontent-%COMP%]{margin-top:10px;border:1px solid #e9eaeb;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 1px 2px #1018280a,0 4px 14px #1018280f}.inline-widget__chart[_ngcontent-%COMP%]{height:380px;padding:14px 16px 6px}.inline-widget__chart--kpi[_ngcontent-%COMP%]{height:150px}.inline-widget__chart--kpi-spark[_ngcontent-%COMP%]{height:220px}.inline-widget__chart[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{display:block;height:100%;width:100%}.inline-widget__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;padding:10px 16px 14px;border-top:1px solid #f2f2f4}.chart-live[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;color:#414651;white-space:nowrap}.chart-live__dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:#17b26a}.forecast-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;padding:10px 14px;border-top:1px solid #f2f2f4;background:#fcfcfd;font-size:11px;line-height:1.5}.forecast-meta__item[_ngcontent-%COMP%]{display:inline-flex;gap:4px;white-space:nowrap}.forecast-meta__label[_ngcontent-%COMP%]{color:#717680}.forecast-meta__value[_ngcontent-%COMP%]{color:#414651;font-weight:600}.forecast-record[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #f2f2f4}.forecast-record__icon[_ngcontent-%COMP%]{flex:0 0 auto}.forecast-record__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:12px;line-height:1.5;color:#717680}.forecast-record__action[_ngcontent-%COMP%]{flex:0 0 auto;padding:4px 10px;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:#5925dc;transition:background .15s ease,border-color .15s ease}.forecast-record__action[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#d9d0fd;background:#f7f5ff}.forecast-record__action[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.follow-ups[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.follow-up[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid #e9eaeb;border-radius:8px;background:#fff;cursor:pointer;font:inherit;font-size:13px;font-weight:500;color:#414651;transition:border-color .15s ease,background .15s ease}.follow-up[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b2ccff;background:#f9fafb}.follow-up[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:default}.follow-up__icon[_ngcontent-%COMP%]{flex:0 0 auto}.follow-up__label[_ngcontent-%COMP%]{white-space:nowrap}.follow-up__badge[_ngcontent-%COMP%]{padding:2px 6px;border-radius:4px;background:#7a5af8;color:#fff;font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.follow-up--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#f7f5ff;color:#5925dc}.follow-up--ai[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b9a6fb;background:#f0ecff}.widget-header-btn[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:6px;background:transparent;color:#717680;cursor:pointer}.widget-header-btn[_ngcontent-%COMP%]:hover{background:#f5f5f6;color:#181d27}.widget-header-btn__badge[_ngcontent-%COMP%]{position:absolute;top:-2px;right:-2px;min-width:14px;height:14px;padding:0 3px;border-radius:999px;background:#2970ff;color:#fff;font-size:10px;font-weight:700;line-height:14px;text-align:center}.widget-header-dropdown[_ngcontent-%COMP%]::part(panel){width:320px;max-width:92vw}.type-picker__panel[_ngcontent-%COMP%], .filter-builder__panel[_ngcontent-%COMP%]{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 8px 24px #10182824;padding:10px;box-sizing:border-box}.inline-action__loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;font-size:13px;color:#535862}.inline-action__hint[_ngcontent-%COMP%]{margin:0 0 6px;font-size:12px;color:#535862}.inline-action__error[_ngcontent-%COMP%]{margin:6px 0 0;font-size:12px;color:#d92d20}.type-picker__section[_ngcontent-%COMP%]{margin:6px 0 4px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:#717680}.type-picker__section[_ngcontent-%COMP%]:first-child{margin-top:0}.type-picker__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.type-picker__tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;box-sizing:border-box;height:60px;border:1px solid #e9eaeb;border-radius:8px;background:#fff;color:#414651;font-size:11px;font-weight:500;cursor:pointer}.type-picker__tile[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#717680}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#2970ff;color:#2970ff}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled) nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.type-picker__tile[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.type-picker__tile--sensible[_ngcontent-%COMP%]{border-color:#2970ff47;background:#2970ff0a}.type-picker__tile--sensible[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.filter-builder__active[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.filter-builder__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#2970ff14;color:#414651;font-size:12px}.filter-builder__chip-remove[_ngcontent-%COMP%]{display:inline-flex;border:none;background:none;padding:0;cursor:pointer;color:inherit}.filter-builder__form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.filter-builder__field-label[_ngcontent-%COMP%]{padding:6px 2px;font-size:12px;font-weight:600;color:#181d27}.filter-builder__and[_ngcontent-%COMP%]{font-size:12px;color:#535862}.filter-builder__select[_ngcontent-%COMP%], .filter-builder__input[_ngcontent-%COMP%]{flex:1 1 100%;min-width:0;padding:7px 8px;box-sizing:border-box;border:1px solid #e9eaeb;border-radius:7px;background:#fff;font:inherit;font-size:12px;color:#181d27}.filter-builder__multi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:160px;overflow-y:auto;width:100%}.filter-builder__multi-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 2px;font-size:12px;color:#414651;cursor:pointer}.filter-builder__multi-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-shell[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 40%;max-width:40%;margin:0}.aq-builder-pane[_ngcontent-%COMP%]{flex:1 1 60%;display:flex;flex-direction:column;min-width:0}.aq-builder-pane[_ngcontent-%COMP%] shared-builder-host[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{display:block;min-width:calc(100cqw - 24px)}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex-basis:0;max-width:0;overflow:hidden;border-right:none}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{flex-basis:100%}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{min-width:100%}.choice-picker[_ngcontent-%COMP%]{margin-top:6px;max-width:520px}.choice-picker__group[_ngcontent-%COMP%]{display:block}.choice-picker__submit-row[_ngcontent-%COMP%]{margin-top:12px;display:flex;justify-content:flex-start}.choice-card[_ngcontent-%COMP%]{display:block}.choice-card[_ngcontent-%COMP%] + .choice-card[_ngcontent-%COMP%]{margin-top:8px}.choice-card[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:12px 14px;gap:12px;align-items:flex-start;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:var(--ng-colors-bg-primary, #ffffff);cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.choice-card[_ngcontent-%COMP%]::part(control){margin-top:1px}.choice-card[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-card[_ngcontent-%COMP%]:not(.choice-card--locked):hover::part(base){border-color:var(--ng-colors-border-brand, #7f56d9);background:var(--ng-colors-bg-brand-primary, #f9f5ff)}.choice-card--chosen[_ngcontent-%COMP%]::part(base){border-color:var(--ng-colors-border-brand, #7f56d9);background:var(--ng-colors-bg-brand-primary, #f9f5ff);box-shadow:inset 0 0 0 1px var(--ng-colors-border-brand, #7f56d9)}.choice-card--chosen[_ngcontent-%COMP%]::part(control){border-color:var(--ng-colors-bg-brand-solid, #7f56d9);background-color:var(--ng-colors-bg-brand-solid, #7f56d9)}.choice-card--chosen[_ngcontent-%COMP%]::part(checked-icon){background-color:#fff}.choice-card--locked[_ngcontent-%COMP%]:not(.choice-card--chosen)::part(base){opacity:.6;cursor:default}.choice-card__label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3px;min-width:0}.choice-card__name[_ngcontent-%COMP%]{font-family:var(--ng-font-family-mono, ui-monospace, "SF Mono", monospace);font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);overflow-wrap:anywhere}.choice-card__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-card__meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;margin-top:1px;font-size:11.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-card__chip--green[_ngcontent-%COMP%]{color:#22c55e;font-weight:700}.choice-card__chip--yellow[_ngcontent-%COMP%]{color:#f59e0b;font-weight:700}.choice-card__chip--red[_ngcontent-%COMP%]{color:#ef4444;font-weight:700}.choice-card__chip--muted[_ngcontent-%COMP%]{color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-picker__empty[_ngcontent-%COMP%]{margin:0;font-size:12.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-picker__chat-link[_ngcontent-%COMP%]{display:block;margin:6px 0 0;padding:0;border:none;background:none;font-size:12.5px;color:var(--ng-colors-brand-600, #4f46e5);cursor:pointer;text-align:left}.choice-picker__chat-link[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:underline}.choice-picker__chat-link[_ngcontent-%COMP%]:disabled{color:var(--ng-colors-text-tertiary-600, #98a2b3);cursor:default}.choice-picker__footer-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-top:6px}.choice-picker__footer-actions[_ngcontent-%COMP%] .choice-picker__chat-link[_ngcontent-%COMP%]{margin-top:0}.choice-picker__chat-draft[_ngcontent-%COMP%]{margin-top:8px;padding:10px;border:1px dashed var(--ng-colors-border-secondary-600, #d0d5dd);border-radius:8px;background:var(--ng-colors-bg-secondary-600, #f9fafb)}.choice-picker__chat-draft-label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-picker__chat-draft-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.choice-picker__chat-draft-input[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.ai-executive-summary[_ngcontent-%COMP%]::part(trigger){display:none}']})};var Pr=(i,t)=>t.id;function Mr(i,t){if(i&1&&(s(0,"div",9),h(1,"div",12),s(2,"span"),p(3),d()()),i&2){let e=r();l(3),A(e.copy().loadingConnections)}}function Sr(i,t){if(i&1){let e=w();s(0,"div",10)(1,"div",13),h(2,"nile-glyph",14),d(),s(3,"h3",15),p(4),d(),s(5,"p",16),p(6),d(),s(7,"button",7),g("click",function(){_(e);let o=r();return u(o.openForm())}),h(8,"nile-glyph",8),p(9),d()()}if(i&2){let e=r();l(4),A(e.copy().noConnectionsTitle),l(2),A(e.copy().noConnectionsSub),l(3),T(" ",e.copy().registerConnectionButton," ")}}function Fr(i,t){i&1&&(s(0,"span",23),p(1,"Active"),d())}function Tr(i,t){i&1&&(s(0,"span",24),p(1,"Inactive"),d())}function Or(i,t){i&1&&(s(0,"span",25),h(1,"nile-glyph",34),p(2," Schema "),d())}function qr(i,t){i&1&&h(0,"span",28)}function Dr(i,t){i&1&&h(0,"nile-glyph",29)}function Er(i,t){i&1&&h(0,"span",28)}function Ir(i,t){i&1&&h(0,"nile-glyph",31)}function Vr(i,t){if(i&1&&(s(0,"span",37),p(1),d()),i&2){let e=r(3).$implicit;l(),J("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function zr(i,t){if(i&1&&(h(0,"nile-glyph",36),s(1,"span"),p(2),d(),f(3,Vr,2,2,"span",37)),i&2){let e=r(2).$implicit;l(2),T("Reachable \xB7 ",e.testResult.tableCount," tables"),l(),C(e.testResult.sampleTables.length?3:-1)}}function Rr(i,t){if(i&1&&(h(0,"nile-glyph",38),s(1,"span"),p(2),d()),i&2){let e=r(2).$implicit,n=r(2);l(2),T("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function Nr(i,t){if(i&1&&(s(0,"div",35),f(1,zr,4,2)(2,Rr,3,1),d()),i&2){let e=r().$implicit;H("wfconn-test-result--ok",e.testResult.reachable)("wfconn-test-result--fail",!e.testResult.reachable),l(),C(e.testResult.reachable?1:2)}}function $r(i,t){if(i&1){let e=w();s(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),p(4),d(),s(5,"span",22),p(6),d(),f(7,Fr,2,0,"span",23)(8,Tr,2,0,"span",24),f(9,Or,3,0,"span",25),d(),s(10,"div",26)(11,"button",27),g("click",function(){let o=_(e).$implicit,a=r(2);return u(a.testConnection(o.id))}),f(12,qr,1,0,"span",28)(13,Dr,1,0,"nile-glyph",29),p(14),d(),s(15,"button",30),g("click",function(){let o=_(e).$implicit,a=r(2);return u(a.deleteConnection(o.id,o.name))}),f(16,Er,1,0,"span",28)(17,Ir,1,0,"nile-glyph",31),d()()(),s(18,"div",32),p(19),wt(20,"date"),d(),f(21,Nr,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);H("wfconn-card--deleting",e.deleting),l(4),A(e.name),l(2),A(n.adapterLabel(e.adapterType)),l(),C(e.isActive?7:8),l(2),C(e.hasSchemaSnapshot?9:-1),l(2),H("wfconn-icon-btn--loading",e.testing),y("disabled",e.testing||e.deleting),l(),C(e.testing?12:13),l(2),T(" ",n.copy().testConnectionButton," "),l(),y("disabled",e.testing||e.deleting),l(),C(e.deleting?16:17),l(3),T(" Created ",kt(20,15,e.createdAt,"mediumDate")," "),l(2),C(e.testResult?21:-1)}}function Lr(i,t){if(i&1&&(s(0,"div",11),V(1,$r,22,18,"div",17,Pr),d()),i&2){let e=r();l(),z(e.connections())}}function Br(i,t){if(i&1){let e=w();s(0,"div",46)(1,"label",47),p(2,"Server"),d(),s(3,"input",60),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("server",o))}),d()(),s(4,"div",46)(5,"label",47),p(6,"Database"),d(),s(7,"input",61),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("database",o))}),d()(),s(8,"div",62)(9,"div",46)(10,"label",47),p(11,"Username"),d(),s(12,"input",63),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("user",o))}),d()(),s(13,"div",46)(14,"label",47),p(15,"Password"),d(),s(16,"div",64)(17,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("password",o))}),d(),s(18,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),h(19,"nile-glyph",67),d()()()(),s(20,"div",62)(21,"div",46)(22,"label",47),p(23,"Schema"),d(),s(24,"input",68),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("schema",o))}),d()(),s(25,"div",69)(26,"label",47),p(27,"Port"),d(),s(28,"input",70),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("port",+o))}),d()()()}if(i&2){let e=r(2);l(3),y("ngModel",e.mssql().server),l(4),y("ngModel",e.mssql().database),l(5),y("ngModel",e.mssql().user),l(5),y("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),l(2),q("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(5),y("ngModel",e.mssql().schema),l(4),y("ngModel",e.mssql().port)}}function Ur(i,t){if(i&1){let e=w();s(0,"div",46)(1,"label",47),p(2,"URL"),d(),s(3,"input",71),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("url",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),p(7,"Username"),d(),s(8,"input",72),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("username",o))}),d()(),s(9,"div",46)(10,"label",47),p(11,"Password"),d(),s(12,"div",64)(13,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("password",o))}),d(),s(14,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),h(15,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),y("ngModel",e.opensearch().url),l(5),y("ngModel",e.opensearch().username),l(5),y("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),l(2),q("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function Wr(i,t){if(i&1){let e=w();s(0,"div",62)(1,"div",46)(2,"label",47),p(3,"Host"),d(),s(4,"input",73),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("host",o))}),d()(),s(5,"div",69)(6,"label",47),p(7,"Port"),d(),s(8,"input",74),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("port",+o))}),d()()(),s(9,"div",46)(10,"label",47),p(11,"Database"),d(),s(12,"input",61),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("database",o))}),d()(),s(13,"div",62)(14,"div",46)(15,"label",47),p(16,"Username"),d(),s(17,"input",75),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("user",o))}),d()(),s(18,"div",46)(19,"label",47),p(20,"Password"),d(),s(21,"div",64)(22,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("password",o))}),d(),s(23,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),h(24,"nile-glyph",67),d()()()(),s(25,"div",46)(26,"label",47),p(27,"Schema"),d(),s(28,"input",76),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("schema",o))}),d()()}if(i&2){let e=r(2);l(4),y("ngModel",e.postgres().host),l(4),y("ngModel",e.postgres().port),l(4),y("ngModel",e.postgres().database),l(5),y("ngModel",e.postgres().user),l(5),y("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),l(2),q("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(4),y("ngModel",e.postgres().schema)}}function Gr(i,t){if(i&1){let e=w();s(0,"div",46)(1,"label",47),p(2,"Account"),d(),s(3,"input",77),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("account",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),p(7,"Database"),d(),s(8,"input",78),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("database",o))}),d()(),s(9,"div",46)(10,"label",47),p(11,"Schema"),d(),s(12,"input",79),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("schema",o))}),d()()(),s(13,"div",46)(14,"label",47),p(15,"Warehouse"),d(),s(16,"input",80),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("warehouse",o))}),d()(),s(17,"div",62)(18,"div",46)(19,"label",47),p(20,"Username"),d(),s(21,"input",81),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("user",o))}),d()(),s(22,"div",46)(23,"label",47),p(24,"Password"),d(),s(25,"div",64)(26,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("password",o))}),d(),s(27,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),h(28,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),y("ngModel",e.snowflake().account),l(5),y("ngModel",e.snowflake().database),l(4),y("ngModel",e.snowflake().schema),l(4),y("ngModel",e.snowflake().warehouse),l(5),y("ngModel",e.snowflake().user),l(5),y("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),l(2),q("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function jr(i,t){if(i&1&&(s(0,"div",56),h(1,"nile-glyph",38),p(2),d()),i&2){let e=r(2);l(2),T(" ",e.formError()," ")}}function Hr(i,t){if(i&1&&(h(0,"span",82),p(1)),i&2){let e=r(2);l(),T(" ",e.copy().registeringButton," ")}}function Yr(i,t){if(i&1&&(h(0,"nile-glyph",83),p(1)),i&2){let e=r(2);l(),T(" ",e.copy().registerAndTestButton," ")}}function Qr(i,t){if(i&1){let e=w();s(0,"div",39),g("click",function(){_(e);let o=r();return u(o.closeForm())}),d(),s(1,"aside",40)(2,"div",41)(3,"span",42),p(4),d(),s(5,"button",43),g("click",function(){_(e);let o=r();return u(o.closeForm())}),h(6,"nile-glyph",44),d()(),s(7,"div",45)(8,"div",46)(9,"label",47),p(10,"Connection name"),d(),s(11,"input",48),g("ngModelChange",function(o){_(e);let a=r();return u(a.formConnectionName.set(o))}),d()(),s(12,"div",46)(13,"label",47),p(14,"Display name "),s(15,"span",49),p(16,"(optional)"),d()(),s(17,"input",48),g("ngModelChange",function(o){_(e);let a=r();return u(a.formDisplayName.set(o))}),d()(),s(18,"div",46)(19,"label",47),p(20,"Adapter type"),d(),s(21,"select",50),g("ngModelChange",function(o){_(e);let a=r();return u(a.formAdapter.set(o))}),s(22,"option",51),p(23,"MSSQL (SQL Server)"),d(),s(24,"option",52),p(25,"OpenSearch"),d(),s(26,"option",53),p(27,"PostgreSQL"),d(),s(28,"option",54),p(29,"Snowflake"),d()()(),s(30,"div",55),p(31,"Connection config"),d(),f(32,Br,29,8),f(33,Ur,16,5),f(34,Wr,29,8),f(35,Gr,29,8),f(36,jr,3,1,"div",56),d(),s(37,"div",57)(38,"button",58),g("click",function(){_(e);let o=r();return u(o.closeForm())}),p(39),d(),s(40,"button",59),g("click",function(){_(e);let o=r();return u(o.submitRegister())}),f(41,Hr,2,1)(42,Yr,2,1),d()()()}if(i&2){let e=r();l(4),A(e.copy().registerConnectionTitle),l(7),y("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),l(6),y("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),l(4),y("ngModel",e.formAdapter()),l(11),C(e.formAdapter()==="mssql"?32:-1),l(),C(e.formAdapter()==="opensearch"?33:-1),l(),C(e.formAdapter()==="postgres"?34:-1),l(),C(e.formAdapter()==="snowflake"?35:-1),l(),C(e.formError()?36:-1),l(2),y("disabled",e.saving()),l(),A(e.copy().cancelButton),l(),y("disabled",e.saving()),l(),C(e.saving()?41:42)}}var ve=class i{svc=$(he);copy(){return E().copy}loading=x(!0);connections=x([]);showForm=x(!1);saving=x(!1);formConnectionName=x("Primary");formDisplayName=x("");formAdapter=x("mssql");mssql=x({server:"",database:"",user:"",password:"",schema:"gold",port:1433});opensearch=x({url:"",username:"",password:""});postgres=x({host:"",port:5432,database:"",user:"",password:"",schema:"public"});snowflake=x({account:"",database:"",schema:"",user:"",password:"",warehouse:""});showPassword=x(!1);formError=x("");hasConnections=D(()=>this.connections().length>0);async ngOnInit(){await this.loadConnections()}async loadConnections(){this.loading.set(!0);try{let t=await this.svc.listConnections();this.connections.set(t)}catch{}finally{this.loading.set(!1)}}openForm(){this.showForm.set(!0),this.formError.set("")}closeForm(){this.showForm.set(!1),this.formError.set("")}patchMssql(t,e){this.mssql.update(n=>P(b({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>P(b({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>P(b({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>P(b({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return b({},this.mssql());case"opensearch":return b({},this.opensearch());case"postgres":return b({},this.postgres());case"snowflake":return b({},this.snowflake())}}async submitRegister(){let t=this.formConnectionName().trim();if(!t){this.formError.set("Connection name is required");return}let e={productId:this.svc.productId,displayName:this.formDisplayName().trim()||void 0,connectionName:t,config:this.buildConfig()};this.saving.set(!0),this.formError.set("");try{let n=await this.svc.register(e),o={id:n.connection.id,name:n.connection.name,adapterType:n.connection.adapterType,isActive:!0,hasSchemaSnapshot:n.test.reachable,hasSemanticDoc:!1,createdAt:n.connection.createdAt,updatedAt:n.connection.createdAt,testResult:n.test};this.connections.update(a=>[o,...a]),this.closeForm(),this.showToast("success",n.test.reachable?`Connection "${t}" registered and tested successfully`:`Connection "${t}" registered (connectivity test failed: ${n.test.error??"unreachable"})`)}catch(n){this.formError.set(this.extractMessage(n,"Registration failed"))}finally{this.saving.set(!1)}}async testConnection(t){this.connections.update(e=>e.map(n=>n.id===t?P(b({},n),{testing:!0,testResult:void 0}):n));try{let e=await this.svc.testConnection(t);this.connections.update(n=>n.map(o=>o.id===t?P(b({},o),{testing:!1,testResult:e}):o))}catch(e){this.connections.update(n=>n.map(o=>o.id===t?P(b({},o),{testing:!1}):o)),this.showToast("error",this.extractMessage(e,"Test failed"))}}async deleteConnection(t,e){if(confirm(`Delete connection "${e}"? This cannot be undone.`)){this.connections.update(n=>n.map(o=>o.id===t?P(b({},o),{deleting:!0}):o));try{await this.svc.deleteConnection(t),this.connections.update(n=>n.filter(o=>o.id!==t)),this.showToast("success",`Connection "${e}" deleted`)}catch(n){this.connections.update(o=>o.map(a=>a.id===t?P(b({},a),{deleting:!1}):a)),this.showToast("error",this.extractMessage(n,"Delete failed"))}}}adapterLabel(t){return{mssql:"MSSQL",opensearch:"OpenSearch",postgres:"PostgreSQL",snowflake:"Snowflake"}[t]??t}showToast(t,e){if(t==="error"&&Oe(e))return;let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),qe()}extractMessage(t,e){return Ee(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=de({type:i,selectors:[["app-ask-aquera-connections-page"]],decls:19,vars:5,consts:[[1,"wfconn-page"],[1,"wfconn-header"],[1,"wfconn-header__left"],["routerLink","/ask-aquera",1,"wfconn-back"],["name","ng-arrow-left","method","stroke","size","14","color","#344054"],[1,"wfconn-header__sep"],[1,"wfconn-header__title"],[1,"wfconn-btn","wfconn-btn--primary",3,"click"],["name","ng-plus","method","stroke","size","13","color","#fff"],[1,"wfconn-loading"],[1,"wfconn-empty"],[1,"wfconn-list"],[1,"wfconn-spinner"],[1,"wfconn-empty__icon"],["name","ng-dataflow-03","method","stroke","size","32","color","#98a2b3"],[1,"wfconn-empty__title"],[1,"wfconn-empty__sub"],[1,"wfconn-card",3,"wfconn-card--deleting"],[1,"wfconn-card"],[1,"wfconn-card__header"],[1,"wfconn-card__info"],[1,"wfconn-card__name"],[1,"wfconn-badge","wfconn-badge--adapter"],[1,"wfconn-badge","wfconn-badge--active"],[1,"wfconn-badge","wfconn-badge--inactive"],[1,"wfconn-badge","wfconn-badge--schema"],[1,"wfconn-card__actions"],["title","Test connectivity",1,"wfconn-icon-btn",3,"click","disabled"],[1,"wfconn-spinner","wfconn-spinner--sm"],["name","ng-activity","method","stroke","size","14"],["title","Delete connection",1,"wfconn-icon-btn","wfconn-icon-btn--danger",3,"click","disabled"],["name","ng-trash-01","method","stroke","size","14"],[1,"wfconn-card__meta"],[1,"wfconn-test-result",3,"wfconn-test-result--ok","wfconn-test-result--fail"],["name","ng-check","method","stroke","size","10"],[1,"wfconn-test-result"],["name","ng-check-circle","method","stroke","size","13"],[1,"wfconn-test-result__tables"],["name","ng-alert-circle","method","stroke","size","13"],[1,"wfconn-form-overlay",3,"click"],[1,"wfconn-form-panel"],[1,"wfconn-form-panel__header"],[1,"wfconn-form-panel__title"],[1,"wfconn-form-close",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"wfconn-form-panel__body"],[1,"wfconn-field"],[1,"wfconn-label"],["type","text",1,"wfconn-input",3,"ngModelChange","ngModel","placeholder"],[1,"wfconn-label--opt"],[1,"wfconn-select",3,"ngModelChange","ngModel"],["value","mssql"],["value","opensearch"],["value","postgres"],["value","snowflake"],[1,"wfconn-divider"],[1,"wfconn-form-error"],[1,"wfconn-form-panel__footer"],[1,"wfconn-btn","wfconn-btn--secondary",3,"click","disabled"],[1,"wfconn-btn","wfconn-btn--primary",3,"click","disabled"],["type","text","placeholder","server.database.windows.net",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","my_database",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field-row"],["type","text","placeholder","sa",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-input-wrap"],["placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",1,"wfconn-input",3,"ngModelChange","type","ngModel"],["type","button",1,"wfconn-input-toggle",3,"click"],["method","stroke","size","14"],["type","text","placeholder","gold",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field","wfconn-field--sm"],["type","number","placeholder","1433",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","https://my-cluster.us-east-1.es.amazonaws.com",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","admin",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","localhost",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","number","placeholder","5432",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","postgres",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","public",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myorg-myaccount",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","MY_DB",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","PUBLIC",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","COMPUTE_WH",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myuser",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-spinner","wfconn-spinner--sm","wfconn-spinner--white"],["name","ng-activity","method","stroke","size","13","color","#fff"]],template:function(e,n){e&1&&(s(0,"section",0),h(1,"wf-page-error"),s(2,"header",1)(3,"div",2)(4,"a",3),h(5,"nile-glyph",4),s(6,"span"),p(7),d()(),s(8,"span",5),p(9,"/"),d(),s(10,"span",6),p(11),d()(),s(12,"button",7),g("click",function(){return n.openForm()}),h(13,"nile-glyph",8),p(14),d()(),f(15,Mr,4,1,"div",9)(16,Sr,10,3,"div",10)(17,Lr,3,0,"div",11),f(18,Qr,43,15),d()),e&2&&(l(7),A(n.copy().connectionsBreadcrumbHome),l(4),A(n.copy().connectionsTitle),l(3),T(" ",n.copy().registerConnectionButton," "),l(),C(n.loading()?15:!n.hasConnections()&&!n.showForm()?16:17),l(3),C(n.showForm()?18:-1))},dependencies:[Be,$e,Le,Ie,Re,Ne,Ve,ze,zt,De,St],styles:[".wfconn-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:#f9fafb}.wfconn-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;background:#fff;border-bottom:1px solid #e4e7ec;flex-shrink:0}.wfconn-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.wfconn-back[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;color:#344054;font-size:13px;text-decoration:none;font-weight:500}.wfconn-back[_ngcontent-%COMP%]:hover{color:#101828}.wfconn-header__sep[_ngcontent-%COMP%]{color:#d0d5dd;font-size:16px}.wfconn-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828}.wfconn-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:500;border:none;cursor:pointer;transition:opacity .15s}.wfconn-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-btn--primary[_ngcontent-%COMP%]{background:#2970ff;color:#fff}.wfconn-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1d5fd9}.wfconn-btn--secondary[_ngcontent-%COMP%]{background:#fff;color:#344054;border:1px solid #d0d5dd}.wfconn-btn--secondary[_ngcontent-%COMP%]:hover:not(:disabled){background:#f9fafb}.wfconn-icon-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:500;border:1px solid #d0d5dd;background:#fff;color:#344054;cursor:pointer;transition:background .15s}.wfconn-icon-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f2f4f7}.wfconn-icon-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-icon-btn--danger[_ngcontent-%COMP%]{color:#b42318}.wfconn-icon-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#fff1f0;border-color:#f97066}.wfconn-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:40px 24px;color:#667085;font-size:14px}.wfconn-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:12px;padding:64px 24px;text-align:center}.wfconn-empty__icon[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:12px;background:#f2f4f7;display:flex;align-items:center;justify-content:center}.wfconn-empty__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#101828;margin:0}.wfconn-empty__sub[_ngcontent-%COMP%]{font-size:14px;color:#667085;margin:0;max-width:380px}.wfconn-list[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;flex:1}.wfconn-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e4e7ec;border-radius:10px;padding:16px 18px;transition:opacity .15s}.wfconn-card--deleting[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.wfconn-card__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.wfconn-card__info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wfconn-card__name[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828}.wfconn-card__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.wfconn-card__meta[_ngcontent-%COMP%]{margin-top:8px;font-size:12px;color:#98a2b3}.wfconn-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:500}.wfconn-badge--adapter[_ngcontent-%COMP%]{background:#f2f4f7;color:#344054}.wfconn-badge--active[_ngcontent-%COMP%]{background:#ecfdf3;color:#027a48}.wfconn-badge--inactive[_ngcontent-%COMP%]{background:#fff1f0;color:#b42318}.wfconn-badge--schema[_ngcontent-%COMP%]{background:#eff8ff;color:#175cd3}.wfconn-test-result[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:10px;padding:8px 10px;border-radius:6px;font-size:12px;font-weight:500}.wfconn-test-result--ok[_ngcontent-%COMP%]{background:#ecfdf3;color:#027a48}.wfconn-test-result--fail[_ngcontent-%COMP%]{background:#fff1f0;color:#b42318}.wfconn-test-result__tables[_ngcontent-%COMP%]{color:inherit;opacity:.7;font-weight:400;margin-left:4px}.wfconn-spinner[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid #e4e7ec;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_wfconn-spin .7s linear infinite}.wfconn-spinner--sm[_ngcontent-%COMP%]{width:12px;height:12px;border-width:1.5px}.wfconn-spinner--white[_ngcontent-%COMP%]{border-color:#ffffff4d;border-top-color:#fff}@keyframes _ngcontent-%COMP%_wfconn-spin{to{transform:rotate(360deg)}}.wfconn-form-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000040;z-index:200}.wfconn-form-panel[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;width:440px;max-width:95vw;background:#fff;border-left:1px solid #e4e7ec;display:flex;flex-direction:column;z-index:201;box-shadow:-4px 0 24px #00000014}.wfconn-form-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e4e7ec;flex-shrink:0}.wfconn-form-panel__title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:#101828}.wfconn-form-close[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:#667085;padding:4px;border-radius:4px;display:flex}.wfconn-form-close[_ngcontent-%COMP%]:hover{background:#f2f4f7;color:#344054}.wfconn-form-panel__body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px}.wfconn-form-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid #e4e7ec;flex-shrink:0}.wfconn-divider[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#98a2b3;text-transform:uppercase;letter-spacing:.06em;padding:4px 0 2px;border-bottom:1px solid #f2f4f7}.wfconn-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;flex:1}.wfconn-field--sm[_ngcontent-%COMP%]{max-width:100px}.wfconn-field-row[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start}.wfconn-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:#344054}.wfconn-label--opt[_ngcontent-%COMP%]{font-weight:400;color:#98a2b3}.wfconn-input[_ngcontent-%COMP%], .wfconn-select[_ngcontent-%COMP%]{height:36px;padding:0 10px;border:1px solid #d0d5dd;border-radius:6px;font-size:13px;color:#101828;background:#fff;width:100%;box-sizing:border-box;outline:none;transition:border-color .15s}.wfconn-input[_ngcontent-%COMP%]:focus, .wfconn-select[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1a}.wfconn-input[_ngcontent-%COMP%]::placeholder, .wfconn-select[_ngcontent-%COMP%]::placeholder{color:#b0b7c3}.wfconn-select[_ngcontent-%COMP%]{cursor:pointer}.wfconn-input-wrap[_ngcontent-%COMP%]{position:relative;display:flex}.wfconn-input-wrap[_ngcontent-%COMP%] .wfconn-input[_ngcontent-%COMP%]{padding-right:36px}.wfconn-input-toggle[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:#98a2b3;padding:0;display:flex}.wfconn-input-toggle[_ngcontent-%COMP%]:hover{color:#344054}.wfconn-form-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px;background:#fff1f0;border-radius:6px;color:#b42318;font-size:12px}"]})};function Xr(i,t){i&1&&h(0,"app-ask-aquera-connections-page")}function Jr(i,t){i&1&&h(0,"app-ask-aquera-page")}function Zr(i,t){if(i&1&&f(0,Xr,1,0,"app-ask-aquera-connections-page")(1,Jr,1,0,"app-ask-aquera-page"),i&2){let e,n=r();C(((e=n.config())==null||e.initial==null?null:e.initial.view)==="connections"?0:1)}}var Ye=class i{config=Pt(void 0);ready=Se({alias:"aq-ready"});error=Se({alias:"aq-error"});unauthorized=Se({alias:"aq-unauthorized"});host=$(xt);stopAdopting=null;stopUi=null;tokenTimer=null;configured=!1;constructor(){Ae(()=>{let t=this.config();t&&this.apply(t)}),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=mt(t))})}async apply(t){let e=t.auth;if(tt({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,adminApiUrl:t.api.adminApiUrl,utilitiesUrl:t.api.utilitiesUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,routing:t.routing,initial:{dashboardId:t.initial?.dashboardId??null,conversationId:t.initial?.conversationId??null}}),this.stopUi?.(),this.stopUi=ht(this.host.nativeElement,t.ui),Lt(t.api.baseUrl),Bt({productId:t.tenant.productId,name:t.tenant.productName}),$t(()=>this.unauthorized.emit()),await Ue(),e.mode==="callback"&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{Ue()},6e4)),!this.configured){this.configured=!0;let n=E();this.ready.emit({customerId:n.customerId??"",productId:n.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopUi?.(),this.tokenTimer&&clearInterval(this.tokenTimer)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=de({type:i,selectors:[["dvz-ask-root"]],inputs:{config:[1,"config"]},outputs:{ready:"aq-ready",error:"aq-error",unauthorized:"aq-unauthorized"},decls:1,vars:1,template:function(e,n){e&1&&f(0,Zr,2,1),e&2&&C(n.config()?0:-1)},dependencies:[ve,ye],styles:[`:host{display:block;height:100%}
13
- `],encapsulation:3,changeDetection:0})};qt();var es="dvz-ask";function ts(i={}){return Ot(Ye,es,[Ct(),Rt([]),Nt(),Ft(Tt([Ut])),{provide:Wt,useFactory:()=>E().baseUrl},{provide:un,useValue:"workforce/dashboards"},Fe(se)],i)}ts();export{es as a,ts as b};