@arcgis/coding-components 5.0.0-next.155 → 5.0.0-next.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{JUSMJGLC.js → 3YF4QLXU.js} +4 -4
- package/dist/cdn/{YK255XEU.js → 4Y2WQD7U.js} +1 -1
- package/dist/cdn/{LSN2L6MF.js → 6MTR3FWI.js} +1 -1
- package/dist/cdn/{QOCH5PNU.js → BE4FGKNF.js} +1 -1
- package/dist/cdn/{RHWX2DDB.js → BUY5C6Q3.js} +1 -1
- package/dist/cdn/{EVSXXHQ5.js → DC37R7JC.js} +1 -1
- package/dist/cdn/{CRFEM3QK.js → DZKPWNZA.js} +1 -1
- package/dist/cdn/{3GTG7FWY.js → EHTEMHJI.js} +1 -1
- package/dist/cdn/{3IYCM3T5.js → FAW7SB6B.js} +1 -1
- package/dist/cdn/{K6IFHJHH.js → FBCPJVPT.js} +1 -1
- package/dist/cdn/{YPRQHETI.js → H75AOE6T.js} +1 -1
- package/dist/cdn/{AILSAJ35.js → HS63YTYQ.js} +1 -1
- package/dist/cdn/{HUEGOCW7.js → I7L3FJ54.js} +1 -1
- package/dist/cdn/{HDPC4QT2.js → MZTGDRYK.js} +1 -1
- package/dist/cdn/{JQCRR5L6.js → NEEMZKOL.js} +1 -1
- package/dist/cdn/{M5R2ARCR.js → QPOKIVLR.js} +1 -1
- package/dist/cdn/{5YBXZZX6.js → RVGVRKXU.js} +1 -1
- package/dist/cdn/assets/code-editor/arcade.worker.js +8 -0
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +2 -2
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +46 -46
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +5 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as F}from"./72K7GT6K.js";import{a as w}from"./EMCHMKAC.js";import{a as m,b as i,c as E,g as M}from"./JUSMJGLC.js";import"./VVVV256M.js";import{b as f}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import{Qk as L,Uk as x,Xk as p,al as g}from"./YCOWKBW5.js";import"./ALDX5YZO.js";var $=["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],P={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n ",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},W={defaultToken:"invalid",tokenPostfix:".arcgis",ignoreCase:!0,keywords:M,operators:$,constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/for(?=\s)/u,{token:"keyword",next:"@forLoopInit"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],forLoopInit:[{include:"@whitespace"},[/\(/u,{token:"@brackets",next:"@forLoopVar"}],[/.*/u,"","@pop"]],forLoopVar:[{include:"@whitespace"},[/var(?=\s)/u,"keyword","@forLoopVarName"],[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopVarName:[{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopCheckInOf:[{include:"@whitespace"},[/in(?=\s)/u,"keyword","@popall"],[/of(?=\s)/u,"keyword","@popall"],[/[a-z_$][\w$]*/u,"identifier"],[/\)/u,{token:"@brackets",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}},b=class{constructor(e,n,{defaults:o,diagnosticsService:d}){this._languageId=e,this._worker=n,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=d,this._defaults=o,w().then(c=>{let u=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let a=F(()=>{this._doValidate(s,r).catch(D=>{throw D})}),A=s.onDidChangeContent(a),S=s.onDidChangeAttached(a);this._modelListeners.set(s.uri.toString(),[A,S]),this._doValidate(s,r).catch(f("DiagnosticsAdapter"))},l=s=>{let r=s.uri.toString();c.setModelMarkers(s,this._languageId,[]);let a=this._modelListeners.get(r);if(a){for(;a.length;)a.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(c.onDidCreateModel(u)),this._disposables.push(c.onWillDisposeModel(s=>{l(s)})),this._disposables.push(c.onDidChangeModelLanguage(s=>{l(s.model),u(s.model)})),this._disposables.push(o.onDidChange(()=>{c.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(l(s),u(s))})})),this._disposables.push(o.onModelContextDidChange(s=>{c.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(f("DiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),c.getModels().forEach(u)})}dispose(){this._disposables.forEach(e=>e.dispose()),this._disposables=[]}async _doValidate(e,n){if(e.isAttachedToEditor())try{let o=await w(),d=await this._worker(e.uri),c=this._defaults.getApiContextForModel(e.uri),u=await d.doValidation(e.uri.toString(),c),l=u.map(s=>R(e.uri,s));this._diagnosticsService.fireDiagnosticsChange(e.uri,u),o.setModelMarkers(e,n,l)}catch(o){f("DiagnosticsAdapter")(o)}}};function V(t){switch(t){case m.Error:return p.Error;case m.Warning:return p.Warning;case m.Information:return p.Info;case m.Hint:return p.Hint;default:return p.Info}}function R(t,e){return{severity:V(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message}}function K(t){return{character:t.column-1,line:t.lineNumber-1}}function h(t){return new x(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function N(t){return{range:h(t.range),text:t.newText}}function z(t){return typeof t.insert<"u"&&typeof t.replace<"u"}function O(t){let e=g.CompletionItemKind;switch(t){case i.Text:return e.Text;case i.Method:return e.Method;case i.Function:return e.Function;case i.Constructor:return e.Constructor;case i.Field:return e.Field;case i.Variable:return e.Variable;case i.Class:return e.Class;case i.Interface:return e.Interface;case i.Module:return e.Module;case i.Property:return e.Property;case i.Unit:return e.Unit;case i.Value:return e.Value;case i.Enum:return e.Enum;case i.Keyword:return e.Keyword;case i.Snippet:return e.Snippet;case i.Color:return e.Color;case i.File:return e.File;case i.Reference:return e.Reference;case i.Folder:return e.Folder;case i.EnumMember:return e.EnumMember;case i.Constant:return e.Constant;case i.Struct:return e.Struct;case i.Event:return e.Event;case i.Operator:return e.Operator;case i.TypeParameter:return e.TypeParameter;default:return e.Property}}var C=class{constructor(e,n){this._worker=e,this._defaults=n,this.triggerCharacters=[".","("]}async provideCompletionItems(e,n){let o=await this._worker(e.uri),d=this._defaults.getApiContextForModel(e.uri),c=await o.doComplete(e.uri.toString(),K(n),d),u=e.getWordUntilPosition(n),l=new x(n.lineNumber,u.startColumn,n.lineNumber,u.endColumn),s=c.items.map(r=>{let a={label:r.label,insertText:r.insertText||r.label,sortText:r.sortText,filterText:r.filterText,detail:r.detail,range:l,kind:O(r.kind)};return r.textEdit&&(z(r.textEdit)?a.range={insert:h(r.textEdit.insert),replace:h(r.textEdit.replace)}:a.range=h(r.textEdit.range),a.insertText=r.textEdit.newText),r.additionalTextEdits&&(a.additionalTextEdits=r.additionalTextEdits.map(N)),r.insertTextFormat===E.Snippet&&(a.insertTextRules=g.CompletionItemInsertTextRule.InsertAsSnippet),r.documentation&&(typeof r.documentation=="string"?a.documentation=r.documentation:a.documentation={supportThemeIcons:!1,value:r.documentation.value,supportHtml:!0}),a});return{incomplete:c.isIncomplete,suggestions:s}}},y=class{constructor(e,n){this._worker=e,this._defaults=n}async provideDocumentFormattingEdits(e){let n=await this._worker(e.uri),o=this._defaults.getApiContextForModel(e.uri.toString());return(await n.doFormat(e.uri.toString(),o)).map(d=>({range:h(d.range),text:d.newText}))}},_=Promise.withResolvers(),k=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,_=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await _.promise}async _getClientProxy(){let e=await w();if(!this._client){let{languageId:n}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating Arcade workers.");this._worker=e.createWebWorker({worker:o("ArcadeWorker",n),host:this._defaults.workerHost}),_.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let n=await this._getClientProxy();return await this._worker?.withSyncedResources(e),n}},I;async function re(...t){return await k.waitForWorker(),await new Promise((e,n)=>{if(!I){n(new Error("Arcade not registered!"));return}e(I(...t))})}var v=class{constructor(){this._onDiagnosticsChange=new L}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,n){this._onDiagnosticsChange.fire({uri:e,diagnostics:n})}},T=new v;function ne(){return T}function se(t){let e=new k(t),n=async(...o)=>await e.getLanguageServiceWorker(...o);I=n,g.setMonarchTokensProvider(t.languageId,W),g.setLanguageConfiguration(t.languageId,P),g.registerCompletionItemProvider(t.languageId,new C(n,t)),g.registerDocumentFormattingEditProvider(t.languageId,new y(n,t)),new b(t.languageId,n,{defaults:t,diagnosticsService:T})}export{ne as getArcadeDiagnosticService,re as getArcadeWorker,se as setupMode};
|
|
2
|
+
import{a as F}from"./72K7GT6K.js";import{a as w}from"./EMCHMKAC.js";import{a as m,b as i,c as E,g as M}from"./3YF4QLXU.js";import"./VVVV256M.js";import{b as f}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import{Qk as L,Uk as x,Xk as p,al as g}from"./YCOWKBW5.js";import"./ALDX5YZO.js";var $=["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],P={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n ",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},W={defaultToken:"invalid",tokenPostfix:".arcgis",ignoreCase:!0,keywords:M,operators:$,constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/for(?=\s)/u,{token:"keyword",next:"@forLoopInit"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],forLoopInit:[{include:"@whitespace"},[/\(/u,{token:"@brackets",next:"@forLoopVar"}],[/.*/u,"","@pop"]],forLoopVar:[{include:"@whitespace"},[/var(?=\s)/u,"keyword","@forLoopVarName"],[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopVarName:[{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopCheckInOf:[{include:"@whitespace"},[/in(?=\s)/u,"keyword","@popall"],[/of(?=\s)/u,"keyword","@popall"],[/[a-z_$][\w$]*/u,"identifier"],[/\)/u,{token:"@brackets",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}},b=class{constructor(e,n,{defaults:o,diagnosticsService:d}){this._languageId=e,this._worker=n,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=d,this._defaults=o,w().then(c=>{let u=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let a=F(()=>{this._doValidate(s,r).catch(D=>{throw D})}),A=s.onDidChangeContent(a),S=s.onDidChangeAttached(a);this._modelListeners.set(s.uri.toString(),[A,S]),this._doValidate(s,r).catch(f("DiagnosticsAdapter"))},l=s=>{let r=s.uri.toString();c.setModelMarkers(s,this._languageId,[]);let a=this._modelListeners.get(r);if(a){for(;a.length;)a.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(c.onDidCreateModel(u)),this._disposables.push(c.onWillDisposeModel(s=>{l(s)})),this._disposables.push(c.onDidChangeModelLanguage(s=>{l(s.model),u(s.model)})),this._disposables.push(o.onDidChange(()=>{c.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(l(s),u(s))})})),this._disposables.push(o.onModelContextDidChange(s=>{c.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(f("DiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),c.getModels().forEach(u)})}dispose(){this._disposables.forEach(e=>e.dispose()),this._disposables=[]}async _doValidate(e,n){if(e.isAttachedToEditor())try{let o=await w(),d=await this._worker(e.uri),c=this._defaults.getApiContextForModel(e.uri),u=await d.doValidation(e.uri.toString(),c),l=u.map(s=>R(e.uri,s));this._diagnosticsService.fireDiagnosticsChange(e.uri,u),o.setModelMarkers(e,n,l)}catch(o){f("DiagnosticsAdapter")(o)}}};function V(t){switch(t){case m.Error:return p.Error;case m.Warning:return p.Warning;case m.Information:return p.Info;case m.Hint:return p.Hint;default:return p.Info}}function R(t,e){return{severity:V(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message}}function K(t){return{character:t.column-1,line:t.lineNumber-1}}function h(t){return new x(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function N(t){return{range:h(t.range),text:t.newText}}function z(t){return typeof t.insert<"u"&&typeof t.replace<"u"}function O(t){let e=g.CompletionItemKind;switch(t){case i.Text:return e.Text;case i.Method:return e.Method;case i.Function:return e.Function;case i.Constructor:return e.Constructor;case i.Field:return e.Field;case i.Variable:return e.Variable;case i.Class:return e.Class;case i.Interface:return e.Interface;case i.Module:return e.Module;case i.Property:return e.Property;case i.Unit:return e.Unit;case i.Value:return e.Value;case i.Enum:return e.Enum;case i.Keyword:return e.Keyword;case i.Snippet:return e.Snippet;case i.Color:return e.Color;case i.File:return e.File;case i.Reference:return e.Reference;case i.Folder:return e.Folder;case i.EnumMember:return e.EnumMember;case i.Constant:return e.Constant;case i.Struct:return e.Struct;case i.Event:return e.Event;case i.Operator:return e.Operator;case i.TypeParameter:return e.TypeParameter;default:return e.Property}}var C=class{constructor(e,n){this._worker=e,this._defaults=n,this.triggerCharacters=[".","("]}async provideCompletionItems(e,n){let o=await this._worker(e.uri),d=this._defaults.getApiContextForModel(e.uri),c=await o.doComplete(e.uri.toString(),K(n),d),u=e.getWordUntilPosition(n),l=new x(n.lineNumber,u.startColumn,n.lineNumber,u.endColumn),s=c.items.map(r=>{let a={label:r.label,insertText:r.insertText||r.label,sortText:r.sortText,filterText:r.filterText,detail:r.detail,range:l,kind:O(r.kind)};return r.textEdit&&(z(r.textEdit)?a.range={insert:h(r.textEdit.insert),replace:h(r.textEdit.replace)}:a.range=h(r.textEdit.range),a.insertText=r.textEdit.newText),r.additionalTextEdits&&(a.additionalTextEdits=r.additionalTextEdits.map(N)),r.insertTextFormat===E.Snippet&&(a.insertTextRules=g.CompletionItemInsertTextRule.InsertAsSnippet),r.documentation&&(typeof r.documentation=="string"?a.documentation=r.documentation:a.documentation={supportThemeIcons:!1,value:r.documentation.value,supportHtml:!0}),a});return{incomplete:c.isIncomplete,suggestions:s}}},y=class{constructor(e,n){this._worker=e,this._defaults=n}async provideDocumentFormattingEdits(e){let n=await this._worker(e.uri),o=this._defaults.getApiContextForModel(e.uri.toString());return(await n.doFormat(e.uri.toString(),o)).map(d=>({range:h(d.range),text:d.newText}))}},_=Promise.withResolvers(),k=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,_=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await _.promise}async _getClientProxy(){let e=await w();if(!this._client){let{languageId:n}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating Arcade workers.");this._worker=e.createWebWorker({worker:o("ArcadeWorker",n),host:this._defaults.workerHost}),_.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let n=await this._getClientProxy();return await this._worker?.withSyncedResources(e),n}},I;async function re(...t){return await k.waitForWorker(),await new Promise((e,n)=>{if(!I){n(new Error("Arcade not registered!"));return}e(I(...t))})}var v=class{constructor(){this._onDiagnosticsChange=new L}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,n){this._onDiagnosticsChange.fire({uri:e,diagnostics:n})}},T=new v;function ne(){return T}function se(t){let e=new k(t),n=async(...o)=>await e.getLanguageServiceWorker(...o);I=n,g.setMonarchTokensProvider(t.languageId,W),g.setLanguageConfiguration(t.languageId,P),g.registerCompletionItemProvider(t.languageId,new C(n,t)),g.registerDocumentFormattingEditProvider(t.languageId,new y(n,t)),new b(t.languageId,n,{defaults:t,diagnosticsService:T})}export{ne as getArcadeDiagnosticService,re as getArcadeWorker,se as setupMode};
|
|
@@ -13725,6 +13725,9 @@ class z1 {
|
|
|
13725
13725
|
case g.ObjectExpression:
|
|
13726
13726
|
this.validateObjectExpression(i);
|
|
13727
13727
|
return;
|
|
13728
|
+
case g.MemberAccessChainExpression:
|
|
13729
|
+
this.validateMemberAccessChainExpression(i);
|
|
13730
|
+
return;
|
|
13728
13731
|
case g.UnaryExpression:
|
|
13729
13732
|
this.validateUnaryExpression(i);
|
|
13730
13733
|
return;
|
|
@@ -13735,6 +13738,7 @@ class z1 {
|
|
|
13735
13738
|
case g.LogicalExpression:
|
|
13736
13739
|
this.validateBinaryAndLogicalExpression(i);
|
|
13737
13740
|
return;
|
|
13741
|
+
case g.SafeMemberExpression:
|
|
13738
13742
|
case g.MemberExpression:
|
|
13739
13743
|
this.validateMemberExpression(i);
|
|
13740
13744
|
return;
|
|
@@ -13950,12 +13954,16 @@ class z1 {
|
|
|
13950
13954
|
validateBinaryAndLogicalExpression(e) {
|
|
13951
13955
|
this.validateExpression(e.left), this.validateExpression(e.right);
|
|
13952
13956
|
}
|
|
13957
|
+
validateMemberAccessChainExpression(e) {
|
|
13958
|
+
this.validateExpression(e.expression);
|
|
13959
|
+
}
|
|
13953
13960
|
validateMemberExpression(e) {
|
|
13954
13961
|
const n = this.flattenMemberExpressionAndValidate(e), i = n[0].object;
|
|
13955
13962
|
this.disableRecordIdentifierAssignment(this.validateExpression, i), _e(i) && (this.getIdentifierInfo(i.name.toLowerCase()) || this.validateMemberExpressionWithProfile(n) || this.validateConstantMemberExpression(n));
|
|
13956
13963
|
}
|
|
13957
13964
|
flattenMemberExpressionAndValidate(e) {
|
|
13958
13965
|
switch (e.type) {
|
|
13966
|
+
case g.SafeMemberExpression:
|
|
13959
13967
|
case g.MemberExpression:
|
|
13960
13968
|
return (!_e(e.property) || e.computed) && this.validateExpression(e.property), [...this.flattenMemberExpressionAndValidate(e.object), e];
|
|
13961
13969
|
default:
|
|
@@ -17381,7 +17381,7 @@ F.add = (t, e, r, n) => {
|
|
|
17381
17381
|
}), F.add("wasm-simd", () => {
|
|
17382
17382
|
const t = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11];
|
|
17383
17383
|
return WebAssembly.validate(new Uint8Array(t));
|
|
17384
|
-
}), F.add("esri-atomics", "Atomics" in tr), F.add("esri-workers", "Worker" in tr), F.add("web-feat:cache", "caches" in tr), F.add("esri-workers-arraybuffer-transfer", !F("safari") || Number(F("safari")) >= 12), F.add("workers-pool-size", 8), F.add("featurelayer-simplify-thresholds", [0.5, 0.5, 0.5, 0.5]), F.add("featurelayer-simplify-payload-size-factors", [1, 1, 4]), F.add("featurelayer-animation-enabled", !0), F.add("featurelayer-snapshot-enabled", !0), F.add("featurelayer-snapshot-initial-tolerance", 0), F.add("featurelayer-snapshot-point-min-threshold", 8e4), F.add("featurelayer-snapshot-point-max-threshold", 4e5), F.add("featurelayer-snapshot-multipoint-min-threshold", 2e4), F.add("featurelayer-snapshot-multipoint-max-threshold", 1e5), F.add("featurelayer-snapshot-polygon-min-threshold", 2e3), F.add("featurelayer-snapshot-polygon-max-threshold", 2e3), F.add("featurelayer-snapshot-polyline-min-threshold", 2e3), F.add("featurelayer-snapshot-polyline-max-threshold", 2e3), F.add("featurelayer-snapshot-max-vertex-count", 25e4), F.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled", !0), F.add("featurelayer-snapshot-concurrency", 4), F.add("featurelayer-snapshot-coverage", 0.1), F.add("featurelayer-query-max-depth", 4), F.add("featurelayer-query-pausing-enabled", !1), F.add("featurelayer-query-tile-concurrency", 4), F.add("featurelayer-query-tile-max-features", 6e5), F.add("featurelayer-advanced-symbols", !1), F.add("featurelayer-pbf", !0), F.add("featurelayer-pbf-statistics", !1), F.add("feature-layers-workers", !0), F.add("feature-polyline-generalization-factor", 1), F.add("parquetlayer-full-query-feature-count", 2e4), F.add("parquetlayer-hittest-max-feature-count", 1), F.add("parquetlayer-persistence-enabled", !1), F.add("parquetlayer-cache-enabled", !0), F.add("mapview-transitions-duration", 200), F.add("mapview-essential-goto-duration", 200), F.add("mapview-srswitch-adjust-rotation-scale-threshold", 24e6), F.add("mapserver-pbf-version-support", 10.81), F.add("mapservice-popup-identify-max-tolerance", 20), F.add("request-queue-concurrency-global", 50), F.add("request-queue-concurrency-hosted", 16), F.add("request-queue-concurrency-non-hosted",
|
|
17384
|
+
}), F.add("esri-atomics", "Atomics" in tr), F.add("esri-workers", "Worker" in tr), F.add("web-feat:cache", "caches" in tr), F.add("esri-workers-arraybuffer-transfer", !F("safari") || Number(F("safari")) >= 12), F.add("workers-pool-size", 8), F.add("featurelayer-simplify-thresholds", [0.5, 0.5, 0.5, 0.5]), F.add("featurelayer-simplify-payload-size-factors", [1, 1, 4]), F.add("featurelayer-animation-enabled", !0), F.add("featurelayer-snapshot-enabled", !0), F.add("featurelayer-snapshot-initial-tolerance", 0), F.add("featurelayer-snapshot-point-min-threshold", 8e4), F.add("featurelayer-snapshot-point-max-threshold", 4e5), F.add("featurelayer-snapshot-multipoint-min-threshold", 2e4), F.add("featurelayer-snapshot-multipoint-max-threshold", 1e5), F.add("featurelayer-snapshot-polygon-min-threshold", 2e3), F.add("featurelayer-snapshot-polygon-max-threshold", 2e3), F.add("featurelayer-snapshot-polyline-min-threshold", 2e3), F.add("featurelayer-snapshot-polyline-max-threshold", 2e3), F.add("featurelayer-snapshot-max-vertex-count", 25e4), F.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled", !0), F.add("featurelayer-snapshot-concurrency", 4), F.add("featurelayer-snapshot-coverage", 0.1), F.add("featurelayer-query-max-depth", 4), F.add("featurelayer-query-pausing-enabled", !1), F.add("featurelayer-query-tile-concurrency", 4), F.add("featurelayer-query-tile-max-features", 6e5), F.add("featurelayer-advanced-symbols", !1), F.add("featurelayer-pbf", !0), F.add("featurelayer-pbf-statistics", !1), F.add("feature-layers-workers", !0), F.add("feature-polyline-generalization-factor", 1), F.add("parquetlayer-full-query-feature-count", 2e4), F.add("parquetlayer-hittest-max-feature-count", 1), F.add("parquetlayer-persistence-enabled", !1), F.add("parquetlayer-cache-enabled", !0), F.add("mapview-transitions-duration", 200), F.add("mapview-essential-goto-duration", 200), F.add("mapview-srswitch-adjust-rotation-scale-threshold", 24e6), F.add("mapserver-pbf-version-support", 10.81), F.add("mapservice-popup-identify-max-tolerance", 20), F.add("request-queue-concurrency-global", 50), F.add("request-queue-concurrency-hosted", 16), F.add("request-queue-concurrency-non-hosted", 6), F.add("curve-densification-coarse-segments", 128), F.add("curve-densification-max-segments", 2e3), F.add("curve-densification-min-segments", 3), F.add("curve-densification-pixel-deviation", 0.5), F.add("view-readyState-waiting-delay", 1e3), F.add("gradient-depth-bias", 0.01), F.add("gradient-depth-epsilon", 1e-8), F.add("enable-feature:esri-compress-textures", !0), F.add("enable-feature:basemap-groundlayers", !0), F.add("enable-feature:oit-ground", !0), !F("host-webworker") && F("host-browser") && (F.add("esri-csp-restrictions", () => {
|
|
17385
17385
|
try {
|
|
17386
17386
|
new Function();
|
|
17387
17387
|
} catch {
|
|
@@ -18238,7 +18238,7 @@ function se(t, e, r, n) {
|
|
|
18238
18238
|
const fr = { apiKey: void 0, apiKeys: { scopes: [] }, applicationName: "", applicationUrl: globalThis.location?.href, assetsPath: "", fontsUrl: "https://static.arcgis.com/fonts", geometryServiceUrl: "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer", geoRSSServiceUrl: "https://utility.arcgis.com/sharing/rss", kmlServiceUrl: "https://utility.arcgis.com/sharing/kml", userPrivilegesApplied: !0, portalUrl: "https://www.arcgis.com", respectPrefersReducedMotion: !0, routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", workers: { loaderConfig: { has: {}, paths: {}, map: {}, packages: [] } }, request: { crossOriginNoCorsDomains: null, httpsDomains: ["arcgis.com", "arcgisonline.com", "esrikr.com", "premiumservices.blackbridge.com", "esripremium.accuweather.com", "gbm.digitalglobe.com", "firstlook.digitalglobe.com", "msi.digitalglobe.com"], interceptors: [], internalInterceptors: [], maxUrlLength: 2e3, priority: "high", proxyRules: [], proxyUrl: null, timeout: 62e3, trustedServers: [], useIdentity: !0 }, log: { interceptors: [], level: null } };
|
|
18239
18239
|
if (globalThis.esriConfig && (q4(fr, globalThis.esriConfig, !0), delete fr.has), !fr.assetsPath) {
|
|
18240
18240
|
{
|
|
18241
|
-
const t = "5.0.0-next.
|
|
18241
|
+
const t = "5.0.0-next.115";
|
|
18242
18242
|
fr.assetsPath = `https://cdn.jsdelivr.net/npm/@arcgis/core@${t}/assets`;
|
|
18243
18243
|
}
|
|
18244
18244
|
fr.defaultAssetsPath = fr.assetsPath;
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{I as s,u as e}from"./DDFKURLO.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./
|
|
2
|
+
import{I as s,u as e}from"./DDFKURLO.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./BE4FGKNF.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./EHTEMHJI.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./IAMP2URN.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./NEEMZKOL.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./QPOKIVLR.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./QDE2LLCP.js")],"arcgis-code-viewer":[()=>import("./H75AOE6T.js"),"language,round"],"arcgis-editor-variables":[()=>import("./NBNHNFDE.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./BUY5C6Q3.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./4Y2WQD7U.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{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,s)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
2
|
import { c as Z } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as ee, html as
|
|
3
|
+
import { css as ee, html as d } from "lit";
|
|
4
4
|
import { nothing as V, safeClassMap as te, LitElement as ie } from "@arcgis/lumina";
|
|
5
5
|
import { ref as oe, createRef as ae } from "lit/directives/ref.js";
|
|
6
6
|
import se from "@arcgis/core/identity/IdentityManager.js";
|
|
@@ -67,10 +67,10 @@ async function we(t) {
|
|
|
67
67
|
const g = b, $ = g.details?.rawResponse || g.message || String(b), k = U($);
|
|
68
68
|
throw k ? new C(k) : b;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
c.push(
|
|
72
|
-
const y =
|
|
73
|
-
let w =
|
|
70
|
+
const l = h.data;
|
|
71
|
+
c.push(l);
|
|
72
|
+
const y = l.conversationId, q = l.inquiryId;
|
|
73
|
+
let w = l.sequenceNumber;
|
|
74
74
|
async function T() {
|
|
75
75
|
let b = 0;
|
|
76
76
|
const g = 100;
|
|
@@ -138,7 +138,7 @@ function $e(t, e, i) {
|
|
|
138
138
|
function xe(t) {
|
|
139
139
|
return t.message.match(/Error in prompt shield/u) ? "I'm having trouble with this request. Try again by rephrasing the question." : t.code === "TIMEOUT" ? "Request timed out. Try again by re-asking the same question or rephrasing it." : t.message;
|
|
140
140
|
}
|
|
141
|
-
const ke = ({ notices: t }) => t.length ?
|
|
141
|
+
const ke = ({ notices: t }) => t.length ? d`<div class="border-block-end">${Q(t, (e) => e.id ?? e.title, (e) => d`<calcite-notice class="submission-notice" .icon=${e.icon} .kind=${e.kind} scale=s open .closable=${e.closable} @calciteNoticeClose=${() => e.onClose?.()}><div slot=title>${e.title}</div>${e.message && d`<div slot=message>${e.message}</div>` || ""}${e.actionLinkMessage && e.onAction && d`<calcite-link slot=link @click=${() => e.onAction?.()}>${e.actionLinkMessage}</calcite-link>` || ""}</calcite-notice>`)}</div>` : null, Se = (t) => {
|
|
142
142
|
const e = t.value.length, i = 72, o = 180, s = t.offsetWidth, r = Math.max(1, Math.floor(s / 8)), p = Math.ceil(e / r), c = i + (p - 2) * 24;
|
|
143
143
|
t.style.setProperty("--calcite-text-area-min-height", `${Math.min(c, o)}px`);
|
|
144
144
|
}, Ce = ({ promptValidationMessage: t, errorMessage: e, contextTooBig: i, contextReducedNoticeDismissed: o, setContextReducedNoticeDismissed: s, setErrorMessage: n, messages: r }) => {
|
|
@@ -171,21 +171,21 @@ const ke = ({ notices: t }) => t.length ? l`<div class="border-block-end">${Q(t,
|
|
|
171
171
|
return p;
|
|
172
172
|
};
|
|
173
173
|
function Ae({ messages: t }) {
|
|
174
|
-
return
|
|
174
|
+
return d`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${t.beta ?? "Beta"}>${t.beta ?? "Beta"}</calcite-chip>`;
|
|
175
175
|
}
|
|
176
176
|
function Te({ popoverContent: t, messages: e }) {
|
|
177
|
-
return
|
|
177
|
+
return d`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer .label=${e.legaldisclaimer ?? "Legal disclaimer"} placement=bottom auto-close focus-trap-disabled><div class="contained">${t}</div></calcite-popover>`;
|
|
178
178
|
}
|
|
179
179
|
function Ie({ errorMessage: t, slot: e }) {
|
|
180
|
-
return
|
|
180
|
+
return d`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? V}>${t}</calcite-input-message></div>`;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
182
|
+
function Re({ active: t, setActive: e, messages: i }) {
|
|
183
|
+
return d`<calcite-alert slot=alerts .open=${t} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${i.expressionapplied ?? "Expression applied"}><div slot=message>${i.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return t ?
|
|
185
|
+
function Ee({ context: t, messages: e }) {
|
|
186
|
+
return t ? d`<div class="gaps">${t.profileId && d`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel ?? "Profile context: {profileId}").replace("{profileId}", t.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel ?? "Profile context: {profileId}").replace("{profileId}", t.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>` || ""}</div>` : null;
|
|
187
187
|
}
|
|
188
|
-
function Me({ isDisabled: t, isReadOnly: e, setQuestion: i, setIsViewingResult: o, textAreaRef: s, question: n, errorMessage: r, setErrorMessage: p, promptValidationMessage: c, setPromptValidationMessage: a, submitQuestion: h, messages:
|
|
188
|
+
function Me({ isDisabled: t, isReadOnly: e, setQuestion: i, setIsViewingResult: o, textAreaRef: s, question: n, errorMessage: r, setErrorMessage: p, promptValidationMessage: c, setPromptValidationMessage: a, submitQuestion: h, messages: l, mode: y, assistantRef: q, context: w, contextReducedNoticeDismissed: T, setContextReducedNoticeDismissed: I }) {
|
|
189
189
|
const b = w?.contextTooLarge ?? !1, g = Ce({
|
|
190
190
|
promptValidationMessage: c,
|
|
191
191
|
errorMessage: r,
|
|
@@ -193,92 +193,92 @@ function Me({ isDisabled: t, isReadOnly: e, setQuestion: i, setIsViewingResult:
|
|
|
193
193
|
contextReducedNoticeDismissed: T,
|
|
194
194
|
setContextReducedNoticeDismissed: I,
|
|
195
195
|
setErrorMessage: p,
|
|
196
|
-
messages:
|
|
196
|
+
messages: l
|
|
197
197
|
});
|
|
198
|
-
return
|
|
198
|
+
return d`<div class="text-area-wrapper">${ke({ notices: g })}<calcite-text-area scale=s resize=vertical .readOnly=${t || e} class=${te(g.length ? "submission-text-area" : "submission-text-area round-top")} .placeholder=${l.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${($) => {
|
|
199
199
|
Se($.target), i($.target.value);
|
|
200
|
-
}} ${oe(s)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${w &&
|
|
200
|
+
}} ${oe(s)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${w && Ee({ context: w, messages: l }) || ""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${y !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${t} @click=${async () => {
|
|
201
201
|
o(!1), i("");
|
|
202
|
-
}} .label=${
|
|
202
|
+
}} .label=${l.startover ?? "Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${l.startover ?? "Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${y !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${t} @click=${async () => {
|
|
203
203
|
o(!1), i("");
|
|
204
|
-
}} class="hidden-below-380" scale=s>${
|
|
204
|
+
}} class="hidden-below-380" scale=s>${l.startover ?? "Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${t} .disabled=${t} @click=${async () => {
|
|
205
205
|
if (p(""), !n) {
|
|
206
|
-
a(
|
|
206
|
+
a(l.enteraprompt ?? "Please enter a prompt");
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
a(void 0), await h();
|
|
210
|
-
}} class="hidden-below-380">${y === "prompt" ?
|
|
210
|
+
}} class="hidden-below-380">${y === "prompt" ? l.ask ?? "Generate" : l.refine ?? "Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${t} .disabled=${t} id=small-submit-button @click=${async () => {
|
|
211
211
|
if (p(""), !n) {
|
|
212
|
-
a(
|
|
212
|
+
a(l.enteraprompt ?? "Please enter a prompt");
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
a(void 0), await h();
|
|
216
|
-
}} class="hidden-above-380" .label=${y === "prompt" ?
|
|
216
|
+
}} class="hidden-above-380" .label=${y === "prompt" ? l.ask ?? "Generate" : l.refine ?? "Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${y === "prompt" ? l.ask ?? "Generate" : l.refine ?? "Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`;
|
|
217
217
|
}
|
|
218
218
|
const Pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement", Ve = "https://www.esri.com/en-us/privacy/privacy-statements";
|
|
219
219
|
function qe({ setOpen: t, messages: e, feedback: i, learnMoreUrl: o, setFeedback: s, onSubmit: n }) {
|
|
220
|
-
return i.active ?
|
|
220
|
+
return i.active ? d`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${i.active} @calciteSheetClose=${() => t(!1)}><calcite-panel .heading=${e.submitfeedback ?? "Submit feedback to Esri"} scale=s><div class="feedback-content"><calcite-text-area scale=s resize=vertical .value=${i.text} @calciteTextAreaInput=${(r) => s({ ...i, text: r.target.value })} .disabled=${i.submitting} .placeholder=${e.donotincludepersonalinfo ?? "Do not include personal or sensitive information"} rows=3></calcite-text-area><calcite-label layout=inline scale=s class="terms-label"><calcite-checkbox scale=l .checked=${i.termsAccepted} @calciteCheckboxChange=${(r) => {
|
|
221
221
|
s({ ...i, termsAccepted: r.target.checked });
|
|
222
222
|
}} .disabled=${i.submitting}></calcite-checkbox><span>${A((e.agreement ?? "I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}", `<calcite-link href=${Ve} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${Pe} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${A((e.feedbackhelps ?? "Your feedback will be used to improve Esri products and services. {LearnMore} about how this data is used.").replace("{LearnMore}", `<calcite-link href=${o} target="_blank">${e.learnmore ?? "Learn more"}</calcite-link>`))}</span></calcite-notice></div><div slot=footer class="feedback-footer"><calcite-button kind=neutral appearance=outline @click=${() => t(!1)} .disabled=${i.submitting}>${e.cancel ?? "Cancel"}</calcite-button><calcite-button @click=${n} .disabled=${!i.termsAccepted || i.submitting} .loading=${i.submitting} data-testid=submit-feedback-button>${e.submit ?? "Submit"}</calcite-button></div></calcite-panel></calcite-sheet>` : null;
|
|
223
223
|
}
|
|
224
224
|
function O({ assistantsEnabled: t, messages: e, slot: i, helpTopicUrl: o }) {
|
|
225
|
-
return
|
|
225
|
+
return d`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${i ?? V} expanded class="info-block" scale=s><div class="info-heading-row"><h1 class="info-heading">${e.introducing ?? "Introducing Arcade Assistant (beta)"}</h1><calcite-chip .label=${e.new ?? "New"} kind=brand scale=s>${e.new ?? "New"}</calcite-chip></div>${t ? d`<p>${e.capabilities ?? "The assistant uses artificial intelligence to generate Arcade expressions."}</p><p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${A((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${o} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : d`<p>${e.useofassistant ?? "The assistant uses artificial intelligence to generate Arcade expressions. To enable Arcade Assistant (beta), the following must be true:"}</p><ul><li>${e.enabledinorg ?? "AI assistants are enabled in the organization settings"}</li><li>${e.enabledbetaapps ?? "Beta apps and capabilities are not blocked"}</li><li>${e.enabledroleprivilege ?? "Your role privilege allows you to use AI assistants"}</li></ul>`}</calcite-block>`;
|
|
226
226
|
}
|
|
227
227
|
function Fe({ messages: t, onProceed: e, onExit: i, helpTopicUrl: o }) {
|
|
228
|
-
return
|
|
228
|
+
return d`<calcite-dialog close-disabled placement=top .heading=${t.welcome ?? "Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${t.beforeyougetstarted ?? "Before you get started be aware:"}</h3><ul><li>${t.maybeincorrect ?? "AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${A((t.pleasereadhelp ?? "Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${t.helptopic ?? "help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${t.proceed ?? "Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${i} kind=neutral>${t.exit ?? "Exit"}</calcite-button></calcite-dialog>`;
|
|
229
229
|
}
|
|
230
230
|
function De({ messages: t, suggestions: e, onSuggestionClick: i }) {
|
|
231
|
-
return
|
|
231
|
+
return d`<calcite-block .heading=${t.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map((o) => d`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${t.promptsuggestion} class="suggestion-button" @click=${() => i?.(o)}>${o}</calcite-button>`)}</div></calcite-block>`;
|
|
232
232
|
}
|
|
233
233
|
const z = 200;
|
|
234
234
|
function L({ hidden: t = !1, expanded: e = !1, messages: i, cards: o, heading: s, collapsible: n = !1, showEffectsIcon: r = !1, onCopyCode: p, standalone: c }) {
|
|
235
|
-
return
|
|
236
|
-
const
|
|
235
|
+
return d`<calcite-block .hidden=${t} id=result-block .heading=${s ?? i.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${r && d`<calcite-chip .label=${i.assistantresponses ?? "Assistant responses"} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${i.assistantresponses ?? "Assistant responses"}>${Q(o, (a) => a.conversationId, (a) => d`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt.length > z ? `${a.priorPrompt.slice(0, z)}...` : a.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${a.conversationId}-${c ? "standalone" : "list"}`} @click=${(h) => {
|
|
236
|
+
const l = h.currentTarget;
|
|
237
237
|
navigator.clipboard.writeText(a.priorPrompt).then(() => {
|
|
238
|
-
|
|
238
|
+
l.setAttribute("data-copied", "true"), setTimeout(() => l.removeAttribute("data-copied"), 1500);
|
|
239
239
|
});
|
|
240
|
-
}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${i.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${i.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${i.copyprompttoclipboard ?? "Copy prompt to clipboard"}</calcite-tooltip></div>${a.message && c &&
|
|
241
|
-
const
|
|
240
|
+
}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${i.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${i.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${i.copyprompttoclipboard ?? "Copy prompt to clipboard"}</calcite-tooltip></div>${a.message && c && d`<div class="response-error-container">${Ie({ errorMessage: a.message })}</div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${i.responsecontext ?? "Response Context"} scale=s>${a.message && !c && d`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start>${a.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${a.conversationId}-error`} .label=${i.error ?? "Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>` || ""}${Ne({ card: a, messages: i })}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${a.code}</arcgis-code-viewer></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button class="add-to-editor-button hidden-above-380" @click=${() => a.onAddToEditor("add")} scale=s icon-start=plus round .label=${i.addtoeditor ?? "Add to editor"} .id=${`add-to-editor-button-${a.conversationId}-${c ? "standalone" : "list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start>${i.addtoeditor ?? "Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${() => a.onAddToEditor("add")} scale=s icon-start=plus round>${i.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${() => a.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${a.conversationId}-${c ? "standalone" : "list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start><span>${i.replaceineditor ?? "Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${(h) => {
|
|
241
|
+
const l = h.currentTarget;
|
|
242
242
|
p(a.code).then(() => {
|
|
243
|
-
|
|
243
|
+
l.setAttribute("data-copied", "true"), setTimeout(() => l.removeAttribute("data-copied"), 1500);
|
|
244
244
|
});
|
|
245
245
|
}} class="response-secondary-action-button" .id=${`copy-response-${a.conversationId}-${c ? "standalone" : "list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${i.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${i.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-response-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${i.copytoclipboard ?? "Copy code to clipboard"}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${i.thumbsup ?? "Thumbs up"} scale=s icon=thumbs-up @click=${a.onThumbsUp} .id=${`thumbs-up-${a.conversationId}-${c ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start><span>${i.helpful ?? "Helpful"}</span></calcite-tooltip><calcite-action .text=${i.thumbsdown ?? "Thumbs down"} scale=s icon=thumbs-down @click=${a.onThumbsDown} .id=${`thumbs-down-${a.conversationId}-${c ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${a.conversationId}-${c ? "standalone" : "list"}`} placement=top-start><span>${i.unhelpful ?? "Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
|
|
246
246
|
}
|
|
247
247
|
const Ne = ({ card: t, messages: e }) => {
|
|
248
248
|
const i = le(), o = `response-chip-profile-${t.conversationId}-${i}`, s = (e.profilecontextlabel ?? "Profile context: {profileId}").replace("{profileId}", t.profileId);
|
|
249
|
-
return
|
|
250
|
-
}, B = (t) => t.type === "featureSet",
|
|
249
|
+
return d`<calcite-tooltip .referenceElement=${o} placement=top-start class="contained-popover-or-tooltip">${s}</calcite-tooltip><calcite-chip .label=${t.profileId} scale=s appearance=outline icon=map-information id=${o ?? V}>${t.profileId}</calcite-chip>`;
|
|
250
|
+
}, B = (t) => t.type === "featureSet", R = (t) => {
|
|
251
251
|
if (!be(t))
|
|
252
252
|
return [];
|
|
253
253
|
const e = [];
|
|
254
254
|
return t.relationships?.forEach((i) => {
|
|
255
255
|
e.push(i.toJSON());
|
|
256
256
|
}), e;
|
|
257
|
-
},
|
|
257
|
+
}, E = (t) => t.length > 0 ? { relationships: t } : {}, _e = (t) => fe(t).map((e) => ({
|
|
258
258
|
alias: e.alias,
|
|
259
259
|
name: e.name,
|
|
260
260
|
type: e.type,
|
|
261
261
|
...e.domain ? { domain: e.domain } : {}
|
|
262
262
|
})), M = (t) => t ? { fields: _e(t) } : { fields: [] };
|
|
263
263
|
async function j(t) {
|
|
264
|
-
const e = await t.loadSource(), i = Y(e) && e.isTable, o =
|
|
264
|
+
const e = await t.loadSource(), i = Y(e) && e.isTable, o = R(e);
|
|
265
265
|
return {
|
|
266
266
|
name: t.name,
|
|
267
267
|
type: "featureSet",
|
|
268
268
|
isTable: i,
|
|
269
269
|
...M(e?.fields),
|
|
270
|
-
...
|
|
270
|
+
...E(o)
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
async function K(t) {
|
|
274
274
|
switch (t.type) {
|
|
275
275
|
case "feature": {
|
|
276
|
-
const e = await t.loadSource(), i =
|
|
276
|
+
const e = await t.loadSource(), i = R(e);
|
|
277
277
|
return {
|
|
278
278
|
name: t.name,
|
|
279
279
|
type: t.type,
|
|
280
280
|
...M(e?.fields),
|
|
281
|
-
...
|
|
281
|
+
...E(i)
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
case "featureSet": {
|
|
@@ -288,7 +288,7 @@ async function K(t) {
|
|
|
288
288
|
type: "featureSet",
|
|
289
289
|
...i ? { isTable: i } : {},
|
|
290
290
|
...M(e?.fields),
|
|
291
|
-
...R(
|
|
291
|
+
...E(R(e))
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
case "featureSetCollection": {
|
|
@@ -539,8 +539,8 @@ class Ke extends ie {
|
|
|
539
539
|
};
|
|
540
540
|
try {
|
|
541
541
|
await e.applyEdits({ addFeatures: [new ue({ attributes: h })] });
|
|
542
|
-
} catch (
|
|
543
|
-
x("error", this, "Error submitting feedback.", { detail: { error:
|
|
542
|
+
} catch (l) {
|
|
543
|
+
x("error", this, "Error submitting feedback.", { detail: { error: l } });
|
|
544
544
|
}
|
|
545
545
|
this.handleFeedbackSheetClose();
|
|
546
546
|
}, this.handleClose = (e) => {
|
|
@@ -724,9 +724,9 @@ ${e}` : "";
|
|
|
724
724
|
if (this.closed)
|
|
725
725
|
return null;
|
|
726
726
|
const e = this.viewState.viewMode === "result", i = this.getHistoryCards();
|
|
727
|
-
return this.assistantsEnabled ?
|
|
727
|
+
return this.assistantsEnabled ? d`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.viewState.splashActive && d`<calcite-scrim></calcite-scrim>` || ""}${Ae({ messages: this.messages })}${Te({ messages: this.messages, popoverContent: O({ assistantsEnabled: this.assistantsEnabled, messages: this.messages, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.viewState.splashActive && Fe({ messages: this.messages, onProceed: () => {
|
|
728
728
|
this.updateViewState({ splashActive: !1 });
|
|
729
|
-
}, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (o) => this.closePanel?.(o) }) || ""}${
|
|
729
|
+
}, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (o) => this.closePanel?.(o) }) || ""}${Re({ active: this.viewState.confirmationActive, setActive: (o) => this.updateViewState({ confirmationActive: o }), messages: this.messages })}${Me({ isDisabled: this.viewState.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestionState, setIsViewingResult: (o) => this.updateViewState({ viewMode: o ? "result" : "prompt" }), mode: e ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.viewState.question, errorMessage: this.viewState.errorMessage, setErrorMessage: (o) => this.updateViewState({ errorMessage: o }), promptValidationMessage: this.viewState.promptValidationMessage, setPromptValidationMessage: (o) => this.updateViewState({ promptValidationMessage: o }), submitQuestion: this.submitQuestion.bind(this), assistantRef: this.el, messages: this.messages, context: this.viewState.context, contextReducedNoticeDismissed: this.viewState.contextReducedNoticeDismissed, setContextReducedNoticeDismissed: (o) => this.updateViewState({ contextReducedNoticeDismissed: o }) })}<calcite-block-group .label=${this.messages.interactiveblocks ?? "interactive blocks"}>${!e && !this.viewState.isSubmitting && De({ messages: this.messages, suggestions: [this.messages.prompsuggestion1 ?? "", this.messages.prompsuggestion2 ?? ""], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.viewState.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${L({
|
|
730
730
|
expanded: e,
|
|
731
731
|
messages: this.messages,
|
|
732
732
|
collapsible: !0,
|
|
@@ -751,7 +751,7 @@ ${e}` : "";
|
|
|
751
751
|
heading: this.messages.recentprompts ?? "Recent prompts",
|
|
752
752
|
hidden: this.viewState.isSubmitting || this.viewState.history.length === 0,
|
|
753
753
|
onCopyCode: this.onCopyCode.bind(this)
|
|
754
|
-
})}</calcite-block-group>${this.viewState.feedback.active ? qe({ setOpen: this.handleFeedbackSheetClose, messages: this.messages, onSubmit: this.handleFeedbackSubmit, feedback: this.viewState.feedback, setFeedback: this.setFeedbackState, learnMoreUrl: this.assistantOverviewDocUrl }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` :
|
|
754
|
+
})}</calcite-block-group>${this.viewState.feedback.active ? qe({ setOpen: this.handleFeedbackSheetClose, messages: this.messages, onSubmit: this.handleFeedbackSubmit, feedback: this.viewState.feedback, setFeedback: this.setFeedbackState, learnMoreUrl: this.assistantOverviewDocUrl }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : d`<calcite-flow><calcite-flow-item .selected=${!e} closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${O({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
Z("arcgis-arcade-coding-assistant", Ke);
|
|
@@ -31,7 +31,11 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
31
31
|
* - Support for many [languages and directionality](https://developers.arcgis.com/javascript/latest/localization/)
|
|
32
32
|
*/
|
|
33
33
|
export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> extends LitElement {
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* enables and configures the arcade assistant
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
35
39
|
accessor arcadeAssistant: ArcadeAssistantConfig | undefined;
|
|
36
40
|
/**
|
|
37
41
|
* Custom panels to be displayed in the side panel.
|