@arcgis/ai-components 5.2.0-next.12 → 5.2.0-next.13

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.
Files changed (73) hide show
  1. package/dist/agent-utils/LLMAgent.js +1 -0
  2. package/dist/cdn/{EBISDZ5H.js → 4UDYY3HL.js} +1 -1
  3. package/dist/cdn/{ERL2CB2Y.js → 55R6J3FL.js} +5 -5
  4. package/dist/cdn/ADYIXCSG.js +2 -0
  5. package/dist/cdn/CAECQD75.js +2 -0
  6. package/dist/cdn/{34SG44C3.js → CE6VDP2D.js} +1 -1
  7. package/dist/cdn/{T43LEBBE.js → CFVVQXPJ.js} +18 -18
  8. package/dist/cdn/CI3QSFPS.js +2 -0
  9. package/dist/cdn/DEAYZ3MK.js +2 -0
  10. package/dist/cdn/{Z2G7MP5L.js → DSVMXDPZ.js} +1 -1
  11. package/dist/cdn/{YLN2BZ5J.js → E2HENO3T.js} +1 -1
  12. package/dist/cdn/{JLKGS6Y5.js → ET453NAD.js} +1 -1
  13. package/dist/cdn/FWU6DFIB.js +2 -0
  14. package/dist/cdn/GPYYAQVI.js +2 -0
  15. package/dist/cdn/JN744CAW.js +2 -0
  16. package/dist/cdn/K475UT3E.js +2 -0
  17. package/dist/cdn/KWTJAVWV.js +2 -0
  18. package/dist/cdn/{5CV7R5IS.js → LREQ3XAW.js} +1 -1
  19. package/dist/cdn/M3SWPT3M.js +2 -0
  20. package/dist/cdn/MAV3DW27.js +4 -0
  21. package/dist/cdn/MRLTR3UO.js +16 -0
  22. package/dist/cdn/PB2ODJC7.js +2 -0
  23. package/dist/cdn/{QCSN44H4.js → QSA4T3BU.js} +1 -1
  24. package/dist/cdn/RMLXVQZ5.js +2 -0
  25. package/dist/cdn/SBHLUL3Q.js +2 -0
  26. package/dist/cdn/{R56X6ZKR.js → SRSFESAD.js} +1 -1
  27. package/dist/cdn/SWBER53G.js +3 -0
  28. package/dist/cdn/WH6QQK6N.js +2 -0
  29. package/dist/cdn/XBW4MWQR.js +2 -0
  30. package/dist/cdn/Z7UWJ4AI.js +3 -0
  31. package/dist/cdn/ZOSUDIJH.js +2 -0
  32. package/dist/cdn/ZPLFFLPF.js +2 -0
  33. package/dist/cdn/agent-utils/index.js +1 -1
  34. package/dist/cdn/index.js +1 -1
  35. package/dist/chunks/adapter.js +169 -168
  36. package/dist/chunks/arcgisKnowledgeGraph.js +3 -2
  37. package/dist/chunks/dataExplorationGraph.js +3 -2
  38. package/dist/chunks/generateLayerDescriptions.js +180 -178
  39. package/dist/chunks/helpGraph.js +3 -2
  40. package/dist/chunks/layerStylingGraph.js +1 -0
  41. package/dist/chunks/navigationGraph.js +3 -2
  42. package/dist/chunks/orchestrator.js +49 -48
  43. package/dist/chunks/toolCallResponse.js +10 -9
  44. package/dist/components/arcgis-assistant/customElement.js +54 -48
  45. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +3 -2
  46. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
  47. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +4 -3
  48. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
  49. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
  50. package/dist/docs/api.json +1 -1
  51. package/dist/docs/docs.json +1 -1
  52. package/dist/docs/web-types.json +1 -1
  53. package/package.json +4 -4
  54. package/dist/cdn/24QNMEFG.js +0 -2
  55. package/dist/cdn/3NBDVZ2I.js +0 -2
  56. package/dist/cdn/53NTYC4I.js +0 -2
  57. package/dist/cdn/AZGGTNA3.js +0 -2
  58. package/dist/cdn/B7WJFBOZ.js +0 -2
  59. package/dist/cdn/DZ2QWNUA.js +0 -3
  60. package/dist/cdn/F6QHMKF5.js +0 -2
  61. package/dist/cdn/H2CHHGGH.js +0 -2
  62. package/dist/cdn/HWKDNS4K.js +0 -4
  63. package/dist/cdn/IMQ4TVHF.js +0 -16
  64. package/dist/cdn/IRZDTYO2.js +0 -2
  65. package/dist/cdn/KHXUWZHB.js +0 -2
  66. package/dist/cdn/LIFK3QSD.js +0 -2
  67. package/dist/cdn/O3EN27N5.js +0 -2
  68. package/dist/cdn/PBO6FZN6.js +0 -2
  69. package/dist/cdn/Q3ZW4FYA.js +0 -3
  70. package/dist/cdn/UPEEHMSY.js +0 -2
  71. package/dist/cdn/WAIFKDR3.js +0 -2
  72. package/dist/cdn/XON27U6U.js +0 -2
  73. package/dist/cdn/YUKR4AZW.js +0 -2
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{b as e,c as i}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as s,z as a}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var t=class extends s{static{this.properties={agent:0,context:0}}async getContext(){return e(this.context)?await this.context():this.context}load(){i(this)}};a("arcgis-assistant-agent",t);export{t as ArcgisAssistantAgent};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as l}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{g as a,h as e,k as o,t as i,u as n,v as r,z as c}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([{watch:d}])=>{var g=a`.container{display:flex;align-items:center;width:100%;justify-content:space-between;gap:var(--calcite-spacing-xs)}.start,.end{display:flex;align-items:center;gap:var(--calcite-spacing-xs)}`,t=class extends r{constructor(){super(...arguments),this._messages=l({blocking:!0}),this._endRef=i(),this._showLog=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1}static{this.properties={_showLog:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,message:0}}static{this.styles=g}loaded(){this.manager.onLifecycle(()=>[d(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_renderCopyButton(){return!this.message?.error&&this.copyEnabled?e`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{let s=this.message?.content?.trim();s&&await navigator.clipboard.writeText(s)}catch(s){o("warn","assistant-message-footer","Failed to copy text to clipboard",{once:!0,detail:{error:s}})}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this.message?.log?.length&&this.logEnabled?e`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderReadAloudButton(){return e`<arcgis-assistant-message-read-aloud .message=${this.message} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-read-aloud>`}_renderLog(){return e`<arcgis-assistant-message-log .log=${this.message?.log} .showLog=${this._showLog} .logEnabled=${this.logEnabled}></arcgis-assistant-message-log>`}_renderFeedback(){return e`<arcgis-assistant-message-feedback .message=${this.message} .feedbackEnabled=${this.feedbackEnabled}></arcgis-assistant-message-feedback>`}render(){return e`${this._renderLog()}<div class="container"><div class="start">${this._renderCopyButton()}${this._renderLogButton()}${this._renderReadAloudButton()}<slot name=footer-actions-start></slot></div><div class="end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div><div ${n(this._endRef)}></div>`}};c("arcgis-assistant-message-footer",t);return t},"core/reactiveUtils")
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./HWKDNS4K.js";import{a as p}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as h,b as l,ta as f}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
2
+ import b from"./SRSFESAD.js";import a from"./CFVVQXPJ.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as p}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as h,b as l,ta as f}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
3
3
  Fields: ${r}${i}`}).join(`
4
4
 
5
5
  `);return`This map contains ${e.size} layer(s):
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as r}from"./QCSN44H4.js";import{A as o}from"./HWKDNS4K.js";var s=r(o);export{s as a};
2
+ import{b as r}from"./QSA4T3BU.js";import{A as o}from"./MAV3DW27.js";var s=r(o);export{s as a};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as L,c as R}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as E,z as $}from"./HWKDNS4K.js";import{a as d}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as N,b as T,ta as b}from"./DHKUXLU3.js";import"./CHPQM77M.js";import{a as f}from"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{k:C,l:F},{a:_,b:v,c:x,d:I,e:A,f:M,g:Z,h:q,i:j,j:V,k:O,l:z,m:S,n:G,o:h,p:B}])=>{var w=[I,A,M,Z,q,j,V,O,z];async function H(e,t){let a=await S("navigation_tool_prompt"),{mapView:n}=x(t),l=n.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],s=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,W)=>`${W+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
2
+ import c from"./SRSFESAD.js";import a from"./CFVVQXPJ.js";import{a as L,c as R}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as E,z as $}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as d}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as N,b as T,ta as b}from"./DHKUXLU3.js";import"./CHPQM77M.js";import{a as f}from"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{k:C,l:F},{a:_,b:v,c:x,d:I,e:A,f:M,g:Z,h:q,i:j,j:V,k:O,l:z,m:S,n:G,o:h,p:B}])=>{var w=[I,A,M,Z,q,j,V,O,z];async function H(e,t){let a=await S("navigation_tool_prompt"),{mapView:n}=x(t),l=n.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],s=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,W)=>`${W+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
3
3
  `):"",c=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",r=e.intent==="goToBookmark"&&l.length?`Available bookmarks:
