text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.17/esri/copyright.txt for details.
  //>>built
  define("esri/arcade/languageUtils","require exports ../geometry/Geometry ../moment dojo/number ./ImmutableArray ../kernel ./ImmutablePointArray ./ImmutablePathArray dojo/_base/array ../geometry/Point ./FunctionWrapper".split(" "),function(y,d,t,m,z,n,G,H,I,A,B,J){function p(a,b,c){if(""===b||null===b||void 0===b||b===c||b===c)return a;do a=a.replace(b,c);while(-1!==a.indexOf(b));return a}function u(a){return a instanceof C||a instanceof J}function h(a){return"string"===typeof a||a instanceof String}
  function k(a){return"boolean"===typeof a}function l(a){return"number"===typeof a}function r(a){return a instanceof Array}function g(a){return a instanceof Date}function v(a,b){if(!1===isNaN(a)){if(void 0===b||null===b||""===b)return a.toString();b=p(b,"\u2030","");b=p(b,"\u00a4","");return z.format(a,{pattern:b})}return a.toString()}function w(a,b){var c=m(a);return void 0===b||null===b||""===b?c.format():c.format(b)}function e(a,b,c){switch(c){case "\x3e":return a>b;case "\x3c":return a<b;case "\x3e\x3d":return a>=
  b;case "\x3c\x3d":return a<=b}return!1}function D(a,b){if(a===b||null===a&&b===d.voidOperation||null===b&&a===d.voidOperation)return!0;if(g(a)&&g(b))return a.getTime()===b.getTime();if(a instanceof I||a instanceof H)return a.equalityTest(b);if(a instanceof B&&b instanceof B){var c=void 0,x=void 0;d.isVersion4?(c=a.cache._arcadeCacheId,x=b.cache._arcadeCacheId):(c=a.getCacheValue("_arcadeCacheId"),x=b.getCacheValue("_arcadeCacheId"));if(void 0!==c&&null!==c)return c===x}return void 0!==a&&void 0!==
  b&&null!==a&&null!==b&&"object"===typeof a&&"object"===typeof b&&a._arcadeCacheId===b._arcadeCacheId&&void 0!==a._arcadeCacheId&&null!==a._arcadeCacheId?!0:!1}function q(a,b){if(h(a))return a;if(null===a)return"";if(l(a))return v(a,b);if(k(a))return a.toString();if(g(a))return w(a,b);if(a instanceof t)return JSON.stringify(a.toJson());if(r(a)){for(var c=[],d=0;d<a.length;d++)c[d]=s(a[d]);return"["+c.join(",")+"]"}if(a instanceof n){c=[];for(d=0;d<a.length();d++)c[d]=s(a.get(d));return"["+c.join(",")+
  "]"}return null!==a&&"object"===typeof a&&void 0!==a.castToText?a.castToText():u(a)?"object, Function":""}function E(a,b){if(h(a))return a;if(null===a)return"";if(l(a))return v(a,b);if(k(a))return a.toString();if(g(a))return w(a,b);if(a instanceof t)return JSON.stringify(a.toJson());if(r(a)){for(var c=[],d=0;d<a.length;d++)c[d]=s(a[d]);return"["+c.join(",")+"]"}if(a instanceof n){c=[];for(d=0;d<a.length();d++)c[d]=s(a.get(d));return"["+c.join(",")+"]"}return null!==a&&"object"===typeof a&&void 0!==
  a.castToText?a.castToText():u(a)?"object, Function":""}function s(a){if(null!==a){if(k(a)||l(a)||h(a))return JSON.stringify(a);if(a instanceof t||a instanceof n||a instanceof Array)return E(a);if(a instanceof Date)return JSON.stringify(a);if(null!==a&&"object"===typeof a&&void 0!==a.castToText)return a.castToText()}return"null"}function f(a,b){return l(a)?a:null===a||""===a?0:g(a)?NaN:k(a)?a?1:0:""===a||void 0===a?NaN:void 0!==b&&h(a)?(b=p(b,"\u2030",""),b=p(b,"\u00a4",""),z.parse(a,{pattern:b})):
  a===d.voidOperation?0:Number(a)}function F(a,b){var c;A.some(b.fields,function(b){b.name===a&&(c=b.domain);return!!c});return c}y=function(){return function(a){this.value=a}}();var K=function(){return function(a){this.value=a}}(),C=function(){return function(a){this.fn=a}}();d.NativeFunction=C;d.ImplicitResult=K;d.ReturnResult=y;d.isVersion4=0===G.version.indexOf("4.");d.voidOperation={type:"VOID"};d.breakResult={type:"BREAK"};d.continueResult={type:"CONTINUE"};d.multiReplace=p;d.isFunctionParameter=
  u;d.isSimpleType=function(a){return h(a)||l(a)||g(a)||k(a)||null===a||a===d.voidOperation||"number"===typeof a?!0:!1};d.defaultUndefined=function(a,b){return void 0===a?b:a};d.isString=h;d.isBoolean=k;d.isNumber=l;d.isArray=r;d.isImmutableArray=function(a){return a instanceof n};d.isDate=g;d.pcCheck=function(a,b,c){if(a.length<b||a.length>c)throw Error("Function called with wrong number of Parameters");};d.generateUUID=function(){var a=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
  function(b){var c=(a+16*Math.random())%16|0;a=Math.floor(a/16);return("x"===b?c:c&3|8).toString(16)})};d.formatNumber=v;d.formatDate=w;d.greaterThanLessThan=function(a,b,c){if(null===a){if(null===b||b===d.voidOperation)return e(null,null,c);if(l(b))return e(0,b,c);if(h(b)||k(b))return e(0,f(b),c);if(g(b))return e(0,b.getTime(),c)}if(a===d.voidOperation){if(null===b||b===d.voidOperation)return e(null,null,c);if(l(b))return e(0,b,c);if(h(b)||k(b))return e(0,f(b),c);if(g(b))return e(0,b.getTime(),c)}else if(l(a)){if(l(b))return e(a,
  b,c);if(k(b))return e(a,f(b),c);if(null===b||b===d.voidOperation)return e(a,0,c);if(h(b))return e(a,f(b),c);if(g(b))return e(a,b.getTime(),c)}else if(h(a)){if(h(b))return e(q(a),q(b),c);if(g(b))return e(f(a),b.getTime(),c);if(l(b))return e(f(a),b,c);if(null===b||b===d.voidOperation)return e(f(a),0,c);if(k(b))return e(f(a),f(b),c)}else if(g(a)){if(g(b))return e(a,b,c);if(null===b||b===d.voidOperation)return e(a.getTime(),0,c);if(l(b))return e(a.getTime(),b,c);if(k(b)||h(b))return e(a.getTime(),f(b),
  c)}else if(k(a)){if(k(b))return e(a,b,c);if(l(b))return e(f(a),f(b),c);if(g(b))return e(f(a),b.getTime(),c);if(null===b||b===d.voidOperation)return e(f(a),0,c);if(h(b))return e(f(a),f(b),c)}return D(a,b)&&("\x3c\x3d"===c||"\x3e\x3d"===c)?!0:!1};d.equalityTest=D;d.toString=q;d.toNumberArray=function(a){var b=[];if(!1===r(a))return null;if(a instanceof n){for(var c=0;c<a.length();c++)b[c]=f(a.get(c));return b}for(c=0;c<a.length;c++)b[c]=f(a[c]);return b};d.toStringExplicit=E;d.toNumber=f;d.toDate=function(a,
  b){if(g(a))return a;if(h(a)){var c=m(a,[void 0===b||null===b||""===b?m.ISO_8601:b]);if(c.isValid())return c.toDate()}return null};d.toDateM=function(a,b){if(g(a))return m(a);if(h(a)){var c=m(a,[void 0===b||null===b||""===b?m.ISO_8601:b]);if(c.isValid())return c}return null};d.toBoolean=function(a){if(k(a))return a;if(h(a)){if(a=a.toLowerCase(),"true"===a)return!0}else if(l(a))return 0===a||isNaN(a)?!1:!0;return!1};d.fixSpatialReference=function(a,b){if(null===a)return null;if(null===a.spatialReference||
  void 0===a.spatialReference)a.spatialReference=b;return a};d.getDomainValue=function(a,b){if(!a||!a.domain)return null;var c=null;b="esriFieldTypeString"===a.field.type?q(b):f(b);for(var d=0;d<a.domain.codedValues.length;d++){var e=a.domain.codedValues[d];e.code===b&&(c=e)}return null===c?null:c.name};d.getDomainCode=function(a,b){if(!a||!a.domain)return null;var c=null;b=q(b);for(var d=0;d<a.domain.codedValues.length;d++){var e=a.domain.codedValues[d];e.name===b&&(c=e)}return null===c?null:c.code};
  d.getDomain=function(a,b,c,d){void 0===c&&(c=null);if(!b||!b.fields)return null;for(var e=null,f=0;f<b.fields.length;f++){var h=b.fields[f];h.name.toLowerCase()===a.toString().toLowerCase()&&(e=h)}if(null===e)return null;var g,k;d||(d=c&&b.typeIdField&&c._field(b.typeIdField));null!=d&&A.some(b.types,function(a){if(a.id===d){if((g=a.domains&&a.domains[e.name])&&"inherited"===g.type)g=F(e.name,b),k=!0;return!0}return!1},this);!k&&!g&&(g=F(a,b));return{field:e,domain:g}}});