@arcgis/coding-components
Version:
Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.
4 lines • 3.81 kB
JavaScript
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
v4.33.14 */
export default $arcgis.t(([{createArcadeExecutor:m}])=>{var k="https://developers.arcgis.com/arcade/",E=100,v=100;function C(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function g(e){return!!e&&typeof e=="object"&&"arcadeDeclaredClass"in e&&typeof e.arcadeDeclaredClass=="string"&&e.arcadeDeclaredClass==="esri.arcade.Feature"}function b(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Dictionary"}function w(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass.startsWith("esri.geometry.")}function R(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass.startsWith("esri.rest.knowledgeGraph.KnowledgeGraph")}function h(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Portal"}function j(e){return!!e&&typeof e=="object"&&"declaredClass"in e&&typeof e.declaredClass=="string"&&e.declaredClass==="esri.arcade.Attachment"}function A(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.arcade.arcadedate"}function D(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.core.sql.dateonly"}function F(e){return!!e&&typeof e=="object"&&"declaredRootClass"in e&&typeof e.declaredRootClass=="string"&&e.declaredRootClass==="esri.core.sql.timeonly"}function S(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 Z(e){return e==null?{type:"null"}:Array.isArray(e)?{type:"array",value:e}:S(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"}:A(e)?{type:"date",value:e}:D(e)?{type:"dateOnly",value:e}:F(e)?{type:"time",value:e}:j(e)?{type:"attachment",value:e}:h(e)?{type:"portal",value:e}:C(e)?{type:"featureSet",value:e,features:[],iterator:null}:g(e)?{type:"feature",value:e}:b(e)?{type:"dictionary",value:e}:w(e)?{type:"geometry",value:e}:R(e)?{type:"knowledgeGraph",value:e}:{type:"unknown"}}function G(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 B(e){return e.value.toString()}function I(e){return e.value.toString()}async function x(e,r="system"){let a=Z(e);return a.type!=="featureSet"||(await a.value.load(),a.iterator=a.value.iterator({aborted:!1}),a.features=await a.iterator.nextBatchAsArcadeFeatures(v,r)??[]),a}async function O(e,r,a,s){let l=new Date;s??=()=>{};try{let o=performance.now(),n=await m(r??"",{variables:e?.variables??[]}),c=performance.now(),{profileVariableInstances:u,spatialReference:d,timeZone:i,services:y}=a,p={spatialReference:d,timeZone:i,rawOutput:!0,console:s,services:y},f=await n.executeAsync(u,p),t=await x(f,i);return t.timeStamp=l,t.compilationTime=c-o,t.executionTime=performance.now()-c,t}catch(o){let n="Unknown Error";return o instanceof Error&&(n=o.message),{type:"error",value:n,error:o,timeStamp:l,compilationTime:0,executionTime:0}}}return{a:k,b:E,c:v,d:Z,e:G,f:B,g:I,h:O}},"arcade")