UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 21 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import e from"../config.js";import{version as t}from"../kernel.js";import{ArcadeDate as n,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as i}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as o,ExecutionErrorCodes as a}from"../arcade/executionError.js";import{ArcadeFunction as u}from"../arcade/FunctionWrapper.js";import s from"../arcade/ImmutableArray.js";import l from"../arcade/ImmutablePathArray.js";import f from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as c,layerGeometryEsriRestConstants as m}from"../arcade/featureset/support/shared.js";import{format as d,parse as y}from"../core/number.js";import{DateOnly as p}from"../core/sql/DateOnly.js";import{TimeOnly as g}from"../core/sql/TimeOnly.js";import h from"../geometry/Extent.js";import b from"../geometry/Geometry.js";import N from"../geometry/Multipoint.js";import S from"../geometry/Point.js";import Z from"../geometry/Polygon.js";import T from"../geometry/Polyline.js";import A from"../geometry/SpatialReference.js";import{isClockwise as k}from"../geometry/support/coordsUtils.js";import{fromJSON as j}from"../geometry/support/jsonUtils.js";import{getLocale as D}from"../intl/locale.js";import{isString as O,isNumber as C,isBoolean as x,isArray as F,isDate as w,isGraphic as J,isInteger as M}from"../support/guards.js";import{DateTime as R}from"luxon";class _{constructor(e){this.value=e}}class I{constructor(e){this.value=e}}const v={type:"VOID"},Y=Symbol("BREAK"),L=Symbol("CONTINUE");function P(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function G(e){return e instanceof u}function V(e){return e instanceof i}function z(e){return!!O(e)||(!!C(e)||(!!te(e)||(!!ne(e)||(!!re(e)||(!!x(e)||(null===e||(e===v||"number"==typeof e)))))))}function q(e,t){return void 0===e?t:e}function E(e){return null==e?"":F(e)||ee(e)?"Array":te(e)?"Date":re(e)?"Time":ne(e)?"DateOnly":O(e)?"String":x(e)?"Boolean":C(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":X(e)?"KnowledgeGraph":e instanceof i?"Module":H(e)?"Feature":e instanceof S?"Point":e instanceof Z?"Polygon":e instanceof T?"Polyline":e instanceof N?"Multipoint":e instanceof h?"Extent":G(e)?"Function":B(e)?"FeatureSet":Q(e)?"FeatureSetCollection":$(e)?"Voxel":e===v?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function U(e){return e instanceof b}function H(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function $(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function B(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function K(e){return"esri.arcade.Dictionary"===e?.declaredClass}function W(e){return K(e)||H(e)||$(e)}function Q(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function X(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function ee(e){return e instanceof s}function te(e){return e instanceof n}function ne(e){return e instanceof p}function re(e){return e instanceof g}function ie(e){return null!=e&&"object"==typeof e}function oe(e,t,n,r,i){if(e.length<t||e.length>n)throw new o(r,a.WrongNumberOfParameters,i)}function ae(e){return e<0?-Math.round(-e):Math.round(e)}function ue(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=P(t,"‰",""),t=P(t,"¤",""),d(e,{pattern:t}))}function se(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(le(t),{locale:D(),numberingSystem:"latn"})}function le(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let n="";const r=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(r)||[])switch(i){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=i;break;default:i.length>=2&&"["===i.slice(0,1)&&"]"===i.slice(-1)?n+=`'${i.slice(1,-1)}'`:n+=`'${i}'`}return n}function fe(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function ce(e,t,r){if(null===e){if(null===t||t===v)return fe(null,null,r);if(C(t))return fe(0,t,r);if(O(t))return fe(0,be(t),r);if(x(t))return fe(0,be(t),r);if(te(t))return fe(0,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}if(e===v){if(null===t||t===v)return fe(null,null,r);if(C(t))return fe(0,t,r);if(O(t))return fe(0,be(t),r);if(x(t))return fe(0,be(t),r);if(te(t))return fe(0,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}else if(C(e)){if(C(t))return fe(e,t,r);if(x(t))return fe(e,be(t),r);if(null===t||t===v)return fe(e,0,r);if(O(t))return fe(e,be(t),r);if(te(t))return fe(e,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}else if(O(e)){if(O(t))return fe(ye(e),ye(t),r);if(te(t))return fe(be(e),t.toNumber(),r);if(re(t))return fe(be(e),t.toNumber(),r);if(ne(t))return fe(be(e),t.toNumber(),r);if(C(t))return fe(be(e),t,r);if(null===t||t===v)return fe(be(e),0,r);if(x(t))return fe(be(e),be(t),r)}else if(te(e)){if(te(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=n.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=n.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),fe(e.toNumber(),t.toNumber(),r);if(null===t||t===v)return fe(e.toNumber(),0,r);if(C(t))return fe(e.toNumber(),t,r);if(x(t))return fe(e.toNumber(),be(t),r);if(O(t))return fe(e.toNumber(),be(t),r);if(re(t))throw new o(null,a.CannotCompareDateAndTime,null);if(ne(t))return fe(e.toNumber(),t.toNumber(),r)}else if(x(e)){if(x(t))return fe(e,t,r);if(C(t))return fe(be(e),be(t),r);if(te(t))return fe(be(e),t.toNumber(),r);if(re(t))return fe(be(e),t.toNumber(),r);if(ne(t))return fe(be(e),t.toNumber(),r);if(null===t||t===v)return fe(be(e),0,r);if(O(t))return fe(be(e),be(t),r)}else if(ne(e)){if(te(t))return fe(e.toNumber(),t.toNumber(),r);if(null===t||t===v)return fe(e.toNumber(),0,r);if(C(t))return fe(e.toNumber(),t,r);if(x(t))return fe(e.toNumber(),be(t),r);if(O(t))return fe(e.toNumber(),be(t),r);if(re(t))throw new o(null,a.CannotCompareDateAndTime,null);if(ne(t))return fe(e.toNumber(),t.toNumber(),r)}else if(re(e)){if(te(t))throw new o(null,a.CannotCompareDateAndTime,null);if(null===t||t===v)return fe(e.toNumber(),0,r);if(C(t))return fe(e.toNumber(),t,r);if(x(t))return fe(e.toNumber(),be(t),r);if(O(t))return fe(e.toNumber(),be(t),r);if(re(t))return fe(e.toNumber(),t.toNumber(),r);if(ne(t))throw new o(null,a.CannotCompareDateAndTime,null)}return!!me(e,t)&&("<="===r||">="===r)}function me(e,t){if(e===t)return!0;if(null===e&&t===v||null===t&&e===v)return!0;if(te(e)&&te(t))return e.equals(t);if(re(e)&&re(t))return e.equals(t);if(ne(e)&&ne(t))return e.equals(t);if(e instanceof l)return e.equalityTest(t);if(e instanceof f)return e.equalityTest(t);if(e instanceof S&&t instanceof S){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(ie(e)&&ie(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function de(e,{useNumbersForDates:t}){let n="";for(const r in e){""!==n&&(n+=",");const i=e[r];null==i?n+=JSON.stringify(r)+":null":x(i)||C(i)||O(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):U(i)?n+=JSON.stringify(r)+":"+ge(i):re(i)||ne(i)?n+=`${JSON.stringify(r)}:${JSON.stringify(i.toString())}`:ee(i)||Array.isArray(i)?n+=JSON.stringify(r)+":"+ge(i,null,t):te(i)?n+=t?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(n+=JSON.stringify(r)+":"+i.castToText(t))}return"{"+n+"}"}function ye(e,t){if(O(e))return e;if(null===e)return"";if(C(e))return ue(e,t);if(x(e))return e.toString();if(te(e))return se(e,t);if(re(e))return e.toFormat(t);if(ne(e))return e.toFormat(t);if(e instanceof b)return JSON.stringify(e.toJSON());if(F(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=he(e[n]);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let n=0;n<e.length();n++)t[n]=he(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():G(e)?"object, Function":e===v?"":V(e)?"object, Module":""}function pe(e){const t=[];if(e instanceof s){for(let n=0;n<e.length();n++)t[n]=be(e.get(n));return t}if(!F(e))return null;for(let n=0;n<e.length;n++)t[n]=be(e[n]);return t}function ge(e,t,n=!1){if(O(e))return e;if(null===e)return"";if(C(e))return ue(e,t);if(x(e))return e.toString();if(te(e))return se(e,t);if(re(e))return e.toFormat(t);if(ne(e))return e.toFormat(t);if(e instanceof b)return e instanceof h?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),((e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0));if(F(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=he(e[r],n);return"["+t.join(",")+"]"}if(e instanceof s){const t=[];for(let r=0;r<e.length();r++)t[r]=he(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(n):G(e)?"object, Function":e===v?"":V(e)?"object, Module":""}function he(e,t=!1){if(null===e)return"null";if(x(e)||C(e)||O(e))return JSON.stringify(e);if(e instanceof b)return ge(e,null,t);if(e instanceof s)return ge(e,null,t);if(Array.isArray(e))return ge(e,null,t);if(te(e))return t?JSON.stringify(e.getTime()):JSON.stringify(se(e,""));if(re(e))return JSON.stringify(e.toString());if(ne(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===v)return"null";return"null"}function be(e,t){return C(e)?e:null===e||""===e?0:te(e)||ne(e)||re(e)?NaN:x(e)?e?1:0:F(e)||""===e||void 0===e?NaN:void 0!==t&&O(e)?(t=P(t,"‰",""),t=P(t,"¤",""),y(e,{pattern:t})):e===v?0:Number(e)}function Ne(e,t){if(te(e))return e;if(O(e)){const r=Se(e,t);if(r)return n.dateTimeToArcadeDate(r)}return null}function Se(e,t){const n=/ (\d\d)/,i=r(t);let o=R.fromISO(e,{zone:i});return o.isValid||n.test(e)&&(e=e.replace(n,"T$1"),o=R.fromISO(e,{zone:t}),o.isValid)?o:null}function Ze(e){return x(e)?e:O(e)?"true"===(e=e.toLowerCase()):!!C(e)&&(0!==e&&!isNaN(e))}function Te(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),j(n)}function Ae(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function ke(e){if(null===e)return null;if(e instanceof S)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof Z){if(0===e.rings.length)return null;for(const t of e.rings)if(t.length>0)return e;return null}if(e instanceof T){if(0===e.paths.length)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof N?0===e.points.length?null:e:e instanceof h?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function je(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(te(t))n=t.toNumber();else if(ne(t))n=t.toString();else if(re(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=ye(t);else{if(null==t)return null;if(""===t)return t;n=be(t)}for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.code===n&&(r=t)}return null===r?ye(t):r.name}function De(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=ye(t);for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.name===r&&(n=t)}return null===n?t:n.code}function Oe(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let i,u,s=null;for(let o=0;o<t.fields.length;o++){const n=t.fields[o];n.name.toLowerCase()===e.toString().toLowerCase()&&(s=n)}if(null===s)throw new o(null,a.FieldNotFound,null,{key:e});let l=t.typeIdField,f="id",c=t.types;if(t.subtypeField&&(l=t.subtypeField,f="code",c=t.subtypes??[]),null===r&&n&&l)r=n.hasField(l)?n.field(l):null;else if(l&&null!==r){let e=!1;for(const t of c||[])if(r===t[f]){e=!0;break}if(!e)for(const t of c||[])if(r===t.name){r=t[f],e=!0;break}e||(r=null,n&&l&&(r=n.hasField(l)?n.field(l):null))}return null!=r&&c.some((e=>e[f]===r&&(i=e.domains?.[s.name],i&&"inherited"===i.type&&(i=Ce(s.name,t),u=!0),!0))),u||i||(i=Ce(e,t)),{field:s,domain:i}}function Ce(e,t){let n;return t.fields.some((t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n))),n}function xe(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},o={key:n,value:e[n]};return i(r,o)}});var i;const o=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,a;if(Array.isArray(t)){for(a="[",i=0;i<t.length;i++)i&&(a+=","),a+=e(t[i])||"null";return a+"]"}if(null===t)return"null";if(o.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=o.push(t)-1,s=Object.keys(t).sort(r?.(t));for(a="",i=0;i<s.length;i++){const n=s[i],r=e(t[n]);r&&(a&&(a+=","),a+=JSON.stringify(n)+":"+r)}return o.splice(u,1),"{"+a+"}"}(e)}function Fe(e){if(null===e)return null;const t=[];for(const n of e)H(n)?t.push(n.geometry()):t.push(n);return t}function we(e,t){if(!(t instanceof S))throw new o(null,a.InvalidParameter,null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Je(e,t){if(F(e)||ee(e)){let n=!1,r=!1,i=[],u=t;if(F(e)){for(const t of e)we(i,t);i.length>0&&(u=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof f)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else{if(!ee(e))throw new o(null,a.InvalidParameter,null);for(const t of e.toArray())we(i,t);i.length>0&&(u=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===i.length)return null;return k(i)||(i=i.slice().reverse()),new Z({rings:[i],spatialReference:u,hasZ:n,hasM:r})}return e}function Me(e,t){if(F(e)||ee(e)){let n=!1,r=!1,i=[],o=t;if(F(e)){for(const t of e)we(i,t);i.length>0&&(o=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())we(i,t);i.length>0&&(o=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new T({paths:[i],spatialReference:o,hasZ:n,hasM:r})}return e}function Re(e,t){if(F(e)||ee(e)){let n=!1,r=!1,i=[],o=t;if(F(e)){for(const t of e)we(i,t);i.length>0&&(o=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())we(i,t);i.length>0&&(o=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new N({points:i,spatialReference:o,hasZ:n,hasM:r})}return e}function _e(e,t=!1){const n=[];if(null===e)return n;if(!0===F(e)){for(let r=0;r<e.length;r++){const i=ye(e[r]);""===i&&!0!==t||n.push(i)}return n}if(e instanceof s){for(let r=0;r<e.length();r++){const i=ye(e.get(r));""===i&&!0!==t||n.push(i)}return n}if(z(e)){const r=ye(e);return""===r&&!0!==t||n.push(r),n}return[]}let Ie=0;function ve(e){return Ie++,Ie%100==0?(Ie=0,new Promise((t=>{setTimeout((()=>{t(e)}),0)}))):e}function Ye(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Le(e,t=null){return null==e?null:x(e)||C(e)||O(e)?e:e instanceof b?!0===t?.keepGeometryType?e:e.toJSON():e instanceof s?e.toArray().map((e=>Le(e,t))):Array.isArray(e)?e.map((e=>Le(e,t))):w(e)?e:te(e)?e.toJSDate():re(e)?e.toString():ne(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Pe(e,t,n,r,i){const o=await Ge(e,t,n);i[r]=o}async function Ge(e,t=null,n=null){if(e instanceof s&&(e=e.toArray()),null==e)return null;if(z(e)||e instanceof b||w(e)||te(e))return Le(e,n);if(Array.isArray(e)){const r=[],i=[];for(const o of e)null===o||z(o)||o instanceof b||w(o)||te(o)?i.push(Le(o,n)):(i.push(null),r.push(Pe(o,t,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function Ve(e){return ze(e)?e.parent:e}function ze(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function qe(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ee(e,t,n){const r=Ve(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return Oe(t,r,e,n)}function Ue(e){const t=Ve(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map((e=>({name:e.name,code:e.code}))):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map((e=>({name:e.name,code:e.id}))):[]}:null:null}function He(e,t,n,r){const i=Ve(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const o=Oe(t,i,e,r);if(void 0===n)try{n=e.field(t)}catch(a){return null}return je(o,n)}function $e(e,t,n,r){const i=Ve(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===n){try{n=e.field(t)}catch(o){return null}return n}return De(Oe(t,i,e,r),n)}function Be(e){return e?.timeZone??"system"}function Ke(e){const t=Ve(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const r of t.fields)n.push(c(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===m[t.geometryType]?"":m[t.geometryType],fields:n}}function We(r,i){const o=n.systemTimeZoneCanonicalName;return"system"===r&&(r=o),{version:Qe,engineVersion:t,timeZone:r,userTimeZone:o,spatialReference:i instanceof A?i.toJSON():i,application:e.applicationName??"",engine:"web",locale:D()}}const Qe="1.30",Xe=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:I,ReturnResult:_,absRound:ae,arcadeVersion:Qe,autoCastArrayOfPointsToMultiPoint:Re,autoCastArrayOfPointsToPolygon:Je,autoCastArrayOfPointsToPolyline:Me,autoCastFeatureToGeometry:Fe,binaryOperator:Ye,breakResult:Y,castAsJson:Le,castAsJsonAsync:Ge,castRecordToText:de,continueResult:L,defaultExecutingContext:We,defaultTimeZone:Be,defaultUndefined:q,equalityTest:me,featureDomainCodeLookup:$e,featureDomainValueLookup:He,featureFullDomain:Ee,featureSchema:Ke,featureSubtypes:Ue,fixNullGeometry:ke,fixSpatialReference:Ae,formatDate:se,formatNumber:ue,getDomain:Oe,getDomainCode:De,getDomainValue:je,getType:E,greaterThanLessThan:ce,isArray:F,isBoolean:x,isDate:te,isDateOnly:ne,isDictionary:K,isDictionaryLike:W,isFeature:H,isFeatureSet:B,isFeatureSetCollection:Q,isFunctionParameter:G,isGeometry:U,isGraphic:J,isImmutableArray:ee,isInteger:M,isJsDate:w,isKnowledgeGraph:X,isModule:V,isNumber:C,isObject:ie,isSimpleType:z,isString:O,isSubtypeGrouplayer:qe,isSubtypeSublayer:ze,isTime:re,isVoxel:$,multiReplace:P,parseGeometryFromJson:Te,pcCheck:oe,stableStringify:xe,standardiseDateFormat:le,tick:ve,toBoolean:Ze,toDate:Ne,toNumber:be,toNumberArray:pe,toString:ye,toStringArray:_e,toStringExplicit:ge,voidOperation:v},Symbol.toStringTag,{value:"Module"}));export{_e as $,ce as A,me as B,Ye as C,oe as D,Fe as E,Je as F,Me as G,Re as H,I,q as J,Be as K,E as L,le as M,ae as N,Ee as O,$e as P,He as Q,_ as R,Ke as S,Ue as T,ke as U,$ as V,P as W,We as X,pe as Y,ze as Z,ve as _,Le as a,Oe as a0,je as a1,De as a2,V as a3,ie as a4,ue as a5,se as a6,Te as a7,xe as a8,qe as a9,Qe as aa,Ge as b,de as c,z as d,Ze as e,ye as f,te as g,Ne as h,G as i,ne as j,re as k,U as l,ee as m,H as n,Q as o,B as p,K as q,X as r,ge as s,be as t,Ae as u,Xe as v,v as w,Y as x,L as y,W as z};