@arcgis/coding-components 5.2.0-next.144 → 5.2.0-next.145
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/{4OC4PWCA.js → 5SMTLM63.js} +1 -1
- package/dist/cdn/{A3TU47C5.js → EQUNYQFX.js} +1 -1
- package/dist/cdn/{VHXEN75D.js → F3SAX4ME.js} +1 -1
- package/dist/cdn/{ZJCPZ5ZN.js → HPGMCJXP.js} +1 -1
- package/dist/cdn/{MBEHVUYT.js → IKFDJHMC.js} +1 -1
- package/dist/cdn/{EQDKZIAP.js → JRRAYX43.js} +1 -1
- package/dist/cdn/{62ON7ZHZ.js → KKN6Q2LE.js} +1 -1
- package/dist/cdn/{GJ4W3JPG.js → KRDRD2B4.js} +1 -1
- package/dist/cdn/{BPCBI4SE.js → S7HUEYFG.js} +1 -1
- package/dist/cdn/{CP57L67B.js → TTWGF3XR.js} +1 -1
- package/dist/cdn/{7GVCXLAE.js → VQONAD2Y.js} +1 -1
- package/dist/cdn/{G4VQ7X3L.js → WJCAK4LW.js} +1 -1
- package/dist/cdn/{GDTEFKCP.js → XRP4U5KQ.js} +1 -1
- package/dist/cdn/{467GNIKK.js → XYBHGDM5.js} +1 -1
- package/dist/cdn/index.js +1 -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 +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import h from"./AI6346MJ.js";import g from"./D5GWRYT7.js";import f from"./J7TSCCXO.js";import e from"./SXM2EQHN.js";import d from"./H5EGZU2S.js";import{f as j}from"./ZLV7T4YS.js";import b from"./7Z6G332Z.js";import"./MZMKV7FA.js";import a from"./ZUCC43DN.js";import{a as W}from"./G4VQ7X3L.js";import{a as H}from"./A3TU47C5.js";import"./C5WMGZYX.js";import"./J4I4EROF.js";import{a as Z,b as ee,c as D}from"./UHQN4ZKV.js";import"./LEFE3FVL.js";import"./XEK22IDA.js";import{a as Y}from"./NKGAHXNJ.js";import"./XWEX2VS6.js";import"./3G26WBEK.js";import{E as T,F as I,G as q,H as y,K as G,L as V,h as z,j as c,l as C,n as R,t as U}from"./O6XP7VU2.js";import{b as l}from"./BFPEJYVB.js";import{El as Q,wl as L,xl as M,zl as F}from"./XCISKBJD.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:v},P,{property:r,subclass:A},{a:X,d:b,i:S,j:w},{b:O},,,f,{a:J},{a:te,b:se}])=>{var ae=z`: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: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}}`,ne=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,m=(s,e,t,i)=>{for(var a=i>1?void 0:i?oe(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&ne(e,t,a),a},ie=100,h=class extends P{constructor(s){super(s),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=ie}};m([r()],h.prototype,"collectionItems",2);m([r()],h.prototype,"errorMessage",2);m([r()],h.prototype,"expanded",2);m([r()],h.prototype,"requestId",2);m([r()],h.prototype,"schemaValue",2);m([r()],h.prototype,"status",2);m([r()],h.prototype,"visibleChildCount",2);h=m([A("ArcadeDebuggerLazyTreeNodeState")],h);var B=class extends P{constructor(s){super(s),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(s,e=!1,t){let i=this.nodes.get(s);if(i)return i;let a=new h;return a.expanded=e,this.nodes.set(s,a),e&&t&&this.loadNode(s,t),a}setExpanded(s,e,t){let i=this.ensureNode(s,e,t);if(i.expanded===e){e&&t&&this.loadNode(s,t);return}i.expanded=e,e&&t&&this.loadNode(s,t)}showMore(s,e){let t=this.ensureNode(s);t.visibleChildCount>=e||(t.visibleChildCount=Math.min(e,t.visibleChildCount+ie))}loadNode(s,e){switch(e.kind){case"collection":this.runLoad(s,e.load,(t,i)=>{t.collectionItems=i});return;case"schema":this.runLoad(s,e.load,(t,i)=>{t.schemaValue=i});return}}runLoad(s,e,t){let i=this.nodes.get(s);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,n=i.requestId+1;i.requestId=n,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(o=>{let u=this.nodes.get(s);!u||this.generation!==a||u.requestId!==n||(t(u,o),u.status="loaded")}).catch(()=>{let o=this.nodes.get(s);!o||this.generation!==a||o.requestId!==n||(o.status="error")})}destroyNodes(){for(let s of this.nodes.values())s.destroy();this.nodes.clear()}};B=m([A("ArcadeDebuggerLazyTreeState")],B);var re=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,d=(s,e,t,i)=>{for(var a=i>1?void 0:i?ce(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&re(e,t,a),a},_=class extends P{constructor(s){super(s),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 resultForLegacyRenderer(){return this.result?.resultType==="debug"?void 0:this.result?.result}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}get executionTiming(){return this.result?.resultType==="error"?void 0:this.result?.timing}addConsoleLog(s){this.consoleLogs=[...this.consoleLogs,s]}};d([r()],_.prototype,"phase",2);d([r()],_.prototype,"mode",2);d([r()],_.prototype,"sessionId",2);d([r()],_.prototype,"result",2);d([r()],_.prototype,"consoleLogs",2);d([r()],_.prototype,"hasExecuted",2);_=d([A("ArcadeDebuggerExecutionModel")],_);var $=class extends P{constructor(s){super(s),this.editorBreakpoints=[],this.executionBreakpoints=[]}setBreakpoints(s,e){s==="editor"?this.editorBreakpoints=Array.from(new Set(e)).sort((t,i)=>t-i):this.executionBreakpoints=Array.from(new Set(e)).sort((t,i)=>t-i)}toggleBreakpoint(s,e){let t=new Set(s==="editor"?this.editorBreakpoints:this.executionBreakpoints);t.has(e)?t.delete(e):t.add(e),this.setBreakpoints(s,t)}clearBreakpoints(s){s==="editor"?this.editorBreakpoints=[]:this.executionBreakpoints=[]}syncExecutionBreakpointsFromEditor(){this.executionBreakpoints=this.editorBreakpoints}};d([r()],$.prototype,"editorBreakpoints",2);d([r()],$.prototype,"executionBreakpoints",2);$=d([A("ArcadeDebuggerSessionModel")],$);var E=class extends P{constructor(s){super(s),this.openedPanel="output",this.showPanel=!1}};d([r()],E.prototype,"openedPanel",2);d([r()],E.prototype,"showPanel",2);E=d([A("ArcadeDebuggerUiModel")],E);var k=class extends P{constructor(s){super(s)}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(s){this.pausedState=s,this.lastPausedState=s}};d([r()],k.prototype,"pausedState",2);d([r()],k.prototype,"lastPausedState",2);k=d([A("ArcadeDebuggerPausedFrameModel")],k);var g=class extends P{constructor(s){super(s),this.execution=new _,this.lazyTreeState=new B,this.pausedFrame=new k,this.previewTabsState=new O,this.session=new $,this.ui=new E}get editorBreakpoints(){return this.session.editorBreakpoints}get debuggerBreakpoints(){return this.isPaused?this.session.executionBreakpoints.map(s=>({line:s})):this.session.editorBreakpoints.map(s=>({line:s}))}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 executionTiming(){return this.execution.executionTiming}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 resultForLegacyRenderer(){return this.execution.resultForLegacyRenderer}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(s){this.execution.addConsoleLog(s)}clearBreakpoints(s){this.session.clearBreakpoints(s)}clearForMissingTestData(){this.cancelExecution({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(s,e){this.execution.mode="debug",this.execution.result={resultType:"debug",result:s,...e?{timing:e}:{}},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(s,e={}){this.execution.mode="run",!e.useDebugRenderer&&S(s)?this.execution.result={resultType:"run",result:s}:e.useDebugRenderer&&!S(s)&&(this.execution.result={resultType:"debug",result:s,...e.timing?{timing:e.timing}:{}}),this.execution.phase="completed",this.pausedFrame.reset(),this.ui.openedPanel="output",this.resetTransientDebuggerState()}continueDebug(){let s=this.pausedFrame.pausedState?.continue;s&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),s.resolve())}disableDebugger(){this.cancelExecution({hidePanel:!0}),this.clearBreakpoints("execution"),this.clearBreakpoints("editor")}fail(s){this.execution.result={resultType:"error",result:s},this.execution.phase="completed",this.pausedFrame.reset(),this.ui.openedPanel="output",this.resetTransientDebuggerState()}pauseDebug(s){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,s),this.pausedFrame.setPausedState(s),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.cancelExecution({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.cancelExecution({hidePanel:!0})}setBreakpoints(s){this.session.setBreakpoints("editor",s)}setPanel(s){this.execution.hasExecuted&&(this.ui.openedPanel=s,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}cancelExecution({hidePanel:s=!0,invalidateSession:e=!0}={}){let t=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),s&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),t?.resolve()}syncPausedState(s,e){this.lazyTreeState.reset(),s&&e&&s!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(s){this.session.toggleBreakpoint("editor",s)}togglePanel(s){if(this.execution.hasExecuted){if(s==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===s&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(s)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new B,this.previewTabsState=new O}};d([r()],g.prototype,"execution",2);d([r()],g.prototype,"lazyTreeState",2);d([r()],g.prototype,"pausedLine",2);d([r()],g.prototype,"pausedFrame",2);d([r()],g.prototype,"previewTabsState",2);d([r()],g.prototype,"session",2);d([r()],g.prototype,"ui",2);g=d([A("ArcadeDebuggerStore")],g);var N=class{#e;#a;#t;constructor(e,t=w){this.#e=e,this.#a=t}start(e){this.cancel({hidePanel:!1});let t=e.mode==="debug"?this.#e.startDebug():this.#e.startRun();setTimeout(()=>{this.#s(t)&&this.#o(e,t)},0)}cancel({hidePanel:e=!0}={}){this.#t?.abort(),this.#t=void 0,this.#e.isExecuting&&this.#e.cancelExecution({hidePanel:e})}async#o(e,t){let i;try{let{externalExecutor:a}=e;i=a?await this.#c({...e,externalExecutor:a},t):await this.#r(e,t)}catch(a){let n=a instanceof Error?a.message:String(a);i={type:"failure",error:b(n,a)}}this.#d(t,i)}async#r(e,t){if(!e.testData)return{type:"failure",error:b("Missing test data")};let i=await e.editorProfile;if(!i)return{type:"failure",error:b("Missing editor profile")};let a=await this.#a(i.definition,e.script,e.testData,{mode:e.mode,console:n=>this.#i(t,n),breakpoints:e.mode==="debug"?e.breakpoints:void 0,onDebugPause:e.mode==="debug"?(n,o)=>this.#n(t,n,o):void 0});return e.mode==="debug"?S(a)?{type:"failure",error:this.#u(a)}:{type:"debug",value:a}:S(a)?{type:"legacy-run",result:a}:{type:"failure",error:b("Unexpected debug result")}}async#c(e,t){let{externalExecutor:i}=e,a=new AbortController;this.#t=a;try{if(e.mode==="debug"){let o=await i.execute({mode:"debug",script:e.script,console:u=>this.#i(t,u),signal:a.signal,breakpoints:e.breakpoints,onDebugPause:(u,x)=>this.#n(t,u,x)});return{type:"debug",value:o.result,timing:o.timing}}let n=await i.execute({mode:"run",script:e.script,console:o=>this.#i(t,o),signal:a.signal});return{type:"run",value:n.result,timing:n.timing}}catch(n){let o=n instanceof Error?n.message:String(n);return{type:"failure",error:b(o,n)}}finally{this.#t===a&&(this.#t=void 0)}}#i(e,t){this.#s(e)&&this.#e.addConsoleLog(t)}async#n(e,t,i){if(!this.#s(e)||!this.#e.isDebugging)return;let a=Promise.withResolvers();return this.#e.pauseDebug({line:t.line,result:i,continue:a}),await a.promise}#d(e,t){if(this.#s(e))switch(t.type){case"debug":this.#e.completeDebug(t.value,t.timing);return;case"failure":this.#e.fail(t.error);return;case"legacy-run":this.#e.completeRun(t.result);return;case"run":this.#e.completeRun(t.value,{useDebugRenderer:!0,timing:t.timing})}}#u(e){return e.type==="error"?b(e.value,e.error):b("Unexpected legacy result")}#s(e){return e===this.#e.sessionId}},de={glyphMargin:!0,lineNumbersMinChars:1},K=class extends q{constructor(){super(...arguments),this._codeEditorElt=T(),this._arcadeAssistantElt=T(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._focusContinueActionOnPause=!1,this._debuggerState=new g,this._executionCoordinator=new N(this._debuggerState),this.messages=W(),this._modelId=U(),this._openArcadeHelp=()=>{window.open(X,"Arcade Help")},this._decorations=void 0,this._monacoEditor=H(Y),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 t=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(t)},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=R({bubbles:!1}),this.arcgisScriptChange=R({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,docsConfig:0}}static{this.styles=[ae]}get _canExecute(){return!!(this.testData||this.externalExecutor)}get _usesBottomExecutionDrawer(){return this._canExecute&&(this.enableDebugger||!!this.externalExecutor)}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 t=this._codeEditorElt.value?.value,i=await w(e.definition,t,this.testData,{mode:"run"});return S(i)?i:{type:"error",value:"Unexpected result",error:null}}async testRun(){try{let e=this._codeEditorElt.value?.value??this.script;if(this.externalExecutor){let{result:n}=await this.externalExecutor.execute({mode:"run",script:e,console:()=>{},signal:new AbortController().signal});return n}let t=this.testData;if(!t)throw new Error("Missing test data");await this._componentReadyDefer.promise;let i=await this._editorProfilePromise;if(!i)throw new Error("Missing editor profile");let a=await w(i.definition,e,t,{mode:"debug"});if(S(a))throw a.type==="error"&&a.error instanceof Error?a.error:new Error(a.type==="error"?a.value:"Unexpected Arcade result");return a}catch(e){let t=e instanceof Error?e.message:String(e);return b(t,e)}}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 t=this._arcadeAssistantElt.value;return e?.prompt&&await t?.openPrompt(e.prompt),!0}async load(){let e=V("./assets");te(e),await this._updateDataModelDeps(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(l(this)),()=>{for(this._askAiBindingKey&&(D(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);this._disposables.length;)this._disposables.pop()?.dispose();this._executionCoordinator.cancel(),this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._executeDebugScriptAction=void 0,this._hasDebuggerBreakpointsContextKey=void 0,this._focusContinueActionOnPause=!1,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),(e.has("testData")||e.has("externalExecutor"))&&this._executionContextChanged(),e.has("enableDebugger")&&(this.enableDebugger||this._debuggerState.disableDebugger(),this._syncExecuteDebugScriptAction()),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 se();this._disposables.push(e.onDiagnosticsChange(p=>{this._preparingArcade||(this._diagnostics=p.diagnostics,this.arcgisDiagnosticsChange.emit(p.diagnostics))})),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._syncAskAiAction();let t=v(()=>this._debuggerState.editorBreakpoints,()=>{this._updateBreakpointsDecorations(),this._updateDebuggerBreakpointContextKey()},{sync:!0}),i=v(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=v(()=>this._debuggerState.isPaused,()=>{!this._debuggerState.isPaused||!this._focusContinueActionOnPause||(this._focusContinueActionOnPause=!1,this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.isConnected&&this._debuggerState.isPaused&&this.el.shadowRoot?.querySelector("#debugger-continue-action")?.setFocus()})}))},{sync:!0}),n=v(()=>this._debuggerState.isDebugging,()=>{this._debuggerState.isDebugging||(this._focusContinueActionOnPause=!1)},{sync:!0}),o=v(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>t.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()},{dispose:()=>n.remove()},{dispose:()=>o.remove()}),this._updateDebuggerBreakpointContextKey();let u=this.editorInstance?.onMouseDown(p=>this._onEditorMouseDown(p));u&&this._disposables.push(u);let x=this.editorInstance?.onDidChangeModelContent(p=>this._onEditorModelContentChange(p));x&&this._disposables.push(x),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 t=e.target.position?.lineNumber;t&&this._debuggerState.toggleBreakpoint(t)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.editorBreakpoints.length||e.isFlush)return;let t=j(this._debuggerState.editorBreakpoints,e.changes);t.length===this._debuggerState.editorBreakpoints.length&&t.every((i,a)=>i===this._debuggerState.editorBreakpoints[a])||this._debuggerState.setBreakpoints(t)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let t=this._debuggerState.debuggerLine;t!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new F(t,1,t,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()}_stopDebugSession(){this._executionCoordinator.cancel({hidePanel:!1})}_resetDebugSession(){this._debuggerState.resetDebug(),this._executeScript("debug").catch(l(this))}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_executionContextChanged(){this._canExecute||(this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this._executeDebugScriptAction&&(this._disposeSafely(this._executeDebugScriptAction),this._executeDebugScriptAction=void 0)),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.openedPanel==="debug-console"&&!this.enableDebugger&&this._debuggerState.closePanel(),this._executionCoordinator.cancel({hidePanel:!1}),this._debuggerState.showPanel&&this._executeScript("run").catch(l(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,t=!1){let i=this.testData,a=this.externalExecutor;!this._codeEditorElt.value||!i&&!a||(this._focusContinueActionOnPause=e==="debug"&&t,this._executionCoordinator.start({mode:e,script:this._codeEditorElt.value?.value??this.script,testData:i,editorProfile:this._editorProfilePromise,externalExecutor:a,breakpoints:this._debuggerState.debuggerBreakpoints}))}_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(l(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(l(this))}_onResultPanelChange(e){let t=e.currentTarget;this._debuggerState.setPanel(t.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[L.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this._canExecute&&this._executeScript("run").catch(l(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e)),this._syncExecuteDebugScriptAction()}_syncExecuteDebugScriptAction(){if(!this._canExecute||!this.enableDebugger){this._executeDebugScriptAction&&(this._disposeSafely(this._executeDebugScriptAction),this._executeDebugScriptAction=void 0);return}if(this._executeDebugScriptAction)return;let e=this.editorInstance?.addAction({id:"run-debug-script",label:this.messages.runanddebug??"Run and debug",precondition:"arcgisArcadeDebuggerHasBreakpoints",keybindings:[M.CtrlCmd|M.Shift|L.F5],contextMenuGroupId:"code",contextMenuOrder:2,run:()=>this._runAndDebug()});this._hasDebuggerBreakpointsContextKey??=this.editorInstance?.createContextKey("arcgisArcadeDebuggerHasBreakpoints",this._debuggerState.editorBreakpoints.length>0),this._updateDebuggerBreakpointContextKey(),e&&(this._executeDebugScriptAction=e,this._disposables.push(e))}_updateDebuggerBreakpointContextKey(){this._hasDebuggerBreakpointsContextKey?.set(this._debuggerState.editorBreakpoints.length>0)}_runAndDebug(){!this._canExecute||!this.enableDebugger||!this._debuggerState.editorBreakpoints.length||this._executeScript("debug",!0).catch(l(this))}_getAskAiBindingKey(){return Q.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 t=this.messages.askarcadeassistant??"Ask Arcade Assistant",i=this._getAskAiBindingKey();return[{title:t,kind:Z,diagnostics:e.markers,isPreferred:!1,isAI:!1,command:{id:ee,title:t,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&&(D(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);return}this._askAiBindingKey&&this._askAiBindingKey!==e&&D(this._askAiBindingKey,void 0),D(e,{provideCodeActions:({context:t})=>this._getAskAiCodeActions(t),run:t=>{this.openArcadeAssistant({prompt:t??this.messages.askarcadeassistantprompt??"Fix the errors in my script"}).catch(l(this))}}),this._askAiBindingKey=e}_disposeSafely(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1),e.dispose()}async _updateArcadeAssistantRemoteState(){let e=this.arcadeAssistant;this.disableAssistant?this._arcadeAssistantRemoteState={shouldRender:!1}:this._arcadeAssistantRemoteState=await J(e??{}),this._syncAskAiAction()}renderMainActionBar(){return this._usesBottomExecutionDrawer||!this._canExecute?null:c`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-toggle-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(l(this))}}></calcite-action>${this._debuggerState.result?c`<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 c`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${f.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${I(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:i,active:a,panelName:n,iconFlipRtl:o=!1,onClick:u=this._toggleSidePanel}){return c`<calcite-action id=${e??C} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${u} data-panel-name=${n??C} .iconFlipRtl=${o}></calcite-action>${!this.sideActionBarExpanded&&c`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:c`<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:t}=this;return c`<arcgis-language-api-panel slot=side-panel class=${y(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=${y(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,profilevariables:this.messages.profilevariables}}></arcgis-editor-variables>${this.suggestions?.length&&c`<arcgis-arcade-suggestions slot=side-panel class=${y(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${t?.shouldRender&&c`<arcgis-arcade-coding-assistant slot=side-panel class=${y(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${t.portalUrl} .serviceUrl=${"serviceUrl"in t?t.serviceUrl:void 0} .helpBase=${t.helpBase} .promptingEnabled=${this._canPromptWithArcadeAssistant()} .feedbackServiceUrl=${t.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant?.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant?.disableQuestionAnswerLogging} .diagnostics=${this._diagnostics} .isDevEnv=${"isDevEnv"in t?t.isDevEnv:!1} .docsConfig=${this.docsConfig} ${I(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(i=>c`<calcite-flow slot=side-panel class=${y(e===i.id?"":"hidden")}>${i?.useFlows?i.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==i.id,editorRef:this.el}):c`<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 c`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.resultForLegacyRenderer} .executionTiming=${this._debuggerState.executionTiming} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:t,debugResult:i,isExecuting:a}=this._debuggerState;if(!e)return null;let n=t==="debug-console"?"output":t;return this.enableDebugger&&t==="debug-console"?c`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:t==="output"&&i?c`<arcgis-arcade-debugger-output slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:c`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${n} .loading=${t==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.resultForLegacyRenderer} .executionTiming=${this._debuggerState.executionTiming} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:t,openedPanel:i,isDebugging:a,isPaused:n,isExecuting:o}=this._debuggerState,u=this.messages.continue??"Continue",x=this.messages.reset??"Reset",p=this.messages.stop??"Stop";return c`<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-toggle-disabled expanded><calcite-action-group scale=s>${this.enableDebugger&&a?c`<calcite-action id=debugger-continue-action .text=${u} icon=forward scale=s .disabled=${!n} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${u}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${x} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${x}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${p} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${p}</span></calcite-tooltip>`:c`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||o} @click=${()=>{this._executeScript("run").catch(l(this))}}></calcite-action>${this.enableDebugger&&c`<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||o} @click=${this._runAndDebug}></calcite-action>`||""}`}</calcite-action-group>${t?c`<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>${this.enableDebugger&&c`<calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug console"} text-enabled scale=s icon=debug .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action>`||""}</calcite-action-group>`:null}</calcite-action-bar>${e?c`<calcite-action .text=${this.messages.collapse??"Collapse"} scale=s icon=chevrons-down icon-flip-rtl @click=${this._onExecutionPanelClose} slot=actions-end></calcite-action>`:null}</div>`}render(){return c`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};G("arcgis-arcade-editor",K);return K},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,d,e,f,g,h)
|
|
2
|
+
import h from"./AI6346MJ.js";import g from"./D5GWRYT7.js";import f from"./J7TSCCXO.js";import e from"./SXM2EQHN.js";import d from"./H5EGZU2S.js";import{f as j}from"./ZLV7T4YS.js";import b from"./7Z6G332Z.js";import"./MZMKV7FA.js";import a from"./ZUCC43DN.js";import{a as W}from"./WJCAK4LW.js";import{a as H}from"./EQUNYQFX.js";import"./C5WMGZYX.js";import"./J4I4EROF.js";import{a as Z,b as ee,c as D}from"./UHQN4ZKV.js";import"./LEFE3FVL.js";import"./XEK22IDA.js";import{a as Y}from"./NKGAHXNJ.js";import"./XWEX2VS6.js";import"./3G26WBEK.js";import{E as T,F as I,G as q,H as y,K as G,L as V,h as z,j as c,l as C,n as R,t as U}from"./O6XP7VU2.js";import{b as l}from"./BFPEJYVB.js";import{El as Q,wl as L,xl as M,zl as F}from"./XCISKBJD.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:v},P,{property:r,subclass:A},{a:X,d:b,i:S,j:w},{b:O},,,f,{a:J},{a:te,b:se}])=>{var ae=z`: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: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}}`,ne=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,m=(s,e,t,i)=>{for(var a=i>1?void 0:i?oe(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&ne(e,t,a),a},ie=100,h=class extends P{constructor(s){super(s),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=ie}};m([r()],h.prototype,"collectionItems",2);m([r()],h.prototype,"errorMessage",2);m([r()],h.prototype,"expanded",2);m([r()],h.prototype,"requestId",2);m([r()],h.prototype,"schemaValue",2);m([r()],h.prototype,"status",2);m([r()],h.prototype,"visibleChildCount",2);h=m([A("ArcadeDebuggerLazyTreeNodeState")],h);var B=class extends P{constructor(s){super(s),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(s,e=!1,t){let i=this.nodes.get(s);if(i)return i;let a=new h;return a.expanded=e,this.nodes.set(s,a),e&&t&&this.loadNode(s,t),a}setExpanded(s,e,t){let i=this.ensureNode(s,e,t);if(i.expanded===e){e&&t&&this.loadNode(s,t);return}i.expanded=e,e&&t&&this.loadNode(s,t)}showMore(s,e){let t=this.ensureNode(s);t.visibleChildCount>=e||(t.visibleChildCount=Math.min(e,t.visibleChildCount+ie))}loadNode(s,e){switch(e.kind){case"collection":this.runLoad(s,e.load,(t,i)=>{t.collectionItems=i});return;case"schema":this.runLoad(s,e.load,(t,i)=>{t.schemaValue=i});return}}runLoad(s,e,t){let i=this.nodes.get(s);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,n=i.requestId+1;i.requestId=n,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(o=>{let u=this.nodes.get(s);!u||this.generation!==a||u.requestId!==n||(t(u,o),u.status="loaded")}).catch(()=>{let o=this.nodes.get(s);!o||this.generation!==a||o.requestId!==n||(o.status="error")})}destroyNodes(){for(let s of this.nodes.values())s.destroy();this.nodes.clear()}};B=m([A("ArcadeDebuggerLazyTreeState")],B);var re=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,d=(s,e,t,i)=>{for(var a=i>1?void 0:i?ce(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&re(e,t,a),a},_=class extends P{constructor(s){super(s),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 resultForLegacyRenderer(){return this.result?.resultType==="debug"?void 0:this.result?.result}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}get executionTiming(){return this.result?.resultType==="error"?void 0:this.result?.timing}addConsoleLog(s){this.consoleLogs=[...this.consoleLogs,s]}};d([r()],_.prototype,"phase",2);d([r()],_.prototype,"mode",2);d([r()],_.prototype,"sessionId",2);d([r()],_.prototype,"result",2);d([r()],_.prototype,"consoleLogs",2);d([r()],_.prototype,"hasExecuted",2);_=d([A("ArcadeDebuggerExecutionModel")],_);var $=class extends P{constructor(s){super(s),this.editorBreakpoints=[],this.executionBreakpoints=[]}setBreakpoints(s,e){s==="editor"?this.editorBreakpoints=Array.from(new Set(e)).sort((t,i)=>t-i):this.executionBreakpoints=Array.from(new Set(e)).sort((t,i)=>t-i)}toggleBreakpoint(s,e){let t=new Set(s==="editor"?this.editorBreakpoints:this.executionBreakpoints);t.has(e)?t.delete(e):t.add(e),this.setBreakpoints(s,t)}clearBreakpoints(s){s==="editor"?this.editorBreakpoints=[]:this.executionBreakpoints=[]}syncExecutionBreakpointsFromEditor(){this.executionBreakpoints=this.editorBreakpoints}};d([r()],$.prototype,"editorBreakpoints",2);d([r()],$.prototype,"executionBreakpoints",2);$=d([A("ArcadeDebuggerSessionModel")],$);var E=class extends P{constructor(s){super(s),this.openedPanel="output",this.showPanel=!1}};d([r()],E.prototype,"openedPanel",2);d([r()],E.prototype,"showPanel",2);E=d([A("ArcadeDebuggerUiModel")],E);var k=class extends P{constructor(s){super(s)}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(s){this.pausedState=s,this.lastPausedState=s}};d([r()],k.prototype,"pausedState",2);d([r()],k.prototype,"lastPausedState",2);k=d([A("ArcadeDebuggerPausedFrameModel")],k);var g=class extends P{constructor(s){super(s),this.execution=new _,this.lazyTreeState=new B,this.pausedFrame=new k,this.previewTabsState=new O,this.session=new $,this.ui=new E}get editorBreakpoints(){return this.session.editorBreakpoints}get debuggerBreakpoints(){return this.isPaused?this.session.executionBreakpoints.map(s=>({line:s})):this.session.editorBreakpoints.map(s=>({line:s}))}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 executionTiming(){return this.execution.executionTiming}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 resultForLegacyRenderer(){return this.execution.resultForLegacyRenderer}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(s){this.execution.addConsoleLog(s)}clearBreakpoints(s){this.session.clearBreakpoints(s)}clearForMissingTestData(){this.cancelExecution({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(s,e){this.execution.mode="debug",this.execution.result={resultType:"debug",result:s,...e?{timing:e}:{}},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(s,e={}){this.execution.mode="run",!e.useDebugRenderer&&S(s)?this.execution.result={resultType:"run",result:s}:e.useDebugRenderer&&!S(s)&&(this.execution.result={resultType:"debug",result:s,...e.timing?{timing:e.timing}:{}}),this.execution.phase="completed",this.pausedFrame.reset(),this.ui.openedPanel="output",this.resetTransientDebuggerState()}continueDebug(){let s=this.pausedFrame.pausedState?.continue;s&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),s.resolve())}disableDebugger(){this.cancelExecution({hidePanel:!0}),this.clearBreakpoints("execution"),this.clearBreakpoints("editor")}fail(s){this.execution.result={resultType:"error",result:s},this.execution.phase="completed",this.pausedFrame.reset(),this.ui.openedPanel="output",this.resetTransientDebuggerState()}pauseDebug(s){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,s),this.pausedFrame.setPausedState(s),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.cancelExecution({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.cancelExecution({hidePanel:!0})}setBreakpoints(s){this.session.setBreakpoints("editor",s)}setPanel(s){this.execution.hasExecuted&&(this.ui.openedPanel=s,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}cancelExecution({hidePanel:s=!0,invalidateSession:e=!0}={}){let t=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),s&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),t?.resolve()}syncPausedState(s,e){this.lazyTreeState.reset(),s&&e&&s!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(s){this.session.toggleBreakpoint("editor",s)}togglePanel(s){if(this.execution.hasExecuted){if(s==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===s&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(s)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new B,this.previewTabsState=new O}};d([r()],g.prototype,"execution",2);d([r()],g.prototype,"lazyTreeState",2);d([r()],g.prototype,"pausedLine",2);d([r()],g.prototype,"pausedFrame",2);d([r()],g.prototype,"previewTabsState",2);d([r()],g.prototype,"session",2);d([r()],g.prototype,"ui",2);g=d([A("ArcadeDebuggerStore")],g);var N=class{#e;#a;#t;constructor(e,t=w){this.#e=e,this.#a=t}start(e){this.cancel({hidePanel:!1});let t=e.mode==="debug"?this.#e.startDebug():this.#e.startRun();setTimeout(()=>{this.#s(t)&&this.#o(e,t)},0)}cancel({hidePanel:e=!0}={}){this.#t?.abort(),this.#t=void 0,this.#e.isExecuting&&this.#e.cancelExecution({hidePanel:e})}async#o(e,t){let i;try{let{externalExecutor:a}=e;i=a?await this.#c({...e,externalExecutor:a},t):await this.#r(e,t)}catch(a){let n=a instanceof Error?a.message:String(a);i={type:"failure",error:b(n,a)}}this.#d(t,i)}async#r(e,t){if(!e.testData)return{type:"failure",error:b("Missing test data")};let i=await e.editorProfile;if(!i)return{type:"failure",error:b("Missing editor profile")};let a=await this.#a(i.definition,e.script,e.testData,{mode:e.mode,console:n=>this.#i(t,n),breakpoints:e.mode==="debug"?e.breakpoints:void 0,onDebugPause:e.mode==="debug"?(n,o)=>this.#n(t,n,o):void 0});return e.mode==="debug"?S(a)?{type:"failure",error:this.#u(a)}:{type:"debug",value:a}:S(a)?{type:"legacy-run",result:a}:{type:"failure",error:b("Unexpected debug result")}}async#c(e,t){let{externalExecutor:i}=e,a=new AbortController;this.#t=a;try{if(e.mode==="debug"){let o=await i.execute({mode:"debug",script:e.script,console:u=>this.#i(t,u),signal:a.signal,breakpoints:e.breakpoints,onDebugPause:(u,x)=>this.#n(t,u,x)});return{type:"debug",value:o.result,timing:o.timing}}let n=await i.execute({mode:"run",script:e.script,console:o=>this.#i(t,o),signal:a.signal});return{type:"run",value:n.result,timing:n.timing}}catch(n){let o=n instanceof Error?n.message:String(n);return{type:"failure",error:b(o,n)}}finally{this.#t===a&&(this.#t=void 0)}}#i(e,t){this.#s(e)&&this.#e.addConsoleLog(t)}async#n(e,t,i){if(!this.#s(e)||!this.#e.isDebugging)return;let a=Promise.withResolvers();return this.#e.pauseDebug({line:t.line,result:i,continue:a}),await a.promise}#d(e,t){if(this.#s(e))switch(t.type){case"debug":this.#e.completeDebug(t.value,t.timing);return;case"failure":this.#e.fail(t.error);return;case"legacy-run":this.#e.completeRun(t.result);return;case"run":this.#e.completeRun(t.value,{useDebugRenderer:!0,timing:t.timing})}}#u(e){return e.type==="error"?b(e.value,e.error):b("Unexpected legacy result")}#s(e){return e===this.#e.sessionId}},de={glyphMargin:!0,lineNumbersMinChars:1},K=class extends q{constructor(){super(...arguments),this._codeEditorElt=T(),this._arcadeAssistantElt=T(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._focusContinueActionOnPause=!1,this._debuggerState=new g,this._executionCoordinator=new N(this._debuggerState),this.messages=W(),this._modelId=U(),this._openArcadeHelp=()=>{window.open(X,"Arcade Help")},this._decorations=void 0,this._monacoEditor=H(Y),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 t=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(t)},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=R({bubbles:!1}),this.arcgisScriptChange=R({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,docsConfig:0}}static{this.styles=[ae]}get _canExecute(){return!!(this.testData||this.externalExecutor)}get _usesBottomExecutionDrawer(){return this._canExecute&&(this.enableDebugger||!!this.externalExecutor)}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 t=this._codeEditorElt.value?.value,i=await w(e.definition,t,this.testData,{mode:"run"});return S(i)?i:{type:"error",value:"Unexpected result",error:null}}async testRun(){try{let e=this._codeEditorElt.value?.value??this.script;if(this.externalExecutor){let{result:n}=await this.externalExecutor.execute({mode:"run",script:e,console:()=>{},signal:new AbortController().signal});return n}let t=this.testData;if(!t)throw new Error("Missing test data");await this._componentReadyDefer.promise;let i=await this._editorProfilePromise;if(!i)throw new Error("Missing editor profile");let a=await w(i.definition,e,t,{mode:"debug"});if(S(a))throw a.type==="error"&&a.error instanceof Error?a.error:new Error(a.type==="error"?a.value:"Unexpected Arcade result");return a}catch(e){let t=e instanceof Error?e.message:String(e);return b(t,e)}}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 t=this._arcadeAssistantElt.value;return e?.prompt&&await t?.openPrompt(e.prompt),!0}async load(){let e=V("./assets");te(e),await this._updateDataModelDeps(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(l(this)),()=>{for(this._askAiBindingKey&&(D(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);this._disposables.length;)this._disposables.pop()?.dispose();this._executionCoordinator.cancel(),this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._executeDebugScriptAction=void 0,this._hasDebuggerBreakpointsContextKey=void 0,this._focusContinueActionOnPause=!1,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),(e.has("testData")||e.has("externalExecutor"))&&this._executionContextChanged(),e.has("enableDebugger")&&(this.enableDebugger||this._debuggerState.disableDebugger(),this._syncExecuteDebugScriptAction()),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 se();this._disposables.push(e.onDiagnosticsChange(p=>{this._preparingArcade||(this._diagnostics=p.diagnostics,this.arcgisDiagnosticsChange.emit(p.diagnostics))})),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._syncAskAiAction();let t=v(()=>this._debuggerState.editorBreakpoints,()=>{this._updateBreakpointsDecorations(),this._updateDebuggerBreakpointContextKey()},{sync:!0}),i=v(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=v(()=>this._debuggerState.isPaused,()=>{!this._debuggerState.isPaused||!this._focusContinueActionOnPause||(this._focusContinueActionOnPause=!1,this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.isConnected&&this._debuggerState.isPaused&&this.el.shadowRoot?.querySelector("#debugger-continue-action")?.setFocus()})}))},{sync:!0}),n=v(()=>this._debuggerState.isDebugging,()=>{this._debuggerState.isDebugging||(this._focusContinueActionOnPause=!1)},{sync:!0}),o=v(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>t.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()},{dispose:()=>n.remove()},{dispose:()=>o.remove()}),this._updateDebuggerBreakpointContextKey();let u=this.editorInstance?.onMouseDown(p=>this._onEditorMouseDown(p));u&&this._disposables.push(u);let x=this.editorInstance?.onDidChangeModelContent(p=>this._onEditorModelContentChange(p));x&&this._disposables.push(x),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 t=e.target.position?.lineNumber;t&&this._debuggerState.toggleBreakpoint(t)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.editorBreakpoints.length||e.isFlush)return;let t=j(this._debuggerState.editorBreakpoints,e.changes);t.length===this._debuggerState.editorBreakpoints.length&&t.every((i,a)=>i===this._debuggerState.editorBreakpoints[a])||this._debuggerState.setBreakpoints(t)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let t=this._debuggerState.debuggerLine;t!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new F(t,1,t,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()}_stopDebugSession(){this._executionCoordinator.cancel({hidePanel:!1})}_resetDebugSession(){this._debuggerState.resetDebug(),this._executeScript("debug").catch(l(this))}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_executionContextChanged(){this._canExecute||(this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this._executeDebugScriptAction&&(this._disposeSafely(this._executeDebugScriptAction),this._executeDebugScriptAction=void 0)),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.openedPanel==="debug-console"&&!this.enableDebugger&&this._debuggerState.closePanel(),this._executionCoordinator.cancel({hidePanel:!1}),this._debuggerState.showPanel&&this._executeScript("run").catch(l(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,t=!1){let i=this.testData,a=this.externalExecutor;!this._codeEditorElt.value||!i&&!a||(this._focusContinueActionOnPause=e==="debug"&&t,this._executionCoordinator.start({mode:e,script:this._codeEditorElt.value?.value??this.script,testData:i,editorProfile:this._editorProfilePromise,externalExecutor:a,breakpoints:this._debuggerState.debuggerBreakpoints}))}_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(l(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(l(this))}_onResultPanelChange(e){let t=e.currentTarget;this._debuggerState.setPanel(t.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[L.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this._canExecute&&this._executeScript("run").catch(l(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e)),this._syncExecuteDebugScriptAction()}_syncExecuteDebugScriptAction(){if(!this._canExecute||!this.enableDebugger){this._executeDebugScriptAction&&(this._disposeSafely(this._executeDebugScriptAction),this._executeDebugScriptAction=void 0);return}if(this._executeDebugScriptAction)return;let e=this.editorInstance?.addAction({id:"run-debug-script",label:this.messages.runanddebug??"Run and debug",precondition:"arcgisArcadeDebuggerHasBreakpoints",keybindings:[M.CtrlCmd|M.Shift|L.F5],contextMenuGroupId:"code",contextMenuOrder:2,run:()=>this._runAndDebug()});this._hasDebuggerBreakpointsContextKey??=this.editorInstance?.createContextKey("arcgisArcadeDebuggerHasBreakpoints",this._debuggerState.editorBreakpoints.length>0),this._updateDebuggerBreakpointContextKey(),e&&(this._executeDebugScriptAction=e,this._disposables.push(e))}_updateDebuggerBreakpointContextKey(){this._hasDebuggerBreakpointsContextKey?.set(this._debuggerState.editorBreakpoints.length>0)}_runAndDebug(){!this._canExecute||!this.enableDebugger||!this._debuggerState.editorBreakpoints.length||this._executeScript("debug",!0).catch(l(this))}_getAskAiBindingKey(){return Q.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 t=this.messages.askarcadeassistant??"Ask Arcade Assistant",i=this._getAskAiBindingKey();return[{title:t,kind:Z,diagnostics:e.markers,isPreferred:!1,isAI:!1,command:{id:ee,title:t,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&&(D(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);return}this._askAiBindingKey&&this._askAiBindingKey!==e&&D(this._askAiBindingKey,void 0),D(e,{provideCodeActions:({context:t})=>this._getAskAiCodeActions(t),run:t=>{this.openArcadeAssistant({prompt:t??this.messages.askarcadeassistantprompt??"Fix the errors in my script"}).catch(l(this))}}),this._askAiBindingKey=e}_disposeSafely(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1),e.dispose()}async _updateArcadeAssistantRemoteState(){let e=this.arcadeAssistant;this.disableAssistant?this._arcadeAssistantRemoteState={shouldRender:!1}:this._arcadeAssistantRemoteState=await J(e??{}),this._syncAskAiAction()}renderMainActionBar(){return this._usesBottomExecutionDrawer||!this._canExecute?null:c`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-toggle-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(l(this))}}></calcite-action>${this._debuggerState.result?c`<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 c`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${f.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${I(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:i,active:a,panelName:n,iconFlipRtl:o=!1,onClick:u=this._toggleSidePanel}){return c`<calcite-action id=${e??C} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${u} data-panel-name=${n??C} .iconFlipRtl=${o}></calcite-action>${!this.sideActionBarExpanded&&c`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:c`<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:t}=this;return c`<arcgis-language-api-panel slot=side-panel class=${y(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=${y(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,profilevariables:this.messages.profilevariables}}></arcgis-editor-variables>${this.suggestions?.length&&c`<arcgis-arcade-suggestions slot=side-panel class=${y(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${t?.shouldRender&&c`<arcgis-arcade-coding-assistant slot=side-panel class=${y(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${t.portalUrl} .serviceUrl=${"serviceUrl"in t?t.serviceUrl:void 0} .helpBase=${t.helpBase} .promptingEnabled=${this._canPromptWithArcadeAssistant()} .feedbackServiceUrl=${t.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant?.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant?.disableQuestionAnswerLogging} .diagnostics=${this._diagnostics} .isDevEnv=${"isDevEnv"in t?t.isDevEnv:!1} .docsConfig=${this.docsConfig} ${I(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(i=>c`<calcite-flow slot=side-panel class=${y(e===i.id?"":"hidden")}>${i?.useFlows?i.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==i.id,editorRef:this.el}):c`<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 c`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.resultForLegacyRenderer} .executionTiming=${this._debuggerState.executionTiming} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:t,debugResult:i,isExecuting:a}=this._debuggerState;if(!e)return null;let n=t==="debug-console"?"output":t;return this.enableDebugger&&t==="debug-console"?c`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:t==="output"&&i?c`<arcgis-arcade-debugger-output slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:c`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${n} .loading=${t==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.resultForLegacyRenderer} .executionTiming=${this._debuggerState.executionTiming} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:t,openedPanel:i,isDebugging:a,isPaused:n,isExecuting:o}=this._debuggerState,u=this.messages.continue??"Continue",x=this.messages.reset??"Reset",p=this.messages.stop??"Stop";return c`<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-toggle-disabled expanded><calcite-action-group scale=s>${this.enableDebugger&&a?c`<calcite-action id=debugger-continue-action .text=${u} icon=forward scale=s .disabled=${!n} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${u}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${x} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${x}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${p} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${p}</span></calcite-tooltip>`:c`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||o} @click=${()=>{this._executeScript("run").catch(l(this))}}></calcite-action>${this.enableDebugger&&c`<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||o} @click=${this._runAndDebug}></calcite-action>`||""}`}</calcite-action-group>${t?c`<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>${this.enableDebugger&&c`<calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug console"} text-enabled scale=s icon=debug .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action>`||""}</calcite-action-group>`:null}</calcite-action-bar>${e?c`<calcite-action .text=${this.messages.collapse??"Collapse"} scale=s icon=chevrons-down icon-flip-rtl @click=${this._onExecutionPanelClose} slot=actions-end></calcite-action>`:null}</div>`}render(){return c`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};G("arcgis-arcade-editor",K);return K},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,d,e,f,g,h)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as r}from"./
|
|
2
|
+
import{b as r}from"./EQUNYQFX.js";import{L as o}from"./O6XP7VU2.js";var s=r(o);export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import f from"./MO22NTSF.js";import e from"./EIKXKAAA.js";import"./5HKDO4SX.js";import b from"./ZUCC43DN.js";import{a as d}from"./
|
|
2
|
+
import f from"./MO22NTSF.js";import e from"./EIKXKAAA.js";import"./5HKDO4SX.js";import b from"./ZUCC43DN.js";import{a as d}from"./WJCAK4LW.js";import"./EQUNYQFX.js";import{b as n,d as u}from"./C5WMGZYX.js";import"./J4I4EROF.js";import{G as o,K as c,h as l,j as a}from"./O6XP7VU2.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([,{a:s,h:r,i:m,j:p},{c:h,f:g,g:f,h:b,i:v}])=>{var y=l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;function x(t,e){return h(t)||b(t)||f(t)||g(t)?e??"Output":t.arcadeType}var i=class extends o{constructor(){super(...arguments),this.messages=d()}static{this.properties={debuggerStore:0,result:0}}static{this.styles=[y,p,m()]}load(){this.manager.onLifecycle(()=>{let e=n(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>e()})}willUpdate(e){e.has("result")&&this.result&&this.debuggerStore?.lazyTreeState.reset()}updateTheme(){u(this.el)==="dark"?this.elementInternals.states.add(r):this.elementInternals.states.delete(r)}render(){if(!this.result)return a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`;let e=this.debuggerStore?.lazyTreeState;return e?a`<calcite-tree .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect} .lines=${s.lines} .selectionMode=${s.selectionMode}>${v({expanded:!0,name:x(this.result,this.messages.output),value:this.result,messages:this.messages,path:this.result.arcadeType,lazyTreeState:e})}</calcite-tree>`:a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`}};c("arcgis-arcade-debugger-output",i);return i},b,e,f)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./H5EGZU2S.js";import{a as $}from"./ZLV7T4YS.js";import{a as _}from"./
|
|
2
|
+
import a from"./H5EGZU2S.js";import{a as $}from"./ZLV7T4YS.js";import{a as _}from"./WJCAK4LW.js";import"./EQUNYQFX.js";import{c as u,e as p}from"./C5WMGZYX.js";import"./J4I4EROF.js";import"./LEFE3FVL.js";import{F as f,G as g,K as b,h as d,j as i,n as o,r as m}from"./O6XP7VU2.js";import{a as h}from"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([{C:r,D:n,E:v,F:w}])=>{var I=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`;function R(a){a.key==="Enter"&&a.stopPropagation()}var c=class extends g{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=_(),this._shouldIgnoreDoubleClick=$(),this._filterValue="",this._flowItemRenderers=[],this._rootPresentation="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.hideDescriptions=!1,this.arcgisInternalClosePanel=o({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=o({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_rootPresentation:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0,heading:1,hideDescriptions:5,messageOverrides:0}}static{this.styles=I}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){if(!this.variable||r(this.variable)){this._rootPresentation="profile";return}this._rootPresentation=this.variable.type==="featureSet"?"featureSetRoot":"collectionRoot"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isRootPresentation(e){return this._rootPresentation===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{p(u(e.querySelector("calcite-flow-item:last-child")??e,"calcite-input"))}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget.value}_emitClose(){this.arcgisInternalClosePanel.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive||this._shouldIgnoreDoubleClick(e))return;let s=e;(!s.key||s.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(s=>this.renderCollectionBasedVariable(t,!1,s))}_getHeadingForCollection(e,t=!1){if(!e)return"";if(t){if(this.heading)return this.heading;if(r(this.variable))return this.variable.definition?.label??this.messages.profilevariables??"Profile variables";if(this._isRootPresentation("featureSetRoot"))return this.messages.fields??"Fields";if(this._isRootPresentation("collectionRoot"))return this.messages.tables??"Tables"}return(n(e)||w(e))&&(this._isRootPresentation("featureSetRoot")||this._isRootPresentation("collectionRoot"))?this.messages.fields??"Fields":this.messages.profilevariables??"Profile variables"}_getDescriptionForCollection(e){return e?n(e)&&this._isRootPresentation("featureSetRoot")?e.variables[0]?.getLabel()??"":v(e)&&this._isRootPresentation("collectionRoot")?e.datastoreInfo?.name??e.getDescription()??"":e.breadcrumb:""}_getItemLabel(e){return e.getLabel()}_getItemDescription(e){return this.hideDescriptions?"":e.getDescription()}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let l=this.loading;return!l&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{h("error",this,"Error loading collection"),l=!1}),l=!0),i`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e,t)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${s}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isRootPresentation("featureSetRoot")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname??""} name=variable-filter></calcite-input><div class="scrollable">${l?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list .label=${this.messages.profilevariables??"Profile variables"}>${this.renderEditorVariables(e)}</calcite-list>`}</div></div></calcite-flow-item>`}renderEditorVariables(e){let t=m(this._filterValue),s=e.variables.filter(l=>l.passFilter(t));return s.length?s.map(l=>this.renderEditorVariable(l)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){return e.type==="group"?this._isRootPresentation("featureSetRoot")&&e.isHeader?i`<calcite-list-item-group .heading=${this._getItemLabel(e)}></calcite-list-item-group>`:this._isRootPresentation("featureSetRoot")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${this._getItemLabel(e)}>${this.renderEditorVariables(e)}</calcite-list-item-group>`:i`<calcite-list-item .label=${this._getItemLabel(e)} .description=${this._getItemDescription(e)} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${R}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}render(){return this.closed?null:this.loading&&!this.variable?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader></calcite-flow-item></calcite-flow>`:!this.loading&&(!this.variable||this.variable?.loaded&&!this.variable?.variables.length)?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.profileempty}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${f(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,s)=>e(t===s.length-1))}</calcite-flow>`}};b("arcgis-editor-variables",c);return c},a)
|
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"./O6XP7VU2.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./
|
|
2
|
+
import{J as s,v as e}from"./O6XP7VU2.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./S7HUEYFG.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,docsConfig:,editorRef:,feedbackServiceUrl,helpBase,insertText:,isDevEnv,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./F3SAX4ME.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./XRP4U5KQ.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./VQONAD2Y.js"),"arcadeAssistant:,customPanels:,disableAssistant,docsConfig:,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus,testRun"],"arcgis-arcade-results":[()=>import("./TTWGF3XR.js"),"consoleLogs:,executionTiming:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./KKN6Q2LE.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./HPGMCJXP.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./OO3J7H7X.js")],"arcgis-code-viewer":[()=>import("./KRDRD2B4.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./XYBHGDM5.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./IKFDJHMC.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./JRRAYX43.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;formatExpression,setFocus"],"arcgis-sql-layer-editor":[()=>import("./5SMTLM63.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)
|