@arcgis/coding-components 5.2.0-next.16 → 5.2.0-next.17

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.
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import f from"./Q2EZ6DGG.js";import e from"./KTDJ3N4O.js";import d from"./UTTEHEMP.js";import c from"./STN3LSQR.js";import{e as te}from"./HXJFZ2Y5.js";import b from"./7Z6G332Z.js";import{a as oe,b as re,c as E}from"./O5XRLNCX.js";import"./OLNYBWUC.js";import{a as ae}from"./P37AQWGL.js";import"./MZMKV7FA.js";import a from"./2WB7S5TQ.js";import{a as ee}from"./MFDNJU3K.js";import{a as Z}from"./B73HLERI.js";import"./NP37C536.js";import"./XSKI5PRU.js";import"./ECNI2A4K.js";import"./XRUKVCVF.js";import{E as T,F as M,G as X,H as P,K as Y,L as J,h as G,j as l,l as I,n as L,t as Q}from"./PJBI5XFD.js";import{a as V,b as u}from"./VGOFAQ7A.js";import"./257WOXQH.js";import"./R2XZZWNP.js";import"./QTLHVR4Y.js";import{Rk as se,Uk as F,Zk as ie}from"./TEXAGKBD.js";import"./H6RQVSYM.js";export default $arcgis.t(([_e,he,{watch:O},m,{property:c,subclass:x},{a:ne,h:v,i:U},{b:N},,,f,{a:ce,b:de}])=>{var me=G`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.bottom-action-bar.is-collapsed{border-bottom:0}.bottom-action-bar{display:flex;.bottom-action-bar__actions{flex:1 1 auto;min-inline-size:0}}`,le="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",h=(t,e)=>{V(t,"Arcade Assistant",e)},ge=["orgAiAssistantsEnabled","betaAppsAllowed","serviceUrlAvailable","userHasUseAiAssistantsPrivilege"],xe=ge,ue=(t,e)=>e.every(s=>t[s]===!0),Se=t=>{let{aiAssistantsEnabled:e}=t;return e===void 0?(h("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},Ae=async t=>(await he.getCredential(t,{oAuthPopupConfirmation:!1})).token,Pe=async t=>{try{return!!await he.checkSignInStatus(t)}catch{return h("warn","User is not signed in."),!1}};async function fe({portalUrl:t}){t&&h("warn","The arcadeAssistant property is deprecated. Set esriConfig.portalUrl instead of arcadeAssistant.portalUrl.");let e=t||_e.portalUrl;if(!e)return h("warn","Arcade Assistant initialization failed. Reason: missing portal url."),{shouldRender:!1};let s=e.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await Pe(s))return{shouldRender:!1};let i=await Ae(e),a=`${s}/sharing/rest/portals/self?f=json&token=${i}`,o=`${s}/sharing/rest/portals/self/settings?f=json&token=${i}`,n=`${s}/sharing/rest/portals/self/signinSettings?f=json&token=${i}`,r=await Promise.allSettled([fetch(a,{credentials:"include"}).then($=>$.json()),fetch(o,{credentials:"include"}).then($=>$.json()),fetch(n,{credentials:"include"}).then($=>$.json())]),[S,A,R]=r,y=S.status==="fulfilled"?S.value:(h("warn",`Failed to fetch selfUrl. Reason: ${S.reason}.`),{}),K=A.status==="fulfilled"?A.value:(h("warn",`Failed to fetch settingsUrl. Reason: ${A.reason}.`),{}),be=R.status==="fulfilled"?R.value:(h("warn",`Failed to fetch signinSettingsUrl. Reason: ${R.reason}.`),{});if(y.isPortal)return{shouldRender:!1};let j=y.helpBase||"";if(!K)return h("warn","Settings response is not available."),{shouldRender:!1};let B={orgAiAssistantsEnabled:Se(K),betaAppsAllowed:be.blockBetaApps!==!0,serviceUrlAvailable:!!y?.helperServices?.aiAssistantServices?.url,userHasUseAiAssistantsPrivilege:y?.user?.privileges?.includes("portal:user:useAIAssistants")===!0};B.betaAppsAllowed||h("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),B.userHasUseAiAssistantsPrivilege||h("warn","User does not have the required privileges to use AI Assistants.");let H=ue(B,xe),q=ue(B,ge),W=y?.helperServices?.aiAssistantServices?.url;return W?{shouldRender:!0,portalUrl:e,availableFeatures:{codeActions:H,prompting:q},serviceUrl:W,helpBase:j,feedbackServiceUrl:le}:{shouldRender:!0,portalUrl:e,availableFeatures:{codeActions:H,prompting:q},helpBase:j,feedbackServiceUrl:le}}var ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,_=(t,e,s,i)=>{for(var a=i>1?void 0:i?ye(e,s):e,o=t.length-1,n;o>=0;o--)(n=t[o])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&ve(e,s,a),a},pe=100,g=class extends m{constructor(t){super(t),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=pe}};_([c()],g.prototype,"collectionItems",2);_([c()],g.prototype,"errorMessage",2);_([c()],g.prototype,"expanded",2);_([c()],g.prototype,"requestId",2);_([c()],g.prototype,"schemaValue",2);_([c()],g.prototype,"status",2);_([c()],g.prototype,"visibleChildCount",2);g=_([x("ArcadeDebuggerLazyTreeNodeState")],g);var C=class extends m{constructor(t){super(t),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(t,e=!1,s){let i=this.nodes.get(t);if(i)return i;let a=new g;return a.expanded=e,this.nodes.set(t,a),e&&s&&this.loadNode(t,s),a}setExpanded(t,e,s){let i=this.ensureNode(t,e,s);if(i.expanded===e){e&&s&&this.loadNode(t,s);return}i.expanded=e,e&&s&&this.loadNode(t,s)}showMore(t,e){let s=this.ensureNode(t);s.visibleChildCount>=e||(s.visibleChildCount=Math.min(e,s.visibleChildCount+pe))}loadNode(t,e){switch(e.kind){case"collection":this.runLoad(t,e.load,(s,i)=>{s.collectionItems=i});return;case"schema":this.runLoad(t,e.load,(s,i)=>{s.schemaValue=i});return}}runLoad(t,e,s){let i=this.nodes.get(t);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,o=i.requestId+1;i.requestId=o,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(n=>{let r=this.nodes.get(t);!r||this.generation!==a||r.requestId!==o||(s(r,n),r.status="loaded")}).catch(()=>{let n=this.nodes.get(t);!n||this.generation!==a||n.requestId!==o||(n.status="error")})}destroyNodes(){for(let t of this.nodes.values())t.destroy();this.nodes.clear()}};C=_([x("ArcadeDebuggerLazyTreeState")],C);var $e=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,d=(t,e,s,i)=>{for(var a=i>1?void 0:i?Ee(e,s):e,o=t.length-1,n;o>=0;o--)(n=t[o])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&$e(e,s,a),a},b=class extends m{constructor(t){super(t),this.phase="idle",this.sessionId=0,this.consoleLogs=[],this.hasExecuted=!1}get isExecuting(){return this.phase==="running"||this.phase==="debug-running"||this.phase==="debug-paused"}get isDebugging(){return this.phase==="debug-running"||this.phase==="debug-paused"}get isPaused(){return this.phase==="debug-paused"}get runResult(){return this.result?.resultType==="run"?this.result.result:void 0}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}addConsoleLog(t){this.consoleLogs=[...this.consoleLogs,t]}};d([c()],b.prototype,"phase",2);d([c()],b.prototype,"mode",2);d([c()],b.prototype,"sessionId",2);d([c()],b.prototype,"result",2);d([c()],b.prototype,"consoleLogs",2);d([c()],b.prototype,"hasExecuted",2);b=d([x("ArcadeDebuggerExecutionModel")],b);var D=class extends m{constructor(t){super(t),this.editorBreakpoints=[],this.executionBreakpoints=[]}setBreakpoints(t,e){t==="editor"?this.editorBreakpoints=Array.from(new Set(e)).sort((s,i)=>s-i):this.executionBreakpoints=Array.from(new Set(e)).sort((s,i)=>s-i)}toggleBreakpoint(t,e){let s=new Set(t==="editor"?this.editorBreakpoints:this.executionBreakpoints);s.has(e)?s.delete(e):s.add(e),this.setBreakpoints(t,s)}clearBreakpoints(t){t==="editor"?this.editorBreakpoints=[]:this.executionBreakpoints=[]}syncExecutionBreakpointsFromEditor(){this.executionBreakpoints=this.editorBreakpoints}};d([c()],D.prototype,"editorBreakpoints",2);d([c()],D.prototype,"executionBreakpoints",2);D=d([x("ArcadeDebuggerSessionModel")],D);var w=class extends m{constructor(t){super(t),this.openedPanel="output",this.showPanel=!1}};d([c()],w.prototype,"openedPanel",2);d([c()],w.prototype,"showPanel",2);w=d([x("ArcadeDebuggerUiModel")],w);var k=class extends m{constructor(t){super(t)}get line(){return this.pausedState?.line}clearPausedState(){this.lastPausedState=this.pausedState,this.pausedState=void 0}reset(){this.pausedState=void 0,this.lastPausedState=void 0}setPausedState(t){this.pausedState=t,this.lastPausedState=t}};d([c()],k.prototype,"pausedState",2);d([c()],k.prototype,"lastPausedState",2);k=d([x("ArcadeDebuggerPausedFrameModel")],k);var p=class extends m{constructor(t){super(t),this.execution=new b,this.lazyTreeState=new C,this.pausedFrame=new k,this.previewTabsState=new N,this.session=new D,this.ui=new w}get editorBreakpoints(){return this.session.editorBreakpoints}get debuggerBreakpoints(){return this.isPaused?this.session.executionBreakpoints.map(t=>({line:t})):this.session.editorBreakpoints.map(t=>({line:t}))}get executionBreakpoints(){return this.session.executionBreakpoints}get consoleLogs(){return this.execution.consoleLogs}get debug(){if(!(!this.pausedFrame.pausedState&&!this.pausedFrame.lastPausedState))return{pausedState:this.pausedFrame.pausedState,lastPausedState:this.pausedFrame.lastPausedState}}get debugResult(){return this.execution.debugResult}get debuggerLine(){return this.pausedFrame.pausedState?.line}get executionState(){return this.pausedFrame.pausedState}get hasExecuted(){return this.execution.hasExecuted}get isDebugging(){return this.execution.isDebugging}get isExecuting(){return this.execution.isExecuting}get isPaused(){return this.execution.isPaused}get mode(){return this.execution.mode}get openedPanel(){return this.ui.openedPanel}get outputRenderer(){if(this.execution.result)return this.execution.result.resultType==="debug"?"debugger":"legacy"}get phase(){return this.execution.phase}get result(){return this.execution.result}get runResult(){return this.execution.runResult}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(t){this.execution.addConsoleLog(t)}clearBreakpoints(t){this.session.clearBreakpoints(t)}clearForMissingTestData(){this.stopDebug({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(t){this.execution.mode="debug",this.execution.result={resultType:"debug",result:t},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(t,e={}){this.execution.mode="run",!e.useDebugRenderer&&v(t)?this.execution.result={resultType:"run",result:t}:e.useDebugRenderer&&!v(t)&&(this.execution.result={resultType:"debug",result:t}),this.execution.phase="completed",this.pausedFrame.reset(),this.ui.openedPanel="output",this.resetTransientDebuggerState()}continueDebug(){let t=this.pausedFrame.pausedState?.continue;t&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),t.resolve())}disableDebugger(){this.stopDebug({hidePanel:!0}),this.clearBreakpoints("execution"),this.clearBreakpoints("editor")}fail(t){this.completeRun(t)}pauseDebug(t){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,t),this.pausedFrame.setPausedState(t),this.execution.phase="debug-paused"}reset(){this.execution.phase="idle",this.execution.mode=void 0,this.execution.result=void 0,this.execution.consoleLogs=[],this.execution.hasExecuted=!1,this.execution.sessionId=0,this.ui.openedPanel="output",this.ui.showPanel=!1,this.pausedFrame.reset(),this.clearBreakpoints("execution"),this.clearBreakpoints("editor"),this.replaceTransientDebuggerState()}resetDebug(){this.stopDebug({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.stopDebug({hidePanel:!0})}setBreakpoints(t){this.session.setBreakpoints("editor",t)}setPanel(t){this.execution.hasExecuted&&(this.ui.openedPanel=t,this.ui.showPanel=!0)}startDebug(){return this.execution.mode="debug",this.execution.phase="debug-running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.session.syncExecutionBreakpointsFromEditor(),this.execution.consoleLogs=[],this.ui.openedPanel="debug-console",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}startRun(){return this.execution.mode="run",this.execution.phase="running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="output",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}stopDebug({hidePanel:t=!0,invalidateSession:e=!0}={}){let s=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),t&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),s?.resolve()}syncPausedState(t,e){this.lazyTreeState.reset(),t&&e&&t!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(t){this.session.toggleBreakpoint("editor",t)}togglePanel(t){if(this.execution.hasExecuted){if(t==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===t&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(t)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new C,this.previewTabsState=new N}};d([c()],p.prototype,"execution",2);d([c()],p.prototype,"lazyTreeState",2);d([c()],p.prototype,"pausedLine",2);d([c()],p.prototype,"pausedFrame",2);d([c()],p.prototype,"previewTabsState",2);d([c()],p.prototype,"session",2);d([c()],p.prototype,"ui",2);p=d([x("ArcadeDebuggerStore")],p);var De={glyphMargin:!0,lineNumbersMinChars:1},z=class extends X{constructor(){super(...arguments),this._codeEditorElt=T(),this._arcadeAssistantElt=T(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new p,this.messages=ee(),this._modelId=Q(),this._openArcadeHelp=()=>{window.open(ne,"Arcade Help")},this._decorations=void 0,this._monacoEditor=Z(ae),this._editorOptions={},this._toggleSidePanel=e=>{e.currentTarget instanceof HTMLElement&&this._setOpenedSidePanel(e.currentTarget.dataset.panelName??"none")},this._closeSidePanel=()=>{this._setOpenedSidePanel("none")},this._updateBreakpointsDecorations=()=>{let e=this.editorInstance;if(!e)return;let s=this._debuggerState.editorBreakpoints.map(i=>({range:new F(i,1,i,1),options:{isWholeLine:!0,glyphMarginClassName:"arcgis-code-editor__breakpoint-glyph",stickiness:this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}));this._decorations?.clear(),this._decorations=e.createDecorationsCollection(s)},this._clearDebuggerDecorations=()=>{this._decorations?.clear(),this._decorations=void 0,this._debuggerPausedLineDecoration?.clear(),this._debuggerPausedLineDecoration=void 0},this._debuggerPausedLineDecoration=void 0,this._preparingArcade=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this._diagnostics=[],this.enableDebugger=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.disableAssistant=!1,this.arcgisDiagnosticsChange=L({bubbles:!1}),this.arcgisScriptChange=L({bubbles:!1})}static{this.properties={_apiLibrary:16,_editorProfile:16,_preparingArcade:16,_arcadeAssistantRemoteState:16,_diagnostics:16,editorInstance:32,editorOptions:0,enableDebugger:5,hideDocumentationActions:5,hideSideBar:5,messageOverrides:0,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,disableAssistant:5,arcadeAssistant:0,externalExecutor:0}}static{this.styles=[me]}get _usesBottomExecutionDrawer(){return this.enableDebugger&&!!this.testData}get editorInstance(){return this._codeEditorElt.value?.editorInstance}get editorOptions(){return{...De,...this._editorOptions}}set editorOptions(e){this._editorOptions=e??{}}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let s=this._codeEditorElt.value?.value,i=await U(e.definition,s,this.testData,{mode:"run"});return v(i)?i:{type:"error",value:"Unexpected debug result",error:null}}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async openArcadeAssistant(e){if(!this._arcadeAssistantRemoteState.shouldRender)return!1;if(this.openedSidePanel="arcade-assistant",await this.updateComplete,!this._canPromptWithArcadeAssistant())return!0;let s=this._arcadeAssistantElt.value;return e?.prompt&&await s?.openPrompt(e.prompt),!0}async load(){let e=J("./assets");ce(e),await this._updateDataModelDeps(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(this._askAiBindingKey&&(E(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);this._disposables.length;)this._disposables.pop()?.dispose();this._abortExternalExecution(),this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("enableDebugger")&&!this.enableDebugger&&this._debuggerState.disableDebugger(),e.has("snippets")&&f.updateApiContextForModel(this._modelId,{snippets:this.snippets}),(e.has("arcadeAssistant")||e.has("disableAssistant"))&&this._updateArcadeAssistantRemoteState()}async loaded(){await this._connectMonacoCustomizations(),this._componentReadyDefer.resolve()}_setOpenedSidePanel(e){this.openedSidePanel=e===this.openedSidePanel?"none":e}async _connectMonacoCustomizations(){if(this._connectMonacoCustomizationsPromise)return await this._connectMonacoCustomizationsPromise;this._connectMonacoCustomizationsPromise=(async()=>{if(!this.isConnected)return;let e=await de();this._disposables.push(e.onDiagnosticsChange(r=>{this._preparingArcade||(this._diagnostics=r.diagnostics,this.arcgisDiagnosticsChange.emit(r.diagnostics))})),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._syncAskAiAction();let s=O(()=>this._debuggerState.editorBreakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=O(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=O(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>s.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let o=this.editorInstance?.onMouseDown(r=>this._onEditorMouseDown(r));o&&this._disposables.push(o);let n=this.editorInstance?.onDidChangeModelContent(r=>this._onEditorModelContentChange(r));n&&this._disposables.push(n),this._updateBreakpointsDecorations(),this._updateDebuggerPausedLineDecoration()})();try{await this._connectMonacoCustomizationsPromise}finally{this._connectMonacoCustomizationsPromise=void 0}}_onEditorMouseDown(e){if(!this.enableDebugger||![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN].includes(e.target.type)||e.target.element?.classList.contains("codicon-gutter-lightbulb"))return;let s=e.target.position?.lineNumber;s&&this._debuggerState.toggleBreakpoint(s)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.editorBreakpoints.length||e.isFlush)return;let s=te(this._debuggerState.editorBreakpoints,e.changes);s.length===this._debuggerState.editorBreakpoints.length&&s.every((i,a)=>i===this._debuggerState.editorBreakpoints[a])||this._debuggerState.setBreakpoints(s)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let s=this._debuggerState.debuggerLine;s!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new F(s,1,s,1),options:{isWholeLine:!0,className:"arcgis-code-editor__debugger-paused-line",glyphMarginClassName:"arcgis-code-editor__debugger-paused-glyph",marginClassName:"arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin",stickiness:this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}]):this._debuggerPausedLineDecoration=void 0}_continueDebugSession(){this._debuggerState.continueDebug()}_abortExternalExecution(){this._externalExecutionAbortController?.abort(),this._externalExecutionAbortController=void 0}_stopDebugSession(){this._abortExternalExecution(),this._debuggerState.stopDebug({hidePanel:!1})}_resetDebugSession(){this._abortExternalExecution(),this._debuggerState.resetDebug(),this._executeScript("debug").catch(u(this))}async _handleDebugPause(e,s,i){if(!this._debuggerState.isDebugging||e!==this._debuggerState.sessionId)return;let a=Promise.withResolvers();return this._debuggerState.pauseDebug({line:s.line,result:i,continue:a}),await a.promise}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _executeWithExternalExecutor(e,s,i){if(!this.externalExecutor)return{type:"error",value:"Missing external executor",error:null};let a=new AbortController;this._abortExternalExecution(),this._externalExecutionAbortController=a;let o=i.console??(()=>{});try{if(e==="debug"){let{breakpoints:n,onDebugPause:r}=i;if(!n||!r)throw new Error("Missing debug execution options");return await this.externalExecutor.execute({mode:"debug",script:s,console:o,signal:a.signal,breakpoints:n,onDebugPause:r})}return await this.externalExecutor.execute({mode:"run",script:s,console:o,signal:a.signal})}catch(n){return{type:"error",value:"Execution failed",error:n instanceof Error?n:new Error(String(n))}}finally{this._externalExecutionAbortController===a&&(this._externalExecutionAbortController=void 0)}}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.showPanel&&this._executeScript("run").catch(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await f.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=f.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await f.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.setPanel(e)}async _executeScript(e){let s=this.testData;if(!this._codeEditorElt.value||!s)return;let i=e==="debug"?this._debuggerState.startDebug():this._debuggerState.startRun();setTimeout(()=>{(async()=>{let a=this._codeEditorElt.value?.value??this.script,o={mode:e,console:r=>this._debuggerState.addConsoleLog(r),breakpoints:e==="debug"?this._debuggerState.debuggerBreakpoints:void 0};e==="debug"&&(o.onDebugPause=this._handleDebugPause.bind(this,i));let n;if(this.externalExecutor)n=await this._executeWithExternalExecutor(e,a,o);else{let r=await this._editorProfilePromise;if(!r){this._debuggerState.fail({type:"error",value:"Missing editor profile",error:null});return}n=await U(r.definition,a,s,o)}if(i===this._debuggerState.sessionId){if(e==="debug"){if(v(n)){this._debuggerState.fail(n);return}this._debuggerState.completeDebug(n);return}v(n)?this._debuggerState.completeRun(n):this.externalExecutor?this._debuggerState.completeRun(n,{useDebugRenderer:!0}):this._debuggerState.fail({type:"error",value:"Unexpected debug result",error:null})}})()},0)}_toggleShowExecutionPanel(){this._debuggerState.togglePanel()}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(this))}_onResultPanelChange(e){let s=e.currentTarget;this._debuggerState.setPanel(s.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[se.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_getAskAiBindingKey(){return ie.parse(this._modelId).toString()}_canRenderAskAiCodeActions(){let e=this._arcadeAssistantRemoteState;return e.shouldRender?e.availableFeatures.codeActions:!1}_canPromptWithArcadeAssistant(){let e=this._arcadeAssistantRemoteState;return e.shouldRender?e.availableFeatures.prompting:!1}_getAskAiCodeActions(e){if(!this._canRenderAskAiCodeActions())return[];if(!e.markers.length)return[];let s=this.messages.askarcadeassistant??"Ask Arcade Assistant",i=this._getAskAiBindingKey();return[{title:s,kind:oe,diagnostics:e.markers,isPreferred:!1,isAI:!1,command:{id:re,title:s,arguments:[i,this.messages.askarcadeassistantprompt??"Fix the errors in my script"]}}]}_syncAskAiAction(){if(!this.editorInstance)return;let e=this._getAskAiBindingKey();if(!this._arcadeAssistantRemoteState.shouldRender){this._askAiBindingKey&&(E(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);return}this._askAiBindingKey&&this._askAiBindingKey!==e&&E(this._askAiBindingKey,void 0),E(e,{provideCodeActions:({context:s})=>this._getAskAiCodeActions(s),run:s=>{this.openArcadeAssistant({prompt:s??this.messages.askarcadeassistantprompt??"Fix the errors in my script"}).catch(u(this))}}),this._askAiBindingKey=e}_disposeSafely(e){let s=this._disposables.indexOf(e);s!==-1&&this._disposables.splice(s,1),e.dispose()}async _updateArcadeAssistantRemoteState(){let e=this.arcadeAssistant;this.disableAssistant?this._arcadeAssistantRemoteState={shouldRender:!1}:this._arcadeAssistantRemoteState=await fe(e??{}),this._syncAskAiAction()}renderMainActionBar(){return this.enableDebugger||!this.testData?null:l`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action>${this._debuggerState.result?l`<calcite-action .text=${this.messages.lastresults??""} .active=${this._debuggerState.showPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`}renderMainPanel(){return l`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${f.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${M(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:s,icon:i,active:a,panelName:o,iconFlipRtl:n=!1,onClick:r=this._toggleSidePanel}){return l`<calcite-action id=${e??I} .text=${s} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${r} data-panel-name=${o??I} .iconFlipRtl=${n}></calcite-action>${!this.sideActionBarExpanded&&l`<calcite-tooltip .referenceElement=${e}><span>${s}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:l`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e,_arcadeAssistantRemoteState:s}=this;return l`<arcgis-language-api-panel slot=side-panel class=${P(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${P(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"} .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>${this.suggestions?.length&&l`<arcgis-arcade-suggestions slot=side-panel class=${P(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${s?.shouldRender&&l`<arcgis-arcade-coding-assistant slot=side-panel class=${P(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${s.portalUrl} .serviceUrl=${"serviceUrl"in s?s.serviceUrl:void 0} .helpBase=${s.helpBase} .promptingEnabled=${this._canPromptWithArcadeAssistant()} .feedbackServiceUrl=${s.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant?.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant?.disableQuestionAnswerLogging} .diagnostics=${this._diagnostics} ${M(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(i=>l`<calcite-flow slot=side-panel class=${P(e===i.id?"":"hidden")}>${i?.useFlows?i.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==i.id,editorRef:this.el}):l`<calcite-flow-item .heading=${i.name} heading-level=2 closable .closed=${e!==i.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${i.description}>${i.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==i.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){if(this._usesBottomExecutionDrawer)return this.renderBottomExecutionBody();if(!this._debuggerState.showPanel)return null;let e=this._debuggerState.openedPanel==="debug-console"?"output":this._debuggerState.openedPanel;return l`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:s,debugResult:i,isExecuting:a,mode:o}=this._debuggerState;return e?s==="debug-console"?l`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:s==="output"&&(o==="debug"||i)?l`<arcgis-arcade-debugger-output .outputTitle=${this.messages.output} slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:l`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${s} .loading=${s==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`:null}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:s,openedPanel:i,isDebugging:a,isPaused:o,isExecuting:n}=this._debuggerState,r=this.messages.continue??"Continue",S=this.messages.reset??"Reset",A=this.messages.stop??"Stop";return l`<div slot=bottom-action-bar class=${`main-action-bar bottom-action-bar ${e?"":"is-collapsed"}`}><calcite-action-bar class="bottom-action-bar__actions" layout=horizontal scale=s expand-disabled expanded><calcite-action-group scale=s>${a?l`<calcite-action id=debugger-continue-action .text=${r} icon=forward scale=s .disabled=${!o} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${r}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${S} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${S}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${A} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${A}</span></calcite-tooltip>`:l`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action><calcite-action .disabled=${this._debuggerState.editorBreakpoints.length===0} .text=${this.messages.runanddebug??"Run and Debug"} text-enabled icon=debug-script scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("debug").catch(u(this))}}></calcite-action>`}</calcite-action-group>${s?l`<calcite-action-group scale=s><calcite-action .active=${i==="output"&&e} .text=${this.messages.output??"Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${()=>this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i==="console"&&e} .text=${this.messages.console??"Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${()=>this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i==="log"&&e} .text=${this.messages.log??"Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${()=>this._setExecutionPanel("log")} .disabled=${this.enableDebugger&&this._debuggerState.mode==="debug"}></calcite-action><calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug Console"} text-enabled scale=s icon=debug-script .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action></calcite-action-group>`:null}</calcite-action-bar>${e?l`<calcite-action .text=${this.messages.close??"Close"} scale=s icon=x icon-flip-rtl @click=${this._onExecutionPanelClose} slot=actions-end></calcite-action>`:null}</div>`}render(){return l`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};Y("arcgis-arcade-editor",z);return z},"config","identity/IdentityManager","core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,c,d,e,f)
@@ -18278,7 +18278,7 @@ function se(t, e, r, n) {
18278
18278
  const cr = { 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 } };
18279
18279
  if (globalThis.esriConfig && (K4(cr, globalThis.esriConfig, !0), delete cr.has), !cr.assetsPath) {
18280
18280
  {
18281
- const t = "5.2.0-next.19";
18281
+ const t = "5.2.0-next.20";
18282
18282
  cr.assetsPath = `https://cdn.jsdelivr.net/npm/@arcgis/core@${t}/assets`;
18283
18283
  }
18284
18284
  cr.defaultAssetsPath = cr.assetsPath;
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{J as s,v as e}from"./PJBI5XFD.js";import"./VGOFAQ7A.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./OH5M4GAZ.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./NCMXRX7O.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./GTE3KXNK.js"),"debuggerStore:,outputTitle,result:"],"arcgis-arcade-editor":[()=>import("./Q3JBU7FP.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./VPVLZ5QO.js"),"consoleLogs:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./LEFFI3FB.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./3O35TTKM.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./76VHPECE.js")],"arcgis-code-viewer":[()=>import("./SCLCF2SG.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./Q5RDW24Y.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./WRVJHPML.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./3QN6NREQ.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./A6IGYBAZ.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];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)
2
+ import{J as s,v as e}from"./PJBI5XFD.js";import"./VGOFAQ7A.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./OH5M4GAZ.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./NCMXRX7O.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./GTE3KXNK.js"),"debuggerStore:,outputTitle,result:"],"arcgis-arcade-editor":[()=>import("./4VIVKIX3.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./VPVLZ5QO.js"),"consoleLogs:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./LEFFI3FB.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./3O35TTKM.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./76VHPECE.js")],"arcgis-code-viewer":[()=>import("./SCLCF2SG.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./Q5RDW24Y.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./WRVJHPML.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./3QN6NREQ.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./A6IGYBAZ.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];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)
@@ -4,7 +4,7 @@ import { css as te, html as d, nothing as z } from "lit";
4
4
  import { i as se } from "../../chunks/monaco-importer.js";
5
5
  import { LitElement as ie, createEvent as N, safeClassMap as P } from "@arcgis/lumina";
6
6
  import { generateGuid as ae } from "@arcgis/toolkit/string";
7
- import { i as $, D as ne, e as K } from "../../chunks/arcade-executor.js";
7
+ import { i as y, D as ne, e as K } from "../../chunks/arcade-executor.js";
8
8
  import { s as oe, a as re } from "../../chunks/arcade-service-accessors.js";
9
9
  import { b as v } from "../../chunks/arcade-defaults.js";
10
10
  import { setArcadeAskAiBinding as B, arcadeAskAiCommandId as ce, arcadeQuickFixKind as le } from "../../chunks/arcade-mode.js";
@@ -17,17 +17,17 @@ import { log as ge, rethrowError as u } from "@arcgis/toolkit/log";
17
17
  import { watch as L } from "@arcgis/core/core/reactiveUtils.js";
18
18
  import m from "@arcgis/core/core/Accessor.js";
19
19
  import { property as c, subclass as f } from "@arcgis/core/core/accessorSupport/decorators.js";
20
- import { A as V } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
20
+ import { A as W } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
21
21
  import { r as pe } from "../../chunks/utilities.js";
22
- import { Range as W, KeyCode as be, Uri as _e } from "monaco-editor";
23
- const me = te`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.bottom-action-bar.is-collapsed{border-bottom:0}.bottom-action-bar{display:flex;.bottom-action-bar__actions{flex:1 1 auto;min-inline-size:0}}`, q = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", h = (t, e) => {
22
+ import { Range as V, KeyCode as be, Uri as _e } from "monaco-editor";
23
+ const me = te`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.bottom-action-bar.is-collapsed{border-bottom:0}.bottom-action-bar{display:flex;.bottom-action-bar__actions{flex:1 1 auto;min-inline-size:0}}`, G = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", h = (t, e) => {
24
24
  ge(t, "Arcade Assistant", e);
25
25
  }, X = [
26
26
  "orgAiAssistantsEnabled",
27
27
  "betaAppsAllowed",
28
28
  "serviceUrlAvailable",
29
29
  "userHasUseAiAssistantsPrivilege"
30
- ], fe = X, G = (t, e) => e.every((s) => t[s] === !0), xe = (t) => {
30
+ ], fe = X, q = (t, e) => e.every((s) => t[s] === !0), xe = (t) => {
31
31
  const { aiAssistantsEnabled: e } = t;
32
32
  return e === void 0 ? (h("warn", "`areAiAssistantsEnabled` is not defined in the organizations settings."), !1) : e;
33
33
  }, Se = async (t) => (await Q.getCredential(t, { oAuthPopupConfirmation: !1 })).token, Ae = async (t) => {
@@ -54,14 +54,14 @@ async function Pe({
54
54
  fetch(o, { credentials: "include" }).then((A) => A.json()),
55
55
  fetch(n, { credentials: "include" }).then((A) => A.json()),
56
56
  fetch(r, { credentials: "include" }).then((A) => A.json())
57
- ]), [x, R, I] = w, S = x.status === "fulfilled" ? x.value : (h("warn", `Failed to fetch selfUrl. Reason: ${x.reason}.`), {}), M = R.status === "fulfilled" ? R.value : (h("warn", `Failed to fetch settingsUrl. Reason: ${R.reason}.`), {}), J = I.status === "fulfilled" ? I.value : (h("warn", `Failed to fetch signinSettingsUrl. Reason: ${I.reason}.`), {});
57
+ ]), [x, R, I] = w, S = x.status === "fulfilled" ? x.value : (h("warn", `Failed to fetch selfUrl. Reason: ${x.reason}.`), {}), T = R.status === "fulfilled" ? R.value : (h("warn", `Failed to fetch settingsUrl. Reason: ${R.reason}.`), {}), J = I.status === "fulfilled" ? I.value : (h("warn", `Failed to fetch signinSettingsUrl. Reason: ${I.reason}.`), {});
58
58
  if (S.isPortal)
59
59
  return { shouldRender: !1 };
60
- const T = S.helpBase || "";
61
- if (!M)
60
+ const M = S.helpBase || "";
61
+ if (!T)
62
62
  return h("warn", "Settings response is not available."), { shouldRender: !1 };
63
63
  const k = {
64
- orgAiAssistantsEnabled: xe(M),
64
+ orgAiAssistantsEnabled: xe(T),
65
65
  betaAppsAllowed: J.blockBetaApps !== !0,
66
66
  serviceUrlAvailable: !!S?.helperServices?.aiAssistantServices?.url,
67
67
  userHasUseAiAssistantsPrivilege: S?.user?.privileges?.includes("portal:user:useAIAssistants") === !0
@@ -70,7 +70,7 @@ async function Pe({
70
70
  "warn",
71
71
  "Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."
72
72
  ), k.userHasUseAiAssistantsPrivilege || h("warn", "User does not have the required privileges to use AI Assistants.");
73
- const F = G(k, fe), U = G(k, X), O = S?.helperServices?.aiAssistantServices?.url;
73
+ const F = q(k, fe), U = q(k, X), O = S?.helperServices?.aiAssistantServices?.url;
74
74
  return O ? {
75
75
  shouldRender: !0,
76
76
  portalUrl: e,
@@ -79,8 +79,8 @@ async function Pe({
79
79
  prompting: U
80
80
  },
81
81
  serviceUrl: O,
82
- helpBase: T,
83
- feedbackServiceUrl: q
82
+ helpBase: M,
83
+ feedbackServiceUrl: G
84
84
  } : {
85
85
  shouldRender: !0,
86
86
  portalUrl: e,
@@ -88,12 +88,12 @@ async function Pe({
88
88
  codeActions: F,
89
89
  prompting: U
90
90
  },
91
- helpBase: T,
92
- feedbackServiceUrl: q
91
+ helpBase: M,
92
+ feedbackServiceUrl: G
93
93
  };
94
94
  }
95
- var ve = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, _ = (t, e, s, i) => {
96
- for (var a = i > 1 ? void 0 : i ? $e(e, s) : e, o = t.length - 1, n; o >= 0; o--)
95
+ var ve = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, _ = (t, e, s, i) => {
96
+ for (var a = i > 1 ? void 0 : i ? ye(e, s) : e, o = t.length - 1, n; o >= 0; o--)
97
97
  (n = t[o]) && (a = (i ? n(e, s, a) : n(a)) || a);
98
98
  return i && a && ve(e, s, a), a;
99
99
  };
@@ -189,10 +189,10 @@ let C = class extends m {
189
189
  C = _([
190
190
  f("ArcadeDebuggerLazyTreeState")
191
191
  ], C);
192
- var ye = Object.defineProperty, De = Object.getOwnPropertyDescriptor, l = (t, e, s, i) => {
192
+ var $e = Object.defineProperty, De = Object.getOwnPropertyDescriptor, l = (t, e, s, i) => {
193
193
  for (var a = i > 1 ? void 0 : i ? De(e, s) : e, o = t.length - 1, n; o >= 0; o--)
194
194
  (n = t[o]) && (a = (i ? n(e, s, a) : n(a)) || a);
195
- return i && a && ye(e, s, a), a;
195
+ return i && a && $e(e, s, a), a;
196
196
  };
197
197
  let b = class extends m {
198
198
  constructor(t) {
@@ -238,7 +238,7 @@ l([
238
238
  b = l([
239
239
  f("ArcadeDebuggerExecutionModel")
240
240
  ], b);
241
- let y = class extends m {
241
+ let $ = class extends m {
242
242
  constructor(t) {
243
243
  super(t), this.editorBreakpoints = [], this.executionBreakpoints = [];
244
244
  }
@@ -258,13 +258,13 @@ let y = class extends m {
258
258
  };
259
259
  l([
260
260
  c()
261
- ], y.prototype, "editorBreakpoints", 2);
261
+ ], $.prototype, "editorBreakpoints", 2);
262
262
  l([
263
263
  c()
264
- ], y.prototype, "executionBreakpoints", 2);
265
- y = l([
264
+ ], $.prototype, "executionBreakpoints", 2);
265
+ $ = l([
266
266
  f("ArcadeDebuggerSessionModel")
267
- ], y);
267
+ ], $);
268
268
  let D = class extends m {
269
269
  constructor(t) {
270
270
  super(t), this.openedPanel = "output", this.showPanel = !1;
@@ -307,7 +307,7 @@ E = l([
307
307
  ], E);
308
308
  let p = class extends m {
309
309
  constructor(t) {
310
- super(t), this.execution = new b(), this.lazyTreeState = new C(), this.pausedFrame = new E(), this.previewTabsState = new V(), this.session = new y(), this.ui = new D();
310
+ super(t), this.execution = new b(), this.lazyTreeState = new C(), this.pausedFrame = new E(), this.previewTabsState = new W(), this.session = new $(), this.ui = new D();
311
311
  }
312
312
  get editorBreakpoints() {
313
313
  return this.session.editorBreakpoints;
@@ -391,7 +391,7 @@ let p = class extends m {
391
391
  this.execution.mode = "debug", this.execution.result = { resultType: "debug", result: t }, this.execution.phase = "completed", this.ui.openedPanel = "output", this.pausedFrame.reset(), this.resetTransientDebuggerState();
392
392
  }
393
393
  completeRun(t, e = {}) {
394
- this.execution.mode = "run", !e.useDebugRenderer && $(t) ? this.execution.result = { resultType: "run", result: t } : e.useDebugRenderer && !$(t) && (this.execution.result = { resultType: "debug", result: t }), this.execution.phase = "completed", this.pausedFrame.reset(), this.ui.openedPanel = "output", this.resetTransientDebuggerState();
394
+ this.execution.mode = "run", !e.useDebugRenderer && y(t) ? this.execution.result = { resultType: "run", result: t } : e.useDebugRenderer && !y(t) && (this.execution.result = { resultType: "debug", result: t }), this.execution.phase = "completed", this.pausedFrame.reset(), this.ui.openedPanel = "output", this.resetTransientDebuggerState();
395
395
  }
396
396
  continueDebug() {
397
397
  const t = this.pausedFrame.pausedState?.continue;
@@ -459,7 +459,7 @@ let p = class extends m {
459
459
  this.pausedLine = void 0, this.lazyTreeState.reset(), this.previewTabsState.clear();
460
460
  }
461
461
  replaceTransientDebuggerState() {
462
- this.pausedLine = void 0, this.lazyTreeState = new C(), this.previewTabsState = new V();
462
+ this.pausedLine = void 0, this.lazyTreeState = new C(), this.previewTabsState = new W();
463
463
  }
464
464
  };
465
465
  l([
@@ -503,10 +503,12 @@ class we extends ie {
503
503
  if (!e)
504
504
  return;
505
505
  const s = this._debuggerState.editorBreakpoints.map((i) => ({
506
- range: new W(i, 1, i, 1),
506
+ range: new V(i, 1, i, 1),
507
507
  options: {
508
508
  isWholeLine: !0,
509
- glyphMarginClassName: "arcgis-code-editor__breakpoint-glyph"
509
+ glyphMarginClassName: "arcgis-code-editor__breakpoint-glyph",
510
+ // keeps decoration at the same line when typing at the edges of the line or the range gets collapsed. essentially keeps breakpoint decoration as a single-line
511
+ stickiness: this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
510
512
  }
511
513
  }));
512
514
  this._decorations?.clear(), this._decorations = e.createDecorationsCollection(s);
@@ -543,7 +545,7 @@ class we extends ie {
543
545
  return { type: "error", value: "Missing editor profile", error: null };
544
546
  await this._componentReadyDefer.promise;
545
547
  const s = this._codeEditorElt.value?.value, i = await K(e.definition, s, this.testData, { mode: "run" });
546
- return $(i) ? i : { type: "error", value: "Unexpected debug result", error: null };
548
+ return y(i) ? i : { type: "error", value: "Unexpected debug result", error: null };
547
549
  }
548
550
  async setFocus() {
549
551
  await this._componentReadyDefer.promise, await this._codeEditorElt.value?.setFocus();
@@ -618,12 +620,15 @@ class we extends ie {
618
620
  const s = this._debuggerState.debuggerLine;
619
621
  s != null ? this._debuggerPausedLineDecoration = e.createDecorationsCollection([
620
622
  {
621
- range: new W(s, 1, s, 1),
623
+ range: new V(s, 1, s, 1),
622
624
  options: {
623
625
  isWholeLine: !0,
624
626
  className: "arcgis-code-editor__debugger-paused-line",
625
627
  glyphMarginClassName: "arcgis-code-editor__debugger-paused-glyph",
626
- marginClassName: "arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin"
628
+ marginClassName: "arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin",
629
+ // keeps decoration at the same line when typing at the edges of the line or the range gets collapsed.
630
+ // essentially keeps paused decoration as a single-line no matter what
631
+ stickiness: this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
627
632
  }
628
633
  }
629
634
  ]) : this._debuggerPausedLineDecoration = void 0;
@@ -738,14 +743,14 @@ class we extends ie {
738
743
  }
739
744
  if (i === this._debuggerState.sessionId) {
740
745
  if (e === "debug") {
741
- if ($(n)) {
746
+ if (y(n)) {
742
747
  this._debuggerState.fail(n);
743
748
  return;
744
749
  }
745
750
  this._debuggerState.completeDebug(n);
746
751
  return;
747
752
  }
748
- $(n) ? this._debuggerState.completeRun(n) : this.externalExecutor ? this._debuggerState.completeRun(n, { useDebugRenderer: !0 }) : this._debuggerState.fail({ type: "error", value: "Unexpected debug result", error: null });
753
+ y(n) ? this._debuggerState.completeRun(n) : this.externalExecutor ? this._debuggerState.completeRun(n, { useDebugRenderer: !0 }) : this._debuggerState.fail({ type: "error", value: "Unexpected debug result", error: null });
749
754
  }
750
755
  })();
751
756
  }, 0);
@@ -39,7 +39,23 @@ export interface EditorProfileDefinition {
39
39
  }
40
40
 
41
41
  /** @deprecated since 5.1. Use EditorProfileDefinition instead. */
42
- export interface IEditorProfileDefinition extends EditorProfileDefinition {}
42
+ export interface IEditorProfileDefinition {
43
+ /** Optional label for the profile. Used in the editor when displaying the variables panel. */
44
+ label?: string;
45
+ /**
46
+ * The collection of variables that will be passed to the expression at execution time.
47
+ * The variable declarations are used to help the editor provide validation and completion.
48
+ */
49
+ variables: ProfileVariable[];
50
+ /** The version of the Arcade API that the editor should use during validation and completion. */
51
+ apiVersion?: string;
52
+ /** The Arcade API bundles that the editor should use during validation and completion. */
53
+ bundles?: BundleType[];
54
+ /** A collection of additional Arcade API items that will be provided at runtime. */
55
+ additionalApiItems?: ApiItem[];
56
+ /** A collection of api item names to hide. */
57
+ hiddenApiItems?: string[];
58
+ }
43
59
 
44
60
  export interface PredefinedProfile {
45
61
  /** The well known profile ID. */
@@ -53,7 +69,16 @@ export interface PredefinedProfile {
53
69
  }
54
70
 
55
71
  /** @deprecated since 5.1. Use PredefinedProfile instead. */
56
- export interface IPredefinedProfile extends PredefinedProfile {}
72
+ export interface IPredefinedProfile {
73
+ /** The well known profile ID. */
74
+ id: ProfileId;
75
+ /** The variables that should be disabled for the profile. */
76
+ disabledVariables?: string[];
77
+ /** Provides the definitions for the definition based variables (feature, featureSet, featureSetCollection). */
78
+ definitions: VariableDefinitions;
79
+ /** A collection of api item names to hide. */
80
+ hiddenApiItems?: string[];
81
+ }
57
82
 
58
83
  /** The type of value variables supported. */
59
84
  export type ProfileVariableValueType = "boolean" | "date" | "dateOnly" | "geometry" | "knowledgeGraph" | "number" | "text" | "time";
@@ -77,7 +102,12 @@ export interface ProfileVariableBase {
77
102
  }
78
103
 
79
104
  /** @deprecated since 5.1. Use ProfileVariableBase instead. */
80
- export interface IProfileVariableBase extends ProfileVariableBase {}
105
+ export interface IProfileVariableBase {
106
+ /** Name of the variable */
107
+ name: string;
108
+ /** Description for the variable */
109
+ description?: string;
110
+ }
81
111
 
82
112
  /** Single value profile variable declaration. */
83
113
  export interface ProfileValue extends ProfileVariableBase {
@@ -85,7 +115,9 @@ export interface ProfileValue extends ProfileVariableBase {
85
115
  }
86
116
 
87
117
  /** @deprecated since 5.1. Use ProfileValue instead. */
88
- export interface IProfileValue extends ProfileValue {}
118
+ export interface IProfileValue extends IProfileVariableBase {
119
+ readonly type: ProfileVariableValueType;
120
+ }
89
121
 
90
122
  /** Dictionary profile variable declaration. Properties of a dictionary are profile variables. */
91
123
  export interface ProfileDictionary extends ProfileVariableBase {
@@ -95,7 +127,11 @@ export interface ProfileDictionary extends ProfileVariableBase {
95
127
  }
96
128
 
97
129
  /** @deprecated since 5.1. Use ProfileDictionary instead. */
98
- export interface IProfileDictionary extends ProfileDictionary {}
130
+ export interface IProfileDictionary extends IProfileVariableBase {
131
+ readonly type: "dictionary";
132
+ /** The dictionary properties. Properties are variables as well. */
133
+ properties?: ProfileVariable[];
134
+ }
99
135
 
100
136
  /** Dictionary profile variable declaration. Properties of a dictionary are profile variables. */
101
137
  export interface ProfileArray extends ProfileVariableBase {
@@ -105,7 +141,11 @@ export interface ProfileArray extends ProfileVariableBase {
105
141
  }
106
142
 
107
143
  /** @deprecated since 5.1. Use ProfileArray instead. */
108
- export interface IProfileArray extends ProfileArray {}
144
+ export interface IProfileArray extends IProfileVariableBase {
145
+ readonly type: "array";
146
+ /** The type for the array elements. */
147
+ elementType?: ProfileVariable;
148
+ }
109
149
 
110
150
  /**
111
151
  * Feature profile variable declaration.
@@ -119,7 +159,11 @@ export interface ProfileFeature extends ProfileVariableBase {
119
159
  }
120
160
 
121
161
  /** @deprecated since 5.1. Use ProfileFeature instead. */
122
- export interface IProfileFeature extends ProfileFeature {}
162
+ export interface IProfileFeature extends IProfileVariableBase {
163
+ readonly type: "feature";
164
+ /** Describes how the editor will find the definition for the feature. */
165
+ definition?: FeatureDefinition;
166
+ }
123
167
 
124
168
  /**
125
169
  * FeatureSet profile variable declaration.
@@ -133,7 +177,11 @@ export interface ProfileFeatureSet extends ProfileVariableBase {
133
177
  }
134
178
 
135
179
  /** @deprecated since 5.1. Use ProfileFeatureSet instead. */
136
- export interface IProfileFeatureSet extends ProfileFeatureSet {}
180
+ export interface IProfileFeatureSet extends IProfileVariableBase {
181
+ readonly type: "featureSet";
182
+ /** Describes how the editor will find the definition for the feature set. */
183
+ definition?: FeatureSetDefinition;
184
+ }
137
185
 
138
186
  /**
139
187
  * FeatureSetCollection profile variable declaration.
@@ -147,7 +195,11 @@ export interface ProfileFeatureSetCollection extends ProfileVariableBase {
147
195
  }
148
196
 
149
197
  /** @deprecated since 5.1. Use ProfileFeatureSetCollection instead. */
150
- export interface IProfileFeatureSetCollection extends ProfileFeatureSetCollection {}
198
+ export interface IProfileFeatureSetCollection extends IProfileVariableBase {
199
+ readonly type: "featureSetCollection";
200
+ /** Describes how the featureSetCollection will find its definition. */
201
+ definition?: FeatureSetCollectionDefinition;
202
+ }
151
203
 
152
204
  /** Voxel profile variable declaration. */
153
205
  export interface ProfileVoxel extends ProfileVariableBase {
@@ -157,7 +209,11 @@ export interface ProfileVoxel extends ProfileVariableBase {
157
209
  }
158
210
 
159
211
  /** @deprecated since 5.1. Use ProfileVoxel instead. */
160
- export interface IProfileVoxel extends ProfileVoxel {}
212
+ export interface IProfileVoxel extends IProfileVariableBase {
213
+ readonly type: "voxel";
214
+ /** Describes how the editor will find the definition for the voxel. */
215
+ definition?: VoxelDefinition;
216
+ }
161
217
 
162
218
  /** Pixel profile variable declaration. */
163
219
  export interface ProfilePixel extends ProfileVariableBase {
@@ -167,12 +223,16 @@ export interface ProfilePixel extends ProfileVariableBase {
167
223
  }
168
224
 
169
225
  /** @deprecated since 5.1. Use ProfilePixel instead. */
170
- export interface IProfilePixel extends ProfilePixel {}
226
+ export interface IProfilePixel extends IProfileVariableBase {
227
+ readonly type: "pixel";
228
+ /** Describes how the editor will find the definition for the pixel. */
229
+ definition?: PixelDefinition;
230
+ }
171
231
 
172
232
  export type FeatureLikeProfile = ProfileFeature | ProfilePixel | ProfileVoxel;
173
233
 
174
234
  /** @deprecated since 5.1. Use FeatureLikeProfile instead. */
175
- export type IFeatureLikeProfile = FeatureLikeProfile;
235
+ export type IFeatureLikeProfile = IProfileFeature | IProfilePixel | IProfileVoxel;
176
236
 
177
237
  /**
178
238
  * Data catalog datastore profile variable declaration.
@@ -275,7 +335,12 @@ export interface PortalItemProperties {
275
335
  }
276
336
 
277
337
  /** @deprecated since 5.1. Use PortalItemProperties instead. */
278
- export interface IPortalItemProperties extends PortalItemProperties {}
338
+ export interface IPortalItemProperties {
339
+ /** The unique portal item id. */
340
+ id: string;
341
+ /** The optional portal url. Default: www.arcgis.com. */
342
+ portal?: { url: string; };
343
+ }
279
344
 
280
345
  /** WebMap and Service FeatureSetCollection can be defined by a portal item. */
281
346
  export interface PortalItemDefinition {
@@ -284,7 +349,10 @@ export interface PortalItemDefinition {
284
349
  }
285
350
 
286
351
  /** @deprecated since 5.1. Use PortalItemDefinition instead. */
287
- export interface IPortalItemDefinition extends PortalItemDefinition {}
352
+ export interface IPortalItemDefinition {
353
+ /** Describes a portal item. */
354
+ portalItem: PortalItemProperties;
355
+ }
288
356
 
289
357
  /** FeatureLayer can be defined from a Feature Layer portal item. */
290
358
  export interface FeatureLayerItemDefinition extends PortalItemDefinition {
@@ -293,7 +361,10 @@ export interface FeatureLayerItemDefinition extends PortalItemDefinition {
293
361
  }
294
362
 
295
363
  /** @deprecated since 5.1. Use FeatureLayerItemDefinition instead. */
296
- export interface IFeatureLayerItemDefinition extends FeatureLayerItemDefinition {}
364
+ export interface IFeatureLayerItemDefinition extends IPortalItemDefinition {
365
+ /** The layer id in the feature layer portal item. Default to 0. */
366
+ layerId?: number;
367
+ }
297
368
 
298
369
  /** FeatureLayers and GroupLayers can be created by providing the url to the resource in a feature service. */
299
370
  export interface UrlDefinition {
@@ -302,7 +373,10 @@ export interface UrlDefinition {
302
373
  }
303
374
 
304
375
  /** @deprecated since 5.1. Use UrlDefinition instead. */
305
- export interface IUrlDefinition extends UrlDefinition {}
376
+ export interface IUrlDefinition {
377
+ /** The url of the resource. */
378
+ url?: string | null;
379
+ }
306
380
 
307
381
  /** The most basic way to define a feature or feature set is by passing a collection of fields */
308
382
  export type FieldsDefinition = Pick<FeatureLayer, "fields">;
@@ -350,7 +424,9 @@ export interface ExtendedPredefinedProfile extends PredefinedProfile {
350
424
  }
351
425
 
352
426
  /** @deprecated since 5.1. Use ExtendedPredefinedProfile instead. */
353
- export interface IExtendedPredefinedProfile extends ExtendedPredefinedProfile {}
427
+ export interface IExtendedPredefinedProfile extends IPredefinedProfile {
428
+ additionalVariables?: ProfileVariable[];
429
+ }
354
430
 
355
431
  export interface EditorCodeSuggestionGroup {
356
432
  /** Label for the suggestion group */
@@ -360,7 +436,12 @@ export interface EditorCodeSuggestionGroup {
360
436
  }
361
437
 
362
438
  /** @deprecated since 5.1. Use EditorCodeSuggestionGroup instead. */
363
- export interface IEditorCodeSuggestionGroup extends EditorCodeSuggestionGroup {}
439
+ export interface IEditorCodeSuggestionGroup {
440
+ /** Label for the suggestion group */
441
+ label: string;
442
+ /** List of suggestions for the group */
443
+ suggestions: EditorCodeSuggestion[];
444
+ }
364
445
 
365
446
  export interface EditorCodeSuggestion {
366
447
  /** A short label for the suggestion. Can be thought as a title */
@@ -374,7 +455,16 @@ export interface EditorCodeSuggestion {
374
455
  }
375
456
 
376
457
  /** @deprecated since 5.1. Use EditorCodeSuggestion instead. */
377
- export interface IEditorCodeSuggestion extends EditorCodeSuggestion {}
458
+ export interface IEditorCodeSuggestion {
459
+ /** A short label for the suggestion. Can be thought as a title */
460
+ label: string;
461
+ /** A short description that will be showed below the label in the list of suggestions panel */
462
+ description?: string;
463
+ /** Markdown string that will be rendered along with the code in the detail panel */
464
+ documentation?: string;
465
+ /** The code for the suggestion. Will be injected in the editor is selected */
466
+ code: string;
467
+ }
378
468
 
379
469
  export type SidePanelName = "api" | "none" | "suggestions" | "variables";
380
470
 
@@ -394,7 +484,20 @@ export interface ContextReferences {
394
484
  }
395
485
 
396
486
  /** @deprecated since 5.1. Use ContextReferences instead. */
397
- export interface IContextReferences extends ContextReferences {}
487
+ export interface IContextReferences {
488
+ /**
489
+ * Spatial reference object used to define the spatial reference for the arcade runtime.
490
+ * By defaults, the spatial reference is set to Web Mercator (wkid: 3857).
491
+ */
492
+ spatialReference?: SpatialReference | { wkid: number; } | null;
493
+ /**
494
+ * Defines the default time zone in which to create and display Arcade date types.
495
+ * By default, the time zone is set to "system".
496
+ */
497
+ timeZone?: string;
498
+ /** Defines the "services" passed to the arcade executor. */
499
+ services?: ArcadeServices;
500
+ }
398
501
 
399
502
  /**
400
503
  * If a profile doesn't contain a map, the spatial reference of geometries will be defaulted to
@@ -410,4 +513,10 @@ export interface EditorTestContext extends ContextReferences {
410
513
  }
411
514
 
412
515
  /** @deprecated since 5.1. Use EditorTestContext instead. */
413
- export interface IEditorTestContext extends EditorTestContext {}
516
+ export interface IEditorTestContext extends IContextReferences {
517
+ /**
518
+ * An object of key/value pairs where the key is the name of a profile variable.
519
+ * The key's value must be of type ArcGIS core ProfileVariableInstance.
520
+ */
521
+ profileVariableInstances: ProfileVariableInstances;
522
+ }