@arcgis/coding-components 5.2.0-next.123 → 5.2.0-next.125
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/{7BW4HK2A.js → 2PZP3YWM.js} +1 -1
- package/dist/cdn/3G26WBEK.js +66 -0
- package/dist/cdn/3KEZ7EEP.css +1 -0
- package/dist/cdn/{KM6YSFH6.js → 6HKTUV2Z.js} +1 -1
- package/dist/cdn/{BXSWFHYR.js → 7CRCML7E.js} +1 -1
- package/dist/cdn/{7OK7ZF7N.js → 7IJT3Z4F.js} +1 -1
- package/dist/cdn/{7EBMAFES.js → AAGGFSQH.js} +1 -1
- package/dist/cdn/{MWWXV5SO.js → ABUWK4CT.js} +1 -1
- package/dist/cdn/{DFRZVVZZ.js → AI6346MJ.js} +1 -1
- package/dist/cdn/{7557YTH2.js → BES2AFJI.js} +1 -1
- package/dist/cdn/{PBU6VJBZ.js → BWXFRAGJ.js} +1 -1
- package/dist/cdn/{AGHMGL6E.js → CHW5BB3L.js} +1 -1
- package/dist/cdn/{XZXSPFYV.js → DITC5ENP.js} +1 -1
- package/dist/cdn/{O5VTBJWD.js → DSXNVNHP.js} +1 -1
- package/dist/cdn/{HY5O2FXT.js → DXURCX2E.js} +1 -1
- package/dist/cdn/{43C5J4GE.js → ERQORLO4.js} +1 -1
- package/dist/cdn/{6W4UAJL7.js → FRKDR2KF.js} +1 -1
- package/dist/cdn/{KHS23QIL.js → G6LQODXE.js} +1 -1
- package/dist/cdn/JD7Z3DOI.js +2 -0
- package/dist/cdn/{JDENX7LP.js → JNW2UKUP.js} +1 -1
- package/dist/cdn/{WF2ENOGH.js → JZKEFFFC.js} +1 -1
- package/dist/cdn/{ZZDJOW42.js → KFZFVK3W.js} +1 -1
- package/dist/cdn/LLJLGZNV.js +2 -0
- package/dist/cdn/LYIGIZYL.css +1 -0
- package/dist/cdn/{5E6FR6BZ.js → M2KHHZZK.js} +1 -1
- package/dist/cdn/{EZLFACAC.js → MYJC26Y2.js} +1 -1
- package/dist/cdn/{DCWOXZNV.js → MZWBKK5Y.js} +1 -1
- package/dist/cdn/{KXTNFBJX.js → N634TYFB.js} +1 -1
- package/dist/cdn/{BDPAZMM4.js → NKCXJFOA.js} +1 -1
- package/dist/cdn/{CMRUQ3BN.js → NKGAHXNJ.js} +2 -2
- package/dist/cdn/{P4HNDIFA.js → OKTFDNZ2.js} +1 -1
- package/dist/cdn/{NKXS3GN7.js → P47PXEKU.js} +1 -1
- package/dist/cdn/{VVY2ZBRC.js → P5SQNRDH.js} +1 -1
- package/dist/cdn/{6DFI5ERF.js → PWGN3YDJ.js} +1 -1
- package/dist/cdn/PY2Q5GGO.js +2 -0
- package/dist/cdn/{RWKSK7LJ.js → Q2IQGLDP.js} +1 -1
- package/dist/cdn/{62DBPVRG.js → QQYU72U2.js} +1 -1
- package/dist/cdn/{22WTKWX3.js → RQFU6BD7.js} +1 -1
- package/dist/cdn/{7WYHXRIC.js → S62CZ4XV.js} +1 -1
- package/dist/cdn/SGV4EZAO.css +1 -0
- package/dist/cdn/{DOGQU7EL.js → SP2OSSVP.js} +1 -1
- package/dist/cdn/{GC7FFZEU.js → TKIQ3MQU.js} +1 -1
- package/dist/cdn/{2OOUSCR2.js → TOVVWCBC.js} +1 -1
- package/dist/cdn/{CLPF64WZ.js → UHQN4ZKV.js} +1 -1
- package/dist/cdn/{N37NWQCL.js → UUP3CHV2.js} +1 -1
- package/dist/cdn/{HQFOVSNC.js → VA5GCGP3.js} +1 -1
- package/dist/cdn/{PBAJAXFT.js → VNDDHGHV.js} +1 -1
- package/dist/cdn/XCISKBJD.js +927 -0
- package/dist/cdn/{2VEQTRYC.js → XECHDNHQ.js} +1 -1
- package/dist/cdn/{U6CVC2TE.js → XLCC7YPR.js} +1 -1
- package/dist/cdn/{UFF53OEH.js → XWEX2VS6.js} +1 -1
- package/dist/cdn/{Y7KC4KFN.js → Y2QWXLND.js} +1 -1
- package/dist/cdn/{QAMR6MWW.js → YG3C4FVJ.js} +1 -1
- package/dist/cdn/{KLDWM65I.js → YIGPP2PN.js} +1 -1
- package/dist/cdn/{JIAPMYH4.js → ZB5LSQCI.js} +1 -1
- package/dist/cdn/{ODW3NXBR.js → ZFNRVJRH.js} +1 -1
- package/dist/cdn/{WSXKO7QU.js → ZGH54UQL.js} +1 -1
- package/dist/cdn/{4TJFIFRU.js → ZIITPBDA.js} +1 -1
- package/dist/cdn/{3MYJY4XF.js → ZSTNW7E7.js} +1 -1
- package/dist/cdn/{GY5IX3XK.js → ZZWYJDQG.js} +2 -2
- package/dist/cdn/assets/code-editor/arcade.worker.js +1376 -1310
- package/dist/cdn/assets/code-editor/css.worker.js +1448 -1392
- package/dist/cdn/assets/code-editor/editor.worker.js +2233 -2177
- package/dist/cdn/assets/code-editor/html.worker.js +1208 -1152
- package/dist/cdn/assets/code-editor/json.worker.js +1364 -1308
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +3451 -3385
- package/dist/cdn/assets/code-editor/sql-layer.worker.js +1835 -1779
- package/dist/cdn/assets/code-editor/ts.worker.js +20770 -20714
- package/dist/cdn/{codicon-KP4OV2OO.ttf → codicon-LTRFOK3N.ttf} +0 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/stdin.css +1 -1
- package/dist/chunks/arcade-service-accessors.js +9 -8
- package/dist/chunks/debugger-value-components.js +6 -6
- package/dist/chunks/debugger-value-styles.js +6 -6
- package/dist/chunks/monaco-importer.js +3 -2
- package/dist/chunks/setup-monaco-theme.js +5 -4
- package/dist/chunks/sql-expr-mode.js +7 -6
- package/dist/chunks/sql-layer-mode.js +13 -12
- package/dist/components/arcgis-code-editor/customElement.js +160 -117
- package/dist/components/types.d.ts +2 -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 +8 -7
- package/dist/cdn/DSQ2DQQL.js +0 -866
- package/dist/cdn/FWJIPXSM.js +0 -2
- package/dist/cdn/N7X5O5MW.css +0 -1
- package/dist/cdn/NHREAORV.js +0 -62
- package/dist/cdn/VFTBLPWP.js +0 -2
- package/dist/cdn/VHWT37FU.css +0 -1
- package/dist/cdn/WYJB4DB6.js +0 -2
- package/dist/cdn/Z5IO75U2.css +0 -1
- /package/dist/cdn/{6CZQZTMF.js → 2AXSYZEN.js} +0 -0
- /package/dist/cdn/{FQOANF2G.js → 33BRQKI6.js} +0 -0
- /package/dist/cdn/{7DK3ZTRU.js → 36W5RXLG.js} +0 -0
- /package/dist/cdn/{3QA7M6CT.js → 45R5XOFL.js} +0 -0
- /package/dist/cdn/{6NHGNIVD.js → 4YFE3KBC.js} +0 -0
- /package/dist/cdn/{WYJEPX44.js → 57E5F75J.js} +0 -0
- /package/dist/cdn/{EJQAPUJS.js → 5EIPVOGO.js} +0 -0
- /package/dist/cdn/{Z6466HTT.js → 5YEMW2UC.js} +0 -0
- /package/dist/cdn/{SA3CPVD5.js → 6VFEED45.js} +0 -0
- /package/dist/cdn/{BXWGMUCF.js → ABZ7ZFXX.js} +0 -0
- /package/dist/cdn/{T2SRJU3Q.js → AGJJ7FJX.js} +0 -0
- /package/dist/cdn/{FT5ERUIM.js → BTLDXLFC.js} +0 -0
- /package/dist/cdn/{UYCJKS7C.js → CJ2MVXSJ.js} +0 -0
- /package/dist/cdn/{E557OH6C.js → CVJM5DJ5.js} +0 -0
- /package/dist/cdn/{JKD3QPJA.js → D4TRKALK.js} +0 -0
- /package/dist/cdn/{CEVSS7MF.js → DKAMEAFP.js} +0 -0
- /package/dist/cdn/{GKYUW47U.js → EQKJWVNG.js} +0 -0
- /package/dist/cdn/{RKHLMCND.js → EXVPEWWR.js} +0 -0
- /package/dist/cdn/{2TM3P5BM.js → FGO22NCZ.js} +0 -0
- /package/dist/cdn/{HNPCFI2T.js → FH5UYXIE.js} +0 -0
- /package/dist/cdn/{3HICEKL5.js → FUBZOMVG.js} +0 -0
- /package/dist/cdn/{HZI3CRZA.js → G3F6L5BF.js} +0 -0
- /package/dist/cdn/{OKBXNZWB.js → G6VYGRE5.js} +0 -0
- /package/dist/cdn/{ADOCXALG.js → GK62ODPJ.js} +0 -0
- /package/dist/cdn/{LWIX4BHD.js → GLWUBI25.js} +0 -0
- /package/dist/cdn/{CLAJKAD4.js → GWJWZDBK.js} +0 -0
- /package/dist/cdn/{ZYCEN3JJ.js → H2KLFHG3.js} +0 -0
- /package/dist/cdn/{CPU5A7GB.js → HLTDO25M.js} +0 -0
- /package/dist/cdn/{3IIYWUMQ.js → HUTT2UBA.js} +0 -0
- /package/dist/cdn/{2PRBQXD6.js → HZSPZILM.js} +0 -0
- /package/dist/cdn/{YO6TWJFE.js → IF6VZF56.js} +0 -0
- /package/dist/cdn/{OTJIHBW2.js → ISYMIYR5.js} +0 -0
- /package/dist/cdn/{SUSHGSN5.js → J72JBXLX.js} +0 -0
- /package/dist/cdn/{DAVBQKOS.js → JW63G7JR.js} +0 -0
- /package/dist/cdn/{JI422GNR.js → KKD3ZAX7.js} +0 -0
- /package/dist/cdn/{SG2BKJM5.js → KSNDH6NJ.js} +0 -0
- /package/dist/cdn/{UOUMWCH7.js → KSYZD77O.js} +0 -0
- /package/dist/cdn/{FPYDAXFV.js → LDUXIRRX.js} +0 -0
- /package/dist/cdn/{KLBYHXFF.js → LW6VG5BJ.js} +0 -0
- /package/dist/cdn/{4VR6NKWG.js → MB3H26SY.js} +0 -0
- /package/dist/cdn/{OVP6UXO6.js → ML3XEYX7.js} +0 -0
- /package/dist/cdn/{H4TDHI2Q.js → MLQTKNOS.js} +0 -0
- /package/dist/cdn/{LSWMYSG5.js → NFD5QRK7.js} +0 -0
- /package/dist/cdn/{QU5CZLK5.js → NGWNHRDV.js} +0 -0
- /package/dist/cdn/{OHFJJGVA.js → NQOXXF5T.js} +0 -0
- /package/dist/cdn/{NULEXQA2.js → O2HZCVVO.js} +0 -0
- /package/dist/cdn/{J7HO6RTJ.js → PTLGMSM7.js} +0 -0
- /package/dist/cdn/{DDDIP43Y.js → PVTDESVT.js} +0 -0
- /package/dist/cdn/{JMC6K5HI.js → Q42IHUZ3.js} +0 -0
- /package/dist/cdn/{O3NHJWA2.js → QDUPWXLI.js} +0 -0
- /package/dist/cdn/{7IS2FKEF.js → QGSV4ECO.js} +0 -0
- /package/dist/cdn/{CSJQLSJC.js → QYQXVQVS.js} +0 -0
- /package/dist/cdn/{HCNKB3RA.js → QZ5SQVOZ.js} +0 -0
- /package/dist/cdn/{FM45ZTLA.js → R7SJNYNM.js} +0 -0
- /package/dist/cdn/{ZXM7ND6Q.js → S5T6XTRV.js} +0 -0
- /package/dist/cdn/{EPZJ7KZC.js → SIP637YL.js} +0 -0
- /package/dist/cdn/{QLSHKD7Y.js → TKZNHPOT.js} +0 -0
- /package/dist/cdn/{3YUOOZQC.js → TUPOE2CF.js} +0 -0
- /package/dist/cdn/{VWAHKT2W.js → UF7HDQEU.js} +0 -0
- /package/dist/cdn/{2ZNNQF33.js → USFPEQ7Q.js} +0 -0
- /package/dist/cdn/{53BLLGWD.js → UXE4ASGX.js} +0 -0
- /package/dist/cdn/{2YJMSLBY.js → UYUJZDIZ.js} +0 -0
- /package/dist/cdn/{QNTJG5AA.js → UZVUXHHW.js} +0 -0
- /package/dist/cdn/{RABQPAZP.js → W6YYQCBS.js} +0 -0
- /package/dist/cdn/{Y3RD24PA.js → WBYKVSV4.js} +0 -0
- /package/dist/cdn/{IEPJZHSS.js → WJYR4BJG.js} +0 -0
- /package/dist/cdn/{7627LBHY.js → WMQL7T43.js} +0 -0
- /package/dist/cdn/{6NKJB46V.js → XQSXGAPV.js} +0 -0
- /package/dist/cdn/{PDL4ZTCL.js → XVT2TWEJ.js} +0 -0
- /package/dist/cdn/{MKNN7Z33.js → YCBGCWWV.js} +0 -0
- /package/dist/cdn/{C7FU7YNV.js → ZQZRAXQ5.js} +0 -0
- /package/dist/cdn/{Y4MQH574.js → ZRGZPKPU.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import h from"./DFRZVVZZ.js";import g from"./5E6FR6BZ.js";import f from"./6DFI5ERF.js";import e from"./AGHMGL6E.js";import{e as W}from"./HQFOVSNC.js";import d from"./H5EGZU2S.js";import b from"./7Z6G332Z.js";import"./MZMKV7FA.js";import a from"./ZUCC43DN.js";import{a as G}from"./N37NWQCL.js";import{a as V}from"./62DBPVRG.js";import"./NULEXQA2.js";import"./J4I4EROF.js";import{a as X,b as Z,c as y}from"./CLPF64WZ.js";import"./LEFE3FVL.js";import"./XEK22IDA.js";import{a as Q}from"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{E as C,F as R,G as U,H as P,K,L as q,h as O,j as c,l as k,n as B,t as z}from"./OKBXNZWB.js";import{b as u}from"./BFPEJYVB.js";import{ml as H,pl as T,ul as j}from"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:I},x,{property:r,subclass:S},{a:J,d:p,i:_,j:D},{b:L},,,A,{a:Y},{a:ee,b:te}])=>{var ie=O`: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}}`,ae=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,m=(s,e,t,i)=>{for(var a=i>1?void 0:i?ne(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&&ae(e,t,a),a},se=100,h=class extends x{constructor(s){super(s),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=se}};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([S("ArcadeDebuggerLazyTreeNodeState")],h);var w=class extends x{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+se))}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 l=this.nodes.get(s);!l||this.generation!==a||l.requestId!==n||(t(l,o),l.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()}};w=m([S("ArcadeDebuggerLazyTreeState")],w);var oe=Object.defineProperty,re=Object.getOwnPropertyDescriptor,d=(s,e,t,i)=>{for(var a=i>1?void 0:i?re(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&&oe(e,t,a),a},b=class extends x{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()],b.prototype,"phase",2);d([r()],b.prototype,"mode",2);d([r()],b.prototype,"sessionId",2);d([r()],b.prototype,"result",2);d([r()],b.prototype,"consoleLogs",2);d([r()],b.prototype,"hasExecuted",2);b=d([S("ArcadeDebuggerExecutionModel")],b);var f=class extends x{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()],f.prototype,"editorBreakpoints",2);d([r()],f.prototype,"executionBreakpoints",2);f=d([S("ArcadeDebuggerSessionModel")],f);var v=class extends x{constructor(s){super(s),this.openedPanel="output",this.showPanel=!1}};d([r()],v.prototype,"openedPanel",2);d([r()],v.prototype,"showPanel",2);v=d([S("ArcadeDebuggerUiModel")],v);var $=class extends x{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()],$.prototype,"pausedState",2);d([r()],$.prototype,"lastPausedState",2);$=d([S("ArcadeDebuggerPausedFrameModel")],$);var g=class extends x{constructor(s){super(s),this.execution=new b,this.lazyTreeState=new w,this.pausedFrame=new $,this.previewTabsState=new L,this.session=new f,this.ui=new v}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)?this.execution.result={resultType:"run",result:s}:e.useDebugRenderer&&!_(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 w,this.previewTabsState=new L}};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([S("ArcadeDebuggerStore")],g);var M=class{#e;#a;#t;constructor(e,t=D){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:p(n,a)}}this.#d(t,i)}async#r(e,t){if(!e.testData)return{type:"failure",error:p("Missing test data")};let i=await e.editorProfile;if(!i)return{type:"failure",error:p("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"?_(a)?{type:"failure",error:this.#l(a)}:{type:"debug",value:a}:_(a)?{type:"legacy-run",result:a}:{type:"failure",error:p("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:l=>this.#i(t,l),signal:a.signal,breakpoints:e.breakpoints,onDebugPause:(l,E)=>this.#n(t,l,E)});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:p(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})}}#l(e){return e.type==="error"?p(e.value,e.error):p("Unexpected legacy result")}#s(e){return e===this.#e.sessionId}},ce={glyphMargin:!0,lineNumbersMinChars:1},F=class extends U{constructor(){super(...arguments),this._codeEditorElt=C(),this._arcadeAssistantElt=C(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new g,this._executionCoordinator=new M(this._debuggerState),this.messages=G(),this._modelId=z(),this._openArcadeHelp=()=>{window.open(J,"Arcade Help")},this._decorations=void 0,this._monacoEditor=V(Q),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 T(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=B({bubbles:!1}),this.arcgisScriptChange=B({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=[ie]}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{...ce,...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 D(e.definition,t,this.testData,{mode:"run"});return _(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 D(i.definition,e,t,{mode:"debug"});if(_(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 p(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=q("./assets");ee(e),await this._updateDataModelDeps(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(this._askAiBindingKey&&(y(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._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(),e.has("snippets")&&A.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 te();this._disposables.push(e.onDiagnosticsChange(l=>{this._preparingArcade||(this._diagnostics=l.diagnostics,this.arcgisDiagnosticsChange.emit(l.diagnostics))})),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._syncAskAiAction();let t=I(()=>this._debuggerState.editorBreakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=I(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=I(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>t.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let n=this.editorInstance?.onMouseDown(l=>this._onEditorMouseDown(l));n&&this._disposables.push(n);let o=this.editorInstance?.onDidChangeModelContent(l=>this._onEditorModelContentChange(l));o&&this._disposables.push(o),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=W(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 T(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(u(this))}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_executionContextChanged(){!this._canExecute&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=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(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await A.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=A.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await A.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.setPanel(e)}async _executeScript(e){let t=this.testData,i=this.externalExecutor;!this._codeEditorElt.value||!t&&!i||this._executionCoordinator.start({mode:e,script:this._codeEditorElt.value?.value??this.script,testData:t,editorProfile:this._editorProfilePromise,externalExecutor:i,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(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(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:[H.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this._canExecute&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_getAskAiBindingKey(){return j.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:X,diagnostics:e.markers,isPreferred:!1,isAI:!1,command:{id:Z,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&&(y(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);return}this._askAiBindingKey&&this._askAiBindingKey!==e&&y(this._askAiBindingKey,void 0),y(e,{provideCodeActions:({context:t})=>this._getAskAiCodeActions(t),run:t=>{this.openArcadeAssistant({prompt:t??this.messages.askarcadeassistantprompt??"Fix the errors in my script"}).catch(u(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 Y(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(u(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=${A.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${R(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:i,active:a,panelName:n,iconFlipRtl:o=!1,onClick:l=this._toggleSidePanel}){return c`<calcite-action id=${e??k} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${l} data-panel-name=${n??k} .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=${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,profilevariables:this.messages.profilevariables}}></arcgis-editor-variables>${this.suggestions?.length&&c`<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>`||""}${t?.shouldRender&&c`<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=${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} ${R(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(i=>c`<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}):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 .outputTitle=${this.messages.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,l=this.messages.continue??"Continue",E=this.messages.reset??"Reset",N=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=${l} icon=forward scale=s .disabled=${!n} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${l}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${E} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${E}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${N} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${N}</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(u(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._executeScript("debug").catch(u(this))}}></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-script .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.close??"Close"} scale=s icon=x 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>`}};K("arcgis-arcade-editor",F);return F},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,d,e,f,g,h)
|
|
2
|
+
import h from"./AI6346MJ.js";import g from"./M2KHHZZK.js";import f from"./PWGN3YDJ.js";import e from"./CHW5BB3L.js";import{e as W}from"./VA5GCGP3.js";import d from"./H5EGZU2S.js";import b from"./7Z6G332Z.js";import"./MZMKV7FA.js";import a from"./ZUCC43DN.js";import{a as G}from"./UUP3CHV2.js";import{a as V}from"./QQYU72U2.js";import"./O2HZCVVO.js";import"./J4I4EROF.js";import{a as X,b as Z,c as y}from"./UHQN4ZKV.js";import"./LEFE3FVL.js";import"./XEK22IDA.js";import{a as Q}from"./NKGAHXNJ.js";import"./XWEX2VS6.js";import"./3G26WBEK.js";import{E as C,F as R,G as U,H as P,K,L as q,h as O,j as c,l as k,n as B,t as z}from"./G6VYGRE5.js";import{b as u}from"./BFPEJYVB.js";import{El as j,wl as H,zl as T}from"./XCISKBJD.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:I},x,{property:r,subclass:S},{a:J,d:p,i:_,j:D},{b:L},,,A,{a:Y},{a:ee,b:te}])=>{var ie=O`: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}}`,ae=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,m=(s,e,t,i)=>{for(var a=i>1?void 0:i?ne(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&&ae(e,t,a),a},se=100,h=class extends x{constructor(s){super(s),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=se}};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([S("ArcadeDebuggerLazyTreeNodeState")],h);var w=class extends x{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+se))}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 l=this.nodes.get(s);!l||this.generation!==a||l.requestId!==n||(t(l,o),l.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()}};w=m([S("ArcadeDebuggerLazyTreeState")],w);var oe=Object.defineProperty,re=Object.getOwnPropertyDescriptor,d=(s,e,t,i)=>{for(var a=i>1?void 0:i?re(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&&oe(e,t,a),a},b=class extends x{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()],b.prototype,"phase",2);d([r()],b.prototype,"mode",2);d([r()],b.prototype,"sessionId",2);d([r()],b.prototype,"result",2);d([r()],b.prototype,"consoleLogs",2);d([r()],b.prototype,"hasExecuted",2);b=d([S("ArcadeDebuggerExecutionModel")],b);var f=class extends x{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()],f.prototype,"editorBreakpoints",2);d([r()],f.prototype,"executionBreakpoints",2);f=d([S("ArcadeDebuggerSessionModel")],f);var v=class extends x{constructor(s){super(s),this.openedPanel="output",this.showPanel=!1}};d([r()],v.prototype,"openedPanel",2);d([r()],v.prototype,"showPanel",2);v=d([S("ArcadeDebuggerUiModel")],v);var $=class extends x{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()],$.prototype,"pausedState",2);d([r()],$.prototype,"lastPausedState",2);$=d([S("ArcadeDebuggerPausedFrameModel")],$);var g=class extends x{constructor(s){super(s),this.execution=new b,this.lazyTreeState=new w,this.pausedFrame=new $,this.previewTabsState=new L,this.session=new f,this.ui=new v}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)?this.execution.result={resultType:"run",result:s}:e.useDebugRenderer&&!_(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 w,this.previewTabsState=new L}};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([S("ArcadeDebuggerStore")],g);var M=class{#e;#a;#t;constructor(e,t=D){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:p(n,a)}}this.#d(t,i)}async#r(e,t){if(!e.testData)return{type:"failure",error:p("Missing test data")};let i=await e.editorProfile;if(!i)return{type:"failure",error:p("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"?_(a)?{type:"failure",error:this.#l(a)}:{type:"debug",value:a}:_(a)?{type:"legacy-run",result:a}:{type:"failure",error:p("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:l=>this.#i(t,l),signal:a.signal,breakpoints:e.breakpoints,onDebugPause:(l,E)=>this.#n(t,l,E)});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:p(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})}}#l(e){return e.type==="error"?p(e.value,e.error):p("Unexpected legacy result")}#s(e){return e===this.#e.sessionId}},ce={glyphMargin:!0,lineNumbersMinChars:1},F=class extends U{constructor(){super(...arguments),this._codeEditorElt=C(),this._arcadeAssistantElt=C(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new g,this._executionCoordinator=new M(this._debuggerState),this.messages=G(),this._modelId=z(),this._openArcadeHelp=()=>{window.open(J,"Arcade Help")},this._decorations=void 0,this._monacoEditor=V(Q),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 T(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=B({bubbles:!1}),this.arcgisScriptChange=B({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=[ie]}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{...ce,...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 D(e.definition,t,this.testData,{mode:"run"});return _(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 D(i.definition,e,t,{mode:"debug"});if(_(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 p(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=q("./assets");ee(e),await this._updateDataModelDeps(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(this._askAiBindingKey&&(y(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._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(),e.has("snippets")&&A.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 te();this._disposables.push(e.onDiagnosticsChange(l=>{this._preparingArcade||(this._diagnostics=l.diagnostics,this.arcgisDiagnosticsChange.emit(l.diagnostics))})),this._canExecute&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._syncAskAiAction();let t=I(()=>this._debuggerState.editorBreakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=I(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=I(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>t.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let n=this.editorInstance?.onMouseDown(l=>this._onEditorMouseDown(l));n&&this._disposables.push(n);let o=this.editorInstance?.onDidChangeModelContent(l=>this._onEditorModelContentChange(l));o&&this._disposables.push(o),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=W(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 T(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(u(this))}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_executionContextChanged(){!this._canExecute&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=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(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await A.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=A.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await A.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.setPanel(e)}async _executeScript(e){let t=this.testData,i=this.externalExecutor;!this._codeEditorElt.value||!t&&!i||this._executionCoordinator.start({mode:e,script:this._codeEditorElt.value?.value??this.script,testData:t,editorProfile:this._editorProfilePromise,externalExecutor:i,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(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(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:[H.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this._canExecute&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_getAskAiBindingKey(){return j.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:X,diagnostics:e.markers,isPreferred:!1,isAI:!1,command:{id:Z,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&&(y(this._askAiBindingKey,void 0),this._askAiBindingKey=void 0);return}this._askAiBindingKey&&this._askAiBindingKey!==e&&y(this._askAiBindingKey,void 0),y(e,{provideCodeActions:({context:t})=>this._getAskAiCodeActions(t),run:t=>{this.openArcadeAssistant({prompt:t??this.messages.askarcadeassistantprompt??"Fix the errors in my script"}).catch(u(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 Y(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(u(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=${A.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${R(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:i,active:a,panelName:n,iconFlipRtl:o=!1,onClick:l=this._toggleSidePanel}){return c`<calcite-action id=${e??k} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${l} data-panel-name=${n??k} .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=${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,profilevariables:this.messages.profilevariables}}></arcgis-editor-variables>${this.suggestions?.length&&c`<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>`||""}${t?.shouldRender&&c`<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=${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} ${R(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(i=>c`<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}):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 .outputTitle=${this.messages.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,l=this.messages.continue??"Continue",E=this.messages.reset??"Reset",N=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=${l} icon=forward scale=s .disabled=${!n} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${l}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${E} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${E}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${N} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${N}</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(u(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._executeScript("debug").catch(u(this))}}></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-script .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.close??"Close"} scale=s icon=x 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>`}};K("arcgis-arcade-editor",F);return F},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,d,e,f,g,h)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as u}from"./5HKDO4SX.js";import a from"./ZUCC43DN.js";import{a as o}from"./
|
|
2
|
+
import{a as u}from"./5HKDO4SX.js";import a from"./ZUCC43DN.js";import{a as o}from"./O2HZCVVO.js";import{H as i,I as v,g as p,h as n,j as t,p as d,q as r}from"./G6VYGRE5.js";export default $arcgis.t(([{f:m,g:y,h:b}])=>{var s={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(a=>a.selected=!1)},g="tree-item-metadata",f=({name:e,isMetadata:a=!1})=>t`<bdi class=${i(o("dictionary-property",a&&g))}>${e}</bdi><bdi class=${i(o(a&&g))}>: </bdi>`,M=({obj:e,subtree:a})=>t`<calcite-tree slot=${"children"} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e,void 0,2)}</calcite-tree-item></calcite-tree>`,N=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??v} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${f({name:"type"})}<bdi>${d(e.type)}</bdi></div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${f({name:"value"})}<span class="string-value">${JSON.stringify(e,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`,j=({type:e,value:a})=>{switch(e){case"unknown":case"Unknown":return t`<span class="constant-value">${e}</span>`;case"null":case"Null":return t`<span class="constant-value">null</span>`;case"text":case"String":case"Text":return t`<span class="string-value">${r(a)}</span>`;case"number":case"Number":return t`<span class="number-value">${a}</span>`;case"boolean":case"Boolean":return t`<span class="constant-value">${a}</span>`;case"date":case"Date":return t`<span class="date-value">${a}</span>`;case"dateOnly":case"DateOnly":return t`<span class="string-value">${r(a)}</span>`;case"time":case"Time":return t`<span class="string-value">${r(a)}</span>`;case"":return t`<span class="string-value">null</span>`;default:return null}},h=["boolean","date","dateOnly","null","number","text","time","unknown","Boolean","Date","DateOnly","Null","Number","Text","Time","Unknown","String",""],D=e=>h.includes(e.type);function C(e){switch(e.type){case"null":case"unknown":return{type:e.type,value:e.type};case"number":return{type:e.type,value:Object.is(e.value,-0)?"-0":String(e.value)};case"boolean":return{type:e.type,value:String(e.value)};case"text":return{type:e.type,value:e.value};case"date":return{type:e.type,value:m(e)};case"dateOnly":return{type:e.type,value:y(e)};case"time":return{type:e.type,value:b(e)}}}var S="calcite-mode-dark";function E(){let e=`:host {
|
|
3
3
|
`,a=u["light-theme"];Object.entries(a).forEach(([c,l])=>{e+=` --arcgis-editor-${c}: ${l};
|
|
4
4
|
`}),e+=`}
|
|
5
5
|
`,e+=`:host(:state(${S})),
|
|
@@ -65,4 +65,4 @@ import{a as u}from"./5HKDO4SX.js";import a from"./ZUCC43DN.js";import{a as o}fro
|
|
|
65
65
|
.date-value {
|
|
66
66
|
color: var(--arcgis-editor-date);
|
|
67
67
|
}
|
|
68
|
-
`;return{a:s,b:f,c:M,d:N,e:
|
|
68
|
+
`;return{a:s,b:f,c:M,d:N,e:j,f:D,g:C,h:S,i:E,j:B}},a)
|