@arcgis/coding-components 4.33.0-next.74 → 4.33.0-next.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arcgis-coding-components/{5525TVLI.js → 342NLOE4.js} +2 -2
- package/dist/arcgis-coding-components/{IWFZL3W2.js → 3BXNPW5F.js} +2 -2
- package/dist/arcgis-coding-components/{5GHS32DP.js.LEGAL.txt → 3BXNPW5F.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{TQE4VYOX.js → 3FETLQIP.js} +2 -2
- package/dist/arcgis-coding-components/{TQE4VYOX.js.LEGAL.txt → 3FETLQIP.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{GIPPKVCI.js → 4HKZ3TQJ.js} +2 -2
- package/dist/arcgis-coding-components/{3DQVNKKO.js → 4VVG3WKG.js} +2 -2
- package/dist/arcgis-coding-components/{5KFVDEEV.js.LEGAL.txt → 4VVG3WKG.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{PNWMM6QM.js → 7CECRXJA.js} +1 -1
- package/dist/arcgis-coding-components/{S2H3D2DX.js → 7DHAT676.js} +2 -2
- package/dist/arcgis-coding-components/{RZLHWMNU.js → CJ6YEE7I.js} +2 -2
- package/dist/arcgis-coding-components/{5GHS32DP.js → DOPVA4YP.js} +2 -2
- package/dist/arcgis-coding-components/{AZYGJSMF.js.LEGAL.txt → DOPVA4YP.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{VKLJCZWI.js → ESSNWZTY.js} +2 -2
- package/dist/arcgis-coding-components/{OLMCQG73.js → FPF2C35K.js} +2 -2
- package/dist/arcgis-coding-components/{QBSA2GCR.js → FV2GPYN6.js} +2 -2
- package/dist/arcgis-coding-components/{FT7Z65RJ.js → GG4ET4QB.js} +2 -2
- package/dist/arcgis-coding-components/{S374A4NC.js → GKYYYIMQ.js} +2 -2
- package/dist/arcgis-coding-components/{NIBH67GE.js → GWG6ISZ7.js} +2 -2
- package/dist/arcgis-coding-components/{UZPOCTMZ.js → IA4I57FY.js} +2 -2
- package/dist/arcgis-coding-components/{3CBW2VEP.js → JBY6ACAI.js} +3 -3
- package/dist/arcgis-coding-components/{3CBW2VEP.js.LEGAL.txt → JBY6ACAI.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{3KNOXMMF.js → JY7ZLNIM.js} +1 -1
- package/dist/arcgis-coding-components/{PYEV7SUQ.js → K2IVEQE5.js} +2 -2
- package/dist/arcgis-coding-components/{3DQVNKKO.js.LEGAL.txt → K2IVEQE5.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{YQ3E4XRK.js → LQL74H5T.js} +2 -2
- package/dist/arcgis-coding-components/LQL74H5T.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{AZYGJSMF.js → LY4YCZAV.js} +2 -2
- package/dist/arcgis-coding-components/LY4YCZAV.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{6MYFLVGY.js → N6D2M65S.js} +2 -2
- package/dist/arcgis-coding-components/{BHWDK64C.js → NDNDJ2JJ.js} +1 -1
- package/dist/arcgis-coding-components/{GKQYZUS6.js → OKOC7LFV.js} +2 -2
- package/dist/arcgis-coding-components/OKOC7LFV.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{Y2WQTKL6.js → Q3NYSEHX.js} +2 -2
- package/dist/arcgis-coding-components/Q3NYSEHX.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{NU4EV62Z.js → QEY4O2FB.js} +2 -2
- package/dist/arcgis-coding-components/{B4G5WQKS.js → QJWWKQZM.js} +2 -2
- package/dist/arcgis-coding-components/QJWWKQZM.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{GJOV5ZD7.js → QOVT3RPP.js} +1 -1
- package/dist/arcgis-coding-components/QOVT3RPP.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{EEY6XK4Z.js → QWNGGA63.js} +2 -2
- package/dist/arcgis-coding-components/QWNGGA63.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{FW5OYVPI.js → ROVNQGRZ.js} +2 -2
- package/dist/arcgis-coding-components/ROVNQGRZ.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{PPSKD4XC.js → UGR2JQRN.js} +2 -2
- package/dist/arcgis-coding-components/UGR2JQRN.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{5KFVDEEV.js → XENMJDDB.js} +2 -2
- package/dist/arcgis-coding-components/XENMJDDB.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{U74MDVEL.js → XEUTOLXY.js} +2 -2
- package/dist/arcgis-coding-components/{U74MDVEL.js.LEGAL.txt → XEUTOLXY.js.LEGAL.txt} +1 -1
- package/dist/arcgis-coding-components/{VBBU6KLA.js → YQSJ3GXL.js} +2 -2
- package/dist/arcgis-coding-components/YQSJ3GXL.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/{TCAWMH3O.js → YQW7CW6V.js} +2 -2
- package/dist/arcgis-coding-components/YQW7CW6V.js.LEGAL.txt +3 -0
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js.LEGAL.txt +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +3 -3
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +7 -7
- package/dist/arcgis-coding-components/B4G5WQKS.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/EEY6XK4Z.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/FW5OYVPI.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/GJOV5ZD7.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/GKQYZUS6.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/IWFZL3W2.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/PPSKD4XC.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/PYEV7SUQ.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/TCAWMH3O.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/VBBU6KLA.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/Y2WQTKL6.js.LEGAL.txt +0 -3
- package/dist/arcgis-coding-components/YQ3E4XRK.js.LEGAL.txt +0 -3
- /package/dist/arcgis-coding-components/{5525TVLI.js.LEGAL.txt → 342NLOE4.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{GIPPKVCI.js.LEGAL.txt → 4HKZ3TQJ.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{3KNOXMMF.js.LEGAL.txt → 7CECRXJA.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{S2H3D2DX.js.LEGAL.txt → 7DHAT676.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{RZLHWMNU.js.LEGAL.txt → CJ6YEE7I.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{6MYFLVGY.js.LEGAL.txt → ESSNWZTY.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{OLMCQG73.js.LEGAL.txt → FPF2C35K.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{QBSA2GCR.js.LEGAL.txt → FV2GPYN6.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{FT7Z65RJ.js.LEGAL.txt → GG4ET4QB.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{S374A4NC.js.LEGAL.txt → GKYYYIMQ.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{NIBH67GE.js.LEGAL.txt → GWG6ISZ7.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{UZPOCTMZ.js.LEGAL.txt → IA4I57FY.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{BHWDK64C.js.LEGAL.txt → JY7ZLNIM.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{PNWMM6QM.js.LEGAL.txt → N6D2M65S.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{VKLJCZWI.js.LEGAL.txt → NDNDJ2JJ.js.LEGAL.txt} +0 -0
- /package/dist/arcgis-coding-components/{NU4EV62Z.js.LEGAL.txt → QEY4O2FB.js.LEGAL.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
4
|
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d,q as e};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{a as g,b as i,c,d}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{a as g,b as i,c,d}from"./7CECRXJA.js";import{c as F}from"./JBY6ACAI.js";import"./342NLOE4.js";import{a as y,v as T}from"./NDNDJ2JJ.js";import{Gl as P,Kl as k,Nl as C,Sl as f,kk as O}from"./GG4ET4QB.js";import"./JY7ZLNIM.js";O();var z={False:"false",Null:"null",True:"true"},$={Break:"break",Continue:"continue",Else:"else",For:"for",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"};var j=["++","--"],V=["-","+","!","~"],W=["=","/=","*=","%=","+=","-="],R=["||","&&"],K=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var s={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentifierExpected:"IdentifierExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},H={[s.InvalidModuleUri]:"Module uri must be a text literal.",[s.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[s.IdentifierExpected]:"'${value}' is an invalid identifier.",[s.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[s.InvalidExpression]:"Invalid expression.",[s.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[s.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[s.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[s.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[s.InvalidTemplateHead]:"Invalid template structure.",[s.InvalidVariableAssignment]:"Invalid variable assignment.",[s.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[s.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[s.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[s.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[s.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[s.PunctuatorExpected]:"'${value}' expected.",[s.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[s.UnexpectedBoolean]:"Unexpected boolean literal.",[s.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[s.UnexpectedIdentifier]:"Unexpected identifier.",[s.UnexpectedKeyword]:"Unexpected keyword.",[s.UnexpectedNull]:"Unexpected null literal.",[s.UnexpectedNumber]:"Unexpected number.",[s.UnexpectedPunctuator]:"Unexpected punctuator.",[s.UnexpectedString]:"Unexpected text literal.",[s.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[s.UnexpectedToken]:"Unexpected token '${value}'."};var E=[[],[],[]];j.forEach(t=>E[t.length-1]?.push(t));V.forEach(t=>E[t.length-1]?.push(t));R.forEach(t=>E[t.length-1]?.push(t));W.forEach(t=>E[t.length-1]?.push(t));K.forEach(t=>E[t.length-1]?.push(t));var o={AlreadyDefined:"AlreadyDefined",ApiConflict:"ApiConflict",AssignedNeverUsed:"AssignedNeverUsed",DefinedNeverAssigned:"DefinedNeverAssigned",DefinedNeverUsed:"DefinedNeverUsed",EmptyBlockStatement:"EmptyBlockStatement",ExecutionError:"ExecutionError",InvalidApiFunctionUsage:"InvalidApiFunctionUsage",InvalidConstantIdentifier:"InvalidConstantIdentifier",InvalidPropertyIdentifier:"InvalidPropertyIdentifier",NoArgumentExpected:"NoArgumentExpected",NotADictionary:"NotADictionary",NotDefined:"NotDefined",NotEnoughArguments:"NotEnoughArguments",ProfileVariablesAreImmutable:"ProfileVariablesAreImmutable",ProfileVariablesConflict:"ProfileVariablesConflict",ReservedKeyword:"ReservedKeyword",TooManyArguments:"TooManyArguments",UnexpectedEmptyFunction:"UnexpectedEmptyFunction",UnexpectedPropertyIdentifier:"UnexpectedPropertyIdentifier",UnknownPropertyIdentifier:"UnknownPropertyIdentifier"},ce={[o.AlreadyDefined]:"'${identifier}' is already defined.",[o.ApiConflict]:"'${identifier}' is already defined as an Arcade constant or function.",[o.AssignedNeverUsed]:"'${identifier}' is assigned but never used.",[o.DefinedNeverAssigned]:"'${identifier}' is defined but never assigned.",[o.DefinedNeverUsed]:"'${identifier}' is defined but never used.",[o.EmptyBlockStatement]:"Empty block statement.",[o.ExecutionError]:"Execution Error: '${stack}'",[o.InvalidApiFunctionUsage]:"Arcade function '${identifier}' not used in a call expression.",[o.InvalidConstantIdentifier]:"Invalid constant identifier, expecting ${list}.",[o.InvalidPropertyIdentifier]:"Invalid property identifier, expecting ${list}.",[o.NoArgumentExpected]:"Expecting no argument.",[o.NotADictionary]:"'${identifier}' doesn't have properties.",[o.NotDefined]:"'${identifier}' is not defined.",[o.NotEnoughArguments]:"Expecting at least ${min} argument(s).",[o.ProfileVariablesAreImmutable]:"Profile variables cannot be modified.",[o.ProfileVariablesConflict]:"'${identifier}' is already defined as a profile variable.",[o.ReservedKeyword]:"'${identifier}' is a reserved keyword.",[o.TooManyArguments]:"Too many arguments, expecting ${max}.",[o.UnexpectedEmptyFunction]:"Unexpected empty function '${identifier}'.",[o.UnexpectedPropertyIdentifier]:"Unexpected property identifier.",[o.UnknownPropertyIdentifier]:"Unknown property identifier '${identifier}'.",...H};var B=Object.values($),q=Object.values(z);var le=q.map(t=>({label:t,kind:i.Constant})),he=B.map(t=>({label:t,kind:i.Keyword})),de=[{label:"exportfunction",kind:i.Snippet,detail:"Export Function Statement",insertText:`export function \${1:functionName} ($2) {
|
|
5
5
|
$0
|
|
6
6
|
}`,insertTextMode:d.adjustIndentation,insertTextFormat:c.Snippet},{label:"exportvar",kind:i.Snippet,detail:"Export Variable Statement",insertText:"export var ${0:variableName}\n",insertTextMode:d.adjustIndentation,insertTextFormat:c.Snippet},{label:"for",kind:i.Snippet,detail:"For Loop Statement",insertText:"for (var ${1:i} = 0; ${1:i} < ${2:array.length}; ${1:i}++) {\n $0\n}",insertTextMode:d.adjustIndentation,insertTextFormat:c.Snippet},{label:"forin",kind:i.Snippet,detail:"For-In Loop Statement",insertText:"for (var ${1:i} in ${2:arrayOrObject}) {\n $0\n}",insertTextMode:d.adjustIndentation,insertTextFormat:c.Snippet},{label:"forof",kind:i.Snippet,detail:"For-Of Loop Statement",insertText:"for (var ${1:i} of ${2:arrayOrObject}) {\n $0\n}",insertTextMode:d.adjustIndentation,insertTextFormat:c.Snippet},{label:"function",kind:i.Snippet,detail:"Function Statement",insertText:`function \${1:functionName} ($2) {
|
|
7
7
|
$0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{e as u}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{e as u}from"./QOVT3RPP.js";var T="https://developers.arcgis.com/arcade/",k=100,m=100;function C(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function v(e){return!!e&&typeof e=="object"&&"arcadeDeclaredClass"in e&&typeof e.arcadeDeclaredClass=="string"&&e.arcadeDeclaredClass==="esri.arcade.Feature"}function g(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Dictionary"}function b(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass.startsWith("esri.geometry.")}function w(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass.startsWith("esri.rest.knowledgeGraph.KnowledgeGraph")}function R(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Portal"}function A(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Attachment"}function h(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.arcade.arcadedate"}function j(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.core.sql.dateonly"}function D(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.core.sql.timeonly"}function F(e){return!!e&&typeof e=="object"&&"length"in e&&typeof e.length=="function"&&"get"in e&&typeof e.get=="function"&&"toArray"in e&&typeof e.toArray=="function"&&"_elements"in e&&Array.isArray(e._elements)}function S(e){return e==null?{type:"null"}:Array.isArray(e)?{type:"array",value:e}:F(e)?{type:"array",value:e.toArray()}:e instanceof Date?{type:"date",value:e}:typeof e=="string"?{type:"text",value:e}:typeof e=="number"?{type:"number",value:e}:typeof e=="boolean"?{type:"boolean",value:e}:typeof e!="object"?{type:"unknown"}:h(e)?{type:"date",value:e}:j(e)?{type:"dateOnly",value:e}:D(e)?{type:"time",value:e}:A(e)?{type:"attachment",value:e}:R(e)?{type:"portal",value:e}:C(e)?{type:"featureSet",value:e,features:[],iterator:null}:v(e)?{type:"feature",value:e}:g(e)?{type:"dictionary",value:e}:b(e)?{type:"geometry",value:e}:w(e)?{type:"knowledgeGraph",value:e}:{type:"unknown"}}function E(e,r="en"){return e.value instanceof Date?new Intl.DateTimeFormat(r,{dateStyle:"medium",timeStyle:"long"}).format(e.value):e.value.toDateTime().setLocale(r).toFormat(e.value.isUnknownTimeZone?"FF":"FF ZZZZZ")}function G(e){return e.value.toString()}function B(e){return e.value.toString()}async function Z(e,r="system"){let a=S(e);return a.type!=="featureSet"||(await a.value.load(),a.iterator=a.value.iterator({aborted:!1}),a.features=await a.iterator.nextBatchAsArcadeFeatures(m,r)??[]),a}async function I(e,r,a,s){let l=new Date;s??=()=>{};try{let o=performance.now(),t=await(await u()).createArcadeExecutor(r??"",{variables:e?.variables??[]}),c=performance.now(),{profileVariableInstances:d,spatialReference:y,timeZone:i}=a,p={spatialReference:y,timeZone:i,rawOutput:!0,console:s},f=await t.executeAsync(d,p),n=await Z(f,i);return n.timeStamp=l,n.compilationTime=c-o,n.executionTime=performance.now()-c,n}catch(o){let t="Unknown Error";return o instanceof Error&&(t=o.message),{type:"error",value:t,error:o,timeStamp:l,compilationTime:0,executionTime:0}}}export{T as a,k as b,m as c,S as d,E as e,G as f,B as g,I as h};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{b as I,c as $,d as V,e as z}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{b as I,c as $,d as V,e as z}from"./7CECRXJA.js";import{a as h,b as R,c as O,d as K,f as q,g as Q,h as X,i as Y,j as d}from"./QOVT3RPP.js";import{b as B,c as H}from"./JBY6ACAI.js";import{x as k}from"./XEUTOLXY.js";import{l as N,p as T,q as U,t as w,u as M}from"./NDNDJ2JJ.js";import{Gl as P,Pl as x}from"./GG4ET4QB.js";function ne(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&F(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function fe(t){return!!t&&typeof t=="object"&&"allLayers"in t&&"allTables"in t&&typeof t.allLayers=="object"&&typeof t.allTables=="object"}function oe(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 ye(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function ae(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function le(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function F(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function v(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function _e(t){return v(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url??"")}function Ee(t){return v(t)||F(t)||le(t)}function We(t){return v(t)||F(t)||le(t)}function Ge(t){return ae(t)||oe(t)||_e(t)}function Z(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function A(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function me(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function Ne(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 C(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function be(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function pe(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function L(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function J(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function f(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function ge(t){return f(t)&&"subtypes"in t}function we(t){return!!t&&typeof t=="object"&&"portalItem"in t}function Ce(t){return pe(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function De(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function Se(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}async function ce(t){if(!t)return null;let e;return F(t)?e=t:e=await h(t),Se(e)&&await e.load(),e}async function Fe(t){t+="/layers";let e=await(await q())(t,{responseType:"json",query:{f:"json"}}),i=t.endsWith("MapServer/layers")?"data":"query",r=ee(e.data?.layers,i),s=ee(e.data?.tables,i);return{layers:r,tables:s}}function ee(t,e){return t?t.filter(i=>{switch(i.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(i.capabilities?i.capabilities.toLowerCase().split(",").map(r=>r.trim()):[]).includes(e);default:return!1}}):[]}async function ve(t,e){let i=await h({url:`${t.url}/${e.relatedTableId}`});return await i.load(),i}function ue(t){return(e,i)=>{if(e.type==="oid")return-1;if(i.type==="oid")return 1;if(f(t)){if(e.name===t.subtypeField)return-1;if(i.name===t.subtypeField)return 1}if(L(t)){if(e.name===t.typeIdField)return-1;if(i.name===t.typeIdField)return 1}return e.name.localeCompare(i.name,"en",{sensitivity:"base"})}}function te(t,e){return t?.every(i=>i.domains?.[e.name]?.type==="inherited")??!1}var Te=/^[a-z_$][a-z0-9_$]*$/giu;function he(t,e=!0){return t.match(Te)?`${e?".":""}${t}`:`["${t}"]`}function de(t,e){return t?`${t}${he(e)}`:e}function ie(t){return we(t)?t.portalItem:null}function Ue(t,e,i=!1){let r=e,s=[],o=[];return Y(t).forEach(n=>{r&&(r+=`
|
|
5
5
|
|
|
6
6
|
`),r+=`**${n.name}** (${n.alias})
|
|
7
7
|
${n.type}`,n.description&&(r+=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{a,b}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{a,b}from"./7DHAT676.js";import"./GG4ET4QB.js";import"./JY7ZLNIM.js";export{a as conf,b as language};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
4
|
var g=class{resolve(t){}reject(t){}constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}};function y(e,t){let n=e;for(;n;){if(n===t)return!0;if(!n.parentNode)return!1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode}return!1}function $(e,t,n){let{subscribe:o}=A(t);return o(r=>{r.some(s=>y(e,s.target))&&n()})}var h={};function A(e){let t=e.join(","),n=h[t];if(n!==void 0)return n;let o=new Set,r=new MutationObserver(s=>o.forEach(c=>c(s)));globalThis.document&&r.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let i={subscribe(s){return o.add(s),()=>{o.delete(s),o.size===0&&(r.disconnect(),h[t]=void 0)}}};return h[t]=i,i}function E(e,t){let n=e;for(;n;){let o=n.closest?.(t);if(o)return o;let r=n.getRootNode?.();if(r===globalThis.document)return null;n=r.host}return null}function U(e){return E(e,":is(.calcite-mode-light, .calcite-mode-dark)")?.classList.contains("calcite-mode-dark")?"dark":"light"}function N(e,t,n){return E(e,`[${t}]`)?.getAttribute(t)??n}function S(e){return e.nodeType===Node.ELEMENT_NODE}function w(e){return typeof e.setFocus=="function"}function l(e,t=""){if(!S(e))return!1;if(e.matches(t))return w(e)&&setTimeout(()=>void e.setFocus(),0),!0;for(let o of e.children)if(l(o,t))return!0;let n=e.shadowRoot;if(n){for(let o of n.children)if(l(o,t))return!0}return!1}async function M(e){e!=null&&(w(e)?await e.setFocus():e.focus())}function V(e,t){if(e?.shadowRoot){if(e.hasAttribute("hydrated")||e.hasAttribute("calcite-hydrated")){l(e,t);return}Promise.resolve(e.componentOnReady?.()).then(()=>l(e,t))}}function _(e,t,...n){try{return e?.call(t,...n)}catch(o){console.error(o,e)}}async function q(e,t,...n){try{let o=e?.call(t,...n);return o instanceof Promise?await o:o}catch(o){console.error(o,e)}}function a(e){let t="";for(let n=0;n<e;n++)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t}function B(){return[a(2),a(1),a(1),a(1),a(3)].join("-")}var j=["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"],C=new Set(j),u="en",R={pt:"pt-PT",nb:"no",zh:"zh-CN"};async function z(e,t,n=""){let o=`${t}/${n}`,r=`${o}${e}.json`;return p[r]??(p[r]=L(e,o)),await p[r]}var p={};async function L(e,t){let n=`${t}${e}.json`;try{let o=await fetch(n);if(o.ok)return await o.json()}catch(o){return console.error(o),{}}return e===u?{}:await L(u,t)}function O(e){let t=N(e,"lang",globalThis.navigator?.language||u);return{lang:t,t9nLocale:T(t)}}function T(e){let[t,n]=e.split("-"),o=t.toLowerCase(),r=o;return n&&(r=`${o}-${n.toUpperCase()}`),r=R[r]??r,C.has(r)?r:n?T(o):u}function Q(e,t,n,o){let r,i=()=>void P(e,t(),o).then(s=>{(r?.lang!==s.lang||r.t9nLocale!==s.t9nLocale||r.t9nStrings!==s.t9nStrings)&&n(s),r=s}).catch(console.error);return queueMicrotask(i),$(e,["lang"],i)}async function P(e,t,n=e.localName.split("-").slice(1).join("-")){let{lang:o,t9nLocale:r}=O(e),i=`${t}/${n}/t9n`,c=n===null?{}:await z(r,i,"messages.");return{lang:o,t9nLocale:r,t9nStrings:c}}var m='"',b="'";function v(e,t){return new Array(t+1).join(e)}function D(e){let t=m,n=b;e.includes(t)&&!e.includes(n)&&(n=m,t=b);let r=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${n})+)`,"gu");e=e.replace(r,(s,c,f,d)=>c+f+v(n,d.length/2));let i=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return e=e.replace(i,(s,c,f,d)=>c+f+v(`\\${t}`,d.length)),t+e+t}function H(e){let t=e?e.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")}function K(e,t={}){return(e??"").replace(/\{(?<valueName>.*?)\}/gu,(n,o)=>t[o]??n)}function Z(e){return`\u200E${e??""}\u200E`}var G=e=>e.replace(k,(t,n)=>`${n===0?"":"-"}${t.toLowerCase()}`),k=/[A-Z]+(?![a-z])|[A-Z]/gu;function J(e,t){let n=t>x?F:t/I,o=0,r=setInterval(()=>{o+=n,o>=t&&(clearInterval(r),e())},n);return r}var x=4e3,F=2e3,I=4;function W(e){return e!==null}function X(e){return e!==void 0}function Y(e,t=100){let n;return(...o)=>{let r=()=>{clearTimeout(n),e(...o)};clearTimeout(n),n=setTimeout(r,t)}}function ee(e,t,n=!1){if(!e||!t)return!1;let o=new URL(e),r=new URL(t);return!n&&o.protocol!==r.protocol||o.host==null||r.host==null?!1:o.host.toLowerCase()===r.host.toLowerCase()&&o.port===r.port}function te(e){try{return new URL(e),!0}catch{return!1}}export{g as a,$ as b,U as c,M as d,V as e,_ as f,q as g,B as h,C as i,z as j,O as k,T as l,Q as m,D as n,H as o,K as p,Z as q,G as r,J as s,W as t,X as u,Y as v,ee as w,te as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{a as h,b as g}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{a as h,b as g}from"./FV2GPYN6.js";import{a as p}from"./YQW7CW6V.js";import{a}from"./ROVNQGRZ.js";import"./LY4YCZAV.js";import"./7CECRXJA.js";import"./QOVT3RPP.js";import"./JBY6ACAI.js";import"./342NLOE4.js";import{c as r,e as n,f as e,r as c,s as d,w as l}from"./XEUTOLXY.js";import{h as s}from"./NDNDJ2JJ.js";import"./GG4ET4QB.js";import"./JY7ZLNIM.js";var f=r`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}}}`,o=class extends d{constructor(){super(...arguments),this._codeEditorElt=h(),this.messages=p(),this._modelId=s(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisScriptChange=c({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.shadowRootOptions=n}static{this.styles=f}async load(){await this._updateEditorProfile().catch(console.error)}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(console.error)}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(console.error)}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=a.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?console.error("encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${g(this._codeEditorElt)}></arcgis-code-editor></div>${this._activeAction==="fields"&&!this.hideSideBar&&e`<arcgis-editor-variables .variable=${i} class="side-panel flex-panel border-inline-start" .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${this._activeAction==="functions"&&!this.hideSideBar&&e`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</div>`}};l("arcgis-sql-expression-editor",o);export{o as ArcgisSqlExpressionEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{b,c as r,d as _,e as v}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{b,c as r,d as _,e as v}from"./DOPVA4YP.js";import{b as l}from"./FV2GPYN6.js";import{a as f}from"./YQW7CW6V.js";import{a as p}from"./JBY6ACAI.js";import"./342NLOE4.js";import{c as u,f as s,h as c,r as a,s as h,w as m}from"./XEUTOLXY.js";import{d as g,e as d}from"./NDNDJ2JJ.js";import"./GG4ET4QB.js";import"./JY7ZLNIM.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=u`: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)}}`,n=class extends h{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=f(),this._colorizeStyle="",this._filterValue="",this.arcgisClose=a({bubbles:!1}),this.arcgisItemSelected=a({bubbles:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0}}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(()=>{d(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.arcgisItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisClose.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code)}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=p(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??c}><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??c}></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=${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??c} ${l(g)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${l(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return s`<style>${this._colorizeStyle}</style><calcite-flow ${l(this.flowFocusHandler)}><calcite-flow-item .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=suggestions>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};m("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import"./JY7ZLNIM.js";var e={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t={defaultToken:"",tokenPostfix:".css",ws:`[
|
|
5
5
|
\r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r
|
|
6
6
|
]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};export{e as conf,t as language};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{b as f}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{b as f}from"./FV2GPYN6.js";import{a as u}from"./YQW7CW6V.js";import{c as d,f as i,r as a,s as h,w as m}from"./XEUTOLXY.js";import{e as c,o as n}from"./NDNDJ2JJ.js";import"./JY7ZLNIM.js";var g=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)}}`;function b(l){l.key==="Enter"&&l.stopPropagation()}var o=class extends h{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=u(),this._filterValue="",this._flowItemRenderers=[],this._mode="profile",this._mutationCounter=1,this.loading=!1,this.arcgisClose=a({bubbles:!1}),this.arcgisItemSelected=a({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_mode:16,_mutationCounter:16,loading:5,modelId:1,variable:0}}static{this.styles=g}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){this._mode=this.variable?.type==="featureSet"?"featureSet":"profile"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isMode(e){return this._mode===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{c(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}_emitClose(){this.arcgisClose.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let s=e;(!s.key||s.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(s=>this.renderCollectionBasedVariable(t,!1,s))}_getHeadingForCollection(e){if(!e)return"";switch(this._mode){case"profile":return this.messages.profilevariables??"";case"featureSet":return this.messages.fields??""}}_getDescriptionForCollection(e){if(!e)return"";switch(this._mode){case"profile":return e.breadcrumb;case"featureSet":return e.variables[0]?.getLabel()??""}}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let r=this.loading;return!r&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{console.error("Error loading collection"),r=!1}),r=!0),i`<calcite-flow-item .heading=${this._getHeadingForCollection(e)} .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._isMode("featureSet")} 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></calcite-input>${r?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list label=variables>${this.renderEditorVariables(e)}</calcite-list>`}</calcite-flow-item>`}renderEditorVariables(e){let t=n(this._filterValue),s=e.variables.filter(r=>r.passFilter(t));return s.length?s.map(r=>this.renderEditorVariable(r)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){switch(e.type){case"group":return this._isMode("featureSet")&&e.isHeader?i`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>`:this._isMode("featureSet")&&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=${b}></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.loading&&this.variable?.loaded&&!this.variable?.variables.length?i`<calcite-flow><calcite-flow-item .heading=${this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.noprofilevariablesmessage}</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>`}};m("arcgis-editor-variables",o);export{o as ArcgisEditorVariables};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
4
|
function u(t){switch(t.type){case"oid":return"key";case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"global-id":case"guid":return"key";case"string":return"string";case"date":return"date-time";case"date-only":return"calendar";case"time-only":return"clock";case"timestamp-offset":return"time-zone";default:return"cube"}}function c(t){switch(t.type){case"small-integer":case"integer":case"big-integer":case"single":case"double":case"long":case"oid":return"number";case"global-id":case"guid":case"string":return"text";case"date":return"date";case"date-only":return"dateOnly";case"time-only":return"time";default:return"text"}}function w(t){return(t??[]).filter(r=>{switch(r.type){case"string":case"small-integer":case"integer":case"big-integer":case"single":case"double":case"long":case"date":case"date-only":case"time-only":case"timestamp-offset":case"oid":case"guid":case"global-id":return!0;default:return!1}})}function p(t){return t.alias||t.name}var e=typeof window<"u"&&"$arcgis"in window&&typeof window.$arcgis=="object"&&"import"in window.$arcgis&&!("forceESM"in window.$arcgis);function n(t){return t.default!==void 0}async function i(){if(e)return await window.$arcgis.import("esri/layers/FeatureLayer");let t=await import("@arcgis/core/layers/FeatureLayer.js");return n(t)?t.default:t}async function d(t){let r=await i();return new r(t)}async function o(){if(e)return await window.$arcgis.import("esri/portal/PortalItem");let t=await import("@arcgis/core/portal/PortalItem.js");return n(t)?t.default:t}async function l(t){let r=await o();return new r(t)}async function a(){if(e)return await window.$arcgis.import("esri/WebMap");let t=await import("@arcgis/core/WebMap.js");return n(t)?t.default:t}async function f(t){let r=await a();return new r(t)}async function s(){if(e)return await window.$arcgis.import("esri/WebScene");let t=await import("@arcgis/core/WebScene.js");return n(t)?t.default:t}async function y(t){let r=await s();return new r(t)}async function g(){if(e)return await window.$arcgis.import("esri/arcade");let t=await import("@arcgis/core/arcade.js");return n(t)?t.default:t}async function S(){if(e)return await window.$arcgis.import("esri/request");let t=await import("@arcgis/core/request.js");return n(t)?t.default:t}export{d as a,l as b,f as c,y as d,g as e,S as f,u as g,c as h,w as i,p as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{b as u,c as f,d as v,e as k,f as S,g as T}from"./YQ3E4XRK.js";import{a as M}from"./TCAWMH3O.js";import{i as P}from"./GJOV5ZD7.js";import{c as y,f as e,r as $,s as x,t as p,u as d,w}from"./U74MDVEL.js";import{n as m,p as n}from"./BHWDK64C.js";import"./3KNOXMMF.js";var L=y`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`,a={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:l=>l.currentTarget.selectedItems.forEach(t=>t.selected=!1)},r={onClick:l=>{let t=l.currentTarget;t.expanded=!t.expanded}};function o(l){return e`<span class="dictionary-property">${l}</span><span>: </span>`}function C(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(l.castAsJson(),void 0,2)}</calcite-tree-item></calcite-tree>`}function R(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${o("type")}${l.type}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${o("value")}<span class="string-value">${JSON.stringify(l,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`}function h(l){switch(l.type){case"unknown":case"null":return e`<span class="constant-value">${l.type}</span>`;case"text":return e`<span class="string-value">${m(l.value)}</span>`;case"number":return e`<span class="number-value">${l.value.toString()}</span>`;case"boolean":return e`<span class="constant-value">${l.value.toString()}</span>`;case"date":return e`<span class="date-value">${k(l)}</span>`;case"dateOnly":return e`<span class="string-value">${m(S(l))}</span>`;case"time":return e`<span class="string-value">${m(T(l))}</span>`;default:return null}}function A(l){let t=P(l.value.fields);return e`<table><thead><tr>${t.map(i=>e`<th>${i.name}</th>`)}</tr></thead><tbody>${l.features.map(i=>e`<tr>${t.map(c=>{try{let s=v(i.field(c.name));return e`<td>${h(s)}</td>`}catch{return e`<td></td>`}})}</tr>`)}</tbody></table>`}var b=class extends x{constructor(){super(...arguments),this.messages=M(),this.openedResultPanel="output",this.arcgisClose=$({bubbles:!1}),this.arcgisOpenedResultPanelChange=$({bubbles:!1})}static{this.properties={consoleLogs:0,loading:5,openedResultPanel:3,result:0}}static{this.styles=L}updateResultPanel(t){this.openedResultPanel=t,this.arcgisOpenedResultPanelChange.emit(t)}_switchResultPanel(t){if(!t.target)return;let i=t.target?.dataset.panelName;i&&this.updateResultPanel(i)}_emitClose(){this.arcgisClose.emit()}renderConsolePanel(){return this.openedResultPanel!=="console"?null:this.loading&&!this.consoleLogs?.length?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length?this.consoleLogs.map(t=>e`<p>${t}</p>`):e`<p>${this.messages.consolemessage}</p>`}</div>`}renderLogPanel(){if(this.openedResultPanel!=="log")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;let t=this.result?.type==="error"?"color-error":"color-success";return e`<calcite-list label=results>${this.result?e`<calcite-list-item .label=${n(this.messages.lastexecutionformat,{timeStamp:new Intl.DateTimeFormat(this.messages._t9nLocale,{dateStyle:"medium",timeStyle:"medium"}).format(this.result.timeStamp)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.compilationtimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.compilationTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.executiontimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.executionTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item>`:e`<calcite-list-item .label=${this.messages.runscriptmessage}><calcite-icon slot=content-start icon=information scale=s class="color-info"></calcite-icon></calcite-list-item>`}</calcite-list>`}renderOutputPanel(){if(this.openedResultPanel!=="output")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;switch(this.result?.type){case"error":return e`<div class="result-value-simple flex-adjustable">${n(this.messages.executionerrorformat,{message:this.result.value})}</div>`;case"null":case"unknown":return e`<div class="result-value-simple ltr-container">${h(this.result)}</div>`;case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}: </span>${h(this.result)}</div>`;case"array":{let t=(this.result.value??[]).slice(0,u);return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.renderArrayHeader(this.result)}</div>${this.renderArrayTree(t,!0)}</calcite-tree-item></calcite-tree></div>`}case"geometry":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${R(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"attachment":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${C(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"feature":case"dictionary":case"portal":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${this.renderDictionaryTree(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"featureSet":return e`<div class="result-value-table ltr-container">${this.renderFeatureSetLabel(this.result)}${A(this.result)}</div>`;case"knowledgeGraph":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}: </span><span class="string-value">${this.result.value.url}</span></div>`;default:return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`}}renderArrayHeader(t){let i=t.value??[],c=Math.max(i.length-u,0);return e`<span>${`${t.type}(${i.length??0})`}</span>${c>0?e`<span> ${n(this.messages.showingfirstitemsformat,{count:u.toString()})}</span>`:null}`}renderArrayTree(t,i=!1){return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.map((c,s)=>{let g=v(c);return this.renderTreeItem(g,s,!i)})}</calcite-tree>`}renderDictionaryTree(t,i=!1){let c=t.geometry?.();return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.keys().map(s=>{let g=v(t.field(s));return this.renderTreeItem(g,s)})}${c?this.renderTreeItem({type:"geometry",value:c},"geometry"):null}</calcite-tree>`}renderTreeItem(t,i,c=!1){switch(t.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<calcite-tree-item><div class="tree-item-label">${o(i)}${h(t)}</div></calcite-tree-item>`;case"array":{let s=(t.value??[]).slice(0,u);return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}${this.renderArrayHeader(t)}</div>${this.renderArrayTree(s,!0)}</calcite-tree-item>`}case"geometry":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${R(t.value,!0)}</calcite-tree-item>`;case"attachment":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${C(t.value,!0)}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${this.renderDictionaryTree(t.value,!0)}</calcite-tree-item>`;default:return null}}renderFeatureSetLabel(t){return e`<div class="value-type"><span>${t.type}:</span>${t.features.length>=f?e`<span> ${n(this.messages.showingfirstitemsformat,{count:f.toString()})}</span>`:null}</div>`}render(){return e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel==="output"} .text=${this.messages.output??""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output></calcite-action><calcite-action .active=${this.openedResultPanel==="console"} .text=${this.messages.console??""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console></calcite-action><calcite-action .active=${this.openedResultPanel==="log"} .text=${this.messages.log??""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close??""} @click=${this._emitClose}></calcite-action></header><article class="flex-adjustable">${this.loading?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`}};w("arcgis-arcade-results",b);export{b as ArcgisArcadeResults};
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{b as u,c as f,d as v,e as k,f as S,g as T}from"./LQL74H5T.js";import{a as M}from"./YQW7CW6V.js";import{i as P}from"./QOVT3RPP.js";import{c as y,f as e,r as $,s as x,t as p,u as d,w}from"./XEUTOLXY.js";import{n as m,p as n}from"./NDNDJ2JJ.js";import"./JY7ZLNIM.js";var L=y`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`,a={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:l=>l.currentTarget.selectedItems.forEach(t=>t.selected=!1)},r={onClick:l=>{let t=l.currentTarget;t.expanded=!t.expanded}};function o(l){return e`<span class="dictionary-property">${l}</span><span>: </span>`}function C(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(l.castAsJson(),void 0,2)}</calcite-tree-item></calcite-tree>`}function R(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${o("type")}${l.type}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${o("value")}<span class="string-value">${JSON.stringify(l,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`}function h(l){switch(l.type){case"unknown":case"null":return e`<span class="constant-value">${l.type}</span>`;case"text":return e`<span class="string-value">${m(l.value)}</span>`;case"number":return e`<span class="number-value">${l.value.toString()}</span>`;case"boolean":return e`<span class="constant-value">${l.value.toString()}</span>`;case"date":return e`<span class="date-value">${k(l)}</span>`;case"dateOnly":return e`<span class="string-value">${m(S(l))}</span>`;case"time":return e`<span class="string-value">${m(T(l))}</span>`;default:return null}}function A(l){let t=P(l.value.fields);return e`<table><thead><tr>${t.map(i=>e`<th>${i.name}</th>`)}</tr></thead><tbody>${l.features.map(i=>e`<tr>${t.map(c=>{try{let s=v(i.field(c.name));return e`<td>${h(s)}</td>`}catch{return e`<td></td>`}})}</tr>`)}</tbody></table>`}var b=class extends x{constructor(){super(...arguments),this.messages=M(),this.openedResultPanel="output",this.arcgisClose=$({bubbles:!1}),this.arcgisOpenedResultPanelChange=$({bubbles:!1})}static{this.properties={consoleLogs:0,loading:5,openedResultPanel:3,result:0}}static{this.styles=L}updateResultPanel(t){this.openedResultPanel=t,this.arcgisOpenedResultPanelChange.emit(t)}_switchResultPanel(t){if(!t.target)return;let i=t.target?.dataset.panelName;i&&this.updateResultPanel(i)}_emitClose(){this.arcgisClose.emit()}renderConsolePanel(){return this.openedResultPanel!=="console"?null:this.loading&&!this.consoleLogs?.length?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length?this.consoleLogs.map(t=>e`<p>${t}</p>`):e`<p>${this.messages.consolemessage}</p>`}</div>`}renderLogPanel(){if(this.openedResultPanel!=="log")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;let t=this.result?.type==="error"?"color-error":"color-success";return e`<calcite-list label=results>${this.result?e`<calcite-list-item .label=${n(this.messages.lastexecutionformat,{timeStamp:new Intl.DateTimeFormat(this.messages._t9nLocale,{dateStyle:"medium",timeStyle:"medium"}).format(this.result.timeStamp)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.compilationtimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.compilationTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.executiontimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.executionTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item>`:e`<calcite-list-item .label=${this.messages.runscriptmessage}><calcite-icon slot=content-start icon=information scale=s class="color-info"></calcite-icon></calcite-list-item>`}</calcite-list>`}renderOutputPanel(){if(this.openedResultPanel!=="output")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;switch(this.result?.type){case"error":return e`<div class="result-value-simple flex-adjustable">${n(this.messages.executionerrorformat,{message:this.result.value})}</div>`;case"null":case"unknown":return e`<div class="result-value-simple ltr-container">${h(this.result)}</div>`;case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}: </span>${h(this.result)}</div>`;case"array":{let t=(this.result.value??[]).slice(0,u);return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.renderArrayHeader(this.result)}</div>${this.renderArrayTree(t,!0)}</calcite-tree-item></calcite-tree></div>`}case"geometry":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${R(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"attachment":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${C(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"feature":case"dictionary":case"portal":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${this.renderDictionaryTree(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"featureSet":return e`<div class="result-value-table ltr-container">${this.renderFeatureSetLabel(this.result)}${A(this.result)}</div>`;case"knowledgeGraph":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}: </span><span class="string-value">${this.result.value.url}</span></div>`;default:return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`}}renderArrayHeader(t){let i=t.value??[],c=Math.max(i.length-u,0);return e`<span>${`${t.type}(${i.length??0})`}</span>${c>0?e`<span> ${n(this.messages.showingfirstitemsformat,{count:u.toString()})}</span>`:null}`}renderArrayTree(t,i=!1){return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.map((c,s)=>{let g=v(c);return this.renderTreeItem(g,s,!i)})}</calcite-tree>`}renderDictionaryTree(t,i=!1){let c=t.geometry?.();return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.keys().map(s=>{let g=v(t.field(s));return this.renderTreeItem(g,s)})}${c?this.renderTreeItem({type:"geometry",value:c},"geometry"):null}</calcite-tree>`}renderTreeItem(t,i,c=!1){switch(t.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<calcite-tree-item><div class="tree-item-label">${o(i)}${h(t)}</div></calcite-tree-item>`;case"array":{let s=(t.value??[]).slice(0,u);return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}${this.renderArrayHeader(t)}</div>${this.renderArrayTree(s,!0)}</calcite-tree-item>`}case"geometry":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${R(t.value,!0)}</calcite-tree-item>`;case"attachment":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${C(t.value,!0)}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${this.renderDictionaryTree(t.value,!0)}</calcite-tree-item>`;default:return null}}renderFeatureSetLabel(t){return e`<div class="value-type"><span>${t.type}:</span>${t.features.length>=f?e`<span> ${n(this.messages.showingfirstitemsformat,{count:f.toString()})}</span>`:null}</div>`}render(){return e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel==="output"} .text=${this.messages.output??""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output></calcite-action><calcite-action .active=${this.openedResultPanel==="console"} .text=${this.messages.console??""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console></calcite-action><calcite-action .active=${this.openedResultPanel==="log"} .text=${this.messages.log??""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close??""} @click=${this._emitClose}></calcite-action></header><article class="flex-adjustable">${this.loading?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`}};w("arcgis-arcade-results",b);export{b as ArcgisArcadeResults};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{b,d,e as g,f as F,g as M}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{b,d,e as g,f as F,g as M}from"./LY4YCZAV.js";import{b as m,c as y,d as h}from"./7CECRXJA.js";import{x as f}from"./XEUTOLXY.js";import{j as u}from"./NDNDJ2JJ.js";var A=o=>{let e=o.variables[0],i=e&&e.type==="featureSet"?w(e):void 0,{apiVersion:t,bundles:a,hiddenApiItems:s}=o.toEditorProfileDefinition();return{apiVersion:t,bundles:a,variables:i?[i]:[],hiddenApiItems:s?.map(r=>r.toLowerCase())}};function w(o){let{name:e}=o,i=o.getDescription(),{definition:t}=o.toProfileVariableDefinition(),a={label:e,detail:e,insertText:e,insertTextMode:h.asIs,insertTextFormat:y.PlainText,kind:m.Field},s={name:e,description:i,type:"dictionary",properties:[],completion:a};if(!t||!("fields"in t))return s;let[r,l]=g(t.fields,i);return s.properties=r,a.documentation={kind:"markdown",value:l},s}var P={id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]};function T(){return P}function I(o){if(!d(o))return;let e=T();if(!e)return;let i={variables:[],hiddenApiItems:o.hiddenApiItems?.map(t=>t.toLowerCase())};return e.variables.forEach(t=>{if(o.disabledVariables?.includes(t.name))return;let a=o.definitions[t.name];switch(t.type){case"featureSet":return b(a)?i.variables.push({...t,type:t.type,definition:a}):void 0;default:throw Error(`sdkVariable type not supported (yet) type: ${t.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(e,i){let t=this._getApiKey(e);this._layerMap.set(t,i)}getFeatureLayerForModel(e){let i=this._getApiKey(e);return this._layerMap.get(i)}async setProfileForModel(e,i,t={locale:"en"}){d(i)&&(i=I(i));let a=await u(t.locale,f("./assets/editor-profile/t9n"),"messages.");if(!a)throw new Error(`Failed to load the language bundle for ${t.locale}`);this.disposeForModel(e);let s=this._getApiKey(e),r=new F(i,a);this._modelToProfileMap.set(s,r);let l=A(r);this.updateApiContextForModel(e,{locale:t.locale,profile:l});let c=i?.variables?.find(v=>v.name==="$layer");c&&this.updateFeatureLayerForModel(e,c.definition)}},n=new p,k={setProfileForModel:n.setProfileForModel.bind(n),getApiLibraryForModel:n.getApiLibraryForModel.bind(n)};export{n as a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{a as T,b as M,c as j,d as m,e as A,f as F,g as $}from"./
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{a as T,b as M,c as j,d as m,e as A,f as F,g as $}from"./LY4YCZAV.js";import{b as f,c as d,d as l}from"./7CECRXJA.js";import{f as v}from"./QOVT3RPP.js";import{x as u}from"./XEUTOLXY.js";import{i as h,j as g,w as k,x}from"./NDNDJ2JJ.js";function L(){return!!window.MonacoEnvironment?.getWorkerUrl}var V=new Map;function G(e){L()||(window.MonacoEnvironment={getWorker:async(n,t)=>{let a=V.get(t)??`${e}/code-editor/editor.worker.js`;switch(t){case"json":a=`${e}/code-editor/json.worker.js`;break;case"css":a=`${e}/code-editor/css.worker.js`;break;case"html":a=`${e}/code-editor/html.worker.js`;break;case"typescript":case"javascript":a=`${e}/code-editor/ts.worker.js`;break;case"arcade":a=`${e}/code-editor/arcade.worker.js`;break;case"arcgis-sql-expression":a=`${e}/code-editor/sql-expr.worker.js`;break}if(!x(a)||k(a,globalThis.location.href,!0))return new Worker(a,{name:t});let r=await(await v())(a,{responseType:"text"});return new Worker(URL.createObjectURL(new Blob([r.data],{type:"text/javascript"})))}})}async function z(){return(await E()).getArcadeDiagnosticService()}async function E(){return await import("./K2IVEQE5.js")}async function D(e){let{apiVersion:n,bundles:t,hiddenApiItems:a}=e.toEditorProfileDefinition(),r=await P(e.dictionaryVariables);return{apiVersion:n,bundles:t,variables:r,hiddenApiItems:a?.map(i=>i.toLowerCase())}}async function P(e,n=f.Variable){return await Promise.all(e.map(async t=>{switch(t.type){case"dictionary":return await R(t,n);case"feature":return await C(t,n);default:return S(t,n)}}))}function S(e,n){let{name:t,type:a}=e,r=e.getDescription();return{name:t,description:r,type:a,completion:{label:t,detail:t,insertText:t,insertTextMode:l.asIs,insertTextFormat:d.PlainText,kind:n,documentation:{kind:"markdown",value:r}}}}async function C(e,n){let t=await e.loadSource(),{name:a}=e,r=e.getDescription(),i={label:a,detail:a,insertText:a,insertTextMode:l.asIs,insertTextFormat:d.PlainText,kind:n},s={name:a,description:r,type:"dictionary",properties:[],completion:i};if(!t)return s;let[o,c]=A(t.fields,r,!0);return s.properties=o,i.documentation={kind:"markdown",value:c},s}async function R(e,n){let{name:t,dictionaryVariables:a}=e,r=e.getDescription(),i=a.reduce((s,o)=>{s!==""&&(s+=`
|
|
5
5
|
|
|
6
6
|
`),s+=`**${o.name}**
|
|
7
7
|
${o.type}`;let c=o.getDescription();return c&&(s+=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
3
|
-
v4.33.0-next.
|
|
4
|
-
import{a as f,h as c}from"./YQ3E4XRK.js";import{a as E,b as S}from"./QBSA2GCR.js";import{a as w}from"./TCAWMH3O.js";import{a as v,b as P,d as s}from"./PPSKD4XC.js";import"./AZYGJSMF.js";import"./PNWMM6QM.js";import"./GJOV5ZD7.js";import"./3CBW2VEP.js";import"./5525TVLI.js";import{c as g,e as u,f as t,h as n,r,s as _,w as m,x}from"./U74MDVEL.js";import{a as h,h as p}from"./BHWDK64C.js";import{Hl as b,kk as D}from"./FT7Z65RJ.js";import"./3KNOXMMF.js";D();var C=d=>{if(!d.toString().includes("calcite-flow-item"))throw new Error("Renderer must return a JSX node that starts with <calcite-flow-item>");return!0},R=g`@layer{arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.sticky{position:sticky;top:0;z-index:10}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}.main-action-bar{border-bottom:var(--arcgis-coding-components-border);flex:0 0 auto;calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}arcgis-arcade-results{border-top:var(--arcgis-coding-components-border);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}}}`,l=class extends _{constructor(){super(...arguments),this._codeEditorElt=E(),this._componentReadyDefer=new h,this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=w(),this._modelId=p(),this._openArcadeHelp=()=>void window.open(f,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let i=e.target?.dataset.panelName??"none";this.openedSidePanel=i===this.openedSidePanel?"none":i,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(console.error)},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:2,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0}}static{this.shadowRootOptions=u}static{this.styles=R}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getEditorInstance(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.editorInstance}async getScript(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.value}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let i=this._codeEditorElt.value?.value;return await c(e.definition,i,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=x("./assets");v(e),await this._updateEditorProfile()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&s.updateApiContextForModel(this._modelId,{snippets:this.snippets})}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await P();this._disposables.push(e.onDiagnosticsChange(i=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(i.diagnostics))),this.testData&&this._addExecuteScriptAction(),await this._codeEditorElt.value?.setFocus()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._showExecutionPanel&&this._executeScript().catch(console.error)}async _updateEditorProfile(){this._preparingArcade=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let i=await this._editorProfilePromise;if(!i){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let a=this._codeEditorElt.value?.value;this._executionResult=await c(i.definition,a,e,o=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,o],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(console.error)}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(console.error)}_onResultPanelChange(e){this._resultPanel=e.detail}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[b.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(console.error)}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let i=this._disposables.indexOf(e);i!==-1&&this._disposables.splice(i,1),e.dispose()}renderMainActionBar(){return this.testData?t`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>void this._executeScript().catch(console.error)}></calcite-action>${this._executionResult?t`<calcite-action .text=${this.messages.lastresults??""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`:null}renderMainPanel(){return t`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${s.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${S(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:i,icon:a,active:o,panelName:$,iconFlipRtl:A=!1,onClick:y=this._toggleSidePanel}){return t`<calcite-action id=${e??n} .text=${i} .textEnabled=${this.sideActionBarExpanded} .icon=${a} .active=${o} @click=${y} data-panel-name=${$??n} .iconFlipRtl=${A}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip .referenceElement=${e}><span>${i}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this.customPanels?.map(e=>this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;switch(this.openedSidePanel){case"api":return t`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-language-api-panel>`;case"variables":return t`<arcgis-editor-variables class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile}></arcgis-editor-variables>`;case"suggestions":return t`<arcgis-arcade-suggestions class="side-panel flex-panel border-inline-start" .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`;case"none":return null}let e=this.customPanels?.find(i=>i.id===this.openedSidePanel);if(e){let i=!!e?.useFlows;return t`<calcite-flow class="side-panel flex-panel border-inline-start">${i&&C(e.renderer)?e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)}):t`<calcite-flow-item .heading=${e.name} closable @calciteFlowItemClose=${this._toggleSidePanel} .description=${e.description}>${e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)})}</calcite-flow-item>`}</calcite-flow>`}return null}renderResultsPanel(){return this._showExecutionPanel?t`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){return t`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`}};m("arcgis-arcade-editor",l);export{l as ArcgisArcadeEditor};
|
|
3
|
+
v4.33.0-next.76 */
|
|
4
|
+
import{a as f,h as c}from"./LQL74H5T.js";import{a as E,b as S}from"./FV2GPYN6.js";import{a as w}from"./YQW7CW6V.js";import{a as v,b as P,d as s}from"./UGR2JQRN.js";import"./LY4YCZAV.js";import"./7CECRXJA.js";import"./QOVT3RPP.js";import"./JBY6ACAI.js";import"./342NLOE4.js";import{c as g,e as u,f as t,h as n,r,s as _,w as m,x}from"./XEUTOLXY.js";import{a as h,h as p}from"./NDNDJ2JJ.js";import{Hl as b,kk as D}from"./GG4ET4QB.js";import"./JY7ZLNIM.js";D();var C=d=>{if(!d.toString().includes("calcite-flow-item"))throw new Error("Renderer must return a JSX node that starts with <calcite-flow-item>");return!0},R=g`@layer{arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.sticky{position:sticky;top:0;z-index:10}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}.main-action-bar{border-bottom:var(--arcgis-coding-components-border);flex:0 0 auto;calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}arcgis-arcade-results{border-top:var(--arcgis-coding-components-border);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}}}`,l=class extends _{constructor(){super(...arguments),this._codeEditorElt=E(),this._componentReadyDefer=new h,this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=w(),this._modelId=p(),this._openArcadeHelp=()=>void window.open(f,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let i=e.target?.dataset.panelName??"none";this.openedSidePanel=i===this.openedSidePanel?"none":i,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(console.error)},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:2,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0}}static{this.shadowRootOptions=u}static{this.styles=R}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getEditorInstance(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.editorInstance}async getScript(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.value}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let i=this._codeEditorElt.value?.value;return await c(e.definition,i,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=x("./assets");v(e),await this._updateEditorProfile()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&s.updateApiContextForModel(this._modelId,{snippets:this.snippets})}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await P();this._disposables.push(e.onDiagnosticsChange(i=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(i.diagnostics))),this.testData&&this._addExecuteScriptAction(),await this._codeEditorElt.value?.setFocus()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._showExecutionPanel&&this._executeScript().catch(console.error)}async _updateEditorProfile(){this._preparingArcade=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let i=await this._editorProfilePromise;if(!i){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let a=this._codeEditorElt.value?.value;this._executionResult=await c(i.definition,a,e,o=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,o],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(console.error)}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(console.error)}_onResultPanelChange(e){this._resultPanel=e.detail}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[b.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(console.error)}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let i=this._disposables.indexOf(e);i!==-1&&this._disposables.splice(i,1),e.dispose()}renderMainActionBar(){return this.testData?t`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>void this._executeScript().catch(console.error)}></calcite-action>${this._executionResult?t`<calcite-action .text=${this.messages.lastresults??""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`:null}renderMainPanel(){return t`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${s.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${S(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:i,icon:a,active:o,panelName:$,iconFlipRtl:A=!1,onClick:y=this._toggleSidePanel}){return t`<calcite-action id=${e??n} .text=${i} .textEnabled=${this.sideActionBarExpanded} .icon=${a} .active=${o} @click=${y} data-panel-name=${$??n} .iconFlipRtl=${A}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip .referenceElement=${e}><span>${i}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this.customPanels?.map(e=>this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;switch(this.openedSidePanel){case"api":return t`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-language-api-panel>`;case"variables":return t`<arcgis-editor-variables class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile}></arcgis-editor-variables>`;case"suggestions":return t`<arcgis-arcade-suggestions class="side-panel flex-panel border-inline-start" .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`;case"none":return null}let e=this.customPanels?.find(i=>i.id===this.openedSidePanel);if(e){let i=!!e?.useFlows;return t`<calcite-flow class="side-panel flex-panel border-inline-start">${i&&C(e.renderer)?e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)}):t`<calcite-flow-item .heading=${e.name} closable @calciteFlowItemClose=${this._toggleSidePanel} .description=${e.description}>${e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)})}</calcite-flow-item>`}</calcite-flow>`}return null}renderResultsPanel(){return this._showExecutionPanel?t`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){return t`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`}};m("arcgis-arcade-editor",l);export{l as ArcgisArcadeEditor};
|