@nocobase/plugin-workflow-json-query 1.9.8 → 2.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/dist/node_modules/jmespath/package.json +1 -1
- package/dist/node_modules/jsonata/jsonata-es5.js +1178 -1266
- package/dist/node_modules/jsonata/jsonata-es5.min.js +1 -1
- package/dist/node_modules/jsonata/jsonata.js +1 -1
- package/dist/node_modules/jsonata/jsonata.min.js +1 -1
- package/dist/node_modules/jsonata/package.json +1 -1
- package/dist/node_modules/jsonpath-plus/package.json +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var runtime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function p(e,r,n,o){var i=r&&r.prototype instanceof y?r:y,s=Object.create(i.prototype),u=new P(o||[]);return a(s,"_invoke",{value:function(e,r,n){var a=l;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===l)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var c=f(e,r,n);if("normal"===c.type){if(a=n.done?v:h,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=v,n.method="throw",n.arg=c.arg)}}}(e,n,u)}),s}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=p;var l="suspendedStart",h="suspendedYield",d="executing",v="completed",b={};function y(){}function g(){}function m(){}var x={};c(x,i,function(){return this});var k=Object.getPrototypeOf,w=k&&k(k(j([])));w&&w!==r&&n.call(w,i)&&(x=w);var E=m.prototype=y.prototype=Object.create(x);function A(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var r;a(this,"_invoke",{value:function(a,o){function i(){return new t(function(r,i){!function r(a,o,i,s){var u=f(e[a],e,o);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==typeof p&&n.call(p,"__await")?t.resolve(p.__await).then(function(e){r("next",e,i,s)},function(e){r("throw",e,i,s)}):t.resolve(p).then(function(e){c.value=e,i(c)},function(e){return r("throw",e,i,s)})}s(u.arg)}(a,o,r,i)})}return r=r?r.then(i,i):i()}})}function T(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)?b:("return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b);var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function j(e){if(null!=e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=m,a(E,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},A(S.prototype),c(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new S(p(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},A(E),c(E,u,"Generator"),c(E,i,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},String.fromCodePoint||function(e){var t=function(t){for(var r=[],n=0,a="",o=0,i=arguments.length;o!==i;++o){var s=+arguments[o];if(!(s<1114111&&s>>>0===s))throw RangeError("Invalid code point: "+s);s<=65535?n=r.push(s):(s-=65536,n=r.push(55296+(s>>10),s%1024+56320)),n>=16383&&(a+=e.apply(null,r),r.length=0)}return a+e.apply(null,r)};try{Object.defineProperty(String,"fromCodePoint",{value:t,configurable:!0,writable:!0})}catch(e){String.fromCodePoint=t}}(String.fromCharCode),Object.is||(Object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var a,o=t.charCodeAt(n);return o>=55296&&o<=56319&&r>n+1&&(a=t.charCodeAt(n+1))>=56320&&a<=57343?1024*(o-55296)+a-56320+65536:o}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}(),Math.log10=Math.log10||function(e){return Math.log(e)*Math.LOG10E},function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsonata=e()}}(function(){return function(){return function e(t,r,n){function a(i,s){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};t[i][0].call(p.exports,function(e){return a(t[i][1][e]||e)},p,p.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}}()({1:[function(e,t,r){"use strict";var n=e("./utils"),a=function(){var e=n.stringToArray,t=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],a=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],o=["Thousand","Million","Billion","Trillion"];var i={};t.forEach(function(e,t){i[e.toLowerCase()]=t}),r.forEach(function(e,t){i[e.toLowerCase()]=t}),a.forEach(function(e,t){var r=e.toLowerCase();i[r]=10*(t+2),i[r.substring(0,e.length-1)+"ieth"]=i[r]}),i.hundredth=100,o.forEach(function(e,t){var r=e.toLowerCase(),n=Math.pow(10,3*(t+1));i[r]=n,i[r+"th"]=n});var s=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],u={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function c(e,t){if(void 0!==e)return l(e=Math.floor(e),d(t))}var p={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},f={UPPER:"upper",LOWER:"lower",TITLE:"title"};function l(n,i){var u,c=n<0;switch(n=Math.abs(n),i.primary){case p.LETTERS:u=function(e,t){for(var r=[],n=t.charCodeAt(0);e>0;)r.unshift(String.fromCharCode((e-1)%26+n)),e=Math.floor((e-1)/26);return r.join("")}(n,i.case===f.UPPER?"A":"a");break;case p.ROMAN:u=function e(t){for(var r=0;r<s.length;r++){var n=s[r];if(t>=n[0])return n[1]+e(t-n[0])}return""}(n),i.case===f.UPPER&&(u=u.toUpperCase());break;case p.WORDS:u=function(e,n){var i=function(e,n,s){var u="";if(e<=19)u=(n?" and ":"")+(s?r[e]:t[e]);else if(e<100){var c=Math.floor(e/10),p=e%10;u=(n?" and ":"")+a[c-2],p>0?u+="-"+i(p,!1,s):s&&(u=u.substring(0,u.length-1)+"ieth")}else if(e<1e3){var f=Math.floor(e/100),l=e%100;u=(n?", ":"")+t[f]+" Hundred",l>0?u+=i(l,!0,s):s&&(u+="th")}else{var h=Math.floor(Math.log10(e)/3);h>o.length&&(h=o.length);var d=Math.pow(10,3*h),v=Math.floor(e/d),b=e-v*d;u=(n?", ":"")+i(v,!1,!1)+" "+o[h-1],b>0?u+=i(b,!0,s):s&&(u+="th")}return u};return i(e,!1,n)}(n,i.ordinal),i.case===f.UPPER?u=u.toUpperCase():i.case===f.LOWER&&(u=u.toLowerCase());break;case p.DECIMAL:u=""+n;var l=i.mandatoryDigits-u.length;if(l>0){var h=new Array(l+1).join("0");u=h+u}if(48!==i.zeroCode&&(u=e(u).map(function(e){return String.fromCodePoint(e.codePointAt(0)+i.zeroCode-48)}).join("")),i.regular)for(var d=Math.floor((u.length-1)/i.groupingSeparators.position);d>0;d--){var v=u.length-d*i.groupingSeparators.position;u=u.substr(0,v)+i.groupingSeparators.character+u.substr(v)}else i.groupingSeparators.reverse().forEach(function(e){var t=u.length-e.position;u=u.substr(0,t)+e.character+u.substr(t)});if(i.ordinal){var b={1:"st",2:"nd",3:"rd"}[u[u.length-1]];(!b||u.length>1&&"1"===u[u.length-2])&&(b="th"),u+=b}break;case p.SEQUENCE:throw{code:"D3130",value:i.token}}return c&&(u="-"+u),u}var h=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function d(t){var r,n={type:"integer",primary:p.DECIMAL,case:f.LOWER,ordinal:!1},a=t.lastIndexOf(";");switch(-1===a?r=t:(r=t.substring(0,a),"o"===t.substring(a+1)[0]&&(n.ordinal=!0)),r){case"A":n.case=f.UPPER;case"a":n.primary=p.LETTERS;break;case"I":n.case=f.UPPER;case"i":n.primary=p.ROMAN;break;case"W":n.case=f.UPPER,n.primary=p.WORDS;break;case"Ww":n.case=f.TITLE,n.primary=p.WORDS;break;case"w":n.primary=p.WORDS;break;default:var o=null,i=0,s=0,u=[],c=0;if(e(r).map(function(e){return e.codePointAt(0)}).reverse().forEach(function(e){for(var t=!1,r=0;r<h.length;r++){var n=h[r];if(e>=n&&e<=n+9){if(t=!0,i++,c++,null===o)o=n;else if(n!==o)throw{code:"D3131"};break}}t||(35===e?(c++,s++):u.push({position:c,character:String.fromCodePoint(e)}))}),i>0){n.primary=p.DECIMAL,n.zeroCode=o,n.mandatoryDigits=i,n.optionalDigits=s;var l=function(e){if(0===e.length)return 0;for(var t=e[0].character,r=1;r<e.length;r++)if(e[r].character!==t)return 0;for(var n=e.map(function(e){return e.position}),a=function(e,t){return 0===t?e:a(t,e%t)},o=n.reduce(a),i=1;i<=n.length;i++)if(-1===n.indexOf(i*o))return 0;return o}(u);l>0?(n.regular=!0,n.groupingSeparators={position:l,character:u[0].character}):(n.regular=!1,n.groupingSeparators=u)}else n.primary=p.SEQUENCE,n.token=r}return n}var v={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function b(e){for(var t=[],r={type:"datetime",parts:t},n=function(r,n){if(n>r){var a=e.substring(r,n);a=a.split("]]").join("]"),t.push({type:"literal",value:a})}},a=0,o=0;o<e.length;){if("["===e.charAt(o)){if("["===e.charAt(o+1)){n(a,o),t.push({type:"literal",value:"["}),a=o+=2;continue}if(n(a,o),a=o,-1===(o=e.indexOf("]",a)))throw{code:"D3135"};var i,s=e.substring(a+1,o),u={type:"marker",component:(s=s.split(/\s+/).join("")).charAt(0)},c=s.lastIndexOf(",");if(-1!==c){var p=s.substring(c+1),l=p.indexOf("-"),h=void 0,b=void 0,y=function(e){return void 0===e||"*"===e?void 0:parseInt(e)};-1===l?h=p:(h=p.substring(0,l),b=p.substring(l+1));var g={min:y(h),max:y(b)};u.width=g,i=s.substring(1,c)}else i=s.substring(1);if(1===i.length)u.presentation1=i;else if(i.length>1){var m=i.charAt(i.length-1);-1!=="atco".indexOf(m)?(u.presentation2=m,"o"===m&&(u.ordinal=!0),u.presentation1=i.substring(0,i.length-1)):u.presentation1=i}else u.presentation1=v[u.component];if(void 0===u.presentation1)throw{code:"D3132",value:u.component};if("n"===u.presentation1[0])u.names=f.LOWER;else if("N"===u.presentation1[0])"n"===u.presentation1[1]?u.names=f.TITLE:u.names=f.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(u.component)){var x=u.presentation1;if(u.presentation2&&(x+=";"+u.presentation2),u.integerFormat=d(x),u.width&&void 0!==u.width.min&&u.integerFormat.mandatoryDigits<u.width.min&&(u.integerFormat.mandatoryDigits=u.width.min),-1!=="YMD".indexOf(u.component))if(u.n=-1,u.width&&void 0!==u.width.max)u.n=u.width.max,u.integerFormat.mandatoryDigits=u.n;else{var k=u.integerFormat.mandatoryDigits+u.integerFormat.optionalDigits;k>=2&&(u.n=k)}}"Z"!==u.component&&"z"!==u.component||(u.integerFormat=d(u.presentation1)),t.push(u),a=o+1}o++}return n(a,o),r}var y=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],g=["January","February","March","April","May","June","July","August","September","October","November","December"],m=function(e){var t=Date.UTC(e.year,e.month),r=new Date(t).getUTCDay();return 0===r&&(r=7),r>4?t+864e5*(8-r):t-864e5*(r-1)},x=function(e,t){return{year:e,month:t,nextMonth:function(){return 11===t?x(e+1,0):x(e,t+1)},previousMonth:function(){return 0===t?x(e-1,11):x(e,t-1)},nextYear:function(){return x(e+1,t)},previousYear:function(){return x(e-1,t)}}},k=function(e,t){return(t-e)/6048e5+1},w=function(e,t){var r;switch(t){case"Y":r=e.getUTCFullYear();break;case"M":r=e.getUTCMonth()+1;break;case"D":r=e.getUTCDate();break;case"d":r=(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0))/864e5+1;break;case"F":0===(r=e.getUTCDay())&&(r=7);break;case"W":var n=x(e.getUTCFullYear(),0),a=m(n),o=Date.UTC(n.year,e.getUTCMonth(),e.getUTCDate()),i=k(a,o);if(i>52)o>=m(n.nextYear())&&(i=1);else if(i<1){var s=m(n.previousYear());i=k(s,o)}r=Math.floor(i);break;case"w":var u=x(e.getUTCFullYear(),e.getUTCMonth()),c=m(u),p=Date.UTC(u.year,u.month,e.getUTCDate()),f=k(c,p);if(f>4)p>=m(u.nextMonth())&&(f=1);else if(f<1){var l=m(u.previousMonth());f=k(l,p)}r=Math.floor(f);break;case"X":var h=x(e.getUTCFullYear(),0),d=m(h),v=m(h.nextYear()),b=e.getTime();r=b<d?h.year-1:b>=v?h.year+1:h.year;break;case"x":var y=x(e.getUTCFullYear(),e.getUTCMonth()),g=m(y),w=y.nextMonth(),E=m(w),A=e.getTime();r=A<g?y.previousMonth().month+1:A>=E?w.month+1:y.month+1;break;case"H":r=e.getUTCHours();break;case"h":r=e.getUTCHours(),0===(r%=12)&&(r=12);break;case"P":r=e.getUTCHours()>=12?"pm":"am";break;case"m":r=e.getUTCMinutes();break;case"s":r=e.getUTCSeconds();break;case"f":r=e.getUTCMilliseconds();break;case"Z":case"z":break;case"C":case"E":r="ISO"}return r},E=null;function A(e,t,r){var n=0,a=0;if(void 0!==r){var o=parseInt(r);n=Math.floor(o/100),a=o%100}var i;void 0===t?(null===E&&(E=b("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),i=E):i=b(t);var s=new Date(e+60*(60*n+a)*1e3),u="";return i.parts.forEach(function(e){"literal"===e.type?u+=e.value:u+=function(e,t){var r=w(e,t.component);if(-1!=="YMDdFWwXxHhms".indexOf(t.component))if("Y"===t.component&&-1!==t.n&&(r%=Math.pow(10,t.n)),t.names){if("M"===t.component||"x"===t.component)r=g[r-1];else{if("F"!==t.component)throw{code:"D3133",value:t.component};r=y[r]}t.names===f.UPPER?r=r.toUpperCase():t.names===f.LOWER&&(r=r.toLowerCase()),t.width&&r.length>t.width.max&&(r=r.substring(0,t.width.max))}else r=l(r,t.integerFormat);else if("f"===t.component)r=l(r,t.integerFormat);else if("Z"===t.component||"z"===t.component){var o=100*n+a;if(t.integerFormat.regular)r=l(o,t.integerFormat);else{var i=t.integerFormat.mandatoryDigits;if(1===i||2===i)r=l(n,t.integerFormat),0!==a&&(r+=":"+c(a,"00"));else{if(3!==i&&4!==i)throw{code:"D3134",value:i};r=l(o,t.integerFormat)}}o>=0&&(r="+"+r),"z"===t.component&&(r="GMT"+r),0===o&&"t"===t.presentation2&&(r="Z")}else"P"===t.component&&t.names===f.UPPER&&(r=r.toUpperCase());return r}(s,e)}),u}function S(e){var t={};if("datetime"===e.type)t.type="datetime",t.parts=e.parts.map(function(e){var t={};if("literal"===e.type)t.regex=e.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if("Z"===e.component||"z"===e.component){var r;Array.isArray(e.integerFormat.groupingSeparators)||(r=e.integerFormat.groupingSeparators),t.regex="","z"===e.component&&(t.regex="GMT"),t.regex+="[-+][0-9]+",r&&(t.regex+=r.character+"[0-9]+"),t.parse=function(t){"z"===e.component&&(t=t.substring(3));var n=0,a=0;r?(n=Number.parseInt(t.substring(0,t.indexOf(r.character))),a=Number.parseInt(t.substring(t.indexOf(r.character)+1))):t.length-1<=2?n=Number.parseInt(t):(n=Number.parseInt(t.substring(0,3)),a=Number.parseInt(t.substring(3)));return 60*n+a}}else if(e.integerFormat)e.integerFormat.n=e.n,t=S(e.integerFormat);else{t.regex="[a-zA-Z]+";var n={};if("M"===e.component||"x"===e.component)g.forEach(function(t,r){e.width&&e.width.max?n[t.substring(0,e.width.max)]=r+1:n[t]=r+1});else if("F"===e.component)y.forEach(function(t,r){r>0&&(e.width&&e.width.max?n[t.substring(0,e.width.max)]=r:n[t]=r)});else{if("P"!==e.component)throw{code:"D3133",value:e.component};n={am:0,AM:0,pm:1,PM:1}}t.parse=function(e){return n[e]}}return t.component=e.component,t});else{t.type="integer";var r,n=e.case===f.UPPER;switch(r=e.n&&e.n>0?0===e.optionalDigits?"{".concat(e.n,"}"):"{".concat(e.n-e.optionalDigits,",").concat(e.n,"}"):"+",e.primary){case p.LETTERS:t.regex=n?"[A-Z]+":"[a-z]+",t.parse=function(e){return function(e,t){for(var r=t.charCodeAt(0),n=0,a=0;a<e.length;a++)n+=(e.charCodeAt(e.length-a-1)-r+1)*Math.pow(26,a);return n}(e,n?"A":"a")};break;case p.ROMAN:t.regex=n?"[MDCLXVI]+":"[mdclxvi]+",t.parse=function(e){return function(e){for(var t=0,r=1,n=e.length-1;n>=0;n--){var a=e[n],o=u[a];o<r?t-=o:(r=o,t+=o)}return t}(n?e:e.toUpperCase())};break;case p.WORDS:t.regex="(?:"+Object.keys(i).concat("and","[\\-, ]").join("|")+")+",t.parse=function(e){return t=e.toLowerCase(),r=t.split(/,\s|\sand\s|[\s\\-]/).map(function(e){return i[e]}),n=[0],r.forEach(function(e){if(e<100){var t=n.pop();t>=1e3&&(n.push(t),t=0),n.push(t+e)}else n.push(n.pop()*e)}),n.reduce(function(e,t){return e+t},0);var t,r,n};break;case p.DECIMAL:t.regex="[0-9]".concat(r),e.ordinal&&(t.regex+="(?:th|st|nd|rd)"),t.parse=function(t){var r=t;return e.ordinal&&(r=t.substring(0,t.length-2)),e.regular?r=r.split(",").join(""):e.groupingSeparators.forEach(function(e){r=r.split(e.character).join("")}),48!==e.zeroCode&&(r=r.split("").map(function(t){return String.fromCodePoint(t.codePointAt(0)-e.zeroCode+48)}).join("")),parseInt(r)};break;case p.SEQUENCE:throw{code:"D3130",value:e.token}}}return t}var T=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");return{formatInteger:c,parseInteger:function(e,t){if(void 0!==e)return S(d(t)).parse(e)},fromMillis:function(e,t,r){if(void 0!==e)return A.call(this,e,t,r)},toMillis:function(e,t){if(void 0!==e){if(void 0===t){if(!T.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}return function(e,t){var r=S(b(t)),n="^"+r.parts.map(function(e){return"("+e.regex+")"}).join("")+"$",a=new RegExp(n,"i").exec(e);if(null!==a){for(var o={},i=1;i<a.length;i++){var s=r.parts[i-1];s.parse&&(o[s.component]=s.parse(a[i]))}if(0===Object.getOwnPropertyNames(o).length)return;var u=0,c=function(e){u<<=1,u+=e?1:0},p=function(e){return!(~e&u||!(e&u))};"YXMxWwdD".split("").forEach(function(e){return c(o[e])});var f=!p(161)&&p(130),l=p(84),h=!l&&p(72);u=0,"PHhmsf".split("").forEach(function(e){return c(o[e])});var d=!p(23)&&p(47),v=(f?"YD":l?"XxwF":h?"XWF":"YMD")+(d?"Phmsf":"Hmsf"),y=this.environment.timestamp,g=!1,m=!1;if(v.split("").forEach(function(e){if(void 0===o[e])g?(o[e]=-1!=="MDd".indexOf(e)?1:0,m=!0):o[e]=w(y,e);else if(g=!0,m)throw{code:"D3136"}}),o.M>0?o.M-=1:o.M=0,f){var x=Date.UTC(o.Y,0),k=1e3*(o.d-1)*60*60*24,E=new Date(x+k);o.M=E.getUTCMonth(),o.D=E.getUTCDate()}if(l)throw{code:"D3136"};if(h)throw{code:"D3136"};d&&(o.H=12===o.h?0:o.h,1===o.P&&(o.H+=12));var A=Date.UTC(o.Y,o.M,o.D,o.H,o.m,o.s,o.f);return(o.Z||o.z)&&(A-=60*(o.Z||o.z)*1e3),A}}.call(this,e,t)}}}}();t.exports=a},{"./utils":6}],2:[function(e,t,r){(function(r){(function(){"use strict";function n(){n=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",p=s.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof m?t:m,o=Object.create(a.prototype),s=new M(n||[]);return i(o,"_invoke",{value:D(e,r,s)}),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",v="suspendedYield",b="executing",y="completed",g={};function m(){}function x(){}function k(){}var w={};f(w,u,function(){return this});var E=Object.getPrototypeOf,A=E&&E(E(C([])));A&&A!==r&&o.call(A,u)&&(w=A);var S=k.prototype=m.prototype=Object.create(w);function T(e){["next","throw","return"].forEach(function(t){f(e,t,function(e){return this._invoke(t,e)})})}function O(e,t){function r(n,i,s,u){var c=h(e[n],e,i);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==a(f)&&o.call(f,"__await")?t.resolve(f.__await).then(function(e){r("next",e,s,u)},function(e){r("throw",e,s,u)}):t.resolve(f).then(function(e){p.value=e,s(p)},function(e){return r("throw",e,s,u)})}u(c.arg)}var n;i(this,"_invoke",{value:function(e,a){function o(){return new t(function(t,n){r(e,a,t,n)})}return n=n?n.then(o,o):o()}})}function D(t,r,n){var a=d;return function(o,i){if(a===b)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:e,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=b;var c=h(t,r,n);if("normal"===c.type){if(a=n.done?y:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=y,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=h(a,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(a(t)+" is not iterable")}return x.prototype=k,i(S,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:x,configurable:!0}),x.displayName=f(k,p,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,f(e,p,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},T(O.prototype),f(O.prototype,c,function(){return this}),t.AsyncIterator=O,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new O(l(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},T(S),f(S,p,"Generator"),f(S,u,function(){return this}),f(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=C,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r,n,a,o,i){try{var s=e[o](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function s(e){o(i,n,a,s,u,"next",e)}function u(e){o(i,n,a,s,u,"throw",e)}s(void 0)})}}var s=e("./utils"),u=function(){var e=s.isNumeric,t=s.isArrayOfStrings,o=s.isArrayOfNumbers,u=s.createSequence,c=s.isSequence,p=s.isFunction,f=s.isLambda,l=s.isPromise,h=s.getFunctionArity,d=s.isDeepEqual,v=s.stringToArray;function b(e,t,r){if(void 0!==e){var n=v(e),a=n.length;if(a+t<0&&(t=0),void 0!==r){if(r<=0)return"";var o=t>=0?t+r:a+t+r;return n.slice(t,o).join("")}return n.slice(t).join("")}}function y(e){if(void 0!==e)return v(e).length}function g(e,t){return m.apply(this,arguments)}function m(){return(m=i(n().mark(function e(t,r){var a;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.apply(this,[r]),!l(a)){e.next=5;break}return e.next=4,a;case 4:a=e.sent;case 5:if(!a||"number"==typeof a.start||"number"===a.end||Array.isArray(a.groups)||p(a.next)){e.next=7;break}throw{code:"T1010",stack:(new Error).stack};case 7:return e.abrupt("return",a);case 8:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function x(){return(x=i(n().mark(function e(t,r){var a,o;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if("string"!=typeof r){e.next=6;break}a=-1!==t.indexOf(r),e.next=10;break;case 6:return e.next=8,g(r,t);case 8:o=e.sent,a=void 0!==o;case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function k(){return(k=i(n().mark(function e(t,r,a){var o,i,s;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if(!(a<0)){e.next=4;break}throw{stack:(new Error).stack,value:a,code:"D3040",index:3};case 4:if(o=u(),!(void 0===a||a>0)){e.next=19;break}return i=0,e.next=9,g(r,t);case 9:if(void 0===(s=e.sent)){e.next=19;break}case 11:if(void 0===s||!(void 0===a||i<a)){e.next=19;break}return o.push({match:s.match,index:s.start,groups:s.groups}),e.next=15,g(s.next);case 15:s=e.sent,i++,e.next=11;break;case 19:return e.abrupt("return",o);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function w(){return(w=i(n().mark(function e(t,r,a,o){var i,s,u,c,p,f,h,d;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if(i=this,""!==r){e.next=5;break}throw{code:"D3010",stack:(new Error).stack,value:r,index:2};case 5:if(!(o<0)){e.next=7;break}throw{code:"D3011",stack:(new Error).stack,value:o,index:4};case 7:if(s="string"==typeof a?function(e){for(var t="",r=0,n=a.indexOf("$",r);-1!==n&&r<a.length;){t+=a.substring(r,n),r=n+1;var o=a.charAt(r);if("$"===o)t+="$",r++;else if("0"===o)t+=e.match,r++;else{var i;if(i=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,n=parseInt(a.substring(r,r+i),10),i>1&&n>e.groups.length&&(n=parseInt(a.substring(r,r+i-1),10)),isNaN(n))t+="$";else{if(e.groups.length>0){var s=e.groups[n-1];void 0!==s&&(t+=s)}r+=n.toString().length}}n=a.indexOf("$",r)}return t+=a.substring(r)}:a,u="",c=0,!(void 0===o||o>0)){e.next=47;break}if(p=0,"string"!=typeof r){e.next=18;break}for(f=t.indexOf(r,c);-1!==f&&(void 0===o||p<o);)u+=t.substring(c,f),u+=a,c=f+r.length,p++,f=t.indexOf(r,c);u+=t.substring(c),e.next=45;break;case 18:return e.next=20,g(r,t);case 20:if(void 0===(h=e.sent)){e.next=44;break}case 22:if(void 0===h||!(void 0===o||p<o)){e.next=41;break}if(u+=t.substring(c,h.start),d=s.apply(i,[h]),!l(d)){e.next=29;break}return e.next=28,d;case 28:d=e.sent;case 29:if("string"!=typeof d){e.next=33;break}u+=d,e.next=34;break;case 33:throw{code:"D3012",stack:(new Error).stack,value:d};case 34:return c=h.start+h.match.length,p++,e.next=38,g(h.next);case 38:h=e.sent,e.next=22;break;case 41:u+=t.substring(c),e.next=45;break;case 44:u=t;case 45:e.next=48;break;case 47:u=t;case 48:return e.abrupt("return",u);case 49:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function E(){return(E=i(n().mark(function e(t,r,a){var o,i,s,u;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if(!(a<0)){e.next=4;break}throw{code:"D3020",stack:(new Error).stack,value:a,index:3};case 4:if(o=[],!(void 0===a||a>0)){e.next=29;break}if("string"!=typeof r){e.next=10;break}o=t.split(r,a),e.next=29;break;case 10:return i=0,e.next=13,g(r,t);case 13:if(void 0===(s=e.sent)){e.next=28;break}u=0;case 16:if(void 0===s||!(void 0===a||i<a)){e.next=25;break}return o.push(t.substring(u,s.start)),u=s.end,e.next=21,g(s.next);case 21:s=e.sent,i++,e.next=16;break;case 25:(void 0===a||i<a)&&o.push(t.substring(u)),e.next=29;break;case 28:o.push(t);case 29:return e.abrupt("return",o);case 30:case"end":return e.stop()}},e)}))).apply(this,arguments)}function A(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var a=(r=Math.round(e))-e;return.5===Math.abs(a)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function S(t){if(void 0!==t){var r=!1;if(Array.isArray(t)){if(1===t.length)r=S(t[0]);else if(t.length>1){r=t.filter(function(e){return S(e)}).length>0}}else"string"==typeof t?t.length>0&&(r=!0):e(t)?0!==t&&(r=!0):null!==t&&"object"===a(t)?Object.keys(t).length>0&&(r=!0):"boolean"==typeof t&&!0===t&&(r=!0);return r}}function T(e,t,r,n){var a=[t],o=h(e);return o>=2&&a.push(r),o>=3&&a.push(n),a}function O(){return(O=i(n().mark(function e(t,r){var a,o,i,s;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:a=u(),o=0;case 4:if(!(o<t.length)){e.next=13;break}return i=T(r,t[o],o,t),e.next=8,r.apply(this,i);case 8:void 0!==(s=e.sent)&&a.push(s);case 10:o++,e.next=4;break;case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function D(){return(D=i(n().mark(function e(t,r){var a,o,i,s;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:a=u(),o=0;case 4:if(!(o<t.length)){e.next=14;break}return i=t[o],s=T(r,i,o,t),e.next=9,r.apply(this,s);case 9:S(e.sent)&&a.push(i);case 11:o++,e.next=4;break;case 14:return e.abrupt("return",a);case 15:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function P(){return(P=i(n().mark(function e(t,r){var a,o,i,s,u,c,p;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:a=!1,i=0;case 4:if(!(i<t.length)){e.next=23;break}if(s=t[i],u=!0,void 0===r){e.next=13;break}return c=T(r,s,i,t),e.next=11,r.apply(this,c);case 11:p=e.sent,u=S(p);case 13:if(!u){e.next=20;break}if(a){e.next=19;break}o=s,a=!0,e.next=20;break;case 19:throw{stack:(new Error).stack,code:"D3138",index:i};case 20:i++,e.next=4;break;case 23:if(a){e.next=25;break}throw{stack:(new Error).stack,code:"D3139"};case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function j(){return(j=i(n().mark(function e(t,r,a){var o,i,s,u;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if(!((i=h(r))<2)){e.next=5;break}throw{stack:(new Error).stack,code:"D3050",index:1};case 5:void 0===a&&t.length>0?(o=t[0],s=1):(o=a,s=0);case 6:if(!(s<t.length)){e.next=16;break}return u=[o,t[s]],i>=3&&u.push(s),i>=4&&u.push(t),e.next=12,r.apply(this,u);case 12:o=e.sent,s++,e.next=6;break;case 16:return e.abrupt("return",o);case 17:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function L(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=u(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function M(){return(M=i(n().mark(function e(t,r){var a,o,i,s;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=u(),e.t0=n().keys(t);case 2:if((e.t1=e.t0()).done){e.next=11;break}return o=e.t1.value,i=T(r,t[o],o,t),e.next=7,r.apply(this,i);case 7:void 0!==(s=e.sent)&&a.push(s),e.next=2;break;case 11:return e.abrupt("return",a);case 12:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function C(){return(C=i(n().mark(function e(r,a){var s,u,c,p;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==r){e.next=2;break}return e.abrupt("return",void 0);case 2:if(!(r.length<=1)){e.next=4;break}return e.abrupt("return",r);case 4:if(void 0!==a){e.next=10;break}if(o(r)||t(r)){e.next=7;break}throw{stack:(new Error).stack,code:"D3070",index:1};case 7:s=function(){var e=i(n().mark(function e(t,r){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t>r);case 1:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}(),e.next=11;break;case 10:s=a;case 11:return u=function(){var e=i(n().mark(function e(t,r){var a,o;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(){var e=i(n().mark(function e(t,r,o){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==r.length){e.next=4;break}Array.prototype.push.apply(t,o),e.next=19;break;case 4:if(0!==o.length){e.next=8;break}Array.prototype.push.apply(t,r),e.next=19;break;case 8:return e.next=10,s(r[0],o[0]);case 10:if(!e.sent){e.next=16;break}return t.push(o[0]),e.next=14,a(t,r,o.slice(1));case 14:e.next=19;break;case 16:return t.push(r[0]),e.next=19,a(t,r.slice(1),o);case 19:case"end":return e.stop()}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),o=[],e.next=4,a(o,t,r);case 4:return e.abrupt("return",o);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}(),c=function(){var e=i(n().mark(function e(t){var r,a,o;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)&&!(t.length<=1)){e.next=4;break}return e.abrupt("return",t);case 4:return r=Math.floor(t.length/2),a=t.slice(0,r),o=t.slice(r),e.next=9,c(a);case 9:return a=e.sent,e.next=12,c(o);case 12:return o=e.sent,e.next=15,u(a,o);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.next=15,c(r);case 15:return p=e.sent,e.abrupt("return",p);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function F(){return(F=i(n().mark(function e(t,r){var a,o,i,s;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a={},e.t0=n().keys(t);case 2:if((e.t1=e.t0()).done){e.next=12;break}return o=e.t1.value,i=t[o],s=T(r,i,o,t),e.next=8,r.apply(this,s);case 8:S(e.sent)&&(a[o]=i),e.next=2;break;case 12:return 0===Object.keys(a).length&&(a=void 0),e.abrupt("return",a);case 14:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}return{sum:function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},count:function(e){return void 0===e?0:e.length},max:function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},min:function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},average:function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},string:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==t){var n;if("string"==typeof t)n=t;else if(p(t))n="";else{if("number"==typeof t&&!isFinite(t))throw{code:"D3001",value:t,stack:(new Error).stack};var a=r?2:0;Array.isArray(t)&&t.outerWrapper&&(t=t[0]),n=JSON.stringify(t,function(t,r){return null!=r&&r.toPrecision&&e(r)?Number(r.toPrecision(15)):r&&p(r)?"":r},a)}return n}},substring:b,substringBefore:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},substringAfter:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},lowercase:function(e){if(void 0!==e)return e.toLowerCase()},uppercase:function(e){if(void 0!==e)return e.toUpperCase()},length:y,trim:function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},pad:function(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" ");var a=Math.abs(t)-y(e);if(a>0){var o=new Array(a+1).join(r);r.length>1&&(o=b(o,0,a)),n=t>0?e+o:o+e}else n=e;return n}},match:function(e,t,r){return k.apply(this,arguments)},contains:function(e,t){return x.apply(this,arguments)},replace:function(e,t,r,n){return w.apply(this,arguments)},split:function(e,t,r){return E.apply(this,arguments)},join:function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},formatNumber:function(e,t,r){if(void 0!==e){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var a=[],o=n["zero-digit"].charCodeAt(0),i=o;i<o+10;i++)a.push(String.fromCharCode(i));var s=a.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,a,o,i=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(i.length,e.length-u.length),p=e.indexOf(n["exponent-separator"],i.length);-1===p||p>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,p),r=c.substring(p+1));var f=t.indexOf(n["decimal-separator"]);return-1===f?(a=t,o=u):(a=t.substring(0,f),o=t.substring(f+1)),{prefix:i,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:a,fractionalPart:o,subpicture:e}});c.forEach(function(e){var t,r,o=e.subpicture,i=o.indexOf(n["decimal-separator"]);i!==o.lastIndexOf(n["decimal-separator"])&&(t="D3081"),o.indexOf(n.percent)!==o.lastIndexOf(n.percent)&&(t="D3082"),o.indexOf(n["per-mille"])!==o.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==o.indexOf(n.percent)&&-1!==o.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==a.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==i?o.charAt(i-1)!==n["grouping-separator"]&&o.charAt(i+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==o.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var p=e.integerPart.indexOf(n.digit);-1!==p&&e.integerPart.substring(0,p).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(p=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(p).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3091");var f="string"==typeof e.exponentPart;if(f&&e.exponentPart.length>0&&(-1!==o.indexOf(n.percent)||-1!==o.indexOf(n["per-mille"]))&&(t="D3092"),f&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===a.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var p,f,l,h,d=c.map(function(e){var t=function(t,r){for(var o=[],i=t.indexOf(n["grouping-separator"]);-1!==i;){var s=(r?t.substring(0,i):t.substring(i)).split("").filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length;o.push(s),i=e.integerPart.indexOf(n["grouping-separator"],i+1)}return o},r=t(e.integerPart),o=function(e){if(0===e.length)return 0;for(var t=function(e,r){return 0===r?e:t(r,e%r)},r=e.reduce(t),n=1;n<=e.length;n++)if(-1===e.indexOf(n*r))return 0;return r}(r),i=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),p=c.filter(function(e){return-1!==a.indexOf(e)}).length,f=c.filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length,l="string"==typeof e.exponentPart;0===s&&0===f&&(l?(p=1,f=1):s=1),l&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===p&&(p=1);var h=0;return l&&(h=e.exponentPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:o,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:i,minimumFactionalPartSize:p,maximumFactionalPartSize:f,minimumExponentSize:h,suffix:e.suffix,picture:e.subpicture}}),v=n["minus-sign"],b=n["zero-digit"],y=n["decimal-separator"],g=n["grouping-separator"];if(1===d.length&&(d.push(JSON.parse(JSON.stringify(d[0]))),d[1].prefix=v+d[1].prefix),f=-1!==(p=e>=0?d[0]:d[1]).picture.indexOf(n.percent)?100*e:-1!==p.picture.indexOf(n["per-mille"])?1e3*e:e,0===p.minimumExponentSize)l=f;else{var m=Math.pow(10,p.scalingFactor),x=Math.pow(10,p.scalingFactor-1);for(l=f,h=0;l<x;)l*=10,h-=1;for(;l>m;)l/=10,h+=1}var k=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==b&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?a[e.charCodeAt(0)-48]:e}).join("")),r},w=k(A(l,p.maximumFactionalPartSize),p.maximumFactionalPartSize),E=w.indexOf(".");for(-1===E?w+=y:w=w.replace(".",y);w.charAt(0)===b;)w=w.substring(1);for(;w.charAt(w.length-1)===b;)w=w.substring(0,w.length-1);E=w.indexOf(y);var S=p.minimumIntegerPartSize-E,T=p.minimumFactionalPartSize-(w.length-E-1);if(w=(S>0?new Array(S+1).join(b):"")+w,w+=T>0?new Array(T+1).join(b):"",E=w.indexOf(y),p.regularGrouping>0)for(var O=Math.floor((E-1)/p.regularGrouping),D=1;D<=O;D++)w=[w.slice(0,E-D*p.regularGrouping),g,w.slice(E-D*p.regularGrouping)].join("");else p.integerPartGroupingPositions.forEach(function(e){w=[w.slice(0,E-e),g,w.slice(E-e)].join(""),E++});if(E=w.indexOf(y),p.fractionalPartGroupingPositions.forEach(function(e){w=[w.slice(0,e+E+1),g,w.slice(e+E+1)].join("")}),E=w.indexOf(y),-1!==p.picture.indexOf(y)&&E!==w.length-1||(w=w.substring(0,w.length-1)),void 0!==h){var P=k(h,0);(S=p.minimumExponentSize-P.length)>0&&(P=new Array(S+1).join(b)+P),w=w+n["exponent-separator"]+(h<0?v:"")+P}return w=p.prefix+w+p.suffix}},formatBase:function(e,t){if(void 0!==e){if(e=A(e),(t=void 0===t?10:A(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},number:function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else if("string"==typeof e&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)&&!isNaN(parseFloat(e))&&isFinite(e))t=parseFloat(e);else if("string"==typeof e&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(e))t=Number(e);else if(!0===e)t=1;else{if(!1!==e)throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=0}return t}},floor:function(e){if(void 0!==e)return Math.floor(e)},ceil:function(e){if(void 0!==e)return Math.ceil(e)},round:A,abs:function(e){if(void 0!==e)return Math.abs(e)},sqrt:function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},power:function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},random:function(){return Math.random()},boolean:S,not:function(e){if(void 0!==e)return!S(e)},map:function(e,t){return O.apply(this,arguments)},zip:function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var a=t.map(function(e){return e[n]});e.push(a)}return e},filter:function(e,t){return D.apply(this,arguments)},single:function(e,t){return P.apply(this,arguments)},foldLeft:function(e,t,r){return j.apply(this,arguments)},sift:function(e,t){return F.apply(this,arguments)},keys:function e(t){var r=u();if(Array.isArray(t)){var n={};t.forEach(function(t){e(t).forEach(function(e){n[e]=!0})}),r=e(n)}else null===t||"object"!==a(t)||p(t)||Object.keys(t).forEach(function(e){return r.push(e)});return r},lookup:function e(t,r){var n;if(Array.isArray(t)){n=u();for(var o=0;o<t.length;o++){var i=e(t[o],r);void 0!==i&&(Array.isArray(i)?i.forEach(function(e){return n.push(e)}):n.push(i))}}else null===t||"object"!==a(t)||p(t)||(n=t[r]);return n},append:L,exists:function(e){return void 0!==e},spread:function e(t){var r=u();if(Array.isArray(t))t.forEach(function(t){r=L(r,e(t))});else if(null===t||"object"!==a(t)||f(t))r=t;else for(var n in t){var o={};o[n]=t[n],r.push(o)}return r},merge:function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},reverse:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},each:function(e,t){return M.apply(this,arguments)},error:function(e){throw{code:"D3137",stack:(new Error).stack,message:e||"$error() function evaluated"}},assert:function(e,t){if(!e)throw{code:"D3141",stack:(new Error).stack,message:t||"$assert() statement failed"}},type:function(t){if(void 0!==t)return null===t?"null":e(t)?"number":"string"==typeof t?"string":"boolean"==typeof t?"boolean":Array.isArray(t)?"array":p(t)?"function":"object"},sort:function(e,t){return C.apply(this,arguments)},shuffle:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},distinct:function(e){if(void 0!==e){if(!Array.isArray(e)||e.length<=1)return e;for(var t=c(e)?u():[],r=0;r<e.length;r++){for(var n=e[r],a=!1,o=0;o<t.length;o++)if(d(n,t[o])){a=!0;break}a||t.push(n)}return t}},base64encode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new r.Buffer.from(e,"binary").toString("base64")})(e)},base64decode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new r.Buffer.from(e,"base64").toString("binary")})(e)},encodeUrlComponent:function(e){if(void 0!==e){var t;try{t=encodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrlComponent"}}return t}},encodeUrl:function(e){if(void 0!==e){var t;try{t=encodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrl"}}return t}},decodeUrlComponent:function(e){if(void 0!==e){var t;try{t=decodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrlComponent"}}return t}},decodeUrl:function(e){if(void 0!==e){var t;try{t=decodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrl"}}return t}}}}();t.exports=u}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(){s=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),s=new M(n||[]);return a(i,"_invoke",{value:D(e,r,s)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",v="suspendedYield",b="executing",y="completed",g={};function m(){}function x(){}function k(){}var w={};f(w,i,function(){return this});var E=Object.getPrototypeOf,A=E&&E(E(C([])));A&&A!==r&&n.call(A,i)&&(w=A);var S=k.prototype=m.prototype=Object.create(w);function T(e){["next","throw","return"].forEach(function(t){f(e,t,function(e){return this._invoke(t,e)})})}function O(e,t){function r(a,o,i,s){var c=h(e[a],e,o);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==u(f)&&n.call(f,"__await")?t.resolve(f.__await).then(function(e){r("next",e,i,s)},function(e){r("throw",e,i,s)}):t.resolve(f).then(function(e){p.value=e,i(p)},function(e){return r("throw",e,i,s)})}s(c.arg)}var o;a(this,"_invoke",{value:function(e,n){function a(){return new t(function(t,a){r(e,n,t,a)})}return o=o?o.then(a,a):a()}})}function D(t,r,n){var a=d;return function(o,i){if(a===b)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:e,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=b;var c=h(t,r,n);if("normal"===c.type){if(a=n.done?y:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=y,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=h(a,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(u(t)+" is not iterable")}return x.prototype=k,a(S,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:x,configurable:!0}),x.displayName=f(k,p,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,f(e,p,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},T(O.prototype),f(O.prototype,c,function(){return this}),t.AsyncIterator=O,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new O(l(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},T(S),f(S,p,"Generator"),f(S,i,function(){return this}),f(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=C,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function u(e){"@babel/helpers - typeof";return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t,r,n,a,o,i){try{var s=e[o](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function p(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){c(o,n,a,i,s,"next",e)}function s(e){c(o,n,a,i,s,"throw",e)}i(void 0)})}}var f=e("./datetime"),l=e("./functions"),h=e("./utils"),d=e("./parser"),v=e("./signature"),b=function(){var e=h.isNumeric,t=h.isArrayOfStrings,r=h.isArrayOfNumbers,o=h.createSequence,i=h.isSequence,c=h.isFunction,b=h.isLambda,y=h.isIterable,g=h.isPromise,m=h.getFunctionArity,x=h.isDeepEqual,k=Fe(null);function w(e,t,r){return E.apply(this,arguments)}function E(){return(E=p(s().mark(function e(t,r,n){var a,o,u,c;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o=n.lookup(Symbol.for("jsonata.__evaluate_entry")))){e.next=4;break}return e.next=4,o(t,r,n);case 4:e.t0=t.type,e.next="path"===e.t0?7:"binary"===e.t0?11:"unary"===e.t0?15:"name"===e.t0?19:"string"===e.t0?21:"number"===e.t0?21:"value"===e.t0?21:"wildcard"===e.t0?23:"descendant"===e.t0?25:"parent"===e.t0?27:"condition"===e.t0?29:"block"===e.t0?33:"bind"===e.t0?37:"regex"===e.t0?41:"function"===e.t0?43:"variable"===e.t0?47:"lambda"===e.t0?49:"partial"===e.t0?51:"apply"===e.t0?55:"transform"===e.t0?59:61;break;case 7:return e.next=9,A(t,r,n);case 9:return a=e.sent,e.abrupt("break",61);case 11:return e.next=13,N(t,r,n);case 13:return a=e.sent,e.abrupt("break",61);case 15:return e.next=17,I(t,r,n);case 17:return a=e.sent,e.abrupt("break",61);case 19:return a=R(t,r,n),e.abrupt("break",61);case 21:return a=G(t),e.abrupt("break",61);case 23:return a=z(t,r),e.abrupt("break",61);case 25:return a=$(t,r),e.abrupt("break",61);case 27:return a=n.lookup(t.slot.label),e.abrupt("break",61);case 29:return e.next=31,ne(t,r,n);case 31:return a=e.sent,e.abrupt("break",61);case 33:return e.next=35,oe(t,r,n);case 35:return a=e.sent,e.abrupt("break",61);case 37:return e.next=39,te(t,r,n);case 39:return a=e.sent,e.abrupt("break",61);case 41:return a=se(t),e.abrupt("break",61);case 43:return e.next=45,ve(t,r,n);case 45:return a=e.sent,e.abrupt("break",61);case 47:return a=ue(t,r,n),e.abrupt("break",61);case 49:return a=ke(t,r,n),e.abrupt("break",61);case 51:return e.next=53,we(t,r,n);case 53:return a=e.sent,e.abrupt("break",61);case 55:return e.next=57,he(t,r,n);case 57:return a=e.sent,e.abrupt("break",61);case 59:return a=fe(t,r,n),e.abrupt("break",61);case 61:if(!Object.prototype.hasOwnProperty.call(t,"predicate")){e.next=70;break}u=0;case 63:if(!(u<t.predicate.length)){e.next=70;break}return e.next=66,C(t.predicate[u].expr,a,n);case 66:a=e.sent;case 67:u++,e.next=63;break;case 70:if("path"===t.type||!Object.prototype.hasOwnProperty.call(t,"group")){e.next=74;break}return e.next=73,Q(t.group,a,n);case 73:a=e.sent;case 74:if(!(c=n.lookup(Symbol.for("jsonata.__evaluate_exit")))){e.next=78;break}return e.next=78,c(t,r,n,a);case 78:return a&&i(a)&&!a.tupleStream&&(t.keepArray&&(a.keepSingleton=!0),0===a.length?a=void 0:1===a.length&&(a=a.keepSingleton?a:a[0])),e.abrupt("return",a);case 80:case"end":return e.stop()}},e)}))).apply(this,arguments)}function A(e,t,r){return S.apply(this,arguments)}function S(){return(S=p(s().mark(function e(t,r,n){var a,i,u,c,p,f;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=Array.isArray(r)&&"variable"!==t.steps[0].type?r:o(r),u=!1,c=void 0,p=0;case 4:if(!(p<t.steps.length)){e.next=28;break}if((f=t.steps[p]).tuple&&(u=!0),0!==p||!f.consarray){e.next=13;break}return e.next=10,w(f,a,n);case 10:i=e.sent,e.next=22;break;case 13:if(!u){e.next=19;break}return e.next=16,L(f,a,c,n);case 16:c=e.sent,e.next=22;break;case 19:return e.next=21,O(f,a,n,p===t.steps.length-1);case 21:i=e.sent;case 22:if(u||void 0!==i&&0!==i.length){e.next=24;break}return e.abrupt("break",28);case 24:void 0===f.focus&&(a=i);case 25:p++,e.next=4;break;case 28:if(u)if(t.tuple)i=c;else for(i=o(),p=0;p<c.length;p++)i.push(c[p]["@"]);if(t.keepSingletonArray&&(Array.isArray(i)&&i.cons&&!i.sequence&&(i=o(i)),i.keepSingleton=!0),!t.hasOwnProperty("group")){e.next=34;break}return e.next=33,Q(t.group,u?c:i,n);case 33:i=e.sent;case 34:return e.abrupt("return",i);case 35:case"end":return e.stop()}},e)}))).apply(this,arguments)}function T(e,t){var r=Fe(e);for(var n in t)r.bind(n,t[n]);return r}function O(e,t,r,n){return D.apply(this,arguments)}function D(){return(D=p(s().mark(function e(t,r,n,a){var u,c,p,f,l;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("sort"!==t.type){e.next=9;break}return e.next=3,ce(t,r,n);case 3:if(u=e.sent,!t.stages){e.next=8;break}return e.next=7,P(t.stages,u,n);case 7:u=e.sent;case 8:return e.abrupt("return",u);case 9:u=o(),c=0;case 11:if(!(c<r.length)){e.next=28;break}return e.next=14,w(t,r[c],n);case 14:if(p=e.sent,!t.stages){e.next=24;break}f=0;case 17:if(!(f<t.stages.length)){e.next=24;break}return e.next=20,C(t.stages[f].expr,p,n);case 20:p=e.sent;case 21:f++,e.next=17;break;case 24:void 0!==p&&u.push(p);case 25:c++,e.next=11;break;case 28:return l=o(),a&&1===u.length&&Array.isArray(u[0])&&!i(u[0])?l=u[0]:u.forEach(function(e){!Array.isArray(e)||e.cons?l.push(e):e.forEach(function(e){return l.push(e)})}),e.abrupt("return",l);case 31:case"end":return e.stop()}},e)}))).apply(this,arguments)}function P(e,t,r){return j.apply(this,arguments)}function j(){return(j=p(s().mark(function e(t,r,n){var a,o,i,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=r,o=0;case 2:if(!(o<t.length)){e.next=16;break}i=t[o],e.t0=i.type,e.next="filter"===e.t0?7:"index"===e.t0?11:13;break;case 7:return e.next=9,C(i.expr,a,n);case 9:return a=e.sent,e.abrupt("break",13);case 11:for(u=0;u<a.length;u++)a[u][i.value]=u;return e.abrupt("break",13);case 13:o++,e.next=2;break;case 16:return e.abrupt("return",a);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function L(e,t,r,n){return M.apply(this,arguments)}function M(){return(M=p(s().mark(function e(t,r,n,a){var i,u,c,p,f,l,h,d;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("sort"!==t.type){e.next=18;break}if(!n){e.next=7;break}return e.next=4,ce(t,n,a);case 4:i=e.sent,e.next=13;break;case 7:return e.next=9,ce(t,r,a);case 9:for(u=e.sent,(i=o()).tupleStream=!0,c=0;c<u.length;c++)(p={"@":u[c]})[t.index]=c,i.push(p);case 13:if(!t.stages){e.next=17;break}return e.next=16,P(t.stages,i,a);case 16:i=e.sent;case 17:return e.abrupt("return",i);case 18:(i=o()).tupleStream=!0,f=a,void 0===n&&(n=r.map(function(e){return{"@":e}})),l=0;case 23:if(!(l<n.length)){e.next=32;break}return f=T(a,n[l]),e.next=27,w(t,n[l]["@"],f);case 27:if(void 0!==(h=e.sent))for(Array.isArray(h)||(h=[h]),d=0;d<h.length;d++)p={},Object.assign(p,n[l]),h.tupleStream?Object.assign(p,h[d]):(t.focus?(p[t.focus]=h[d],p["@"]=n[l]["@"]):p["@"]=h[d],t.index&&(p[t.index]=d),t.ancestor&&(p[t.ancestor.label]=n[l]["@"])),i.push(p);case 29:l++,e.next=23;break;case 32:if(!t.stages){e.next=36;break}return e.next=35,P(t.stages,i,a);case 35:i=e.sent;case 36:return e.abrupt("return",i);case 37:case"end":return e.stop()}},e)}))).apply(this,arguments)}function C(e,t,r){return F.apply(this,arguments)}function F(){return(F=p(s().mark(function t(n,a,i){var u,c,p,f,h,d;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o(),a&&a.tupleStream&&(u.tupleStream=!0),Array.isArray(a)||(a=o(a)),"number"!==n.type){t.next=10;break}(c=Math.floor(n.value))<0&&(c=a.length+c),void 0!==(p=a[c])&&(Array.isArray(p)?u=p:u.push(p)),t.next=24;break;case 10:c=0;case 11:if(!(c<a.length)){t.next=24;break}return p=a[c],f=p,h=i,a.tupleStream&&(f=p["@"],h=T(i,p)),t.next=18,w(n,f,h);case 18:d=t.sent,e(d)&&(d=[d]),r(d)?d.forEach(function(e){var t=Math.floor(e);t<0&&(t=a.length+t),t===c&&u.push(p)}):l.boolean(d)&&u.push(p);case 21:c++,t.next=11;break;case 24:return t.abrupt("return",u);case 25:case"end":return t.stop()}},t)}))).apply(this,arguments)}function N(e,t,r){return U.apply(this,arguments)}function U(){return(U=p(s().mark(function e(t,r,n){var a,o,i,u,c;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.lhs,r,n);case 2:if(o=e.sent,i=t.value,u=function(){var e=p(s().mark(function e(){return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.rhs,r,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),"and"!==i&&"or"!==i){e.next=17;break}return e.prev=6,e.next=9,Z(o,u,i);case 9:return e.abrupt("return",e.sent);case 12:throw e.prev=12,e.t0=e.catch(6),e.t0.position=t.position,e.t0.token=i,e.t0;case 17:return e.next=19,u();case 19:c=e.sent,e.prev=20,e.t1=i,e.next="+"===e.t1?24:"-"===e.t1?24:"*"===e.t1?24:"/"===e.t1?24:"%"===e.t1?24:"="===e.t1?26:"!="===e.t1?26:"<"===e.t1?28:"<="===e.t1?28:">"===e.t1?28:">="===e.t1?28:"&"===e.t1?30:".."===e.t1?32:"in"===e.t1?34:36;break;case 24:return a=Y(o,c,i),e.abrupt("break",36);case 26:return a=q(o,c,i),e.abrupt("break",36);case 28:return a=W(o,c,i),e.abrupt("break",36);case 30:return a=X(o,c),e.abrupt("break",36);case 32:return a=ee(o,c),e.abrupt("break",36);case 34:return a=H(o,c),e.abrupt("break",36);case 36:e.next=43;break;case 38:throw e.prev=38,e.t2=e.catch(20),e.t2.position=t.position,e.t2.token=i,e.t2;case 43:return e.abrupt("return",a);case 44:case"end":return e.stop()}},e,null,[[6,12],[20,38]])}))).apply(this,arguments)}function I(e,t,r){return _.apply(this,arguments)}function _(){return(_=p(s().mark(function t(r,o,i){var u,c,f,h,d,v,b,y;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=r.value,t.next="-"===t.t0?3:"["===t.t0?16:"{"===t.t0?24:28;break;case 3:return t.next=5,w(r.expression,o,i);case 5:if(void 0!==(u=t.sent)){t.next=10;break}u=void 0,t.next=15;break;case 10:if(!e(u)){t.next=14;break}u=-u,t.next=15;break;case 14:throw{code:"D1002",stack:(new Error).stack,position:r.position,token:r.value,value:u};case 15:return t.abrupt("break",28);case 16:return u=[],t.next=19,Promise.all(r.expressions.map(function(){var e=p(s().mark(function e(t,r){return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i.isParallelCall=r>0,e.t0=t,e.next=4,w(t,o,i);case 4:return e.t1=e.sent,e.abrupt("return",[e.t0,e.t1]);case 6:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 19:c=t.sent,f=a(c);try{for(f.s();!(h=f.n()).done;)d=h.value,v=n(d,2),b=v[0],void 0!==(y=v[1])&&("["===b.value?u.push(y):u=l.append(u,y))}catch(e){f.e(e)}finally{f.f()}return r.consarray&&Object.defineProperty(u,"cons",{enumerable:!1,configurable:!1,value:!0}),t.abrupt("break",28);case 24:return t.next=26,Q(r,o,i);case 26:return u=t.sent,t.abrupt("break",28);case 28:return t.abrupt("return",u);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function R(e,t,r){return l.lookup(t,e.value)}function G(e){return e.value}function z(e,t){var r=o();return Array.isArray(t)&&t.outerWrapper&&t.length>0&&(t=t[0]),null!==t&&"object"===u(t)&&Object.keys(t).forEach(function(e){var n=t[e];Array.isArray(n)?(n=function e(t,r){void 0===r&&(r=[]);Array.isArray(t)?t.forEach(function(t){e(t,r)}):r.push(t);return r}(n),r=l.append(r,n)):r.push(n)}),r}function $(e,t){var r,n=o();return void 0!==t&&(!function e(t,r){Array.isArray(t)||r.push(t);Array.isArray(t)?t.forEach(function(t){e(t,r)}):null!==t&&"object"===u(t)&&Object.keys(t).forEach(function(n){e(t[n],r)})}(t,n),r=1===n.length?n[0]:n),r}function Y(t,r,n){var a;if(void 0!==t&&!e(t))throw{code:"T2001",stack:(new Error).stack,value:t};if(void 0!==r&&!e(r))throw{code:"T2002",stack:(new Error).stack,value:r};if(void 0===t||void 0===r)return a;switch(n){case"+":a=t+r;break;case"-":a=t-r;break;case"*":a=t*r;break;case"/":a=t/r;break;case"%":a=t%r}return a}function q(e,t,r){var n,a=u(e),o=u(t);if("undefined"===a||"undefined"===o)return!1;switch(r){case"=":n=x(e,t);break;case"!=":n=!x(e,t)}return n}function W(e,t,r){var n,a=u(e),o=u(t);if(!("undefined"===a||"string"===a||"number"===a)||!("undefined"===o||"string"===o||"number"===o))throw{code:"T2010",stack:(new Error).stack,value:"string"!==a&&"number"!==a?e:t};if("undefined"!==a&&"undefined"!==o){if(a!==o)throw{code:"T2009",stack:(new Error).stack,value:e,value2:t};switch(r){case"<":n=e<t;break;case"<=":n=e<=t;break;case">":n=e>t;break;case">=":n=e>=t}return n}}function H(e,t){var r=!1;if(void 0===e||void 0===t)return!1;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}function Z(e,t,r){return B.apply(this,arguments)}function B(){return(B=p(s().mark(function e(t,r,n){var a,o;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=J(t),e.t0=n,e.next="and"===e.t0?4:"or"===e.t0?13:22;break;case 4:if(e.t1=o,!e.t1){e.next=11;break}return e.t2=J,e.next=9,r();case 9:e.t3=e.sent,e.t1=(0,e.t2)(e.t3);case 11:return a=e.t1,e.abrupt("break",22);case 13:if(e.t4=o,e.t4){e.next=20;break}return e.t5=J,e.next=18,r();case 18:e.t6=e.sent,e.t4=(0,e.t5)(e.t6);case 20:return a=e.t4,e.abrupt("break",22);case 22:return e.abrupt("return",a);case 23:case"end":return e.stop()}},e)}))).apply(this,arguments)}function J(e){var t=l.boolean(e);return void 0!==t&&t}function X(e,t){var r="",n="";return void 0!==e&&(r=l.string(e)),void 0!==t&&(n=l.string(t)),r.concat(n)}function Q(e,t,r){return V.apply(this,arguments)}function V(){return(V=p(s().mark(function e(t,r,i){var u,c,f,h,d,v,b,y,g,m,x,k,E,A,S,O,D;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u={},c={},f=!(!r||!r.tupleStream),Array.isArray(r)||(r=o(r)),0===r.length&&r.push(void 0),h=0;case 6:if(!(h<r.length)){e.next=32;break}d=r[h],v=f?T(i,d):i,b=0;case 10:if(!(b<t.lhs.length)){e.next=29;break}return y=t.lhs[b],e.next=14,w(y[0],f?d["@"]:d,v);case 14:if("string"==typeof(g=e.sent)||void 0===g){e.next=17;break}throw{code:"T1003",stack:(new Error).stack,position:t.position,value:g};case 17:if(void 0===g){e.next=26;break}if(m={data:d,exprIndex:b},!c.hasOwnProperty(g)){e.next=25;break}if(c[g].exprIndex===b){e.next=22;break}throw{code:"D1009",stack:(new Error).stack,position:t.position,value:g};case 22:c[g].data=l.append(c[g].data,d),e.next=26;break;case 25:c[g]=m;case 26:b++,e.next=10;break;case 29:h++,e.next=6;break;case 32:return e.next=34,Promise.all(Object.keys(c).map(function(){var e=p(s().mark(function e(r,n){var a,o,u,p;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=c[r],o=a.data,u=i,f&&(p=K(a.data),o=p["@"],delete p["@"],u=T(i,p)),i.isParallelCall=n>0,e.t0=r,e.next=8,w(t.lhs[a.exprIndex][1],o,u);case 8:return e.t1=e.sent,e.abrupt("return",[e.t0,e.t1]);case 10:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 34:x=e.sent,k=a(x),e.prev=36,k.s();case 38:if((E=k.n()).done){e.next=49;break}return A=E.value,e.next=42,A;case 42:S=e.sent,O=n(S,2),g=O[0],void 0!==(D=O[1])&&(u[g]=D);case 47:e.next=38;break;case 49:e.next=54;break;case 51:e.prev=51,e.t0=e.catch(36),k.e(e.t0);case 54:return e.prev=54,k.f(),e.finish(54);case 57:return e.abrupt("return",u);case 58:case"end":return e.stop()}},e,null,[[36,51,54,57]])}))).apply(this,arguments)}function K(e){if(!Array.isArray(e))return e;var t={};Object.assign(t,e[0]);for(var r=1;r<e.length;r++)for(var n in e[r])t[n]=l.append(t[n],e[r][n]);return t}function ee(e,t){var r;if(void 0!==e&&!Number.isInteger(e))throw{code:"T2003",stack:(new Error).stack,value:e};if(void 0!==t&&!Number.isInteger(t))throw{code:"T2004",stack:(new Error).stack,value:t};if(void 0===e||void 0===t)return r;if(e>t)return r;var n=t-e+1;if(n>1e7)throw{code:"D2014",stack:(new Error).stack,value:n};r=new Array(n);for(var a=e,o=0;a<=t;a++,o++)r[o]=a;return r.sequence=!0,r}function te(e,t,r){return re.apply(this,arguments)}function re(){return(re=p(s().mark(function e(t,r,n){var a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.rhs,r,n);case 2:return a=e.sent,n.bind(t.lhs.value,a),e.abrupt("return",a);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ne(e,t,r){return ae.apply(this,arguments)}function ae(){return(ae=p(s().mark(function e(t,r,n){var a,o;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.condition,r,n);case 2:if(o=e.sent,!l.boolean(o)){e.next=9;break}return e.next=6,w(t.then,r,n);case 6:a=e.sent,e.next=13;break;case 9:if(void 0===t.else){e.next=13;break}return e.next=12,w(t.else,r,n);case 12:a=e.sent;case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}function oe(e,t,r){return ie.apply(this,arguments)}function ie(){return(ie=p(s().mark(function e(t,r,n){var a,o,i;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=Fe(n),i=0;case 2:if(!(i<t.expressions.length)){e.next=9;break}return e.next=5,w(t.expressions[i],r,o);case 5:a=e.sent;case 6:i++,e.next=2;break;case 9:return e.abrupt("return",a);case 10:case"end":return e.stop()}},e)}))).apply(this,arguments)}function se(e){var t=new Ie.RegexEngine(e.value),r=function(n,a){var o;t.lastIndex=a||0;var i=t.exec(n);if(null!==i){if(o={match:i[0],start:i.index,end:i.index+i[0].length,groups:[]},i.length>1)for(var s=1;s<i.length;s++)o.groups.push(i[s]);o.next=function(){if(!(t.lastIndex>=n.length)){var a=r(n,t.lastIndex);if(a&&""===a.match)throw{code:"D1004",stack:(new Error).stack,position:e.position,value:e.value.source};return a}}}return o};return r}function ue(e,t,r){return""===e.value?t&&t.outerWrapper?t[0]:t:r.lookup(e.value)}function ce(e,t,r){return pe.apply(this,arguments)}function pe(){return(pe=p(s().mark(function e(t,r,n){var a,o,i,c,f;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=r,i=!!r.tupleStream,c=function(){var e=p(s().mark(function e(r,a){var o,c,p,f,l,h,d,v,b;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=0,c=0;case 2:if(!(0===o&&c<t.terms.length)){e.next=37;break}return p=t.terms[c],f=r,l=n,i&&(f=r["@"],l=T(n,r)),e.next=9,w(p.expression,f,l);case 9:return h=e.sent,f=a,l=n,i&&(f=a["@"],l=T(n,a)),e.next=15,w(p.expression,f,l);case 15:if(d=e.sent,v=u(h),b=u(d),"undefined"!==v){e.next=21;break}return o="undefined"===b?0:1,e.abrupt("continue",34);case 21:if("undefined"!==b){e.next=24;break}return o=-1,e.abrupt("continue",34);case 24:if(!("string"!==v&&"number"!==v||"string"!==b&&"number"!==b)){e.next=26;break}throw{code:"T2008",stack:(new Error).stack,position:t.position,value:"string"!==v&&"number"!==v?h:d};case 26:if(v===b){e.next=28;break}throw{code:"T2007",stack:(new Error).stack,position:t.position,value:h,value2:d};case 28:if(h!==d){e.next=32;break}return e.abrupt("continue",34);case 32:o=h<d?-1:1;case 33:!0===p.descending&&(o=-o);case 34:c++,e.next=2;break;case 37:return e.abrupt("return",1===o);case 38:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}(),f={environment:n,input:r},e.next=6,l.sort.apply(f,[o,c]);case 6:return a=e.sent,e.abrupt("return",a);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fe(e,r,n){return Me(function(){var r=p(s().mark(function r(a){var o,i,p,f,l,h,d,v,b,y,g;return s().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==a){r.next=2;break}return r.abrupt("return",void 0);case 2:if(o=n.lookup("clone"),c(o)){r.next=5;break}throw{code:"T2013",stack:(new Error).stack,position:e.position};case 5:return r.next=7,ye(o,[a],null,n);case 7:return i=r.sent,r.next=10,w(e.pattern,i,n);case 10:if(void 0===(p=r.sent)){r.next=39;break}Array.isArray(p)||(p=[p]),f=0;case 14:if(!(f<p.length)){r.next=39;break}if(!(l=p[f])||!(l.isPrototypeOf(i)||l instanceof Object.constructor)){r.next=18;break}throw{code:"D1010",stack:(new Error).stack,position:e.position};case 18:return r.next=20,w(e.update,l,n);case 20:if(h=r.sent,"undefined"===(d=u(h))){r.next=26;break}if("object"===d&&null!==h&&!Array.isArray(h)){r.next=25;break}throw{code:"T2011",stack:(new Error).stack,position:e.update.position,value:h};case 25:for(v in h)l[v]=h[v];case 26:if(void 0===e.delete){r.next=36;break}return r.next=29,w(e.delete,l,n);case 29:if(void 0===(b=r.sent)){r.next=36;break}if(y=b,Array.isArray(b)||(b=[b]),t(b)){r.next=35;break}throw{code:"T2012",stack:(new Error).stack,position:e.delete.position,value:y};case 35:for(g=0;g<b.length;g++)"object"===u(l)&&null!==l&&delete l[b[g]];case 36:f++,r.next=14;break;case 39:return r.abrupt("return",i);case 40:case"end":return r.stop()}},r)}));return function(e){return r.apply(this,arguments)}}(),"<(oa):o>")}var le=d("function($f, $g) { function($x){ $g($f($x)) } }");function he(e,t,r){return de.apply(this,arguments)}function de(){return(de=p(s().mark(function e(t,r,n){var a,o,i,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.lhs,r,n);case 2:if(o=e.sent,"function"!==t.rhs.type){e.next=9;break}return e.next=6,ve(t.rhs,r,n,{context:o});case 6:a=e.sent,e.next=26;break;case 9:return e.next=11,w(t.rhs,r,n);case 11:if(i=e.sent,c(i)){e.next=14;break}throw{code:"T2006",stack:(new Error).stack,position:t.position,value:i};case 14:if(!c(o)){e.next=23;break}return e.next=17,w(le,null,n);case 17:return u=e.sent,e.next=20,ye(u,[o,i],null,n);case 20:a=e.sent,e.next=26;break;case 23:return e.next=25,ye(i,[o],null,n);case 25:a=e.sent;case 26:return e.abrupt("return",a);case 27:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ve(e,t,r,n){return be.apply(this,arguments)}function be(){return(be=p(s().mark(function e(t,r,n,a){var o,i,f,l,h,d;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.procedure,r,n);case 2:if(void 0!==(i=e.sent)||"path"!==t.procedure.type||!n.lookup(t.procedure.steps[0].value)){e.next=5;break}throw{code:"T1005",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 5:f=[],void 0!==a&&f.push(a.context),l=s().mark(function e(){var a,o;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w(t.arguments[h],r,n);case 2:a=e.sent,c(a)?((o=function(){var e=p(s().mark(function e(){var t,r,o,i=arguments;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(t=i.length,r=new Array(t),o=0;o<t;o++)r[o]=i[o];return e.next=3,ye(a,r,null,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()).arity=m(a),f.push(o)):f.push(a);case 4:case"end":return e.stop()}},e)}),h=0;case 9:if(!(h<t.arguments.length)){e.next=14;break}return e.delegateYield(l(),"t0",11);case 11:h++,e.next=9;break;case 14:return d="path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value,e.prev=15,"object"===u(i)&&(i.token=d,i.position=t.position),e.next=19,ye(i,f,r,n);case 19:o=e.sent,e.next=27;break;case 22:throw e.prev=22,e.t1=e.catch(15),e.t1.position||(e.t1.position=t.position),e.t1.token||(e.t1.token=d),e.t1;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e,null,[[15,22]])}))).apply(this,arguments)}function ye(e,t,r,n){return ge.apply(this,arguments)}function ge(){return(ge=p(s().mark(function e(t,r,n,a){var o,i,u,c;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,me(t,r,n,a);case 2:o=e.sent;case 3:if(!b(o)||!0!==o.thunk){e.next=25;break}return e.next=6,w(o.body.procedure,o.input,o.environment);case 6:i=e.sent,"variable"===o.body.procedure.type&&(i.token=o.body.procedure.value),i.position=o.body.procedure.position,u=[],c=0;case 11:if(!(c<o.body.arguments.length)){e.next=20;break}return e.t0=u,e.next=15,w(o.body.arguments[c],o.input,o.environment);case 15:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 17:c++,e.next=11;break;case 20:return e.next=22,me(i,u,n,a);case 22:o=e.sent,e.next=3;break;case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}},e)}))).apply(this,arguments)}function me(e,t,r,n){return xe.apply(this,arguments)}function xe(){return(xe=p(s().mark(function e(t,r,n,a){var o,i,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=r,t&&(i=Ae(t.signature,r,n)),!b(t)){e.next=9;break}return e.next=6,Se(t,i);case 6:o=e.sent,e.next=28;break;case 9:if(!t||!0!==t._jsonata_function){e.next=19;break}if(u={environment:a,input:n},o=t.implementation.apply(u,i),y(o)&&(o=o.next().value),!g(o)){e.next=17;break}return e.next=16,o;case 16:o=e.sent;case 17:e.next=28;break;case 19:if("function"!=typeof t){e.next=27;break}if(o=t.apply(n,i),!g(o)){e.next=25;break}return e.next=24,o;case 24:o=e.sent;case 25:e.next=28;break;case 27:throw{code:"T1006",stack:(new Error).stack};case 28:e.next=34;break;case 30:throw e.prev=30,e.t0=e.catch(0),t&&(void 0===e.t0.token&&void 0!==t.token&&(e.t0.token=t.token),e.t0.position=t.position||e.t0.position),e.t0;case 34:return e.abrupt("return",o);case 35:case"end":return e.stop()}},e,null,[[0,30]])}))).apply(this,arguments)}function ke(e,t,r){var n={_jsonata_lambda:!0,input:t,environment:r,arguments:e.arguments,signature:e.signature,body:e.body};return!0===e.thunk&&(n.thunk=!0),n.apply=function(){var e=p(s().mark(function e(a,o){return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ye(n,o,t,a?a.environment:r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}(),n}function we(e,t,r){return Ee.apply(this,arguments)}function Ee(){return(Ee=p(s().mark(function e(t,r,n){var a,o,i,u,c;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=[],i=0;case 2:if(!(i<t.arguments.length)){e.next=16;break}if("operator"!==(u=t.arguments[i]).type||"?"!==u.value){e.next=8;break}o.push(u),e.next=13;break;case 8:return e.t0=o,e.next=11,w(u,r,n);case 11:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 13:i++,e.next=2;break;case 16:return e.next=18,w(t.procedure,r,n);case 18:if(void 0!==(c=e.sent)||"path"!==t.procedure.type||!n.lookup(t.procedure.steps[0].value)){e.next=21;break}throw{code:"T1007",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 21:if(!b(c)){e.next=25;break}a=Oe(c,o),e.next=34;break;case 25:if(!c||!0!==c._jsonata_function){e.next=29;break}a=De(c.implementation,o),e.next=34;break;case 29:if("function"!=typeof c){e.next=33;break}a=De(c,o),e.next=34;break;case 33:throw{code:"T1008",stack:(new Error).stack,position:t.position,token:"path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value};case 34:return e.abrupt("return",a);case 35:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ae(e,t,r){return void 0===e?t:e.validate(t,r)}function Se(e,t){return Te.apply(this,arguments)}function Te(){return(Te=p(s().mark(function e(t,r){var n,a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Fe(t.environment),t.arguments.forEach(function(e,t){a.bind(e.value,r[t])}),"function"!=typeof t.body){e.next=8;break}return e.next=5,Pe(t.body,a);case 5:n=e.sent,e.next=11;break;case 8:return e.next=10,w(t.body,t.input,a);case 10:n=e.sent;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Oe(e,t){var r=Fe(e.environment),n=[];return e.arguments.forEach(function(e,a){var o=t[a];o&&"operator"===o.type&&"?"===o.value?n.push(e):r.bind(e.value,o)}),{_jsonata_lambda:!0,input:e.input,environment:r,arguments:n,body:e.body}}function De(e,t){var r=Le(e),n="function("+(r=r.map(function(e){return"$"+e.trim()})).join(", ")+"){ _ }",a=d(n);return a.body=e,Oe(a,t)}function Pe(e,t){return je.apply(this,arguments)}function je(){return(je=p(s().mark(function e(t,r){var n,a,o,i;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Le(t),a=n.map(function(e){return r.lookup(e.trim())}),o={environment:r},i=t.apply(o,a),!g(i)){e.next=8;break}return e.next=7,i;case 7:i=e.sent;case 8:return e.abrupt("return",i);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Le(e){var t=e.toString();return/\(([^)]*)\)/.exec(t)[1].split(",")}function Me(e,t){var r={_jsonata_function:!0,implementation:e};return void 0!==t&&(r.signature=v(t)),r}function Ce(){return(Ce=p(s().mark(function e(t,r){var n,a,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:n=this.input,void 0!==r&&(n=r,Array.isArray(n)&&!i(n)&&((n=o(n)).outerWrapper=!0)),e.prev=4,a=d(t,!1),e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(4),Ue(e.t0),{stack:(new Error).stack,code:"D3120",value:e.t0.message,error:e.t0};case 12:return e.prev=12,e.next=15,w(a,n,this.environment);case 15:u=e.sent,e.next=22;break;case 18:throw e.prev=18,e.t1=e.catch(12),Ue(e.t1),{stack:(new Error).stack,code:"D3121",value:e.t1.message,error:e.t1};case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}},e,this,[[4,8],[12,18]])}))).apply(this,arguments)}function Fe(e){var t={},r={bind:function(e,r){t[e]=r},lookup:function(r){var n;return t.hasOwnProperty(r)?n=t[r]:e&&(n=e.lookup(r)),n},timestamp:e?e.timestamp:null,async:!!e&&e.async,isParallelCall:!!e&&e.isParallelCall,global:e?e.global:{ancestry:[null]}};if(e){var n=e.lookup(Symbol.for("jsonata.__createFrame_push"));n&&n(e,r)}return r}k.bind("sum",Me(l.sum,"<a<n>:n>")),k.bind("count",Me(l.count,"<a:n>")),k.bind("max",Me(l.max,"<a<n>:n>")),k.bind("min",Me(l.min,"<a<n>:n>")),k.bind("average",Me(l.average,"<a<n>:n>")),k.bind("string",Me(l.string,"<x-b?:s>")),k.bind("substring",Me(l.substring,"<s-nn?:s>")),k.bind("substringBefore",Me(l.substringBefore,"<s-s:s>")),k.bind("substringAfter",Me(l.substringAfter,"<s-s:s>")),k.bind("lowercase",Me(l.lowercase,"<s-:s>")),k.bind("uppercase",Me(l.uppercase,"<s-:s>")),k.bind("length",Me(l.length,"<s-:n>")),k.bind("trim",Me(l.trim,"<s-:s>")),k.bind("pad",Me(l.pad,"<s-ns?:s>")),k.bind("match",Me(l.match,"<s-f<s:o>n?:a<o>>")),k.bind("contains",Me(l.contains,"<s-(sf):b>")),k.bind("replace",Me(l.replace,"<s-(sf)(sf)n?:s>")),k.bind("split",Me(l.split,"<s-(sf)n?:a<s>>")),k.bind("join",Me(l.join,"<a<s>s?:s>")),k.bind("formatNumber",Me(l.formatNumber,"<n-so?:s>")),k.bind("formatBase",Me(l.formatBase,"<n-n?:s>")),k.bind("formatInteger",Me(f.formatInteger,"<n-s:s>")),k.bind("parseInteger",Me(f.parseInteger,"<s-s:n>")),k.bind("number",Me(l.number,"<(nsb)-:n>")),k.bind("floor",Me(l.floor,"<n-:n>")),k.bind("ceil",Me(l.ceil,"<n-:n>")),k.bind("round",Me(l.round,"<n-n?:n>")),k.bind("abs",Me(l.abs,"<n-:n>")),k.bind("sqrt",Me(l.sqrt,"<n-:n>")),k.bind("power",Me(l.power,"<n-n:n>")),k.bind("random",Me(l.random,"<:n>")),k.bind("boolean",Me(l.boolean,"<x-:b>")),k.bind("not",Me(l.not,"<x-:b>")),k.bind("map",Me(l.map,"<af>")),k.bind("zip",Me(l.zip,"<a+>")),k.bind("filter",Me(l.filter,"<af>")),k.bind("single",Me(l.single,"<af?>")),k.bind("reduce",Me(l.foldLeft,"<afj?:j>")),k.bind("sift",Me(l.sift,"<o-f?:o>")),k.bind("keys",Me(l.keys,"<x-:a<s>>")),k.bind("lookup",Me(l.lookup,"<x-s:x>")),k.bind("append",Me(l.append,"<xx:a>")),k.bind("exists",Me(l.exists,"<x:b>")),k.bind("spread",Me(l.spread,"<x-:a<o>>")),k.bind("merge",Me(l.merge,"<a<o>:o>")),k.bind("reverse",Me(l.reverse,"<a:a>")),k.bind("each",Me(l.each,"<o-f:a>")),k.bind("error",Me(l.error,"<s?:x>")),k.bind("assert",Me(l.assert,"<bs?:x>")),k.bind("type",Me(l.type,"<x:s>")),k.bind("sort",Me(l.sort,"<af?:a>")),k.bind("shuffle",Me(l.shuffle,"<a:a>")),k.bind("distinct",Me(l.distinct,"<x:x>")),k.bind("base64encode",Me(l.base64encode,"<s-:s>")),k.bind("base64decode",Me(l.base64decode,"<s-:s>")),k.bind("encodeUrlComponent",Me(l.encodeUrlComponent,"<s-:s>")),k.bind("encodeUrl",Me(l.encodeUrl,"<s-:s>")),k.bind("decodeUrlComponent",Me(l.decodeUrlComponent,"<s-:s>")),k.bind("decodeUrl",Me(l.decodeUrl,"<s-:s>")),k.bind("eval",Me(function(e,t){return Ce.apply(this,arguments)},"<sx?:x>")),k.bind("toMillis",Me(f.toMillis,"<s-s?:n>")),k.bind("fromMillis",Me(f.fromMillis,"<n-s?s?:s>")),k.bind("clone",Me(function(e){if(void 0!==e)return JSON.parse(l.string(e))},"<(oa)-:o>"));var Ne={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",D1010:"Attempted to access the Javascript object prototype",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e6. Attempted to allocate {{value}}.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function Ue(e){var t=Ne[e.code];if(void 0!==t){var r=t.replace(/\{\{\{([^}]+)}}}/g,function(){return e[arguments[1]]});r=r.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(e[arguments[1]])}),e.message=r}}function Ie(e,t){var r,n;try{r=d(e,t&&t.recover),n=r.errors,delete r.errors}catch(e){throw Ue(e),e}var a=Fe(k),u=new Date;return a.bind("now",Me(function(e,t){return f.fromMillis(u.getTime(),e,t)},"<s?s?:s>")),a.bind("millis",Me(function(){return u.getTime()},"<:n>")),t&&t.RegexEngine?Ie.RegexEngine=t.RegexEngine:Ie.RegexEngine=RegExp,{evaluate:function(){var e=p(s().mark(function e(t,c,p){var f,l,h,d;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===n){e.next=4;break}throw Ue(f={code:"S0500",position:0}),f;case 4:if(void 0!==c)for(h in l=Fe(a),c)l.bind(h,c[h]);else l=a;return l.bind("$",t),u=new Date,l.timestamp=u,Array.isArray(t)&&!i(t)&&((t=o(t)).outerWrapper=!0),e.prev=9,e.next=12,w(r,t,l);case 12:return d=e.sent,"function"==typeof p&&p(null,d),e.abrupt("return",d);case 17:throw e.prev=17,e.t0=e.catch(9),Ue(e.t0),e.t0;case 21:case"end":return e.stop()}},e,null,[[9,17]])}));return function(t,r,n){return e.apply(this,arguments)}}(),assign:function(e,t){a.bind(e,t)},registerFunction:function(e,t,r){var n=Me(t,r);a.bind(e,n)},ast:function(){return r},errors:function(){return n}}}return Ie.parser=d,Ie}();t.exports=b},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(e,t,r){"use strict";var n,a,o,i=e("./signature"),s=(n={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=function(e){var t=0,r=e.length,o=function(e,r){return{type:e,value:r,position:t}},i=function(s){if(t>=r)return null;for(var u=e.charAt(t);t<r&&" \t\n\r\v".indexOf(u)>-1;)t++,u=e.charAt(t);if("/"===u&&"*"===e.charAt(t+1)){var c=t;for(t+=2,u=e.charAt(t);"*"!==u||"/"!==e.charAt(t+1);)if(u=e.charAt(++t),t>=r)throw{code:"S0106",stack:(new Error).stack,position:c};return t+=2,u=e.charAt(t),i(s)}if(!0!==s&&"/"===u)return t++,o("regex",function(){for(var n,a,o=t,i=0,s=function(t){if("/"===e.charAt(t)&&0===i){for(var r=0;"\\"===e.charAt(t-(r+1));)r++;if(r%2==0)return!0}return!1};t<r;){var u=e.charAt(t);if(s(t)){if(""===(n=e.substring(o,t)))throw{code:"S0301",stack:(new Error).stack,position:t};for(t++,u=e.charAt(t),o=t;"i"===u||"m"===u;)t++,u=e.charAt(t);return a=e.substring(o,t)+"g",new RegExp(n,a)}"("!==u&&"["!==u&&"{"!==u||"\\"===e.charAt(t-1)||i++,")"!==u&&"]"!==u&&"}"!==u||"\\"===e.charAt(t-1)||i--,t++}throw{code:"S0302",stack:(new Error).stack,position:t}}());if("."===u&&"."===e.charAt(t+1))return t+=2,o("operator","..");if(":"===u&&"="===e.charAt(t+1))return t+=2,o("operator",":=");if("!"===u&&"="===e.charAt(t+1))return t+=2,o("operator","!=");if(">"===u&&"="===e.charAt(t+1))return t+=2,o("operator",">=");if("<"===u&&"="===e.charAt(t+1))return t+=2,o("operator","<=");if("*"===u&&"*"===e.charAt(t+1))return t+=2,o("operator","**");if("~"===u&&">"===e.charAt(t+1))return t+=2,o("operator","~>");if(Object.prototype.hasOwnProperty.call(n,u))return t++,o("operator",u);if('"'===u||"'"===u){var p=u;t++;for(var f="";t<r;){if("\\"===(u=e.charAt(t)))if(t++,u=e.charAt(t),Object.prototype.hasOwnProperty.call(a,u))f+=a[u];else{if("u"!==u)throw{code:"S0103",stack:(new Error).stack,position:t,token:u};var l=e.substr(t+1,4);if(!/^[0-9a-fA-F]+$/.test(l))throw{code:"S0104",stack:(new Error).stack,position:t};var h=parseInt(l,16);f+=String.fromCharCode(h),t+=4}else{if(u===p)return t++,o("string",f);f+=u}t++}throw{code:"S0101",stack:(new Error).stack,position:t}}var d,v=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(e.substring(t));if(null!==v){var b=parseFloat(v[0]);if(!isNaN(b)&&isFinite(b))return t+=v[0].length,o("number",b);throw{code:"S0102",stack:(new Error).stack,position:t,token:v[0]}}if("`"===u){t++;var y=e.indexOf("`",t);if(-1!==y)return d=e.substring(t,y),t=y+1,o("name",d);throw t=r,{code:"S0105",stack:(new Error).stack,position:t}}for(var g,m=t;;)if(g=e.charAt(m),m===r||" \t\n\r\v".indexOf(g)>-1||Object.prototype.hasOwnProperty.call(n,g)){if("$"===e.charAt(t))return d=e.substring(t+1,m),t=m,o("variable",d);switch(d=e.substring(t,m),t=m,d){case"or":case"in":case"and":return o("operator",d);case"true":return o("value",!0);case"false":return o("value",!1);case"null":return o("value",null);default:return t===r&&""===d?null:o("name",d)}}else m++};return i},function(e,t){var r,a,s={},u=[],c=function(){var e=[];"(end)"!==r.id&&e.push({type:r.type,value:r.value,position:r.position});for(var t=a();null!==t;)e.push(t),t=a();return e},p={nud:function(){var e={code:"S0211",token:this.value,position:this.position};if(t)return e.remaining=c(),e.type="error",u.push(e),e;throw e.stack=(new Error).stack,e}},f=function(e,t){var r=s[e];return t=t||0,r?t>=r.lbp&&(r.lbp=t):((r=Object.create(p)).id=r.value=e,r.lbp=t,s[e]=r),r},l=function(e){if(t){e.remaining=c(),u.push(e);var n=s["(error)"];return(r=Object.create(n)).error=e,r.type="(error)",r}throw e.stack=(new Error).stack,e},h=function(t,n){if(t&&r.id!==t){var o={code:"(end)"===r.id?"S0203":"S0202",position:r.position,token:r.value,value:t};return l(o)}var i=a(n);if(null===i)return(r=s["(end)"]).position=e.length,r;var u,c=i.value,p=i.type;switch(p){case"name":case"variable":u=s["(name)"];break;case"operator":if(!(u=s[c]))return l({code:"S0204",stack:(new Error).stack,position:i.position,token:c});break;case"string":case"number":case"value":u=s["(literal)"];break;case"regex":p="regex",u=s["(regex)"];break;default:return l({code:"S0205",stack:(new Error).stack,position:i.position,token:c})}return(r=Object.create(u)).value=c,r.type=p,r.position=i.position,r},d=function(e){var t,n=r;for(h(null,!0),t=n.nud();e<r.lbp;)n=r,h(),t=n.led(t);return t},v=function(e){f(e,0).nud=function(){return this}},b=function(e,t,r){var a=t||n[e],o=f(e,a);return o.led=r||function(e){return this.lhs=e,this.rhs=d(a),this.type="binary",this},o},y=function(e,t,r){var n=f(e,t);return n.led=r,n},g=function(e,t){var r=f(e);return r.nud=t||function(){return this.expression=d(70),this.type="unary",this},r};v("(end)"),v("(name)"),v("(literal)"),v("(regex)"),f(":"),f(";"),f(","),f(")"),f("]"),f("}"),f(".."),b("."),b("+"),b("-"),b("*"),b("/"),b("%"),b("="),b("<"),b(">"),b("!="),b("<="),b(">="),b("&"),b("and"),b("or"),b("in"),v("and"),v("or"),v("in"),g("-"),b("~>"),y("(error)",10,function(e){return this.lhs=e,this.error=r.error,this.remaining=c(),this.type="error",this}),g("*",function(){return this.type="wildcard",this}),g("**",function(){return this.type="descendant",this}),g("%",function(){return this.type="parent",this}),b("(",n["("],function(e){if(this.procedure=e,this.type="function",this.arguments=[],")"!==r.id)for(;"operator"===r.type&&"?"===r.id?(this.type="partial",this.arguments.push(r),h("?")):this.arguments.push(d(0)),","===r.id;)h(",");if(h(")",!0),"name"===e.type&&("function"===e.value||"λ"===e.value)){if(this.arguments.forEach(function(e,t){if("variable"!==e.type)return l({code:"S0208",stack:(new Error).stack,position:e.position,token:e.value,value:t+1})}),this.type="lambda","<"===r.id){for(var t=r.position,n=1,a="<";n>0&&"{"!==r.id&&"(end)"!==r.id;){var o=h();">"===o.id?n--:"<"===o.id&&n++,a+=o.value}h(">");try{this.signature=i(a)}catch(e){return e.position=t+e.offset,l(e)}}h("{"),this.body=d(0),h("}")}return this}),g("(",function(){for(var e=[];")"!==r.id&&(e.push(d(0)),";"===r.id);)h(";");return h(")",!0),this.type="block",this.expressions=e,this}),g("[",function(){var e=[];if("]"!==r.id)for(;;){var t=d(0);if(".."===r.id){var n={type:"binary",value:"..",position:r.position,lhs:t};h(".."),n.rhs=d(0),t=n}if(e.push(t),","!==r.id)break;h(",")}return h("]",!0),this.expressions=e,this.type="unary",this}),b("[",n["["],function(e){if("]"===r.id){for(var t=e;t&&"binary"===t.type&&"["===t.value;)t=t.lhs;return t.keepArray=!0,h("]"),e}return this.lhs=e,this.rhs=d(n["]"]),this.type="binary",h("]",!0),this}),b("^",n["^"],function(e){h("(");for(var t=[];;){var n={descending:!1};if("<"===r.id?h("<"):">"===r.id&&(n.descending=!0,h(">")),n.expression=d(0),t.push(n),","!==r.id)break;h(",")}return h(")"),this.lhs=e,this.rhs=t,this.type="binary",this});var m=function(e){var t=[];if("}"!==r.id)for(;;){var n=d(0);h(":");var a=d(0);if(t.push([n,a]),","!==r.id)break;h(",")}return h("}",!0),void 0===e?(this.lhs=t,this.type="unary"):(this.lhs=e,this.rhs=t,this.type="binary"),this};g("{",m),b("{",n["{"],m),y(":=",n[":="],function(e){return"variable"!==e.type?l({code:"S0212",stack:(new Error).stack,position:e.position,token:e.value}):(this.lhs=e,this.rhs=d(n[":="]-1),this.type="binary",this)}),b("@",n["@"],function(e){return this.lhs=e,this.rhs=d(n["@"]),"variable"!==this.rhs.type?l({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),b("#",n["#"],function(e){return this.lhs=e,this.rhs=d(n["#"]),"variable"!==this.rhs.type?l({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),b("?",n["?"],function(e){return this.type="condition",this.condition=e,this.then=d(0),":"===r.id&&(h(":"),this.else=d(0)),this}),g("|",function(){return this.type="transform",this.pattern=d(0),h("|"),this.update=d(0),","===r.id&&(h(","),this.delete=d(0)),h("|"),this});var x=function(e){var t;if("function"!==e.type||e.predicate)if("condition"===e.type)e.then=x(e.then),void 0!==e.else&&(e.else=x(e.else)),t=e;else if("block"===e.type){var r=e.expressions.length;r>0&&(e.expressions[r-1]=x(e.expressions[r-1])),t=e}else t=e;else{var n={type:"lambda",thunk:!0,arguments:[],position:e.position};n.body=e,t=n}return t},k=0,w=0,E=[],A=function(e,t){switch(e.type){case"name":case"wildcard":t.level--,0===t.level&&(void 0===e.ancestor?e.ancestor=t:(E[t.index].slot.label=e.ancestor.label,e.ancestor=t),e.tuple=!0);break;case"parent":t.level++;break;case"block":e.expressions.length>0&&(e.tuple=!0,t=A(e.expressions[e.expressions.length-1],t));break;case"path":e.tuple=!0;var r=e.steps.length-1;for(t=A(e.steps[r--],t);t.level>0&&r>=0;)t=A(e.steps[r--],t);break;default:throw{code:"S0217",token:e.type,position:e.position}}return t},S=function(e,t){if(void 0!==t.seekingParent||"parent"===t.type){var r=void 0!==t.seekingParent?t.seekingParent:[];"parent"===t.type&&r.push(t.slot),void 0===e.seekingParent?e.seekingParent=r:Array.prototype.push.apply(e.seekingParent,r)}},T=function(e){var t=e.steps.length-1,r=e.steps[t],n=void 0!==r.seekingParent?r.seekingParent:[];"parent"===r.type&&n.push(r.slot);for(var a=0;a<n.length;a++){var o=n[a];for(t=e.steps.length-2;o.level>0;){if(t<0){void 0===e.seekingParent?e.seekingParent=[o]:e.seekingParent.push(o);break}for(var i=e.steps[t--];t>=0&&i.focus&&e.steps[t].focus;)i=e.steps[t--];o=A(i,o)}}},O=function(e){var r;switch(e.type){case"binary":switch(e.value){case".":var n=O(e.lhs);r="path"===n.type?n:{type:"path",steps:[n]},"parent"===n.type&&(r.seekingParent=[n.slot]);var a=O(e.rhs);"function"===a.type&&"path"===a.procedure.type&&1===a.procedure.steps.length&&"name"===a.procedure.steps[0].type&&"function"===r.steps[r.steps.length-1].type&&(r.steps[r.steps.length-1].nextFunction=a.procedure.steps[0].value),"path"===a.type?Array.prototype.push.apply(r.steps,a.steps):(void 0!==a.predicate&&(a.stages=a.predicate,delete a.predicate),r.steps.push(a)),r.steps.filter(function(e){if("number"===e.type||"value"===e.type)throw{code:"S0213",stack:(new Error).stack,position:e.position,value:e.value};return"string"===e.type}).forEach(function(e){e.type="name"}),r.steps.filter(function(e){return!0===e.keepArray}).length>0&&(r.keepSingletonArray=!0);var o=r.steps[0];"unary"===o.type&&"["===o.value&&(o.consarray=!0);var i=r.steps[r.steps.length-1];"unary"===i.type&&"["===i.value&&(i.consarray=!0),T(r);break;case"[":var s=r=O(e.lhs),c="predicate";if("path"===r.type&&(s=r.steps[r.steps.length-1],c="stages"),void 0!==s.group)throw{code:"S0209",stack:(new Error).stack,position:e.position};void 0===s[c]&&(s[c]=[]);var p=O(e.rhs);void 0!==p.seekingParent&&(p.seekingParent.forEach(function(e){1===e.level?A(s,e):e.level--}),S(s,p)),s[c].push({type:"filter",expr:p,position:e.position});break;case"{":if(void 0!==(r=O(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};r.group={lhs:e.rhs.map(function(e){return[O(e[0]),O(e[1])]}),position:e.position};break;case"^":"path"!==(r=O(e.lhs)).type&&(r={type:"path",steps:[r]});var f={type:"sort",position:e.position};f.terms=e.rhs.map(function(e){var t=O(e.expression);return S(f,t),{descending:e.descending,expression:t}}),r.steps.push(f),T(r);break;case":=":(r={type:"bind",value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),S(r,r.rhs);break;case"@":if(r=O(e.lhs),s=r,"path"===r.type&&(s=r.steps[r.steps.length-1]),void 0!==s.stages||void 0!==s.predicate)throw{code:"S0215",stack:(new Error).stack,position:e.position};if("sort"===s.type)throw{code:"S0216",stack:(new Error).stack,position:e.position};e.keepArray&&(s.keepArray=!0),s.focus=e.rhs.value,s.tuple=!0;break;case"#":r=O(e.lhs),s=r,"path"===r.type?s=r.steps[r.steps.length-1]:(r={type:"path",steps:[r]},void 0!==s.predicate&&(s.stages=s.predicate,delete s.predicate)),void 0===s.stages?s.index=e.rhs.value:s.stages.push({type:"index",value:e.rhs.value,position:e.position}),s.tuple=!0;break;case"~>":(r={type:"apply",value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),r.keepArray=r.lhs.keepArray||r.rhs.keepArray;break;default:(r={type:e.type,value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),S(r,r.lhs),S(r,r.rhs)}break;case"unary":r={type:e.type,value:e.value,position:e.position},"["===e.value?r.expressions=e.expressions.map(function(e){var t=O(e);return S(r,t),t}):"{"===e.value?r.lhs=e.lhs.map(function(e){var t=O(e[0]);S(r,t);var n=O(e[1]);return S(r,n),[t,n]}):(r.expression=O(e.expression),"-"===e.value&&"number"===r.expression.type?(r=r.expression).value=-r.value:S(r,r.expression));break;case"function":case"partial":(r={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map(function(e){var t=O(e);return S(r,t),t}),r.procedure=O(e.procedure);break;case"lambda":r={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var l=O(e.body);r.body=x(l);break;case"condition":(r={type:e.type,position:e.position}).condition=O(e.condition),S(r,r.condition),r.then=O(e.then),S(r,r.then),void 0!==e.else&&(r.else=O(e.else),S(r,r.else));break;case"transform":(r={type:e.type,position:e.position}).pattern=O(e.pattern),r.update=O(e.update),void 0!==e.delete&&(r.delete=O(e.delete));break;case"block":(r={type:e.type,position:e.position}).expressions=e.expressions.map(function(e){var t=O(e);return S(r,t),(t.consarray||"path"===t.type&&t.steps[0].consarray)&&(r.consarray=!0),t});break;case"name":r={type:"path",steps:[e]},e.keepArray&&(r.keepSingletonArray=!0);break;case"parent":r={type:"parent",slot:{label:"!"+k++,level:1,index:w++}},E.push(r);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":r=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",r=O(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};r=e}break;case"error":r=e,e.lhs&&(r=O(e.lhs));break;default:var h="S0206";"(end)"===e.id&&(h="S0207");var d={code:h,position:e.position,token:e.value};if(t)return u.push(d),{type:"error",error:d};throw d.stack=(new Error).stack,d}return e.keepArray&&(r.keepArray=!0),r};a=o(e),h();var D=d(0);if("(end)"!==r.id){var P={code:"S0201",position:r.position,token:r.value};l(P)}if("parent"===(D=O(D)).type||void 0!==D.seekingParent)throw{code:"S0217",token:D.type,position:D.position};return u.length>0&&(D.errors=u),D});t.exports=s},{"./signature":5}],5:[function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./utils"),o=function(){var e={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};return function(t){for(var r=1,o=[],i={},s=i;r<t.length;){var u=t.charAt(r);if(":"===u)break;var c=function(){o.push(i),s=i,i={}},p=function(e,t,r,n){for(var a=1,o=t;o<e.length;)if(o++,(u=e.charAt(o))===n){if(0==--a)break}else u===r&&a++;return o};switch(u){case"s":case"n":case"b":case"l":case"o":i.regex="["+u+"m]",i.type=u,c();break;case"a":i.regex="[asnblfom]",i.type=u,i.array=!0,c();break;case"f":i.regex="f",i.type=u,c();break;case"j":i.regex="[asnblom]",i.type=u,c();break;case"x":i.regex="[asnblfom]",i.type=u,c();break;case"-":s.context=!0,s.contextRegex=new RegExp(s.regex),s.regex+="?";break;case"?":case"+":s.regex+=u;break;case"(":var f=p(t,r,"(",")"),l=t.substring(r+1,f);if(-1!==l.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:l,offset:r};i.regex="["+l+"m]",i.type="("+l+")",r=f,c();break;case"<":if("a"!==s.type&&"f"!==s.type)throw{code:"S0401",stack:(new Error).stack,value:s.type,offset:r};var h=p(t,r,"<",">");s.subtype=t.substring(r+1,h),r=h}r++}var d="^"+o.map(function(e){return"("+e.regex+")"}).join("")+"$",v=new RegExp(d),b=function(e){var t;if(a.isFunction(e))t="f";else switch(n(e)){case"string":t="s";break;case"number":t="n";break;case"boolean":t="b";break;case"object":t=null===e?"l":Array.isArray(e)?"a":"o";break;case"undefined":default:t="m"}return t};return{definition:t,validate:function(t,r){var n="";t.forEach(function(e){n+=b(e)});var a=v.exec(n);if(a){var i=[],s=0;return o.forEach(function(n,o){var u=t[s],c=a[o+1];if(""===c)if(n.context&&n.contextRegex){var p=b(r);if(!n.contextRegex.test(p))throw{code:"T0411",stack:(new Error).stack,value:r,index:s+1};i.push(r)}else i.push(u),s++;else c.split("").forEach(function(r){if("a"===n.type){if("m"===r)u=void 0;else{u=t[s];var a=!0;if(void 0!==n.subtype)if("a"!==r&&c!==n.subtype)a=!1;else if("a"===r&&u.length>0){var o=b(u[0]);a=o===n.subtype.charAt(0)&&0===u.filter(function(e){return b(e)!==o}).length}if(!a)throw{code:"T0412",stack:(new Error).stack,value:u,index:s+1,type:e[n.subtype]};"a"!==r&&(u=[u])}i.push(u),s++}else i.push(u),s++})}),i}!function(e,t){for(var r="^",n=0,a=0;a<o.length;a++){r+=o[a].regex;var i=t.match(r);if(null===i)throw{code:"T0410",stack:(new Error).stack,value:e[n],index:n+1};n=i[0].length}throw{code:"T0410",stack:(new Error).stack,value:e[n],index:n+1}}(t,n)}}}}();t.exports=o},{"./utils":6}],6:[function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(){function e(e){var t=!1;if("number"==typeof e&&(t=!isNaN(e))&&!isFinite(e))throw{code:"D1001",value:e,stack:(new Error).stack};return t}var t=("function"==typeof Symbol?Symbol:{}).iterator||"@@iterator";return{isNumeric:e,isArrayOfStrings:function(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter(function(e){return"string"!=typeof e}).length),t},isArrayOfNumbers:function(t){var r=!1;return Array.isArray(t)&&(r=0===t.filter(function(t){return!e(t)}).length),r},createSequence:function(){var e=[];return e.sequence=!0,1===arguments.length&&e.push(arguments[0]),e},isSequence:function(e){return!0===e.sequence&&Array.isArray(e)},isFunction:function(e){return e&&(!0===e._jsonata_function||!0===e._jsonata_lambda)||"function"==typeof e},isLambda:function(e){return e&&!0===e._jsonata_lambda},isIterable:function(e){return"object"===o(e)&&null!==e&&t in e&&"next"in e&&"function"==typeof e.next},getFunctionArity:function(e){return"number"==typeof e.arity?e.arity:"function"==typeof e.implementation?e.implementation.length:"number"==typeof e.length?e.length:e.arguments.length},isDeepEqual:function e(t,r){if(t===r)return!0;if("object"===o(t)&&"object"===o(r)&&null!==t&&null!==r){if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}var a=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(r);if(a.length!==i.length)return!1;for(a=a.sort(),i=i.sort(),n=0;n<a.length;n++)if(a[n]!==i[n])return!1;for(n=0;n<a.length;n++){var s=a[n];if(!e(t[s],r[s]))return!1}return!0}return!1},stringToArray:function(e){var t,r=[],a=n(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.push(o)}}catch(e){a.e(e)}finally{a.f()}return r},isPromise:function(e){return"object"===o(e)&&null!==e&&"then"in e&&"function"==typeof e.then}}}();t.exports=i},{}]},{},[3])(3)});
|
|
1
|
+
var runtime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,r,n,i){var o=r&&r.prototype instanceof b?r:b,s=Object.create(o.prototype),u=new P(i||[]);return a(s,"_invoke",{value:function(e,r,n){var a=l;return function(i,o){if(a===d)throw new Error("Generator is already running");if(a===v){if("throw"===i)throw o;return{value:t,done:!0}}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===l)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var c=p(e,r,n);if("normal"===c.type){if(a=n.done?v:h,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=v,n.method="throw",n.arg=c.arg)}}}(e,n,u)}),s}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var l="suspendedStart",h="suspendedYield",d="executing",v="completed",g={};function b(){}function y(){}function m(){}var k={};c(k,o,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(j([])));x&&x!==r&&n.call(x,o)&&(k=x);var E=m.prototype=b.prototype=Object.create(k);function A(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var r;a(this,"_invoke",{value:function(a,i){function o(){return new t(function(r,o){!function r(a,i,o,s){var u=p(e[a],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):t.resolve(f).then(function(e){c.value=e,o(c)},function(e){return r("throw",e,o,s)})}s(u.arg)}(a,i,r,o)})}return r=r?r.then(o,o):o()}})}function T(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)?g:("return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g);var i=p(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function j(e){if(null!=e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=m,a(E,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},A(S.prototype),c(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new S(f(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},A(E),c(E,u,"Generator"),c(E,o,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},String.fromCodePoint||function(e){var t=function(t){for(var r=[],n=0,a="",i=0,o=arguments.length;i!==o;++i){var s=+arguments[i];if(!(s<1114111&&s>>>0===s))throw RangeError("Invalid code point: "+s);s<=65535?n=r.push(s):(s-=65536,n=r.push(55296+(s>>10),s%1024+56320)),n>=16383&&(a+=e.apply(null,r),r.length=0)}return a+e.apply(null,r)};try{Object.defineProperty(String,"fromCodePoint",{value:t,configurable:!0,writable:!0})}catch(e){String.fromCodePoint=t}}(String.fromCharCode),Object.is||(Object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var a,i=t.charCodeAt(n);return i>=55296&&i<=56319&&r>n+1&&(a=t.charCodeAt(n+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}(),Math.log10=Math.log10||function(e){return Math.log(e)*Math.LOG10E},function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsonata=e()}}(function(){return function(){return function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){return a(t[o][1][e]||e)},f,f.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(e,t,r){"use strict";var n=e("./utils"),a=function(){var e=n.stringToArray,t=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],a=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],i=["Thousand","Million","Billion","Trillion"];var o={};t.forEach(function(e,t){o[e.toLowerCase()]=t}),r.forEach(function(e,t){o[e.toLowerCase()]=t}),a.forEach(function(e,t){var r=e.toLowerCase();o[r]=10*(t+2),o[r.substring(0,e.length-1)+"ieth"]=o[r]}),o.hundredth=100,i.forEach(function(e,t){var r=e.toLowerCase(),n=Math.pow(10,3*(t+1));o[r]=n,o[r+"th"]=n});var s=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],u={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function c(e,t){if(void 0!==e)return l(e=Math.floor(e),d(t))}var f={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},p={UPPER:"upper",LOWER:"lower",TITLE:"title"};function l(n,o){var u,c=n<0;switch(n=Math.abs(n),o.primary){case f.LETTERS:u=function(e,t){for(var r=[],n=t.charCodeAt(0);e>0;)r.unshift(String.fromCharCode((e-1)%26+n)),e=Math.floor((e-1)/26);return r.join("")}(n,o.case===p.UPPER?"A":"a");break;case f.ROMAN:u=function e(t){for(var r=0;r<s.length;r++){var n=s[r];if(t>=n[0])return n[1]+e(t-n[0])}return""}(n),o.case===p.UPPER&&(u=u.toUpperCase());break;case f.WORDS:u=function(e,n){var o=function(e,n,s){var u="";if(e<=19)u=(n?" and ":"")+(s?r[e]:t[e]);else if(e<100){var c=Math.floor(e/10),f=e%10;u=(n?" and ":"")+a[c-2],f>0?u+="-"+o(f,!1,s):s&&(u=u.substring(0,u.length-1)+"ieth")}else if(e<1e3){var p=Math.floor(e/100),l=e%100;u=(n?", ":"")+t[p]+" Hundred",l>0?u+=o(l,!0,s):s&&(u+="th")}else{var h=Math.floor(Math.log10(e)/3);h>i.length&&(h=i.length);var d=Math.pow(10,3*h),v=Math.floor(e/d),g=e-v*d;u=(n?", ":"")+o(v,!1,!1)+" "+i[h-1],g>0?u+=o(g,!0,s):s&&(u+="th")}return u};return o(e,!1,n)}(n,o.ordinal),o.case===p.UPPER?u=u.toUpperCase():o.case===p.LOWER&&(u=u.toLowerCase());break;case f.DECIMAL:u=""+n;var l=o.mandatoryDigits-u.length;if(l>0){var h=new Array(l+1).join("0");u=h+u}if(48!==o.zeroCode&&(u=e(u).map(function(e){return String.fromCodePoint(e.codePointAt(0)+o.zeroCode-48)}).join("")),o.regular)for(var d=Math.floor((u.length-1)/o.groupingSeparators.position);d>0;d--){var v=u.length-d*o.groupingSeparators.position;u=u.substr(0,v)+o.groupingSeparators.character+u.substr(v)}else o.groupingSeparators.reverse().forEach(function(e){var t=u.length-e.position;u=u.substr(0,t)+e.character+u.substr(t)});if(o.ordinal){var g={1:"st",2:"nd",3:"rd"}[u[u.length-1]];(!g||u.length>1&&"1"===u[u.length-2])&&(g="th"),u+=g}break;case f.SEQUENCE:throw{code:"D3130",value:o.token}}return c&&(u="-"+u),u}var h=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function d(t){var r,n={type:"integer",primary:f.DECIMAL,case:p.LOWER,ordinal:!1},a=t.lastIndexOf(";");switch(-1===a?r=t:(r=t.substring(0,a),"o"===t.substring(a+1)[0]&&(n.ordinal=!0)),r){case"A":n.case=p.UPPER;case"a":n.primary=f.LETTERS;break;case"I":n.case=p.UPPER;case"i":n.primary=f.ROMAN;break;case"W":n.case=p.UPPER,n.primary=f.WORDS;break;case"Ww":n.case=p.TITLE,n.primary=f.WORDS;break;case"w":n.primary=f.WORDS;break;default:var i=null,o=0,s=0,u=[],c=0;if(e(r).map(function(e){return e.codePointAt(0)}).reverse().forEach(function(e){for(var t=!1,r=0;r<h.length;r++){var n=h[r];if(e>=n&&e<=n+9){if(t=!0,o++,c++,null===i)i=n;else if(n!==i)throw{code:"D3131"};break}}t||(35===e?(c++,s++):u.push({position:c,character:String.fromCodePoint(e)}))}),o>0){n.primary=f.DECIMAL,n.zeroCode=i,n.mandatoryDigits=o,n.optionalDigits=s;var l=function(e){if(0===e.length)return 0;for(var t=e[0].character,r=1;r<e.length;r++)if(e[r].character!==t)return 0;for(var n=e.map(function(e){return e.position}),a=function(e,t){return 0===t?e:a(t,e%t)},i=n.reduce(a),o=1;o<=n.length;o++)if(-1===n.indexOf(o*i))return 0;return i}(u);l>0?(n.regular=!0,n.groupingSeparators={position:l,character:u[0].character}):(n.regular=!1,n.groupingSeparators=u)}else n.primary=f.SEQUENCE,n.token=r}return n}var v={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function g(e){for(var t=[],r={type:"datetime",parts:t},n=function(r,n){if(n>r){var a=e.substring(r,n);a=a.split("]]").join("]"),t.push({type:"literal",value:a})}},a=0,i=0;i<e.length;){if("["===e.charAt(i)){if("["===e.charAt(i+1)){n(a,i),t.push({type:"literal",value:"["}),a=i+=2;continue}if(n(a,i),a=i,-1===(i=e.indexOf("]",a)))throw{code:"D3135"};var o,s=e.substring(a+1,i),u={type:"marker",component:(s=s.split(/\s+/).join("")).charAt(0)},c=s.lastIndexOf(",");if(-1!==c){var f=s.substring(c+1),l=f.indexOf("-"),h=void 0,g=void 0,b=function(e){return void 0===e||"*"===e?void 0:parseInt(e)};-1===l?h=f:(h=f.substring(0,l),g=f.substring(l+1));var y={min:b(h),max:b(g)};u.width=y,o=s.substring(1,c)}else o=s.substring(1);if(1===o.length)u.presentation1=o;else if(o.length>1){var m=o.charAt(o.length-1);-1!=="atco".indexOf(m)?(u.presentation2=m,"o"===m&&(u.ordinal=!0),u.presentation1=o.substring(0,o.length-1)):u.presentation1=o}else u.presentation1=v[u.component];if(void 0===u.presentation1)throw{code:"D3132",value:u.component};if("n"===u.presentation1[0])u.names=p.LOWER;else if("N"===u.presentation1[0])"n"===u.presentation1[1]?u.names=p.TITLE:u.names=p.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(u.component)){var k=u.presentation1;if(u.presentation2&&(k+=";"+u.presentation2),u.integerFormat=d(k),u.width&&void 0!==u.width.min&&u.integerFormat.mandatoryDigits<u.width.min&&(u.integerFormat.mandatoryDigits=u.width.min),"Y"===u.component)if(u.n=-1,u.width&&void 0!==u.width.max)u.n=u.width.max,u.integerFormat.mandatoryDigits=u.n;else{var w=u.integerFormat.mandatoryDigits+u.integerFormat.optionalDigits;w>=2&&(u.n=w)}var x=t[t.length-1];x&&x.integerFormat&&(x.integerFormat.parseWidth=x.integerFormat.mandatoryDigits)}"Z"!==u.component&&"z"!==u.component||(u.integerFormat=d(u.presentation1)),t.push(u),a=i+1}i++}return n(a,i),r}var b=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],y=["January","February","March","April","May","June","July","August","September","October","November","December"],m=function(e){var t=Date.UTC(e.year,e.month),r=new Date(t).getUTCDay();return 0===r&&(r=7),r>4?t+864e5*(8-r):t-864e5*(r-1)},k=function(e,t){return{year:e,month:t,nextMonth:function(){return 11===t?k(e+1,0):k(e,t+1)},previousMonth:function(){return 0===t?k(e-1,11):k(e,t-1)},nextYear:function(){return k(e+1,t)},previousYear:function(){return k(e-1,t)}}},w=function(e,t){return(t-e)/6048e5+1},x=function(e,t){var r;switch(t){case"Y":r=e.getUTCFullYear();break;case"M":r=e.getUTCMonth()+1;break;case"D":r=e.getUTCDate();break;case"d":r=(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0))/864e5+1;break;case"F":0===(r=e.getUTCDay())&&(r=7);break;case"W":var n=k(e.getUTCFullYear(),0),a=m(n),i=Date.UTC(n.year,e.getUTCMonth(),e.getUTCDate()),o=w(a,i);if(o>52)i>=m(n.nextYear())&&(o=1);else if(o<1){var s=m(n.previousYear());o=w(s,i)}r=Math.floor(o);break;case"w":var u=k(e.getUTCFullYear(),e.getUTCMonth()),c=m(u),f=Date.UTC(u.year,u.month,e.getUTCDate()),p=w(c,f);if(p>4)f>=m(u.nextMonth())&&(p=1);else if(p<1){var l=m(u.previousMonth());p=w(l,f)}r=Math.floor(p);break;case"X":var h=k(e.getUTCFullYear(),0),d=m(h),v=m(h.nextYear()),g=e.getTime();r=g<d?h.year-1:g>=v?h.year+1:h.year;break;case"x":var b=k(e.getUTCFullYear(),e.getUTCMonth()),y=m(b),x=b.nextMonth(),E=m(x),A=e.getTime();r=A<y?b.previousMonth().month+1:A>=E?x.month+1:b.month+1;break;case"H":r=e.getUTCHours();break;case"h":r=e.getUTCHours(),0===(r%=12)&&(r=12);break;case"P":r=e.getUTCHours()>=12?"pm":"am";break;case"m":r=e.getUTCMinutes();break;case"s":r=e.getUTCSeconds();break;case"f":r=e.getUTCMilliseconds();break;case"Z":case"z":break;case"C":case"E":r="ISO"}return r},E=null;function A(e,t,r){var n=0,a=0;if(void 0!==r){var i=parseInt(r);n=Math.floor(i/100),a=i%100}var o;void 0===t?(null===E&&(E=g("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),o=E):o=g(t);var s=new Date(e+60*(60*n+a)*1e3),u="";return o.parts.forEach(function(e){"literal"===e.type?u+=e.value:u+=function(e,t){var r=x(e,t.component);if(-1!=="YMDdFWwXxHhms".indexOf(t.component))if("Y"===t.component&&-1!==t.n&&(r%=Math.pow(10,t.n)),t.names){if("M"===t.component||"x"===t.component)r=y[r-1];else{if("F"!==t.component)throw{code:"D3133",value:t.component};r=b[r]}t.names===p.UPPER?r=r.toUpperCase():t.names===p.LOWER&&(r=r.toLowerCase()),t.width&&r.length>t.width.max&&(r=r.substring(0,t.width.max))}else r=l(r,t.integerFormat);else if("f"===t.component)r=l(r,t.integerFormat);else if("Z"===t.component||"z"===t.component){var i=100*n+a;if(t.integerFormat.regular)r=l(i,t.integerFormat);else{var o=t.integerFormat.mandatoryDigits;if(1===o||2===o)r=l(n,t.integerFormat),0!==a&&(r+=":"+c(a,"00"));else{if(3!==o&&4!==o)throw{code:"D3134",value:o};r=l(i,t.integerFormat)}}i>=0&&(r="+"+r),"z"===t.component&&(r="GMT"+r),0===i&&"t"===t.presentation2&&(r="Z")}else"P"===t.component&&t.names===p.UPPER&&(r=r.toUpperCase());return r}(s,e)}),u}function S(e){var t={};if("datetime"===e.type)t.type="datetime",t.parts=e.parts.map(function(e){var t={};if("literal"===e.type)t.regex=e.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if("Z"===e.component||"z"===e.component){var r;Array.isArray(e.integerFormat.groupingSeparators)||(r=e.integerFormat.groupingSeparators),t.regex="","z"===e.component&&(t.regex="GMT"),t.regex+="[-+][0-9]+",r&&(t.regex+=r.character+"[0-9]+"),t.parse=function(t){"z"===e.component&&(t=t.substring(3));var n=0,a=0;r?(n=Number.parseInt(t.substring(0,t.indexOf(r.character))),a=Number.parseInt(t.substring(t.indexOf(r.character)+1))):t.length-1<=2?n=Number.parseInt(t):(n=Number.parseInt(t.substring(0,3)),a=Number.parseInt(t.substring(3)));return 60*n+a}}else if(e.integerFormat)t=S(e.integerFormat);else{t.regex="[a-zA-Z]+";var n={};if("M"===e.component||"x"===e.component)y.forEach(function(t,r){e.width&&e.width.max?n[t.substring(0,e.width.max)]=r+1:n[t]=r+1});else if("F"===e.component)b.forEach(function(t,r){r>0&&(e.width&&e.width.max?n[t.substring(0,e.width.max)]=r:n[t]=r)});else{if("P"!==e.component)throw{code:"D3133",value:e.component};n={am:0,AM:0,pm:1,PM:1}}t.parse=function(e){return n[e]}}return t.component=e.component,t});else{t.type="integer";var r=e.case===p.UPPER;switch(e.primary){case f.LETTERS:t.regex=r?"[A-Z]+":"[a-z]+",t.parse=function(e){return function(e,t){for(var r=t.charCodeAt(0),n=0,a=0;a<e.length;a++)n+=(e.charCodeAt(e.length-a-1)-r+1)*Math.pow(26,a);return n}(e,r?"A":"a")};break;case f.ROMAN:t.regex=r?"[MDCLXVI]+":"[mdclxvi]+",t.parse=function(e){return function(e){for(var t=0,r=1,n=e.length-1;n>=0;n--){var a=e[n],i=u[a];i<r?t-=i:(r=i,t+=i)}return t}(r?e:e.toUpperCase())};break;case f.WORDS:t.regex="(?:"+Object.keys(o).concat("and","[\\-, ]").join("|")+")+",t.parse=function(e){return t=e.toLowerCase(),r=t.split(/,\s|\sand\s|[\s\\-]/).map(function(e){return o[e]}),n=[0],r.forEach(function(e){if(e<100){var t=n.pop();t>=1e3&&(n.push(t),t=0),n.push(t+e)}else n.push(n.pop()*e)}),n.reduce(function(e,t){return e+t},0);var t,r,n};break;case f.DECIMAL:t.regex="[0-9]",e.parseWidth?t.regex+="{".concat(e.parseWidth,"}"):t.regex+="+",e.ordinal&&(t.regex+="(?:th|st|nd|rd)"),t.parse=function(t){var r=t;return e.ordinal&&(r=t.substring(0,t.length-2)),e.regular?r=r.split(",").join(""):e.groupingSeparators.forEach(function(e){r=r.split(e.character).join("")}),48!==e.zeroCode&&(r=r.split("").map(function(t){return String.fromCodePoint(t.codePointAt(0)-e.zeroCode+48)}).join("")),parseInt(r)};break;case f.SEQUENCE:throw{code:"D3130",value:e.token}}}return t}var T=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");return{formatInteger:c,parseInteger:function(e,t){if(void 0!==e)return S(d(t)).parse(e)},fromMillis:function(e,t,r){if(void 0!==e)return A.call(this,e,t,r)},toMillis:function(e,t){if(void 0!==e){if(void 0===t){if(!T.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}return function(e,t){var r=S(g(t)),n="^"+r.parts.map(function(e){return"("+e.regex+")"}).join("")+"$",a=new RegExp(n,"i").exec(e);if(null!==a){for(var i={},o=1;o<a.length;o++){var s=r.parts[o-1];s.parse&&(i[s.component]=s.parse(a[o]))}if(0===Object.getOwnPropertyNames(i).length)return;var u=0,c=function(e){u<<=1,u+=e?1:0},f=function(e){return!(~e&u||!(e&u))};"YXMxWwdD".split("").forEach(function(e){return c(i[e])});var p=!f(161)&&f(130),l=f(84),h=!l&&f(72);u=0,"PHhmsf".split("").forEach(function(e){return c(i[e])});var d=!f(23)&&f(47),v=(p?"YD":l?"XxwF":h?"XWF":"YMD")+(d?"Phmsf":"Hmsf"),b=this.environment.timestamp,y=!1,m=!1;if(v.split("").forEach(function(e){if(void 0===i[e])y?(i[e]=-1!=="MDd".indexOf(e)?1:0,m=!0):i[e]=x(b,e);else if(y=!0,m)throw{code:"D3136"}}),i.M>0?i.M-=1:i.M=0,p){var k=Date.UTC(i.Y,0),w=1e3*(i.d-1)*60*60*24,E=new Date(k+w);i.M=E.getUTCMonth(),i.D=E.getUTCDate()}if(l)throw{code:"D3136"};if(h)throw{code:"D3136"};d&&(i.H=12===i.h?0:i.h,1===i.P&&(i.H+=12));var A=Date.UTC(i.Y,i.M,i.D,i.H,i.m,i.s,i.f);return(i.Z||i.z)&&(A-=60*(i.Z||i.z)*1e3),A}}.call(this,e,t)}}}}();t.exports=a},{"./utils":6}],2:[function(e,t,r){(function(r){(function(){"use strict";function n(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(r,n,a,o){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,a){var i,o,s,c=0,f=a||[],p=!1,l={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,o=0,s=e,l.n=r,u}};function h(r,n){for(o=r,s=n,t=0;!p&&c&&!a&&t<f.length;t++){var a,i=f[t],h=l.p,d=i[2];r>3?(a=d===n)&&(s=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=r<2&&h<i[1])?(o=0,l.v=n,l.n=i[1]):h<d&&(a=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,l.n=d,o=0))}if(a||r>1)return u;throw p=!0,n}return function(a,f,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,d),o=f,s=d;(t=o<2?e:s)||!p;){i||(o?o<3?(o>1&&(l.n=-1),h(o,s)):l.n=s:l.v=s);try{if(c=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(p=l.n<0)?s:r.call(n,l))!==u)break}catch(t){i=e,o=1,s=t}finally{c=1}}return{value:t,done:p}}}(r,a,o),!0),f}var u={};function c(){}function f(){}function p(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(i(t={},n,function(){return this}),t),h=p.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,i(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=p,i(h,"constructor",p),i(p,"constructor",f),f.displayName="GeneratorFunction",i(p,o,"GeneratorFunction"),i(h),i(h,o,"Generator"),i(h,n,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:d}})()}function i(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}(i=function(e,t,r,n){function o(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,n)}function o(e){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){s(i,n,a,o,u,"next",e)}function u(e){s(i,n,a,o,u,"throw",e)}o(void 0)})}}var c=e("./utils"),f=function(){var e=c.isNumeric,t=c.isArrayOfStrings,i=c.isArrayOfNumbers,s=c.createSequence,f=c.isSequence,p=c.isFunction,l=c.isLambda,h=c.isPromise,d=c.getFunctionArity,v=c.isDeepEqual,g=c.stringToArray;function b(e,t,r){if(void 0!==e){var n=g(e),a=n.length;if(a+t<0&&(t=0),void 0!==r){if(r<=0)return"";var i=t>=0?t+r:a+t+r;return n.slice(t,i).join("")}return n.slice(t).join("")}}function y(e){if(void 0!==e)return g(e).length}function m(e,t){return k.apply(this,arguments)}function k(){return(k=u(a().m(function e(t,r){var n;return a().w(function(e){for(;;)switch(e.n){case 0:if(n=t.apply(this,[r]),!h(n)){e.n=2;break}return e.n=1,n;case 1:n=e.v;case 2:if(!n||"number"==typeof n.start||"number"===n.end||Array.isArray(n.groups)||p(n.next)){e.n=3;break}throw{code:"T1010",stack:(new Error).stack};case 3:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function w(){return(w=u(a().m(function e(t,r){var n,i;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if("string"!=typeof r){e.n=2;break}n=-1!==t.indexOf(r),e.n=4;break;case 2:return e.n=3,m(r,t);case 3:i=e.v,n=void 0!==i;case 4:return e.a(2,n)}},e)}))).apply(this,arguments)}function x(){return(x=u(a().m(function e(t,r,n){var i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!(n<0)){e.n=2;break}throw{stack:(new Error).stack,value:n,code:"D3040",index:3};case 2:if(i=s(),!(void 0===n||n>0)){e.n=6;break}return o=0,e.n=3,m(r,t);case 3:if(void 0===(u=e.v)){e.n=6;break}case 4:if(void 0===u||!(void 0===n||o<n)){e.n=6;break}return i.push({match:u.match,index:u.start,groups:u.groups}),e.n=5,m(u.next);case 5:u=e.v,o++,e.n=4;break;case 6:return e.a(2,i)}},e)}))).apply(this,arguments)}function E(){return(E=u(a().m(function e(t,r,n,i){var o,s,u,c,f,p,l,d;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(o=this,""!==r){e.n=2;break}throw{code:"D3010",stack:(new Error).stack,value:r,index:2};case 2:if(!(i<0)){e.n=3;break}throw{code:"D3011",stack:(new Error).stack,value:i,index:4};case 3:if(s="string"==typeof n?function(e){for(var t="",r=0,a=n.indexOf("$",r);-1!==a&&r<n.length;){t+=n.substring(r,a),r=a+1;var i=n.charAt(r);if("$"===i)t+="$",r++;else if("0"===i)t+=e.match,r++;else{var o;if(o=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,a=parseInt(n.substring(r,r+o),10),o>1&&a>e.groups.length&&(a=parseInt(n.substring(r,r+o-1),10)),isNaN(a))t+="$";else{if(e.groups.length>0){var s=e.groups[a-1];void 0!==s&&(t+=s)}r+=a.toString().length}}a=n.indexOf("$",r)}return t+=n.substring(r)}:n,u="",c=0,!(void 0===i||i>0)){e.n=15;break}if(f=0,"string"!=typeof r){e.n=4;break}for(p=t.indexOf(r,c);-1!==p&&(void 0===i||f<i);)u+=t.substring(c,p),u+=n,c=p+r.length,f++,p=t.indexOf(r,c);u+=t.substring(c),e.n=14;break;case 4:return e.n=5,m(r,t);case 5:if(void 0===(l=e.v)){e.n=13;break}case 6:if(void 0===l||!(void 0===i||f<i)){e.n=12;break}if(u+=t.substring(c,l.start),d=s.apply(o,[l]),!h(d)){e.n=8;break}return e.n=7,d;case 7:d=e.v;case 8:if("string"!=typeof d){e.n=9;break}u+=d,e.n=10;break;case 9:throw{code:"D3012",stack:(new Error).stack,value:d};case 10:return c=l.start+l.match.length,f++,e.n=11,m(l.next);case 11:l=e.v,e.n=6;break;case 12:u+=t.substring(c),e.n=14;break;case 13:u=t;case 14:e.n=16;break;case 15:u=t;case 16:return e.a(2,u)}},e,this)}))).apply(this,arguments)}function A(){return(A=u(a().m(function e(t,r,n){var i,o,s,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!(n<0)){e.n=2;break}throw{code:"D3020",stack:(new Error).stack,value:n,index:3};case 2:if(i=[],!(void 0===n||n>0)){e.n=9;break}if("string"!=typeof r){e.n=3;break}i=t.split(r,n),e.n=9;break;case 3:return o=0,e.n=4,m(r,t);case 4:if(void 0===(s=e.v)){e.n=8;break}u=0;case 5:if(void 0===s||!(void 0===n||o<n)){e.n=7;break}return i.push(t.substring(u,s.start)),u=s.end,e.n=6,m(s.next);case 6:s=e.v,o++,e.n=5;break;case 7:(void 0===n||o<n)&&i.push(t.substring(u)),e.n=9;break;case 8:i.push(t);case 9:return e.a(2,i)}},e)}))).apply(this,arguments)}function S(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var a=(r=Math.round(e))-e;return.5===Math.abs(a)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function T(t){if(void 0!==t){var r=!1;if(Array.isArray(t)){if(1===t.length)r=T(t[0]);else if(t.length>1){r=t.filter(function(e){return T(e)}).length>0}}else"string"==typeof t?t.length>0&&(r=!0):e(t)?0!==t&&(r=!0):null===t||"object"!==o(t)||p(t)?"boolean"==typeof t&&!0===t&&(r=!0):Object.keys(t).length>0&&(r=!0);return r}}function O(e,t,r,n){var a=[t],i=d(e);return i>=2&&a.push(r),i>=3&&a.push(n),a}function D(){return(D=u(a().m(function e(t,r){var n,i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=s(),i=0;case 2:if(!(i<t.length)){e.n=5;break}return o=O(r,t[i],i,t),e.n=3,r.apply(this,o);case 3:void 0!==(u=e.v)&&n.push(u);case 4:i++,e.n=2;break;case 5:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function P(){return(P=u(a().m(function e(t,r){var n,i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=s(),i=0;case 2:if(!(i<t.length)){e.n=5;break}return o=t[i],u=O(r,o,i,t),e.n=3,r.apply(this,u);case 3:T(e.v)&&n.push(o);case 4:i++,e.n=2;break;case 5:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function j(){return(j=u(a().m(function e(t,r){var n,i,o,s,u,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=!1,o=0;case 2:if(!(o<t.length)){e.n=7;break}if(s=t[o],u=!0,void 0===r){e.n=4;break}return c=O(r,s,o,t),e.n=3,r.apply(this,c);case 3:f=e.v,u=T(f);case 4:if(!u){e.n=6;break}if(n){e.n=5;break}i=s,n=!0,e.n=6;break;case 5:throw{stack:(new Error).stack,code:"D3138",index:o};case 6:o++,e.n=2;break;case 7:if(n){e.n=8;break}throw{stack:(new Error).stack,code:"D3139"};case 8:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function M(){return(M=u(a().m(function e(t,r,n){var i,o,s,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!((o=d(r))<2)){e.n=2;break}throw{stack:(new Error).stack,code:"D3050",index:1};case 2:void 0===n&&t.length>0?(i=t[0],s=1):(i=n,s=0);case 3:if(!(s<t.length)){e.n=5;break}return u=[i,t[s]],o>=3&&u.push(s),o>=4&&u.push(t),e.n=4,r.apply(this,u);case 4:i=e.v,s++,e.n=3;break;case 5:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function C(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=s(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function F(){return(F=u(a().m(function e(t,r){var i,o,u,c,f,p;return a().w(function(e){for(;;)switch(e.n){case 0:i=s(),f=n(t);case 1:if((p=f()).done){e.n=3;break}return o=p.value,u=O(r,t[o],o,t),e.n=2,r.apply(this,u);case 2:void 0!==(c=e.v)&&i.push(c),e.n=1;break;case 3:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function U(){return(U=u(a().m(function e(r,n){var o,s,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==r){e.n=1;break}return e.a(2,void 0);case 1:if(!(r.length<=1)){e.n=2;break}return e.a(2,r);case 2:if(void 0!==n){e.n=4;break}if(i(r)||t(r)){e.n=3;break}throw{stack:(new Error).stack,code:"D3070",index:1};case 3:o=function(){var e=u(a().m(function e(t,r){return a().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,t>r)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),e.n=5;break;case 4:o=n;case 5:return s=function(){var e=u(a().m(function e(t,r){var n,i;return a().w(function(e){for(;;)switch(e.n){case 0:return n=function(){var e=u(a().m(function e(t,r,i){return a().w(function(e){for(;;)switch(e.n){case 0:if(0!==r.length){e.n=1;break}Array.prototype.push.apply(t,i),e.n=6;break;case 1:if(0!==i.length){e.n=2;break}Array.prototype.push.apply(t,r),e.n=6;break;case 2:return e.n=3,o(r[0],i[0]);case 3:if(!e.v){e.n=5;break}return t.push(i[0]),e.n=4,n(t,r,i.slice(1));case 4:e.n=6;break;case 5:return t.push(r[0]),e.n=6,n(t,r.slice(1),i);case 6:return e.a(2)}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),i=[],e.n=1,n(i,t,r);case 1:return e.a(2,i)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),c=function(){var e=u(a().m(function e(t){var r,n,i;return a().w(function(e){for(;;)switch(e.n){case 0:if(Array.isArray(t)&&!(t.length<=1)){e.n=1;break}return e.a(2,t);case 1:return r=Math.floor(t.length/2),n=t.slice(0,r),i=t.slice(r),e.n=2,c(n);case 2:return n=e.v,e.n=3,c(i);case 3:return i=e.v,e.n=4,s(n,i);case 4:return e.a(2,e.v);case 5:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),e.n=6,c(r);case 6:return f=e.v,e.a(2,f)}},e)}))).apply(this,arguments)}function N(){return(N=u(a().m(function e(t,r){var i,o,s,u,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:i={},c=n(t);case 1:if((f=c()).done){e.n=3;break}return o=f.value,s=t[o],u=O(r,s,o,t),e.n=2,r.apply(this,u);case 2:T(e.v)&&(i[o]=s),e.n=1;break;case 3:return 0===Object.keys(i).length&&(i=void 0),e.a(2,i)}},e,this)}))).apply(this,arguments)}return{sum:function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},count:function(e){return void 0===e?0:e.length},max:function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},min:function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},average:function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},string:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==t){var n;if("string"==typeof t)n=t;else if(p(t))n="";else{if("number"==typeof t&&!isFinite(t))throw{code:"D3001",value:t,stack:(new Error).stack};var a=r?2:0;Array.isArray(t)&&t.outerWrapper&&(t=t[0]),n=JSON.stringify(t,function(t,r){return null!=r&&r.toPrecision&&e(r)?Number(r.toPrecision(15)):r&&p(r)?"":r},a)}return n}},substring:b,substringBefore:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},substringAfter:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},lowercase:function(e){if(void 0!==e)return e.toLowerCase()},uppercase:function(e){if(void 0!==e)return e.toUpperCase()},length:y,trim:function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},pad:function(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" "),t=Math.trunc(t);var a=Math.abs(t)-y(e);if(a>0){var i=new Array(a+1).join(r);r.length>1&&(i=b(i,0,a)),n=t>0?e+i:i+e}else n=e;return n}},match:function(e,t,r){return x.apply(this,arguments)},contains:function(e,t){return w.apply(this,arguments)},replace:function(e,t,r,n){return E.apply(this,arguments)},split:function(e,t,r){return A.apply(this,arguments)},join:function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},formatNumber:function(e,t,r){if(void 0!==e){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var a=[],i=n["zero-digit"].charCodeAt(0),o=i;o<i+10;o++)a.push(String.fromCharCode(o));var s=a.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,a,i,o=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(o.length,e.length-u.length),f=e.indexOf(n["exponent-separator"],o.length);-1===f||f>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,f),r=c.substring(f+1));var p=t.indexOf(n["decimal-separator"]);return-1===p?(a=t,i=u):(a=t.substring(0,p),i=t.substring(p+1)),{prefix:o,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:a,fractionalPart:i,subpicture:e}});c.forEach(function(e){var t,r,i=e.subpicture,o=i.indexOf(n["decimal-separator"]);o!==i.lastIndexOf(n["decimal-separator"])&&(t="D3081"),i.indexOf(n.percent)!==i.lastIndexOf(n.percent)&&(t="D3082"),i.indexOf(n["per-mille"])!==i.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==i.indexOf(n.percent)&&-1!==i.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==a.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==o?i.charAt(o-1)!==n["grouping-separator"]&&i.charAt(o+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==i.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var f=e.integerPart.indexOf(n.digit);-1!==f&&e.integerPart.substring(0,f).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(f=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(f).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3091");var p="string"==typeof e.exponentPart;if(p&&e.exponentPart.length>0&&(-1!==i.indexOf(n.percent)||-1!==i.indexOf(n["per-mille"]))&&(t="D3092"),p&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===a.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var f,p,l,h,d=c.map(function(e){var t=function(t,r){for(var i=[],o=t.indexOf(n["grouping-separator"]);-1!==o;){var s=(r?t.substring(0,o):t.substring(o)).split("").filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length;i.push(s),o=e.integerPart.indexOf(n["grouping-separator"],o+1)}return i},r=t(e.integerPart),i=function(e){if(0===e.length)return 0;for(var t=function(e,r){return 0===r?e:t(r,e%r)},r=e.reduce(t),n=1;n<=e.length;n++)if(-1===e.indexOf(n*r))return 0;return r}(r),o=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),f=c.filter(function(e){return-1!==a.indexOf(e)}).length,p=c.filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length,l="string"==typeof e.exponentPart;0===s&&0===p&&(l?(f=1,p=1):s=1),l&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===f&&(f=1);var h=0;return l&&(h=e.exponentPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:i,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:o,minimumFactionalPartSize:f,maximumFactionalPartSize:p,minimumExponentSize:h,suffix:e.suffix,picture:e.subpicture}}),v=n["minus-sign"],g=n["zero-digit"],b=n["decimal-separator"],y=n["grouping-separator"];if(1===d.length&&(d.push(JSON.parse(JSON.stringify(d[0]))),d[1].prefix=v+d[1].prefix),p=-1!==(f=e>=0?d[0]:d[1]).picture.indexOf(n.percent)?100*e:-1!==f.picture.indexOf(n["per-mille"])?1e3*e:e,0===f.minimumExponentSize)l=p;else{var m=Math.pow(10,f.scalingFactor),k=Math.pow(10,f.scalingFactor-1);for(l=p,h=0;l<k;)l*=10,h-=1;for(;l>m;)l/=10,h+=1}var w=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==g&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?a[e.charCodeAt(0)-48]:e}).join("")),r},x=w(S(l,f.maximumFactionalPartSize),f.maximumFactionalPartSize),E=x.indexOf(".");for(-1===E?x+=b:x=x.replace(".",b);x.charAt(0)===g;)x=x.substring(1);for(;x.charAt(x.length-1)===g;)x=x.substring(0,x.length-1);E=x.indexOf(b);var A=f.minimumIntegerPartSize-E,T=f.minimumFactionalPartSize-(x.length-E-1);if(x=(A>0?new Array(A+1).join(g):"")+x,x+=T>0?new Array(T+1).join(g):"",E=x.indexOf(b),f.regularGrouping>0)for(var O=Math.floor((E-1)/f.regularGrouping),D=1;D<=O;D++)x=[x.slice(0,E-D*f.regularGrouping),y,x.slice(E-D*f.regularGrouping)].join("");else f.integerPartGroupingPositions.forEach(function(e){x=[x.slice(0,E-e),y,x.slice(E-e)].join(""),E++});if(E=x.indexOf(b),f.fractionalPartGroupingPositions.forEach(function(e){x=[x.slice(0,e+E+1),y,x.slice(e+E+1)].join("")}),E=x.indexOf(b),-1!==f.picture.indexOf(b)&&E!==x.length-1||(x=x.substring(0,x.length-1)),void 0!==h){var P=w(h,0);(A=f.minimumExponentSize-P.length)>0&&(P=new Array(A+1).join(g)+P),x=x+n["exponent-separator"]+(h<0?v:"")+P}return x=f.prefix+x+f.suffix}},formatBase:function(e,t){if(void 0!==e){if(e=S(e),(t=void 0===t?10:S(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},number:function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else if("string"==typeof e&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)&&!isNaN(parseFloat(e))&&isFinite(e))t=parseFloat(e);else if("string"==typeof e&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(e))t=Number(e);else if(!0===e)t=1;else{if(!1!==e)throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=0}return t}},floor:function(e){if(void 0!==e)return Math.floor(e)},ceil:function(e){if(void 0!==e)return Math.ceil(e)},round:S,abs:function(e){if(void 0!==e)return Math.abs(e)},sqrt:function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},power:function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},random:function(){return Math.random()},boolean:T,not:function(e){if(void 0!==e)return!T(e)},map:function(e,t){return D.apply(this,arguments)},zip:function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var a=t.map(function(e){return e[n]});e.push(a)}return e},filter:function(e,t){return P.apply(this,arguments)},single:function(e,t){return j.apply(this,arguments)},foldLeft:function(e,t,r){return M.apply(this,arguments)},sift:function(e,t){return N.apply(this,arguments)},keys:function e(t){var r=s();if(Array.isArray(t)){var n={};t.forEach(function(t){e(t).forEach(function(e){n[e]=!0})}),r=e(n)}else null===t||"object"!==o(t)||p(t)||Object.keys(t).forEach(function(e){return r.push(e)});return r},lookup:function e(t,r){var n;if(Array.isArray(t)){n=s();for(var a=0;a<t.length;a++){var i=e(t[a],r);void 0!==i&&(Array.isArray(i)?i.forEach(function(e){return n.push(e)}):n.push(i))}}else null===t||"object"!==o(t)||p(t)||(n=t[r]);return n},append:C,exists:function(e){return void 0!==e},spread:function e(t){var r=s();if(Array.isArray(t))t.forEach(function(t){r=C(r,e(t))});else if(null===t||"object"!==o(t)||l(t))r=t;else for(var n in t){var a={};a[n]=t[n],r.push(a)}return r},merge:function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},reverse:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},each:function(e,t){return F.apply(this,arguments)},error:function(e){throw{code:"D3137",stack:(new Error).stack,message:e||"$error() function evaluated"}},assert:function(e,t){if(!e)throw{code:"D3141",stack:(new Error).stack,message:t||"$assert() statement failed"}},type:function(t){if(void 0!==t)return null===t?"null":e(t)?"number":"string"==typeof t?"string":"boolean"==typeof t?"boolean":Array.isArray(t)?"array":p(t)?"function":"object"},sort:function(e,t){return U.apply(this,arguments)},shuffle:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},distinct:function(e){if(void 0!==e){if(!Array.isArray(e)||e.length<=1)return e;for(var t=f(e)?s():[],r=0;r<e.length;r++){for(var n=e[r],a=!1,i=0;i<t.length;i++)if(v(n,t[i])){a=!0;break}a||t.push(n)}return t}},base64encode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new r.Buffer.from(e,"binary").toString("base64")})(e)},base64decode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new r.Buffer.from(e,"base64").toString("binary")})(e)},encodeUrlComponent:function(e){if(void 0!==e){var t;try{t=encodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrlComponent"}}return t}},encodeUrl:function(e){if(void 0!==e){var t;try{t=encodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrl"}}return t}},decodeUrlComponent:function(e){if(void 0!==e){var t;try{t=decodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrlComponent"}}return t}},decodeUrl:function(e){if(void 0!==e){var t;try{t=decodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrl"}}return t}}}}();t.exports=f}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(e,t,r){"use strict";function n(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(f(e)+" is not iterable")}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function i(r,n,a,i){var u=n&&n.prototype instanceof s?n:s,f=Object.create(u.prototype);return c(f,"_invoke",function(r,n,a){var i,s,u,c=0,f=a||[],p=!1,l={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,s=0,u=e,l.n=r,o}};function h(r,n){for(s=r,u=n,t=0;!p&&c&&!a&&t<f.length;t++){var a,i=f[t],h=l.p,d=i[2];r>3?(a=d===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=r<2&&h<i[1])?(s=0,l.v=n,l.n=i[1]):h<d&&(a=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,l.n=d,s=0))}if(a||r>1)return o;throw p=!0,n}return function(a,f,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!p;){i||(s?s<3?(s>1&&(l.n=-1),h(s,u)):l.n=u:l.v=u);try{if(c=2,i){if(s||(a="next"),t=i[a]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);i=e}else if((t=(p=l.n<0)?u:r.call(n,l))!==o)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:p}}}(r,a,i),!0),f}var o={};function s(){}function f(){}function p(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),h=p.prototype=s.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=p,c(h,"constructor",p),c(p,"constructor",f),f.displayName="GeneratorFunction",c(p,a,"GeneratorFunction"),c(h),c(h,a,"Generator"),c(h,n,function(){return this}),c(h,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:d}})()}function c(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}(c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function f(e){"@babel/helpers - typeof";return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){p(i,n,a,o,s,"next",e)}function s(e){p(i,n,a,o,s,"throw",e)}o(void 0)})}}var h=e("./datetime"),d=e("./functions"),v=e("./utils"),g=e("./parser"),b=e("./signature"),y=function(){var e=v.isNumeric,t=v.isArrayOfStrings,r=v.isArrayOfNumbers,o=v.createSequence,s=v.isSequence,c=v.isFunction,p=v.isLambda,y=v.isIterable,m=v.isPromise,k=v.getFunctionArity,w=v.isDeepEqual,x=Ne(null);function E(e,t,r){return A.apply(this,arguments)}function A(){return(A=l(u().m(function e(t,r,n){var a,i,o,c,f;return u().w(function(e){for(;;)switch(e.n){case 0:if(!(i=n.lookup(Symbol.for("jsonata.__evaluate_entry")))){e.n=1;break}return e.n=1,i(t,r,n);case 1:f=t.type,e.n="path"===f?2:"binary"===f?4:"unary"===f?6:"name"===f?8:"string"===f?9:"number"===f?9:"value"===f?9:"wildcard"===f?10:"descendant"===f?11:"parent"===f?12:"condition"===f?13:"block"===f?15:"bind"===f?17:"regex"===f?19:"function"===f?20:"variable"===f?22:"lambda"===f?23:"partial"===f?24:"apply"===f?26:"transform"===f?28:29;break;case 2:return e.n=3,S(t,r,n);case 3:return a=e.v,e.a(3,29);case 4:return e.n=5,I(t,r,n);case 5:return a=e.v,e.a(3,29);case 6:return e.n=7,_(t,r,n);case 7:return a=e.v,e.a(3,29);case 8:return a=z(t,r,n),e.a(3,29);case 9:return a=$(t),e.a(3,29);case 10:return a=G(t,r),e.a(3,29);case 11:return a=q(t,r),e.a(3,29);case 12:return a=n.lookup(t.slot.label),e.a(3,29);case 13:return e.n=14,ae(t,r,n);case 14:return a=e.v,e.a(3,29);case 15:return e.n=16,oe(t,r,n);case 16:return a=e.v,e.a(3,29);case 17:return e.n=18,re(t,r,n);case 18:return a=e.v,e.a(3,29);case 19:return a=ue(t),e.a(3,29);case 20:return e.n=21,ge(t,r,n);case 21:return a=e.v,e.a(3,29);case 22:return a=ce(t,r,n),e.a(3,29);case 23:return a=xe(t,r,n),e.a(3,29);case 24:return e.n=25,Ee(t,r,n);case 25:return a=e.v,e.a(3,29);case 26:return e.n=27,de(t,r,n);case 27:return a=e.v,e.a(3,29);case 28:return a=le(t,r,n),e.a(3,29);case 29:if(!Object.prototype.hasOwnProperty.call(t,"predicate")){e.n=33;break}o=0;case 30:if(!(o<t.predicate.length)){e.n=33;break}return e.n=31,U(t.predicate[o].expr,a,n);case 31:a=e.v;case 32:o++,e.n=30;break;case 33:if("path"===t.type||!Object.prototype.hasOwnProperty.call(t,"group")){e.n=35;break}return e.n=34,V(t.group,a,n);case 34:a=e.v;case 35:if(!(c=n.lookup(Symbol.for("jsonata.__evaluate_exit")))){e.n=36;break}return e.n=36,c(t,r,n,a);case 36:return a&&s(a)&&!a.tupleStream&&(t.keepArray&&(a.keepSingleton=!0),0===a.length?a=void 0:1===a.length&&(a=a.keepSingleton?a:a[0])),e.a(2,a)}},e)}))).apply(this,arguments)}function S(e,t,r){return T.apply(this,arguments)}function T(){return(T=l(u().m(function e(t,r,n){var a,i,s,c,f,p;return u().w(function(e){for(;;)switch(e.n){case 0:a=Array.isArray(r)&&"variable"!==t.steps[0].type?r:o(r),s=!1,c=void 0,f=0;case 1:if(!(f<t.steps.length)){e.n=10;break}if((p=t.steps[f]).tuple&&(s=!0),0!==f||!p.consarray){e.n=3;break}return e.n=2,E(p,a,n);case 2:i=e.v,e.n=7;break;case 3:if(!s){e.n=5;break}return e.n=4,C(p,a,c,n);case 4:c=e.v,e.n=7;break;case 5:return e.n=6,D(p,a,n,f===t.steps.length-1);case 6:i=e.v;case 7:if(s||void 0!==i&&0!==i.length){e.n=8;break}return e.a(3,10);case 8:void 0===p.focus&&(a=i);case 9:f++,e.n=1;break;case 10:if(s)if(t.tuple)i=c;else for(i=o(),f=0;f<c.length;f++)i.push(c[f]["@"]);if(t.keepSingletonArray&&(Array.isArray(i)&&i.cons&&!i.sequence&&(i=o(i)),i.keepSingleton=!0),!t.hasOwnProperty("group")){e.n=12;break}return e.n=11,V(t.group,s?c:i,n);case 11:i=e.v;case 12:return e.a(2,i)}},e)}))).apply(this,arguments)}function O(e,t){var r=Ne(e);for(var n in t)r.bind(n,t[n]);return r}function D(e,t,r,n){return P.apply(this,arguments)}function P(){return(P=l(u().m(function e(t,r,n,a){var i,c,f,p,l;return u().w(function(e){for(;;)switch(e.n){case 0:if("sort"!==t.type){e.n=4;break}return e.n=1,fe(t,r,n);case 1:if(i=e.v,!t.stages){e.n=3;break}return e.n=2,j(t.stages,i,n);case 2:i=e.v;case 3:return e.a(2,i);case 4:i=o(),c=0;case 5:if(!(c<r.length)){e.n=12;break}return e.n=6,E(t,r[c],n);case 6:if(f=e.v,!t.stages){e.n=10;break}p=0;case 7:if(!(p<t.stages.length)){e.n=10;break}return e.n=8,U(t.stages[p].expr,f,n);case 8:f=e.v;case 9:p++,e.n=7;break;case 10:void 0!==f&&i.push(f);case 11:c++,e.n=5;break;case 12:return l=o(),a&&1===i.length&&Array.isArray(i[0])&&!s(i[0])?l=i[0]:i.forEach(function(e){!Array.isArray(e)||e.cons?l.push(e):e.forEach(function(e){return l.push(e)})}),e.a(2,l)}},e)}))).apply(this,arguments)}function j(e,t,r){return M.apply(this,arguments)}function M(){return(M=l(u().m(function e(t,r,n){var a,i,o,s,c;return u().w(function(e){for(;;)switch(e.n){case 0:a=r,i=0;case 1:if(!(i<t.length)){e.n=6;break}o=t[i],c=o.type,e.n="filter"===c?2:"index"===c?4:5;break;case 2:return e.n=3,U(o.expr,a,n);case 3:return a=e.v,e.a(3,5);case 4:for(s=0;s<a.length;s++)a[s][o.value]=s;return e.a(3,5);case 5:i++,e.n=1;break;case 6:return e.a(2,a)}},e)}))).apply(this,arguments)}function C(e,t,r,n){return F.apply(this,arguments)}function F(){return(F=l(u().m(function e(t,r,n,a){var i,s,c,f,p,l,h,d;return u().w(function(e){for(;;)switch(e.n){case 0:if("sort"!==t.type){e.n=7;break}if(!n){e.n=2;break}return e.n=1,fe(t,n,a);case 1:i=e.v,e.n=4;break;case 2:return e.n=3,fe(t,r,a);case 3:for(s=e.v,(i=o()).tupleStream=!0,c=0;c<s.length;c++)(f={"@":s[c]})[t.index]=c,i.push(f);case 4:if(!t.stages){e.n=6;break}return e.n=5,j(t.stages,i,a);case 5:i=e.v;case 6:return e.a(2,i);case 7:(i=o()).tupleStream=!0,p=a,void 0===n&&(n=r.map(function(e){return{"@":e}})),l=0;case 8:if(!(l<n.length)){e.n=11;break}return p=O(a,n[l]),e.n=9,E(t,n[l]["@"],p);case 9:if(void 0!==(h=e.v))for(Array.isArray(h)||(h=[h]),d=0;d<h.length;d++)f={},Object.assign(f,n[l]),h.tupleStream?Object.assign(f,h[d]):(t.focus?(f[t.focus]=h[d],f["@"]=n[l]["@"]):f["@"]=h[d],t.index&&(f[t.index]=d),t.ancestor&&(f[t.ancestor.label]=n[l]["@"])),i.push(f);case 10:l++,e.n=8;break;case 11:if(!t.stages){e.n=13;break}return e.n=12,j(t.stages,i,a);case 12:i=e.v;case 13:return e.a(2,i)}},e)}))).apply(this,arguments)}function U(e,t,r){return N.apply(this,arguments)}function N(){return(N=l(u().m(function t(n,a,i){var s,c,f,p,l,h;return u().w(function(t){for(;;)switch(t.n){case 0:if(s=o(),a&&a.tupleStream&&(s.tupleStream=!0),Array.isArray(a)||(a=o(a)),"number"!==n.type){t.n=2;break}return(c=Math.floor(n.value))<0&&(c=a.length+c),t.n=1,a[c];case 1:void 0!==(f=t.v)&&(Array.isArray(f)?s=f:s.push(f)),t.n=6;break;case 2:c=0;case 3:if(!(c<a.length)){t.n=6;break}return f=a[c],p=f,l=i,a.tupleStream&&(p=f["@"],l=O(i,f)),t.n=4,E(n,p,l);case 4:h=t.v,e(h)&&(h=[h]),r(h)?h.forEach(function(e){var t=Math.floor(e);t<0&&(t=a.length+t),t===c&&s.push(f)}):d.boolean(h)&&s.push(f);case 5:c++,t.n=3;break;case 6:return t.a(2,s)}},t)}))).apply(this,arguments)}function I(e,t,r){return L.apply(this,arguments)}function L(){return(L=l(u().m(function e(t,r,n){var a,i,o,s,c,f,p,h;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,E(t.lhs,r,n);case 1:if(i=e.v,o=t.value,s=function(){var e=l(u().m(function e(){return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t.rhs,r,n);case 1:return e.a(2,e.v)}},e)}));return function(){return e.apply(this,arguments)}}(),"and"!==o&&"or"!==o){e.n=5;break}return e.p=2,e.n=3,B(i,s,o);case 3:return e.a(2,e.v);case 4:throw e.p=4,(f=e.v).position=t.position,f.token=o,f;case 5:return e.n=6,s();case 6:c=e.v,e.p=7,p=o,e.n="+"===p?8:"-"===p?8:"*"===p?8:"/"===p?8:"%"===p?8:"="===p?9:"!="===p?9:"<"===p?10:"<="===p?10:">"===p?10:">="===p?10:"&"===p?11:".."===p?12:"in"===p?13:14;break;case 8:return a=W(i,c,o),e.a(3,14);case 9:return a=Y(i,c,o),e.a(3,14);case 10:return a=H(i,c,o),e.a(3,14);case 11:return a=Q(i,c),e.a(3,14);case 12:return a=te(i,c),e.a(3,14);case 13:return a=Z(i,c),e.a(3,14);case 14:e.n=16;break;case 15:throw e.p=15,(h=e.v).position=t.position,h.token=o,h;case 16:return e.a(2,a)}},e,null,[[7,15],[2,4]])}))).apply(this,arguments)}function _(e,t,r){return R.apply(this,arguments)}function R(){return(R=l(u().m(function t(r,n,o){var s,c,f,p,h,v,g,b,y;return u().w(function(t){for(;;)switch(t.n){case 0:y=r.value,t.n="-"===y?1:"["===y?6:"{"===y?8:10;break;case 1:return t.n=2,E(r.expression,n,o);case 2:if(void 0!==(s=t.v)){t.n=3;break}s=void 0,t.n=5;break;case 3:if(!e(s)){t.n=4;break}s=-s,t.n=5;break;case 4:throw{code:"D1002",stack:(new Error).stack,position:r.position,token:r.value,value:s};case 5:return t.a(3,10);case 6:return s=[],t.n=7,Promise.all(r.expressions.map(function(){var e=l(u().m(function e(t,r){var a,i;return u().w(function(e){for(;;)switch(e.n){case 0:return o.isParallelCall=r>0,a=t,e.n=1,E(t,n,o);case 1:return i=e.v,e.a(2,[a,i])}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 7:c=t.v,f=i(c);try{for(f.s();!(p=f.n()).done;)h=p.value,v=a(h,2),g=v[0],void 0!==(b=v[1])&&("["===g.value?s.push(b):s=d.append(s,b))}catch(e){f.e(e)}finally{f.f()}return r.consarray&&Object.defineProperty(s,"cons",{enumerable:!1,configurable:!1,value:!0}),t.a(3,10);case 8:return t.n=9,V(r,n,o);case 9:return s=t.v,t.a(3,10);case 10:return t.a(2,s)}},t)}))).apply(this,arguments)}function z(e,t,r){return d.lookup(t,e.value)}function $(e){return e.value}function G(e,t){var r=o();return Array.isArray(t)&&t.outerWrapper&&t.length>0&&(t=t[0]),null!==t&&"object"===f(t)&&Object.keys(t).forEach(function(e){var n=t[e];Array.isArray(n)?(n=function e(t,r){void 0===r&&(r=[]);Array.isArray(t)?t.forEach(function(t){e(t,r)}):r.push(t);return r}(n),r=d.append(r,n)):r.push(n)}),r}function q(e,t){var r,n=o();return void 0!==t&&(!function e(t,r){Array.isArray(t)||r.push(t);Array.isArray(t)?t.forEach(function(t){e(t,r)}):null!==t&&"object"===f(t)&&Object.keys(t).forEach(function(n){e(t[n],r)})}(t,n),r=1===n.length?n[0]:n),r}function W(t,r,n){var a;if(void 0!==t&&!e(t))throw{code:"T2001",stack:(new Error).stack,value:t};if(void 0!==r&&!e(r))throw{code:"T2002",stack:(new Error).stack,value:r};if(void 0===t||void 0===r)return a;switch(n){case"+":a=t+r;break;case"-":a=t-r;break;case"*":a=t*r;break;case"/":a=t/r;break;case"%":a=t%r}return a}function Y(e,t,r){var n,a=f(e),i=f(t);if("undefined"===a||"undefined"===i)return!1;switch(r){case"=":n=w(e,t);break;case"!=":n=!w(e,t)}return n}function H(e,t,r){var n,a=f(e),i=f(t);if(!("undefined"===a||"string"===a||"number"===a)||!("undefined"===i||"string"===i||"number"===i))throw{code:"T2010",stack:(new Error).stack,value:"string"!==a&&"number"!==a?e:t};if("undefined"!==a&&"undefined"!==i){if(a!==i)throw{code:"T2009",stack:(new Error).stack,value:e,value2:t};switch(r){case"<":n=e<t;break;case"<=":n=e<=t;break;case">":n=e>t;break;case">=":n=e>=t}return n}}function Z(e,t){var r=!1;if(void 0===e||void 0===t)return!1;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}function B(e,t,r){return J.apply(this,arguments)}function J(){return(J=l(u().m(function e(t,r,n){var a,i,o,s,c,f,p,l,h;return u().w(function(e){for(;;)switch(e.n){case 0:i=X(t),o=n,e.n="and"===o?1:"or"===o?4:7;break;case 1:if(!(s=i)){e.n=3;break}return c=X,e.n=2,r();case 2:f=e.v,s=c(f);case 3:return a=s,e.a(3,7);case 4:if(p=i){e.n=6;break}return l=X,e.n=5,r();case 5:h=e.v,p=l(h);case 6:return a=p,e.a(3,7);case 7:return e.a(2,a)}},e)}))).apply(this,arguments)}function X(e){var t=d.boolean(e);return void 0!==t&&t}function Q(e,t){var r="",n="";return void 0!==e&&(r=d.string(e)),void 0!==t&&(n=d.string(t)),r.concat(n)}function V(e,t,r){return K.apply(this,arguments)}function K(){return(K=l(u().m(function e(t,r,n){var s,c,f,p,h,v,g,b,y,m,k,w,x,A,S,T,D,P;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:s={},c={},f=!(!r||!r.tupleStream),Array.isArray(r)||(r=o(r)),0===r.length&&r.push(void 0),p=0;case 1:if(!(p<r.length)){e.n=9;break}h=r[p],v=f?O(n,h):n,g=0;case 2:if(!(g<t.lhs.length)){e.n=8;break}return b=t.lhs[g],e.n=3,E(b[0],f?h["@"]:h,v);case 3:if("string"==typeof(y=e.v)||void 0===y){e.n=4;break}throw{code:"T1003",stack:(new Error).stack,position:t.position,value:y};case 4:if(void 0===y){e.n=7;break}if(m={data:h,exprIndex:g},!c.hasOwnProperty(y)){e.n=6;break}if(c[y].exprIndex===g){e.n=5;break}throw{code:"D1009",stack:(new Error).stack,position:t.position,value:y};case 5:c[y].data=d.append(c[y].data,h),e.n=7;break;case 6:c[y]=m;case 7:g++,e.n=2;break;case 8:p++,e.n=1;break;case 9:return e.n=10,Promise.all(Object.keys(c).map(function(){var e=l(u().m(function e(r,a){var i,o,s,p,l,h;return u().w(function(e){for(;;)switch(e.n){case 0:return i=c[r],o=i.data,s=n,f&&(p=ee(i.data),o=p["@"],delete p["@"],s=O(n,p)),n.isParallelCall=a>0,l=r,e.n=1,E(t.lhs[i.exprIndex][1],o,s);case 1:return h=e.v,e.a(2,[l,h])}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 10:k=e.v,w=i(k),e.p=11,w.s();case 12:if((x=w.n()).done){e.n=15;break}return A=x.value,e.n=13,A;case 13:S=e.v,T=a(S,2),y=T[0],void 0!==(D=T[1])&&(s[y]=D);case 14:e.n=12;break;case 15:e.n=17;break;case 16:e.p=16,P=e.v,w.e(P);case 17:return e.p=17,w.f(),e.f(17);case 18:return e.a(2,s)}},e,null,[[11,16,17,18]])}))).apply(this,arguments)}function ee(e){if(!Array.isArray(e))return e;var t={};Object.assign(t,e[0]);for(var r=1;r<e.length;r++)for(var n in e[r])t[n]=d.append(t[n],e[r][n]);return t}function te(e,t){var r;if(void 0!==e&&!Number.isInteger(e))throw{code:"T2003",stack:(new Error).stack,value:e};if(void 0!==t&&!Number.isInteger(t))throw{code:"T2004",stack:(new Error).stack,value:t};if(void 0===e||void 0===t)return r;if(e>t)return r;var n=t-e+1;if(n>1e7)throw{code:"D2014",stack:(new Error).stack,value:n};r=new Array(n);for(var a=e,i=0;a<=t;a++,i++)r[i]=a;return r.sequence=!0,r}function re(e,t,r){return ne.apply(this,arguments)}function ne(){return(ne=l(u().m(function e(t,r,n){var a;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t.rhs,r,n);case 1:return a=e.v,n.bind(t.lhs.value,a),e.a(2,a)}},e)}))).apply(this,arguments)}function ae(e,t,r){return ie.apply(this,arguments)}function ie(){return(ie=l(u().m(function e(t,r,n){var a,i;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t.condition,r,n);case 1:if(i=e.v,!d.boolean(i)){e.n=3;break}return e.n=2,E(t.then,r,n);case 2:a=e.v,e.n=5;break;case 3:if(void 0===t.else){e.n=5;break}return e.n=4,E(t.else,r,n);case 4:a=e.v;case 5:return e.a(2,a)}},e)}))).apply(this,arguments)}function oe(e,t,r){return se.apply(this,arguments)}function se(){return(se=l(u().m(function e(t,r,n){var a,i,o;return u().w(function(e){for(;;)switch(e.n){case 0:i=Ne(n),o=0;case 1:if(!(o<t.expressions.length)){e.n=4;break}return e.n=2,E(t.expressions[o],r,i);case 2:a=e.v;case 3:o++,e.n=1;break;case 4:return e.a(2,a)}},e)}))).apply(this,arguments)}function ue(e){var t=new _e.RegexEngine(e.value),r=function(n,a){var i;t.lastIndex=a||0;var o=t.exec(n);if(null!==o){if(i={match:o[0],start:o.index,end:o.index+o[0].length,groups:[]},o.length>1)for(var s=1;s<o.length;s++)i.groups.push(o[s]);i.next=function(){if(!(t.lastIndex>=n.length)){var a=r(n,t.lastIndex);if(a&&""===a.match)throw{code:"D1004",stack:(new Error).stack,position:e.position,value:e.value.source};return a}}}return i};return r}function ce(e,t,r){return""===e.value?t&&t.outerWrapper?t[0]:t:r.lookup(e.value)}function fe(e,t,r){return pe.apply(this,arguments)}function pe(){return(pe=l(u().m(function e(t,r,n){var a,i,o,s,c;return u().w(function(e){for(;;)switch(e.n){case 0:return i=r,o=!!r.tupleStream,s=function(){var e=l(u().m(function e(r,a){var i,s,c,p,l,h,d,v,g;return u().w(function(e){for(;;)switch(e.n){case 0:i=0,s=0;case 1:if(!(0===i&&s<t.terms.length)){e.n=11;break}return c=t.terms[s],p=r,l=n,o&&(p=r["@"],l=O(n,r)),e.n=2,E(c.expression,p,l);case 2:return h=e.v,p=a,l=n,o&&(p=a["@"],l=O(n,a)),e.n=3,E(c.expression,p,l);case 3:if(d=e.v,v=f(h),g=f(d),"undefined"!==v){e.n=4;break}return i="undefined"===g?0:1,e.a(3,10);case 4:if("undefined"!==g){e.n=5;break}return i=-1,e.a(3,10);case 5:if(!("string"!==v&&"number"!==v||"string"!==g&&"number"!==g)){e.n=6;break}throw{code:"T2008",stack:(new Error).stack,position:t.position,value:"string"!==v&&"number"!==v?h:d};case 6:if(v===g){e.n=7;break}throw{code:"T2007",stack:(new Error).stack,position:t.position,value:h,value2:d};case 7:if(h!==d){e.n=8;break}return e.a(3,10);case 8:i=h<d?-1:1;case 9:!0===c.descending&&(i=-i);case 10:s++,e.n=1;break;case 11:return e.a(2,1===i)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),c={environment:n,input:r},e.n=1,d.sort.apply(c,[i,s]);case 1:return a=e.v,e.a(2,a)}},e)}))).apply(this,arguments)}function le(e,r,n){return Fe(function(){var r=l(u().m(function r(a){var i,o,s,p,l,h,d,v,g,b,y;return u().w(function(r){for(;;)switch(r.n){case 0:if(void 0!==a){r.n=1;break}return r.a(2,void 0);case 1:if(i=n.lookup("clone"),c(i)){r.n=2;break}throw{code:"T2013",stack:(new Error).stack,position:e.position};case 2:return r.n=3,ye(i,[a],null,n);case 3:return o=r.v,r.n=4,E(e.pattern,o,n);case 4:if(void 0===(s=r.v)){r.n=13;break}Array.isArray(s)||(s=[s]),p=0;case 5:if(!(p<s.length)){r.n=13;break}if(!(l=s[p])||!(l.isPrototypeOf(o)||l instanceof Object.constructor)){r.n=6;break}throw{code:"D1010",stack:(new Error).stack,position:e.position};case 6:return r.n=7,E(e.update,l,n);case 7:if(h=r.v,"undefined"===(d=f(h))){r.n=9;break}if("object"===d&&null!==h&&!Array.isArray(h)){r.n=8;break}throw{code:"T2011",stack:(new Error).stack,position:e.update.position,value:h};case 8:for(v in h)l[v]=h[v];case 9:if(void 0===e.delete){r.n=12;break}return r.n=10,E(e.delete,l,n);case 10:if(void 0===(g=r.v)){r.n=12;break}if(b=g,Array.isArray(g)||(g=[g]),t(g)){r.n=11;break}throw{code:"T2012",stack:(new Error).stack,position:e.delete.position,value:b};case 11:for(y=0;y<g.length;y++)"object"===f(l)&&null!==l&&delete l[g[y]];case 12:p++,r.n=5;break;case 13:return r.a(2,o)}},r)}));return function(e){return r.apply(this,arguments)}}(),"<(oa):o>")}var he=g("function($f, $g) { function($x){ $g($f($x)) } }");function de(e,t,r){return ve.apply(this,arguments)}function ve(){return(ve=l(u().m(function e(t,r,n){var a,i,o,s;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t.lhs,r,n);case 1:if(i=e.v,"function"!==t.rhs.type){e.n=3;break}return e.n=2,ge(t.rhs,r,n,{context:i});case 2:a=e.v,e.n=10;break;case 3:return e.n=4,E(t.rhs,r,n);case 4:if(o=e.v,c(o)){e.n=5;break}throw{code:"T2006",stack:(new Error).stack,position:t.position,value:o};case 5:if(!c(i)){e.n=8;break}return e.n=6,E(he,null,n);case 6:return s=e.v,e.n=7,ye(s,[i,o],null,n);case 7:a=e.v,e.n=10;break;case 8:return e.n=9,ye(o,[i],null,n);case 9:a=e.v;case 10:return e.a(2,a)}},e)}))).apply(this,arguments)}function ge(e,t,r,n){return be.apply(this,arguments)}function be(){return(be=l(u().m(function e(t,r,a,i){var o,s,p,h,d,v,g;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,E(t.procedure,r,a);case 1:if(void 0!==(s=e.v)||"path"!==t.procedure.type||!a.lookup(t.procedure.steps[0].value)){e.n=2;break}throw{code:"T1005",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 2:p=[],void 0!==i&&p.push(i.context),h=u().m(function e(){var n,i;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t.arguments[d],r,a);case 1:n=e.v,c(n)?((i=function(){var e=l(u().m(function e(){var t,r,i,o=arguments;return u().w(function(e){for(;;)switch(e.n){case 0:for(t=o.length,r=new Array(t),i=0;i<t;i++)r[i]=o[i];return e.n=1,ye(n,r,null,a);case 1:return e.a(2,e.v)}},e)}));return function(){return e.apply(this,arguments)}}()).arity=k(n),p.push(i)):p.push(n);case 2:return e.a(2)}},e)}),d=0;case 3:if(!(d<t.arguments.length)){e.n=5;break}return e.d(n(h()),4);case 4:d++,e.n=3;break;case 5:return v="path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value,e.p=6,"object"===f(s)&&(s.token=v,s.position=t.position),e.n=7,ye(s,p,r,a);case 7:o=e.v,e.n=9;break;case 8:throw e.p=8,(g=e.v).position||(g.position=t.position),g.token||(g.token=v),g;case 9:return e.a(2,o)}},e,null,[[6,8]])}))).apply(this,arguments)}function ye(e,t,r,n){return me.apply(this,arguments)}function me(){return(me=l(u().m(function e(t,r,n,a){var i,o,s,c,f,l;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ke(t,r,n,a);case 1:i=e.v;case 2:if(!p(i)||!0!==i.thunk){e.n=9;break}return e.n=3,E(i.body.procedure,i.input,i.environment);case 3:o=e.v,"variable"===i.body.procedure.type&&(o.token=i.body.procedure.value),o.position=i.body.procedure.position,s=[],c=0;case 4:if(!(c<i.body.arguments.length)){e.n=7;break}return f=s,e.n=5,E(i.body.arguments[c],i.input,i.environment);case 5:l=e.v,f.push.call(f,l);case 6:c++,e.n=4;break;case 7:return e.n=8,ke(o,s,n,a);case 8:i=e.v,e.n=2;break;case 9:return e.a(2,i)}},e)}))).apply(this,arguments)}function ke(e,t,r,n){return we.apply(this,arguments)}function we(){return(we=l(u().m(function e(t,r,n,a){var i,o,s,c;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=r,t&&(o=Se(t.signature,r,n)),!p(t)){e.n=2;break}return e.n=1,Te(t,o);case 1:i=e.v,e.n=9;break;case 2:if(!t||!0!==t._jsonata_function){e.n=5;break}if(s={environment:a,input:n},i=t.implementation.apply(s,o),y(i)&&(i=i.next().value),!m(i)){e.n=4;break}return e.n=3,i;case 3:i=e.v;case 4:e.n=9;break;case 5:if("function"!=typeof t){e.n=8;break}if(i=t.apply(n,o),!m(i)){e.n=7;break}return e.n=6,i;case 6:i=e.v;case 7:e.n=9;break;case 8:throw{code:"T1006",stack:(new Error).stack};case 9:e.n=11;break;case 10:throw e.p=10,c=e.v,t&&(void 0===c.token&&void 0!==t.token&&(c.token=t.token),c.position=t.position||c.position),c;case 11:return e.a(2,i)}},e,null,[[0,10]])}))).apply(this,arguments)}function xe(e,t,r){var n={_jsonata_lambda:!0,input:t,environment:r,arguments:e.arguments,signature:e.signature,body:e.body};return!0===e.thunk&&(n.thunk=!0),n.apply=function(){var e=l(u().m(function e(a,i){return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ye(n,i,t,a?a.environment:r);case 1:return e.a(2,e.v)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),n}function Ee(e,t,r){return Ae.apply(this,arguments)}function Ae(){return(Ae=l(u().m(function e(t,r,n){var a,i,o,s,c,f,l;return u().w(function(e){for(;;)switch(e.n){case 0:i=[],o=0;case 1:if(!(o<t.arguments.length)){e.n=5;break}if("operator"!==(s=t.arguments[o]).type||"?"!==s.value){e.n=2;break}i.push(s),e.n=4;break;case 2:return f=i,e.n=3,E(s,r,n);case 3:l=e.v,f.push.call(f,l);case 4:o++,e.n=1;break;case 5:return e.n=6,E(t.procedure,r,n);case 6:if(void 0!==(c=e.v)||"path"!==t.procedure.type||!n.lookup(t.procedure.steps[0].value)){e.n=7;break}throw{code:"T1007",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 7:if(!p(c)){e.n=8;break}a=De(c,i),e.n=11;break;case 8:if(!c||!0!==c._jsonata_function){e.n=9;break}a=Pe(c.implementation,i),e.n=11;break;case 9:if("function"!=typeof c){e.n=10;break}a=Pe(c,i),e.n=11;break;case 10:throw{code:"T1008",stack:(new Error).stack,position:t.position,token:"path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value};case 11:return e.a(2,a)}},e)}))).apply(this,arguments)}function Se(e,t,r){return void 0===e?t:e.validate(t,r)}function Te(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=l(u().m(function e(t,r){var n,a;return u().w(function(e){for(;;)switch(e.n){case 0:if(a=Ne(t.environment),t.arguments.forEach(function(e,t){a.bind(e.value,r[t])}),"function"!=typeof t.body){e.n=2;break}return e.n=1,je(t.body,a);case 1:n=e.v,e.n=4;break;case 2:return e.n=3,E(t.body,t.input,a);case 3:n=e.v;case 4:return e.a(2,n)}},e)}))).apply(this,arguments)}function De(e,t){var r=Ne(e.environment),n=[];return e.arguments.forEach(function(e,a){var i=t[a];i&&"operator"===i.type&&"?"===i.value?n.push(e):r.bind(e.value,i)}),{_jsonata_lambda:!0,input:e.input,environment:r,arguments:n,body:e.body}}function Pe(e,t){var r=Ce(e),n="function("+(r=r.map(function(e){return"$"+e.trim()})).join(", ")+"){ _ }",a=g(n);return a.body=e,De(a,t)}function je(e,t){return Me.apply(this,arguments)}function Me(){return(Me=l(u().m(function e(t,r){var n,a,i,o;return u().w(function(e){for(;;)switch(e.n){case 0:if(n=Ce(t),a=n.map(function(e){return r.lookup(e.trim())}),i={environment:r},o=t.apply(i,a),!m(o)){e.n=2;break}return e.n=1,o;case 1:o=e.v;case 2:return e.a(2,o)}},e)}))).apply(this,arguments)}function Ce(e){var t=e.toString();return/\(([^)]*)\)/.exec(t)[1].split(",")}function Fe(e,t){var r={_jsonata_function:!0,implementation:e};return void 0!==t&&(r.signature=b(t)),r}function Ue(){return(Ue=l(u().m(function e(t,r){var n,a,i,c,f;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=this.input,void 0!==r&&(n=r,Array.isArray(n)&&!s(n)&&((n=o(n)).outerWrapper=!0)),e.p=2,a=g(t,!1),e.n=4;break;case 3:throw e.p=3,Le(c=e.v),{stack:(new Error).stack,code:"D3120",value:c.message,error:c};case 4:return e.p=4,e.n=5,E(a,n,this.environment);case 5:i=e.v,e.n=7;break;case 6:throw e.p=6,Le(f=e.v),{stack:(new Error).stack,code:"D3121",value:f.message,error:f};case 7:return e.a(2,i)}},e,this,[[4,6],[2,3]])}))).apply(this,arguments)}function Ne(e){var t={},r={bind:function(e,r){t[e]=r},lookup:function(r){var n;return t.hasOwnProperty(r)?n=t[r]:e&&(n=e.lookup(r)),n},timestamp:e?e.timestamp:null,async:!!e&&e.async,isParallelCall:!!e&&e.isParallelCall,global:e?e.global:{ancestry:[null]}};if(e){var n=e.lookup(Symbol.for("jsonata.__createFrame_push"));n&&n(e,r)}return r}x.bind("sum",Fe(d.sum,"<a<n>:n>")),x.bind("count",Fe(d.count,"<a:n>")),x.bind("max",Fe(d.max,"<a<n>:n>")),x.bind("min",Fe(d.min,"<a<n>:n>")),x.bind("average",Fe(d.average,"<a<n>:n>")),x.bind("string",Fe(d.string,"<x-b?:s>")),x.bind("substring",Fe(d.substring,"<s-nn?:s>")),x.bind("substringBefore",Fe(d.substringBefore,"<s-s:s>")),x.bind("substringAfter",Fe(d.substringAfter,"<s-s:s>")),x.bind("lowercase",Fe(d.lowercase,"<s-:s>")),x.bind("uppercase",Fe(d.uppercase,"<s-:s>")),x.bind("length",Fe(d.length,"<s-:n>")),x.bind("trim",Fe(d.trim,"<s-:s>")),x.bind("pad",Fe(d.pad,"<s-ns?:s>")),x.bind("match",Fe(d.match,"<s-f<s:o>n?:a<o>>")),x.bind("contains",Fe(d.contains,"<s-(sf):b>")),x.bind("replace",Fe(d.replace,"<s-(sf)(sf)n?:s>")),x.bind("split",Fe(d.split,"<s-(sf)n?:a<s>>")),x.bind("join",Fe(d.join,"<a<s>s?:s>")),x.bind("formatNumber",Fe(d.formatNumber,"<n-so?:s>")),x.bind("formatBase",Fe(d.formatBase,"<n-n?:s>")),x.bind("formatInteger",Fe(h.formatInteger,"<n-s:s>")),x.bind("parseInteger",Fe(h.parseInteger,"<s-s:n>")),x.bind("number",Fe(d.number,"<(nsb)-:n>")),x.bind("floor",Fe(d.floor,"<n-:n>")),x.bind("ceil",Fe(d.ceil,"<n-:n>")),x.bind("round",Fe(d.round,"<n-n?:n>")),x.bind("abs",Fe(d.abs,"<n-:n>")),x.bind("sqrt",Fe(d.sqrt,"<n-:n>")),x.bind("power",Fe(d.power,"<n-n:n>")),x.bind("random",Fe(d.random,"<:n>")),x.bind("boolean",Fe(d.boolean,"<x-:b>")),x.bind("not",Fe(d.not,"<x-:b>")),x.bind("map",Fe(d.map,"<af>")),x.bind("zip",Fe(d.zip,"<a+>")),x.bind("filter",Fe(d.filter,"<af>")),x.bind("single",Fe(d.single,"<af?>")),x.bind("reduce",Fe(d.foldLeft,"<afj?:j>")),x.bind("sift",Fe(d.sift,"<o-f?:o>")),x.bind("keys",Fe(d.keys,"<x-:a<s>>")),x.bind("lookup",Fe(d.lookup,"<x-s:x>")),x.bind("append",Fe(d.append,"<xx:a>")),x.bind("exists",Fe(d.exists,"<x:b>")),x.bind("spread",Fe(d.spread,"<x-:a<o>>")),x.bind("merge",Fe(d.merge,"<a<o>:o>")),x.bind("reverse",Fe(d.reverse,"<a:a>")),x.bind("each",Fe(d.each,"<o-f:a>")),x.bind("error",Fe(d.error,"<s?:x>")),x.bind("assert",Fe(d.assert,"<bs?:x>")),x.bind("type",Fe(d.type,"<x:s>")),x.bind("sort",Fe(d.sort,"<af?:a>")),x.bind("shuffle",Fe(d.shuffle,"<a:a>")),x.bind("distinct",Fe(d.distinct,"<x:x>")),x.bind("base64encode",Fe(d.base64encode,"<s-:s>")),x.bind("base64decode",Fe(d.base64decode,"<s-:s>")),x.bind("encodeUrlComponent",Fe(d.encodeUrlComponent,"<s-:s>")),x.bind("encodeUrl",Fe(d.encodeUrl,"<s-:s>")),x.bind("decodeUrlComponent",Fe(d.decodeUrlComponent,"<s-:s>")),x.bind("decodeUrl",Fe(d.decodeUrl,"<s-:s>")),x.bind("eval",Fe(function(e,t){return Ue.apply(this,arguments)},"<sx?:x>")),x.bind("toMillis",Fe(h.toMillis,"<s-s?:n>")),x.bind("fromMillis",Fe(h.fromMillis,"<n-s?s?:s>")),x.bind("clone",Fe(function(e){if(void 0!==e)return JSON.parse(d.string(e))},"<(oa)-:o>"));var Ie={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",D1010:"Attempted to access the Javascript object prototype",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e6. Attempted to allocate {{value}}.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function Le(e){var t=Ie[e.code];if(void 0!==t){var r=t.replace(/\{\{\{([^}]+)}}}/g,function(){return e[arguments[1]]});r=r.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(e[arguments[1]])}),e.message=r}}function _e(e,t){var r,n;try{r=g(e,t&&t.recover),n=r.errors,delete r.errors}catch(e){throw Le(e),e}var a=Ne(x),i=new Date;return a.bind("now",Fe(function(e,t){return h.fromMillis(i.getTime(),e,t)},"<s?s?:s>")),a.bind("millis",Fe(function(){return i.getTime()},"<:n>")),t&&t.RegexEngine?_e.RegexEngine=t.RegexEngine:_e.RegexEngine=RegExp,{evaluate:function(){var e=l(u().m(function e(t,c,f){var p,l,h,d,v;return u().w(function(e){for(;;)switch(e.p=e.n){case 0:if(void 0===n){e.n=1;break}throw Le(p={code:"S0500",position:0}),p;case 1:if(void 0!==c)for(h in l=Ne(a),c)l.bind(h,c[h]);else l=a;return l.bind("$",t),i=new Date,l.timestamp=i,Array.isArray(t)&&!s(t)&&((t=o(t)).outerWrapper=!0),e.p=2,e.n=3,E(r,t,l);case 3:return d=e.v,"function"==typeof f&&f(null,d),e.a(2,d);case 4:throw e.p=4,Le(v=e.v),v;case 5:return e.a(2)}},e,null,[[2,4]])}));return function(t,r,n){return e.apply(this,arguments)}}(),assign:function(e,t){a.bind(e,t)},registerFunction:function(e,t,r){var n=Fe(t,r);a.bind(e,n)},ast:function(){return r},errors:function(){return n}}}return _e.parser=g,_e}();t.exports=y},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(e,t,r){"use strict";var n,a,i,o=e("./signature"),s=(n={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,"?:":40,"??":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},i=function(e){var t=0,r=e.length,i=function(e,r){return{type:e,value:r,position:t}},o=function(s){if(t>=r)return null;for(var u=e.charAt(t);t<r&&" \t\n\r\v".indexOf(u)>-1;)t++,u=e.charAt(t);if("/"===u&&"*"===e.charAt(t+1)){var c=t;for(t+=2,u=e.charAt(t);"*"!==u||"/"!==e.charAt(t+1);)if(u=e.charAt(++t),t>=r)throw{code:"S0106",stack:(new Error).stack,position:c};return t+=2,u=e.charAt(t),o(s)}if(!0!==s&&"/"===u)return t++,i("regex",function(){for(var n,a,i=t,o=0,s=function(t){if("/"===e.charAt(t)&&0===o){for(var r=0;"\\"===e.charAt(t-(r+1));)r++;if(r%2==0)return!0}return!1};t<r;){var u=e.charAt(t);if(s(t)){if(""===(n=e.substring(i,t)))throw{code:"S0301",stack:(new Error).stack,position:t};for(t++,u=e.charAt(t),i=t;"i"===u||"m"===u;)t++,u=e.charAt(t);return a=e.substring(i,t)+"g",new RegExp(n,a)}"("!==u&&"["!==u&&"{"!==u||"\\"===e.charAt(t-1)||o++,")"!==u&&"]"!==u&&"}"!==u||"\\"===e.charAt(t-1)||o--,t++}throw{code:"S0302",stack:(new Error).stack,position:t}}());if("."===u&&"."===e.charAt(t+1))return t+=2,i("operator","..");if(":"===u&&"="===e.charAt(t+1))return t+=2,i("operator",":=");if("!"===u&&"="===e.charAt(t+1))return t+=2,i("operator","!=");if(">"===u&&"="===e.charAt(t+1))return t+=2,i("operator",">=");if("<"===u&&"="===e.charAt(t+1))return t+=2,i("operator","<=");if("*"===u&&"*"===e.charAt(t+1))return t+=2,i("operator","**");if("~"===u&&">"===e.charAt(t+1))return t+=2,i("operator","~>");if("?"===u&&":"===e.charAt(t+1))return t+=2,i("operator","?:");if("?"===u&&"?"===e.charAt(t+1))return t+=2,i("operator","??");if(Object.prototype.hasOwnProperty.call(n,u))return t++,i("operator",u);if('"'===u||"'"===u){var f=u;t++;for(var p="";t<r;){if("\\"===(u=e.charAt(t)))if(t++,u=e.charAt(t),Object.prototype.hasOwnProperty.call(a,u))p+=a[u];else{if("u"!==u)throw{code:"S0103",stack:(new Error).stack,position:t,token:u};var l=e.substr(t+1,4);if(!/^[0-9a-fA-F]+$/.test(l))throw{code:"S0104",stack:(new Error).stack,position:t};var h=parseInt(l,16);p+=String.fromCharCode(h),t+=4}else{if(u===f)return t++,i("string",p);p+=u}t++}throw{code:"S0101",stack:(new Error).stack,position:t}}var d,v=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(e.substring(t));if(null!==v){var g=parseFloat(v[0]);if(!isNaN(g)&&isFinite(g))return t+=v[0].length,i("number",g);throw{code:"S0102",stack:(new Error).stack,position:t,token:v[0]}}if("`"===u){t++;var b=e.indexOf("`",t);if(-1!==b)return d=e.substring(t,b),t=b+1,i("name",d);throw t=r,{code:"S0105",stack:(new Error).stack,position:t}}for(var y,m=t;;)if(y=e.charAt(m),m===r||" \t\n\r\v".indexOf(y)>-1||Object.prototype.hasOwnProperty.call(n,y)){if("$"===e.charAt(t))return d=e.substring(t+1,m),t=m,i("variable",d);switch(d=e.substring(t,m),t=m,d){case"or":case"in":case"and":return i("operator",d);case"true":return i("value",!0);case"false":return i("value",!1);case"null":return i("value",null);default:return t===r&&""===d?null:i("name",d)}}else m++};return o},function(e,t){var r,a,s={},u=[],c=function(){var e=[];"(end)"!==r.id&&e.push({type:r.type,value:r.value,position:r.position});for(var t=a();null!==t;)e.push(t),t=a();return e},f={nud:function(){var e={code:"S0211",token:this.value,position:this.position};if(t)return e.remaining=c(),e.type="error",u.push(e),e;throw e.stack=(new Error).stack,e}},p=function(e,t){var r=s[e];return t=t||0,r?t>=r.lbp&&(r.lbp=t):((r=Object.create(f)).id=r.value=e,r.lbp=t,s[e]=r),r},l=function(e){if(t){e.remaining=c(),u.push(e);var n=s["(error)"];return(r=Object.create(n)).error=e,r.type="(error)",r}throw e.stack=(new Error).stack,e},h=function(t,n){if(t&&r.id!==t){var i={code:"(end)"===r.id?"S0203":"S0202",position:r.position,token:r.value,value:t};return l(i)}var o=a(n);if(null===o)return(r=s["(end)"]).position=e.length,r;var u,c=o.value,f=o.type;switch(f){case"name":case"variable":u=s["(name)"];break;case"operator":if(!(u=s[c]))return l({code:"S0204",stack:(new Error).stack,position:o.position,token:c});break;case"string":case"number":case"value":u=s["(literal)"];break;case"regex":f="regex",u=s["(regex)"];break;default:return l({code:"S0205",stack:(new Error).stack,position:o.position,token:c})}return(r=Object.create(u)).value=c,r.type=f,r.position=o.position,r},d=function(e){var t,n=r;for(h(null,!0),t=n.nud();e<r.lbp;)n=r,h(),t=n.led(t);return t},v=function(e){p(e,0).nud=function(){return this}},g=function(e,t,r){var a=t||n[e],i=p(e,a);return i.led=r||function(e){return this.lhs=e,this.rhs=d(a),this.type="binary",this},i},b=function(e,t,r){var n=p(e,t);return n.led=r,n},y=function(e,t){var r=p(e);return r.nud=t||function(){return this.expression=d(70),this.type="unary",this},r};v("(end)"),v("(name)"),v("(literal)"),v("(regex)"),p(":"),p(";"),p(","),p(")"),p("]"),p("}"),p(".."),g("."),g("+"),g("-"),g("*"),g("/"),g("%"),g("="),g("<"),g(">"),g("!="),g("<="),g(">="),g("&"),g("and"),g("or"),g("in"),v("and"),v("or"),v("in"),y("-"),g("~>"),g("??",n["??"],function(e){return this.type="condition",this.condition={type:"function",value:"(",procedure:{type:"variable",value:"exists"},arguments:[e]},this.then=e,this.else=d(0),this}),b("(error)",10,function(e){return this.lhs=e,this.error=r.error,this.remaining=c(),this.type="error",this}),y("*",function(){return this.type="wildcard",this}),y("**",function(){return this.type="descendant",this}),y("%",function(){return this.type="parent",this}),g("(",n["("],function(e){if(this.procedure=e,this.type="function",this.arguments=[],")"!==r.id)for(;"operator"===r.type&&"?"===r.id?(this.type="partial",this.arguments.push(r),h("?")):this.arguments.push(d(0)),","===r.id;)h(",");if(h(")",!0),"name"===e.type&&("function"===e.value||"λ"===e.value)){if(this.arguments.forEach(function(e,t){if("variable"!==e.type)return l({code:"S0208",stack:(new Error).stack,position:e.position,token:e.value,value:t+1})}),this.type="lambda","<"===r.id){for(var t=r.position,n=1,a="<";n>0&&"{"!==r.id&&"(end)"!==r.id;){var i=h();">"===i.id?n--:"<"===i.id&&n++,a+=i.value}h(">");try{this.signature=o(a)}catch(e){return e.position=t+e.offset,l(e)}}h("{"),this.body=d(0),h("}")}return this}),y("(",function(){for(var e=[];")"!==r.id&&(e.push(d(0)),";"===r.id);)h(";");return h(")",!0),this.type="block",this.expressions=e,this}),y("[",function(){var e=[];if("]"!==r.id)for(;;){var t=d(0);if(".."===r.id){var n={type:"binary",value:"..",position:r.position,lhs:t};h(".."),n.rhs=d(0),t=n}if(e.push(t),","!==r.id)break;h(",")}return h("]",!0),this.expressions=e,this.type="unary",this}),g("[",n["["],function(e){if("]"===r.id){for(var t=e;t&&"binary"===t.type&&"["===t.value;)t=t.lhs;return t.keepArray=!0,h("]"),e}return this.lhs=e,this.rhs=d(n["]"]),this.type="binary",h("]",!0),this}),g("^",n["^"],function(e){h("(");for(var t=[];;){var n={descending:!1};if("<"===r.id?h("<"):">"===r.id&&(n.descending=!0,h(">")),n.expression=d(0),t.push(n),","!==r.id)break;h(",")}return h(")"),this.lhs=e,this.rhs=t,this.type="binary",this});var m=function(e){var t=[];if("}"!==r.id)for(;;){var n=d(0);h(":");var a=d(0);if(t.push([n,a]),","!==r.id)break;h(",")}return h("}",!0),void 0===e?(this.lhs=t,this.type="unary"):(this.lhs=e,this.rhs=t,this.type="binary"),this};y("{",m),g("{",n["{"],m),b(":=",n[":="],function(e){return"variable"!==e.type?l({code:"S0212",stack:(new Error).stack,position:e.position,token:e.value}):(this.lhs=e,this.rhs=d(n[":="]-1),this.type="binary",this)}),g("@",n["@"],function(e){return this.lhs=e,this.rhs=d(n["@"]),"variable"!==this.rhs.type?l({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),g("#",n["#"],function(e){return this.lhs=e,this.rhs=d(n["#"]),"variable"!==this.rhs.type?l({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),g("?",n["?"],function(e){return this.type="condition",this.condition=e,this.then=d(0),":"===r.id&&(h(":"),this.else=d(0)),this}),g("?:",n["?:"],function(e){return this.type="condition",this.condition=e,this.then=e,this.else=d(0),this}),y("|",function(){return this.type="transform",this.pattern=d(0),h("|"),this.update=d(0),","===r.id&&(h(","),this.delete=d(0)),h("|"),this});var k=function(e){var t;if("function"!==e.type||e.predicate)if("condition"===e.type)e.then=k(e.then),void 0!==e.else&&(e.else=k(e.else)),t=e;else if("block"===e.type){var r=e.expressions.length;r>0&&(e.expressions[r-1]=k(e.expressions[r-1])),t=e}else t=e;else{var n={type:"lambda",thunk:!0,arguments:[],position:e.position};n.body=e,t=n}return t},w=0,x=0,E=[],A=function(e,t){switch(e.type){case"name":case"wildcard":t.level--,0===t.level&&(void 0===e.ancestor?e.ancestor=t:(E[t.index].slot.label=e.ancestor.label,e.ancestor=t),e.tuple=!0);break;case"parent":t.level++;break;case"block":e.expressions.length>0&&(e.tuple=!0,t=A(e.expressions[e.expressions.length-1],t));break;case"path":e.tuple=!0;var r=e.steps.length-1;for(t=A(e.steps[r--],t);t.level>0&&r>=0;)t=A(e.steps[r--],t);break;default:throw{code:"S0217",token:e.type,position:e.position}}return t},S=function(e,t){if(void 0!==t.seekingParent||"parent"===t.type){var r=void 0!==t.seekingParent?t.seekingParent:[];"parent"===t.type&&r.push(t.slot),void 0===e.seekingParent?e.seekingParent=r:Array.prototype.push.apply(e.seekingParent,r)}},T=function(e){var t=e.steps.length-1,r=e.steps[t],n=void 0!==r.seekingParent?r.seekingParent:[];"parent"===r.type&&n.push(r.slot);for(var a=0;a<n.length;a++){var i=n[a];for(t=e.steps.length-2;i.level>0;){if(t<0){void 0===e.seekingParent?e.seekingParent=[i]:e.seekingParent.push(i);break}for(var o=e.steps[t--];t>=0&&o.focus&&e.steps[t].focus;)o=e.steps[t--];i=A(o,i)}}},O=function(e){var r;switch(e.type){case"binary":switch(e.value){case".":var n=O(e.lhs);r="path"===n.type?n:{type:"path",steps:[n]},"parent"===n.type&&(r.seekingParent=[n.slot]);var a=O(e.rhs);"function"===a.type&&"path"===a.procedure.type&&1===a.procedure.steps.length&&"name"===a.procedure.steps[0].type&&"function"===r.steps[r.steps.length-1].type&&(r.steps[r.steps.length-1].nextFunction=a.procedure.steps[0].value),"path"===a.type?Array.prototype.push.apply(r.steps,a.steps):(void 0!==a.predicate&&(a.stages=a.predicate,delete a.predicate),r.steps.push(a)),r.steps.filter(function(e){if("number"===e.type||"value"===e.type)throw{code:"S0213",stack:(new Error).stack,position:e.position,value:e.value};return"string"===e.type}).forEach(function(e){e.type="name"}),r.steps.filter(function(e){return!0===e.keepArray}).length>0&&(r.keepSingletonArray=!0);var i=r.steps[0];"unary"===i.type&&"["===i.value&&(i.consarray=!0);var o=r.steps[r.steps.length-1];"unary"===o.type&&"["===o.value&&(o.consarray=!0),T(r);break;case"[":var s=r=O(e.lhs),c="predicate";if("path"===r.type&&(s=r.steps[r.steps.length-1],c="stages"),void 0!==s.group)throw{code:"S0209",stack:(new Error).stack,position:e.position};void 0===s[c]&&(s[c]=[]);var f=O(e.rhs);void 0!==f.seekingParent&&(f.seekingParent.forEach(function(e){1===e.level?A(s,e):e.level--}),S(s,f)),s[c].push({type:"filter",expr:f,position:e.position});break;case"{":if(void 0!==(r=O(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};r.group={lhs:e.rhs.map(function(e){return[O(e[0]),O(e[1])]}),position:e.position};break;case"^":"path"!==(r=O(e.lhs)).type&&(r={type:"path",steps:[r]});var p={type:"sort",position:e.position};p.terms=e.rhs.map(function(e){var t=O(e.expression);return S(p,t),{descending:e.descending,expression:t}}),r.steps.push(p),T(r);break;case":=":(r={type:"bind",value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),S(r,r.rhs);break;case"@":if(r=O(e.lhs),s=r,"path"===r.type&&(s=r.steps[r.steps.length-1]),void 0!==s.stages||void 0!==s.predicate)throw{code:"S0215",stack:(new Error).stack,position:e.position};if("sort"===s.type)throw{code:"S0216",stack:(new Error).stack,position:e.position};e.keepArray&&(s.keepArray=!0),s.focus=e.rhs.value,s.tuple=!0;break;case"#":r=O(e.lhs),s=r,"path"===r.type?s=r.steps[r.steps.length-1]:(r={type:"path",steps:[r]},void 0!==s.predicate&&(s.stages=s.predicate,delete s.predicate)),void 0===s.stages?s.index=e.rhs.value:s.stages.push({type:"index",value:e.rhs.value,position:e.position}),s.tuple=!0;break;case"~>":(r={type:"apply",value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),r.keepArray=r.lhs.keepArray||r.rhs.keepArray;break;default:(r={type:e.type,value:e.value,position:e.position}).lhs=O(e.lhs),r.rhs=O(e.rhs),S(r,r.lhs),S(r,r.rhs)}break;case"unary":r={type:e.type,value:e.value,position:e.position},"["===e.value?r.expressions=e.expressions.map(function(e){var t=O(e);return S(r,t),t}):"{"===e.value?r.lhs=e.lhs.map(function(e){var t=O(e[0]);S(r,t);var n=O(e[1]);return S(r,n),[t,n]}):(r.expression=O(e.expression),"-"===e.value&&"number"===r.expression.type?(r=r.expression).value=-r.value:S(r,r.expression));break;case"function":case"partial":(r={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map(function(e){var t=O(e);return S(r,t),t}),r.procedure=O(e.procedure);break;case"lambda":r={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var l=O(e.body);r.body=k(l);break;case"condition":(r={type:e.type,position:e.position}).condition=O(e.condition),S(r,r.condition),r.then=O(e.then),S(r,r.then),void 0!==e.else&&(r.else=O(e.else),S(r,r.else));break;case"transform":(r={type:e.type,position:e.position}).pattern=O(e.pattern),r.update=O(e.update),void 0!==e.delete&&(r.delete=O(e.delete));break;case"block":(r={type:e.type,position:e.position}).expressions=e.expressions.map(function(e){var t=O(e);return S(r,t),(t.consarray||"path"===t.type&&t.steps[0].consarray)&&(r.consarray=!0),t});break;case"name":r={type:"path",steps:[e]},e.keepArray&&(r.keepSingletonArray=!0);break;case"parent":r={type:"parent",slot:{label:"!"+w++,level:1,index:x++}},E.push(r);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":r=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",r=O(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};r=e}break;case"error":r=e,e.lhs&&(r=O(e.lhs));break;default:var h="S0206";"(end)"===e.id&&(h="S0207");var d={code:h,position:e.position,token:e.value};if(t)return u.push(d),{type:"error",error:d};throw d.stack=(new Error).stack,d}return e.keepArray&&(r.keepArray=!0),r};a=i(e),h();var D=d(0);if("(end)"!==r.id){var P={code:"S0201",position:r.position,token:r.value};l(P)}if("parent"===(D=O(D)).type||void 0!==D.seekingParent)throw{code:"S0217",token:D.type,position:D.position};return u.length>0&&(D.errors=u),D});t.exports=s},{"./signature":5}],5:[function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./utils"),i=function(){var e={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};return function(t){for(var r=1,i=[],o={},s=o;r<t.length;){var u=t.charAt(r);if(":"===u)break;var c=function(){i.push(o),s=o,o={}},f=function(e,t,r,n){for(var a=1,i=t;i<e.length;)if(i++,(u=e.charAt(i))===n){if(0==--a)break}else u===r&&a++;return i};switch(u){case"s":case"n":case"b":case"l":case"o":o.regex="["+u+"m]",o.type=u,c();break;case"a":o.regex="[asnblfom]",o.type=u,o.array=!0,c();break;case"f":o.regex="f",o.type=u,c();break;case"j":o.regex="[asnblom]",o.type=u,c();break;case"x":o.regex="[asnblfom]",o.type=u,c();break;case"-":s.context=!0,s.contextRegex=new RegExp(s.regex),s.regex+="?";break;case"?":case"+":s.regex+=u;break;case"(":var p=f(t,r,"(",")"),l=t.substring(r+1,p);if(-1!==l.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:l,offset:r};o.regex="["+l+"m]",o.type="("+l+")",r=p,c();break;case"<":if("a"!==s.type&&"f"!==s.type)throw{code:"S0401",stack:(new Error).stack,value:s.type,offset:r};var h=f(t,r,"<",">");s.subtype=t.substring(r+1,h),r=h}r++}var d="^"+i.map(function(e){return"("+e.regex+")"}).join("")+"$",v=new RegExp(d),g=function(e){var t;if(a.isFunction(e))t="f";else switch(n(e)){case"string":t="s";break;case"number":t="n";break;case"boolean":t="b";break;case"object":t=null===e?"l":Array.isArray(e)?"a":"o";break;case"undefined":default:t="m"}return t};return{definition:t,validate:function(t,r){var n="";t.forEach(function(e){n+=g(e)});var a=v.exec(n);if(a){var o=[],s=0;return i.forEach(function(n,i){var u=t[s],c=a[i+1];if(""===c)if(n.context&&n.contextRegex){var f=g(r);if(!n.contextRegex.test(f))throw{code:"T0411",stack:(new Error).stack,value:r,index:s+1};o.push(r)}else o.push(u),s++;else c.split("").forEach(function(r){if("a"===n.type){if("m"===r)u=void 0;else{u=t[s];var a=!0;if(void 0!==n.subtype)if("a"!==r&&c!==n.subtype)a=!1;else if("a"===r&&u.length>0){var i=g(u[0]);a=i===n.subtype.charAt(0)&&0===u.filter(function(e){return g(e)!==i}).length}if(!a)throw{code:"T0412",stack:(new Error).stack,value:u,index:s+1,type:e[n.subtype]};"a"!==r&&(u=[u])}o.push(u),s++}else o.push(u),s++})}),o}!function(e,t){for(var r="^",n=0,a=0;a<i.length;a++){r+=i[a].regex;var o=t.match(r);if(null===o)throw{code:"T0410",stack:(new Error).stack,value:e[n],index:n+1};n=o[0].length}throw{code:"T0410",stack:(new Error).stack,value:e[n],index:n+1}}(t,n)}}}}();t.exports=i},{"./utils":6}],6:[function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(){function e(e){var t=!1;if("number"==typeof e&&(t=!isNaN(e))&&!isFinite(e))throw{code:"D1001",value:e,stack:(new Error).stack};return t}var t=("function"==typeof Symbol?Symbol:{}).iterator||"@@iterator";return{isNumeric:e,isArrayOfStrings:function(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter(function(e){return"string"!=typeof e}).length),t},isArrayOfNumbers:function(t){var r=!1;return Array.isArray(t)&&(r=0===t.filter(function(t){return!e(t)}).length),r},createSequence:function(){var e=[];return e.sequence=!0,1===arguments.length&&e.push(arguments[0]),e},isSequence:function(e){return!0===e.sequence&&Array.isArray(e)},isFunction:function(e){return e&&(!0===e._jsonata_function||!0===e._jsonata_lambda)||"function"==typeof e},isLambda:function(e){return e&&!0===e._jsonata_lambda},isIterable:function(e){return"object"===i(e)&&null!==e&&t in e&&"next"in e&&"function"==typeof e.next},getFunctionArity:function(e){return"number"==typeof e.arity?e.arity:"function"==typeof e.implementation?e.implementation.length:"number"==typeof e.length?e.length:e.arguments.length},isDeepEqual:function e(t,r){if(t===r)return!0;if("object"===i(t)&&"object"===i(r)&&null!==t&&null!==r){if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}var a=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(r);if(a.length!==o.length)return!1;for(a=a.sort(),o=o.sort(),n=0;n<a.length;n++)if(a[n]!==o[n])return!1;for(n=0;n<a.length;n++){var s=a[n];if(!e(t[s],r[s]))return!1}return!0}return!1},stringToArray:function(e){var t,r=[],a=n(e);try{for(a.s();!(t=a.n()).done;){var i=t.value;r.push(i)}}catch(e){a.e(e)}finally{a.f()}return r},isPromise:function(e){return"object"===i(e)&&null!==e&&"then"in e&&"function"==typeof e.then}}}();t.exports=o},{}]},{},[3])(3)});
|