@arcgis/coding-components 5.1.0-next.55 → 5.1.0-next.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/cdn/2XTHR2WZ.js +2 -0
  2. package/dist/cdn/3QKEF7NL.js +2 -0
  3. package/dist/cdn/{RJRCBNNO.js → 57WNN7NN.js} +1 -1
  4. package/dist/cdn/6E4U2MLJ.js +7 -0
  5. package/dist/cdn/{PKG2K3V2.js → A2OAI373.js} +1 -1
  6. package/dist/cdn/AAMHIVYL.js +2 -0
  7. package/dist/cdn/AHDVGYFC.js +2 -0
  8. package/dist/cdn/CZ2DJPO4.js +2 -0
  9. package/dist/cdn/D6BJOZGQ.js +2 -0
  10. package/dist/cdn/DGFH2WPL.js +2 -0
  11. package/dist/cdn/FLNLMLTL.js +2 -0
  12. package/dist/cdn/{UZJHWA6T.js → FUBRHCFC.js} +1 -1
  13. package/dist/cdn/{PVL67WGX.js → FYW5NKEJ.js} +1 -1
  14. package/dist/cdn/LSBKL6MO.js +6 -0
  15. package/dist/cdn/MVAB75O7.js +2 -0
  16. package/dist/cdn/QGCNEBN6.js +4 -0
  17. package/dist/cdn/SV4IPD4A.js +2 -0
  18. package/dist/cdn/T6RFLFX3.js +2 -0
  19. package/dist/cdn/TBTVVU6V.js +2 -0
  20. package/dist/cdn/V63C7RKJ.js +2 -0
  21. package/dist/cdn/{6YD47X7H.js → VILW5AVK.js} +1 -1
  22. package/dist/cdn/VPP77CFW.js +2 -0
  23. package/dist/cdn/W2PBO44R.js +12 -0
  24. package/dist/cdn/{4A2CLADY.js → WNKEPEXN.js} +1 -1
  25. package/dist/cdn/{54ZOADNQ.js → XU4GWM7C.js} +1 -1
  26. package/dist/cdn/YPMKBMXS.js +2 -0
  27. package/dist/cdn/ZCXZTSQU.js +2 -0
  28. package/dist/cdn/ZHZFKZA7.js +2 -0
  29. package/dist/cdn/assets/arcade-editor/t9n/messages.en.json +1 -1
  30. package/dist/cdn/assets/code-editor/sql-expr.worker.js +119 -116
  31. package/dist/cdn/assets/code-editor/sql-layer.worker.js +10087 -0
  32. package/dist/cdn/assets/editor-variables/t9n/messages.en.json +1 -1
  33. package/dist/cdn/assets/sql-expression-editor/t9n/messages.en.json +1 -1
  34. package/dist/cdn/assets/sql-layer-editor/t9n/messages.en.json +1 -0
  35. package/dist/cdn/index.js +1 -1
  36. package/dist/cdn/main.css +1 -1
  37. package/dist/chunks/arcade-defaults.js +98 -96
  38. package/dist/chunks/arcade-service-accessors.js +40 -28
  39. package/dist/chunks/bigquery.js +186 -0
  40. package/dist/chunks/colorize.js +1 -1
  41. package/dist/chunks/fields.js +2 -2
  42. package/dist/chunks/language-defaults-base.js +733 -464
  43. package/dist/chunks/postgres.js +209 -0
  44. package/dist/chunks/setup-monaco-theme.js +28 -20
  45. package/dist/chunks/sql-expr-defaults.js +11 -10
  46. package/dist/chunks/sql-layer-defaults.js +231 -0
  47. package/dist/chunks/sql-layer-mode.js +301 -0
  48. package/dist/chunks/sqlServer.js +288 -0
  49. package/dist/chunks/utils.js +184 -0
  50. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +134 -123
  51. package/dist/components/arcgis-arcade-editor/customElement.d.ts +17 -0
  52. package/dist/components/arcgis-arcade-editor/customElement.js +22 -22
  53. package/dist/components/arcgis-code-editor/customElement.d.ts +2 -1
  54. package/dist/components/arcgis-code-editor/customElement.js +91 -71
  55. package/dist/components/arcgis-editor-variables/customElement.js +50 -47
  56. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +12 -0
  57. package/dist/components/arcgis-sql-expression-editor/customElement.js +17 -17
  58. package/dist/components/arcgis-sql-layer-editor/customElement.d.ts +50 -0
  59. package/dist/components/arcgis-sql-layer-editor/customElement.js +92 -0
  60. package/dist/components/arcgis-sql-layer-editor/index.d.ts +1 -0
  61. package/dist/components/arcgis-sql-layer-editor/index.js +7 -0
  62. package/dist/components/types.d.ts +79 -2
  63. package/dist/docs/api.json +1 -1
  64. package/dist/docs/docs.json +1 -1
  65. package/dist/docs/vscode.html-custom-data.json +1 -1
  66. package/dist/docs/web-types.json +1 -1
  67. package/dist/index.d.ts +10 -0
  68. package/dist/loader.js +6 -5
  69. package/dist/types/lumina.d.ts +9 -2
  70. package/dist/types/preact.d.ts +10 -2
  71. package/dist/types/react.d.ts +11 -2
  72. package/dist/types/stencil.d.ts +9 -2
  73. package/dist/utils/data-catalog-datastore.d.ts +170 -0
  74. package/package.json +5 -5
  75. package/dist/cdn/5CO7XWOT.js +0 -2
  76. package/dist/cdn/5FXY5U3T.js +0 -2
  77. package/dist/cdn/CYC4AWZE.js +0 -2
  78. package/dist/cdn/GVO3LEFV.js +0 -2
  79. package/dist/cdn/J5X2KSYD.js +0 -2
  80. package/dist/cdn/QHJAF7L3.js +0 -6
  81. package/dist/cdn/T7GEIGWF.js +0 -2
  82. package/dist/cdn/TAXRVBJC.js +0 -2
  83. package/dist/cdn/VR5CATAW.js +0 -2
  84. package/dist/cdn/WTNM2NCZ.js +0 -2
  85. package/dist/cdn/XEUG3X2W.js +0 -2
  86. package/dist/cdn/ZJCI6LP6.js +0 -12
  87. package/dist/cdn/ZSVJAJND.js +0 -4
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as L}from"./MP6Z45SA.js";import{a as l}from"./NKCYMRE4.js";import{b as g}from"./BCUUVBXH.js";import{Qk as C,al as h}from"./NG7S6FUK.js";var m=Promise.withResolvers(),u=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._modelLifecycleListeners=[],this._isDisposed=!1,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker()),this._modelContextChangeListener=this._defaults.onModelContextDidChange(()=>{this._stopWorkerIfUnused()}),this._registerModelLifecycleListeners()}dispose(){for(this._isDisposed=!0,this._configChangeListener.dispose(),this._modelContextChangeListener.dispose();this._modelLifecycleListeners.length;)this._modelLifecycleListeners.pop()?.dispose();this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _registerModelLifecycleListeners(){let e=await l();this._isDisposed||this._modelLifecycleListeners.push(e.onWillDisposeModel(()=>{this._stopWorkerIfUnused()}),e.onDidChangeModelLanguage(()=>{this._stopWorkerIfUnused()}))}async _stopWorkerIfUnused(){this._worker&&((await l()).getModels().some(e=>e.getLanguageId()===this._defaults.languageId)||this.stopWorker())}async _getClientProxy(){let e=await l();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Layer workers.");this._worker=e.createWebWorker({worker:o("SqlLayerWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},D=i=>{let e=y(i.start),t=y(i.end);return{startRegex:new RegExp(e),contentRegex:new RegExp(`[^${t}]+`),escapedRegex:new RegExp(`${t}${t}`),endRegex:new RegExp(t)}},S=i=>{let e=i.specialChars.identifierQuote;return{comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}]}},E=i=>{let e=D(i.specialChars.identifierQuote);return{defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:i.keywords,operators:i.operators,builtinFunctions:i.functions,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[e.startRegex,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[e.contentRegex,"identifier"],[e.escapedRegex,"identifier"],[e.endRegex,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}},y=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),a=this._defaults.getApiContextForModel(e.uri),n=e.getWordUntilPosition(t),d={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:n.startColumn,endColumn:n.endColumn};return await o.doComplete(e.uri.toString(),d,t,a)}catch(o){return g("SqlLayerCompletionProvider")(o),{suggestions:[]}}}},f=class{constructor(e,t,{defaults:o,diagnosticService:a}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._defaults=o,this._diagnosticsService=a,l().then(n=>{let d=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let c=L(()=>{this._doValidate(s,r).catch(M=>{throw M})}),x=s.onDidChangeContent(c),I=s.onDidChangeAttached(c);this._modelListeners.set(s.uri.toString(),[x,I]),this._doValidate(s,r).catch(g("SqlLayerDiagnosticsAdapter"))},p=s=>{let r=s.uri.toString();n.setModelMarkers(s,this._languageId,[]);let c=this._modelListeners.get(r);if(c){for(;c.length;)c.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(n.onDidCreateModel(d)),this._disposables.push(n.onWillDisposeModel(s=>p(s))),this._disposables.push(n.onDidChangeModelLanguage(s=>{p(s.model),d(s.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(p(s),d(s))})})),this._disposables.push(o.onModelContextDidChange(s=>{n.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(g("SqlLayerDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(d)})}async _doValidate(e,t){let o=await l();if(e.isAttachedToEditor())try{let a=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),d=await a.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,d),o.setModelMarkers(e,t,d)}catch(a){g("SqlLayerDiagnosticsAdapter")(a)}}},w;async function T(...i){return await u.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("SQL layer worker not registered!"));return}e(w(...i))})}var k=class{constructor(){this._onDiagnosticsChange=new C}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},b=new k;function H(){return b}async function Q(i){let e=new u(i),t=async(...a)=>await e.getLanguageServiceWorker(...a);w=t;let o=await i.getDialectSpec();h.setMonarchTokensProvider(i.languageId,E(o)),h.setLanguageConfiguration(i.languageId,S(o)),h.registerCompletionItemProvider(i.languageId,new _(t,i)),new f(i.languageId,t,{defaults:i,diagnosticService:b})}export{T as a,H as b,Q as c};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import c from"./SV4IPD4A.js";import b from"./LSBKL6MO.js";import{a as m}from"./HPZZVB4X.js";import a from"./ZCXZTSQU.js";import{a as t}from"./NKCYMRE4.js";import{Zk as d,al as n}from"./NG7S6FUK.js";export default $arcgis.t(([{a:s,b:p},a,{c:c}])=>{var k=["arcade","arcgis-sql-expression","sql-layer-sql-server","sql-layer-postgres","sql-layer-bigquery"],i=new Set,u=new Map;function l(e){let r=u.get(e);return r||(r=Promise.withResolvers(),u.set(e,r)),r}function f(e){l(e).resolve()}function T(e){return k.includes(e)?l(e).promise:Promise.resolve()}function h(e,r){return()=>{i.has(e)||i.add(e),r()}}async function U(e){i.has(e)||(await t()).createModel("",e,d.parse("")).dispose()}n.register({id:a.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});n.onLanguage(a.languageId,h(a.languageId,()=>{c().then(e=>{e.setupMode(a),f(a.languageId)}).catch(e=>{throw e})}));n.register({id:s.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});n.onLanguage(s.languageId,h(s.languageId,()=>{p().then(e=>{e.setupMode(s),f(s.languageId)}).catch(e=>{throw e})}));q();function q(){t().then(e=>{["light","dark"].forEach(r=>{let g=r==="light"?"vs":"vs-dark",o=m[`${r}-theme`];e.defineTheme(g,{base:g,inherit:!0,rules:[{token:"comment.arcgis",foreground:o.comment},{token:"constant.arcgis",foreground:o.constant},{token:"keyword.arcgis",foreground:o.keyword},{token:"identifier.arcgis",foreground:o.identifier},{token:"number.arcgis",foreground:o.number},{token:"string.arcgis",foreground:o.string},{token:"operator.arcgis",foreground:o.operator},{token:"predefined.arcgis",foreground:o.predefined},{token:"date.arcgis",foreground:o.date}],colors:{}})})})}return{a:f,b:T,c:h,d:U}},a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"./3TTFCHAA.js";var E={id:"sqlServer",keywords:["ADD","ALL","ALTER","AND","ANY","AS","ASC","AUTHORIZATION","AVG","BACKUP","BEGIN","BETWEEN","BREAK","BROWSE","BULK","BY","CASCADE","CASE","CHECK","CHECKPOINT","CLOSE","CLUSTERED","COALESCE","COLLATE","COLUMN","COMMIT","COMPUTE","CONSTRAINT","CONTAINS","CONTAINSTABLE","CONTINUE","CONVERT","COUNT","CREATE","CROSS","CURRENT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURSOR","DATABASE","DBCC","DEALLOCATE","DECLARE","DEFAULT","DELETE","DENY","DESC","DISK","DISTINCT","DISTRIBUTED","DOUBLE","DROP","DUMP","ELSE","END","ERRLVL","ESCAPE","EXCEPT","EXEC","EXECUTE","EXISTS","EXIT","EXTERNAL","FETCH","FILE","FILLFACTOR","FOR","FOREIGN","FREETEXT","FREETEXTTABLE","FROM","FULL","FUNCTION","GOTO","GRANT","GROUP","HAVING","HOLDLOCK","IDENTITY","IDENTITYCOL","IDENTITY_INSERT","IF","IN","INDEX","INNER","INSERT","INTERSECT","INTO","IS","ISOLATION","JOIN","KEY","KILL","LEFT","LEVEL","LIKE","LINENO","LOAD","MAX","MERGE","MIN","NATIONAL","NOCHECK","NONCLUSTERED","NOT","NULL","NULLIF","OF","OFF","OFFSETS","ON","ONLY","OPEN","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","OPTION","OR","ORDER","OUTER","OVER","PERCENT","PIVOT","PLAN","PRECISION","PREPARE","PRIMARY","PRINT","PRIVILEGES","PROC","PROCEDURE","PROCESSEXIT","PUBLIC","RAISERROR","READ","READTEXT","RECONFIGURE","REFERENCES","REPEATABLE","REPLICATION","RESTORE","RESTRICT","RETURN","REVOKE","RIGHT","ROLLBACK","ROWCOUNT","ROWGUIDCOL","RULE","SAVE","SCHEMA","SECURITYAUDIT","SELECT","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","SERIALIZABLE","SESSION_USER","SET","SETUSER","SHUTDOWN","SOME","STATISTICS","SUM","SYSTEM_USER","TABLE","TABLESAMPLE","TEMPORARY","TEXTSIZE","THEN","TO","TOP","TRAN","TRANSACTION","TRIGGER","TRUNCATE","TRY_CONVERT","TSEQUAL","UNION","UNIQUE","UNPIVOT","UPDATE","UPDATETEXT","USE","USER","VALUES","VARYING","VIEW","WAITFOR","WHEN","WHERE","WHILE","WITH","WITHIN_GROUP","WORK","WRITETEXT"],functions:["UPPER","LOWER","CONCAT","ASCII","LEN","CHAR","LTRIM","RTRIM","SUBSTRING","SOUNDEX","REPLACE","CEILING","FLOOR","ROUND","LOG","LOG10","MOD","POWER","SIGN","ASIN","ACOS","ATAN","SIN","COS","TAN","DATEPART","DATALENGTH","CHARINDEX","ABS","VAR","STDEV","AVG","COUNT","MAX","MIN","SUM","COALESCE","CONVERT","CAST","CURRENT_USER","GETDATE","CURRENT_TIMESTAMP","STDEVP","VARP","NULLIF","PERCENTILE_CONT","PERCENTILE_DISC","CUME_DIST","FIRST_VALUE","LAST_VALUE","LEAD","LAG","PERCENT_RANK","RANK","NTILE","DENSE_RANK","ROW_NUMBER","STRING_AGG","GROUPING SETS","CUBE","ROLLUP"],operators:["+"],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:"'",end:null},escapeClause:{keyword:"ESCAPE",suffix:""}}};export{E as sqlServerDialect};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"./3TTFCHAA.js";var E={id:"bigquery",keywords:["ALL","AND","ANY","ARRAY","AS","ASC","ASSERT_ROWS_MODIFIED","AT","BETWEEN","BY","CASE","CAST","COLLATE","CONTAINS","CREATE","CROSS","CUBE","CURRENT","DEFAULT","DEFINE","DESC","DISTINCT","ELSE","END","ENUM","ESCAPE","EXCEPT","EXCLUDE","EXISTS","EXTRACT","FALSE","FETCH","FOLLOWING","FOR","FROM","FULL","GROUP","GROUPING","GROUPS","HASH","HAVING","IF","IGNORE","IN","INNER","INTERSECT","INTERVAL","INTO","IS","JOIN","LATERAL","LEFT","LIKE","LIMIT","LOOKUP","MERGE","NATURAL","NEW","NO","NOT","NULL","NULLS","OF","ON","OR","ORDER","OUTER","OVER","PARTITION","PRECEDING","PROTO","RANGE","RECURSIVE","RESPECT","RIGHT","ROLLUP","ROWS","SELECT","SET","SOME","STRUCT","TABLESAMPLE","THEN","TO","TREAT","TRUE","UNBOUNDED","UNION","UNNEST","USING","WHEN","WHERE","WINDOW","WITH","WITHIN"],functions:["UPPER","LOWER","CONCAT","CHAR_LENGTH","BYTE_LENGTH","LTRIM","RTRIM","SUBSTR","REPLACE","TRIM","CEIL","FLOOR","ROUND","LN","LOG10","LOG","MOD","POWER","TRUNC","SINH","COSH","TANH","ASIN","ACOS","ATAN","TO_HEX","SIN","COS","TAN","EXTRACT","BIT_COUNT","ABS","VARIANCE","STDDEV","AVG","COUNT","MAX","MIN","SUM","COALESCE","CONVERT","CAST","CURRENT_TIME","CURRENT_DATE","CURRENT_TIMESTAMP","STDDEV_POP","VAR_POP","VAR_SAMP","NULLIF","PERCENTILE_CONT","PERCENTILE_DISC","CUME_DIST","FIRST_VALUE","LAST_VALUE","LEAD","LAG","PERCENT_RANK","RANK","NTILE","DENSE_RANK","ROW_NUMBER","STRING_AGG","ROLLUP"],operators:["||"],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:"`",end:"`"},escapeKey:{start:"\\",end:null},escapeClause:{keyword:"ESCAPE",suffix:""}}};export{E as bigqueryDialect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as u}from"./BCUUVBXH.js";function M(t){return y(t)||C(t)}function v(t){return N(t).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function C(t){return v(t).length>0}function N(t){return t.currentTarget.assignedNodes({flatten:!0})}function y(t){return L(t).length>0}function L(t,e){return w(t.target,e)}function w(t,e){let n=t.assignedElements({flatten:!0});return e?n.filter(o=>o.matches(e)):n}var A=(t,e)=>{let n=t;for(;n;){if(n===e)return!0;if(!n.parentNode)return!1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode}return!1},h=(t,e,n)=>{let o=T(e).subscribe;return o(s=>{s.some(r=>A(t,r.target))&&n()})},d={},T=t=>{let e=t.join(","),n=d[e];if(n!==void 0)return n;let o=new Set,s=new MutationObserver(r=>o.forEach(l=>l(r)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});let i={subscribe:r=>(o.add(r),()=>{o.delete(r),o.size===0&&(s.disconnect(),d[e]=void 0)})};return d[e]=i,i},g=(t,e)=>{let n=t;for(;n;){let o=n.closest?.(e);if(o)return o;let s=n.getRootNode?.();if(s===globalThis.document)return;n=s?.host}};function P(t){let e=g(t,".calcite-mode-dark, .calcite-mode-light, .calcite-mode-auto");return e?.classList.contains("calcite-mode-dark")||e?.classList.contains("calcite-mode-auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var m=(t,e,n)=>g(t,`[${e}]`)?.getAttribute(e)??n,F=async t=>{t!=null&&(p(t)?await t.setFocus():t.focus())},p=t=>typeof t.setFocus=="function",G=(t,e)=>{if(t?.shadowRoot){if(t.hasAttribute("hydrated")||t.hasAttribute("calcite-hydrated")){c(t,e);return}Promise.resolve(t.componentOnReady?.()).then(()=>c(t,e))}},$=t=>t.nodeType===Node.ELEMENT_NODE,c=(t,e="")=>{if(!$(t))return!1;if(t.matches(e))return p(t)&&setTimeout(()=>void t.setFocus(),0),!0;for(let o of t.children)if(c(o,e))return!0;let n=t.shadowRoot;if(n){for(let o of n.children)if(c(o,e))return!0}return!1};var k="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),S=new Set(k),a="en",z={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},O=async(t,e,n="")=>{let o=`${e}/${n}`,s=`${o}${t}.json`;return f[s]??(f[s]=b(t,o)),await f[s]},f={},b=async(t,e)=>{let n=`${e}${t}.json`;try{let o=await fetch(n);if(o.ok)return await o.json()}catch(o){return u("error","intl",`An unknown error occurred while fetching localization strings at ${n}`,{detail:{error:o}}),{}}return t===a?{}:await b(a,e)},j=t=>{let e=m(t,"lang",globalThis.navigator?.language||a);return{lang:e,t9nLocale:E(e)}},E=t=>{let[e,n]=t.split("-"),o=e.toLowerCase(),s=o;return n&&(s=`${o}-${n.toUpperCase()}`),s=z[s]??s,S.has(s)?s:n?E(o):a},R=(t,e,n,o)=>{let s,i=()=>x(t,e(),o).then(r=>{(s?.lang!==r.lang||s.t9nLocale!==r.t9nLocale||s.t9nStrings!==r.t9nStrings)&&n(r),s=r}).catch(r=>{u("error","intl","Error updating component locale state",{detail:{error:r}})});return queueMicrotask(i),h(t,["lang"],i)},x=async(t,e,n=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:s}=j(t),i=`${e}/${n}/t9n`,l=n===null?{}:await O(s,i,"messages.");return{lang:o,t9nLocale:s,t9nStrings:l}};export{M as a,h as b,P as c,F as d,G as e,S as f,O as g,j as h,E as i,R as j};
2
+ import{a as u}from"./BCUUVBXH.js";function M(t){return y(t)||C(t)}function v(t){return N(t).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function C(t){return v(t).length>0}function N(t){return t.currentTarget.assignedNodes({flatten:!0})}function y(t){return L(t).length>0}function L(t,e){return w(t.target,e)}function w(t,e){let n=t.assignedElements({flatten:!0});return e?n.filter(o=>o.matches(e)):n}var A=(t,e)=>{let n=t;for(;n;){if(n===e)return!0;if(!n.parentNode)return!1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode}return!1},h=(t,e,n)=>{let o=T(e).subscribe;return o(s=>{s.some(r=>A(t,r.target))&&n()})},d={},T=t=>{let e=t.join(","),n=d[e];if(n!==void 0)return n;let o=new Set,s=new MutationObserver(r=>o.forEach(l=>l(r)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});let i={subscribe:r=>(o.add(r),()=>{o.delete(r),o.size===0&&(s.disconnect(),d[e]=void 0)})};return d[e]=i,i},g=(t,e)=>{let n=t;for(;n;){let o=n.closest?.(e);if(o)return o;let s=n.getRootNode?.();if(s===globalThis.document)return;n=s?.host}};function F(t){let e=g(t,".calcite-mode-dark, .calcite-mode-light, .calcite-mode-auto");return e?.classList.contains("calcite-mode-dark")||e?.classList.contains("calcite-mode-auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var m=(t,e,n)=>g(t,`[${e}]`)?.getAttribute(e)??n,P=async t=>{t!=null&&(p(t)?await t.setFocus():t.focus())},p=t=>typeof t.setFocus=="function",G=(t,e)=>{if(t?.shadowRoot){if(t.hasAttribute("hydrated")||t.hasAttribute("calcite-hydrated")){c(t,e);return}Promise.resolve(t.componentOnReady?.()).then(()=>c(t,e))}},$=t=>t.nodeType===Node.ELEMENT_NODE,c=(t,e="")=>{if(!$(t))return!1;if(t.matches(e))return p(t)&&setTimeout(()=>void t.setFocus(),0),!0;for(let o of t.children)if(c(o,e))return!0;let n=t.shadowRoot;if(n){for(let o of n.children)if(c(o,e))return!0}return!1};var k="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),S=new Set(k),a="en",z={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},O=async(t,e,n="")=>{let o=`${e}/${n}`,s=`${o}${t}.json`;return f[s]??(f[s]=b(t,o)),await f[s]},f={},b=async(t,e)=>{let n=`${e}${t}.json`;try{let o=await fetch(n);if(o.ok)return await o.json()}catch(o){return u("error","intl",`An unknown error occurred while fetching localization strings at ${n}`,{detail:{error:o}}),{}}return t===a?{}:await b(a,e)},j=t=>{let e=m(t,"lang",globalThis.navigator?.language||a);return{lang:e,t9nLocale:E(e)}},E=t=>{let[e,n]=t.split("-"),o=e.toLowerCase(),s=o;return n&&(s=`${o}-${n.toUpperCase()}`),s=z[s]??s,S.has(s)?s:n?E(o):a},R=(t,e,n,o)=>{let s,i=()=>x(t,e(),o).then(r=>{(s?.lang!==r.lang||s.t9nLocale!==r.t9nLocale||s.t9nStrings!==r.t9nStrings)&&n(r),s=r}).catch(r=>{u("error","intl","Error updating component locale state",{detail:{error:r}})});return queueMicrotask(i),h(t,["lang"],i)},x=async(t,e,n=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:s}=j(t),i=`${e}/${n}/t9n`,l=n===null?{}:await O(s,i,"messages.");return{lang:o,t9nLocale:s,t9nStrings:l}};export{M as a,h as b,g as c,F as d,P as e,G as f,S as g,O as h,j as i,E as j,R as k};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as n}from"./N2YCVDWS.js";import{a as f}from"./4A2CLADY.js";import"./RJRCBNNO.js";import{a as g}from"./OZ65S2RS.js";import"./BQLG62QR.js";import{d as p,e as u}from"./UZJHWA6T.js";import{E as a,F as d,J as h,h as m,j as s,n as c,r as o}from"./4BNI5KJQ.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var b=m`: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-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
2
+ import{a as n}from"./N2YCVDWS.js";import{a as f}from"./WNKEPEXN.js";import"./57WNN7NN.js";import{a as g}from"./OZ65S2RS.js";import"./BQLG62QR.js";import{e as p,f as u}from"./FUBRHCFC.js";import{E as a,F as d,J as h,h as m,j as s,n as c,r as o}from"./4BNI5KJQ.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var b=m`: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-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
@@ -0,0 +1,6 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import b from"./W2PBO44R.js";import a from"./ZHZFKZA7.js";import{b as f,c as p,d as c}from"./BQLG62QR.js";import{g as v,h as T}from"./FUBRHCFC.js";import{K as m}from"./4BNI5KJQ.js";export default $arcgis.t(([{getDeclaredPixelMembers:$},{G:w,f:M,g:F,h:P,i:k,j:A,n:b},{k:I,l:L,m:V,o:C,p:D}])=>{async function K(e){let{apiVersion:i,bundles:t,hiddenApiItems:n}=e.toEditorProfileDefinition(),o=await j(e.dictionaryVariables.filter(w));return{apiVersion:i,bundles:t,variables:o,hiddenApiItems:n?.map(s=>s.toLowerCase())}}async function j(e,i=f.Variable){return await Promise.all(e.map(async t=>{switch(t.type){case"dictionary":return await q(t,i);case"pixel":return await O(t,i);case"voxel":case"feature":return await B(t,i);default:return _(t,i)}}))}function _(e,i){let{name:t,type:n}=e,o=e.getDescription(),s=i===f.Field?I(t,!1):t;return{name:t,description:o,type:n,completion:{label:t,detail:t,insertText:s,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i,documentation:{kind:"markdown",value:o}}}}async function B(e,i){let t=await e.loadSource(),{name:n}=e,o=e.getDescription(),s={label:n,detail:n,insertText:n,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},a={name:n,description:o,type:"dictionary",properties:[],completion:s};if(!t)return a;let[r,l]=L(t.fields,o,!0);return a.properties=r,s.documentation={kind:"markdown",value:l},a}async function O(e,i){let t=await e.loadSource(),n=e.toProfileVariableDefinition();if(n.type!=="pixel")throw new Error("Incorrect definition passed to pixel variable");let{name:o}=e,s=e.getDescription(),a={label:o,detail:o,insertText:o,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},r={name:o,description:s,type:"dictionary",properties:[],completion:a};if(!t||!n.definition)return r;let l=await $(t),[d,u]=V(l,s);return r.properties=d,a.documentation={kind:"markdown",value:u},r}async function q(e,i){let{name:t,dictionaryVariables:n}=e,o=e.getDescription(),s=n.reduce((a,r)=>{a!==""&&(a+=`
3
+
4
+ `),a+=`**${r.name}**
5
+ ${r.type}`;let l=r.getDescription();return l&&(a+=`
6
+ ${l}`),a},o);return{name:t,description:o,type:"dictionary",properties:await j(n.filter(w),f.Field),completion:{label:t,detail:t,insertText:t,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i,documentation:{kind:"markdown",value:s}}}}async function h(e="en"){let i=E.get(e);if(i)return i;if(!v.has(e))return await h("en");try{let t=await fetch(m(`./assets/arcade-language/profiles/arcade-profiles.t9n.${e}.json`));return t.ok?z(e,await t.json()):e==="en"?null:await h("en")}catch{return null}}var E=new Map;function z(e,i){let t=new Map;return i.forEach(n=>{t.set(n.id,n)}),E.set(e,t),t}async function G(e,i="en"){return(await h(i))?.get(e)??null}function H(e){return!!e&&typeof e=="object"&&"additionalVariables"in e&&Array.isArray(e.additionalVariables)}function J(e){return e?.map(g)}function g(e){switch(e.type){case"dictionary":return{...e,type:e.type,properties:J(e.properties)};case"array":return{...e,type:e.type,elementType:{type:"number",name:"number"}};default:return{...e,type:e.type}}}async function N(e,i="en"){if(!b(e))return;let t=await G(e.id,i);if(!t)return;let n=e.definitions,o=new Map(Object.entries(n).map(([a,r])=>[a.toLowerCase(),r])),s={bundles:[...t.bundles],variables:[],hiddenApiItems:e.hiddenApiItems?.map(a=>a.toLowerCase())};return t.variables.forEach(a=>{if(e.disabledVariables?.includes(a.name))return;let r=o.get(a.name.toLowerCase());switch(a.type){case"dictionary":return s.variables.push(g({...a,type:a.type,properties:Array.isArray(r)?[...r]:a.properties}));case"feature":return M(r)?s.variables.push({...a,type:"feature",definition:r}):void 0;case"pixel":return P(r)?s.variables.push({...a,type:a.type,definition:r}):void 0;case"voxel":return F(r)?s.variables.push({...a,type:a.type,definition:r}):void 0;case"featureSet":return k(r)?s.variables.push({...a,type:a.type,definition:r}):void 0;case"featureSetCollection":return A(r)?s.variables.push({...a,type:a.type,definition:r}):void 0;default:return s.variables.push(g(a))}}),H(e)&&s.variables.push(...e.additionalVariables??[]),s}var Q=["catalog-footprint","catalog","csv","feature","geojson","knowledge-graph-sublayer","oriented-imagery","subtype-group","subtype-sublayer","wfs"];function R(e){return!!e&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&Q.includes(e.type)}var U={filterFsCollectionLayersFromMap:e=>R(e)},x=class extends D{#e=new Map;constructor(){super("arcade",{apiPath:"./assets/arcade-language/api",apiPrefix:"arcade-api.t9n."})}async setProfileForModel(i,t,n={locale:"en"}){let o=this._getApiKey(i),s=(this.#e.get(o)||Promise.resolve()).then(async()=>{let r=t,l=b(r)?await N(r,n.locale):r,d=await T(n.locale,m("./assets/editor-profile/t9n"),"messages.");if(!d)throw new Error(`Failed to load the language bundle for ${n.locale}`);this.disposeForModel(i);let u=new C(l,d,n.locale,U);this._modelToProfileMap.set(o,u);let S=await K(u);this.updateApiContextForModel(i,{locale:n.locale,profile:S,snippets:n.snippets})}),a=s.finally(()=>{this.#e.get(o)===a&&this.#e.delete(o)});return this.#e.set(o,a),await s}},y=new x,ae={setProfileForModel:y.setProfileForModel.bind(y),getApiLibraryForModel:y.getApiLibraryForModel.bind(y)};return y},"applications/Components/arcadeEditorUtils",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import i from"./D6BJOZGQ.js";import h from"./SV4IPD4A.js";import e from"./LSBKL6MO.js";import"./HPZZVB4X.js";import{a as k,c as u,d as L}from"./2XTHR2WZ.js";import{a as w}from"./57WNN7NN.js";import d from"./ZCXZTSQU.js";import c from"./W2PBO44R.js";import a from"./ZHZFKZA7.js";import{a as N}from"./MP6Z45SA.js";import"./IFNCCZ7O.js";import"./OZ65S2RS.js";import{a as C}from"./NKCYMRE4.js";import"./BQLG62QR.js";import{a as E,b as y,d as b}from"./FUBRHCFC.js";import"./UYBZWFE5.js";import{F as v,J as S,K as T,h as g,i as _,j as l}from"./4BNI5KJQ.js";import{b as f}from"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,,{a:O},{b:c,d:p}])=>{var M=Symbol(),h=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,e)=>{this.o=t,this.h=e})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,e,s){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this.v=i.task,this.j=i.args,this.m=i.argsEqual??A,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),e=this.O;this.O=t,t===e||t===void 0||e!==void 0&&this.m(e,t)||await this.run(t)}async run(t){let e,s;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let o=!1;try{e=await this.v(t,{signal:this.q.signal})}catch(d){o=!0,s=d}if(this.p===i){if(e===M)this.i=0;else{if(o===!1){try{this.k?.(e)}catch{}this.i=2,this.o?.(e)}else{try{this.A?.(s)}catch{}this.i=3,this.h?.(s)}this.u=e,this.l=s}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},A=(n,t)=>n===t||n.length===t.length&&n.every(((e,s)=>!_(e,t[s])));var q=g`pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){pre{border-radius:var(--calcite-corner-radius-round)}}`,m=class extends v{constructor(){super(...arguments),this._monacoEditor=w(C),this.#e=Promise.withResolvers(),this.#t="",this._slotContentObservers=[],this._onDefaultSlotChange=async t=>{E(t)||(this._codeFromSlot="");let e=t.target instanceof HTMLSlotElement?t.target:null,s=e?this._computeSlotText(e):"";e&&this._observeAssignedSlotNodes(e),s!==this._codeFromSlot&&(this._codeFromSlot=s),this.#e.resolve()},this._colorizeTask=new h(this,{task:async([t,e],{signal:s})=>{if(await this.#e.promise,s.aborted)return this.#t;if(await c(e),s.aborted)return this.#t;let i=await k(t,e);return s.aborted?this.#t:(this.#t=i,i)},args:()=>[this._codeFromSlot,this.language]}),this._codeFromSlot="",this.language="arcade",this.round=!1}static{this.properties={_codeFromSlot:16,language:1,round:7}}static{this.styles=q}#e;#t;async load(){O(T("./assets")),await p(this.language),await c(this.language),this._applyColorizeStyles(u()),this.manager.onLifecycle(()=>(this._themeObserver=y(this.el,["class"],()=>this.updateTheme()),this._themeChangedListener=L(()=>{this._applyColorizeStyles(u())}),this.updateTheme(),()=>{this._themeObserver?.(),this._themeObserver=void 0,this._themeChangedListener?.dispose(),this._themeChangedListener=void 0}))}loaded(){this.el.hasChildNodes()||this.#e.resolve()}willUpdate(t){t.has("language")&&p(this.language).then(()=>c(this.language)).catch(f(this))}disconnectedCallback(){super.disconnectedCallback(),this._disposeSlotObservers()}_disposeSlotObservers(){this._slotContentObservers.length&&(this._slotContentObservers.forEach(t=>t.disconnect()),this._slotContentObservers=[])}_observeAssignedSlotNodes(t){this._disposeSlotObservers();let e=t.assignedNodes({flatten:!0});if(!e.length)return;let s=new Set;for(let r of e)r.nodeType===Node.ELEMENT_NODE?s.add(r):r.nodeType===Node.TEXT_NODE&&r.parentElement&&s.add(r.parentElement);let i={characterData:!0,childList:!0,subtree:!0},o=N(()=>{let r=this._computeSlotText(t);r!==this._codeFromSlot&&(this._codeFromSlot=r)},100),d=r=>{if(r.some(a=>a.type==="childList")){let a=this._computeSlotText(t);a!==this._codeFromSlot&&(this._codeFromSlot=a);return}o()};s.forEach(r=>{let a=new MutationObserver(d);a.observe(r,i),this._slotContentObservers.push(a)})}_computeSlotText(t){let e=t.assignedNodes({flatten:!0}).filter(s=>s.nodeType!==Node.COMMENT_NODE);if(this.language==="html"&&e.length){let s=e.find(o=>o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TEMPLATE");if(s)return(s.innerHTML??"").trim();let i=e.map(o=>o.nodeType===Node.ELEMENT_NODE?o.outerHTML:o.nodeType===Node.TEXT_NODE?o.textContent??"":"").join("").trim();return i}return e.map(s=>s.textContent??"").join("").trim()}updateTheme(){let t=b(this.el)==="light"?"vs":"vs-dark";t!==this._currentTheme&&(this._currentTheme=t,this._monacoEditor.setTheme(t))}_applyColorizeStyles(t){if(!this._colorizeSheet){this._colorizeSheet=new CSSStyleSheet;let e=this.renderRoot;e.adoptedStyleSheets=[...e.adoptedStyleSheets,this._colorizeSheet]}this._colorizeSheet.replaceSync(t)}render(){return l`<div><slot @slotchange=${this._onDefaultSlotChange} style="display:none" aria-hidden=true></slot><pre class="arcgis-code-viewer" aria-label=${`${this.language} code snippet`}>${this._colorizeTask.render({error:()=>null,pending:()=>l`<code class=${`language-${this.language}`}></code>`,complete:t=>l`<code class=${`language-${this.language}`} .innerHTML=${t??""}></code>`})}</pre></div>`}};S("arcgis-code-viewer",m);return m},a,c,d,e,h,i)
@@ -0,0 +1,4 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import c from"./LSBKL6MO.js";import{a as ne}from"./WNKEPEXN.js";import"./57WNN7NN.js";import b from"./W2PBO44R.js";import a from"./ZHZFKZA7.js";import"./MP6Z45SA.js";import{d as de}from"./IFNCCZ7O.js";import{c as ce,d as le}from"./OZ65S2RS.js";import"./NKCYMRE4.js";import"./BQLG62QR.js";import"./FUBRHCFC.js";import"./UYBZWFE5.js";import{A as Z,B as ee,C as D,D as te,E as ae,F as ie,G as se,H as _,J as oe,h as K,j as p,k as P,l as U,s as X,v as q,w as N,x as F,y as I,z as S}from"./4BNI5KJQ.js";import{a as k}from"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";export default $arcgis.t(([Me,ue,Ee,me,he,{getDeclaredVoxelMembers:Re,getDeclaredPixelMembers:Ve},Pe,{property:w,subclass:qe},{G:z,w:re,x:O},,L])=>{var pe=(a,e,t)=>{let i=new Map;for(let s=e;s<=t;s++)i.set(a[s],s);return i},B=N(class extends F{constructor(a){if(super(a),a.type!==q.CHILD)throw Error("repeat() can only be used in text expressions")}dt(a,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let s=[],n=[],c=0;for(let d of a)s[c]=i?i(d,c):c,n[c]=t(d,c),c++;return{values:n,keys:s}}render(a,e,t){return this.dt(a,e,t).values}update(a,[e,t,i]){let s=ee(a),{values:n,keys:c}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=c,n;let d=this.ut??=[],r=[],o,g,l=0,u=s.length-1,m=0,h=n.length-1;for(;l<=u&&m<=h;)if(s[l]===null)l++;else if(s[u]===null)u--;else if(d[l]===c[m])r[m]=S(s[l],n[m]),l++,m++;else if(d[u]===c[h])r[h]=S(s[u],n[h]),u--,h--;else if(d[l]===c[h])r[h]=S(s[l],n[h]),I(a,r[h+1],s[l]),l++,h--;else if(d[u]===c[m])r[m]=S(s[u],n[m]),I(a,s[l],s[u]),u--,m++;else if(o===void 0&&(o=pe(c,m,h),g=pe(d,l,u)),o.has(d[l]))if(o.has(d[u])){let f=g.get(c[m]),T=f!==void 0?s[f]:null;if(T===null){let v=I(a,s[l]);S(v,n[m]),r[m]=v}else r[m]=S(T,n[m]),I(a,s[l],T),s[f]=null;m++}else D(s[u]),u--;else D(s[l]),l++;for(;m<=h;){let f=I(a,r[h+1]);S(f,n[m]),r[m++]=f}for(;l<=u;){let f=s[l++];f!==null&&D(f)}return this.ut=c,Z(a,r),P}});var R=class extends F{constructor(e){if(super(e),this.it=U,e.type!==q.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===P)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};R.directiveName="unsafeHTML",R.resultType=1;var V=N(R);var Ne=K`:host(:not([closed])){container-type:size;--calcite-block-border-color: var(--calcite-color-transparent);box-sizing:border-box;.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}@container (max-width: 380px){.hidden-below-380{display:none}}@container (min-width: 380px){.hidden-above-380{display:none}}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.feedback-content{padding:var(--calcite-spacing-sm);display:flex;flex-direction:column;max-height:75cqb;overflow-y:auto;>*{margin-block-end:.5rem}>*:last-child,.terms-label{margin-block-end:0}calcite-text-area{--calcite-text-area-min-height: 4rem}calcite-notice{margin-block-start:0}}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}.feedback-footer{display:flex;justify-content:flex-end;gap:.5rem;width:100%}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}calcite-list-item calcite-button{margin-inline-end:.25rem}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none;flex-direction:column}calcite-text-area{height:auto;overflow:hidden;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.contained-popover-or-tooltip{--calcite-popover-max-size-x: 100%;--calcite-tooltip-max-size-x: 100%}.info-heading{font-size:var(--calcite-font-size-0);color:var(--calcite-color-text-1);margin:0}.info-heading-row{display:flex;align-items:center;gap:var(--calcite-spacing-sm);flex-wrap:wrap}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-button{font-weight:var(--calcite-font-weight-medium)}.suggestions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs);flex-wrap:wrap}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=heading] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}.contained{max-width:100%;max-height:100%;max-width:100cqi;max-height:75cqb;overflow-y:auto}.submission-notice{--calcite-notice-border-color: transparent;margin-block:0;width:100%;--calcite-font-size-relative-base: var(--calcite-font-size--2)}.border-block-end{border-block-end:1px solid var(--calcite-color-border-3)}.round-top{border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0}}:host([closed]){display:none}`,A=class extends Error{constructor({message:e,code:t,subCode:i,details:s,source:n}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=i,this.details=s,this.source=n}};function ge(a){if(!a)return;let e=a.indexOf('{"error":');if(e!==-1)try{let t=a.slice(e),i=JSON.parse(t);if(i&&typeof i=="object"&&i.error)return i.error}catch{return}}async function Fe(a){let{baseUrl:e,skillId:t,message:i,authToken:s,previousConversationId:n,context:c}=a,d=t?`${e}/skills/${t}/chat`:`${e}/chat`,r=[],o={message:i,context:c};n&&(o.conversation_id=n);let g;try{g=await ue(d,{method:"post",headers:{"Content-Type":"application/json",token:s},body:JSON.stringify(o),responseType:"json"})}catch(v){let $=v,C=$.details?.rawResponse||$.message||String(v),M=ge(C);throw M?new A(M):v}let l=g.data;r.push(l);let u=l.conversationId,m=l.inquiryId,h=l.sequenceNumber;async function f(){let v=0,$=100;for(;v<$;){await new Promise(E=>setTimeout(E,1e3));let C=De(u,h,m),M;try{M=await ue(d,{method:"post",headers:{"Content-Type":"application/json",token:s},body:JSON.stringify(C),responseType:"json"})}catch(E){let Y=E,Ie=Y.details?.rawResponse||Y.message||String(E),W=ge(Ie);throw W?new A(W):E}let x=M.data;if(x.context?.kind==="ArcgisErrorAsContext"&&x.context.error)throw new A({message:x.context.error.message||"ArcGIS Assistant error",code:x.context.error.code,subCode:x.context.error.subCode,details:x.context.error.details,source:"polling-response"});if(r.push(x),h=x.sequenceNumber,v++,!x.hasMore)break}if(v===$)throw new A({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let T=120*1e3;return await Promise.race([f(),new Promise((v,$)=>setTimeout(()=>$(new A({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),T))]),r}function De(a,e,t){return{conversationId:a,inquiryId:t,ackSequenceNumber:e}}function _e(a){return a.message.match(/Error in prompt shield/u)?"I'm having trouble with this request. Try again by rephrasing the question.":a.code==="TIMEOUT"?"Request timed out. Try again by re-asking the same question or rephrasing it.":a.message}var Ue=({notices:a})=>a.length?p`<div class="border-block-end">${B(a,e=>e.id??e.title,e=>p`<calcite-notice class="submission-notice" .icon=${e.icon} .kind=${e.kind} scale=s open .closable=${e.closable} @calciteNoticeClose=${()=>e.onClose?.()}><div slot=title>${e.title}</div>${e.message&&p`<div slot=message>${e.message}</div>`||""}${e.actionLinkMessage&&e.onAction&&p`<calcite-link slot=link @click=${()=>e.onAction?.()}>${e.actionLinkMessage}</calcite-link>`||""}</calcite-notice>`)}</div>`:null,Oe=a=>{let e=a.value.length,t=72,i=180,s=a.offsetWidth,n=Math.max(1,Math.floor(s/8)),c=Math.ceil(e/n),d=t+(c-2)*24;a.style.setProperty("--calcite-text-area-min-height",`${Math.min(d,i)}px`)},ze=({promptValidationMessage:a,errorMessage:e,contextTooBig:t,contextReducedNoticeDismissed:i,setContextReducedNoticeDismissed:s,setErrorMessage:n,messages:c})=>{let d=[];if(a&&d.push({id:"prompt-validation",kind:"danger",icon:"exclamation-mark-triangle",title:a,closable:!0}),e&&d.push({id:"assistant-error",kind:"danger",icon:"exclamation-mark-triangle",title:e,closable:!0,onClose:()=>n(void 0)}),t&&!i){let r=c.contextreduced??"Context reduced",o=c.contextreducedmessage??"The editor profile is too large for the assistant. It has been reduced in the assistant in order to ensure a successful request.";d.push({id:"context-reduced",kind:"warning",icon:"exclamation-mark-triangle",title:r,message:o,closable:!0,onClose:()=>s(!0)})}return d};function Le({messages:a}){return p`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${a.beta??"Beta"}>${a.beta??"Beta"}</calcite-chip>`}function Be({popoverContent:a,messages:e}){return p`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer .label=${e.legaldisclaimer??"Legal disclaimer"} placement=bottom auto-close focus-trap-disabled><div class="contained">${a}</div></calcite-popover>`}function Qe({errorMessage:a,slot:e}){return p`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??_}>${a}</calcite-input-message></div>`}function je({active:a,setActive:e,messages:t}){return p`<calcite-alert slot=alerts .open=${a} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${()=>e(!1)} .label=${t.expressionapplied??"Expression applied"}><div slot=message>${t.expressionapplied??"Expression applied to editor."}</div></calcite-alert>`}function He({context:a,messages:e}){return a?p`<div class="gaps">${a.profileId&&p`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>`||""}</div>`:null}function Ge({isDisabled:a,isReadOnly:e,setQuestion:t,setIsViewingResult:i,textAreaRef:s,question:n,errorMessage:c,setErrorMessage:d,promptValidationMessage:r,setPromptValidationMessage:o,submitQuestion:g,messages:l,mode:u,assistantRef:m,context:h,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T}){let v=h?.contextTooLarge??!1,$=ze({promptValidationMessage:r,errorMessage:c,contextTooBig:v,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T,setErrorMessage:d,messages:l});return p`<div class="text-area-wrapper">${Ue({notices:$})}<calcite-text-area scale=s resize=vertical .readOnly=${a||e} class=${se($.length?"submission-text-area":"submission-text-area round-top")} .placeholder=${l.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${C=>{Oe(C.target),t(C.target.value)}} ${ae(s)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${h&&He({context:h,messages:l})||""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${a} @click=${async()=>{i(!1),t("")}} .label=${l.startover??"Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${l.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${a} @click=${async()=>{i(!1),t("")}} class="hidden-below-380" scale=s>${l.startover??"Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} @click=${async()=>{if(d(""),!n){o(l.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-below-380">${u==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} id=small-submit-button @click=${async()=>{if(d(""),!n){o(l.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-above-380" .label=${u==="prompt"?l.ask??"Generate":l.refine??"Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${u==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`}var Je="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement",Ye="https://www.esri.com/en-us/privacy/privacy-statements";function We({setOpen:a,messages:e,feedback:t,learnMoreUrl:i,setFeedback:s,onSubmit:n}){return t.active?p`<calcite-sheet class="feedback-sheet" .label=${e.feedback??"Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${()=>a(!1)}><calcite-panel .heading=${e.submitfeedback??"Submit feedback to Esri"} scale=s><div class="feedback-content"><calcite-text-area scale=s resize=vertical .value=${t.text} @calciteTextAreaInput=${c=>s({...t,text:c.target.value})} .disabled=${t.submitting} .placeholder=${e.donotincludepersonalinfo??"Do not include personal or sensitive information"} rows=3></calcite-text-area><calcite-label layout=inline scale=s class="terms-label"><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${c=>{s({...t,termsAccepted:c.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${V((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Ye} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${Je} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${V((e.feedbackhelps??"Your feedback will be used to improve Esri products and services. {LearnMore} about how this data is used.").replace("{LearnMore}",`<calcite-link href=${i} target="_blank">${e.learnmore??"Learn more"}</calcite-link>`))}</span></calcite-notice></div><div slot=footer class="feedback-footer"><calcite-button kind=neutral appearance=outline @click=${()=>a(!1)} .disabled=${t.submitting}>${e.cancel??"Cancel"}</calcite-button><calcite-button @click=${n} .disabled=${!t.termsAccepted||t.submitting} .loading=${t.submitting} data-testid=submit-feedback-button>${e.submit??"Submit"}</calcite-button></div></calcite-panel></calcite-sheet>`:null}function be({assistantsEnabled:a,messages:e,slot:t,helpTopicUrl:i}){return p`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??_} expanded class="info-block" scale=s><div class="info-heading-row"><h1 class="info-heading">${e.introducing??"Introducing Arcade Assistant (beta)"}</h1><calcite-chip .label=${e.new??"New"} kind=brand scale=s>${e.new??"New"}</calcite-chip></div>${a?p`<p>${e.capabilities??"The assistant uses artificial intelligence to generate Arcade expressions."}</p><p>${e.keepinmind??"Keep in mind the following:"}<ul><li>${e.beconsise??"Be concise, but also clear in your request"}</li><li>${e.avoidambiguity??"Avoid ambiguity and vagueness"}</li><li>${e.moredetails??"you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${V((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${i} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:p`<p>${e.useofassistant??"The assistant uses artificial intelligence to generate Arcade expressions. To enable Arcade Assistant (beta), the following must be true:"}</p><ul><li>${e.enabledinorg??"AI assistants are enabled in the organization settings"}</li><li>${e.enabledbetaapps??"Beta apps and capabilities are not blocked"}</li><li>${e.enabledroleprivilege??"Your role privilege allows you to use AI assistants"}</li></ul>`}</calcite-block>`}function Ke({messages:a,onProceed:e,onExit:t,helpTopicUrl:i}){return p`<calcite-dialog close-disabled placement=top .heading=${a.welcome??"Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${a.beforeyougetstarted??"Before you get started be aware:"}</h3><ul><li>${a.maybeincorrect??"AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${V((a.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${i} target="_blank">${a.helptopic??"help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${a.proceed??"Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${a.exit??"Exit"}</calcite-button></calcite-dialog>`}function Xe({messages:a,suggestions:e,onSuggestionClick:t}){return p`<calcite-block .heading=${a.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map(i=>p`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${a.promptsuggestion} class="suggestion-button" @click=${()=>t?.(i)}>${i}</calcite-button>`)}</div></calcite-block>`}var fe=200;function ve({hidden:a=!1,expanded:e=!1,messages:t,cards:i,heading:s,collapsible:n=!1,showEffectsIcon:c=!1,onCopyCode:d,standalone:r}){return p`<calcite-block .hidden=${a} id=result-block .heading=${s??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${c&&p`<calcite-chip .label=${t.assistantresponses??"Assistant responses"} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>`||""}<calcite-card-group .label=${t.assistantresponses??"Assistant responses"}>${B(i,o=>o.conversationId,o=>p`<calcite-card><div slot=heading><div class="prior-prompt"><span>${o.priorPrompt.length>fe?`${o.priorPrompt.slice(0,fe)}...`:o.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${o.conversationId}-${r?"standalone":"list"}`} @click=${g=>{let l=g.currentTarget;navigator.clipboard.writeText(o.priorPrompt).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully??"copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully??"copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${o.message&&r&&p`<div class="response-error-container">${Qe({errorMessage:o.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${o.message&&!r&&p`<calcite-tooltip .referenceElement=${`response-chip-${o.conversationId}-error`} placement=top-start>${o.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${o.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${Ze({card:o,messages:t})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${o.code}</arcgis-code-viewer></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button class="add-to-editor-button hidden-above-380" @click=${()=>o.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>o.onAddToEditor("add")} scale=s icon-start=plus round>${t.addtoeditor??"Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${()=>o.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start><span>${t.replaceineditor??"Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${g=>{let l=g.currentTarget;d(o.code).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully??"copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully??"copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-response-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copytoclipboard??"Copy code to clipboard"}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup??"Thumbs up"} scale=s icon=thumbs-up @click=${o.onThumbsUp} .id=${`thumbs-up-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start><span>${t.helpful??"Helpful"}</span></calcite-tooltip><calcite-action .text=${t.thumbsdown??"Thumbs down"} scale=s icon=thumbs-down @click=${o.onThumbsDown} .id=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var Ze=({card:a,messages:e})=>{let t=X(),i=`response-chip-profile-${a.conversationId}-${t}`,s=(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId);return p`<calcite-tooltip .referenceElement=${i} placement=top-start class="contained-popover-or-tooltip">${s}</calcite-tooltip><calcite-chip .label=${a.profileId} scale=s appearance=outline icon=map-information id=${i??_}>${a.profileId}</calcite-chip>`},ye=a=>a.type==="featureSet";function Ae(a){return a&&a!=="dataCatalogDatastore"?a:void 0}var Q=a=>{if(!re(a))return[];let e=[];return a.relationships?.forEach(t=>{e.push(t.toJSON())}),e},j=a=>a.length>0?{relationships:a}:{},et=a=>de(a).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),H=a=>a?{fields:et(a)}:{fields:[]};async function we(a){let e=await a.loadSource(),t=O(e)&&e.isTable,i=Q(e);return{name:a.name,type:"featureSet",isTable:t,...H(e?.fields),...j(i)}}async function Ce(a){switch(a.type){case"feature":{let t=await a.loadSource(),i=Q(t);return{name:a.name,type:a.type,...H(t?.fields),...j(i)}}case"featureSet":{let t=await a.loadSource(),i=O(t)&&t.isTable;return{name:a.name,type:"featureSet",...i?{isTable:i}:{},...H(t?.fields),...j(Q(t))}}case"featureSetCollection":{let t=await a.loadSource(),i=t?.layers.filter(ye)??[],s=t?.tables.filter(ye)??[],n=await Promise.all(i.map(we)),c=await Promise.all(s.map(we));return{name:a.name,type:"featureSetCollection",layers:n,tables:c}}case"dictionary":{let t=await Promise.all(a.dictionaryVariables.filter(z).map(Ce));return{name:a.name,type:"dictionary",attributes:t}}case"pixel":{let t=await a.loadSource();if(!t)return{name:a.name,type:"pixel"};let i=await Ve(t);return{name:a.name,type:"pixel",members:i.map($e)}}case"voxel":{let t=await a.loadSource();if(!t)return{name:a.name,type:"voxel"};let i=await Re(t);return{name:a.name,type:"voxel",members:i.map($e)}}case"array":let e=Ae(a.elementType.type);return{name:a.name,type:"array",...e?{elementType:e}:{}};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:a.name,type:a.type}}}function $e(a){if(a.type==="array"){let e=Ae(a.elementType.type);return{name:a.name,type:"array",...e?{elementType:e}:{}}}return{name:a.name,type:a.type}}async function tt(a){return{variables:await Promise.all(a.variables.filter(z).map(Ce))}}var at=1e5;function it(a){let e=new TextEncoder().encode(a).length;return Math.ceil(e/3.5)}function G(a){return it(JSON.stringify(a))}function st(a){let e=i=>({name:i.name,type:i.type,...i.isTable?{isTable:i.isTable}:{},...i.relationships?{relationships:i.relationships}:{}}),t=i=>{switch(i.type){case"feature":case"featureSet":case"knowledgeGraph":return{name:i.name,type:i.type,..."isTable"in i&&i.isTable?{isTable:i.isTable}:{},..."relationships"in i?{relationships:i.relationships}:{}};case"featureSetCollection":return{name:i.name,type:"featureSetCollection",layers:i.layers.map(e),tables:i.tables.map(e)};case"dictionary":return{name:i.name,type:"dictionary",attributes:i.attributes.map(t)};case"pixel":case"voxel":return{name:i.name,type:i.type};case"array":return{name:i.name,type:"array",...i.elementType?{elementType:i.elementType}:{}};default:return i}};return{variables:a.variables.map(t)}}function ot(a){let e=a.variables,t=e.length,i=e.find(n=>n.name==="$feature")??e.find(n=>n.type==="feature")??e[0],s=i?[i]:[];return{context:{variables:s},wasReduced:t!==s.length,reducedToVariableName:i?.name}}function nt(a){return G(a)>at}var rt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,y=(a,e,t,i)=>{for(var s=i>1?void 0:i?ct(e,t):e,n=a.length-1,c;n>=0;n--)(c=a[n])&&(s=(i?c(e,t,s):c(s))||s);return i&&s&&rt(e,t,s),s},b=class extends Pe{constructor(a){super(a),this.viewMode="prompt",this.confirmationActive=!1,this.contextReducedNoticeDismissed=!1,this.splashActive=!0,this.isSubmitting=!1,this.question="",this.history=[],this.feedback={active:!1}}};y([w()],b.prototype,"viewMode",2);y([w()],b.prototype,"confirmationActive",2);y([w()],b.prototype,"contextReducedNoticeDismissed",2);y([w()],b.prototype,"splashActive",2);y([w()],b.prototype,"isSubmitting",2);y([w()],b.prototype,"errorMessage",2);y([w()],b.prototype,"promptValidationMessage",2);y([w()],b.prototype,"question",2);y([w()],b.prototype,"history",2);y([w()],b.prototype,"feedback",2);y([w()],b.prototype,"context",2);b=y([qe("ArcadeAssistantViewState")],b);var lt="arcade_generation",dt="ArcadeCodeRequest",xe="visualization",ke="ArcadeAssistant",pt=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras","conversation_id","privacy_statement"],Se=[],Te=!0,J=class extends ie{constructor(){super(...arguments),this.textAreaRef=te(),this.messages=ne(),this._feedbackService=void 0,this.viewState=new b,this.handleFeedbackButton=(e,t)=>{this.updateViewState({feedback:{active:!0,value:e,item:t,termsAccepted:!1,text:"",submitting:!1}})},this.handleFeedbackSheetClose=()=>{this.updateViewState({feedback:{active:!1}})},this.handleFeedbackSubmit=async()=>{if(!this.viewState.feedback.active)return;this.updateViewState({feedback:{...this.viewState.feedback,submitting:!0}});let e=await this.ensureFeedbackService();if(!e){this.handleFeedbackSheetClose();return}let t=!1,i;this.viewState.feedback.item.conversationId===this.viewState.history[0]?.conversationId&&this.viewState.viewMode==="result"?(i=this.viewState.context,t=!0):i=this.viewState.feedback.item.contextSnapshot;let s=me.applicationName;!s&&!this.appVersion&&k("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let{value:n,text:c,termsAccepted:d,item:{question:r,formattedScript:o,conversationId:g}}=this.viewState.feedback,l={user_evaluation:n,your_comments:c||void 0,question:r??"",answer:this.encodeAnswerForFeedback(o),useragent:navigator.userAgent,_source:ke,version:this.appVersion||s||"NOT_SET",context:i?JSON.stringify({...i,isSnapshot:!t}):"",extras:i?.profileId??"",conversation_id:g??"",privacy_statement:d?"I_agree":""};try{await e.applyEdits({addFeatures:[new he({attributes:l})]})}catch(u){k("error",this,"Error submitting feedback.",{detail:{error:u}})}this.handleFeedbackSheetClose()},this.handleClose=e=>{this.closed=!0,this.closePanel?.(e)},this.setQuestionState=e=>{this.updateViewState({question:e,promptValidationMessage:void 0})},this.setFeedbackState=e=>{this.updateViewState({feedback:e})},this.onSuggestionClick=e=>{this.textAreaRef.value&&(this.textAreaRef.value.value=e,this.textAreaRef.value.setFocus(),this.setQuestionState(e))},this.helpBase="",this.assistantsEnabled=!1,this.closed=!1,this.disableQuestionAnswerLogging=!1}static{this.properties={closePanel:0,insertText:0,helpBase:1,assistantsEnabled:5,portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1,disableQuestionAnswerLogging:5}}static{this.styles=Ne}get disclaimerComment(){return`// ${this.messages.disclaimercomment}
3
+ // ${this.messages.disclaimerpt2??"AI-generated content may be inaccurate. Review before using."}`}get assistantOverviewDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`}get usingTheAssitantDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`}async destroy(){}connectedCallback(){super.connectedCallback(),this.updateViewState({history:Se,splashActive:Te})}load(){let e=async()=>{let t=this.getModel();if(!t){this.updateViewState({context:void 0});return}let i=await this.getProfileAndMetadata(t.uri);this.updateViewState({context:i,contextReducedNoticeDismissed:i.contextTooLarge?!1:this.viewState.contextReducedNoticeDismissed})};e().catch(t=>{k("error",this,"Error setting initial context.",{detail:{error:t}})}),this.manager.onLifecycle(()=>{let t=L.onModelContextDidChange(async()=>{e().catch(i=>{k("error",this,"Error setting context.",{detail:{error:i}})})});return{remove:()=>{t.dispose()}}})}disconnectedCallback(){super.disconnectedCallback(),Se=this.viewState.history,Te=this.viewState.splashActive,this.copySuccessTimer&&(clearTimeout(this.copySuccessTimer),this.copySuccessTimer=void 0)}createFeedbackContextSnapshot(e){let t=st(e.metadata);return{...e,metadata:t,estimatedTokens:G(t)}}encodeAnswerForFeedback(e){return encodeURIComponent(e??"")}updateViewState(e){this.viewState.set(e)}getHistoryCards(){return this.viewState.history.reduce((e,t)=>(!t.script||(e.push({priorPrompt:t.question,code:t.formattedScript||t.error||"",profileId:t.profile??xe,onAddToEditor:i=>{ce(this.editorRef.editorInstance,t.formattedScript??"",i,this.disclaimerComment)},onThumbsUp:()=>this.handleFeedbackButton("good",t),onThumbsDown:()=>this.handleFeedbackButton("bad",t),conversationId:t.conversationId??"",message:t.message}),this.viewState.viewMode),e),[])}async ensureFeedbackService(){if(this._feedbackService)return this._feedbackService;if(!this.feedbackServiceUrl)return;let e=new Ee({url:this.feedbackServiceUrl});await e.load();let t=pt.filter(i=>!e.fields.some(s=>s.name===i));if(t.length>0){k("error",this,`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);return}return this._feedbackService=e,e}async logInteractionToFeedbackService(e){if(this.disableQuestionAnswerLogging||!e.question)return;let t;try{t=await this.ensureFeedbackService()}catch(c){k("error",this,"Error initializing feedback service for interaction logging.",{detail:{error:c}});return}if(!t)return;let i=me.applicationName,s=e.contextSnapshot,n={question:e.question,answer:this.encodeAnswerForFeedback(e.answer),useragent:navigator.userAgent,_source:ke,version:this.appVersion||i||"NOT_SET",context:s?JSON.stringify({...s,isSnapshot:!0}):"",extras:s?.profileId??"",conversation_id:e.conversationId??"",privacy_statement:""};try{await t.applyEdits({addFeatures:[new he({attributes:n})]})}catch(c){k("error",this,"Error logging arcade assistant question/answer interaction.",{detail:{error:c}})}}getModel(){return this.editorRef.editorInstance?.getModel()}async submitQuestion(){if(!this.viewState.question)return;let e=this.viewState.question;this.updateViewState({isSubmitting:!0,errorMessage:void 0});let t,i;try{let s=this.getModel();if(!s||!this.serviceUrl)return;let n=this.viewState.context??await this.getProfileAndMetadata(s.uri);t=this.createFeedbackContextSnapshot(n);let c=await this.getToken(),d=await Fe({baseUrl:this.serviceUrl,skillId:lt,message:e,authToken:c,context:{kind:dt,context:{profile_id:n.profileId,metadata:[n.metadata]}}});i=d?.[0]?.conversationId;let r=d.find(o=>o.context?.kind==="ArcadeCodeResponse");if(!r){await this.logInteractionToFeedbackService({question:e,answer:"No ArcadeCodeResponse returned.",contextSnapshot:t,conversationId:i});return}if(r.context?.kind==="ArcadeCodeResponse"){let o=this.createFeedbackContextSnapshot(n),g=le(r?.context?.arcadeCode?.code??"");this.updateViewState({history:[{script:r?.context?.arcadeCode?.code,formattedScript:g,error:void 0,question:e,profile:n.profileId,conversationId:r.conversationId,contextSnapshot:o,...r.message?{message:r.message}:{}},...this.viewState.history],viewMode:"result",errorMessage:void 0}),await this.logInteractionToFeedbackService({question:e,answer:g,contextSnapshot:t,conversationId:r.conversationId})}}catch(s){let n=s instanceof Error&&s.name==="ArcadeAssistantError"?_e(s)||this.messages.erroroccurred||"An error occurred.":this.messages.erroroccurred||"An error occurred.";this.updateViewState({errorMessage:n}),await this.logInteractionToFeedbackService({question:e,answer:n,contextSnapshot:t,conversationId:i}),k("error",this,"Error submitting question",{detail:{error:s}})}finally{this.updateViewState({isSubmitting:!1})}}async getToken(){let{token:e}=await Me.getCredential(this.portalUrl);return e}async getProfileAndMetadata(e){let t=xe,i=L.getEditorProfileForModel(e);i?.loaded||await i?.loadSource();let s=this.editorRef.profile;s&&"id"in s&&(t=s.id);let n=i?await tt(i):{variables:[]},c=nt(n),d=c?ot(n):void 0,r=d?d.context:n,o=G(r);return{profileId:t,metadata:r,contextTooLarge:c,reducedToVariableName:d?.reducedToVariableName,estimatedTokens:o}}onCopyCode(e){let t=e?`${this.disclaimerComment}
4
+ ${e}`:"";return navigator.clipboard.writeText(t)}render(){if(this.closed)return null;let e=this.viewState.viewMode==="result",t=this.getHistoryCards();return this.assistantsEnabled?p`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.viewState.splashActive&&p`<calcite-scrim></calcite-scrim>`||""}${Le({messages:this.messages})}${Be({messages:this.messages,popoverContent:be({assistantsEnabled:this.assistantsEnabled,messages:this.messages,helpTopicUrl:this.usingTheAssitantDocUrl})})}<calcite-shell class="unstyled-shell">${this.viewState.splashActive&&Ke({messages:this.messages,onProceed:()=>{this.updateViewState({splashActive:!1})},helpTopicUrl:this.assistantOverviewDocUrl,onExit:i=>this.closePanel?.(i)})||""}${je({active:this.viewState.confirmationActive,setActive:i=>this.updateViewState({confirmationActive:i}),messages:this.messages})}${Ge({isDisabled:this.viewState.isSubmitting,isReadOnly:!1,setQuestion:this.setQuestionState,setIsViewingResult:i=>this.updateViewState({viewMode:i?"result":"prompt"}),mode:e?"refine":"prompt",textAreaRef:this.textAreaRef,question:this.viewState.question,errorMessage:this.viewState.errorMessage,setErrorMessage:i=>this.updateViewState({errorMessage:i}),promptValidationMessage:this.viewState.promptValidationMessage,setPromptValidationMessage:i=>this.updateViewState({promptValidationMessage:i}),submitQuestion:this.submitQuestion.bind(this),assistantRef:this.el,messages:this.messages,context:this.viewState.context,contextReducedNoticeDismissed:this.viewState.contextReducedNoticeDismissed,setContextReducedNoticeDismissed:i=>this.updateViewState({contextReducedNoticeDismissed:i})})}<calcite-block-group .label=${this.messages.interactiveblocks??"interactive blocks"}>${!e&&!this.viewState.isSubmitting&&Xe({messages:this.messages,suggestions:[this.messages.prompsuggestion1??"",this.messages.prompsuggestion2??""],onSuggestionClick:this.onSuggestionClick})||""}<calcite-block .hidden=${!this.viewState.isSubmitting} .heading=${this.messages.generatingresponse??"Generating response..."}></calcite-block>${ve({expanded:e,messages:this.messages,collapsible:!0,showEffectsIcon:!0,cards:t.length?[t[0]]:[],heading:this.messages.besteffort??"Here's the assistant's best effort",hidden:this.viewState.isSubmitting||!e,onCopyCode:this.onCopyCode.bind(this),standalone:!0})}${ve({expanded:!e,messages:this.messages,collapsible:!0,cards:e?t.slice(1):t,heading:this.messages.recentprompts??"Recent prompts",hidden:this.viewState.isSubmitting||this.viewState.history.length===0,onCopyCode:this.onCopyCode.bind(this)})}</calcite-block-group>${this.viewState.feedback.active?We({setOpen:this.handleFeedbackSheetClose,messages:this.messages,onSubmit:this.handleFeedbackSubmit,feedback:this.viewState.feedback,setFeedback:this.setFeedbackState,learnMoreUrl:this.assistantOverviewDocUrl}):null}</calcite-shell></calcite-flow-item></calcite-flow>`:p`<calcite-flow><calcite-flow-item .selected=${!e} closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${be({slot:"content-top",messages:this.messages,assistantsEnabled:this.assistantsEnabled,helpTopicUrl:this.usingTheAssitantDocUrl})}</calcite-flow-item></calcite-flow>`}};oe("arcgis-arcade-coding-assistant",J);return J},"identity/IdentityManager","request","layers/FeatureLayer","config","Graphic","applications/Components/arcadeEditorUtils","core/Accessor","core/accessorSupport/decorators",a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{Ok as i,aj as l}from"./NG7S6FUK.js";export default $arcgis.t(([d])=>{function m(){return!!window.MonacoEnvironment?.getWorker}var c="",f=new Map,u=!1;async function p(t,r,e){if(e)return r?r():new Worker(t);let s=window.location.origin;if(new URL(t,window.location.href).origin!==s){let o=await d(t,{responseType:"text"});return new Worker(URL.createObjectURL(new Blob([o.data],{type:"text/javascript"})),{type:"module"})}return new Worker(t,{type:"module"})}function E(t){if(m())return;g(),c=t;let r=`${c}/code-editor`,e={arcade:`${r}/arcade.worker.js`,"arcgis-sql-expression":`${r}/sql-expr.worker.js`,"sql-layer-sql-server":`${r}/sql-layer.worker.js`,"sql-layer-postgres":`${r}/sql-layer.worker.js`,"sql-layer-bigquery":`${r}/sql-layer.worker.js`,html:`${r}/html.worker.js`,css:`${r}/css.worker.js`,typescript:`${r}/ts.worker.js`,json:`${r}/json.worker.js`,default:`${r}/editor.worker.js`},s={arcade:{url:e.arcade},"arcgis-sql-expression":{url:e["arcgis-sql-expression"]},"sql-layer-sql-server":{url:e["sql-layer-sql-server"]},"sql-layer-postgres":{url:e["sql-layer-postgres"]},"sql-layer-bigquery":{url:e["sql-layer-bigquery"]},html:{url:e.html},css:{url:e.css},typescript:{url:e.typescript},javascript:{url:e.typescript},json:{url:e.json},default:{url:e.default}};window.MonacoEnvironment={getWorker:async(o,a)=>{let n=f.get(a);if(n)return await p(n,void 0,u);let{url:y,localWorker:q}=s[a]||s.default;return await p(y,q,u)}}}var w=!1;function g(){w||(i.get(l),w=!0)}async function L(){return(await j()).getArcadeDiagnosticService()}async function j(){return await import("./XEUCI6KC.js")}return{a:E,b:L,c:j}},"request")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import d from"./XU4GWM7C.js";import c from"./ZCXZTSQU.js";import b from"./W2PBO44R.js";import a from"./ZHZFKZA7.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import"./OZ65S2RS.js";import"./NKCYMRE4.js";import"./BQLG62QR.js";import"./FUBRHCFC.js";import"./UYBZWFE5.js";import"./4BNI5KJQ.js";import"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,{a:a,b:b,c:c}])=>{return{getSqlExprDiagnosticService:b,getSqlExprWorker:a,setupMode:c}},a,b,c,d)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{b as E}from"./CZ2DJPO4.js";import f from"./6E4U2MLJ.js";import{a as m}from"./WNKEPEXN.js";import"./57WNN7NN.js";import e from"./W2PBO44R.js";import b from"./ZHZFKZA7.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import"./OZ65S2RS.js";import"./NKCYMRE4.js";import"./BQLG62QR.js";import"./FUBRHCFC.js";import"./UYBZWFE5.js";import{D as n,E as c,F as h,G as p,J as g,h as d,j as s,n as a,s as l}from"./4BNI5KJQ.js";import{b as t}from"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,,,,,{E:_},{c:o},{a:b,b:u,c:f,d:v}])=>{var S=d`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,r=class extends h{constructor(){super(...arguments),this._codeEditorElt=n(),this._disposables=[],this._modelId=l(),this.messages=m(),this._preparing=!1,this._resolvedLanguage=o,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.openedSidePanel="none",this.arcgisDiagnosticsChange=a({bubbles:!1}),this.arcgisScriptChange=a({bubbles:!1})}static{this.properties={_editorProfile:16,_preparing:16,_resolvedLanguage:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5,messageOverrides:0,openedSidePanel:3}}static{this.styles=[S]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateDataModelDeps().catch(t(this))}willUpdate(e){e.has("profile")&&this._updateDataModelDeps().catch(t(this))}async loaded(){let e=E();this._disposables.push(e.onDiagnosticsChange(i=>{i.uri.toString()===this._modelId&&!this._preparing&&this.arcgisDiagnosticsChange.emit(i.diagnostics)}))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose();v().forEach(e=>e.disposeForModel(this._modelId))}async _updateDataModelDeps(){this._preparing=!0;try{let e=await b(this.profile);e!==this._resolvedLanguage&&(f(this._resolvedLanguage)?.disposeForModel(this._modelId),this._resolvedLanguage=e);let i=u(this._resolvedLanguage);await i.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=i.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0,this._resolvedLanguage=o}finally{this._preparing=!1}}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_toggleSidePanel(e){this.openedSidePanel=this.openedSidePanel===e?"none":e,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(t(this))}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsText(e){this._codeEditorElt.value?.insertText(e.detail).catch(t(this))}_getTablesVariable(){return this._editorProfile?.variables.find(_)}render(){let e=this._getTablesVariable();return s`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${c(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&s`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables??"Tables"} .messageOverrides=${{profileempty:this.messages.profileempty}} .closed=${this.openedSidePanel!=="variables"} class=${p(this.openedSidePanel==="variables"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>{this.openedSidePanel="none"}} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables??"Tables"} icon=table .active=${this.openedSidePanel==="variables"} data-panel-name=variables @click=${()=>this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded&&s`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables??"Tables"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-layer-editor",r);return r},"portal/PortalItem","WebMap","WebScene","layers/FeatureLayer","applications/Components/arcadeEditorUtils","core/Error","portal/Portal",b,e,f)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as v}from"./WNKEPEXN.js";import"./57WNN7NN.js";import a from"./ZHZFKZA7.js";import{c as u,e as p}from"./FUBRHCFC.js";import{E as f,F as g,J as b,h as d,j as i,n as r,q as m}from"./4BNI5KJQ.js";import{a as h}from"./BCUUVBXH.js";import"./3TTFCHAA.js";export default $arcgis.t(([{C:o,D:n,E:_,F:w}])=>{var $=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}}`;function I(l){l.key==="Enter"&&l.stopPropagation()}var c=class extends g{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=v(),this._filterValue="",this._flowItemRenderers=[],this._rootPresentation="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=r({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=r({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_rootPresentation:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0,heading:1,messageOverrides:0}}static{this.styles=$}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||o(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)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(o(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.messages.fields??"Fields":this.messages.profilevariables??"Profile variables"}_getDescriptionForCollection(e){return e?n(e)?e.variables[0]?.getLabel()??"":_(e)?e.datastoreInfo?.name??e.getDescription()??"":e.breadcrumb:""}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let a=this.loading;return!a&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{h("error",this,"Error loading collection"),a=!1}),a=!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><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>${a?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>`}</calcite-flow-item>`}renderEditorVariables(e){let t=m(this._filterValue),s=e.variables.filter(a=>a.passFilter(t));return s.length?s.map(a=>this.renderEditorVariable(a)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){switch(e.type){case"group":return this._isRootPresentation("featureSetRoot")&&e.isHeader?i`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>`:this._isRootPresentation("featureSetRoot")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${e.getLabel()}>${this.renderEditorVariables(e)}</calcite-list-item-group>`;default:return i`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @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=${I}></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)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as v}from"./N2YCVDWS.js";import{b,c as r,d as _}from"./WTNM2NCZ.js";import{a as p}from"./4A2CLADY.js";import"./RJRCBNNO.js";import{a as f}from"./OZ65S2RS.js";import"./NKCYMRE4.js";import"./BQLG62QR.js";import{d as h,e as m}from"./UZJHWA6T.js";import"./UYBZWFE5.js";import{E as c,F as d,J as u,h as g,j as s,l,n as a}from"./4BNI5KJQ.js";import"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=g`: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-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,n=class extends d{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=p(),this._colorizeStyle="",this._filterValue="",this.closed=!1,this.arcgisInternalClosePanel=a({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=a({bubbles:!1,composed:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0,closed:5}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{m(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget?.value??""}_emitItemSelected(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisInternalClosePanel.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code,"arcade")}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=f(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??l}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??l}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??l} ${c(h)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${c(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return this.closed?null:s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input><calcite-list .label=${this.messages.suggestions??"Suggestions"}>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};u("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
2
+ import{b,c as r,d as _}from"./2XTHR2WZ.js";import{a as v}from"./N2YCVDWS.js";import{a as p}from"./WNKEPEXN.js";import"./57WNN7NN.js";import{a as f}from"./OZ65S2RS.js";import"./NKCYMRE4.js";import"./BQLG62QR.js";import{e as h,f as m}from"./FUBRHCFC.js";import"./UYBZWFE5.js";import{E as c,F as d,J as u,h as g,j as s,l,n as a}from"./4BNI5KJQ.js";import"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=g`: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-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,n=class extends d{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=p(),this._colorizeStyle="",this._filterValue="",this.closed=!1,this.arcgisInternalClosePanel=a({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=a({bubbles:!1,composed:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0,closed:5}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{m(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget?.value??""}_emitItemSelected(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisInternalClosePanel.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code,"arcade")}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=f(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??l}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??l}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??l} ${c(h)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${c(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return this.closed?null:s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input><calcite-list .label=${this.messages.suggestions??"Suggestions"}>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};u("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"./3TTFCHAA.js";var E={id:"postgres",keywords:["ALL","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","ASYMMETRIC","AUTHORIZATION","BETWEEN","BINARY","BOTH","CASE","CAST","CHECK","COLLATE","COLLATION","COLUMN","CONCURRENTLY","CONSTRAINT","CREATE","CROSS","CURRENT_CATALOG","CURRENT_DATE","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","DEFAULT","DEFERRABLE","DESC","DISTINCT","DO","ELSE","END","EXCEPT","FALSE","FETCH","FOR","FOREIGN","FREEZE","FROM","FULL","GRANT","GROUP","HAVING","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LATERAL","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","NATURAL","NEW","NOT","NOTNULL","NULL","OFF","OFFSET","OLD","ON","ONLY","OR","ORDER","OUTER","OVER","OVERLAPS","PLACING","PRIMARY","REFERENCES","RETURNING","RIGHT","SELECT","SESSION_USER","SIMILAR","SOME","SYMMETRIC","TABLE","THEN","TO","TRAILING","TRUE","UNION","UNIQUE","USER","USING","VARIADIC","VERBOSE","WHEN","WHERE","WINDOW","WITH","CMAX","CMIN","CTID","TABLEOID","XMAX","XMIN"],functions:["UPPER","LOWER","CONCAT","ASCII","CHAR_LENGTH","OCTET_LENGTH","CHR","LTRIM","RTRIM","SUBSTRING","SOUNDEX","REPLACE","TRIM","CEILING","FLOOR","ROUND","LN","LOG","MOD","POWER","SIGN","TRUNC","ASIN","ACOS","ATAN","TO_HEX","SIN","COS","TAN","EXTRACT","BIT_LENGTH","POSITION","ABS","VARIANCE","STDDEV","AVG","COUNT","MAX","MIN","SUM","COALESCE","CONVERT","CAST","CURRENT_USER","CURRENT_TIME","CURRENT_DATE","CURRENT_TIMESTAMP","STDDEV_POP","STDDEV_SAMP","VAR_POP","VAR_SAMP","NULLIF","PERCENTILE_CONT","PERCENTILE_DISC","CUME_DIST","FIRST_VALUE","LAST_VALUE","LEAD","LAG","PERCENT_RANK","RANK","NTILE","DENSE_RANK","ROW_NUMBER","STRING_AGG","GROUPING SETS","CUBE","ROLLUP","REGR_INTERCEPT","REGR_R2","REGR_SLOPE"],operators:["||"],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:"'",end:null},escapeClause:{keyword:"ESCAPE",suffix:""}}};export{E as postgresDialect};
@@ -0,0 +1,12 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import a from"./ZHZFKZA7.js";import{a as R,b as Se,c as k,d as b,e as g}from"./IFNCCZ7O.js";import{b as De}from"./OZ65S2RS.js";import{a as ve}from"./NKCYMRE4.js";import{b as P,c as M,d as $,e as we}from"./BQLG62QR.js";import{j as ae}from"./FUBRHCFC.js";import{K as se,r as re,t as A}from"./4BNI5KJQ.js";import{a as c}from"./BCUUVBXH.js";import{Qk as G,Zk as W}from"./NG7S6FUK.js";export default $arcgis.t(([Ee,Ae,Le,B,{getDeclaredVoxelMembers:Ue,getDeclaredPixelMembers:Ne},qe,Oe,{A:q,B:y,F:be,H:O,I:ge,a:L,b:ne,c:oe,d:le,e:pe,k:U,l:T,m:ce,o:u,p:he,q:ue,r:x,s:N,t:m,u:de,v:fe,w:_e,y:me,z:ye}])=>{var w=s=>s!==void 0,_=s=>s!==null;function Re(s){switch(s){case"esriFieldTypeOID":return"oid";case"esriFieldTypeSmallInteger":return"small-integer";case"esriFieldTypeInteger":return"integer";case"esriFieldTypeBigInteger":return"big-integer";case"esriFieldTypeSingle":return"single";case"esriFieldTypeDouble":return"double";case"esriFieldTypeDate":return"date";case"esriFieldTypeDateOnly":return"date-only";case"esriFieldTypeTimeOnly":return"time-only";case"esriFieldTypeTimestampOffset":return"timestamp-offset";case"esriFieldTypeGUID":return"guid";case"esriFieldTypeGlobalID":return"global-id";case"esriFieldTypeString":return"string";case"esriFieldTypeGeometry":return"geometry";case"esriFieldTypeBlob":return"blob";case"esriFieldTypeRaster":return"raster";case"esriFieldTypeXML":return"xml";default:return"string"}}function ke(s){return{fields:s.fields.map(e=>({name:e.name,type:Re(e.type),serverType:e.type,nullable:e.nullable}))}}function Ce(s){return typeof s?.query=="object"&&s.query?s.query:{}}var H=class{constructor(e){this.itemId=e.itemId,this.portal=e.portal,this.serviceUrl=e.serviceUrl,this._requestOptions=e.requestOptions}fetchInfo(e){return this.portal.request(this._datastoreUrl,this._createRequestOptions(e))}async fetchDatasets(e){return(await this.portal.request(z(this._datastoreUrl,"datasets"),this._createRequestOptions(e))).datasets}async fetchTableDescription(e,t){if(!e)throw new qe("portal:invalid-parameter",'The "tableName" parameter must be provided.');let i=await this.portal.request(z(this._datastoreUrl,"tableDescription"),{...this._createRequestOptions(t),query:{...Ce(this._requestOptions),...Ce(t),tableName:e}});return ke(i)}get _datastoreUrl(){return z(this.serviceUrl,"datastores",encodeURIComponent(this.itemId))}_createRequestOptions(e){return{...this._requestOptions,...e}}};function z(s,...e){let t=s.replaceAll(/\/+$/gu,""),i=e.filter(r=>!!r).map(r=>r.replaceAll(/^\/+|\/+$/gu,""));return[t,...i].join("/")}var Ge={id:"ansi",keywords:[],functions:[],operators:[],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:null,end:null},escapeClause:{keyword:"ESCAPE",suffix:null}}},Fe=new Map,We={ansi:async()=>await Promise.resolve(Ge),bigquery:async()=>(await import("./FLNLMLTL.js")).bigqueryDialect,postgres:async()=>(await import("./VPP77CFW.js")).postgresDialect,sqlServer:async()=>(await import("./DGFH2WPL.js")).sqlServerDialect};async function ze(s){let e=Fe.get(s);if(e)return await e;let t=We[s]();return Fe.set(s,t),await t}var Be=["SELECT","FROM","WHERE","GROUP","BY","HAVING","ORDER","LIMIT","DISTINCT","AS","JOIN","LEFT","RIGHT","FULL","INNER","OUTER","CROSS","ON","USING","AND","OR","NOT","IN","IS","LIKE","BETWEEN","NULL","TRUE","FALSE","ASC","DESC"],He=["<=",">=","<>","!=","=","<",">","+","-","*","/","%","||"],Ke=(s,e={})=>{let t=new Set(e.baseKeywords??Be);for(let r of s.keywords)t.add(r.toUpperCase());let i=new Set(e.baseOperators??He);for(let r of s.operators)i.add(r);return{keywords:Array.from(t),functions:s.functions,operators:Array.from(i),specialChars:s.specialChars}},D={sqlServer:"sql-layer-sql-server",postgres:"sql-layer-postgres",bigquery:"sql-layer-bigquery"},Ie=D.postgres,je={[D.sqlServer]:"sqlServer",[D.postgres]:"postgres",[D.bigquery]:"bigquery"};function Qe(s){return je[s]}async function Je(s){return Ke(await ze(Qe(s)))}var Ze=/^[A-Za-z_][A-Za-z0-9_$]*$/u;function Xe(s){return s==="esriDBMS_PostgreSQL"?Ie:s==="esriDBMS_SQLServer"?D.sqlServer:Ie}function It(s){return s.trim().toLowerCase()}function Ye(s){return s.specialChars.identifierQuote}function et(s,e){let t=s.trim();return t?Ze.test(t)?e.keywords.includes(t.toUpperCase()):!0:!1}function $e(s,e){let t=s.trim();if(!t||!et(t,e))return t;let i=Ye(e),r=t.replaceAll(i.end,`${i.end}${i.end}`);return`${i.start}${r}${i.end}`}function tt(s,e){return s.split(".").map(t=>$e(t,e)).join(".")}function Tt(s){return s.split(".").at(-1)??s}function it(s){return Je(Xe(s))}async function rt(s,e){let t=new B({url:`${s.url}/${e.relatedTableId}`});return await t.load(),t}function ee(s){return(e,t)=>{if(e.type==="oid")return-1;if(t.type==="oid")return 1;if(m(s)){if(e.name===s.subtypeField)return-1;if(t.name===s.subtypeField)return 1}if(x(s)){if(e.name===s.typeIdField)return-1;if(t.name===s.typeIdField)return 1}return e.name.localeCompare(t.name,"en",{sensitivity:"base"})}}function Te(s,e){return s?.every(t=>t.domains?.[e.name]?.type==="inherited")??!1}var st=/^[a-z_$][a-z0-9_$]*$/giu;function te(s,e=!0){return s.match(st)?`${e?".":""}${s}`:`["${s}"]`}function Ve(s,e){return s?`${s}${te(e)}`:e}function xe(s){return fe(s)?s.portalItem:null}function xt(s,e,t=!1){let i=e,r=[],n=[];return b(s).forEach(a=>{i&&(i+=`
3
+
4
+ `),i+=`**${a.name}** (${a.alias})
5
+ ${a.type}`,a.description&&(i+=`
6
+ '${a.description}`);let f=k(a),h=te(a.name,!1),p=g(a);if(r.push({name:a.name,description:p,type:f,completion:{label:a.name,detail:p,insertText:h,insertTextMode:$.asIs,insertTextFormat:M.PlainText,kind:P.Field}}),t){if(!a.alias||a.alias.toLowerCase()===a.name.toLowerCase())return;let I=`**${a.alias}**
7
+ ${a.type}`;a.description&&(I+=`
8
+ '${a.description}`),n.push({name:a.alias,description:a.name,type:f,completion:{label:a.alias,detail:a.name,insertText:h,insertTextMode:$.asIs,insertTextFormat:M.PlainText,kind:P.Field,documentation:{kind:"markdown",value:I}}})}}),[[...r,...n],i]}function Pt(s,e){let t=e,i=[];return s.forEach(r=>{t&&(t+=`
9
+
10
+ `),t+=`**${r.name}**
11
+ ${r.type}`,r.name&&(t+=`
12
+ '${r.name}`),i.push({name:r.name,description:r.name,type:"array",completion:{label:r.name,detail:r.name,insertText:te(r.name,!1),insertTextMode:$.asIs,insertTextFormat:M.PlainText,kind:P.Field}})}),[i,t]}var V=class{constructor(e,t,i){this._profile=e,this._label=t,this.description=i,this.filterDescription=!1}getLabel(){return this._label==null?"":typeof this._label=="string"?re(this._label):A(this._profile?.intlStrings[this._label.code],this._label.formatValues)}getDescription(){return this.description==null?"":typeof this.description=="string"?this.description:A(this._profile?.intlStrings[this.description.code],this.description.formatValues)}passFilter(e){return!e||e.test(this.getLabel())?!0:this.filterDescription&&e.test(this.getDescription())}},S=class extends V{constructor(e){super(e.profile,e.label,e.description??e.declaration?.description),this.declaration=e.declaration??{},this.name=e.declaration?.name??"",this.snippet=e.snippet??"",this.nonInteractive=e.nonInteractive??!1,this.filterDescription=e.filterDescription??!1,this.icon=e.icon}},o=class extends S{constructor(e){super(e),this.type="text",this.isCollection=!1,this.type=e.declaration?.type??"text"}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},K=class extends S{constructor(e){super(e),this.type="array",this.isCollection=!1,this.elementType=e.declaration?.elementType??{type:"number",name:"number"}}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,elementType:this.elementType,name:"",...this.declaration}}},d=class extends S{constructor(e,t){super(t),this.owner=e,this.isCollection=!0,this._loaded=!0,this.variables=[]}get breadcrumb(){if(this.owner){let e=this.owner.breadcrumb;return e?`${e} / ${this.name}`:this.name}return this.name}get loaded(){return this._loaded}get informationUrl(){return null}get informationType(){return""}},l=class extends V{constructor(e,t,i=[],r=!1){super(e,t),this.variables=i,this.isHeader=r,this.type="group",this.isCollection=!0}passFilter(){return!0}},v=class s extends d{constructor(e,t){super(e,t),this.type="dictionary",this.dictionaryVariables=[],this.loadPropertyDeclarations(t.declaration?.properties),this.snippet&&this.dictionaryVariables.length&&(this.variables=[new l(this._profile,this.snippet,this.dictionaryVariables)])}async loadSource(){}loadPropertyDeclarations(e){this.dictionaryVariables=this.createVariableInstances(e),this.variables=this.dictionaryVariables}createVariableInstances(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(i=>{let r=this.createVariableInstance(i);r&&t.push(r)}),t}createVariableInstance(e){let t=Ve(this.snippet,e.name);switch(e.type){case"number":case"text":case"boolean":case"date":case"dateOnly":case"time":case"geometry":case"knowledgeGraph":return new o({profile:this._profile,declaration:e,label:t,snippet:t});case"pixel":return new J(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"voxel":return new Q(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"feature":return new j(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"featureSet":return new F(this,{profile:this._profile,declaration:e,label:t,snippet:t},[new o({profile:this._profile,label:t,description:"",snippet:t})]);case"featureSetCollection":return new Z(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"dictionary":return new s(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"array":return new K({profile:this._profile,declaration:e,label:t,snippet:t});case"dataCatalogDatastore":return new X(this,{profile:this._profile,declaration:e,label:t,snippet:t});default:return c("error","Editor profile","Invalid profile variable",{detail:{declaration:e}}),null}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,properties:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},E=class extends d{constructor(e,t,i){super(e,t),this.relationshipsProperties=i,this._source=null,this._loaded=!1,this._definition=t.declaration?.definition}get title(){return u(this._source)?this._source.title??"":""}get url(){return he(this._source)?this._source.url??"":""}get informationUrl(){return!this.loaded||!this.url?null:ue(this._source)?`${this.url}/${this._source.layerId}`:this.url}get informationType(){return this._profile?.intlStrings.layer??"layer"}async loadSource(){return _(this._loadPromise)&&w(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}_getValueSnippet(e){return["feature","voxel","pixel"].includes(this.type)?Ve(this.snippet,e.name):e.name}_getSubtypeOrDomainNameSnippet(e){return this.type!=="feature"?null:m(this._source)&&e.name===this._source.subtypeField?`SubtypeName(${this.snippet})`:`DomainName(${this.snippet}, "${e.name}")`}_getFieldProperty(e,t){let i=this._getDomainDictionary(e);if(i)return i;let r=this._getValueSnippet(e);return new o({profile:this._profile,label:r,description:g(e),snippet:r,icon:R(e,t),filterDescription:!0})}_getMemberProperty(e){let t=this._getValueSnippet(e);return new o({profile:this._profile,label:t,description:e.name,snippet:t,icon:Se(e),filterDescription:!0})}_getDomainDictionary(e){return N(this._source)?m(this._source)&&this._source.subtypeField?this._getSubtypeDomainDictionary(e):x(this._source)&&this._source.typeIdField?this._getFeatureTypeDomainDictionary(e):this._getFieldDomainDictionary(e):null}_getSubtypeDomainDictionary(e){if(!m(this._source))return null;if(!de(this._source))return e.name===this._source.subtypeField?null:this._getFieldDomainDictionary(e);if(e.name===this._source.subtypeField){let r=this._createDomainDictionary(e);return r.icon="subtype",r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes,e)),r}if(Te(this._source.subtypes,e))return this._getFieldDomainDictionary(e);let t=this._getDomainValuesGroup(this._source.subtypes,e);if(!t)return null;let i=this._createDomainDictionary(e);return i.variables.push(t),i}_getFeatureTypeDomainDictionary(e){if(!x(this._source))return null;if(e.name===this._source.typeIdField){let r=this._createDomainDictionary(e);return r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types,e)),r}if(Te(this._source.types,e))return this._getFieldDomainDictionary(e);let t=this._getDomainValuesGroup(this._source.types,e);if(!t)return null;let i=this._createDomainDictionary(e);return i.variables.push(t),i}_getFieldDomainDictionary(e){if(!N(this._source))return null;let t=this._source.getFieldDomain(e.name);if(!T(t))return null;let i=this._getCodedValueDomainGroup(t,{code:"domainvalues"}),r=this._createDomainDictionary(e);return r.variables.push(i),r}_getTypeOrSubtypeDomainGroup(e,t){if(T(t.domain))return this._getCodedValueDomainGroup(t.domain,{code:"subtypes"});let i=e?.map(r=>{let n=U(r)?r.code:r.id;return new o({profile:this._profile,label:`${n}`,description:r.name,snippet:`"${n}"`})})??[];return new l(this._profile,{code:"subtypes"},i)}_getCodedValueDomainGroup(e,t){let i=e.codedValues.map(r=>new o({profile:this._profile,label:`${r.code}`,description:r.name,snippet:`"${r.code}"`,filterDescription:!0}));return new l(this._profile,t,i)}_getDomainValuesGroup(e,t){let i=[];return!e||e.length===0||(e.forEach(r=>{let n=r.domains?.[t.name];if(!n||ce(n)||!T(n))return;let a=g(t),f=this._getCodedValueDomainGroup(n,{code:"domainvaluesfortypeformat",formatValues:{fieldName:a,typeName:r.name}}),h=U(r)?r.code:r.id,p=`${h}`,I=`"${h}""`,ie=new v(this,{profile:this._profile,label:p,snippet:I,description:r.name,declaration:{name:a}});ie.variables=[f],i.push(ie)}),!i.length)?null:new l(this._profile,{code:"domainvaluesbysubtypes"},i)}_createDomainDictionary(e){let t=this._getValueSnippet(e),i=g(e),r=new v(this,{profile:this._profile,label:t,description:i,snippet:t,icon:"form-dropdown",declaration:{name:e.name}}),n=new l(this._profile,i,[new o({profile:this._profile,label:t,description:"",snippet:t})]);r.variables=[n];let a=this._getSubtypeOrDomainNameSnippet(e);return a&&n.variables.push(new o({profile:this._profile,label:a,description:"",snippet:a})),r}async _getRelationshipsProperty(){if(!this.relationshipsProperties?.exposeRelationships||!this._profile?.supportFeatureSetFunctions)return null;let e=this._source;if(!_e(e))return null;let t=new l(this._profile,{code:"relationships"}),i=await Promise.all(e.relationships?.map(async r=>{let n=await rt(e,r);if(!L(n)||r.relatedTableId===this.relationshipsProperties?.sourceTableId)return null;let a=`FeatureSetByRelationshipName(${this.snippet}, "${r.name}")`;return new F(this,{profile:this._profile,declaration:{definition:n},label:n.title,description:"",nonInteractive:!0},[new o({profile:this._profile,label:a,description:"",snippet:a})],{exposeRelationships:!0,sourceTableId:e.layerId})})??[]);return t.variables=i.filter(_),t.variables.length?t:null}},C=class extends E{constructor(e,t,i,r={exposeRelationships:!0}){super(e,t,r),this.type=i}get title(){return u(this._source)?this._source.title??"":{code:this.type}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},j=class extends C{constructor(e,t){super(e,t,"feature",{exposeRelationships:!0}),this.type="feature"}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await O(this._definition),!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new l(this._profile,e,[new o({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new l(this._profile,{code:"values"});if(this.variables.push(t),me(this._source)){let n=`Geometry(${this.snippet})`,a=new o({profile:this._profile,declaration:{name:n},label:n,description:"Geometry",snippet:n,icon:"shapes",filterDescription:!0});t.variables.push(a)}let i=this._source;b(this._source.fields).map(n=>i.fields.find(a=>a.name===n.name)).sort(ee(i)).forEach(n=>{t.variables.push(this._getFieldProperty(n))});let r=await this._getRelationshipsProperty();r&&this.variables.push(r)}catch(e){c("error","FeatureVariable","Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},Q=class extends C{constructor(e,t){super(e,t,"voxel",{exposeRelationships:!1}),this.type="voxel",this._source=null}async _loadSource(){if(this.loaded)return this._source;try{if(!ye(this._definition))throw new Error("Invalid definition - not a VoxelLayer");if(await this._definition.load(),this._source=this._definition,!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new l(this._profile,e,[new o({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new l(this._profile,{code:"values"});this.variables.push(t);let i=await Ue(this._source),r=this._source;b(this._source.fields).map(n=>r.fields.find(a=>a.name===n.name)).sort(ee(r)).forEach(n=>{t.variables.push(this._getFieldProperty(n,i))})}catch(e){c("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},J=class extends C{constructor(e,t){super(e,t,"pixel",{exposeRelationships:!1}),this.type="pixel",this._source=null}async _loadSource(){if(this.loaded)return this._source;try{if(!q(this._definition))throw new Error("Invalid definition - not an ImageryLayer");if(await this._definition.load(),this._source=this._definition,!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new l(this._profile,e,[new o({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new l(this._profile,{code:"values"});if(this.variables.push(t),!q(this._source))throw new Error("Invalid definition - not an ImageryLayer");(await Ne(this._source)).forEach(i=>{t.variables.push(this._getMemberProperty(i))})}catch(e){c("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},F=class extends E{constructor(e,t,i=[],r){super(e,t,r),this.featureSetSnippets=i,this.type="featureSet"}get title(){return u(this._source)?this._source.title??"":{code:"featureset"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await O(this._definition),!this._source)throw new Error("Invalid definition");this.variables.push(new l(this._profile,this.title,this.featureSetSnippets,!0));let e=new l(this._profile,{code:"fields"});this.variables.push(e),e.variables=b(this._source.fields).sort(ee(this._source)).map(i=>this._getFieldProperty(i));let t=await this._getRelationshipsProperty();t&&this.variables.push(t)}catch(e){c("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},Z=class extends d{constructor(e,t){super(e,t),this.type="featureSetCollection",this._featureSetCollections=null,this._loaded=!1,this._definition=t.declaration?.definition}get informationUrl(){return!this.loaded||!this._featureSetCollections?null:typeof this._featureSetCollections.source!="string"?De(xe(this._featureSetCollections.source)):null}get informationType(){if(!this.loaded||!this._featureSetCollections)return"";if(typeof this._featureSetCollections.source=="string")return this._profile?.intlStrings.featureservice??"featureservice";switch(this._featureSetCollections.source.declaredClass){case"esri.WebMap":return this._profile?.intlStrings.webmap??"webmap";case"esri.WebScene":return this._profile?.intlStrings.webscene??"webscene";default:return this._profile?.intlStrings.map??"map"}}async loadSource(){return _(this._loadPromise)&&w(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._featureSetCollections;try{if(this._featureSetCollections=await this._featureSetCollectionsFromDefinition(),!this._featureSetCollections)throw new Error("Invalid definition");let e=typeof this._featureSetCollections.source=="string"?{code:this._featureSetCollections.source.endsWith("FeatureServer")?"featureservice":"mapservice"}:{code:"webmapformat",formatValues:{webMapTitle:xe(this._featureSetCollections.source)?.title||"Untitled map"}},t=new l(this._profile,e,[new o({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]),i=new l(this._profile,{code:"layers"},this._featureSetCollections.layers),r=new l(this._profile,{code:"tables"},this._featureSetCollections.tables);this.variables.push(t,i,r)}catch(e){c("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._featureSetCollections=null}finally{this._loaded=!0}return this._featureSetCollections}async _featureSetCollectionsFromDefinition(){return this._definition?ne(this._definition)?await this._featureSetCollectionFromMap(this._definition):pe(this._definition)?await this._featureSetCollectionFromUrl(this._definition.url):le(this._definition)?await this._featureSetCollectionFromPortalItem(this._definition.portalItem):null:null}async _featureSetCollectionFromMap(e){oe(e)&&await e.loadAll(),await Promise.all(e.allTables.map(async i=>await i.load()));let t=this._profile?.policy?.filterFsCollectionLayersFromMap??(()=>!0);return{layers:this._convertWebMapLayersToVariables(e.allLayers.filter(t)),tables:this._convertWebMapLayersToVariables(e.allTables),source:e}}async _featureSetCollectionFromPortalItem(e){let t=new Ee(e);switch(await t.load(),t.type){case"Web Map":{let i=new Ae({portalItem:t});return await this._featureSetCollectionFromMap(i)}case"Web Scene":{let i=new Le({portalItem:t});return await this._featureSetCollectionFromMap(i)}case"Feature Service":return await this._featureSetCollectionFromUrl(t.url);default:return c("error",this.type,"Unsupported portal item",{detail:{definition:e}}),null}}async _featureSetCollectionFromUrl(e){let t=e?.replace(/\/featureserver\/[0-9]*/iu,"/FeatureServer");if(t=t?.replace(/\/mapserver\/[0-9]*/iu,"/MapServer"),t=t?.split("?")[0],!t)return null;let i=await ge(t),r=Promise.all(i.layers.map(async h=>{let p=new B({url:`${t}/${h.id}`});return await p.load(),this._createFeatureSetVariable(p)})),n=Promise.all(i.tables.map(async h=>{let p=new B({url:`${t}/${h.id}`});return await p.load(),this._createFeatureSetVariable(p)})),[a,f]=await Promise.all([r,n]);return{layers:a,tables:f,source:t}}_convertWebMapLayersToVariables(e){let t=[];return e.toArray().reverse().forEach(i=>{if(L(i)){t.push(this._createFeatureSetVariable(i,!0));return}}),t}_createFeatureSetVariable(e,t=!1){return new F(this,{profile:this._profile,declaration:{name:e.title??"",definition:e},label:t?e.title:e.sourceJSON.name??e.title,description:"",nonInteractive:!0},this._makeFeatureSetSnippets(e,t))}_makeFeatureSetSnippets(e,t=!1){if(!this._profile?.supportFeatureSetFunctions)return[];if(t){let i=`FeatureSetById(${this.snippet}, "${e.id}")`,r=`FeatureSetByName(${this.snippet}, "${e.title}")`;return[new o({profile:this._profile,label:i,description:"",snippet:i}),new o({profile:this._profile,label:r,description:"",snippet:r})]}else{let i=`FeatureSetById(${this.snippet}, "${e.layerId}")`;return[new o({profile:this._profile,label:i,description:"",snippet:i})]}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},X=class extends d{constructor(e,t){super(e,t),this.type="dataCatalogDatastore",this._catalogDatastore=null,this._datastore=null,this._loaded=!1,this._definition=t.declaration?.definition}_serializeDefinitionFromInstance(e){return{id:e.itemId??"",serviceUrl:e.serviceUrl??"",portal:{url:e.portal?.url??""}}}_getSerializedDefinition(){let e=this.declaration.definition;if(e)return y(e)?e:this._serializeDefinitionFromInstance(e);if(y(this._definition))return this._definition;if(this._catalogDatastore)return this._serializeDefinitionFromInstance(this._catalogDatastore);if(this._definition)return this._serializeDefinitionFromInstance(this._definition)}async loadSource(){return _(this._loadPromise)&&w(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._datastore;try{if(!this._definition)throw new Error("No definition provided");y(this._definition)?this._catalogDatastore=await this._dataCatalogDatastoreFromDefinition(this._definition):this._catalogDatastore=this._definition;let e=this._catalogDatastore;if(!e)throw new Error("Invalid definition");let t=await e.fetchInfo();this._datastoreInfo=t;let i=await e.fetchDatasets(),r=await it(t.databasePlatform),n=i.map(a=>new Y(this,{profile:this._profile,declaration:{name:a.name},label:a.name,description:a.type,snippet:tt(a.name,r)},e,a,r));this.variables=n,this._datastore={tables:n,source:y(this._definition)?this._definition:e,info:t}}catch(e){c("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._datastore=null}finally{this._loaded=!0}return this._datastore}get datastoreInfo(){return this._datastoreInfo}get tableVariables(){return this.variables.filter(be)}async _dataCatalogDatastoreFromDefinition(e){let t=new Oe({url:e.portal.url});return await t.load(),new H({itemId:e.id,serviceUrl:e.serviceUrl,portal:t})}toProfileVariableDefinition(){let e=this.declaration,t=this._getSerializedDefinition();return{type:this.type,name:"",...e,...t?{definition:t}:{}}}},Y=class extends d{constructor(e,t,i,r,n){super(e,t),this._catalogDatastore=i,this.datasetInfo=r,this._dialectSpec=n,this.type="dictionary",this._fieldInfos=[],this._loaded=!1}get fieldInfos(){return this._fieldInfos}async loadSource(){return _(this._loadPromise)&&w(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadFields(),await this._loadPromise)}async _loadFields(){if(this.loaded)return this._fieldInfos;try{let e=await this._catalogDatastore.fetchTableDescription(this.datasetInfo.name);this._fieldInfos=e.fields,this.variables=this._fieldInfos.map(t=>{let i={name:t.name,alias:t.name,type:t.type};return new o({profile:this._profile,declaration:{type:k(i)},label:t.name,description:[t.serverType,t.nullable?"nullable":"not null"].filter(Boolean).join(" | "),snippet:$e(t.name,this._dialectSpec),icon:R(i),filterDescription:!0})})}catch(e){c("error","DataCatalogDatastoreTableVariable","Error loading dataset",{detail:{error:e,dataset:this.datasetInfo}}),this._fieldInfos=[]}finally{this._loaded=!0}return this._fieldInfos}toProfileVariableDefinition(){return{type:"dictionary",name:this.datasetInfo.name,description:this.datasetInfo.type}}},Pe=class extends v{constructor(e,t,i="en",r={}){super(void 0,{profile:null,declaration:{properties:[]}}),this.definition=e,this.intlStrings=t,this.locale=i,this.policy=r,this.variables=[],this._profile=this,this.loadPropertyDeclarations(e?.variables)}get supportFeatureSetFunctions(){return this.definition?.bundles?.includes("data-access")??!1}toEditorProfileDefinition(){return{...this.definition,variables:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},at={locale:"en"},Me=class{constructor(e,t){this.languageId=e,this._apiConfig=t,this._onDidChange=new G,this._modelToProfileMap=new Map,this._modelToApiContextMap=new Map,this._localeToApiLibraryPromiseMap=new Map,this._onModelContextDidChange=new G,this._onDidModelContextChangeTimeout=-1,ve().then(i=>{i.onWillDisposeModel(r=>{this.disposeForModel(r.uri)})})}_fireModelContextDidChange(e){this._onDidModelContextChangeTimeout===-1&&(this._onDidModelContextChangeTimeout=window.setTimeout(()=>{this._onDidModelContextChangeTimeout=-1,this._onModelContextDidChange.fire(e)},0))}_getApiKey(e){return W.isUri(e)||(e=W.parse(e)),e.toString()}getWorkerHostExtension(){}get onDidChange(){return this._onDidChange.event}disposeForModel(e){let t=this._getApiKey(e);this._modelToProfileMap.delete(t),this._modelToApiContextMap.delete(t)&&this._fireModelContextDidChange(t)}getEditorProfileForModel(e){return this._modelToProfileMap.get(this._getApiKey(e))}getApiContextForModel(e){return this._modelToApiContextMap.get(this._getApiKey(e))??at}updateApiContextForModel(e,t){let i=this._getApiKey(e),r=this._modelToApiContextMap.get(i)??{};this._modelToApiContextMap.set(i,{...r,...t}),this._fireModelContextDidChange(i)}get onModelContextDidChange(){return this._onModelContextDidChange.event}async getApiLibraryForModel(e){let t=this.getApiContextForModel(e),i=this.getApiLibrary(t.locale??"en");return(await we(i,t)).categories}get workerHost(){if(!this._workerHost){let e=Object.assign({getApiLibrary:async t=>await this.getApiLibrary(t),getLanguageId:()=>this.languageId},this.getWorkerHostExtension());this._workerHost=e}return this._workerHost}async fetchApiLibrary(e){try{let{apiPath:t,apiPrefix:i}=this._apiConfig,r=se(`${t}/${i}${e}.json`),n=await fetch(r);return n.ok?await n.json():[]}catch{return[]}}async getApiLibrary(e){let t=ae(e);return this._localeToApiLibraryPromiseMap.has(t)||this._localeToApiLibraryPromiseMap.set(t,this.fetchApiLibrary(t)),await this._localeToApiLibraryPromiseMap.get(t)??[]}};return{a:H,b:D,c:Ie,d:Qe,e:Je,f:Xe,g:It,h:$e,i:tt,j:Tt,k:te,l:xt,m:Pt,n:X,o:Pe,p:Me}},"portal/PortalItem","WebMap","WebScene","layers/FeatureLayer","applications/Components/arcadeEditorUtils","core/Error","portal/Portal",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{b as r}from"./RJRCBNNO.js";import{K as o}from"./4BNI5KJQ.js";var s=r(o);export{s as a};
2
+ import{b as r}from"./57WNN7NN.js";import{K as o}from"./4BNI5KJQ.js";var s=r(o);export{s as a};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./VR5CATAW.js";import{a as I}from"./MP6Z45SA.js";import{a as h}from"./NKCYMRE4.js";import{b as l}from"./BCUUVBXH.js";import{Qk as T,al as u}from"./NG7S6FUK.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
2
+ import a from"./ZCXZTSQU.js";import{a as I}from"./MP6Z45SA.js";import{a as h}from"./NKCYMRE4.js";import{b as l}from"./BCUUVBXH.js";import{Qk as T,al as u}from"./NG7S6FUK.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a,b,c}from"./CZ2DJPO4.js";import"./MP6Z45SA.js";import"./NKCYMRE4.js";import"./UYBZWFE5.js";import"./BCUUVBXH.js";import"./YLN7EMJC.js";import"./GHSEU7VA.js";import"./4OSKRQ5X.js";import"./NG7S6FUK.js";import"./3TTFCHAA.js";export{b as getSqlLayerDiagnosticService,a as getSqlLayerWorker,c as setupMode};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import c from"./W2PBO44R.js";import a from"./ZHZFKZA7.js";import{b as y,c as h,d as b}from"./BQLG62QR.js";import{h as f}from"./FUBRHCFC.js";import{K as u}from"./4BNI5KJQ.js";export default $arcgis.t(([{i:m,n:d},{l:g,o:F,p:M}])=>{var w=o=>{let t=o.variables[0],i=t?.type==="featureSet"?A(t):void 0,{apiVersion:e,bundles:a,hiddenApiItems:r}=o.toEditorProfileDefinition();return{apiVersion:e,bundles:a,variables:i?[i]:[],hiddenApiItems:r?.map(s=>s.toLowerCase())}};function A(o){let{name:t}=o,i=o.getDescription(),{definition:e}=o.toProfileVariableDefinition(),a={label:t,detail:t,insertText:t,insertTextMode:b.asIs,insertTextFormat:h.PlainText,kind:y.Field},r={name:t,description:i,type:"dictionary",properties:[],completion:a};if(!e||!("fields"in e))return r;let[s,l]=g(e.fields,i);return r.properties=s,a.documentation={kind:"markdown",value:l},r}var I={id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]};function P(){return I}function T(o){if(!d(o))return;let t=P();if(!t)return;let i={variables:[],hiddenApiItems:o.hiddenApiItems?.map(e=>e.toLowerCase())};return t.variables.forEach(e=>{if(o.disabledVariables?.includes(e.name))return;let a=o.definitions[e.name];switch(e.type){case"featureSet":return m(a)?i.variables.push({...e,type:e.type,definition:a}):void 0;default:throw Error(`sdkVariable type not supported (yet) type: ${e.type}`)}}),i}var x="arcgis-sql-expression",p=class extends M{constructor(){super(x,{apiPath:"./assets/sql-language/api",apiPrefix:"sql-api.t9n."}),this._languageId=x,this._layerMap=new Map}updateFeatureLayerForModel(t,i){let e=this._getApiKey(t);this._layerMap.set(e,i)}getFeatureLayerForModel(t){let i=this._getApiKey(t);return this._layerMap.get(i)}async setProfileForModel(t,i,e={locale:"en"}){d(i)&&(i=T(i));let a=await f(e.locale,u("./assets/editor-profile/t9n"),"messages.");if(!a)throw new Error(`Failed to load the language bundle for ${e.locale}`);this.disposeForModel(t);let r=this._getApiKey(t),s=new F(i,a);this._modelToProfileMap.set(r,s);let l=w(s);this.updateApiContextForModel(t,{locale:e.locale,profile:l});let c=i?.variables?.find(v=>v.name==="$layer");c&&this.updateFeatureLayerForModel(t,c.definition)}},n=new p,C={setProfileForModel:n.setProfileForModel.bind(n),getApiLibraryForModel:n.getApiLibraryForModel.bind(n)};async function S(){return await import("./T6RFLFX3.js").then(m=>m.default)}return{a:n,b:S}},a,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ export default $arcgis.t(([f,y])=>{function v(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&i(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function c(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function h(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function p(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function s(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function i(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function o(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function d(t){return o(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url??"")}function u(t){return o(t)||i(t)||s(t)}function D(t){return u(t)&&"type"in t&&t.type==="voxel"}function F(t){return u(t)&&"type"in t&&(t.type==="imagery"||t.type==="imagery-tile")}function w(t){return o(t)||i(t)||s(t)}function q(t){return p(t)||c(t)||d(t)}function S(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function x(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function W(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function L(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function M(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function G(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function b(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function U(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function k(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function j(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function z(t){return j(t)&&"subtypes"in t}function B(t){return!!t&&typeof t=="object"&&"portalItem"in t}function E(t){return b(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function g(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function m(t){if(t&&typeof t=="object"){if(g(t))return t.isTable||"type"in t&&t.type==="table";if("geometryType"in t)return t.geometryType===""||t.geometryType==="esriGeometryNull"||t.geometryType===null}return!1}function H(t){return!m(t)}function C(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}function N(t){return!!t&&typeof t=="object"&&"type"in t&&t.type==="voxel"}function O(t){return!!t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&["imagery","imagery-tile"].includes(t.type)}function V(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"serviceUrl"in t&&typeof t.serviceUrl=="string"&&"portal"in t&&!!t.portal&&typeof t.portal=="object"&&"url"in t.portal&&typeof t.portal.url=="string"}function $(t){return!!t&&"intlStrings"in t&&"policy"in t}function J(t){return t?.type==="featureSet"}function K(t){return t?.type==="dataCatalogDatastore"}function I(t){return!!t&&"datasetInfo"in t}function P(t){return!!t&&t.type!=="dataCatalogDatastore"&&!I(t)}async function Q(t){if(!t)return null;let r;return i(t)?r=t:r=new f(t),C(r)&&await r.load(),r}async function R(t){t+="/layers";let r=await y(t,{responseType:"json",query:{f:"json"}}),n=t.endsWith("MapServer/layers")?"data":"query",e=a(r.data?.layers,n),l=a(r.data?.tables,n);return{layers:e,tables:l}}function a(t,r){return t?t.filter(n=>{switch(n.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(n.capabilities?n.capabilities.toLowerCase().split(",").map(e=>e.trim()):[]).includes(r);default:return!1}}):[]}return{a:v,b:c,c:h,d:p,e:o,f:u,g:D,h:F,i:w,j:q,k:S,l:x,m:W,n:L,o:M,p:G,q:b,r:U,s:k,t:j,u:z,v:B,w:E,x:g,y:H,z:N,A:O,B:V,C:$,D:J,E:K,F:I,G:P,H:Q,I:R}},"layers/FeatureLayer","request")
@@ -1 +1 @@
1
- {"help":"Help","profilevariables":"Profile variables","constantsandfunctions":"Functions","suggestions":"Suggestions","run":"Run","lastresults":"Last results","arcadeassistant":"Arcade assistant"}
1
+ {"help":"Help","profilevariables":"Profile variables","constantsandfunctions":"Functions","suggestions":"Suggestions","run":"Run","lastresults":"Last results","arcadeassistant":"Arcade assistant","profileempty":"This profile does not have any variables."}