@arcgis/ai-components 5.1.0-next.4 → 5.1.0-next.41

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 (95) hide show
  1. package/dist/cdn/24MYCR6F.js +3 -0
  2. package/dist/cdn/2JJGDGMG.js +67 -0
  3. package/dist/cdn/433QN6BZ.js +2 -0
  4. package/dist/cdn/{R3LASMEM.js → 6Z5UQ3RY.js} +106 -107
  5. package/dist/cdn/75CJ2C4L.js +2 -0
  6. package/dist/cdn/7ITNTTBI.js +2 -0
  7. package/dist/cdn/{CN6VFVA2.js → BSIB6MUI.js} +1 -0
  8. package/dist/cdn/COBFCTOX.js +2 -0
  9. package/dist/cdn/CXBXMIVC.js +2 -0
  10. package/dist/cdn/{UY4FI7AP.js → FHXNY4QC.js} +1 -1
  11. package/dist/cdn/HN2XKXPX.js +2 -0
  12. package/dist/cdn/HRAAW2JX.js +2 -0
  13. package/dist/cdn/NCO7XIEC.js +3 -0
  14. package/dist/cdn/OG537NIF.js +2 -0
  15. package/dist/cdn/RNZITNTO.js +2 -0
  16. package/dist/cdn/{62K6RJZZ.js → SA7B3M2J.js} +1 -1
  17. package/dist/cdn/TBEVPWWN.js +2 -0
  18. package/dist/cdn/UIXYUELQ.js +2 -0
  19. package/dist/cdn/UY42NIH7.js +2 -0
  20. package/dist/cdn/VC3I52HI.js +2 -0
  21. package/dist/cdn/{ZYQ6U2YH.js → VDUOWASW.js} +14 -0
  22. package/dist/cdn/{NKNUZCLA.js → W2A22QZU.js} +15 -0
  23. package/dist/cdn/XI5SV3HJ.js +47 -0
  24. package/dist/cdn/XSVSCXUM.js +2 -0
  25. package/dist/cdn/XUUCW7HH.js +2 -0
  26. package/dist/cdn/{M7XUI5KY.js → Z6ZNHTPJ.js} +35 -3
  27. package/dist/cdn/ZF5LIGCC.js +275 -0
  28. package/dist/cdn/ZPGX72R2.js +4 -0
  29. package/dist/cdn/index.js +1 -1
  30. package/dist/cdn/main.css +1 -1
  31. package/dist/chunks/converterUtils.js +117 -0
  32. package/dist/chunks/utils.js +16 -14
  33. package/dist/chunks/utils2.js +8 -3
  34. package/dist/components/arcgis-assistant/customElement.d.ts +286 -23
  35. package/dist/components/arcgis-assistant/customElement.js +172 -142
  36. package/dist/components/arcgis-assistant/index.js +2 -1
  37. package/dist/components/arcgis-assistant/types.d.ts +97 -0
  38. package/dist/components/arcgis-assistant-agent/customElement.d.ts +22 -8
  39. package/dist/components/arcgis-assistant-agent/customElement.js +7 -7
  40. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -6
  41. package/dist/components/arcgis-assistant-chat/customElement.js +14 -14
  42. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +12 -5
  43. package/dist/components/arcgis-assistant-chat-card/customElement.js +59 -25
  44. package/dist/components/arcgis-assistant-chat-card/index.js +2 -0
  45. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +14 -12
  46. package/dist/components/arcgis-assistant-chat-card-content/index.js +1 -0
  47. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +5 -2
  48. package/dist/components/arcgis-assistant-chat-entry/customElement.js +42 -20
  49. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +73 -6
  50. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +5 -5
  51. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +73 -0
  52. package/dist/components/arcgis-assistant-help-agent/customElement.js +26 -0
  53. package/dist/components/arcgis-assistant-help-agent/index.d.ts +1 -0
  54. package/dist/components/arcgis-assistant-help-agent/index.js +1 -0
  55. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +1 -1
  56. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -8
  57. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +3 -3
  58. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +10 -10
  59. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +6 -6
  60. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +53 -6
  61. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +5 -5
  62. package/dist/components/arcgis-assistant-shell/customElement.d.ts +3 -0
  63. package/dist/components/arcgis-assistant-shell/customElement.js +12 -11
  64. package/dist/docs/api.json +1 -1
  65. package/dist/docs/docs.json +1 -1
  66. package/dist/docs/vscode.html-custom-data.json +1 -1
  67. package/dist/docs/web-types.json +1 -1
  68. package/dist/index.d.ts +16 -0
  69. package/dist/loader.js +9 -8
  70. package/dist/types/lumina.d.ts +19 -5
  71. package/dist/types/preact.d.ts +20 -5
  72. package/dist/types/react.d.ts +21 -5
  73. package/dist/types/stencil.d.ts +19 -5
  74. package/dist/utils/index.d.ts +305 -0
  75. package/dist/utils/index.js +13 -0
  76. package/package.json +15 -8
  77. package/dist/cdn/26V7SXDR.js +0 -4
  78. package/dist/cdn/4Y73V2HU.js +0 -2
  79. package/dist/cdn/5DFZMIRZ.js +0 -2
  80. package/dist/cdn/6ULHJSIQ.js +0 -245
  81. package/dist/cdn/AQZDEJJZ.js +0 -2
  82. package/dist/cdn/GCFT45CD.js +0 -2
  83. package/dist/cdn/I22GHLAO.js +0 -2
  84. package/dist/cdn/IFWK7P7O.js +0 -2
  85. package/dist/cdn/KJZARHAM.js +0 -2
  86. package/dist/cdn/M672SFG6.js +0 -2
  87. package/dist/cdn/MLJ7GXKB.js +0 -2
  88. package/dist/cdn/PCBMGVNZ.js +0 -4
  89. package/dist/cdn/Q674OE2M.js +0 -2
  90. package/dist/cdn/QOIX2B5M.js +0 -2
  91. package/dist/cdn/SOWNHB7F.js +0 -30
  92. package/dist/cdn/SW3IAT6V.js +0 -2
  93. package/dist/cdn/VUHDKXFM.js +0 -2
  94. package/dist/cdn/XVUE27HC.js +0 -2
  95. package/dist/cdn/ZFFHP5DI.js +0 -2
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as c}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as e,h as t,p as s,t as i}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var r=e`.assistant-chat-card__prompt-container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 25%,transparent);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.assistant-chat-card__prompt-avatar{display:flex;align-items:center;justify-content:center}.assistant-chat-card__content-container{display:flex;flex:1;flex-direction:column;width:100%}.assistant-chat-card__response-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.assistant-chat-card__response-icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.assistant-chat-card__footer{display:flex;width:100%;justify-content:space-between;padding:0 var(--calcite-spacing-xxs)}.assistant-chat-card__feedback-actions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xxs)}.assistant-chat-card__log-container{padding:0 var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-sm)}.assistant-chat-card__log{margin:0;font-size:var(--calcite-font-size-sm);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);width:100%;overflow:auto}.assistant-chat-card__footer-start{display:flex;gap:var(--calcite-spacing-xxs)}@media(min-width:1280px){.assistant-chat-card__prompt-container,.assistant-chat-card__response-container{max-width:80%}}`,a=class extends s{constructor(){super(...arguments),this._messages=c({blocking:!0}),this._showLog=!1,this.loading=!1,this.type="prompt",this.feedbackDisabled=!1,this.timestampDisabled=!1}static{this.properties={_showLog:16,loading:5,type:1,feedbackDisabled:5,timestampDisabled:5,content:1,loadingMessage:1,log:1,error:1,user:1}}static{this.styles=r}_renderLog(){return this.log&&this._showLog?t`<div class="assistant-chat-card__log-container"><pre class="assistant-chat-card__log">${this.log}</pre></div>`:null}_renderThumbsUpButton(){return t`<calcite-action id=action-thumbs-up icon=thumbs-up scale=s appearance=transparent @click=${()=>{}} text></calcite-action><calcite-tooltip reference-element=action-thumbs-up overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsUpLabel}</span></calcite-tooltip>`}_renderThumbsDownButton(){return t`<calcite-action id=action-thumbs-down icon=thumbs-down scale=s appearance=transparent @click=${()=>{}} text></calcite-action><calcite-tooltip reference-element=action-thumbs-down overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsDownLabel}</span></calcite-tooltip>`}_renderFeedback(){return!this.feedbackDisabled&&!this.error?t`<div class="assistant-chat-card__feedback-actions">${this._renderThumbsUpButton()}${this._renderThumbsDownButton()}</div>`:null}_renderCopyButton(){return this.error?null:t`<calcite-action id=action-copy icon=copy-to-clipboard scale=s appearance=transparent @click=${async()=>{try{this.content&&await navigator.clipboard.writeText(this.content)}catch(n){console.error("Failed to copy text to clipboard:",n)}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`}_renderLogButton(){return this.log?t`<calcite-action id=action-log icon=access-string-results scale=s appearance=transparent @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}_renderFooter(){return this.loading?null:t`<div class="assistant-chat-card__footer"><slot name=footer-start class="assistant-chat-card__footer-start">${this._renderCopyButton()}${this._renderLogButton()}</slot>${this._renderFeedback()}</div>`}render(){return this.type==="prompt"?t`<div class="assistant-chat-card__prompt-container"><div>${this.content}</div><div class="assistant-chat-card__prompt-avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></div>`:t`<div class="assistant-chat-card__response-container"><calcite-icon icon=effects class="assistant-chat-card__response-icon"></calcite-icon><div class="assistant-chat-card__content-container"><arcgis-assistant-chat-card-content .loading=${this.loading} .loadingMessage=${this.loadingMessage} .type=${this.error?"error":"text"} .content=${this.error??this.content}></arcgis-assistant-chat-card-content>${this._renderLog()}${this._renderFooter()}</div></div>`}};i("arcgis-assistant-chat-card",a);export{a as ArcgisAssistantChatCard};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function n(e){return e?typeof e=="string"?document.querySelector(e):e:null}export{n as a};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{g as e,h as t,n as i,o,p as r,t as n}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([c,{watch:l}])=>{var g=e`.assistant-chat__messages-container{display:flex;flex:1;flex-direction:column}.assistant-chat__messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-md);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`,a=class extends r{constructor(){super(...arguments),this.#s=i(),this.loading=!1,this.loadingMessage="",this.messages=new c([])}static{this.properties={loading:5,loadingMessage:1,user:1,messages:0}}static{this.styles=g}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.requestUpdate(),this._scrollToEnd()}),l(()=>this.loading,()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return t`<div class="assistant-chat__messages-container"><div class="assistant-chat__messages-list"><slot></slot>${this.messages.map(s=>t`<arcgis-assistant-chat-card .type=${s.type} .content=${s.content} .log=${s.log} .error=${s.error} .user=${this.user}></arcgis-assistant-chat-card>`)}${this.loading?t`<arcgis-assistant-chat-card .loading=${this.loading} .loadingMessage=${this.loadingMessage} type=response></arcgis-assistant-chat-card>`:null}</div><div ${o(this.#s)}></div></div>`}};n("arcgis-assistant-chat",a);return a},"core/Collection","core/reactiveUtils")
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as o}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as a,h as t,k as e,p as n,t as l}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var r=a`.assistant-shell__footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.assistant-shell__content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative}.assistant-shell__suggested-prompts-container{position:absolute;bottom:0;display:flex;justify-content:center;width:100%}.assistant-shell__suggested-prompts{padding:var(--calcite-spacing-md)}.assistant-shell__suggested-prompt{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal}`,i=class extends n{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.description="",this.loading=!1,this.entryMessageClosed=!1,this.awaitingResponse=!1,this.suggestedPrompts=[],this.inputValue="",this.arcgisCancel=e(),this.arcgisSubmit=e()}static{this.properties={heading:1,description:1,loading:5,entryMessage:1,entryMessageClosed:5,awaitingResponse:5,suggestedPrompts:0,inputValue:1,status:1}}static{this.styles=r}_renderSuggestedPrompts(){return this.suggestedPrompts?.length?t`<div class="assistant-shell__suggested-prompts-container"><calcite-chip-group class="assistant-shell__suggested-prompts" .label=${this._messages.suggestedPromptsLabel??"suggested prompts"} selection-mode=single-persist @calciteChipGroupSelect=${s=>this.inputValue=s.target.selectedItems[0]?.value??""}>${this.suggestedPrompts.map(s=>t`<calcite-chip closable .value=${s} .label=${s} appearance=outline-fill kind=brand><div class="assistant-shell__suggested-prompt">${s}</div></calcite-chip>`)}</calcite-chip-group></div>`:null}render(){return t`<calcite-panel .loading=${this.loading} .heading=${this.heading??this._messages.shellHeading} .description=${this.description}><slot slot=header-actions-end name=header-actions-end></slot><div class="assistant-shell__content-container"><slot></slot>${this._renderSuggestedPrompts()}</div><div class="assistant-shell__footer-container" slot=footer><slot name=entry-message>${this.entryMessageClosed?null:t`<calcite-notice slot=entry-message .open=${!this.entryMessageClosed} kind=info closable icon width=full><div slot=message>${this.entryMessage??this._messages.shellEntryMessage}</div></calcite-notice>`}</slot><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .arcgisSubmit=${this.arcgisSubmit} .arcgisCancel=${this.arcgisCancel} .inputValue=${this.inputValue} .status=${this.status}><slot name=entry-actions-start slot=entry-actions-start></slot></arcgis-assistant-chat-entry><slot name=footer-content></slot></div></calcite-panel>`}};l("arcgis-assistant-shell",i);export{i as ArcgisAssistantShell};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as s}from"./I22GHLAO.js";import{b as o}from"./WBSNYWJJ.js";function i(e,t){let n=s(e.referenceElement);if(n)return n;let r=o(e.el,"arcgis-assistant"),a=s(r?.referenceElement);if(a)return a;throw new Error(`${t}: Reference element not found`)}async function m(e,t){let n=i(e,t);await n.componentOnReady();let r=n.view;if(!r)throw new Error(`${t}: Reference element does not have a view`);return await r.when(),r}function g(e){let t=o(e.el,"arcgis-assistant");if(t===void 0)throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");t.register({agent:e.agent,getContext:()=>e.getContext?.()??e.context??{}})}export{m as a,g as b};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import c from"./6ULHJSIQ.js";import b from"./R3LASMEM.js";import{a as i,b as e}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as a,t as s}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{a:r}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await i(this,"arcgis-assistant-navigation-agent"),e(this)}};s("arcgis-assistant-navigation-agent",t);return t},b,c)
@@ -1,4 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as b}from"./UY4FI7AP.js";import a from"./R3LASMEM.js";import{a as f}from"./I22GHLAO.js";import"./WBSNYWJJ.js";import{g as y,h,n as g,o as u,p as v,t as _}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([E,{whenOnce:k,watch:L,when:S},O,P,{property:c,subclass:C},{y:w}])=>{var H=y`:host{height:100%}`,M=Object.defineProperty,x=Object.getOwnPropertyDescriptor,n=(l,t,e,r)=>{for(var s=r>1?void 0:r?x(t,e):t,a=l.length-1,o;a>=0;a--)(o=l[a])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&M(t,e,s),s},i=class extends P{constructor(l){super(l),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 k(()=>!this.view.updating),this._set("orchestrator",await w.init({agents:[...this.agents],portal:this.portal,view:this.view??void 0})),this.addHandles([L(()=>[this.view,this.agents],()=>void this._initialize())])}async*ask(l,t){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let e="";try{let r=this.orchestrator.ask(l);for await(let s of r){if(t?.aborted){yield{type:"cancelled"};break}switch(s.type){case"trace":{this._set("processingStep",s.data.text),e+=`${s.data.text}
3
-
4
- `;break}case"completed":{if(!s.result.content.length){yield{type:"completed",error:"Could not process the request.",log:e};return}let a=s.result.content;this._set("processingStep",""),yield{type:"completed",response:a,log:e};return}case"interrupt":{console.log("Orchestrator interrupt:",s);let{kind:a,message:o,metadata:m}=s.interrupt,p=Array.isArray(m)?[...m]:[],$=(()=>{switch(a){case"booleanChoice":return{type:"boolean-choice",message:o,options:p};case"singleSelection":return{type:"single-select",message:o,options:p};case"multipleSelection":return{type:"multi-select",message:o,options:p};case"textInput":return{type:"text-input",message:o};default:return{type:a,message:o,options:p}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:$};break}case"cancelled":{yield{type:"cancelled"};return}default:{console.warn("Unknown event type:",s);break}}}}catch(r){console.warn("Error during message processing:",r),yield{type:"completed",error:"An error occurred during message processing.",log:e};return}finally{this._set("processing",!1)}}};n([c({readOnly:!0})],i.prototype,"orchestrator",2);n([c()],i.prototype,"agents",2);n([c()],i.prototype,"portal",2);n([c()],i.prototype,"view",2);n([c({readOnly:!0})],i.prototype,"loading",2);n([c({readOnly:!0})],i.prototype,"processing",2);n([c({readOnly:!0})],i.prototype,"processingStep",2);i=n([C("OrchestratorController")],i);var d=class extends v{constructor(){super(...arguments),this._messages=b({blocking:!0}),this.#e=g(),this.#s=g(),this.#t=null,this.#r=null,this.#a=new Map,this.#i=t=>{t.stopPropagation(),this.orchestrator?.cancelInterrupt(),this._interrupt=null},this.#o=t=>{t.stopPropagation();let e=t.detail;this.orchestrator?.resumeInterrupt(e),this._interrupt=null},this.#n=t=>{t.stopPropagation(),this.suggestedPrompts=[];let e=t.detail;this.#h(e)},this.#l=t=>{if(t.stopPropagation(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this.#r?.abort()},this._interrupt=null,this._chatHistory=new E([]),this._error=null,this.referenceElement=null,this.portal=new O,this.suggestedPrompts=[]}static{this.properties={_interrupt:16,_chatHistory:16,_error:16,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,portal:0,suggestedPrompts:0}}static{this.styles=H}#e;#s;#t;#r;#a;#i;#o;#n;#l;get orchestrator(){return this.#t?.orchestrator}register(t){this.#a.set(t.agent.id,t)}load(){this.manager.onLifecycle(()=>()=>{this.#r?.abort(),this._interrupt=null,this._chatHistory.removeAll(),this._error=null})}loaded(){this.manager.onLifecycle(()=>{this.#e.value?.addEventListener("arcgisSubmit",this.#n),this.#e.value?.addEventListener("arcgisCancel",this.#l);let t=S(()=>!!this._interrupt&&!!this.#s.value,()=>{let e=this.#s.value;e.removeEventListener("arcgisSubmit",this.#o),e.removeEventListener("arcgisCancel",this.#i),e.addEventListener("arcgisSubmit",this.#o,{once:!0}),e.addEventListener("arcgisCancel",this.#i,{once:!0})});return queueMicrotask(()=>void this.#c()),()=>{t.remove(),this.#s.value?.removeEventListener("arcgisSubmit",this.#o),this.#s.value?.removeEventListener("arcgisCancel",this.#i),this.#e.value?.removeEventListener("arcgisSubmit",this.#n),this.#e.value?.removeEventListener("arcgisCancel",this.#l),this.#t?.destroy(),this.#t=null}})}async#c(){try{let t=f(this.referenceElement);await t?.componentOnReady();let e=[...this.#a.values()];this.#t=new i({agents:e,portal:this.portal,view:t?.view}),await this.#t.load()}catch(t){console.warn(t),this._error="Error initializing orchestrator."}}async#h(t){let e=t.trim();if(!e||(this._chatHistory.push({type:"prompt",content:e}),!this.#t))return;this.#r=new AbortController;let r=this.#t.ask(e,this.#r.signal);for await(let s of r)switch(s.type){case"completed":this._chatHistory.push({type:"response",content:s.response,log:s.log,error:s.error});break;case"interrupt":this._interrupt=s.payload;break;case"cancelled":this._chatHistory.push({type:"response",error:"Request cancelled."});break}}render(){return h`<arcgis-assistant-shell .loading=${this.#t?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} .entryMessage=${this.entryMessage} .entryMessageClosed=${this._chatHistory.length>0} .awaitingResponse=${this.#t?.processing} .suggestedPrompts=${this.suggestedPrompts} .status=${this.#t?.processing?"working":this._error?"error":"ready"} ${u(this.#e)}>${this._error?h`<calcite-notice slot=entry-message open kind=danger icon width=full><div slot=message>${this._error}</div></calcite-notice>`:null}${this._interrupt?h`<arcgis-assistant-interrupt slot=entry-message .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${u(this.#s)}></arcgis-assistant-interrupt>`:null}<arcgis-assistant-chat .loading=${this.#t?.processing} .loadingMessage=${this.#t?.processingStep||""} .messages=${this._chatHistory} .user=${this.portal?.user?.fullName||this.portal?.user?.username}><slot></slot></arcgis-assistant-chat><slot name=header-actions-end slot=header-actions-end></slot>${this.entryMessage?null:h`<slot name=entry-message slot=entry-message></slot>`}<slot name=entry-actions-start slot=entry-actions-start></slot><slot name=footer-content slot=footer-content></slot></arcgis-assistant-shell>`}};_("arcgis-assistant",d);return d},"core/Collection","core/reactiveUtils","portal/Portal","core/Accessor","core/accessorSupport/decorators",a)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as n}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as a,h as e,k as s,p as l,t as c}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var o=a``,i=class extends l{constructor(){super(...arguments),this.#t=[],this._messages=n({blocking:!0}),this.arcgisCancel=s(),this.arcgisSubmit=s()}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(r=>r.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":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"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}>${this._renderInterruptOptions()}<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.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};c("arcgis-assistant-interrupt",i);export{i as ArcgisAssistantInterrupt};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import c from"./6ULHJSIQ.js";import b from"./R3LASMEM.js";import{a as r,b as e}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as a,t as s}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{b:i}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await r(this,"arcgis-assistant-data-exploration-agent"),e(this)}};s("arcgis-assistant-data-exploration-agent",t);return t},b,c)
@@ -1,30 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"./CFDTXKJ6.js";var e=`## Task: Summarize Geographic Features
3
-
4
- You are given features from ArcGIS Feature layer for multiple layers:
5
- {queryResponse}
6
-
7
- Also consider any **relevant context from the chat history**, such as user questions or instructions.
8
-
9
- ### Your goal:
10
-
11
- 1. If the user question is about a **specific calculation** (e.g., average, total, count, min, max), return only the **direct numeric answer** \u2014 short and clear.
12
- - Example: \u201CThe average price is $4.00.\u201D
13
-
14
- 2. If the question is more general or there are **multiple features with varying attributes**, write a **brief summary** (2\u20133 sentences max) that highlights key patterns or insights.
15
-
16
- 3. The response can be per layer, or summarize based on the question.
17
-
18
- 4. When the user asks "where" a feature is located: Simply confirm whether the feature was found and in which layer. DO NOT attempt to provide coordinates, addresses, or geographic descriptions.
19
-
20
- 5. DO NOT ramble.
21
-
22
- 6. Use bullet points for lists and use new lines (\\n) and appropriate formatting in your response
23
-
24
- In all cases:
25
-
26
- - Focus on **notable attribute values**, **commonalities or differences**, and **interesting trends**.
27
- - If the feature list is empty or not meaningful, state that clearly.
28
-
29
- **Keep your response concise and relevant to the user\u2019s question.**
30
- `;export{e as default};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import c from"./6ULHJSIQ.js";import b from"./R3LASMEM.js";import{a as s,b as a}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as r,t as e}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{d:i}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-query-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await s(this,"arcgis-assistant-layer-query-agent"),a(this)}};e("arcgis-assistant-layer-query-agent",t);return t},b,c)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as u}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as i,h as s,k as a,n as r,o as n,p as c,r as o,t as l}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{watch:h}])=>{var d=i`.assistant-chat-entry__input-container{display:flex;flex-direction:column}.assistant-chat-entry__footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.assistant-chat-entry__footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.assistant-chat-entry__status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.assistant-chat-entry__status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.assistant-chat-entry__status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.assistant-chat-entry__status-text{text-transform:capitalize}`,e=class extends c{constructor(){super(...arguments),this.#t=r(),this._messages=u({blocking:!0}),this.enterKeySubmits=!0,this.awaitingResponse=!1,this.inputValue="",this.arcgisCancel=a(),this.arcgisSubmit=a()}static{this.properties={enterKeySubmits:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1}}static{this.styles=d}#t;loaded(){this.manager.onLifecycle(()=>[h(()=>this.inputValue,t=>{this.#t.value&&(this.#t.value.value=t)},{initial:!0})])}async _submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.#t.value?.value.trim();t&&(this.arcgisSubmit.emit(t),this.#t.value&&(this.#t.value.value="",await this.#t.value.setFocus()))}render(){return s`<div class="assistant-chat-entry__input-container"><calcite-text-area .value=${this.#t.value?.value} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} @keydown=${async t=>{t.key==="Enter"&&!t.shiftKey&&this.enterKeySubmits&&(t.preventDefault(),await this._submitMessage())}} ${n(this.#t)}><div slot=footer-start class="assistant-chat-entry__footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="assistant-chat-entry__footer-end">${this.status?s`<div id=tooltip-status class="assistant-chat-entry__status-indicator" data-status=${this.status??o}></div><calcite-tooltip reference-element=tooltip-status offset-distance=12><span class="assistant-chat-entry__status-text">${this.status}</span></calcite-tooltip>`:null}<calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} slot=footer-end round @click=${()=>void this._submitMessage()}>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></div></calcite-text-area></div>`}};l("arcgis-assistant-chat-entry",e);return e},"core/reactiveUtils")
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{g as i,h as t,p as r,q as e,t as o}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var c=i`.assistant-chat-card-content__skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.assistant-chat-card-content__skeleton-text{display:block;height:.95em;border-radius:6px;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-chat-card-content-shimmer 1.2s ease-in-out infinite;width:85%}.assistant-chat-card-content__skeleton-text:last-child{width:70%}@keyframes assistant-chat-card-content-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.assistant-chat-card-content__skeleton-text{animation:none}}.assistant-chat-card-content__text-container{padding:var(--calcite-spacing-sm);display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);color:var(--calcite-color-text-1)}.assistant-chat-card-content__text-loading{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.assistant-chat-card-content__error-notice{padding:var(--calcite-spacing-sm)}`,n="assistant-chat-card-content",a={textLoading:`${n}__text-loading`,skeletonBlock:`${n}__skeleton-block`,skeletonText:`${n}__skeleton-text`},s=class extends r{constructor(){super(...arguments),this.loading=!1,this.type="text"}static{this.properties={loading:5,type:1,content:1,loadingMessage:1}}static{this.styles=c}_renderText(){return t`<div class="assistant-chat-card-content__text-container"><div><span class=${e(this.loading?a.textLoading:void 0)}>${this.loading?this.loadingMessage:this.content}</span></div>${this.loading?t`<div class=${e(a.skeletonBlock)}><span class=${e(a.skeletonText)}></span><span class=${e(a.skeletonText)}></span></div>`:null}</div>`}_renderError(){return t`<calcite-notice class="assistant-chat-card-content__error-notice" open icon kind=warning width=auto><div slot=message>${this.content}</div></calcite-notice>`}render(){switch(this.type){case"text":return this._renderText();case"error":return this._renderError();default:return t`<p>Unsupported content type</p>`}}};o("arcgis-assistant-chat-card-content",s);export{s as ArcgisAssistantChatCardContent};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import c from"./6ULHJSIQ.js";import b from"./R3LASMEM.js";import{a as e,b as i}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as s,t as a}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{e:r}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await e(this,"arcgis-assistant-layer-styling-agent"),i(this)}};a("arcgis-assistant-layer-styling-agent",t);return t},b,c)