text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/3.38/esri/copyright.txt for details.
  //>>built
  define("esri/arcade/parser",["require","exports","./treeAnalysis","./lib/arcade-parser"],function(t,c,f,m){Object.defineProperty(c,"__esModule",{value:!0});c.referencesFunction=c.referencesMember=c.extractExpectedFieldLiterals=c.validateScript=c.extractFieldLiterals=c.scriptCheck=c.parseScript=void 0;c.parseScript=function(b,a){void 0===a&&(a=[]);b=m.parse("function _() { "+b+"\n}");if(null===b.body||void 0===b.body)throw Error("No formula provided.");if(0===b.body.length)throw Error("No formula provided.");
  if(0===b.body.length)throw Error("No formula provided.");if("BlockStatement"!==b.body[0].body.type)throw Error("Invalid formula content.");var g=f.validateLanguage(b);if(""!==g)throw Error(g);f.findScriptDependencies(b,a);return b};c.scriptCheck=function(b,a,g,p,q){var h=[];b="function _() { \n"+b+"\n}";try{var n=m.parse(b,{tolerant:!0,loc:!0,range:!0}),k=n.errors;if(0<k.length)for(var l=0;l<k.length;l++)h.push({line:k[l].lineNumber-2,character:k[l].column,reason:k[l].description});var d=f.checkScript(n,
  a,g,p,q);for(a=0;a<d.length;a++)d[a].line-=2,d[a].range&&(d[a].range=[d[a][0]-15,d[a][1]-15]),d[a].loc&&(d[a].loc.start.line-=2,d[a].loc.end.line-=2),h.push(d[a])}catch(e){try{if("Unexpected token }"===e.description){var r=b.split("\n").length;e.lineNumber===r?(e.index=b.length-1,h.push({line:e.lineNumber-4,character:e.column,reason:"Unexpected end of script"})):(e.index=b.length-1,h.push({line:e.lineNumber-2,character:e.column,reason:"Unexpected end of script"}))}else h.push({line:e.lineNumber-2,
  character:e.column,reason:e.description})}catch(u){}}return h};c.extractFieldLiterals=function(b,a){void 0===a&&(a=!1);return f.findFieldLiterals(b)};c.validateScript=function(b,a,g){return f.validateScript(b,a,g)};c.extractExpectedFieldLiterals=function(b){return f.findExpectedFieldLiterals(b)};c.referencesMember=function(b,a){return f.referencesMember(b,a)};c.referencesFunction=function(b,a){return f.referencesFunction(b,a)}});