4
4
  ${l.map(p=>`- ${p}`).join(`
5
5
  `)}`:"",o=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as o}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{g as a,h as e,n as i,v as c,z as n}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var r=a`.actions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs)}`,t=class extends c{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.feedbackEnabled=!1,this.arcgisFeedback=i()}static{this.properties={feedbackEnabled:5,message:0}}static{this.styles=r}_handleFeedback(s){this.message&&(this.message.feedback=this.message.feedback?.positive===s?void 0:{positive:s},this.arcgisFeedback.emit(this.message),this.requestUpdate())}_getFeedback(){return this.message?.feedback?.positive}_renderThumbsUpButton(){return e`<calcite-action id=action-thumbs-up icon=thumbs-up scale=s .active=${this._getFeedback()===!0} @click=${()=>this._handleFeedback(!0)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-up overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsUpLabel}</span></calcite-tooltip>`}_renderThumbsDownButton(){return e`<calcite-action id=action-thumbs-down icon=thumbs-down scale=s .active=${this._getFeedback()===!1} @click=${()=>this._handleFeedback(!1)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-down overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsDownLabel}</span></calcite-tooltip>`}render(){return this.feedbackEnabled&&!this.message?.error?e`<div class="actions">${this._renderThumbsUpButton()}${this._renderThumbsDownButton()}</div>`:null}};n("arcgis-assistant-message-feedback",t);export{t as ArcgisAssistantMessageFeedback};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as i,h as t,v as n,z as o}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var p=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=p}_renderSuggestedPrompts(s){if(s.type!=="suggested-prompts")return null;let r=s.data?.prompts,a=Array.isArray(r)?r.filter(c=>typeof c=="string"):[];return a.length?t`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(s){switch(s.type){case"suggested-prompts":return this._renderSuggestedPrompts(s);case"text":return t`<arcgis-assistant-message-text .content=${s.data?.content}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as e,h as t,v as r,z as a}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var p=e`.interrupt-details ul{margin-block:var(--calcite-spacing-xxs) 0;padding-inline-start:var(--calcite-spacing-xxl)}.interrupt-details li{margin-block:0}.interrupts-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-lg)}`,s=class extends r{static{this.properties={interrupts:0}}static{this.styles=p}render(){return this.interrupts?.length?t`<calcite-block collapsible expanded heading="Assistant Questions"><div class="interrupts-container">${this.interrupts?.map(({interrupt:l,response:i})=>t`<div class="interrupt-details"><div>Q: ${l.message}</div><ul>${Array.isArray(i)?i.length?i.map(n=>t`<li>${n}</li>`):t`<li>(Question skipped)</li>`:t`<li>${i!=null?String(i):"(Question skipped)"}</li>`}</ul></div>`)}</div></calcite-block>`:null}};a("arcgis-assistant-interrupt-preview",s);export{s as ArcgisAssistantInterruptPreview};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as e,h as a,v as s,z as i}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var r=e`.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 15%,var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.avatar{display:flex;align-items:center;justify-content:center}@container (min-width: 480px){.container{max-width:80%}}`,t=class extends s{static{this.properties={content:1,user:1,message:0}}static{this.styles=r}_getContent(){return this.message?.role==="user"?this.message.content:this.content}render(){return a`<div class="container"><div><slot name=content>${this._getContent()}</slot></div><slot name=icon><div class="avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></slot></div>`}};i("arcgis-assistant-user-message",t);export{t as ArcgisAssistantUserMessage};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as u,b as S,c as v}from"./XOH56EQ2.js";import b from"./TR4GFL7X.js";import{b as f,c as y}from"./FUIGPHBH.js";import a from"./CFVVQXPJ.js";import"./ADYIXCSG.js";import"./P7DG5T3Z.js";import{c as d}from"./DXVU45KM.js";import{b as c}from"./BX7FSMUU.js";import{O as g,u as l}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,{watch:T},,,{property:m,subclass:_},{f:h},w])=>{var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,a=(e,s,t,r)=>{for(var o=r>1?void 0:r?x(s,t):s,n=e.length-1,p;n>=0;n--)(p=e[n])&&(o=(r?p(s,t,o):p(o))||o);return r&&o&&k(s,t,o),o},i=class extends w{constructor(e){super(e),this.modelTier="default"}initialize(){this.addHandles(T(()=>[this.description,this.inputSchema,this.modelTier,this.name,this.outputSchema,this.prompt,this.tools],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let e=f(this.getSchemas());this._set("workspace",e);let s=this.id,t={[s]:this._invoke.bind(this)},r=[{from:s,decide:()=>{}}];this._set("createGraph",()=>y(t,r,e,{agent:this,entryNode:s,middlewares:this.middlewares}))}async _invoke(e,s){try{return this.outputSchema?await this._invokeStructured(e,s):await this._invokeUnstructured(e,s)}catch(t){if(l(t))throw t;let r=t instanceof Error?t.message:String(t);return u({outputMessage:r},"failed",r)}}async _invokeStructured(e,s){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let t=await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares),responseFormat:this.outputSchema}).invoke({messages:e.agentExecutionContext.messages},s);if(!("structuredResponse"in t)||t.structuredResponse===void 0)throw new Error("LLMAgent did not receive structured output from createAgent.");return S(t.structuredResponse,this.outputSchema,t.messages)}async _invokeUnstructured(e,s){let t=(await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares)}).invoke({messages:e.agentExecutionContext.messages},s)).messages,r=t.at(-1)?.content??"",o=typeof r=="string"?r:JSON.stringify(r),n=o.trim()||"LLMAgent completed.";return u({agentExecutionContext:{...e.agentExecutionContext,messages:t},outputMessage:o},"success",n)}async _getPromptWithInputVariables(e){let s=v(e,this.inputSchema);for(let{outputKey:t}of this.middlewares)t&&(s[String(t)]=e[t]);return await g.fromTemplate(this.prompt).format(s)}_getTools(){return this.tools?.map(e=>e.getTool())??[]}};a([m()],i.prototype,"prompt",2);a([m()],i.prototype,"tools",2);a([m()],i.prototype,"inputSchema",2);a([m()],i.prototype,"outputSchema",2);a([m()],i.prototype,"modelTier",2);i=a([_("LLMAgent")],i);return i},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","core/accessorSupport/decorators",a,b)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{c as K,d as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as y,z as f}from"./HWKDNS4K.js";import{a as c,b}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as x,b as d,j as k,ta as _}from"./DHKUXLU3.js";import{Z as v}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{fetchKnowledgeGraph:B},{j:A,l:q},{K:u,L:C,M:G,N:T,O:N,P:R,Q:L,R:$,S:z,T:F,U:D,a:S,m:g,n:h,p:M}])=>{var I=[R,L,F,$,N,D,z];async function O(e,a){let r=await g("arcgis_knowledge_tool_prompt"),o=C(a),s={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},n=await q({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:s,tools:I}),i=(n.tool_calls?.length??0)>0,t=typeof n.text=="string"?n.text.trim():"",l=t.length>0,p=n.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function V(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,a){let r=new S(I,{handleToolErrors:!1});try{let o=await r.invoke({messages:e.arcgisKnowledgeMessages},a),s=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
2
+ import e from"./SRSFESAD.js";import a from"./CFVVQXPJ.js";import{c as K,d as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as y,z as f}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as c,b}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as x,b as d,j as k,ta as _}from"./DHKUXLU3.js";import{Z as v}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{fetchKnowledgeGraph:B},{j:A,l:q},{K:u,L:C,M:G,N:T,O:N,P:R,Q:L,R:$,S:z,T:F,U:D,a:S,m:g,n:h,p:M}])=>{var I=[R,L,F,$,N,D,z];async function O(e,a){let r=await g("arcgis_knowledge_tool_prompt"),o=C(a),s={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},n=await q({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:s,tools:I}),i=(n.tool_calls?.length??0)>0,t=typeof n.text=="string"?n.text.trim():"",l=t.length>0,p=n.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function V(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,a){let r=new S(I,{handleToolErrors:!1});try{let o=await r.invoke({messages:e.arcgisKnowledgeMessages},a),s=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
3
3
 
4
4
  Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);s.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${o.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let n=s.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=s[0];return i&&V(i)&&await b(J(i),a),{...e,outputMessage:n.join(`
5
5
  `),summary:n.length?h(n.join(`
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as y}from"./E2HENO3T.js";import"./QSA4T3BU.js";import{a as v}from"./NXKKG5TK.js";import{g as p,h as r,n as o,t as n,u as c,v as g,w as m,z as f}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([b])=>{var w=p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`,l=class extends g{constructor(){super(...arguments),this.#s=n(),this.#a=n(),this.#t=-1,this.#e="",this.#i=t=>{t.stopPropagation();let s=t.detail;this._setDraftValue(s.value),s.focusInput&&this.#s.value&&this.#s.value.setFocus()},this.#r=t=>{let s=t.target.value??"";this.inputValue=s,this.#e=s},this._messages=y({blocking:!0}),this._inFocus=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.inputValue="",this.voiceInputEnabled=!1,this.messages=new b([]),this.disabled=!1,this.arcgisCancel=o(),this.arcgisSubmit=o()}static{this.properties={_inFocus:16,_userMessages:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5}}static{this.styles=w}#s;#a;#t;#e;#i;#r;get _userMessages(){return this.messages.toArray().filter(t=>t.role==="user").map(({content:t})=>t)}async submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.inputValue.trim();t&&(this.arcgisSubmit.emit(t),this.inputValue="",this.#t=-1,this.#e="",this.#a.value?.clearDraftSession(),this.#s.value&&await this.#s.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#i),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#i)}}))}async _navigateHistory(t,s){let i=this.#s.value;if(!i)return;let e=this._userMessages;if(e.length===0)return;let u=i.value??"",h=i.shadowRoot?.querySelector("textarea"),a=h?.selectionStart,d=h?.selectionEnd;if(!(a==null||d==null)&&!(a!==d||t==="up"&&a!==0||t==="down"&&a!==u.length)){if(t==="up"){this.#t===-1?(this.#e=u,this.#t=e.length-1):this.#t=Math.max(0,this.#t-1),this.inputValue=e[this.#t]??"",s.preventDefault();return}this.#t!==-1&&(this.#t<e.length-1?(this.#t+=1,this.inputValue=e[this.#t]??""):(this.#t=-1,this.inputValue=this.#e),s.preventDefault())}}_setDraftValue(t){this.inputValue=t,this.#t=-1,this.#e=t}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}render(){return r`<div class="input-container"><calcite-text-area class=${m(v({focused:this._inFocus}))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async t=>{t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled||(t.key==="Enter"?(t.preventDefault(),await this.submitMessage()):t.key==="ArrowUp"?await this._navigateHistory("up",t):t.key==="ArrowDown"&&await this._navigateHistory("down",t))}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${c(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?r`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${c(this.#a)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`}};f("arcgis-assistant-chat-entry",l);return l},"core/Collection")
@@ -0,0 +1,4 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as Y}from"./ADYIXCSG.js";var X=globalThis,Z=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),It=new WeakMap,I=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=It.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&It.set(e,t))}return t}toString(){return this.cssText}},kt=o=>new I(typeof o=="string"?o:o+"",void 0,gt),be=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,r,i)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+o[i+1],o[0]);return new I(e,o,gt)},jt=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),r=X.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return kt(e)})(o):o;var{is:_e,defineProperty:Ae,getOwnPropertyDescriptor:Ce,getOwnPropertyNames:we,getOwnPropertySymbols:Oe,getPrototypeOf:Te}=Object,et=globalThis,Ht=et.trustedTypes,Se=Ht?Ht.emptyScript:"",Pe=et.reactiveElementPolyfillSupport,k=(o,t)=>o,tt={toAttribute(o,t){switch(t){case Boolean:o=o?Se:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},j=(o,t)=>!_e(o,t),Vt={attribute:!0,type:String,converter:tt,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),et.litPropertyMetadata??=new WeakMap;var _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Ae(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){let{get:r,set:i}=Ce(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let a=r?.call(this);i?.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Te(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...we(e),...Oe(e)];for(let r of s)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let r of s)e.unshift(vt(r))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:tt).toAttribute(e,s.type);this._$Em=t,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){let s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let i=s.getPropertyOptions(r),n=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:tt;this._$Em=r;let a=n.fromAttribute(e,i.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,s,r=!1,i){if(t!==void 0){let n=this.constructor;if(r===!1&&(i=this[t]),s??=n.getPropertyOptions(t),!((s.hasChanged??j)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),i!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[r,i]of s){let{wrapped:n}=i,a=this[r];n!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[k("elementProperties")]=new Map,_[k("finalized")]=new Map,Pe?.({ReactiveElement:_}),(et.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,zt=o=>o,st=$t.trustedTypes,Bt=st?st.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,_t="?"+A,Ne=`<${_t}>`,T=document,V=()=>T.createComment(""),z=o=>o===null||typeof o!="object"&&typeof o!="function",At=Array.isArray,Jt=o=>At(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
3
+ \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wt=/-->/g,Ft=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Qt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ds=Ct(1),ps=Ct(2),us=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!At(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Xt=(o,t)=>{let e=o.length-1,s=[],r,i=t===2?"<svg>":t===3?"<math>":"",n=H;for(let a=0;a<e;a++){let l=o[a],h,u,c=-1,m=0;for(;m<l.length&&(n.lastIndex=m,u=n.exec(l),u!==null);)m=n.lastIndex,n===H?u[1]==="!--"?n=Wt:u[1]!==void 0?n=Ft:u[2]!==void 0?(Qt.test(u[2])&&(r=RegExp("</"+u[2],"g")),n=w):u[3]!==void 0&&(n=w):n===w?u[0]===">"?(n=r??H,c=-1):u[1]===void 0?c=-2:(c=n.lastIndex-u[2].length,h=u[1],n=u[3]===void 0?w:u[3]==='"'?Gt:qt):n===Gt||n===qt?n=w:n===Wt||n===Ft?n=H:(n=w,r=void 0);let v=n===w&&o[a+1].startsWith("/>")?" ":"";i+=n===H?l+Ne:c>=0?(s.push(h),l.slice(0,c)+bt+l.slice(c)+A+v):l+A+(c===-2?a:v)}return[Yt(o,i+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,n=0,a=t.length-1,l=this.parts,[h,u]=Xt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=O.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let c of r.getAttributeNames())if(c.endsWith(bt)){let m=u[n++],v=r.getAttribute(c).split(A),C=/([.?@])?(.*)/.exec(m);l.push({type:1,index:i,name:C[2],strings:v,ctor:C[1]==="."?rt:C[1]==="?"?it:C[1]==="@"?nt:P}),r.removeAttribute(c)}else c.startsWith(A)&&(l.push({type:6,index:i}),r.removeAttribute(c));if(Qt.test(r.tagName)){let c=r.textContent.split(A),m=c.length-1;if(m>0){r.textContent=st?st.emptyScript:"";for(let v=0;v<m;v++)r.append(c[v],V()),O.nextNode(),l.push({type:2,index:++i});r.append(c[m],V())}}}else if(r.nodeType===8)if(r.data===_t)l.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(A,c+1))!==-1;)l.push({type:7,index:i}),c+=A.length-1}i++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,i=z(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(o),r._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=S(o,r._$AS(o,t.values),r,s)),t}var ot=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);O.currentNode=r;let i=O.nextNode(),n=0,a=0,l=s[0];for(;l!==void 0;){if(n===l.index){let h;l.type===2?h=new L(i,i.nextSibling,this,t):l.type===1?h=new l.ctor(i,l.name,l.strings,this,t):l.type===6&&(h=new at(i,this,t)),this._$AV.push(h),l=s[++a]}n!==l?.index&&(i=O.nextNode(),n++)}return O.currentNode=T,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),z(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Jt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let i=new ot(r,this),n=i.u(this.options);i.p(e),this.T(n),this._$AH=i}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){At(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let i of t)r===e.length?e.push(s=new o(this.O(V()),this.O(V()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=zt(t).nextSibling;zt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){let i=this.strings,n=!1;if(i===void 0)t=S(this,t,e,0),n=!z(t)||t!==this._$AH&&t!==f,n&&(this._$AH=t);else{let a=t,l,h;for(t=i[0],l=0;l<i.length-1;l++)h=S(this,a[s+l],e,l),h===f&&(h=this._$AH[l]),n||=!z(h)||h!==this._$AH[l],h===d?t=d:t!==d&&(t+=(h??"")+i[l+1]),this._$AH[l]=h}n&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},rt=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},it=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},nt=class extends P{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},at=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Zt={M:bt,P:A,A:_t,C:1,L:Xt,R:ot,D:Jt,V:S,I:L,H:P,N:it,U:nt,B:rt,F:at},De=$t.litHtmlPolyfillSupport;De?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let i=e?.renderBefore??null;s._$litPart$=r=new L(t.insertBefore(V(),i),i,void 0,e??{})}return r._$AI(o),r};var Ot=globalThis,E=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var xe=Ot.litElementPolyfillSupport;xe?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Os=(o,t,e,s)=>{let r=se(t);if(s?.once){let n=`${o}${r}${e}`;if(te.has(n))return;te.add(n)}let i;if(s?.detail){i={};for(let[n,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let l=new WeakRef(a);Object.defineProperty(i,n,{enumerable:!0,get(){return l.deref()}})}else i[n]=a;ee?.log.interceptors?.forEach(n=>n(o,r,e,i)),console[o](`[${r}]: ${e}`,i)}else ee?.log.interceptors?.forEach(n=>n(o,r,e)),console[o](`[${r}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),Le=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ps=o=>typeof o?.then=="function";var F,D=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],re=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},ie=()=>N,U,Ns=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Ue=()=>{let o=U;return U=void 0,o},ne=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(r=>t(r,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(Le(o))return o;let s=Ue();if(s!==void 0)return s},lt=!1,Ds=o=>{lt=!0;try{return o()}finally{lt=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};var le=(o,t)=>{let e=t>Re?Me:t/Ie,s=0,r=setInterval(()=>{s+=e,s>=t&&(clearInterval(r),o())},e);return r},Re=4e3,Me=2e3,Ie=4;var ke=(o,t,e)=>{let s=Object.keys(o),r=s.length;R===void 0&&queueMicrotask(M),R??=new Map;let i=R.get(o);return i===void 0&&(i={callbacks:[],keyCount:r},R.set(o,i)),i.keyCount!==r&&(i.callbacks.forEach(n=>n(s)),i.callbacks=[],i.keyCount=r),i.callbacks.push(n=>{let a=h=>p(t,null,h),l=n[r];l===void 0?a(void 0):o[l]===e?a(l):a(void 0)}),e},R,M=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},je=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((r,i)=>p(t,void 0,e===i?r:void 0)),e},He=(o=[G(),...ie()],t,e)=>{let s=Array.isArray(o)?o:[o],r=s.length+1,i=n=>{r-=1,n!==void 0&&(r=Math.min(r,0)),r===0&&t(n)};s.forEach(n=>ke(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!1}),e));for(let n of s)if("manager"in n&&n.manager.component===n){je(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!0}),e);break}return e},Ve=(o="",t={},e=G())=>{let s={emit:r=>{o===""&&M();let i=new CustomEvent(o,{detail:r,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(i),i}};return o===""&&He(void 0,r=>o=r.key,s),s},ze=Ve.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#r=[],this.#i=[],this.#l=[],this.#c=[],this.#d=[],this.#n=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(re(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#r;#i;#l;#c;#d;#n;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return D(this.#o),ne}get useRef(){return D(this.#o),ae}get useRefSync(){return D(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#r.push(t)}onUpdate(t){this.#i.push(t)}onUpdated(t){this.#l.push(t)}onDestroy(t){this.#c.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#n.forEach(p),t.#n=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#r.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#i.forEach(ce,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#l.forEach(ce,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#c.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){D(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(r=>{typeof r=="function"?this.#n.push(r):typeof r=="object"&&typeof r.remove=="function"&&this.#n.push(r.remove)})}};function ce(o){p(o,void 0,this)}var he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,r,i){if(!((r==="exports"||r==="_exports")&&r in s&&s[r]===e)&&(r in s||r in Promise.prototype||typeof r=="symbol"))return typeof s=="function"?s[r]:Reflect.get(s,r,i)}},e=new Proxy(o,t);return e};var pe=Tt;var{I:zs}=Zt;var ht=o=>o.strings===void 0;var Be={},ue=(o,t=Be)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},dt=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),qe(t)}};function We(o){this._$AN!==void 0?(dt(this),this._$AM=o,fe(this)):this._$AM=o}function Fe(o,t=!1,e=0){let s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let i=e;i<s.length;i++)K(s[i],!1),dt(s[i]);else s!=null&&(K(s,!1),dt(s));else K(this,o)}var qe=o=>{o.type==y.CHILD&&(o._$AP??=Fe,o._$AQ??=We)},pt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),dt(this))}setValue(t){if(ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends pt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var xt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Ke=(o,t)=>function(s,r){if(!globalThis.customElements)return;let n=(r??s??{}).resourcesUrl;n&&o.setAssetPath(n);for(let[a,[l,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[c,m,v]=h.split(";"),C=c?c?.split(",").map(Je):void 0,yt=C?.map(([x])=>x),Q=class extends Dt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,x])=>x).filter(x=>x!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!Q.B&&(Q.B=l(),Q.F()),super()}};customElements.define(a,Q)}},ut=Object.defineProperty,Je=o=>{let t=o.split(":");return t.length===1?[t[0],Y(t[0])]:t},Qe=globalThis.HTMLElement??Ut,Dt=class extends Qe{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#r({a:e.A}):e.B.then(async s=>{await e.K.p,t.#r(await(s.default?.then(r=>typeof r=="function"?{a:r}:r)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=xt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#r(t){let e=this.constructor,s=e.L,r=this.#e,i=Object.values(t).find(c=>c.L===s),n=`${s}--lazy`,a=i;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Xe(a),!e.A&&(e.A=i,customElements.define(n,i)),i.N=this;let h=document.createElement(n);i.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(c=>h.attributeChangedCallback(c,null,this.getAttribute(c))),Object.entries(r).forEach(Ye,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ye([o,t]){this[o]=t}var Xe=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(r,i){e.setAttribute.call(this.el,r,i)},t.removeAttribute=function(r){e.removeAttribute.call(this.el,r)},t.hasAttribute=function(r){return e.hasAttribute.call(this.el,r)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),M();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),D(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=le(t,Ze)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(r=>r(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Ze=1e3,mt="autoDestroyDisabled";var ye=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ge="important",ts=" !"+ge,es=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let r=t[s];if(r!=null){this.ft.add(s);let i=typeof r=="string"&&r.endsWith(ts);s.includes("-")||i?e.setProperty(s,i?r.slice(0,-11):r,i?ge:""):e[s]=r}}return f}});var ss=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ht(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ve=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,r=e.K.o,i=o.prototype.shouldUpdate;t.#r=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==i&&(t.#e=t.shouldUpdate,t.shouldUpdate=i),r&&(t.#t=new Map,e.elementProperties.forEach((n,a)=>t.#t.set(a,r()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0,i=r?.hasChanged??j,n={attribute:s&1&&typeof t=="string"?Y(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),useDefault:!!(s&128),c:!1,...r,hasChanged(a,l){let h=i(a,l);return n.c=h,h}};super.createProperty(t,n)}static getPropertyDescriptor(t,e,s){let r=this.K,i=super.getPropertyDescriptor(t,e,s);return s.d=i,{...i,get(){return r.t?.(this.#t.get(t)),i.get?.call(this)},set(n){let a=this.manager;if(s.readOnly&&!lt&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${n}"`);i.set.call(this,n??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(M(),a?.S(t,n))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#r;#i;#l;get elementInternals(){return this.#l??=this.el.attachInternals(),this.#l}connectedCallback(){this.hasAttribute("defer-hydration")||this.#c(!0)}#c(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#i=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#n().catch(r=>{this.#r.reject(r),setTimeout(()=>{throw r})})):e&&this.requestUpdate()}#d(t){try{this.#i.clear(),this.constructor.K.r(this.#i,()=>super.update(t))}catch(e){throw this.#i.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#i?.destroy(),this.#i=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,i=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#c(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let n=i.getRootNode();n.adoptedStyleSheets=[...n.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return i}async#n(){let t=this.el.G??xt(this.el);t&&await t;let e=[];for(let r of this.M)"triggerLoad"in r?e.push(r.triggerLoad()):e.push(W(r.hostLoad,r));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(r=>r.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(r=>!r.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async r=>await r.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let r of this.M)"triggerLoaded"in r?r.triggerLoaded():p(r.hostLoaded,r);this.loaded?.(),this.#r.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#i?this.#d(t):super.update(t)}listen(t,e,s){let r=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,r,s),()=>this.el.removeEventListener(t,r,s)))}listenOn(t,e,s,r){let i=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,i,r),()=>t.removeEventListener(e,i,r)))}async componentOnReady(){return await this.#r.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var $e=o=>{let t,e=r=>{t=new URL(r,globalThis.location?.href||void 0).href},s={...o,getAssetPath(r){let i=new URL(r,t);return i.origin!==globalThis.location?.origin?i.href:i.pathname},setAssetPath:e,customElement(r,i){i.K=s,i.L=r,customElements.get(r)||customElements.define(r,i)}};return e(o.defaultAssetPath),s};var $r=o=>typeof o=="object"&&o!=null?ye(o):o;var Mt=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(r){return e.#t.call(this,r)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},br=$(Mt);var _r=d;var J=$e({defaultAssetPath:"https://jsdev.arcgis.com/5.2.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Tr,getAssetPath:Sr,setAssetPath:Pr}=J;J.t=void 0;J.o=void 0;J.c=void 0;J.r=void 0;export{Ps as a,D as b,re as c,ie as d,Ns as e,Ds as f,be as g,ds as h,f as i,d as j,Os as k,oe as l,He as m,ze as n,Tt as o,Ke as p,y as q,$ as r,g as s,Xs as t,Nt as u,ve as v,$r as w,_r as x,J as y,Tr as z,Sr as A};
@@ -0,0 +1,16 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import c from"./4UDYY3HL.js";import b from"./SRSFESAD.js";import a from"./CFVVQXPJ.js";import{a as D,c as O}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as $,z as A}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as l}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as N,b as E,ta as k}from"./DHKUXLU3.js";import{Z as V}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,K,X,,,{j:z,l:T},{C:R,D:G,E:L,F:P,G:F,H:U,a:j,m:S,n:M,o:f,p:Q},C])=>{var Y=async(e,t)=>(await l({text:"Exiting Data Exploration agent"},t),e),Z=async(e,t)=>{await l({text:"Requesting LLM for layer filter results"},t);let a=await S("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:s,tools:F}),r=[...e.dataExplorationMessages,i];if(!((i.tool_calls?.length??0)>0))return await l({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:r};let u=r,n=i.content.toString();return await C(i,t),{...e,dataExplorationMessages:u,outputMessage:n}},ee=async(e,t)=>{await l({text:"Requesting LLM for layer query results"},t);let a=await S("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s=e.agentExecutionContext.sharedState.lastNavigatedFeatures,i=s&&typeof s=="object"&&"value"in s?s.value:s,r="none";if(i!=null)try{r=JSON.stringify(i)}catch{r="none"}let u={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,lastNavigatedFeatures:r},n=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:u,tools:P}),m=(n.tool_calls?.length??0)>0,g=n.content.toString();return await C(n,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,n],...m?{}:{outputMessage:g},status:"success",summary:g&&!m?M(g):"Query planning completed."}},te=async(e,t)=>{try{await l({text:"Requesting LLM for summary on query results"},t);let a=await S("summarize_query_response_prompt"),d={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await z({promptText:a,modelTier:"fast",config:t,messages:e.dataExplorationMessages,inputVariables:d}),s=typeof o=="string"?o:o.content,i=new V(s);await l({text:`Received response from LLM: ${s}`},t);let r=s;return{...e,outputMessage:r,status:"success",summary:r?M(r):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,i]}}catch(a){throw await l({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${a instanceof Error?a.message:String(a)}`)}};async function ae(e,t){if((e.queryResponse??[]).some(d=>{let o=d.details;return typeof o=="object"&&o!==null&&"error"in o}))return await l({text:"Skipping layer filter tool because query response contains an error."},t),{...e};let a=await new j(F,{handleToolErrors:!1}).invoke({messages:e.dataExplorationMessages},t);return await l({text:`Finished executing layer filter tool: ${a.messages.map(d=>d.content).join(", ")}`},t),{...e}}var se=10,re=["string","small-integer","integer"],ie=async(e,t,{includeSummaryStatistics:a=!0,includeUniqueValues:d=!0}={})=>{let o=null,s=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){a&&(o=await K({layer:e,field:t.name}));let i=t.domain?.type==="coded-value"?t.domain:null;d&&(re.includes(t.type)||i)&&(s=(await X({layer:e,field:t.name})).uniqueValueInfos.sort((r,u)=>u.count-r.count).slice(0,se),i&&(s=s.map(r=>({...r,value:i.getName(r.value)??r.value}))))}}catch(i){console.error(`Error fetching statistics for field ${t.name}:`,i)}return{summaryStatistics:o,uniqueValues:s}};function oe(e,t){return["string","small-integer","integer"].includes(e)||t==="coded-value"}async function ne(e,t,a,d=!0){let o=[],s=[],i=[];for(let r of e){let u=function(p){let c=t.get(p)?.layerItem;return c?[c.name&&`Name: ${c.name}`,c.title&&`Title: ${c.title}`,c.description&&`Description: ${c.description}`].filter(Boolean).join(" | "):p},{layerId:n,results:m}=r,g=a.map?.allLayers.find(p=>p.id===n),w=t.get(n)?.fieldRegistry;if(!w)continue;let h=o.find(p=>p.layerId===n);h||(h={layerId:n,layerSummary:u(n),fieldInfos:[]},o.push(h));for(let p of m){let c=w.get(p.name);if(!c)continue;let y=c.statistics,v=d&&!y?.summaryStatistics,q=oe(c.type,c.domain?.type)&&!y?.uniqueValues,b=v||q;if(i.push({layerId:n,fieldName:c.name,didFetchStatistics:b}),b){let J=ie(g,c,{includeSummaryStatistics:v,includeUniqueValues:q}).then(I=>{let x={summaryStatistics:y?.summaryStatistics??null,uniqueValues:y?.uniqueValues??null};v&&(x.summaryStatistics=I.summaryStatistics),q&&(x.uniqueValues=I.uniqueValues),w.set(c.name,{...c,statistics:x}),c.statistics=x});s.push(J)}h.fieldInfos.push(c)}}return await Promise.all(s),{layerFieldInfo:o,didFetchStatistics:s.length>0,fieldStatisticsFetchStatus:i}}var W=/\b(average|avg|mean|median|max(?:imum)?|min(?:imum)?|sum|total|count|std(?:dev|\s*deviation)|variance|null\s*count|missing\s*values?|range)\b/iu;function le(e,t){return W.test(e)||W.test(t)}var de=async(e,t)=>{try{await l({text:"Preparing field information for vector search results"},t);let a=f(t,"layersAndFieldsRegistry"),{mapView:d}=G(t),{assignedTask:o,userRequest:s}=e.agentExecutionContext,i=le(o,s),{layerFieldInfo:r,didFetchStatistics:u,fieldStatisticsFetchStatus:n}=await ne(e.vectorSearchFieldResults,a,d,i);u?await l({text:"Statistics fetched"},t):await l({text:"Statistics skipped"},t);for(let m of n)await l({text:` - ${m.fieldName} - stats ${m.didFetchStatistics?"fetched":"skipped"}`},t);return await l({text:"Field information prepared"},t),{...e,layerFieldInfo:r}}catch(a){throw await l({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${a instanceof Error?a.message:String(a)}`)}},B=.7,ce=10,ue=async(e,t)=>{try{await l({text:"Similarity search to find fields"},t);let a=f(t,"fieldSearch"),d=f(t,"layersAndFieldsRegistry"),o=f(t,"embeddingCache"),s=await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:B,topResults:ce,embeddingCache:o}),i=s.map(({layerId:u,results:n})=>{let m=n.map(g=>` - ${g.name} (${g.score.toFixed(2)})`).join(`
3
+ `);return`${d.get(u)?.layerItem.name??u}:
4
+ ${m}`}).join(`
5
+ `),r;return s.length>0?r=`Vector search completed. Matching layers and fields with scores:
6
+ ${i}`:r=`No vector search results found for score over ${B}.`,await l({text:r},t),{...e,vectorSearchFieldResults:s}}catch(a){throw await l({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},me=.7,ge=async(e,t)=>{try{await l({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let a=f(t,"layerSearch"),d=f(t,"layersAndFieldsRegistry"),o=f(t,"embeddingCache"),s=await a.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:me,embeddingCache:o}),i=s.map(n=>n.id),r=s.map(({id:n,score:m})=>`${d.get(n)?.layerItem.name??n} (${m.toFixed(2)})`).join(`
7
+ `),u;return i.length>0?u=`Vector search completed. Matching layers with scores:
8
+ ${r}`:u="Vector search completed. No matching layers found.",await l({text:u},t),{...e,vectorSearchLayerIds:i}}catch(a){throw await l({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},pe=(e,t)=>Q(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Data Exploration Agent")(e,t),fe=()=>new k(R).addNode("requireDataExplorationServices",pe).addNode("vectorSearchLayers",ge).addNode("vectorSearchFields",ue).addNode("fieldStatistics",de).addNode("queryAgent",ee).addNode("queryTools",U).addNode("summarizeQueryResponseLLM",te).addNode("filterAgent",Z).addNode("filterTools",ae).addNode("earlyExit",Y).addEdge(N,"requireDataExplorationServices").addEdge("requireDataExplorationServices","vectorSearchLayers").addConditionalEdges("vectorSearchLayers",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"fieldStatistics":"earlyExit").addEdge("fieldStatistics","queryAgent").addConditionalEdges("queryAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"queryTools":"filterAgent").addConditionalEdges("queryTools",e=>e.queryResponse.length?"summarizeQueryResponseLLM":"filterAgent").addEdge("summarizeQueryResponseLLM","filterAgent").addConditionalEdges("filterAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"filterTools":E).addEdge("filterTools",E).addEdge("earlyExit",E),he=String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
9
+ The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
10
+ _Example: “Only show stations where Brand is Shell”_
11
+ _Example: “Make Shell stations stand out on the map”_
12
+ _Example: “Gray out all stations that aren’t Shell”_
13
+ This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
14
+ _Example: “How many features are there?”_
15
+ _Example: “What’s the average population?”_
16
+ _Example: “Which values are in the status field?”_`,H={id:"dataExploration",name:"Data Exploration Agent",description:he,createGraph:fe,workspace:R};var _=class extends ${constructor(){super(...arguments),this.agent=H}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=D(this,"arcgis-assistant-data-exploration-agent"),O(this)}};A("arcgis-assistant-data-exploration-agent",_);return _},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","views/LinkChartView","rest/knowledgeGraphService",a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as t,h as e,t as i,u as a,v as o,z as r}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([l,{watch:n}])=>{var c=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`,s=class extends o{constructor(){super(...arguments),this.#s=i(),this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=c}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this._scrollToEnd()}),n(()=>[this.loading,this.interrupt],()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return e`<div class="messages-container"><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div ${a(this.#s)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as A,d as N}from"./NXKKG5TK.js";import{a as x,b as C,c as f,d as m,e as P,f as L,k as g,m as v,n as O,o as w}from"./HWKDNS4K.js";var $=t=>(...s)=>{let e=m(),o=new t(...s),r=o.exports;f(e.at(-1));let n=o.component.manager;n.W(o,r),o.watchExports(n.W.bind(n,o)),P(o);let a=[o.component,...e].reverse();return v(a,i=>i===void 0?void 0:T(o,i,r),r)},T=(t,{host:s,key:e,isReactive:o},r)=>{let n=s,a=n[e]!==t.exports,i=n[e]!==r,l=r!==t.exports;if(a&&!i&&l&&(n[e]=t.exports),s===t.component){if(o){let p=t.component.manager;i&&p.W(t,n[e]),t.onUpdate(u=>{if(u.has(e)){let y=n[e];y!==t.exports&&p.W(t,y)}})}t.O=o?void 0:e}let c=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(c?L(()=>{n[e]=t.exports}):n[e]=t.exports)})};var U="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),F=new Set(U),h="en",W={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},K=async(t,s,e="")=>{let o=`${s}/${e}`,r=`${o}${t}.json`;return _[r]??=j(t,o),await _[r]},_={},j=async(t,s)=>{let e=`${s}${t}.json`;try{let o=await fetch(e);if(o.ok)return await o.json()}catch(o){return g("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:o}}),{}}return t===h?{}:await j(h,s)},b=t=>{let s=N(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:D(s)}},D=t=>{let[s,e]=t.split("-"),o=s.toLowerCase(),r=o;return e&&(r=`${o}-${e.toUpperCase()}`),r=W[r]??r,F.has(r)?r:e?D(o):h},V=(t,s,e,o)=>{let r,n=()=>q(t,s(),o).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&e(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),A(t,["lang"],n)},q=async(t,s,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:r}=b(t),n=`${s}/${e}/t9n`,i=e===null?{}:await K(r,n,"messages.");return{lang:o,t9nLocale:r,t9nStrings:i}};var z=t=>R(void 0,t);var E=class extends w{constructor(s,e){super(s);let o=this.exports;try{C(this.component);let r=e(this.component,this),n=this.exports!==o;if(x(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},R=$(E);var nt=(t,s,e)=>z((o,r)=>{let n=s,a=O({bubbles:!1,composed:!1});return r.onUpdated(i=>{if(!n.some(c=>i.has(c)))return;let l=e(k(t,n,i)),d=e(k(t,n));l.forEach((c,p)=>{d.has(p)||a.emit({...c,data:void 0})}),d.forEach((c,p)=>{let u=l.get(p);(!u||!M(u,c))&&a.emit(c)})}),a});function k(t,s,e){let o={};return s.forEach(r=>{o[r]=e?.has(r)?e.get(r):t[r]}),o}function M(t,s){if(t===s)return!0;if(!t||!s||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return!1;let e=Object.entries(t),o=Object.entries(s);return e.length!==o.length?!1:e.every(([r,n])=>M(n,s[r]))}var at=t=>(s={})=>z((e,o)=>{let r=b(e.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=e;o.onLifecycle(()=>V(e.el,()=>t("./assets"),({t9nLocale:l,t9nStrings:d,lang:c})=>{let p={...d,_lang:c,_t9nLocale:l,_loading:!1};o.exports=p;let u=d.componentLabel;typeof u=="string"&&"label"in e&&e.label==null&&(e.label??=u),i(a.messageOverrides)},s.name));let i=l=>{let d=o.exports,c=d._original??d,p=S(c,l);l&&(p._original=c),o.exports=p};return"messageOverrides"in a&&o.onUpdate(l=>{l.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),S=(t,s)=>{if(!s)return t;let e={...t};return Object.entries(s).forEach(([o,r])=>{t[o]!==void 0&&(typeof r=="object"?e[o]=S(t[o],r):e[o]=r??t[o])}),e};export{nt as a,at as b};
2
+ import{b as A,d as N}from"./NXKKG5TK.js";import{a as x,b as C,c as f,d as m,e as P,f as L,k as g,m as v,n as O,o as w}from"./MAV3DW27.js";var $=t=>(...s)=>{let e=m(),o=new t(...s),r=o.exports;f(e.at(-1));let n=o.component.manager;n.W(o,r),o.watchExports(n.W.bind(n,o)),P(o);let a=[o.component,...e].reverse();return v(a,i=>i===void 0?void 0:T(o,i,r),r)},T=(t,{host:s,key:e,isReactive:o},r)=>{let n=s,a=n[e]!==t.exports,i=n[e]!==r,l=r!==t.exports;if(a&&!i&&l&&(n[e]=t.exports),s===t.component){if(o){let p=t.component.manager;i&&p.W(t,n[e]),t.onUpdate(u=>{if(u.has(e)){let y=n[e];y!==t.exports&&p.W(t,y)}})}t.O=o?void 0:e}let c=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(c?L(()=>{n[e]=t.exports}):n[e]=t.exports)})};var U="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),F=new Set(U),h="en",W={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},K=async(t,s,e="")=>{let o=`${s}/${e}`,r=`${o}${t}.json`;return _[r]??=j(t,o),await _[r]},_={},j=async(t,s)=>{let e=`${s}${t}.json`;try{let o=await fetch(e);if(o.ok)return await o.json()}catch(o){return g("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:o}}),{}}return t===h?{}:await j(h,s)},b=t=>{let s=N(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:D(s)}},D=t=>{let[s,e]=t.split("-"),o=s.toLowerCase(),r=o;return e&&(r=`${o}-${e.toUpperCase()}`),r=W[r]??r,F.has(r)?r:e?D(o):h},V=(t,s,e,o)=>{let r,n=()=>q(t,s(),o).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&e(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),A(t,["lang"],n)},q=async(t,s,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:r}=b(t),n=`${s}/${e}/t9n`,i=e===null?{}:await K(r,n,"messages.");return{lang:o,t9nLocale:r,t9nStrings:i}};var z=t=>R(void 0,t);var E=class extends w{constructor(s,e){super(s);let o=this.exports;try{C(this.component);let r=e(this.component,this),n=this.exports!==o;if(x(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},R=$(E);var nt=(t,s,e)=>z((o,r)=>{let n=s,a=O({bubbles:!1,composed:!1});return r.onUpdated(i=>{if(!n.some(c=>i.has(c)))return;let l=e(k(t,n,i)),d=e(k(t,n));l.forEach((c,p)=>{d.has(p)||a.emit({...c,data:void 0})}),d.forEach((c,p)=>{let u=l.get(p);(!u||!M(u,c))&&a.emit(c)})}),a});function k(t,s,e){let o={};return s.forEach(r=>{o[r]=e?.has(r)?e.get(r):t[r]}),o}function M(t,s){if(t===s)return!0;if(!t||!s||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return!1;let e=Object.entries(t),o=Object.entries(s);return e.length!==o.length?!1:e.every(([r,n])=>M(n,s[r]))}var at=t=>(s={})=>z((e,o)=>{let r=b(e.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=e;o.onLifecycle(()=>V(e.el,()=>t("./assets"),({t9nLocale:l,t9nStrings:d,lang:c})=>{let p={...d,_lang:c,_t9nLocale:l,_loading:!1};o.exports=p;let u=d.componentLabel;typeof u=="string"&&"label"in e&&e.label==null&&(e.label??=u),i(a.messageOverrides)},s.name));let i=l=>{let d=o.exports,c=d._original??d,p=S(c,l);l&&(p._original=c),o.exports=p};return"messageOverrides"in a&&o.onUpdate(l=>{l.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),S=(t,s)=>{if(!s)return t;let e={...t};return Object.entries(s).forEach(([o,r])=>{t[o]!==void 0&&(typeof r=="object"?e[o]=S(t[o],r):e[o]=r??t[o])}),e};export{nt as a,at as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as g}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{h as u,v as c,z as h}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([{watch:_},y,{property:m,subclass:f}])=>{var A=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(e,s,i,a)=>{for(var r=a>1?void 0:a?S(s,i):s,t=e.length-1,n;t>=0;t--)(n=e[t])&&(r=(a?n(s,i,r):n(r))||r);return a&&r&&A(s,i,r),r};function l(){return typeof window>"u"?null:window}var o=class extends y{constructor(){super(...arguments),this._utterance=null,this.state="idle",this.supported=o.isSupported()}destroy(){this.stop(),super.destroy()}start(e){let s=e.trim(),i=l(),a=i?.SpeechSynthesisUtterance,r=i?.speechSynthesis;if(this._set("supported",o.isSupported(i)),!s||!a||!r)return;this.stop();let t=new a(s);t.rate=.9,t.pitch=1.1,t.volume=1,t.onend=()=>{this._utterance===t&&this._reset()},t.onerror=()=>{this._utterance===t&&this._reset()};try{r.speak(t),this._utterance=t,this._set("state","playing")}catch{t.onend=null,t.onerror=null,this._reset()}}stop(){let e=l(),s=e?.speechSynthesis;if(this._set("supported",o.isSupported(e)),s)try{(s.speaking||s.pending)&&s.cancel()}catch{}this._reset()}toggle(e){if(this.state==="playing"){this.stop();return}this.start(e)}static isSupported(e=l()){return!!e?.speechSynthesis&&typeof e.SpeechSynthesisUtterance=="function"}_reset(){this._utterance&&(this._utterance.onend=null,this._utterance.onerror=null),this._utterance=null,this._set("state","idle")}};p([m({readOnly:!0})],o.prototype,"state",2);p([m({readOnly:!0})],o.prototype,"supported",2);o=p([f("ReadAloudController")],o);var d=class extends c{constructor(){super(...arguments),this._messages=g({blocking:!0}),this._readAloudController=new o,this.readAloudEnabled=!1}static{this.properties={readAloudEnabled:5,message:0}}loaded(){this.manager.onLifecycle(()=>[_(()=>this._readAloudController.state,()=>this.requestUpdate(),{initial:!0}),{remove:()=>{this._readAloudController.stop()}}])}_toggleReadAloud(){this._readAloudController.toggle(this.message?.content??"")}render(){return this.readAloudEnabled&&!this.message?.error&&this.message?.content?.trim()&&this._readAloudController.supported?u`<calcite-action id=action-read-aloud .icon=${this._readAloudController.state==="playing"?"sound-off":"sound"} scale=s .active=${this._readAloudController.state==="playing"} @click=${()=>this._toggleReadAloud()} text></calcite-action><calcite-tooltip reference-element=action-read-aloud overlay-positioning=fixed placement=bottom><span>${this._readAloudController.state==="playing"?this._messages.stopReadingButtonLabel:this._messages.readAloudButtonLabel}</span></calcite-tooltip>`:null}};h("arcgis-assistant-message-read-aloud",d);return d},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as i,b as o}from"./CE6VDP2D.js";import{g as a,h as c,v as e,z as r}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var s=a`.container{color:var(--calcite-color-text-1)}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}`,t=class extends e{static{this.properties={content:1}}static{this.styles=s}render(){return c`<div class="container"><div class="content">${i(o(this.content))}</div></div>`}};r("arcgis-assistant-message-text",t);export{t as ArcgisAssistantMessageText};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./T43LEBBE.js";import{a as T,b as S}from"./P7DG5T3Z.js";import{_ as w,ea as Ee,g as Se,j as Q,k as B,pa as L,u as xe}from"./DHKUXLU3.js";import{L as z,P as oe,_ as j,wc as f}from"./CHPQM77M.js";import{a as s}from"./WNS5ZUF5.js";import{Dd as I}from"./ZEYIBYSF.js";export default $arcgis.t(([Ae,M,ie,Le,,Ce,ot,{addressToLocations:at},nt,it,De,{createRenderer:st},{getSchemesByTag:lt,getSchemes:ct},{getBackgroundColorTheme:Re},{createAgeRenderer:ut,createContinuousRenderer:dt},{getSchemesByTag:we},{createContinuousRenderer:pt},{createRenderer:mt},{getSchemesByTag:ht},{createRenderer:ft},{getSchemesByTag:yt},{createRenderer:gt},{getSchemesByTag:wt},{createRenderer:bt},{getSchemesByTag:vt},{createAgeRenderer:Tt,createContinuousRenderer:St},{createRenderer:xt},{getSchemesByTag:Et},It,Oe,Pe,{formatDateOnly:Nt,convertDateFormatToIntlOptions:K,formatTimeOnly:$t,formatDate:qe},kt,Ft,Mt,At,Ct,Ge,,{fetchKnowledgeGraph:_e,executeQueryStreaming:Rt,executeSearchStreaming:qt},_t,{b:D,c:Ie,k:Ne}])=>{var Me=e=>Array.isArray(e)&&e.every(z),Xe=e=>typeof e=="object"&&e!=null&&"messages"in e&&Me(e.messages),et=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,U=class extends Ee{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:o,handleToolErrors:a}=t??{};super({name:r,tags:o,func:(n,l)=>this.run(n,l)}),this.tools=e,this.handleToolErrors=a??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(o=>o.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let o=await r.invoke({...e,type:"tool_call"},t);return z(o)&&o.getType()==="tool"||B(o)?o:new oe({status:"success",name:r.name,content:typeof o=="string"?o:JSON.stringify(o),tool_call_id:e.id})}catch(o){if(!this.handleToolErrors||xe(o))throw o;return new oe({status:"error",content:`Error: ${o.message}
2
+ import a from"./CFVVQXPJ.js";import{a as T,b as S}from"./P7DG5T3Z.js";import{_ as w,ea as Ee,g as Se,j as Q,k as B,pa as L,u as xe}from"./DHKUXLU3.js";import{L as z,P as oe,_ as j,wc as f}from"./CHPQM77M.js";import{a as s}from"./WNS5ZUF5.js";import{Dd as I}from"./ZEYIBYSF.js";export default $arcgis.t(([Ae,M,ie,Le,,Ce,ot,{addressToLocations:at},nt,it,De,{createRenderer:st},{getSchemesByTag:lt,getSchemes:ct},{getBackgroundColorTheme:Re},{createAgeRenderer:ut,createContinuousRenderer:dt},{getSchemesByTag:we},{createContinuousRenderer:pt},{createRenderer:mt},{getSchemesByTag:ht},{createRenderer:ft},{getSchemesByTag:yt},{createRenderer:gt},{getSchemesByTag:wt},{createRenderer:bt},{getSchemesByTag:vt},{createAgeRenderer:Tt,createContinuousRenderer:St},{createRenderer:xt},{getSchemesByTag:Et},It,Oe,Pe,{formatDateOnly:Nt,convertDateFormatToIntlOptions:K,formatTimeOnly:$t,formatDate:qe},kt,Ft,Mt,At,Ct,Ge,,{fetchKnowledgeGraph:_e,executeQueryStreaming:Rt,executeSearchStreaming:qt},_t,{b:D,c:Ie,k:Ne}])=>{var Me=e=>Array.isArray(e)&&e.every(z),Xe=e=>typeof e=="object"&&e!=null&&"messages"in e&&Me(e.messages),et=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,U=class extends Ee{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:o,handleToolErrors:a}=t??{};super({name:r,tags:o,func:(n,l)=>this.run(n,l)}),this.tools=e,this.handleToolErrors=a??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(o=>o.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let o=await r.invoke({...e,type:"tool_call"},t);return z(o)&&o.getType()==="tool"||B(o)?o:new oe({status:"success",name:r.name,content:typeof o=="string"?o:JSON.stringify(o),tool_call_id:e.id})}catch(o){if(!this.handleToolErrors||xe(o))throw o;return new oe({status:"error",content:`Error: ${o.message}
3
3
  Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(et(e))r=[await this.runTool(e.lg_tool_call,t)];else{let n;if(Me(e))n=e;else if(Xe(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let l=new Set(n.filter(c=>c.getType()==="tool").map(c=>c.tool_call_id)),i;for(let c=n.length-1;c>=0;c-=1){let u=n[c];if(j(u)){i=u;break}}if(i==null||!j(i))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(i.tool_calls?.filter(c=>c.id==null||!l.has(c.id)).map(c=>this.runTool(c,t))??[])}if(!r.some(B))return Array.isArray(e)?r:{messages:r};let o=[],a=null;for(let n of r)B(n)?n.graph===Q.PARENT&&Array.isArray(n.goto)&&n.goto.every(l=>Se(l))?a?a.goto.push(...n.goto):a=new Q({graph:Q.PARENT,goto:n.goto}):o.push(n):o.push(Array.isArray(e)?[n]:{messages:[n]});return a&&o.push(a),o}};var An=w.Root({llmInputMessages:w({reducer:(e,t)=>L([],t),default:()=>[]})});var O=(e,t)=>t??e,Oi=w.Root({...Ie(),intent:w({reducer:O}),vectorSearchLayerResults:w({reducer:O,default:()=>[]}),vectorSearchFieldResults:w({reducer:O}),navigationInternalState:w({reducer:O,default:()=>({toolCallMessage:void 0})})});async function zt(e,t){let r=M.getDefault().helperServices,o=r.geocode.find(d=>d.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!o)throw new Error("No geocoding service found in helperServices.");let a=o.url,n=`${ie.assetsPath?.endsWith("/")?ie.assetsPath:`${ie.assetsPath}/`}esri/images/search/search-symbol-32.png`,l=(await at(a,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!l?.extent||!l.location)throw new Error(`Could not find location for: ${e}`);let i=new nt({url:n,width:24,height:24}),c=new ot({geometry:l.location,symbol:i});t.graphics.removeAll(),t.graphics.add(c),await t.goTo(l.extent);let u={address:l.address??"",location:l.location?l.location.toJSON():null,extent:l.extent?l.extent.toJSON():null};return{text:`Successfully zoomed to ${e}.`,sharedStatePatch:{lastResolvedLocation:{value:u}}}}var jt=["mapView"];function N(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=jt.filter(o=>!(o in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function Lt({address:e},t){let{mapView:r}=N(t);return await zt(e,r)}var Dt=s.object({address:s.string().describe("The full address or place name to locate.")}),Pi=f(Lt,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Dt});async function Ot(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let o=r.find(n=>n.name===e);if(!o)throw new Error(`Bookmark with name "${e}" not found.`);let a=o.viewpoint;if(!a)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(a),{text:`Navigated to bookmark: ${e}`}}async function Pt({bookmarkName:e},t){let{mapView:r}=N(t);return await Promise.resolve(Ot(e,r))}var Gt=I.object({bookmarkName:I.string().describe("The name of the bookmark to navigate to.")}),Gi=f(Pt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Gt});async function Vt(e,t,r){let o=r.map?.allLayers.find(l=>l.id===e);if(!o)return{text:`Error: Layer with id ${e} not found`};let a=t?.trim()?t:"1=1",n=o.createQuery();n.where=a;try{let{extent:l,count:i}=await o.queryExtent(n);if(i===0)return{text:`No features found in ${o.title} matching: ${a}`,where:a};if(l)await r.goTo(l);else return{text:`Error: Unable to determine extent for ${o.title}`,where:a};let c={layerId:e,layerTitle:o.title??e,where:a,count:i};return{text:`Successfully zoomed to ${i} feature(s) in ${o.title} matching: ${a}`,where:a,sharedStatePatch:{lastNavigatedFeatures:{value:c}}}}catch(l){return console.error("Error in goToFeatures:",l),{text:`Error: ${l instanceof Error?l.message:"Unknown error"}`,where:a}}}async function Qt({layerId:e,where:t},r){let{mapView:o}=N(r);return await Vt(e,t,o)}var Bt=I.object({layerId:I.string().describe("The layerId of the layer to zoom to."),where:I.string().describe("The sql-92 where clause used to query features to zoom to")}),Vi=f(Qt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Bt});async function Ut(e){let t=new it({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(t),{text:"Successfully zoomed to world extent"}}async function Kt(e,t){let{mapView:r}=N(t);return await Ut(r)}var Wt=I.object({}),Qi=f(Kt,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:Wt});async function Ht(e){let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(t)await e.goTo(t);else throw new Error("Initial extent is undefined");return{text:"Successfully zoomed to home extent"}}async function Jt(e,t){let{mapView:r}=N(t);return await Ht(r)}var Zt=s.object({}),Bi=f(Jt,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:Zt});async function Yt(e,t){await t.when();let r=t.map?.allLayers.find(a=>a.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),{text:`Could not find layer for: ${e}`};let o;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?o=t.map.diagramNodesExtent:o=r.fullExtent,o?(await t.goTo(o),r.visible=!0,{text:`Successfully zoomed to: ${r.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function Xt({layerId:e},t){let{mapView:r}=N(t);return await Yt(e,r)}var er=I.object({layerId:I.string().describe("The id of the layer to navigate to")}),Ui=f(Xt,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:er});async function tr(e,t){return await t.goTo({scale:e}),{text:`Successfully zoomed to: ${e}`}}async function rr({scale:e},t){let{mapView:r}=N(t);return await tr(e,r)}var or=s.object({scale:s.number().describe("The map scale of the view to go to.")}),Ki=f(rr,{name:"goToScale",description:"Go to the specified view scale.",schema:or});async function ar(e,t,r){let o={target:new De({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(o.zoom=r.zoom),r?.scale!==void 0&&(o.scale=r.scale),await t.goTo(o),{text:`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,r?.zoom!==void 0?`zoom ${r.zoom}`:"",r?.scale!==void 0?`scale 1:${r.scale}`:""].filter(Boolean).join(", ")}`}}async function nr({center:e,zoom:t,scale:r},o){let{mapView:a}=N(o);return await ar(e,a,{zoom:t,scale:r})}var ir=s.object({center:s.object({longitude:s.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:s.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:s.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:s.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),Wi=f(nr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:ir});async function sr(e,t){return await t.goTo({zoom:e}),{text:`Successfully zoomed to: ${e}`}}async function lr({zoom:e},t){let{mapView:r}=N(t);return await sr(e,r)}var cr=s.object({zoom:s.number().min(1).max(20).describe("The zoom level of the view to go to.")}),Hi=f(lr,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:cr}),ze=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./KMQ3SP4I.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md":()=>import("./5QAHYX7Y.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_lucene_generation_prompt.md":()=>import("./5ZZGKP7N.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_summarize_result_prompt.md":()=>import("./AXDZBBNL.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./ZS2TZ6BF.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./LQ6R5YRN.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./X2ZDYHCG.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./T537PKP4.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./F2AHA4GB.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./FX7UOGHP.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./NE7E52YR.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./6YMR4QSD.js").then(e=>e.default)});async function le(e){let t=Object.entries(ze).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
4
4
  Available prompts:
5
5
  ${Object.keys(ze).join(`
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as x}from"./434TAA3J.js";import a from"./CFVVQXPJ.js";import{a as O}from"./E2HENO3T.js";import"./QSA4T3BU.js";import{a as Y}from"./5W7S2RS4.js";import"./NXKKG5TK.js";import{g as A,h as g,k as L,l as P,n as p,t as v,u as E,v as M,x as I,z as F}from"./MAV3DW27.js";import{b as D}from"./ADYIXCSG.js";import{a as y}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{U as N,a as W,b as q,ta as U,u as j}from"./DHKUXLU3.js";import{Z as H,ja as T}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([Ce,{whenOnce:Re,watch:$e,when:Ae},Le,se,re,J,ie,ne,Pe,,,De,{property:b,subclass:Me},{a:z,d:V,e:S,g:G,h:B,i:Q}])=>{var ae=async r=>{let e=await oe(),t=await z("default"),i=re.getDefault(),s=(await se.getCredential(`${i.url}/sharing`)).token,a={type:"generateEmbeddings",webmapEmbeddings:r,auth:{apiUrl:t,token:s}};return e.postMessage(a),await new Promise((n,o)=>{let c=d=>{d.data==="completed"&&(e.removeEventListener("message",c),n())},l=d=>{e.removeEventListener("message",c),o(d instanceof Error?d:new Error("Embeddings worker error"))};e.addEventListener("message",c),e.addEventListener("error",l,{once:!0})}),e},oe=async()=>{{let r=(await import("./23EQTPO3.js")).default;return new r}},ce=r=>{r.currentIntent="none"},le=async(r,e)=>{let t=S(e);if(r.agentExecutionContext.userRequest){let s=new T(r.agentExecutionContext.userRequest.trim());r.agentExecutionContext.messages=[...r.agentExecutionContext.messages,s],ce(r)}let i=t?.services.agentRegistry.list().map(s=>s.agent.id)??[];return await y({text:`Available agents: ${[...i].join(", ")}`},e),await y({text:"Analyzing user input"},e),r},de=async(r,e)=>(await y({text:"Exiting..."},e),r),K=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),ge=(r,e)=>{if(!K(r)){r!==void 0&&console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);return}let t={};for(let[i,s]of Object.entries(r)){if(!K(s)||!("value"in s)){console.warn(`Agent "${e}" returned invalid sharedStatePatch entry for key "${i}". Ignoring that entry.`);continue}t[i]={value:s.value}}return t},he=r=>{let{previousSharedState:e,patch:t,agentId:i}=r;if(!t)return e;let s=Date.now(),a={...e};for(let[n,o]of Object.entries(t))o?.value!==void 0&&(a[n]={value:o.value,meta:{updatedByAgentId:i,updatedAt:s}});return a},X=r=>typeof r!="string"?void 0:r.trim()||void 0,ue=r=>{switch(r){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},pe=(r,e)=>{let t=X(e?.outputMessage),i=X(e?.summary),s=e?.status,a=s==="success"||s==="failed"?s:"unknown";a==="unknown"&&console.warn(`Agent "${r}" returned missing/invalid status. Defaulting to "unknown".`);let n=ge(e?.sharedStatePatch,r);return{outputMessage:t,summary:i??t??ue(a),status:a,sharedStatePatch:n}},Z=4e3,me=async(r,e)=>{let t=S(e);if(t?.abortSignal?.aborted)return await y({text:"Run cancelled; skipping agent execution"},e),{...r,currentIntent:"none",requiresFollowUp:!1};let{agentRegistry:i}=t?.services??{},s=i?.get(r.currentIntent);if(!s)return console.warn(`No agent found for intent: ${r.currentIntent}`),r;await y({text:`Executing registered agent: ${s.agent.name}`},e);let a={...e??{},configurable:{...t??{},agentId:s.agent.id,context:s.getContext?await s.getContext():void 0}},n;try{let l=await s.agent.createGraph().compile().invoke({agentExecutionContext:{...r.agentExecutionContext,messages:[...r.agentExecutionContext.messages],priorSteps:structuredClone(r.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(r.agentExecutionContext.sharedState??{})}},a);n=pe(s.agent.name,l),await y({text:`Finished executing registered agent: ${s.agent.name}`},e)}catch(l){if(j(l))throw l;let d=l instanceof Error?l.message:String(l);console.error(`Agent "${s.agent.name}" failed:`,l),await y({text:`Registered agent failed: ${s.agent.name}. ${d}`},e),n={status:"failed",outputMessage:`Agent execution failed: ${d}`,summary:`Agent execution failed: ${d}`}}let o=n.outputMessage,c=[...r.agentExecutionContext.messages];if(o){let l=o.length>Z?`${o.slice(0,Z-14)}
3
+ [truncated]`:o;c.push(new H(l))}return{...r,stepCount:r.stepCount+1,lastExecutedAgent:s.agent.id,requiresFollowUp:n.status==="failed"?!0:r.requiresFollowUp,finalOutputMessage:o??"",agentExecutionContext:{...r.agentExecutionContext,messages:c,priorSteps:[...r.agentExecutionContext.priorSteps??[],{agentId:s.agent.id,assignedTask:r.agentExecutionContext.assignedTask,summary:n?.summary||"No summary provided.",status:n?.status||"unknown"}],sharedState:he({previousSharedState:r.agentExecutionContext.sharedState,patch:n.sharedStatePatch,agentId:s.agent.id})}}},ye=3,we=()=>new U(V).addNode("ingestInput",le).addNode("intentLLM",B).addNode("executeRegisteredAgent",me).addNode("exit",de).addEdge(W,"ingestInput").addEdge("ingestInput","intentLLM").addConditionalEdges("intentLLM",r=>r.currentIntent==="none"||r.currentIntent===r.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",r=>r.stepCount>=ye||!r.requiresFollowUp?"exit":"intentLLM").addEdge("exit",q),C=class{constructor(){this.agentRegistry=new Map}register(e){let{agent:t}=e;if(this.agentRegistry.has(t.id))throw new Error(`Duplicate agent id: ${t.id}`);this.agentRegistry.set(t.id,e)}get(e){return this.agentRegistry.get(e)}list(){return[...this.agentRegistry.values()]}},R=class{constructor(e,t){this.graph=e,this.config={...t}}async waitForUser(){return await new Promise((e,t)=>{this.resolveWait=e,this.rejectWait=t})}handle(e,t){try{let i={agentId:e.agentId,id:e.id,payload:t},s=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:i},subgraphs:!0,version:"v2"});this.resolveWait?.(s)}catch(i){this.rejectWait?.(i)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},be=async r=>{try{return await(await G()).embedDocuments(r)}catch(e){throw console.error("Failed to generate embeddings:",e),e}},ee=async(r,e)=>{let t=e.get(r);if(t)return t;let i=await be([r]);return e.set(r,i[0]),i[0]};async function fe(r,e,t,i){let s=`req-${Date.now()}`,a={type:"layerSearch",precomputedEmbedding:i?await ee(r,i):void 0,requestId:s,minScore:t};return await new Promise(n=>{let o=c=>{c.data.requestId===s&&n(c.data.results)};e.addEventListener("message",o,{once:!0}),e.postMessage(a)})}function ve(r){let{worker:e}=r;return{async searchLayers({text:t,minScore:i,embeddingCache:s}){return await fe(t,e,i,s)}}}var Ee=async({combinedQuery:r,layerIds:e,embeddingsWorker:t,minScore:i,topResults:s,embeddingCache:a})=>{let n=`req-${Date.now()}`,o=a?await ee(r,a):void 0,c={type:"fieldSearch",layerIdForFieldsSearch:e,precomputedEmbedding:o,requestId:n,minScore:i,topResults:s};return await new Promise(l=>{let d=h=>{if(h.data.requestId!==n)return;let u=h.data.results.map(({layerId:f,results:k})=>({layerId:f,results:k}));l(u)};t.addEventListener("message",d,{once:!0}),t.postMessage(c)})};function _e(r){let{worker:e}=r;return{async searchFields({text:t,layerIds:i,minScore:s,topResults:a,embeddingCache:n}){return await Ee({combinedQuery:t,layerIds:i,embeddingsWorker:e,minScore:s,topResults:a,embeddingCache:n})}}}var ke=r=>{let e=Q.safeParse(r);if(!e.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return e.data},Ie=(r,e)=>{let t=new Map,i=new Map;if(e.allLayers.forEach(s=>{s instanceof ie&&i.set(s.id,s)}),r.length!==i.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let s of r){let a=i.get(s.id);if(!a)throw new Error(`Layer with ID ${s.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(s.fields.length!==a.fields.length)throw new Error(`Field count mismatch for layer ID ${s.id} during registry restoration. Regenerate embeddings.`);let n={name:s.name,title:s.title,description:s.description},o=new Map;for(let c of s.fields){let l=a.fieldsIndex.get(c.name);if(!l)throw new Error(`Field with name ${c.name} not found in the original layer ${s.id} during registry restoration. Regenerate embeddings.`);o.set(c.name,{name:c.name,alias:a.getFieldAlias(c.name)??c.alias,description:c.description,type:l.type||"unknown",valueType:l.valueType||"unknown",domain:a.getFieldDomain(c.name)??void 0})}t.set(s.id,{layerItem:n,fieldRegistry:o})}return t},Se=async r=>{try{return(await ne(r,{responseType:"json"})).data}catch(e){throw new Error(`Failed to fetch data from ${r}: ${String(e)}`)}},xe=async r=>{let e=r.map;if(!e?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:t}=await e.portalItem.fetchResources(),i=t.find(a=>a.resource.path==="embeddings-v01.json");if(!i?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let s=await Se(i.resource.url);return ke(s)},_=class r{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.agentRegistry=new C,this.activeRunId="",this.cancelledRunIds=new Set,this.streamEpoch=0}static async init(e){let t=new r;try{if(e.view?.map){await J.whenOnce(()=>e.view.ready);let i=await xe(e.view),s=Ie(i.layers,e.view.map);t.layersAndFieldsRegistry=s,t.embeddingsWorker=await ae(i)}return e.agents?.forEach(i=>{t.agentRegistry.register(i)}),t.orchestratorReady=!0,t}catch(i){throw console.error("Orchestrator initialization failed:",i),i}}async*ask(e){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");if(++this.streamEpoch,!e.trim())return;let t=D();this.activeRunId=t,this.activeAbortController=new AbortController,this.graph||(this.graph=we().compile({checkpointer:new N}));let i=this.embeddingsWorker?ve({worker:this.embeddingsWorker}):void 0,s=this.embeddingsWorker?_e({worker:this.embeddingsWorker}):void 0,a=new Map,n={version:"v2",streamMode:"custom",configurable:{thread_id:t,abortSignal:this.activeAbortController.signal,hitlResponse:null,services:{layerSearch:i,fieldSearch:s,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:this.agentRegistry,embeddingCache:a}},subgraphs:!0},o=this.graph?.streamEvents({agentExecutionContext:{userRequest:e,messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState}},n),c=++this.streamEpoch;if(yield*this.pipeStream(o,c,t),this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}for(;;){if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}let d=(await this.graph.getState(n,{subgraphs:!0})).tasks.find(h=>h.interrupts.length>0)?.interrupts[0]?.value;if(!d)break;this.currentInterrupt=d,this.interruptHandler=new R(this.graph,n),yield{runId:t,timestamp:Date.now(),type:"interrupt",interrupt:d};try{let h=await this.interruptHandler.waitForUser(),u=++this.streamEpoch;yield*this.pipeStream(h,u,t)}catch(h){if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}if(h){yield{runId:t,timestamp:Date.now(),type:"error",error:{message:h?.message}};return}}}if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}let l=(await this.graph.getState(n,{subgraphs:!0})).values;if(this.isRunCancelled(t)){yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"};return}this.chatHistory=l.agentExecutionContext.messages.length?l.agentExecutionContext.messages:this.chatHistory,this.priorSteps=l.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=l.agentExecutionContext.sharedState??{},yield{runId:t,timestamp:Date.now(),type:"completed",result:{content:l.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={}}resumeInterrupt(e){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,e)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}cancel(){this.activeRunId&&(this.cancelledRunIds.add(this.activeRunId),this.activeAbortController?.abort(),++this.streamEpoch,this.interruptHandler?.cancel())}async*pipeStream(e,t,i){for await(let s of e){if(this.isRunCancelled(i)||t!==this.streamEpoch)break;s.event==="on_custom_event"&&s.name==="trace_message"?yield{runId:i,timestamp:Date.now(),type:"trace",data:s.data}:s.name==="graph_ux_suggestion"&&(yield{runId:i,timestamp:Date.now(),type:"ux-suggestion",suggestion:s.data})}}isRunCancelled(e){return this.cancelledRunIds.has(e)}dispose(){this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};var Fe=A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`,Oe=Object.defineProperty,We=Object.getOwnPropertyDescriptor,w=(r,e,t,i)=>{for(var s=i>1?void 0:i?We(e,t):e,a=r.length-1,n;a>=0;a--)(n=r[a])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&Oe(e,t,s),s},qe=async r=>await new Promise(e=>setTimeout(e,r));async function*je(r,{chunkSize:e=5,delay:t=20}={}){let i=0;for(;i<r.length;)yield r.slice(i,i+e),i+=e,await qe(t)}async function*te(r,e,t,i){for await(let s of je(r)){if(i?.aborted){yield{type:"cancelled",log:t,runId:e};return}yield{type:"block-data",blockType:"text",data:{content:s},runId:e}}}var m=class extends De{constructor(r){super(r),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await Re(()=>!this.view.updating),this._set("orchestrator",await _.init({agents:[...this.agents],view:this.view??void 0})),this.addHandles([$e(()=>[this.view,this.agents],()=>{this._initialize()})])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(r,e){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let t=[],i;try{let s=this.orchestrator.ask(r);for await(let a of s){let n=a.runId;switch(a.type){case"trace":{this._set("processingStep",a.data.text),t.push(a.data.text);break}case"completed":{this._set("processing",!1),this._set("processingStep","");let o=a.result,c=!!o.content.length,l=!!i?.length;if(!c&&!l){yield{type:"completed",error:"No response received.",log:t,runId:n};return}let d=o.content;if(yield{type:"block-start",blockType:"text",runId:n},yield*te(d,n,t,e),yield{type:"block-end",blockType:"text",runId:n},l)for(let h of i){if(e?.aborted){yield{type:"cancelled",log:t,runId:n};return}let{type:u,data:f}=h;if(yield{type:"block-start",blockType:u,runId:n},u==="text"){let k=typeof f?.content=="string"?f.content:"";yield*te(k,n,t,e)}else yield{type:"block-data",blockType:u,data:f,runId:n};yield{type:"block-end",blockType:u,runId:n}}yield{type:"completed",response:d,blocks:i,log:t,runId:n};return}case"ux-suggestion":{let o=a.suggestion;i=i?[...i,o]:[o];break}case"interrupt":{let{kind:o,message:c,metadata:l}=a.interrupt,d=Array.isArray(l)?l.filter(u=>typeof u=="string"):[],h=(()=>{switch(o){case"booleanChoice":return{type:"boolean-choice",message:c,options:d};case"singleSelection":return{type:"single-select",message:c,options:d};case"multipleSelection":return{type:"multi-select",message:c,options:d};case"textInput":return{type:"text-input",message:c};default:return{type:o,message:c,options:d}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:h,runId:n};break}case"cancelled":{yield{type:"cancelled",log:t,runId:n};return}case"error":{yield{type:"completed",error:a.error.message,log:t,runId:n};return}default:{console.warn("Unknown event type:",a);break}}}}catch(s){console.warn("Error during message processing:",s),yield{type:"completed",error:"An error occurred during message processing.",log:t,runId:"error"};return}finally{this._set("processing",!1)}}cancel(){this.orchestrator?.cancel()}};w([b({readOnly:!0})],m.prototype,"orchestrator",2);w([b()],m.prototype,"agents",2);w([b()],m.prototype,"portal",2);w([b()],m.prototype,"view",2);w([b({readOnly:!0})],m.prototype,"loading",2);w([b({readOnly:!0})],m.prototype,"processing",2);w([b({readOnly:!0})],m.prototype,"processingStep",2);m=w([Me("OrchestratorController")],m);var He="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",Te="Embeddings not found for this web map.",Ne="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",$=class extends M{constructor(){super(...arguments),this._messages=O({blocking:!0}),this.#e=v(),this.#a=v(),this.#s=v(),this.#t=null,this.#o=new Map,this.#r=Le.getDefault(),this.#i=e=>{e.stopPropagation(),this.cancelInterrupt()},this.#n=e=>{e.stopPropagation();let t=e.detail;this.submitInterrupt(t)},this.#c=e=>{e.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let t=e.detail;this._inputValue="",this.arcgisSubmit.emit(t),this.submitMessage(t)},this.#l=e=>{if(this._canceling=!0,e.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this._orchestratorController?.cancel(),this.#t?.abort(),this.#t=null},this.#d=e=>{e.stopPropagation();let t=e.detail;this.arcgisFeedback.emit(t)},this.#g=e=>{e.stopPropagation();let t=e.detail;this._inputValue=t.prompt,this.arcgisPromptSelect.emit(t)},this.#h=e=>{this.arcgisSlottableRequest.emit(e.detail)},this._orchestratorController=null,this._interrupt=null,this._interruptDetails=[],this._error=null,this._inputValue="",this._isAnswering=!1,this._canceling=!1,this.messages=new Ce([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.logEnabled=!1,this.copyEnabled=!1,this.voiceInputEnabled=!1,this.readAloudEnabled=!1,this.assistantAvatarEnabled=!1,this.arcgisCancel=p(),this.arcgisError=p(),this.arcgisFeedback=p(),this.arcgisInterrupt=p(),this.arcgisInterruptCancel=p(),this.arcgisInterruptSubmit=p(),this.arcgisPromptSelect=p(),this.arcgisReady=p(),this.arcgisSubmit=p(),this.arcgisSlottableRequest=p({bubbles:!1,composed:!1}),this.arcgisResponse=p()}static{this.properties={_orchestratorController:16,_interrupt:16,_interruptDetails:16,_error:16,_inputValue:16,_isAnswering:16,_signedInUserId:16,_canceling:16,_isSignedIn:16,_user:16,awaitingResponse:32,awaitingResponseStep:32,interrupt:32,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,logEnabled:5,copyEnabled:5,voiceInputEnabled:5,readAloudEnabled:5,assistantAvatarEnabled:5}}static{this.styles=Fe}#e;#a;#s;#t;#o;#r;#i;#n;#c;#l;#d;#g;#h;async#u(){try{let e=Y(this.el,this.referenceElement);await e?.componentOnReady();let t=[...this.#o.values()];return t.length?(this._orchestratorController?.destroy(),this._orchestratorController=new m({agents:t,portal:this.#r,view:e?.view}),await this._orchestratorController.load(),!0):(this._error="No agents found.",!1)}catch(e){return this._error=e?.message??"Error initializing orchestrator.",P(this)(e),!1}}get _isSignedIn(){return!!this.#r?.user||!!this._signedInUserId}get _user(){return this.#r?.user?.fullName||this.#r?.user?.username}get awaitingResponse(){return this._orchestratorController?.processing??!1}get awaitingResponseStep(){return this._orchestratorController?.processingStep??""}get interrupt(){return this._interrupt}get orchestrator(){return this._orchestratorController?.orchestrator}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}cancelInterrupt(){this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null}register(e){this.#o.set(e.agent.id,e)}async submitMessage(e){let t=e.trim();if(!t||(this.messages.push({id:Date.now().toString(),role:"user",content:t}),!this._orchestratorController))return;this.#t=new AbortController;let i=this._orchestratorController.ask(t,this.#t?.signal);for await(let s of i){let a=s.runId,n=this.messages.at(-1);switch(s.type){case"block-start":{this._isAnswering=!0;let o={type:s.blockType,isPending:!0};if(n?.role==="assistant"&&n.id===a){let c=[...n.blocks??[],o];this.messages.splice(-1,1,{...n,blocks:c})}else this.messages.push({role:"assistant",blocks:[o],id:a,isStreaming:!0,interrupts:this._interruptDetails}),this._interruptDetails=[];break}case"block-data":{if(n?.role!=="assistant"||n?.id!==a)break;let o=[...n.blocks??[]],c=o[o.length-1],{blockType:l,data:d}=s;if(c?.type!==l||!c.isPending)break;if(l==="text"){let h=typeof c.data?.content=="string"?c.data.content:"",u=typeof d?.content=="string"?d.content:"";o[o.length-1]={...c,data:{...c.data,content:h+u}}}else o[o.length-1]={...c,data:{...c.data,...d??{}}};this.messages.splice(-1,1,{...n,blocks:o});break}case"block-end":{if(n?.role!=="assistant"||n?.id!==a)break;let o=[...n.blocks??[]],c=o[o.length-1];if(c?.type!==s.blockType||!c.isPending)break;let l=c;o[o.length-1]={...l,data:{...l.data},isPending:!1},this.messages.splice(-1,1,{...n,blocks:o});break}case"completed":s.error?(this.messages.push({role:"assistant",log:s.log,error:s.error,id:a,interrupts:this._interruptDetails}),this._interruptDetails=[]):n?.role==="assistant"&&n.id===a&&this.messages.splice(-1,1,{...n,content:s.response,blocks:n.blocks?.map(o=>({...o,isPending:!1}))??[],isStreaming:!1,log:s.log}),this._isAnswering=!1,this.#t=null,this._canceling=!1;break;case"interrupt":this._interrupt={...s.payload,id:a},this.arcgisInterrupt.emit(this._interrupt);break;case"cancelled":n?.role==="assistant"&&n.id===a?this.messages.splice(-1,1,{...n,blocks:n.blocks?.filter(o=>o.type==="text"||!o.isPending)??[],isStreaming:!1,log:s.log,error:"(Stopped by user)"}):(this.messages.push({role:"assistant",log:s.log,error:"(Stopped by user)",id:a,interrupts:this._interruptDetails}),this._interruptDetails=[]),this._isAnswering=!1,this.#t=null,this._canceling=!1;break}}}submitInterrupt(e){this.arcgisInterruptSubmit.emit(e),this._interrupt&&(this._interruptDetails=[...this._interruptDetails,{interrupt:this._interrupt,response:e}]),this.orchestrator?.resumeInterrupt(e),this._interrupt=null}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#e.value?.addEventListener("arcgisPromptSelect",this.#g),this.#e.value?.addEventListener("arcgisSubmit",this.#c),this.#e.value?.addEventListener("arcgisCancel",this.#l),this.#e.value?.addEventListener("arcgisFeedback",this.#d);let e=Ae(()=>!!this._interrupt&&!!this.#s.value,()=>{let i=this.#s.value;i.removeEventListener("arcgisSubmit",this.#n),i.removeEventListener("arcgisCancel",this.#i),i.addEventListener("arcgisSubmit",this.#n,{once:!0}),i.addEventListener("arcgisCancel",this.#i,{once:!0})}),t=this.messages.on("after-add",i=>{let s=i.item;s.role==="assistant"&&(s.error||s.content)&&this.arcgisResponse.emit(s)});return queueMicrotask(()=>{this.#u().then(i=>{i?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))})}),()=>{e.remove(),t.remove(),this.#e.value?.removeEventListener("arcgisPromptSelect",this.#g),this.#s.value?.removeEventListener("arcgisSubmit",this.#n),this.#s.value?.removeEventListener("arcgisCancel",this.#i),this.#e.value?.removeEventListener("arcgisSubmit",this.#c),this.#e.value?.removeEventListener("arcgisCancel",this.#l),this.#e.value?.removeEventListener("arcgisFeedback",this.#d),this._orchestratorController?.destroy(),this._orchestratorController=null}})}_reset(){this._orchestratorController?.cancel(),this.#t?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null,this._inputValue="",this._signedInUserId=void 0}_renderEntryMessage(){return this._isSignedIn?this._error?this._renderErrorNotice():this.entryMessage?this.messages.length>0?null:g`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>`:g`<slot name=entry-message></slot>`:this._renderSignInNotice()}_renderSignInNotice(){let e=this.#r;return g`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>You need to sign in to use the assistant chat.</div>${e?g`<calcite-link slot=link @click=${async()=>{try{let t=await Pe.getCredential(`${e.url}/sharing`);this._signedInUserId=t.userId,this._error=null,this.requestUpdate(),await this.#u()?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))}catch(t){this._error=t?.message??"Error signing in.",this.arcgisError.emit(new Error(this._error)),L("error",this,"Error signing in:",{detail:{error:t}})}}} target=_blank title="Sign in to ArcGIS Online">Sign in</calcite-link>`:g`<div slot=link>No portal information available</div>`}</calcite-notice>`}_renderErrorNotice(){return this._error?g`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error===He?g`<div slot=message>${Te}</div><calcite-link slot=link .href=${Ne} target=_blank title="Learn about web map embeddings">Read more</calcite-link>`:g`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}render(){return g`<calcite-panel .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} ${E(this.#e)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map(e=>e.role==="assistant"?g`<arcgis-assistant-message .message=${e} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#h} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${e.blocks?.map((t,i)=>g`<slot name=${x(e.id,i)??I} slot=${x(e.id,i)??I}><arcgis-assistant-message-block .block=${t}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>`:g`<arcgis-assistant-user-message .message=${e} .user=${this._user}></arcgis-assistant-user-message>`)}</slot>${this._interrupt?g`<div slot=message-loading><div class="interrupt-waiting-message">waiting for user input...</div></div>`:g`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt?g`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${E(this.#s)}></arcgis-assistant-interrupt></slot>`:this.suggestedPrompts?.length?g`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>`:null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse||this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling||!this._isSignedIn||!!this._interrupt} ${E(this.#a)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse||this._isAnswering?"circle-stop":"send"} @click=${()=>{this.#a.value?.submitMessage()}} round>${this.awaitingResponse||this._isAnswering?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`}};F("arcgis-assistant",$);return $},"core/Collection","core/reactiveUtils","portal/Portal","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","config","layers/FeatureLayer","core/Accessor","core/accessorSupport/decorators",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as c}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{g as i,h as s,n as r,v as a,z as p}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var l=i`:host{display:block;max-width:100%}.group{max-width:100%}.prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer;font-weight:var(--calcite-font-weight-regular)}calcite-chip{max-width:100%}`,e=class extends a{constructor(){super(...arguments),this._messages=c({blocking:!0}),this.prompts=[],this.arcgisPromptSelect=r()}static{this.properties={label:1,prompts:0}}static{this.styles=l}_emitPromptSelect(t){this.arcgisPromptSelect.emit({prompt:t})}render(){return this.prompts.length?s`<calcite-chip-group class="group" .label=${this.label??this._messages.suggestedPromptsLabel}>${this.prompts.map(t=>s`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${()=>this._emitPromptSelect(t)}><div class="prompt">${t}</div></calcite-chip>`)}</calcite-chip-group>`:null}};p("arcgis-assistant-suggested-prompts",e);export{e as ArcgisAssistantSuggestedPrompts};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as r}from"./E2HENO3T.js";import"./QSA4T3BU.js";import"./NXKKG5TK.js";import{g as a,h as e,n as i,v as c,z as l}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var o=a`:host{width:100%;padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}`,s=class extends c{constructor(){super(...arguments),this.#t=[],this._messages=r({blocking:!0}),this.arcgisCancel=i(),this.arcgisSubmit=i()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(n=>n.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div><calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.type==="boolean-choice"?!0:this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};l("arcgis-assistant-interrupt",s);export{s as ArcgisAssistantInterrupt};
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as e,b as n}from"./CE6VDP2D.js";import{g as r,h as i,v as s,z as c}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var l=r`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,o=class extends s{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:0}}static{this.styles=l}render(){return this.log?.length&&this.showLog&&this.logEnabled?i`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
3
+ `)||a.length>70;return i`<calcite-accordion-item .heading=${t?`${a.substring(0,70)}...`:a} .expanded=${t}><div class="entry">${t?e(n(a)):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}};c("arcgis-assistant-message-log",o);export{o as ArcgisAssistantMessageLog};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as C,h as S,n as l,v as R,x as m,z as y}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";export default $arcgis.t(([{when:k,watch:u},I,{property:d,subclass:f}])=>{var T=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends I{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&M(t,s,r),r},c=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":O.find(e=>window.MediaRecorder.isTypeSupported(e))??""}initialize(){c.isSupported()&&this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!c.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?this._set("errorCode","not-allowed"):this._set("errorCode","recording-failed"))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],c.prototype,"_mimeType",1);g([d()],c.prototype,"handleRecording",2);g([d()],c.prototype,"chunkTimeSlice",2);c=g([f("MediaRecorderController")],c);var $=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?$(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function w(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=w();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t,this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!w()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=l(),this.arcgisVoiceInputError=l(),this.arcgisVoiceInputInterimTranscription=l(),this.arcgisVoiceInputStart=l(),this.arcgisVoiceInputStop=l(),this.arcgisVoiceInputTranscription=l(),this.arcgisVoiceInputTranscriptionStreamChunk=l()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=T}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new c({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":c.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as i,h as a,v as e,z as t}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var n=i`:host{display:contents}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);padding:0 var(--calcite-spacing-sm)}.loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.text{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.skeleton-text{display:block;height:.95em;border-radius:var(--calcite-border-radius);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 1.2s ease-in-out infinite;width:85%}.skeleton-text:last-child{width:70%}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.skeleton-text{animation:none}}`,s=class extends e{constructor(){super(...arguments),this.loading=!1,this.loadingMessage="",this.assistantAvatarEnabled=!1}static{this.properties={loading:5,loadingMessage:1,assistantAvatarEnabled:5,interrupts:0}}static{this.styles=n}render(){return this.loading?a`<arcgis-assistant-message footer-disabled>${this.assistantAvatarEnabled?a`<slot name=icon slot=icon><calcite-icon class="icon" icon=effects scale=s></calcite-icon></slot>`:null}<slot name=content slot=content><arcgis-assistant-interrupt-preview .interrupts=${this.interrupts}></arcgis-assistant-interrupt-preview><div class="loading-container"><div class="loading"><calcite-loader label=loading inline></calcite-loader><div class="text">${this.loadingMessage}</div></div><div class="skeleton-block"><span class="skeleton-text"></span><span class="skeleton-text"></span></div></div></slot></arcgis-assistant-message>`:null}};t("arcgis-assistant-message-loading",s);export{s as ArcgisAssistantMessageLoading};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../YIMNOUTF.js";var a,o,i,c,u,s,w,f,l,m,p;async function r(n,t){if(t in n)return n[t];if("default"in n){let e=await n.default;return typeof e=="object"&&e!==null&&t in e?e[t]:e}throw new Error(`Unable to resolve ${String(t)} from module.`)}function k(n,t){let e={};for(let[y,d]of Object.entries(t))e[y]=b(n,d);return e}function W(n,t){return n.object(k(n,t))}function b(n,t){let e=g(n,t);return t.required===!0?e:e.optional()}function g(n,t){let e=A(n,t);return t.description!==void 0&&(e=e.describe(t.description)),e}function h(n,t){switch(t){case"string":return n.string();case"number":return n.number();case"boolean":return n.boolean()}}function A(n,t){switch(t.type){case"string":{if(t.enum!==void 0){if(t.enum.length===0)throw new Error("String schema field enum must include at least one value.");return n.enum(t.enum)}return n.string()}case"number":return n.number();case"boolean":return n.boolean();case"array":{if(t.itemType===void 0)throw new Error("Array schema field requires an itemType definition.");return n.array(h(n,t.itemType))}}}async function S(n){p??=import("../Q7TL5Q5N.js");let t=await p;return W(t.z,n)}async function L(n){a??=import("../IR7PTESF.js");let t=await a,e=await r(t,"FunctionAgent");return new e(n)}async function v(n){o??=import("../7CYGX4F4.js");let t=await o,e=await r(t,"FunctionTool");return new e(n)}async function T(n){i??=import("../LIFK3QSD.js");let t=await i,e=await r(t,"LLMAgent");return new e(n)}async function q(n){c??=import("../Q6LRANX6.js");let t=await c,e=await r(t,"WorkflowAgent");return new e(n)}async function F(n){u??=import("../K3JCH4XW.js");let t=await u,e=await r(t,"ConditionalWorkflow");return new e(n)}async function j(n){s??=import("../X4XY5HIE.js");let t=await s,e=await r(t,"LoopWorkflow");return new e(n)}async function E(n){w??=import("../O3RFFPU3.js");let t=await w,e=await r(t,"ParallelWorkflow");return new e(n)}async function M(n){f??=import("../JIWK6QK6.js");let t=await f,e=await r(t,"RouterWorkflow");return new e(n)}async function P(n){l??=import("../DQSEBKOX.js");let t=await l,e=await r(t,"SequentialWorkflow");return new e(n)}async function R(n){m??=import("../3JGWGKT6.js");let t=await m,e=await r(t,"SwitchWorkflow");return new e(n)}export{F as createConditionalWorkflow,L as createFunctionAgent,v as createFunctionTool,T as createLLMAgent,j as createLoopWorkflow,E as createParallelWorkflow,M as createRouterWorkflow,S as createSchema,P as createSequentialWorkflow,R as createSwitchWorkflow,q as createWorkflowAgent};
2
+ import"../YIMNOUTF.js";var a,o,i,c,u,s,w,f,l,m,p;async function r(n,t){if(t in n)return n[t];if("default"in n){let e=await n.default;return typeof e=="object"&&e!==null&&t in e?e[t]:e}throw new Error(`Unable to resolve ${String(t)} from module.`)}function k(n,t){let e={};for(let[y,d]of Object.entries(t))e[y]=b(n,d);return e}function W(n,t){return n.object(k(n,t))}function b(n,t){let e=g(n,t);return t.required===!0?e:e.optional()}function g(n,t){let e=A(n,t);return t.description!==void 0&&(e=e.describe(t.description)),e}function h(n,t){switch(t){case"string":return n.string();case"number":return n.number();case"boolean":return n.boolean()}}function A(n,t){switch(t.type){case"string":{if(t.enum!==void 0){if(t.enum.length===0)throw new Error("String schema field enum must include at least one value.");return n.enum(t.enum)}return n.string()}case"number":return n.number();case"boolean":return n.boolean();case"array":{if(t.itemType===void 0)throw new Error("Array schema field requires an itemType definition.");return n.array(h(n,t.itemType))}}}async function S(n){p??=import("../Q7TL5Q5N.js");let t=await p;return W(t.z,n)}async function L(n){a??=import("../IR7PTESF.js");let t=await a,e=await r(t,"FunctionAgent");return new e(n)}async function v(n){o??=import("../7CYGX4F4.js");let t=await o,e=await r(t,"FunctionTool");return new e(n)}async function T(n){i??=import("../KWTJAVWV.js");let t=await i,e=await r(t,"LLMAgent");return new e(n)}async function q(n){c??=import("../Q6LRANX6.js");let t=await c,e=await r(t,"WorkflowAgent");return new e(n)}async function F(n){u??=import("../K3JCH4XW.js");let t=await u,e=await r(t,"ConditionalWorkflow");return new e(n)}async function j(n){s??=import("../X4XY5HIE.js");let t=await s,e=await r(t,"LoopWorkflow");return new e(n)}async function E(n){w??=import("../O3RFFPU3.js");let t=await w,e=await r(t,"ParallelWorkflow");return new e(n)}async function M(n){f??=import("../JIWK6QK6.js");let t=await f,e=await r(t,"RouterWorkflow");return new e(n)}async function P(n){l??=import("../DQSEBKOX.js");let t=await l,e=await r(t,"SequentialWorkflow");return new e(n)}async function R(n){m??=import("../3JGWGKT6.js");let t=await m,e=await r(t,"SwitchWorkflow");return new e(n)}export{F as createConditionalWorkflow,L as createFunctionAgent,v as createFunctionTool,T as createLLMAgent,j as createLoopWorkflow,E as createParallelWorkflow,M as createRouterWorkflow,S as createSchema,P as createSequentialWorkflow,R as createSwitchWorkflow,q as createWorkflowAgent};
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{p as s,y as e}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var a=s(e,{"arcgis-assistant":[()=>import("./Q3ZW4FYA.js"),"_messages:,assistantAvatarEnabled,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./O3EN27N5.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./IMQ4TVHF.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./Z2G7MP5L.js"),"referenceElement;;getContext"],"arcgis-assistant-knowledge-agent":[()=>import("./5CV7R5IS.js"),"context:,referenceElement,serviceUrl;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./ERL2CB2Y.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./JLKGS6Y5.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./53NTYC4I.js"),"interrupt:,loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./F6QHMKF5.js"),"_messages:,awaitingResponse,disabled,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./3NBDVZ2I.js"),"_messages:,message,options:,type"],"arcgis-assistant-interrupt-preview":[()=>import("./PBO6FZN6.js"),"interrupts:"],"arcgis-assistant-message":[()=>import("./XON27U6U.js"),"assistantAvatarEnabled,copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./B7WJFBOZ.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./24QNMEFG.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./UPEEHMSY.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./YUKR4AZW.js"),"assistantAvatarEnabled,interrupts:,loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./DZ2QWNUA.js"),"log:,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./AZGGTNA3.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./H2CHHGGH.js"),"content"],"arcgis-assistant-speech-input":[()=>import("./IRZDTYO2.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./WAIFKDR3.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./KHXUWZHB.js"),"content,message:,user"]});a({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-knowledge-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-message,arcgis-assistant-message-block,arcgis-assistant-message-feedback,arcgis-assistant-message-footer,arcgis-assistant-message-loading,arcgis-assistant-message-log,arcgis-assistant-message-read-aloud,arcgis-assistant-message-text,arcgis-assistant-speech-input,arcgis-assistant-suggested-prompts,arcgis-assistant-user-message){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r,p,j,i=(a.importMap??={}).imports??={})=>{"agent-utils/index,agent-utils/middlewares/middleware,agent-utils/middlewares/humanInTheLoop,agent-utils/middlewares/trace".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e,"@arcgis/ai-components/",".js")
2
+ import{p as s,y as e}from"./MAV3DW27.js";import"./ADYIXCSG.js";import"./YIMNOUTF.js";var a=s(e,{"arcgis-assistant":[()=>import("./SWBER53G.js"),"_messages:,assistantAvatarEnabled,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./CI3QSFPS.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./MRLTR3UO.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./DSVMXDPZ.js"),"referenceElement;;getContext"],"arcgis-assistant-knowledge-agent":[()=>import("./LREQ3XAW.js"),"context:,referenceElement,serviceUrl;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./55R6J3FL.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./ET453NAD.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./PB2ODJC7.js"),"interrupt:,loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./M3SWPT3M.js"),"_messages:,awaitingResponse,disabled,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./XBW4MWQR.js"),"_messages:,message,options:,type"],"arcgis-assistant-interrupt-preview":[()=>import("./JN744CAW.js"),"interrupts:"],"arcgis-assistant-message":[()=>import("./CAECQD75.js"),"assistantAvatarEnabled,copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./GPYYAQVI.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./FWU6DFIB.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./DEAYZ3MK.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./ZPLFFLPF.js"),"assistantAvatarEnabled,interrupts:,loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./Z7UWJ4AI.js"),"log:,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./RMLXVQZ5.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./SBHLUL3Q.js"),"content"],"arcgis-assistant-speech-input":[()=>import("./ZOSUDIJH.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./WH6QQK6N.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./K475UT3E.js"),"content,message:,user"]});a({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-knowledge-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-message,arcgis-assistant-message-block,arcgis-assistant-message-feedback,arcgis-assistant-message-footer,arcgis-assistant-message-loading,arcgis-assistant-message-log,arcgis-assistant-message-read-aloud,arcgis-assistant-message-text,arcgis-assistant-speech-input,arcgis-assistant-suggested-prompts,arcgis-assistant-user-message){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r,p,j,i=(a.importMap??={}).imports??={})=>{"agent-utils/index,agent-utils/middlewares/middleware,agent-utils/middlewares/humanInTheLoop,agent-utils/middlewares/trace".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e,"@arcgis/ai-components/",".js")