{"size": 28540, "ext": "js", "max_stars_repo_path": "react-dashboard/build/static/js/109.c0adf7c4.chunk.js", "max_stars_repo_name": "dulfrey/unfpa-visual-analytics", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "react-dashboard/build/static/js/109.c0adf7c4.chunk.js", "max_issues_repo_name": "dulfrey/unfpa-visual-analytics", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "react-dashboard/build/static/js/109.c0adf7c4.chunk.js", "max_forks_repo_name": "dulfrey/unfpa-visual-analytics", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 14270.0, "max_line_length": 28493, "alphanum_fraction": 0.6701471619}
(this["webpackJsonpunfpa-front"]=this["webpackJsonpunfpa-front"]||[]).push([[109],{1354:function(e,t,n){"use strict";n.r(t),n.d(t,"executeScript",(function(){return se})),n.d(t,"extend",(function(){return le})),n.d(t,"extractFieldLiterals",(function(){return fe})),n.d(t,"findFunctionCalls",(function(){return pe})),n.d(t,"functionHelper",(function(){return ue})),n.d(t,"referencesFunction",(function(){return Oe})),n.d(t,"referencesMember",(function(){return he})),n.d(t,"validateScript",(function(){return be}));var r=n(14),c=n(1082),a=n(1084),o=n(1008),i=n(1033),u=n(1156),l=n(1107),s=n(1063),f=n(977),b=n(1085),h=n(985),O=n(1158),p=n(1159),d=n(1285),j=n(1160),v=n(1162),g=n(1163),E=n(1211),y=n(28),N=n(57),w=n(110),m=n(209),I=n(54),S=n(121),T=n(118),R=n(48);var P=100;function C(e){return e instanceof Error?Object(y.s)(e):Object(y.s)(new Error(e))}function A(e){return Object(y.t)(e)}function U(e,t){for(var n=[],r=0;r<t.arguments.length;r++)n.push(M(e,t.arguments[r]));return Object(y.b)(n)}function x(e,t,n){return Object(y.c)((function(r,c){U(e,t).then((function(a){try{r(n(e,t,a))}catch(o){c(o)}}),c)}))}function F(e,t,n){try{return U(e,t).then((function(r){try{var c=n(e,t,r);return function(e){return e&&"function"==typeof e.then}(c)?c:Object(y.t)(c)}catch(a){return C(a)}}))}catch(r){return C(r)}}function M(e,t,n){try{if(t.breakpoint&&!0!==n)return t.breakpoint().then((function(){return M(e,t,!0)}));switch(t.type){case"VariableDeclarator":return function(e,t){try{var r=null;return r=null===t.init?Object(y.t)(null):M(e,t.init),null!==e.localScope?r.then((function(n){return Object(y.c)((function(r){if(n===f.P&&(n=null),"Identifier"!==t.id.type)throw new Error("Can only assign a regular variable");var c=t.id.name.toLowerCase();e.localScope[c]={value:n,valueset:!0,node:t.init},r(f.P)}))})):r.then((function(n){return Object(y.c)((function(r){if("Identifier"!==t.id.type)throw new Error("Can only assign a regular variable");var c=t.id.name.toLowerCase();n===f.P&&(n=null),e.globalScope[c]={value:n,valueset:!0,node:t.init},r(f.P)}))}))}catch(n){return C(n)}}(e,t);case"VariableDeclaration":return G(e,t,0);case"BlockStatement":return function(e,t){try{return Y(e,t,0)}catch(n){return C(n)}}(e,t);case"FunctionDeclaration":return function(e,t){try{var r=t.id.name.toLowerCase();return e.globalScope[r]={valueset:!0,node:null,value:new u.a(t,e)},Object(y.t)(f.P)}catch(n){return C(n)}}(e,t);case"ReturnStatement":return function(e,t){return Object(y.c)((function(n,r){null===t.argument?n(new f.r(f.P)):M(e,t.argument).then((function(e){try{n(new f.r(e))}catch(t){r(t)}}),r)}))}(e,t);case"IfStatement":return function(e,t){return Object(y.c)((function(n,r){"AssignmentExpression"!==t.test.type&&"UpdateExpression"!==t.test.type?M(e,t.test).then((function(c){try{!0===c?M(e,t.consequent).then(n,r):!1===c?null!==t.alternate?M(e,t.alternate).then(n,r):n(f.P):r(new Error(Object(b.g)(t.test,"RUNTIME","CANNOT_USE_NONBOOLEAN_IN_CONDITION")))}catch(a){r(a)}}),r):r(new Error(Object(b.g)(t.test,"RUNTIME","CANNOT_USE_ASSIGNMENT_IN_CONDITION")))}))}(e,t);case"ExpressionStatement":return function(e,t){try{return"AssignmentExpression"===t.expression.type?M(e,t.expression):(t.expression.type,M(e,t.expression).then((function(e){return Object(y.c)((function(t){t(e===f.P?f.P:new f.i(e))}))})))}catch(n){return Object(y.s)(n)}}(e,t);case"UpdateExpression":return function(e,t){try{var n=t.argument;if("MemberExpression"===n.type){var r={t:null};return M(e,n.object).then((function(t){var c=null;return r.t=t,!0===n.computed?c=M(e,n.property):"Identifier"===n.property.type&&(c=Object(y.t)(n.property.name)),c})).then((function(e){return Object(y.c)((function(n){var c,a=r.t;if(Object(f.u)(a)){if(!Object(f.D)(e))throw new Error("Invalid Parameter");if(e<0&&(e=a.length+e),e<0||e>=a.length)throw new Error("Assignment outside of array bounds");c=Object(f.N)(a[e]),a[e]="++"===t.operator?c+1:c-1}else if(a instanceof o.a){if(!1===Object(f.z)(e))throw new Error("Dictionary accessor must be a string");if(!0!==a.hasField(e))throw new Error("Invalid Parameter");c=Object(f.N)(a.field(e)),a.setField(e,"++"===t.operator?c+1:c-1)}else{if(!(a instanceof i.a))throw Object(f.v)(a)?new Error("Array is Immutable"):new Error("Invalid Parameter");if(!1===Object(f.z)(e))throw new Error("Feature accessor must be a string");if(!0!==a.hasField(e))throw new Error("Invalid Parameter");c=Object(f.N)(a.field(e)),a.setField(e,"++"===t.operator?c+1:c-1)}!1===t.prefix?n(c):n("++"===t.operator?c+1:c-1)}))}))}return Object(y.c)((function(n,r){var c,a="Identifier"===t.argument.type?t.argument.name.toLowerCase():"";if(!a)throw new Error("Invalid identifier");return null!==e.localScope&&void 0!==e.localScope[a]?(c=Object(f.N)(e.localScope[a].value),e.localScope[a]={value:"++"===t.operator?c+1:c-1,valueset:!0,node:t},void(!1===t.prefix?n(c):n("++"===t.operator?c+1:c-1))):void 0!==e.globalScope[a]?(c=Object(f.N)(e.globalScope[a].value),e.globalScope[a]={value:"++"===t.operator?c+1:c-1,valueset:!0,node:t},void(!1===t.prefix?n(c):n("++"===t.operator?c+1:c-1))):void r(new Error("Variable not recognised"))}))}catch(c){return Object(y.s)(c)}}(e,t);case"AssignmentExpression":return function(e,t){return Object(y.c)((function(n,r){var c=t.left;if("MemberExpression"===c.type)M(e,t.right).then((function(a){try{M(e,c.object).then((function(u){try{var l=null;if(!0===c.computed)l=M(e,c.property);else{if("Identifier"!==c.property.type)throw new Error("Expected computed or identifier for assignemnt target");l=Object(y.t)(c.property.name)}l.then((function(e){try{if(Object(f.u)(u)){if(!Object(f.D)(e))throw new Error("Invalid Parameter");if(e<0&&(e=u.length+e),e<0||e>u.length)throw new Error("Assignment outside of array bounds");if(e===u.length){if("="!==t.operator)throw new Error("Invalid Parameter");u[e]=B(a,t.operator,u[e],t)}else u[e]=B(a,t.operator,u[e],t)}else if(u instanceof o.a){if(!1===Object(f.z)(e))throw new Error("Dictionary accessor must be a string");if(!0===u.hasField(e))u.setField(e,B(a,t.operator,u.field(e),t));else{if("="!==t.operator)throw new Error("Invalid Parameter");u.setField(e,B(a,t.operator,null,t))}}else{if(!(u instanceof i.a))throw Object(f.v)(u)?new Error("Array is Immutable"):new Error("Invalid Parameter");if(!1===Object(f.z)(e))throw new Error("Feature accessor must be a string");if(!0===u.hasField(e))u.setField(e,B(a,t.operator,u.field(e),t));else{if("="!==t.operator)throw new Error("Invalid Parameter");u.setField(e,B(a,t.operator,null,t))}}n(f.P)}catch(c){r(c)}}),r)}catch(s){r(s)}}),r)}catch(u){r(u)}}),r);else{var a=c.name.toLowerCase();if(null!==e.localScope&&void 0!==e.localScope[a])return void M(e,t.right).then((function(o){try{e.localScope[a]={value:B(o,t.operator,e.localScope[a].value,t),valueset:!0,node:t.right},n(f.P)}catch(c){r(c)}}),r);void 0!==e.globalScope[a]?M(e,t.right).then((function(o){try{e.globalScope[a]={value:B(o,t.operator,e.globalScope[a].value,t),valueset:!0,node:t.right},n(f.P)}catch(c){r(c)}}),r):r(new Error("Cannot assign undeclared variable"))}}))}(e,t);case"ForStatement":return function(e,t){try{return null!==t.init?M(e,t.init).then((function(){return Object(y.c)((function(n,r){k(e,t,{testResult:!0,lastAction:f.P},(function(e){n(e)}),(function(e){r(e)}),0)}))})):Object(y.c)((function(n,r){k(e,t,{testResult:!0,lastAction:f.P},(function(e){n(e)}),(function(e){r(e)}),0)}))}catch(n){return Object(y.s)(n)}}(e,t);case"ForInStatement":return function(e,t){return Object(y.c)((function(n,r){M(e,t.right).then((function(c){try{("VariableDeclaration"===t.left.type?M(e,t.left):Object(y.t)()).then((function(){try{var a="";if("VariableDeclaration"===t.left.type){var u=t.left.declarations[0].id;"Identifier"===u.type&&(a=u.name)}else"Identifier"===t.left.type&&(a=t.left.name);if(!a)throw new Error(Object(b.g)(t,"RUNTIME","INVALIDVARIABLE"));a=a.toLowerCase();var l=null;if(null!==e.localScope&&void 0!==e.localScope[a]&&(l=e.localScope[a]),null===l&&void 0!==e.globalScope[a]&&(l=e.globalScope[a]),null===l)return void r(new Error(Object(b.g)(t,"RUNTIME","VARIABLENOTDECLARED")));Object(f.u)(c)||Object(f.z)(c)?z(e,t,c,{reject:r,resolve:n},l):Object(f.v)(c)?function(e,t,n,r,a,o){try{if(void 0===o&&(o="i"),0===n.length)return void r.resolve(f.P);_(e,t,n,a,0,o,(function(e){r.resolve(e)}),(function(e){r.reject(e)}),0)}catch(c){r.reject(c)}}(e,t,c,{reject:r,resolve:n},l):c instanceof o.a||c instanceof i.a?function(e,t,n,c,a){try{z(e,t,n.keys(),c,a,"k")}catch(r){c.reject(r)}}(e,t,c,{reject:r,resolve:n},l):Object(f.I)(c)?V(c.iterator(e.abortSignal),e,t,c,l,(function(e){n(e)}),(function(e){r(e)}),0):z(e,t,[],{reject:r,resolve:n},l)}catch(s){r(s)}}),r)}catch(a){r(a)}}),r)}))}(e,t);case"BreakStatement":return Object(y.t)(f.E);case"EmptyStatement":return Object(y.t)(f.P);case"ContinueStatement":return Object(y.t)(f.G);case"TemplateElement":return function(e,t){return Object(y.t)(t.value?t.value.cooked:"")}(0,t);case"TemplateLiteral":return function(e,t){return Object(y.c)((function(n){var c=[];Object(h.o)(t.expressions,(function(t,n,r,a){return M(e,n).then((function(e){c[r]=Object(f.x)(e)}))})).then((function(){var e,a="",o=0,i=Object(r.a)(t.quasis);try{for(i.s();!(e=i.n()).done;){var u=e.value;a+=u.value?u.value.cooked:"",!1===u.tail&&(a+=c[o]?c[o]:"",o++)}}catch(l){i.e(l)}finally{i.f()}n(a)}))}))}(e,t);case"Identifier":return q(e,t);case"MemberExpression":return function(e,t){try{return M(e,t.object).then((function(n){try{return null===n?Object(y.s)(new Error(Object(b.g)(t,"RUNTIME","NOTFOUND"))):!1===t.computed?"Identifier"===t.property.type?n instanceof o.a||n instanceof i.a?Object(y.t)(n.field(t.property.name)):n instanceof w.a?Object(y.t)(J(n,t.property.name,e,t)):Object(y.s)(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE"))):Object(y.s)(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE"))):M(e,t.property).then((function(r){return Object(y.c)((function(c,a){if(n instanceof o.a||n instanceof i.a)Object(f.z)(r)?c(n.field(r)):a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")));else if(n instanceof w.a)Object(f.z)(r)?c(J(n,r,e,t)):a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")));else if(Object(f.u)(n))if(Object(f.D)(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new Error(Object(b.g)(t,"RUNTIME","OUTOFBOUNDS"));c(n[r])}else a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")));else if(Object(f.v)(n))if(Object(f.D)(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new Error(Object(b.g)(t,"RUNTIME","OUTOFBOUNDS"));c(n.get(r))}else a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")));else if(Object(f.z)(n))if(Object(f.D)(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new Error(Object(b.g)(t,"RUNTIME","OUTOFBOUNDS"));c(n[r])}else a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")));else a(new Error(Object(b.g)(t,"RUNTIME","INVALIDTYPE")))}))}))}catch(r){return C(r)}}))}catch(n){return C(n)}}(e,t);case"Literal":return A(t.value);case"CallExpression":return function(e,t){try{if("Identifier"!==t.callee.type)return C(Object(b.g)(t,"RUNTIME","ONLYNODESSUPPORTED"));if(null!==e.localScope&&void 0!==e.localScope[t.callee.name.toLowerCase()]){var r=e.localScope[t.callee.name.toLowerCase()];return r.value instanceof f.n?r.value.fn(e,t):r.value instanceof u.a?ne(e,t,r.value.definition):C(Object(b.g)(t,"RUNTIME","NOTAFUNCTION"))}if(void 0!==e.globalScope[t.callee.name.toLowerCase()]){var c=e.globalScope[t.callee.name.toLowerCase()];return c.value instanceof f.n?c.value.fn(e,t):c.value instanceof u.a?ne(e,t,c.value.definition):C(Object(b.g)(t,"RUNTIME","NOTAFUNCTION"))}return C(Object(b.g)(t,"RUNTIME","NOTFOUND"))}catch(n){return C(n)}}(e,t);case"UnaryExpression":return function(e,t){try{return M(e,t.argument).then((function(e){return Object(y.c)((function(n,r){Object(f.C)(e)&&"!"===t.operator?n(!e):"-"===t.operator?n(-1*Object(f.N)(e)):"+"===t.operator?n(1*Object(f.N)(e)):"~"===t.operator?n(~Object(f.N)(e)):r(new Error(Object(b.g)(t,"RUNTIME","NOTSUPPORTEDUNARYOPERATOR")))}))}))}catch(n){return C(n)}}(e,t);case"BinaryExpression":return function(e,t){try{return Object(y.b)([M(e,t.left),M(e,t.right)]).then((function(e){return Object(y.c)((function(n,r){var c=e[0],a=e[1];switch(t.operator){case"|":case"<<":case">>":case">>>":case"^":case"&":n(Object(f.B)(Object(f.N)(c),Object(f.N)(a),t.operator));case"==":n(Object(f.y)(c,a));break;case"!=":n(!Object(f.y)(c,a));break;case"<":case">":case"<=":case">=":n(Object(f.A)(c,a,t.operator));break;case"+":Object(f.z)(c)||Object(f.z)(a)?n(Object(f.x)(c)+Object(f.x)(a)):n(Object(f.N)(c)+Object(f.N)(a));break;case"-":n(Object(f.N)(c)-Object(f.N)(a));break;case"*":n(Object(f.N)(c)*Object(f.N)(a));break;case"/":n(Object(f.N)(c)/Object(f.N)(a));break;case"%":n(Object(f.N)(c)%Object(f.N)(a));break;default:r(new Error(Object(b.g)(t,"RUNTIME","OPERATORNOTRECOGNISED")))}}))}))}catch(n){return C(n)}}(e,t);case"LogicalExpression":return function(e,t){return Object(y.c)((function(n,r){"AssignmentExpression"!==t.left.type&&"UpdateExpression"!==t.left.type?"AssignmentExpression"!==t.right.type&&"UpdateExpression"!==t.right.type?M(e,t.left).then((function(c){try{if(!Object(f.C)(c))throw new Error(Object(b.g)(t,"RUNTIME","ONLYBOOLEAN"));switch(t.operator){case"||":!0===c?n(c):M(e,t.right).then((function(e){try{if(!Object(f.C)(e))throw new Error(Object(b.g)(t,"RUNTIME","ONLYORORAND"));n(e)}catch(c){r(c)}}),r);break;case"&&":!1===c?n(c):M(e,t.right).then((function(e){try{if(!Object(f.C)(e))throw new Error(Object(b.g)(t,"RUNTIME","ONLYORORAND"));n(e)}catch(c){r(c)}}),r);break;default:throw new Error(Object(b.g)(t,"RUNTIME","ONLYORORAND"))}}catch(a){r(a)}}),r):r(new Error(Object(b.g)(t.right,"RUNTIME","CANNOT_USE_ASSIGNMENT_IN_CONDITION"))):r(new Error(Object(b.g)(t.left,"RUNTIME","CANNOT_USE_ASSIGNMENT_IN_CONDITION")))}))}(e,t);case"ArrayExpression":return function(e,t){try{for(var r=[],c=0;c<t.elements.length;c++)r.push(M(e,t.elements[c]));return Object(y.b)(r).then((function(e){return Object(y.c)((function(n,r){for(var c=0;c<e.length;c++){if(Object(f.w)(e[c]))return void r(new Error(Object(b.g)(t,"RUNTIME","FUNCTIONCONTEXTILLEGAL")));e[c]===f.P&&(e[c]=null)}n(e)}))}))}catch(n){return C(n)}}(e,t);case"ObjectExpression":return function(e,t){try{for(var n=[],r=0;r<t.properties.length;r++)n.push(M(e,t.properties[r]));return Object(y.b)(n).then((function(e){return Object(y.c)((function(t){for(var n={},r=0;r<e.length;r++){var c=e[r];if(Object(f.w)(c.value))throw new Error("Illegal Argument");if(!1===Object(f.z)(c.key))throw new Error("Illegal Argument");c.value===f.P?n[c.key.toString()]=null:n[c.key.toString()]=c.value}var a=new o.a(n);a.immutable=!1,t(a)}))}))}catch(c){return C(c)}}(e,t);case"Property":return function(e,t){try{return M(e,t.value).then((function(n){return Object(y.c)((function(r){"Identifier"===t.key.type?r({key:t.key.name,value:n}):M(e,t.key).then((function(e){r({key:e,value:n})}))}))}))}catch(n){return Object(y.s)(n)}}(e,t);default:return C(Object(b.g)(t,"RUNTIME","UNREOGNISED"))}}catch(c){return C(c)}}function D(e,t,n){try{return M(e,t.body).then((function(r){try{return n.lastAction=r,n.lastAction===f.E||n.lastAction instanceof f.r?(n.testResult=!1,Object(y.t)(n)):null!==t.update?M(e,t.update).then((function(){return Object(y.t)(n)})):Object(y.t)(n)}catch(c){return Object(y.s)(c)}}))}catch(r){return Object(y.s)(r)}}function k(e,t,n,r,c,a){try{(function(e,t,n){try{return null!==t.test?M(e,t.test).then((function(r){try{return!0===e.abortSignal.aborted?Object(y.s)(new Error("Cancelled")):(n.testResult=r,!1===n.testResult?Object(y.t)(n):!0!==n.testResult?Object(y.s)(new Error(Object(b.g)(t,"RUNTIME","CANNOT_USE_NONBOOLEAN_IN_CONDITION"))):D(e,t,n))}catch(c){return Object(y.s)(c)}})):D(e,t,n)}catch(r){return Object(y.s)(r)}})(e,t,n).then((function(){try{!0===n.testResult?++a>P?(a=0,setTimeout((function(){k(e,t,n,r,c,a)}),0)):k(e,t,n,r,c,a):n.lastAction instanceof f.r?r(n.lastAction):r(f.P)}catch(o){c(o)}}),(function(e){c(e)}))}catch(o){c(o)}}function L(e,t,n,r,c,a,o,i,u,l){try{if(r<=a)return void i(f.P);c.value="k"===o?n[a]:a,M(e,t.body).then((function(s){try{s instanceof f.r?i(s):s===f.E?i(f.P):++l>P?(l=0,setTimeout((function(){L(e,t,n,r,c,a+1,o,i,u,l)}),0)):L(e,t,n,r,c,a+1,o,i,u,l)}catch(b){u(b)}}),(function(e){u(e)}))}catch(s){u(s)}}function _(e,t,n,r,c,a,o,i,u){try{if(n.length()<=c)return void o(f.P);r.value="k"===a?n.get(c):c,M(e,t.body).then((function(l){l instanceof f.r?o(l):l===f.E?o(f.P):++u>P?(u=0,setTimeout((function(){_(e,t,n,r,c+1,a,o,i,u)}),0)):_(e,t,n,r,c+1,a,o,i,u)}),(function(e){i(e)}))}catch(l){i(l)}}function z(e,t,n,r,c,a){try{if(void 0===a&&(a="i"),0===n.length)return void r.resolve(f.P);L(e,t,n,n.length,c,0,a,(function(e){r.resolve(e)}),(function(e){r.reject(e)}),0)}catch(o){r.reject(o)}}function V(e,t,n,r,c,a,o,u){try{e.next().then((function(l){try{if(null===l)a(f.P);else{var s=i.a.createFromGraphicLikeObject(l.geometry,l.attributes,r);s._underlyingGraphic=l,c.value=s,M(t,n.body).then((function(i){try{i===f.E?a(f.P):i instanceof f.r?a(i):++u>P?(u=0,setTimeout((function(){V(e,t,n,r,c,a,o,u)}),0)):V(e,t,n,r,c,a,o,u)}catch(l){o(l)}}),(function(e){o(e)}))}}catch(b){o(b)}}),(function(e){o(e)}))}catch(l){o(l)}}function B(e,t,n,r){switch(t){case"=":return e===f.P?null:e;case"/=":return Object(f.N)(n)/Object(f.N)(e);case"*=":return Object(f.N)(n)*Object(f.N)(e);case"-=":return Object(f.N)(n)-Object(f.N)(e);case"+=":return Object(f.z)(n)||Object(f.z)(e)?Object(f.x)(n)+Object(f.x)(e):Object(f.N)(n)+Object(f.N)(e);case"%=":return Object(f.N)(n)%Object(f.N)(e);default:throw new Error(Object(b.g)(r,"RUNTIME","OPERATORNOTRECOGNISED"))}}function Y(e,t,n){try{return n>=t.body.length?Object(y.t)(f.P):Object(y.c)((function(r,c){M(e,t.body[n]).then((function(a){try{a instanceof f.r||a===f.E||a===f.G||n===t.body.length-1?r(a):Y(e,t,n+1).then(r,c)}catch(o){c(o)}}),c)}))}catch(r){return C(r)}}function G(e,t,n){return Object(y.c)((function(r,c){n>=t.declarations.length?r(f.P):M(e,t.declarations[n]).then((function(){n===t.declarations.length-1?r(f.P):G(e,t,n+1).then((function(){r(f.P)}),c)}),c)}))}var H=0;function J(e,t,n,r){var c;switch(t=t.toLowerCase()){case"hasz":var a=e.hasZ;return void 0!==a&&a;case"hasm":var i=e.hasM;return void 0!==i&&i;case"spatialreference":var u=e.spatialReference._arcadeCacheId;if(void 0===u){var f=!0;Object.freeze&&Object.isFrozen(e.spatialReference)&&(f=!1),f&&(H++,e.spatialReference._arcadeCacheId=H,u=H)}var h=new o.a({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return void 0!==u&&(h._arcadeCacheId="SPREF"+u.toString()),h}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":var O=e[t];return void 0!==O?O:null;case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return void 0===(c=e.cache._arcadeCacheId)&&(c=++H,e.cache._arcadeCacheId=c),new l.a(e.rings,e.spatialReference,!0===e.hasZ,!0===e.hasM,c);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return void 0!==e[t]?e[t]:null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return void 0===(c=e.cache._arcadeCacheId)&&(c=++H,e.cache._arcadeCacheId=c),new l.a(e.paths,e.spatialReference,!0===e.hasZ,!0===e.hasM,c);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return void 0===(c=e.cache._arcadeCacheId)&&(c=++H,e.cache._arcadeCacheId=c),new s.a(e.points,e.spatialReference,!0===e.hasZ,!0===e.hasM,c,1);case"type":return"Multipoint"}}throw new Error(Object(b.g)(r,"RUNTIME","PROPERTYNOTFOUND"))}function q(e,t){return Object(y.c)((function(n,r){var c=t.name.toLowerCase();if(null===e.localScope||void 0===e.localScope[c])if(void 0===e.globalScope[c])r(new Error(Object(b.g)(t,"RUNTIME","VARIABLENOTFOUND")));else{var a=e.globalScope[c];!0===a.valueset?n(a.value):null!==a.d?a.d.then(n,r):(a.d=M(e,a.node),a.d.then((function(e){try{a.value=e,a.valueset=!0,n(e)}catch(c){r(c)}}),r))}else{var o=e.localScope[c];!0===o.valueset?n(o.value):null!==o.d?o.d.then(n,r):(o.d=M(e,o.node),o.d.then((function(e){try{o.value=e,o.valueset=!0,n(e)}catch(c){r(c)}}),r))}}))}var Z={};function K(e){return null===e?"":Object(f.u)(e)||Object(f.v)(e)?"Array":Object(f.H)(e)?"Date":Object(f.z)(e)?"String":Object(f.C)(e)?"Boolean":Object(f.D)(e)?"Number":e instanceof a.a?"Attachment":e instanceof c.a?"Portal":e instanceof o.a?"Dictionary":e instanceof i.a?"Feature":e instanceof I.a?"Point":e instanceof S.a?"Polygon":e instanceof T.a?"Polyline":e instanceof m.a?"Multipoint":e instanceof N.a?"Extent":Object(f.w)(e)?"Function":Object(f.I)(e)?"FeatureSet":Object(f.K)(e)?"FeatureSetCollection":e===f.P?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognised Type"}function W(e,t,n,r){return Object(y.c)((function(c,a){M(e,t.arguments[n]).then((function(o){try{if(Object(f.y)(o,r))return void M(e,t.arguments[n+1]).then(c,a);var i=t.arguments.length-n;return 1===i?void M(e,t.arguments[n]).then(c,a):(2===i&&c(null),3===i?void M(e,t.arguments[n+2]).then(c,a):void W(e,t,n+2,r).then(c,a))}catch(u){a(u)}}),a)}))}function X(e,t,n,r){return Object(y.c)((function(c,a){!0===r?M(e,t.arguments[n+1]).then(c,a):3===t.arguments.length-n?M(e,t.arguments[n+2]).then(c,a):M(e,t.arguments[n+2]).then((function(r){try{if(!1===Object(f.C)(r))return void a(new Error("WHEN needs boolean test conditions"));X(e,t,n+2,r).then(c,a)}catch(o){a(o)}}))}))}function Q(e,t){try{var n=e.length,r=Math.floor(n/2);return 0===n?Object(y.t)([]):1===n?Object(y.t)([e[0]]):Object(y.c)((function(c,a){var o=[Q(e.slice(0,r),t),Q(e.slice(r,n),t)];Object(y.b)(o).then((function(e){try{$(e[0],e[1],t,[]).then(c,a)}catch(n){a(n)}}),a)}))}catch(c){return C(c)}}function $(e,t,n,r){return Object(y.c)((function(c,a){var o=r;e.length>0||t.length>0?e.length>0&&t.length>0?n(e[0],t[0]).then((function(i){try{isNaN(i)&&(i=1),i<=0?(o.push(e[0]),e=e.slice(1)):(o.push(t[0]),t=t.slice(1)),$(e,t,n,r).then(c,a)}catch(u){a(u)}}),a):e.length>0?(o.push(e[0]),$(e=e.slice(1),t,n,r).then(c,a)):t.length>0&&(o.push(t[0]),t=t.slice(1),$(e,t,n,r).then(c,a)):c(r)}))}function ee(e,t){var n=e.length,r=Math.floor(n/2);return t||(t=function(e,t){return e<t?-1:e===t?0:1}),0===n?[]:1===n?[e[0]]:function(e,t,n){for(var r=[];e.length>0||t.length>0;)if(e.length>0&&t.length>0){var c=n(e[0],t[0]);isNaN(c)&&(c=1),c<=0?(r.push(e[0]),e=e.slice(1)):(r.push(t[0]),t=t.slice(1))}else e.length>0?(r.push(e[0]),e=e.slice(1)):t.length>0&&(r.push(t[0]),t=t.slice(1));return r}(ee(e.slice(0,r),t),ee(e.slice(r,n),t),t)}function te(e,t,n){try{var r=e.body;if(n.length!==e.params.length)return C(new Error("Invalid Parameter calls to function."));for(var c=0;c<n.length;c++){var a=e.params[c];"Identifier"===a.type&&(t.localScope[a.name.toLowerCase()]={d:null,value:n[c],valueset:!0,node:null})}return M(t,r).then((function(e){return Object(y.c)((function(t,n){e instanceof f.r?t(e.value):e!==f.E?e!==f.G?t(e instanceof f.i?e.value:e):n(new Error("Cannot Continue from a Function")):n(new Error("Cannot Break from a Function"))}))}))}catch(o){return Object(y.s)(o)}}function ne(e,t,n){return F(e,t,(function(t,r,c){var a={spatialReference:e.spatialReference,services:e.services,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:e.depthCounter+1};if(a.depthCounter>64)throw new Error("Exceeded maximum function depth");return te(n,a,c)}))}function re(e){return function(){var t={abortSignal:e.context.abortSignal,spatialReference:e.context.spatialReference,console:e.context.console,lrucache:e.context.lrucache,interceptor:e.context.interceptor,services:e.context.services,localScope:{},globalScope:e.context.globalScope,depthCounter:e.context.depthCounter+1};if(t.depthCounter>64)throw new Error("Exceeded maximum function depth");return te(e.definition,t,arguments)}}Object(O.a)(Z,x),Object(p.a)(Z,x),Object(E.a)(Z,x),Object(v.a)(Z,x),Object(j.a)(Z,x),Object(g.a)(Z,x),Object(d.registerFunctions)({functions:Z,compiled:!1,signatures:null,failDefferred:null,evaluateIdentifier:null,arcadeCustomFunctionHandler:null,mode:"async",standardFunction:x,standardFunctionAsync:F}),Z.typeof=function(e,t){return x(e,t,(function(e,t,n){Object(f.J)(n,1,1);var r=K(n[0]);if("Unrecognised Type"===r)throw new Error("Unrecognised Type");return r}))},Z.iif=function(e,t){return Object(y.c)((function(n,r){Object(f.J)(null===t.arguments?[]:t.arguments,3,3),M(e,t.arguments[0]).then((function(c){try{if(!1===Object(f.C)(c))return void r(new Error("IF Function must have a boolean test condition"));Object(y.b)([M(e,t.arguments[1]),M(e,t.arguments[2])]).then((function(e){n(c?e[0]:e[1])}),r)}catch(a){r(a)}}),r)}))},Z.decode=function(e,t){return Object(y.c)((function(n,r){t.arguments.length<2?r(new Error("Missing Parameters")):2!==t.arguments.length?(t.arguments.length-1)%2!=0?M(e,t.arguments[0]).then((function(c){try{W(e,t,1,c).then(n,r)}catch(a){r(a)}}),r):r(new Error("Must have a default value result.")):M(e,t.arguments[1]).then(n,r)}))},Z.when=function(e,t){try{return t.arguments.length<3?C("Missing Parameters"):t.arguments.length%2==0?C("Must have a default value result."):M(e,t.arguments[0]).then((function(n){return Object(y.c)((function(r,c){!1!==Object(f.C)(n)?X(e,t,0,n).then(r,c):c(new Error("WHEN needs boolean test conditions"))}))}))}catch(n){return C(n)}},Z.sort=function(e,t){return F(e,t,(function(e,t,n){Object(f.J)(n,1,2);var r=n[0];if(Object(f.v)(r)&&(r=r.toArray()),!1===Object(f.u)(r))return C(Error("Illegal Argument"));if(n.length>1)return!1===Object(f.w)(n[1])?C(Error("Illegal Argument")):Q(r,re(n[1]));var c=r;if(0===c.length)return Object(y.t)([]);for(var a={},o=0;o<c.length;o++){var i=K(c[o]);""!==i&&(a[i]=!0)}if(!0===a.Array||!0===a.Dictionary||!0===a.Feature||!0===a.Point||!0===a.Polygon||!0===a.Polyline||!0===a.Multipoint||!0===a.Extent||!0===a.Function)return Object(y.t)(c.slice(0));var u=0,l="";for(var s in a)u++,l=s;return u>1||"String"===l?c=ee(c,(function(e,t){if(null==e||e===f.P)return null==t||t===f.P?0:1;if(null==t||t===f.P)return-1;var n=Object(f.x)(e),r=Object(f.x)(t);return n<r?-1:n===r?0:1})):"Number"===l?c=ee(c,(function(e,t){return e-t})):"Boolean"===l?c=ee(c,(function(e,t){return e===t?0:t?-1:1})):"Date"===l&&(c=ee(c,(function(e,t){return t-e}))),Object(y.t)(c)}))};var ce={failDefferred:C,resolveDeffered:A,fixSpatialReference:f.L,parseArguments:U,standardFunction:x,standardFunctionAsync:F,evaluateIdentifier:q,arcadeCustomFunction:re};for(var ae in Z)Z[ae]={value:new f.n(Z[ae]),valueset:!0,node:null};var oe=function(){};function ie(e){console.log(e)}(oe.prototype=Z).infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},oe.prototype.pi={value:Math.PI,valueset:!0,node:null};var ue=ce;function le(e){for(var t={mode:"async",compiled:!1,functions:{},signatures:[],standardFunction:x,standardFunctionAsync:F,failDefferred:C,evaluateIdentifier:q,arcadeCustomFunctionHandler:re},n=0;n<e.length;n++)e[n].registerFunctions(t);for(var r in t.functions)Z[r]={value:new f.n(t.functions[r]),valueset:!0,node:null},oe.prototype[r]=Z[r];for(var c=0;c<t.signatures.length;c++)Object(b.a)(t.signatures[c],"async")}function se(e,t){var n=t.spatialReference;null==n&&(n=new R.a({wkid:102100}));var r=function(e,t){var n=new oe;null==e&&(e={}),null==t&&(t={});var r=new o.a({newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});for(var c in r.immutable=!1,n.textformatting={value:r,valueset:!0,node:null},t)n[c]={value:new f.n(t[c]),native:!0,valueset:!0,node:null};for(var a in e)e[a]&&"esri.Graphic"===e[a].declaredClass?n[a]={value:i.a.createFromGraphic(e[a]),valueset:!0,node:null}:n[a]={value:e[a],valueset:!0,node:null};return n}(t.vars,t.customfunctions);return M({spatialReference:n,services:t.services,abortSignal:void 0===t.abortSignal||null===t.abortSignal?{aborted:!1}:t.abortSignal,globalScope:r,console:t.console?t.console:ie,lrucache:t.lrucache,interceptor:t.interceptor,localScope:null,depthCounter:1},e.body[0].body).then((function(e){return Object(y.c)((function(t,n){e instanceof f.r&&(e=e.value),e instanceof f.i&&(e=e.value),e===f.P&&(e=null),e!==f.E?e!==f.G?e instanceof f.n||e instanceof u.a?n(new Error("Cannot return FUNCTION")):t(e):n(new Error("Cannot return CONTINUE")):n(new Error("Cannot return BREAK"))}))}))}function fe(e,t){return Object(b.d)(e)}function be(e,t){return Object(b.k)(e,t,"full")}function he(e,t){return Object(b.i)(e,t)}function Oe(e,t){return Object(b.h)(e,t)}function pe(e){return Object(b.e)(e)}}}]);
//# sourceMappingURL=109.c0adf7c4.chunk.js.map