3 lines
No EOL
185 KiB
JavaScript
3 lines
No EOL
185 KiB
JavaScript
/*! For license information please see module.js.LICENSE.txt */
|
|
define(["@emotion/css","@grafana/data","@grafana/runtime","@grafana/ui","emotion","lodash","moment","react"],((e,t,r,n,a,o,i,s)=>(()=>{var u=[e=>{"use strict";e.exports=s},e=>{"use strict";e.exports=n},e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},e=>{"use strict";e.exports=t},(e,t,r)=>{var n=r(10),a=r(30),o=r(31),i="[object Null]",s="[object Undefined]",u=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:i:u&&u in Object(e)?a(e):o(e)}},(e,t,r)=>{var n=r(11),a="object"==typeof self&&self&&self.Object===Object&&self,o=n||a||Function("return this")();e.exports=o},e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},(e,t,r)=>{var n=r(21),a=r(12),o=r(37),i=r(38),s=Object.prototype,u=s.hasOwnProperty,c=n((function(e,t){e=Object(e);var r=-1,n=t.length,c=n>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(n=1);++r<n;)for(var l=t[r],f=i(l),p=-1,h=f.length;++p<h;){var d=f[p],v=e[d];(void 0===v||a(v,s[d])&&!u.call(e,d))&&(e[d]=l[d])}return e}));e.exports=c},e=>{e.exports=function(e){return e}},(e,t,r)=>{var n=r(4),a=r(2),o="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!a(e))return!1;var t=n(e);return t==i||t==s||t==o||t==u}},(e,t,r)=>{var n=r(5).Symbol;e.exports=n},(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},(e,t,r)=>{var n=r(9),a=r(14);e.exports=function(e){return null!=e&&a(e.length)&&!n(e)}},e=>{var t=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}},e=>{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var a=typeof e;return!!(n=null==n?t:n)&&("number"==a||"symbol"!=a&&r.test(e))&&e>-1&&e%1==0&&e<n}},(e,t,r)=>{e=r.nmd(e);var n=r(5),a=r(44),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||a;e.exports=u},(e,t,r)=>{e=r.nmd(e);var n=r(11),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a&&n.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",a="second",o="minute",i="hour",s="day",u="week",c="month",l="quarter",f="year",p="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},g=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},m={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),a=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(a,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),a=t.clone().add(n,c),o=r-a<0,i=t.clone().add(n+(o?-1:1),c);return+(-(n+(r-a)/(o?a-i:i-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:f,w:u,d:s,D:p,h:i,m:o,s:a,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=y;var x=function(e){return e instanceof A},k=function e(t,r,n){var a;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();w[o]&&(a=o),r&&(w[o]=r,a=o);var i=t.split("-");if(!a&&i.length>1)return e(i[0])}else{var s=t.name;w[s]=t,a=s}return!n&&a&&(b=a),a||!n&&b},E=function(e,t){if(x(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new A(r)},S=m;S.l=k,S.i=x,S.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function y(e){this.$L=k(e.locale,null,!0),this.parse(e)}var g=y.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(d);if(n){var a=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},g.isAfter=function(e,t){return E(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<E(e)},g.$g=function(e,t,r){return S.u(e)?this[t]:this.set(r,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var r=this,n=!!S.u(t)||t,l=S.p(e),h=function(e,t){var a=S.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?a:a.endOf(s)},d=function(e,t){return S.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,y=this.$M,g=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case f:return n?h(1,0):h(31,11);case c:return n?h(1,y):h(0,y+1);case u:var b=this.$locale().weekStart||0,w=(v<b?v+7:v)-b;return h(n?g-w:g+(6-w),y);case s:case p:return d(m+"Hours",0);case i:return d(m+"Minutes",1);case o:return d(m+"Seconds",2);case a:return d(m+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var r,u=S.p(e),l="set"+(this.$u?"UTC":""),h=(r={},r[s]=l+"Date",r[p]=l+"Date",r[c]=l+"Month",r[f]=l+"FullYear",r[i]=l+"Hours",r[o]=l+"Minutes",r[a]=l+"Seconds",r[n]=l+"Milliseconds",r)[u],d=u===s?this.$D+(t-this.$W):t;if(u===c||u===f){var v=this.clone().set(p,1);v.$d[h](d),v.init(),this.$d=v.set(p,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](d);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[S.p(e)]()},g.add=function(n,l){var p,h=this;n=Number(n);var d=S.p(l),v=function(e){var t=E(h);return S.w(t.date(t.date()+Math.round(e*n)),h)};if(d===c)return this.set(c,this.$M+n);if(d===f)return this.set(f,this.$y+n);if(d===s)return v(1);if(d===u)return v(7);var y=(p={},p[o]=t,p[i]=r,p[a]=e,p)[d]||1,g=this.$d.getTime()+n*y;return S.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",a=S.z(this),o=this.$H,i=this.$m,s=this.$M,u=r.weekdays,c=r.months,l=function(e,r,a,o){return e&&(e[r]||e(t,n))||a[r].slice(0,o)},f=function(e){return S.s(o%12||12,e,"0")},p=r.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n},d={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:S.s(s+1,2,"0"),MMM:l(r.monthsShort,s,c,3),MMMM:l(c,s),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:l(r.weekdaysMin,this.$W,u,2),ddd:l(r.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:S.s(o,2,"0"),h:f(1),hh:f(2),a:p(o,i,!0),A:p(o,i,!1),m:String(i),mm:S.s(i,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:a};return n.replace(v,(function(e,t){return t||d[e]||a.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,p,h){var d,v=S.p(p),y=E(n),g=(y.utcOffset()-this.utcOffset())*t,m=this-y,b=S.m(this,y);return b=(d={},d[f]=b/12,d[c]=b,d[l]=b/3,d[u]=(m-g)/6048e5,d[s]=(m-g)/864e5,d[i]=m/r,d[o]=m/t,d[a]=m/e,d)[v]||m,h?b:S.a(b)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},y}(),O=A.prototype;return E.prototype=O,[["$ms",n],["$s",a],["$m",o],["$H",i],["$W",s],["$M",c],["$y",f],["$D",p]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,A,E),e.$i=!0),E},E.locale=k,E.isDayjs=x,E.unix=function(e){return E(1e3*e)},E.en=w[b],E.Ls=w,E.p={},E}()},t=>{"use strict";t.exports=e},e=>{"use strict";e.exports=a},(e,t,r)=>{var n=r(8),a=r(22),o=r(24);e.exports=function(e,t){return o(a(e,t,n),e+"")}},(e,t,r)=>{var n=r(23),a=Math.max;e.exports=function(e,t,r){return t=a(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,s=a(o.length-t,0),u=Array(s);++i<s;)u[i]=o[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=o[i];return c[t]=r(u),n(e,this,c)}}},e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},(e,t,r)=>{var n=r(25),a=r(36)(n);e.exports=a},(e,t,r)=>{var n=r(26),a=r(27),o=r(8),i=a?function(e,t){return a(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=i},e=>{e.exports=function(e){return function(){return e}}},(e,t,r)=>{var n=r(28),a=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=a},(e,t,r)=>{var n=r(29),a=r(35);e.exports=function(e,t){var r=a(e,t);return n(r)?r:void 0}},(e,t,r)=>{var n=r(9),a=r(32),o=r(2),i=r(34),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||a(e))&&(n(e)?p:s).test(i(e))}},(e,t,r)=>{var n=r(10),a=Object.prototype,o=a.hasOwnProperty,i=a.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var a=i.call(e);return n&&(t?e[s]=r:delete e[s]),a}},e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},(e,t,r)=>{var n,a=r(33),o=(n=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},(e,t,r)=>{var n=r(5)["__core-js_shared__"];e.exports=n},e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},e=>{var t=800,r=16,n=Date.now;e.exports=function(e){var a=0,o=0;return function(){var i=n(),s=r-(i-o);if(o=i,s>0){if(++a>=t)return arguments[0]}else a=0;return e.apply(void 0,arguments)}}},(e,t,r)=>{var n=r(12),a=r(13),o=r(15),i=r(2);e.exports=function(e,t,r){if(!i(r))return!1;var s=typeof t;return!!("number"==s?a(r)&&o(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},(e,t,r)=>{var n=r(39),a=r(48),o=r(13);e.exports=function(e){return o(e)?n(e,!0):a(e)}},(e,t,r)=>{var n=r(40),a=r(41),o=r(43),i=r(16),s=r(15),u=r(45),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),l=!r&&a(e),f=!r&&!l&&i(e),p=!r&&!l&&!f&&u(e),h=r||l||f||p,d=h?n(e.length,String):[],v=d.length;for(var y in e)!t&&!c.call(e,y)||h&&("length"==y||f&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,v))||d.push(y);return d}},e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},(e,t,r)=>{var n=r(42),a=r(6),o=Object.prototype,i=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return a(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},(e,t,r)=>{var n=r(4),a=r(6),o="[object Arguments]";e.exports=function(e){return a(e)&&n(e)==o}},e=>{var t=Array.isArray;e.exports=t},e=>{e.exports=function(){return!1}},(e,t,r)=>{var n=r(46),a=r(47),o=r(17),i=o&&o.isTypedArray,s=i?a(i):n;e.exports=s},(e,t,r)=>{var n=r(4),a=r(14),o=r(6),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&a(e.length)&&!!i[n(e)]}},e=>{e.exports=function(e){return function(t){return e(t)}}},(e,t,r)=>{var n=r(2),a=r(49),o=r(50),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=a(e),r=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&r.push(s);return r}},e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},e=>{"use strict";e.exports=r},(e,t,r)=>{e.exports=function(){function e(t,r,n){function a(i,s){if(!r[i]){if(!t[i]){if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[i]={exports:{}};t[i][0].call(c.exports,(function(e){return a(t[i][1][e]||e)}),c,c.exports,e,t,r,n)}return r[i].exports}for(var o=void 0,i=0;i<n.length;i++)a(n[i]);return a}return e}()({1:[function(e,t,r){const n=e("./utils"),a=function(){"use strict";const 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"];function i(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){const t=Math.floor(e/10),r=e%10;u=(n?" and ":"")+a[t-2],r>0?u+="-"+i(r,!1,s):s&&(u=u.substring(0,u.length-1)+"ieth")}else if(e<1e3){const r=Math.floor(e/100),a=e%100;u=(n?", ":"")+t[r]+" Hundred",a>0?u+=i(a,!0,s):s&&(u+="th")}else{var c=Math.floor(Math.log10(e)/3);c>o.length&&(c=o.length);const t=Math.pow(10,3*c),r=Math.floor(e/t),a=e-r*t;u=(n?", ":"")+i(r,!1,!1)+" "+o[c-1],a>0?u+=i(a,!0,s):s&&(u+="th")}return u};return i(e,!1,n)}const s={};function u(e){const t=e.split(/,\s|\sand\s|[\s\\-]/).map((e=>s[e]));let r=[0];return t.forEach((e=>{if(e<100){let t=r.pop();t>=1e3&&(r.push(t),t=0),r.push(t+e)}else r.push(r.pop()*e)})),r.reduce(((e,t)=>e+t),0)}t.forEach((function(e,t){s[e.toLowerCase()]=t})),r.forEach((function(e,t){s[e.toLowerCase()]=t})),a.forEach((function(e,t){const r=e.toLowerCase();s[r]=10*(t+2),s[r.substring(0,e.length-1)+"ieth"]=s[r]})),s.hundredth=100,o.forEach((function(e,t){const r=e.toLowerCase(),n=Math.pow(10,3*(t+1));s[r]=n,s[r+"th"]=n}));const c=[[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"]],l={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function f(e){for(var t=0;t<c.length;t++){const r=c[t];if(e>=r[0])return r[1]+f(e-r[0])}return""}function p(e){for(var t=0,r=1,n=e.length-1;n>=0;n--){const a=e[n],o=l[a];o<r?t-=o:(r=o,t+=o)}return t}function h(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("")}function d(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}function v(e,t){if(void 0!==e)return m(e=Math.floor(e),w(t))}const y={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},g={UPPER:"upper",LOWER:"lower",TITLE:"title"};function m(t,r){let n;const a=t<0;switch(t=Math.abs(t),r.primary){case y.LETTERS:n=h(t,r.case===g.UPPER?"A":"a");break;case y.ROMAN:n=f(t),r.case===g.UPPER&&(n=n.toUpperCase());break;case y.WORDS:n=i(t,r.ordinal),r.case===g.UPPER?n=n.toUpperCase():r.case===g.LOWER&&(n=n.toLowerCase());break;case y.DECIMAL:n=""+t;var o=r.mandatoryDigits-n.length;if(o>0){var s=new Array(o+1).join("0");n=s+n}if(48!==r.zeroCode&&(n=e(n).map((e=>String.fromCodePoint(e.codePointAt(0)+r.zeroCode-48))).join("")),r.regular)for(let e=Math.floor((n.length-1)/r.groupingSeparators.position);e>0;e--){const t=n.length-e*r.groupingSeparators.position;n=n.substr(0,t)+r.groupingSeparators.character+n.substr(t)}else r.groupingSeparators.reverse().forEach((e=>{const t=n.length-e.position;n=n.substr(0,t)+e.character+n.substr(t)}));if(r.ordinal){var u={1:"st",2:"nd",3:"rd"}[n[n.length-1]];(!u||n.length>1&&"1"===n[n.length-2])&&(u="th"),n+=u}break;case y.SEQUENCE:throw{code:"D3130",value:r.token}}return a&&(n="-"+n),n}const b=[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 w(t){const r={type:"integer",primary:y.DECIMAL,case:g.LOWER,ordinal:!1};let n,a;const o=t.lastIndexOf(";");switch(-1===o?n=t:(n=t.substring(0,o),a=t.substring(o+1),"o"===a[0]&&(r.ordinal=!0)),n){case"A":r.case=g.UPPER;case"a":r.primary=y.LETTERS;break;case"I":r.case=g.UPPER;case"i":r.primary=y.ROMAN;break;case"W":r.case=g.UPPER,r.primary=y.WORDS;break;case"Ww":r.case=g.TITLE,r.primary=y.WORDS;break;case"w":r.primary=y.WORDS;break;default:{let t=null,a=0,o=0,i=[],s=0;if(e(n).map((e=>e.codePointAt(0))).reverse().forEach((e=>{let r=!1;for(let n=0;n<b.length;n++){const o=b[n];if(e>=o&&e<=o+9){if(r=!0,a++,s++,null===t)t=o;else if(o!==t)throw{code:"D3131"};break}}r||(35===e?(s++,o++):i.push({position:s,character:String.fromCodePoint(e)}))})),a>0){r.primary=y.DECIMAL,r.zeroCode=t,r.mandatoryDigits=a,r.optionalDigits=o;const e=function(e){if(0===e.length)return 0;const t=e[0].character;for(let r=1;r<e.length;r++)if(e[r].character!==t)return 0;const r=e.map((e=>e.position)),n=function(e,t){return 0===t?e:n(t,e%t)},a=r.reduce(n);for(let e=1;e<=r.length;e++)if(-1===r.indexOf(e*a))return 0;return a}(i);e>0?(r.regular=!0,r.groupingSeparators={position:e,character:i[0].character}):(r.regular=!1,r.groupingSeparators=i)}else r.primary=y.SEQUENCE,r.token=n}}return r}const x={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 k(e){var t=[];const r={type:"datetime",parts:t},n=function(r,n){if(n>r){let a=e.substring(r,n);a=a.split("]]").join("]"),t.push({type:"literal",value:a})}};for(var 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"};let r=e.substring(a+1,o);r=r.split(/\s+/).join("");var i,s={type:"marker",component:r.charAt(0)},u=r.lastIndexOf(",");if(-1!==u){const e=r.substring(u+1),t=e.indexOf("-");let n,a;const o=function(e){return void 0===e||"*"===e?void 0:parseInt(e)};-1===t?n=e:(n=e.substring(0,t),a=e.substring(t+1));const c={min:o(n),max:o(a)};s.width=c,i=r.substring(1,u)}else i=r.substring(1);if(1===i.length)s.presentation1=i;else if(i.length>1){var c=i.charAt(i.length-1);-1!=="atco".indexOf(c)?(s.presentation2=c,"o"===c&&(s.ordinal=!0),s.presentation1=i.substring(0,i.length-1)):s.presentation1=i}else s.presentation1=x[s.component];if(void 0===s.presentation1)throw{code:"D3132",value:s.component};if("n"===s.presentation1[0])s.names=g.LOWER;else if("N"===s.presentation1[0])"n"===s.presentation1[1]?s.names=g.TITLE:s.names=g.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(s.component)){var l=s.presentation1;if(s.presentation2&&(l+=";"+s.presentation2),s.integerFormat=w(l),s.width&&void 0!==s.width.min&&s.integerFormat.mandatoryDigits<s.width.min&&(s.integerFormat.mandatoryDigits=s.width.min),-1!=="YMD".indexOf(s.component))if(s.n=-1,s.width&&void 0!==s.width.max)s.n=s.width.max,s.integerFormat.mandatoryDigits=s.n;else{var f=s.integerFormat.mandatoryDigits+s.integerFormat.optionalDigits;f>=2&&(s.n=f)}}"Z"!==s.component&&"z"!==s.component||(s.integerFormat=w(s.presentation1)),t.push(s),a=o+1}o++}return n(a,o),r}const E=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"],A=864e5,O=function(e){const t=Date.UTC(e.year,e.month);var r=new Date(t).getUTCDay();return 0===r&&(r=7),r>4?t+(8-r)*A:t-(r-1)*A},_=function(e,t){return{year:e,month:t,nextMonth:function(){return 11===t?_(e+1,0):_(e,t+1)},previousMonth:function(){return 0===t?_(e-1,11):_(e,t-1)},nextYear:function(){return _(e+1,t)},previousYear:function(){return _(e-1,t)}}},j=function(e,t){return(t-e)/(7*A)+1},T=(e,t)=>{let 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))/A+1;break;case"F":r=e.getUTCDay(),0===r&&(r=7);break;case"W":{const t=_(e.getUTCFullYear(),0),n=O(t),a=Date.UTC(t.year,e.getUTCMonth(),e.getUTCDate());let o=j(n,a);if(o>52)a>=O(t.nextYear())&&(o=1);else if(o<1){const e=O(t.previousYear());o=j(e,a)}r=Math.floor(o);break}case"w":{const t=_(e.getUTCFullYear(),e.getUTCMonth()),n=O(t),a=Date.UTC(t.year,t.month,e.getUTCDate());let o=j(n,a);if(o>4)a>=O(t.nextMonth())&&(o=1);else if(o<1){const e=O(t.previousMonth());o=j(e,a)}r=Math.floor(o);break}case"X":{const t=_(e.getUTCFullYear(),0),n=O(t),a=O(t.nextYear()),o=e.getTime();r=o<n?t.year-1:o>=a?t.year+1:t.year;break}case"x":{const t=_(e.getUTCFullYear(),e.getUTCMonth()),n=O(t),a=t.nextMonth(),o=O(a),i=e.getTime();r=i<n?t.previousMonth().month+1:i>=o?a.month+1:t.month+1;break}case"H":r=e.getUTCHours();break;case"h":r=e.getUTCHours(),r%=12,0===r&&(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};let F=null;function C(e,t,r){var n=0,a=0;if(void 0!==r){const e=parseInt(r);n=Math.floor(e/100),a=e%100}var o=function(e,t){var r=T(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=S[r-1];else{if("F"!==t.component)throw{code:"D3133",value:t.component};r=E[r]}t.names===g.UPPER?r=r.toUpperCase():t.names===g.LOWER&&(r=r.toLowerCase()),t.width&&r.length>t.width.max&&(r=r.substring(0,t.width.max))}else r=m(r,t.integerFormat);else if("f"===t.component)r=m(r,t.integerFormat);else if("Z"===t.component||"z"===t.component){const e=100*n+a;if(t.integerFormat.regular)r=m(e,t.integerFormat);else{const o=t.integerFormat.mandatoryDigits;if(1===o||2===o)r=m(n,t.integerFormat),0!==a&&(r+=":"+v(a,"00"));else{if(3!==o&&4!==o)throw{code:"D3134",value:o};r=m(e,t.integerFormat)}}e>=0&&(r="+"+r),"z"===t.component&&(r="GMT"+r),0===e&&"t"===t.presentation2&&(r="Z")}return r};let i;void 0===t?(null===F&&(F=k("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),i=F):i=k(t);const s=new Date(e+60*(60*n+a)*1e3);let u="";return i.parts.forEach((function(e){"literal"===e.type?u+=e.value:u+=o(s,e)})),u}function D(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){let 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));let n=0,a=0;return 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))),60*n+a}}else if(e.integerFormat)e.integerFormat.n=e.n,t=D(e.integerFormat);else{t.regex="[a-zA-Z]+";var r={};if("M"===e.component||"x"===e.component)S.forEach((function(t,n){e.width&&e.width.max?r[t.substring(0,e.width.max)]=n+1:r[t]=n+1}));else if("F"===e.component)E.forEach((function(t,n){n>0&&(e.width&&e.width.max?r[t.substring(0,e.width.max)]=n:r[t]=n)}));else{if("P"!==e.component)throw{code:"D3133",value:e.component};r={am:0,AM:0,pm:1,PM:1}}t.parse=function(e){return r[e]}}return t.component=e.component,t}));else{t.type="integer";const r=e.case===g.UPPER;let n;switch(n=e.n&&e.n>0?0===e.optionalDigits?`{${e.n}}`:`{${e.n-e.optionalDigits},${e.n}}`:"+",e.primary){case y.LETTERS:t.regex=r?"[A-Z]+":"[a-z]+",t.parse=function(e){return d(e,r?"A":"a")};break;case y.ROMAN:t.regex=r?"[MDCLXVI]+":"[mdclxvi]+",t.parse=function(e){return p(r?e:e.toUpperCase())};break;case y.WORDS:t.regex="(?:"+Object.keys(s).concat("and","[\\-, ]").join("|")+")+",t.parse=function(e){return u(e.toLowerCase())};break;case y.DECIMAL:t.regex=`[0-9]${n}`,e.ordinal&&(t.regex+="(?:th|st|nd|rd)"),t.parse=function(t){let r=t;return e.ordinal&&(r=t.substring(0,t.length-2)),e.regular?r=r.split(",").join(""):e.groupingSeparators.forEach((e=>{r=r.split(e.character).join("")})),48!==e.zeroCode&&(r=r.split("").map((t=>String.fromCodePoint(t.codePointAt(0)-e.zeroCode+48))).join("")),parseInt(r)};break;case y.SEQUENCE:throw{code:"D3130",value:e.token}}}return t}function P(e,t){if(void 0!==e)return D(w(t)).parse(e)}function I(e,t){const r=D(k(t)),n="^"+r.parts.map((e=>"("+e.regex+")")).join("")+"$";var a=new RegExp(n,"i").exec(e);if(null!==a){const e=161,t=130,n=84,i=72,s=23,u=47,c={};for(let e=1;e<a.length;e++){const t=r.parts[e-1];t.parse&&(c[t.component]=t.parse(a[e]))}if(0===Object.getOwnPropertyNames(c).length)return;let l=0;const f=e=>{l<<=1,l+=e?1:0},p=e=>!(~e&l||!(e&l));"YXMxWwdD".split("").forEach((e=>f(c[e])));const h=!p(e)&&p(t),d=p(n),v=!d&&p(i);l=0,"PHhmsf".split("").forEach((e=>f(c[e])));const y=!p(s)&&p(u),g=(h?"YD":d?"XxwF":v?"XWF":"YMD")+(y?"Phmsf":"Hmsf"),m=this.environment.timestamp;let b=!1,w=!1;if(g.split("").forEach((e=>{if(void 0===c[e])b?(c[e]=-1!=="MDd".indexOf(e)?1:0,w=!0):c[e]=T(m,e);else if(b=!0,w)throw{code:"D3136"}})),c.M>0?c.M-=1:c.M=0,h){const e=Date.UTC(c.Y,0),t=1e3*(c.d-1)*60*60*24,r=new Date(e+t);c.M=r.getUTCMonth(),c.D=r.getUTCDate()}if(d)throw{code:"D3136"};if(v)throw{code:"D3136"};y&&(c.H=12===c.h?0:c.h,1===c.P&&(c.H+=12));var o=Date.UTC(c.Y,c.M,c.D,c.H,c.m,c.s,c.f);return(c.Z||c.z)&&(o-=60*(c.Z||c.z)*1e3),o}}var N=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)?$");function $(e,t){if(void 0!==e){if(void 0===t){if(!N.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}return I.call(this,e,t)}}function M(e,t,r){if(void 0!==e)return C.call(this,e,t,r)}return{formatInteger:v,parseInteger:P,fromMillis:M,toMillis:$}}();t.exports=a},{"./utils":6}],2:[function(e,t,n){(function(r){(function(){var n=e("./utils");const a=(()=>{"use strict";var e=n.isNumeric,t=n.isArrayOfStrings,a=n.isArrayOfNumbers,o=n.createSequence,i=n.isSequence,s=n.isFunction,u=n.isLambda,c=n.isIterable,l=n.getFunctionArity,f=n.isDeepEqual,p=n.stringToArray;function h(e){if(void 0!==e){var t=0;return e.forEach((function(e){t+=e})),t}}function d(e){return void 0===e?0:e.length}function v(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)}function y(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)}function g(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),t/e.length}}function m(t,r=!1){if(void 0!==t){var n;if("string"==typeof t)n=t;else if(s(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&&s(r)?"":r}),a)}return n}}function b(e,t,r){if(void 0!==e){var n=p(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 w(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}}function x(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}}function k(e){if(void 0!==e)return e.toLowerCase()}function E(e){if(void 0!==e)return e.toUpperCase()}function S(e){if(void 0!==e)return p(e).length}function A(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}}function O(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" ");var a=Math.abs(t)-S(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}}function*_(e,t){var r=e.apply(this,[t]);if(c(r)&&(r=yield*r),r&&"number"!=typeof r.start&&"number"!==r.end&&!Array.isArray(r.groups)&&!s(r.next))throw{code:"T1010",stack:(new Error).stack};return r}function*j(e,t){if(void 0!==e)return"string"==typeof t?-1!==e.indexOf(t):void 0!==(yield*_(t,e))}function*T(e,t,r){if(void 0!==e){if(r<0)throw{stack:(new Error).stack,value:r,code:"D3040",index:3};var n=o();if(void 0===r||r>0){var a=0,i=yield*_(t,e);if(void 0!==i)for(;void 0!==i&&(void 0===r||a<r);)n.push({match:i.match,index:i.start,groups:i.groups}),i=yield*_(i.next),a++}return n}}function*F(e,t,r,n){if(void 0!==e){var a,o=this;if(""===t)throw{code:"D3010",stack:(new Error).stack,value:t,index:2};if(n<0)throw{code:"D3011",stack:(new Error).stack,value:n,index:4};a="string"==typeof r?function(e){for(var t="",n=0,a=r.indexOf("$",n);-1!==a&&n<r.length;){t+=r.substring(n,a),n=a+1;var o=r.charAt(n);if("$"===o)t+="$",n++;else if("0"===o)t+=e.match,n++;else{var i;if(i=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,a=parseInt(r.substring(n,n+i),10),i>1&&a>e.groups.length&&(a=parseInt(r.substring(n,n+i-1),10)),isNaN(a))t+="$";else{if(e.groups.length>0){var s=e.groups[a-1];void 0!==s&&(t+=s)}n+=a.toString().length}}a=r.indexOf("$",n)}return t+=r.substring(n)}:r;var i="",s=0;if(void 0===n||n>0){var u=0;if("string"==typeof t){for(var l=e.indexOf(t,s);-1!==l&&(void 0===n||u<n);)i+=e.substring(s,l),i+=r,s=l+t.length,u++,l=e.indexOf(t,s);i+=e.substring(s)}else{var f=yield*_(t,e);if(void 0!==f){for(;void 0!==f&&(void 0===n||u<n);){i+=e.substring(s,f.start);var p=a.apply(o,[f]);if(c(p)&&(p=yield*p),"string"!=typeof p)throw{code:"D3012",stack:(new Error).stack,value:p};i+=p,s=f.start+f.match.length,u++,f=yield*_(f.next)}i+=e.substring(s)}else i=e}}else i=e;return i}}function C(e){if(void 0!==e){var t="undefined"!=typeof window?window.btoa:function(e){return new r.Buffer.from(e,"binary").toString("base64")};return t(e)}}function D(e){if(void 0!==e){var t="undefined"!=typeof window?window.atob:function(e){return new r.Buffer.from(e,"base64").toString("binary")};return t(e)}}function P(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}}function I(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}}function N(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}}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}}function*M(e,t,r){if(void 0!==e){if(r<0)throw{code:"D3020",stack:(new Error).stack,value:r,index:3};var n=[];if(void 0===r||r>0)if("string"==typeof t)n=e.split(t,r);else{var a=0,o=yield*_(t,e);if(void 0!==o){for(var i=0;void 0!==o&&(void 0===r||a<r);)n.push(e.substring(i,o.start)),i=o.end,o=yield*_(o.next),a++;(void 0===r||a<r)&&n.push(e.substring(i))}else n.push(e)}return n}}function L(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)}function R(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=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),l=e.indexOf(n["exponent-separator"],i.length);-1===l||l>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,l),r=c.substring(l+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}},l=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 l=e.integerPart.indexOf(n.digit);-1!==l&&e.integerPart.substring(0,l).split("").filter((function(e){return a.indexOf(e)>-1})).length>0&&(t="D3090"),-1!==(l=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(l).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}},f=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(""),l=c.filter((function(e){return-1!==a.indexOf(e)})).length,f=c.filter((function(e){return-1!==a.indexOf(e)||e===n.digit})).length,p="string"==typeof e.exponentPart;0===s&&0===f&&(p?(l=1,f=1):s=1),p&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===l&&(l=1);var h=0;return p&&(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:l,maximumFactionalPartSize:f,minimumExponentSize:h,suffix:e.suffix,picture:e.subpicture}},p=u.map(c);p.forEach(l);var h,d,v,y,g=p.map(f),m=n["minus-sign"],b=n["zero-digit"],w=n["decimal-separator"],x=n["grouping-separator"];if(1===g.length&&(g.push(JSON.parse(JSON.stringify(g[0]))),g[1].prefix=m+g[1].prefix),d=-1!==(h=e>=0?g[0]:g[1]).picture.indexOf(n.percent)?100*e:-1!==h.picture.indexOf(n["per-mille"])?1e3*e:e,0===h.minimumExponentSize)v=d;else{var k=Math.pow(10,h.scalingFactor),E=Math.pow(10,h.scalingFactor-1);for(v=d,y=0;v<E;)v*=10,y-=1;for(;v>k;)v/=10,y+=1}var S=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},A=S(W(v,h.maximumFactionalPartSize),h.maximumFactionalPartSize),O=A.indexOf(".");for(-1===O?A+=w:A=A.replace(".",w);A.charAt(0)===b;)A=A.substring(1);for(;A.charAt(A.length-1)===b;)A=A.substring(0,A.length-1);O=A.indexOf(w);var _=h.minimumIntegerPartSize-O,j=h.minimumFactionalPartSize-(A.length-O-1);if(A=(_>0?new Array(_+1).join(b):"")+A,A+=j>0?new Array(j+1).join(b):"",O=A.indexOf(w),h.regularGrouping>0)for(var T=Math.floor((O-1)/h.regularGrouping),F=1;F<=T;F++)A=[A.slice(0,O-F*h.regularGrouping),x,A.slice(O-F*h.regularGrouping)].join("");else h.integerPartGroupingPositions.forEach((function(e){A=[A.slice(0,O-e),x,A.slice(O-e)].join(""),O++}));if(O=A.indexOf(w),h.fractionalPartGroupingPositions.forEach((function(e){A=[A.slice(0,e+O+1),x,A.slice(e+O+1)].join("")})),O=A.indexOf(w),-1!==h.picture.indexOf(w)&&O!==A.length-1||(A=A.substring(0,A.length-1)),void 0!==y){var C=S(y,0);(_=h.minimumExponentSize-C.length)>0&&(C=new Array(_+1).join(b)+C),A=A+n["exponent-separator"]+(y<0?m:"")+C}return A=h.prefix+A+h.suffix}}function z(e,t){if(void 0!==e){if(e=W(e),(t=void 0===t?10:W(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}}function U(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(!0===e)t=1;else{if(!1!==e)throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=0}return t}}function q(e){if(void 0!==e)return Math.abs(e)}function B(e){if(void 0!==e)return Math.floor(e)}function G(e){if(void 0!==e)return Math.ceil(e)}function W(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&&(n=r.toString().split("e"),r=+(n[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function Y(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}}function H(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}}function J(){return Math.random()}function V(t){if(void 0!==t){var r=!1;return Array.isArray(t)?1===t.length?r=V(t[0]):t.length>1&&(r=t.filter((function(e){return V(e)})).length>0):"string"==typeof t?t.length>0&&(r=!0):e(t)?0!==t&&(r=!0):null!==t&&"object"==typeof t?Object.keys(t).length>0&&(r=!0):"boolean"==typeof t&&!0===t&&(r=!0),r}}function Z(e){if(void 0!==e)return!V(e)}function Q(e,t,r,n){var a=[t],o=l(e);return o>=2&&a.push(r),o>=3&&a.push(n),a}function*X(e,t){if(void 0!==e){for(var r=o(),n=0;n<e.length;n++){var a=Q(t,e[n],n,e),i=yield*t.apply(this,a);void 0!==i&&r.push(i)}return r}}function*K(e,t){if(void 0!==e){for(var r=o(),n=0;n<e.length;n++){var a=e[n],i=Q(t,a,n,e);V(yield*t.apply(this,i))&&r.push(a)}return r}}function*ee(e,t){if(void 0!==e){for(var r,n=!1,a=0;a<e.length;a++){var o=e[a],i=!0;if(void 0!==t){var s=Q(t,o,a,e);i=V(yield*t.apply(this,s))}if(i){if(n)throw{stack:(new Error).stack,code:"D3138",index:a};r=o,n=!0}}if(!n)throw{stack:(new Error).stack,code:"D3139"};return r}}function te(){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((e=>e[n]));e.push(a)}return e}function*re(e,t,r){if(void 0!==e){var n,a,o=l(t);if(o<2)throw{stack:(new Error).stack,code:"D3050",index:1};for(void 0===r&&e.length>0?(n=e[0],a=1):(n=r,a=0);a<e.length;){var i=[n,e[a]];o>=3&&i.push(a),o>=4&&i.push(e),n=yield*t.apply(this,i),a++}return n}}function ne(e){var t=o();if(Array.isArray(e)){var r={};e.forEach((function(e){ne(e).forEach((function(e){r[e]=!0}))})),t=ne(r)}else null===e||"object"!=typeof e||u(e)||Object.keys(e).forEach((e=>t.push(e)));return t}function ae(e,t){var r;if(Array.isArray(e)){r=o();for(var n=0;n<e.length;n++){var a=ae(e[n],t);void 0!==a&&(Array.isArray(a)?a.forEach((e=>r.push(e))):r.push(a))}}else null!==e&&"object"==typeof e&&(r=e[t]);return r}function oe(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=o(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function ie(e){return void 0!==e}function se(e){var t=o();if(Array.isArray(e))e.forEach((function(e){t=oe(t,se(e))}));else if(null===e||"object"!=typeof e||u(e))t=e;else for(var r in e){var n={};n[r]=e[r],t.push(n)}return t}function ue(e){if(void 0!==e){var t={};return e.forEach((function(e){for(var r in e)t[r]=e[r]})),t}}function ce(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}}function*le(e,t){var r=o();for(var n in e){var a=Q(t,e[n],n,e),i=yield*t.apply(this,a);void 0!==i&&r.push(i)}return r}function fe(e){throw{code:"D3137",stack:(new Error).stack,message:e||"$error() function evaluated"}}function pe(e,t){if(!e)throw{code:"D3141",stack:(new Error).stack,message:t||"$assert() statement failed"}}function he(t){if(void 0!==t)return null===t?"null":e(t)?"number":"string"==typeof t?"string":"boolean"==typeof t?"boolean":Array.isArray(t)?"array":s(t)?"function":"object"}function*de(e,r){if(void 0!==e){if(e.length<=1)return e;var n;if(void 0===r){if(!a(e)&&!t(e))throw{stack:(new Error).stack,code:"D3070",index:1};n=function*(e,t){return e>t}}else n=r;var o=function*(e,t){var r=function*(e,t,a){0===t.length?Array.prototype.push.apply(e,a):0===a.length?Array.prototype.push.apply(e,t):(yield*n(t[0],a[0]))?(e.push(a[0]),yield*r(e,t,a.slice(1))):(e.push(t[0]),yield*r(e,t.slice(1),a))},a=[];return yield*r(a,e,t),a},i=function*(e){if(!Array.isArray(e)||e.length<=1)return e;var t=Math.floor(e.length/2),r=e.slice(0,t),n=e.slice(t);return r=yield*i(r),n=yield*i(n),yield*o(r,n)};return yield*i(e)}}function ve(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}}function ye(e){if(void 0!==e){if(!Array.isArray(e)||e.length<=1)return e;for(var t=i(e)?o():[],r=0;r<e.length;r++){for(var n=e[r],a=!1,s=0;s<t.length;s++)if(f(n,t[s])){a=!0;break}a||t.push(n)}return t}}function*ge(e,t){var r={};for(var n in e){var a=e[n],o=Q(t,a,n,e);V(yield*t.apply(this,o))&&(r[n]=a)}return 0===Object.keys(r).length&&(r=void 0),r}return{sum:h,count:d,max:v,min:y,average:g,string:m,substring:b,substringBefore:w,substringAfter:x,lowercase:k,uppercase:E,length:S,trim:A,pad:O,match:T,contains:j,replace:F,split:M,join:L,formatNumber:R,formatBase:z,number:U,floor:B,ceil:G,round:W,abs:q,sqrt:Y,power:H,random:J,boolean:V,not:Z,map:X,zip:te,filter:K,single:ee,foldLeft:re,sift:ge,keys:ne,lookup:ae,append:oe,exists:ie,spread:se,merge:ue,reverse:ce,each:le,error:fe,assert:pe,type:he,sort:de,shuffle:ve,distinct:ye,base64encode:C,base64decode:D,encodeUrlComponent:P,encodeUrl:I,decodeUrlComponent:N,decodeUrl:$}})();t.exports=a}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(e,t,r){var n=e("./datetime"),a=e("./functions"),o=e("./utils"),i=e("./parser"),s=e("./signature"),u=function(){"use strict";var e=o.isNumeric,t=o.isArrayOfStrings,r=o.isArrayOfNumbers,u=o.createSequence,c=o.isSequence,l=o.isFunction,f=o.isLambda,p=o.isIterable,h=o.getFunctionArity,d=o.isDeepEqual,v=le(null);function*y(e,t,r){var n,a=r.lookup("__evaluate_entry");switch(a&&a(e,t,r),e.type){case"path":n=yield*g(e,t,r);break;case"binary":n=yield*E(e,t,r);break;case"unary":n=yield*S(e,t,r);break;case"name":n=A(e,t,r);break;case"string":case"number":case"value":n=O(e,t,r);break;case"wildcard":n=_(e,t,r);break;case"descendant":n=T(e,t,r);break;case"parent":n=r.lookup(e.slot.label);break;case"condition":n=yield*q(e,t,r);break;case"block":n=yield*B(e,t,r);break;case"bind":n=yield*U(e,t,r);break;case"regex":n=G(e,t,r);break;case"function":n=yield*Z(e,t,r);break;case"variable":n=W(e,t,r);break;case"lambda":n=K(e,t,r);break;case"partial":n=yield*ee(e,t,r);break;case"apply":n=yield*V(e,t,r);break;case"transform":n=H(e,t,r)}if(!r.async||null!=n&&"function"==typeof n.then||(n=Promise.resolve(n)),r.async&&"function"==typeof n.then&&e.nextFunction&&"function"==typeof n[e.nextFunction]||(n=yield n),Object.prototype.hasOwnProperty.call(e,"predicate"))for(var o=0;o<e.predicate.length;o++)n=yield*k(e.predicate[o].expr,n,r);"path"!==e.type&&Object.prototype.hasOwnProperty.call(e,"group")&&(n=yield*L(e.group,n,r));var i=r.lookup("__evaluate_exit");return i&&i(e,t,r,n),n&&c(n)&&!n.tupleStream&&(e.keepArray&&(n.keepSingleton=!0),0===n.length?n=void 0:1===n.length&&(n=n.keepSingleton?n:n[0])),n}function*g(e,t,r){var n,a;n=Array.isArray(t)&&"variable"!==e.steps[0].type?t:u(t);for(var o=!1,i=void 0,s=0;s<e.steps.length;s++){var c=e.steps[s];if(c.tuple&&(o=!0),0===s&&c.consarray?a=yield*y(c,n,r):o?i=yield*x(c,n,i,r):a=yield*b(c,n,r,s===e.steps.length-1),!o&&(void 0===a||0===a.length))break;void 0===c.focus&&(n=a)}if(o)if(e.tuple)a=i;else for(a=u(),s=0;s<i.length;s++)a.push(i[s]["@"]);return e.keepSingletonArray&&(Array.isArray(a)&&a.cons&&!a.sequence&&(a=u(a)),a.keepSingleton=!0),e.hasOwnProperty("group")&&(a=yield*L(e.group,o?i:a,r)),a}function m(e,t){var r=le(e);for(const e in t)r.bind(e,t[e]);return r}function*b(e,t,r,n){var a;if("sort"===e.type)return a=yield*Y(e,t,r),e.stages&&(a=yield*w(e.stages,a,r)),a;a=u();for(var o=0;o<t.length;o++){var i=yield*y(e,t[o],r);if(e.stages)for(var s=0;s<e.stages.length;s++)i=yield*k(e.stages[s].expr,i,r);void 0!==i&&a.push(i)}var l=u();return n&&1===a.length&&Array.isArray(a[0])&&!c(a[0])?l=a[0]:a.forEach((function(e){!Array.isArray(e)||e.cons?l.push(e):e.forEach((e=>l.push(e)))})),l}function*w(e,t,r){for(var n=t,a=0;a<e.length;a++){var o=e[a];switch(o.type){case"filter":n=yield*k(o.expr,n,r);break;case"index":for(var i=0;i<n.length;i++)n[i][o.value]=i}}return n}function*x(e,t,r,n){var a;if("sort"===e.type){if(r)a=yield*Y(e,r,n);else{var o=yield*Y(e,t,n);(a=u()).tupleStream=!0;for(var i=0;i<o.length;i++){var s={"@":o[i]};s[e.index]=i,a.push(s)}}return e.stages&&(a=yield*w(e.stages,a,n)),a}(a=u()).tupleStream=!0;var c=n;void 0===r&&(r=t.map((e=>({"@":e}))));for(var l=0;l<r.length;l++){c=m(n,r[l]);var f=yield*y(e,r[l]["@"],c);if(void 0!==f){Array.isArray(f)||(f=[f]);for(var p=0;p<f.length;p++)s={},Object.assign(s,r[l]),f.tupleStream?Object.assign(s,f[p]):(e.focus?(s[e.focus]=f[p],s["@"]=r[l]["@"]):s["@"]=f[p],e.index&&(s[e.index]=p),e.ancestor&&(s[e.ancestor.label]=r[l]["@"])),a.push(s)}}return e.stages&&(a=yield*w(e.stages,a,n)),a}function*k(t,n,o){var i=u();if(n&&n.tupleStream&&(i.tupleStream=!0),Array.isArray(n)||(n=u(n)),"number"===t.type){var s=Math.floor(t.value);s<0&&(s=n.length+s),void 0!==(c=n[s])&&(Array.isArray(c)?i=c:i.push(c))}else for(s=0;s<n.length;s++){var c,l=c=n[s],f=o;n.tupleStream&&(l=c["@"],f=m(o,c));var p=yield*y(t,l,f);e(p)&&(p=[p]),r(p)?p.forEach((function(e){var t=Math.floor(e);t<0&&(t=n.length+t),t===s&&i.push(c)})):a.boolean(p)&&i.push(c)}return i}function*E(e,t,r){var n,a=yield*y(e.lhs,t,r),o=e.value,i=function*(){return yield*y(e.rhs,t,r)};if("and"===o||"or"===o)try{return yield*N(a,i,o)}catch(t){throw t.position=e.position,t.token=o,t}var s=yield*i();try{switch(o){case"+":case"-":case"*":case"/":case"%":n=C(a,s,o);break;case"=":case"!=":n=D(a,s,o);break;case"<":case"<=":case">":case">=":n=P(a,s,o);break;case"&":n=M(a,s);break;case"..":n=z(a,s);break;case"in":n=I(a,s)}}catch(t){throw t.position=e.position,t.token=o,t}return n}function*S(t,r,n){var o;switch(t.value){case"-":if(void 0===(o=yield*y(t.expression,r,n)))o=void 0;else{if(!e(o))throw{code:"D1002",stack:(new Error).stack,position:t.position,token:t.value,value:o};o=-o}break;case"[":o=[];for(var i=0;i<t.expressions.length;i++){var s=t.expressions[i],u=yield*y(s,r,n);void 0!==u&&("["===s.value?o.push(u):o=a.append(o,u))}t.consarray&&Object.defineProperty(o,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":o=yield*L(t,r,n)}return o}function A(e,t,r){return a.lookup(t,e.value)}function O(e){return e.value}function _(e,t){var r=u();return Array.isArray(t)&&t.outerWrapper&&t.length>0&&(t=t[0]),null!==t&&"object"==typeof t&&Object.keys(t).forEach((function(e){var n=t[e];Array.isArray(n)?(n=j(n),r=a.append(r,n)):r.push(n)})),r}function j(e,t){return void 0===t&&(t=[]),Array.isArray(e)?e.forEach((function(e){j(e,t)})):t.push(e),t}function T(e,t){var r,n=u();return void 0!==t&&(F(t,n),r=1===n.length?n[0]:n),r}function F(e,t){Array.isArray(e)||t.push(e),Array.isArray(e)?e.forEach((function(e){F(e,t)})):null!==e&&"object"==typeof e&&Object.keys(e).forEach((function(r){F(e[r],t)}))}function C(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 D(e,t,r){var n;if(void 0===e||void 0===t)return!1;switch(r){case"=":n=d(e,t);break;case"!=":n=!d(e,t)}return n}function P(e,t,r){var n,a=typeof e,o=typeof 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 I(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*N(e,t,r){var n,a=$(e);switch(r){case"and":n=a&&$(yield*t());break;case"or":n=a||$(yield*t())}return n}function $(e){var t=a.boolean(e);return void 0!==t&&t}function M(e,t){var r="",n="";return void 0!==e&&(r=a.string(e)),void 0!==t&&(n=a.string(t)),r.concat(n)}function*L(e,t,r){var n={},o={},i=!(!t||!t.tupleStream);Array.isArray(t)||(t=u(t)),0===t.length&&t.push(void 0);for(var s=0;s<t.length;s++)for(var c=t[s],l=i?m(r,c):r,f=0;f<e.lhs.length;f++){var p=e.lhs[f],h=yield*y(p[0],i?c["@"]:c,l);if("string"!=typeof h&&void 0!==h)throw{code:"T1003",stack:(new Error).stack,position:e.position,value:h};if(void 0!==h){var d={data:c,exprIndex:f};if(o.hasOwnProperty(h)){if(o[h].exprIndex!==f)throw{code:"D1009",stack:(new Error).stack,position:e.position,value:h};o[h].data=a.append(o[h].data,c)}else o[h]=d}}for(h in o){var v=(d=o[h]).data;if(l=r,i){var g=R(d.data);v=g["@"],delete g["@"],l=m(r,g)}var b=yield*y(e.lhs[d.exprIndex][1],v,l);void 0!==b&&(n[h]=b)}return n}function R(e){if(!Array.isArray(e))return e;var t={};Object.assign(t,e[0]);for(var r=1;r<e.length;r++)for(const n in e[r])t[n]=a.append(t[n],e[r][n]);return t}function z(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*U(e,t,r){var n=yield*y(e.rhs,t,r);return r.bind(e.lhs.value,n),n}function*q(e,t,r){var n,o=yield*y(e.condition,t,r);return a.boolean(o)?n=yield*y(e.then,t,r):void 0!==e.else&&(n=yield*y(e.else,t,r)),n}function*B(e,t,r){for(var n,a=le(r),o=0;o<e.expressions.length;o++)n=yield*y(e.expressions[o],t,a);return n}function G(e){var t=new he.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 W(e,t,r){return""===e.value?t&&t.outerWrapper?t[0]:t:r.lookup(e.value)}function*Y(e,t,r){var n=t,o=!!t.tupleStream,i=function*(t,n){for(var a=0,i=0;0===a&&i<e.terms.length;i++){var s=e.terms[i],u=t,c=r;o&&(u=t["@"],c=m(r,t));var l=yield*y(s.expression,u,c);u=n,c=r,o&&(u=n["@"],c=m(r,n));var f=yield*y(s.expression,u,c),p=typeof l,h=typeof f;if("undefined"!==p)if("undefined"!==h){if("string"!==p&&"number"!==p||"string"!==h&&"number"!==h)throw{code:"T2008",stack:(new Error).stack,position:e.position,value:"string"!==p&&"number"!==p?l:f};if(p!==h)throw{code:"T2007",stack:(new Error).stack,position:e.position,value:l,value2:f};l!==f&&(a=l<f?-1:1,!0===s.descending&&(a=-a))}else a=-1;else a="undefined"===h?0:1}return 1===a},s={environment:r,input:t};return yield*a.sort.apply(s,[n,i])}function H(e,r,n){return se((function*(r){if(void 0!==r){var a=n.lookup("clone");if(!l(a))throw{code:"T2013",stack:(new Error).stack,position:e.position};var o=yield*Q(a,[r],null,n),i=yield*y(e.pattern,o,n);if(void 0!==i){Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s++){var u=i[s],c=yield*y(e.update,u,n),f=typeof c;if("undefined"!==f){if("object"!==f||null===c||Array.isArray(c))throw{code:"T2011",stack:(new Error).stack,position:e.update.position,value:c};for(var p in c)u[p]=c[p]}if(void 0!==e.delete){var h=yield*y(e.delete,u,n);if(void 0!==h){var d=h;if(Array.isArray(h)||(h=[h]),!t(h))throw{code:"T2012",stack:(new Error).stack,position:e.delete.position,value:d};for(var v=0;v<h.length;v++)"object"==typeof u&&null!==u&&delete u[h[v]]}}}}return o}}),"<(oa):o>")}var J=i("function($f, $g) { function($x){ $g($f($x)) } }");function*V(e,t,r){var n,a=yield*y(e.lhs,t,r);if("function"===e.rhs.type)n=yield*Z(e.rhs,t,r,{context:a});else{var o=yield*y(e.rhs,t,r);if(!l(o))throw{code:"T2006",stack:(new Error).stack,position:e.position,value:o};if(l(a)){var i=yield*y(J,null,r);n=yield*Q(i,[a,o],null,r)}else n=yield*Q(o,[a],null,r)}return n}function*Z(e,t,r,n){var a,o=yield*y(e.procedure,t,r);if(void 0===o&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1005",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};var i=[];void 0!==n&&i.push(n.context);for(var s=0;s<e.arguments.length;s++){const n=yield*y(e.arguments[s],t,r);if(l(n)){const e=function*(...e){return yield*Q(n,e,null,r)};e.arity=h(n),i.push(e)}else i.push(n)}var u="path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value;try{"object"==typeof o&&(o.token=u,o.position=e.position),a=yield*Q(o,i,t,r)}catch(t){throw t.position||(t.position=e.position),t.token||(t.token=u),t}return a}function*Q(e,t,r,n){var a;for(a=yield*X(e,t,r,n);f(a)&&!0===a.thunk;){var o=yield*y(a.body.procedure,a.input,a.environment);"variable"===a.body.procedure.type&&(o.token=a.body.procedure.value),o.position=a.body.procedure.position;for(var i=[],s=0;s<a.body.arguments.length;s++)i.push(yield*y(a.body.arguments[s],a.input,a.environment));a=yield*X(o,i,r,n)}return a}function*X(e,t,r,n){var a;try{var o=t;if(e&&(o=te(e.signature,t,r)),f(e))a=yield*re(e,o);else if(e&&!0===e._jsonata_function){var i={environment:n,input:r};a=e.implementation.apply(i,o),p(a)&&(a=yield*a)}else{if("function"!=typeof e)throw{code:"T1006",stack:(new Error).stack};a=e.apply(r,o),p(a)&&(a=yield*a)}}catch(t){throw e&&(void 0===t.token&&void 0!==e.token&&(t.token=e.token),t.position=e.position),t}return a}function K(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*(e,r){return yield*Q(n,r,t,e.environment)},n}function*ee(e,t,r){for(var n,a=[],o=0;o<e.arguments.length;o++){var i=e.arguments[o];"operator"===i.type&&"?"===i.value?a.push(i):a.push(yield*y(i,t,r))}var s=yield*y(e.procedure,t,r);if(void 0===s&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1007",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};if(f(s))n=ne(s,a);else if(s&&!0===s._jsonata_function)n=ae(s.implementation,a);else{if("function"!=typeof s)throw{code:"T1008",stack:(new Error).stack,position:e.position,token:"path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value};n=ae(s,a)}return n}function te(e,t,r){return void 0===e?t:e.validate(t,r)}function*re(e,t){var r=le(e.environment);return e.arguments.forEach((function(e,n){r.bind(e.value,t[n])})),"function"==typeof e.body?yield*oe(e.body,r):yield*y(e.body,e.input,r)}function ne(e,t){var r=le(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 ae(e,t){var r=ie(e),n="function("+(r=r.map((function(e){return"$"+e.trim()}))).join(", ")+"){ _ }",a=i(n);return a.body=e,ne(a,t)}function*oe(e,t){var r=ie(e).map((function(e){return t.lookup(e.trim())})),n={environment:t},a=e.apply(n,r);return p(a)&&(a=yield*a),a}function ie(e){var t=e.toString();return/\(([^)]*)\)/.exec(t)[1].split(",")}function se(e,t){var r={_jsonata_function:!0,implementation:e};return void 0!==t&&(r.signature=s(t)),r}function*ue(e,t){if(void 0!==e){var r=this.input;void 0!==t&&(r=t,Array.isArray(r)&&!c(r)&&((r=u(r)).outerWrapper=!0));try{var n=i(e,!1)}catch(e){throw pe(e),{stack:(new Error).stack,code:"D3120",value:e.message,error:e}}try{var a=yield*y(n,r,this.environment)}catch(e){throw pe(e),{stack:(new Error).stack,code:"D3121",value:e.message,error:e}}return a}}function ce(e){if(void 0!==e)return JSON.parse(a.string(e))}function le(e){var t={};return{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,global:e?e.global:{ancestry:[null]}}}v.bind("sum",se(a.sum,"<a<n>:n>")),v.bind("count",se(a.count,"<a:n>")),v.bind("max",se(a.max,"<a<n>:n>")),v.bind("min",se(a.min,"<a<n>:n>")),v.bind("average",se(a.average,"<a<n>:n>")),v.bind("string",se(a.string,"<x-b?:s>")),v.bind("substring",se(a.substring,"<s-nn?:s>")),v.bind("substringBefore",se(a.substringBefore,"<s-s:s>")),v.bind("substringAfter",se(a.substringAfter,"<s-s:s>")),v.bind("lowercase",se(a.lowercase,"<s-:s>")),v.bind("uppercase",se(a.uppercase,"<s-:s>")),v.bind("length",se(a.length,"<s-:n>")),v.bind("trim",se(a.trim,"<s-:s>")),v.bind("pad",se(a.pad,"<s-ns?:s>")),v.bind("match",se(a.match,"<s-f<s:o>n?:a<o>>")),v.bind("contains",se(a.contains,"<s-(sf):b>")),v.bind("replace",se(a.replace,"<s-(sf)(sf)n?:s>")),v.bind("split",se(a.split,"<s-(sf)n?:a<s>>")),v.bind("join",se(a.join,"<a<s>s?:s>")),v.bind("formatNumber",se(a.formatNumber,"<n-so?:s>")),v.bind("formatBase",se(a.formatBase,"<n-n?:s>")),v.bind("formatInteger",se(n.formatInteger,"<n-s:s>")),v.bind("parseInteger",se(n.parseInteger,"<s-s:n>")),v.bind("number",se(a.number,"<(nsb)-:n>")),v.bind("floor",se(a.floor,"<n-:n>")),v.bind("ceil",se(a.ceil,"<n-:n>")),v.bind("round",se(a.round,"<n-n?:n>")),v.bind("abs",se(a.abs,"<n-:n>")),v.bind("sqrt",se(a.sqrt,"<n-:n>")),v.bind("power",se(a.power,"<n-n:n>")),v.bind("random",se(a.random,"<:n>")),v.bind("boolean",se(a.boolean,"<x-:b>")),v.bind("not",se(a.not,"<x-:b>")),v.bind("map",se(a.map,"<af>")),v.bind("zip",se(a.zip,"<a+>")),v.bind("filter",se(a.filter,"<af>")),v.bind("single",se(a.single,"<af?>")),v.bind("reduce",se(a.foldLeft,"<afj?:j>")),v.bind("sift",se(a.sift,"<o-f?:o>")),v.bind("keys",se(a.keys,"<x-:a<s>>")),v.bind("lookup",se(a.lookup,"<x-s:x>")),v.bind("append",se(a.append,"<xx:a>")),v.bind("exists",se(a.exists,"<x:b>")),v.bind("spread",se(a.spread,"<x-:a<o>>")),v.bind("merge",se(a.merge,"<a<o>:o>")),v.bind("reverse",se(a.reverse,"<a:a>")),v.bind("each",se(a.each,"<o-f:a>")),v.bind("error",se(a.error,"<s?:x>")),v.bind("assert",se(a.assert,"<bs?:x>")),v.bind("type",se(a.type,"<x:s>")),v.bind("sort",se(a.sort,"<af?:a>")),v.bind("shuffle",se(a.shuffle,"<a:a>")),v.bind("distinct",se(a.distinct,"<x:x>")),v.bind("base64encode",se(a.base64encode,"<s-:s>")),v.bind("base64decode",se(a.base64decode,"<s-:s>")),v.bind("encodeUrlComponent",se(a.encodeUrlComponent,"<s-:s>")),v.bind("encodeUrl",se(a.encodeUrl,"<s-:s>")),v.bind("decodeUrlComponent",se(a.decodeUrlComponent,"<s-:s>")),v.bind("decodeUrl",se(a.decodeUrl,"<s-:s>")),v.bind("eval",se(ue,"<sx?:x>")),v.bind("toMillis",se(n.toMillis,"<s-s?:n>")),v.bind("fromMillis",se(n.fromMillis,"<n-s?s?:s>")),v.bind("clone",se(ce,"<(oa)-:o>"));var fe={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}}",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 pe(e){var t=fe[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 he(e,t){var r,a;try{r=i(e,t&&t.recover),a=r.errors,delete r.errors}catch(e){throw pe(e),e}var o=le(v),s=new Date;return o.bind("now",se((function(e,t){return n.fromMillis(s.getTime(),e,t)}),"<s?s?:s>")),o.bind("millis",se((function(){return s.getTime()}),"<:n>")),t&&t.RegexEngine?he.RegexEngine=t.RegexEngine:he.RegexEngine=RegExp,{evaluate:function(e,t,n){if(void 0!==a){var i={code:"S0500",position:0};throw pe(i),i}var l,f,p;if(void 0!==t)for(var h in l=le(o),t)l.bind(h,t[h]);else l=o;if(l.bind("$",e),s=new Date,l.timestamp=s,Array.isArray(e)&&!c(e)&&((e=u(e)).outerWrapper=!0),"function"==typeof n){l.async=!0;var d=function(e){pe(e),n(e,null)},v=function(e){(f=p.next(e)).done?n(null,f.value):f.value.then(v).catch(d)};p=y(r,e,l),(f=p.next()).value.then(v).catch(d)}else try{for(p=y(r,e,l),f=p.next();!f.done;)f=p.next(f.value);return f.value}catch(i){throw pe(i),i}},assign:function(e,t){o.bind(e,t)},registerFunction:function(e,t,r){var n=se(t,r);o.bind(e,n)},ast:function(){return r},errors:function(){return a}}}return he.parser=i,he}();t.exports=u},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(e,t,r){var n=e("./signature");const a=(()=>{"use strict";var e={".":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},t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},r=function(r){var n=0,a=r.length,o=function(e,t){return{type:e,value:t,position:n}},i=function(){for(var e,t,o=n,i=0;n<a;){var s=r.charAt(n);if("/"===s&&"\\"!==r.charAt(n-1)&&0===i){if(""===(e=r.substring(o,n)))throw{code:"S0301",stack:(new Error).stack,position:n};for(n++,s=r.charAt(n),o=n;"i"===s||"m"===s;)n++,s=r.charAt(n);return t=r.substring(o,n)+"g",new RegExp(e,t)}"("!==s&&"["!==s&&"{"!==s||"\\"===r.charAt(n-1)||i++,")"!==s&&"]"!==s&&"}"!==s||"\\"===r.charAt(n-1)||i--,n++}throw{code:"S0302",stack:(new Error).stack,position:n}},s=function(u){if(n>=a)return null;for(var c=r.charAt(n);n<a&&" \t\n\r\v".indexOf(c)>-1;)n++,c=r.charAt(n);if("/"===c&&"*"===r.charAt(n+1)){var l=n;for(n+=2,c=r.charAt(n);"*"!==c||"/"!==r.charAt(n+1);)if(c=r.charAt(++n),n>=a)throw{code:"S0106",stack:(new Error).stack,position:l};return n+=2,c=r.charAt(n),s(u)}if(!0!==u&&"/"===c)return n++,o("regex",i());if("."===c&&"."===r.charAt(n+1))return n+=2,o("operator","..");if(":"===c&&"="===r.charAt(n+1))return n+=2,o("operator",":=");if("!"===c&&"="===r.charAt(n+1))return n+=2,o("operator","!=");if(">"===c&&"="===r.charAt(n+1))return n+=2,o("operator",">=");if("<"===c&&"="===r.charAt(n+1))return n+=2,o("operator","<=");if("*"===c&&"*"===r.charAt(n+1))return n+=2,o("operator","**");if("~"===c&&">"===r.charAt(n+1))return n+=2,o("operator","~>");if(Object.prototype.hasOwnProperty.call(e,c))return n++,o("operator",c);if('"'===c||"'"===c){var f=c;n++;for(var p="";n<a;){if("\\"===(c=r.charAt(n)))if(n++,c=r.charAt(n),Object.prototype.hasOwnProperty.call(t,c))p+=t[c];else{if("u"!==c)throw{code:"S0103",stack:(new Error).stack,position:n,token:c};var h=r.substr(n+1,4);if(!/^[0-9a-fA-F]+$/.test(h))throw{code:"S0104",stack:(new Error).stack,position:n};var d=parseInt(h,16);p+=String.fromCharCode(d),n+=4}else{if(c===f)return n++,o("string",p);p+=c}n++}throw{code:"S0101",stack:(new Error).stack,position:n}}var v,y=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(r.substring(n));if(null!==y){var g=parseFloat(y[0]);if(!isNaN(g)&&isFinite(g))return n+=y[0].length,o("number",g);throw{code:"S0102",stack:(new Error).stack,position:n,token:y[0]}}if("`"===c){n++;var m=r.indexOf("`",n);if(-1!==m)return v=r.substring(n,m),n=m+1,o("name",v);throw n=a,{code:"S0105",stack:(new Error).stack,position:n}}for(var b,w=n;;)if(b=r.charAt(w),w===a||" \t\n\r\v".indexOf(b)>-1||Object.prototype.hasOwnProperty.call(e,b)){if("$"===r.charAt(n))return v=r.substring(n+1,w),n=w,o("variable",v);switch(v=r.substring(n,w),n=w,v){case"or":case"in":case"and":return o("operator",v);case"true":return o("value",!0);case"false":return o("value",!1);case"null":return o("value",null);default:return n===a&&""===v?null:o("name",v)}}else w++};return s};return function(t,a){var o,i,s={},u=[],c=function(){var e=[];"(end)"!==o.id&&e.push({type:o.type,value:o.value,position:o.position});for(var t=i();null!==t;)e.push(t),t=i();return e},l={nud:function(){var e={code:"S0211",token:this.value,position:this.position};if(a)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(l)).id=r.value=e,r.lbp=t,s[e]=r),r},p=function(e){if(a){e.remaining=c(),u.push(e);var t=s["(error)"];return(o=Object.create(t)).error=e,o.type="(error)",o}throw e.stack=(new Error).stack,e},h=function(e,r){if(e&&o.id!==e){var n={code:"(end)"===o.id?"S0203":"S0202",position:o.position,token:o.value,value:e};return p(n)}var a=i(r);if(null===a)return(o=s["(end)"]).position=t.length,o;var u,c=a.value,l=a.type;switch(l){case"name":case"variable":u=s["(name)"];break;case"operator":if(!(u=s[c]))return p({code:"S0204",stack:(new Error).stack,position:a.position,token:c});break;case"string":case"number":case"value":u=s["(literal)"];break;case"regex":l="regex",u=s["(regex)"];break;default:return p({code:"S0205",stack:(new Error).stack,position:a.position,token:c})}return(o=Object.create(u)).value=c,o.type=l,o.position=a.position,o},d=function(e){var t,r=o;for(h(null,!0),t=r.nud();e<o.lbp;)r=o,h(),t=r.led(t);return t},v=function(e){f(e,0).nud=function(){return this}},y=function(t,r,n){var a=r||e[t],o=f(t,a);return o.led=n||function(e){return this.lhs=e,this.rhs=d(a),this.type="binary",this},o},g=function(e,t,r){var n=f(e,t);return n.led=r,n},m=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(".."),y("."),y("+"),y("-"),y("*"),y("/"),y("%"),y("="),y("<"),y(">"),y("!="),y("<="),y(">="),y("&"),y("and"),y("or"),y("in"),v("and"),v("or"),v("in"),m("-"),y("~>"),g("(error)",10,(function(e){return this.lhs=e,this.error=o.error,this.remaining=c(),this.type="error",this})),m("*",(function(){return this.type="wildcard",this})),m("**",(function(){return this.type="descendant",this})),m("%",(function(){return this.type="parent",this})),y("(",e["("],(function(e){if(this.procedure=e,this.type="function",this.arguments=[],")"!==o.id)for(;"operator"===o.type&&"?"===o.id?(this.type="partial",this.arguments.push(o),h("?")):this.arguments.push(d(0)),","===o.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 p({code:"S0208",stack:(new Error).stack,position:e.position,token:e.value,value:t+1})})),this.type="lambda","<"===o.id){for(var t=o.position,r=1,a="<";r>0&&"{"!==o.id&&"(end)"!==o.id;){var i=h();">"===i.id?r--:"<"===i.id&&r++,a+=i.value}h(">");try{this.signature=n(a)}catch(e){return e.position=t+e.offset,p(e)}}h("{"),this.body=d(0),h("}")}return this})),m("(",(function(){for(var e=[];")"!==o.id&&(e.push(d(0)),";"===o.id);)h(";");return h(")",!0),this.type="block",this.expressions=e,this})),m("[",(function(){var e=[];if("]"!==o.id)for(;;){var t=d(0);if(".."===o.id){var r={type:"binary",value:"..",position:o.position,lhs:t};h(".."),r.rhs=d(0),t=r}if(e.push(t),","!==o.id)break;h(",")}return h("]",!0),this.expressions=e,this.type="unary",this})),y("[",e["["],(function(t){if("]"===o.id){for(var r=t;r&&"binary"===r.type&&"["===r.value;)r=r.lhs;return r.keepArray=!0,h("]"),t}return this.lhs=t,this.rhs=d(e["]"]),this.type="binary",h("]",!0),this})),y("^",e["^"],(function(e){h("(");for(var t=[];;){var r={descending:!1};if("<"===o.id?h("<"):">"===o.id&&(r.descending=!0,h(">")),r.expression=d(0),t.push(r),","!==o.id)break;h(",")}return h(")"),this.lhs=e,this.rhs=t,this.type="binary",this}));var b=function(e){var t=[];if("}"!==o.id)for(;;){var r=d(0);h(":");var n=d(0);if(t.push([r,n]),","!==o.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};m("{",b),y("{",e["{"],b),g(":=",e[":="],(function(t){return"variable"!==t.type?p({code:"S0212",stack:(new Error).stack,position:t.position,token:t.value}):(this.lhs=t,this.rhs=d(e[":="]-1),this.type="binary",this)})),y("@",e["@"],(function(t){return this.lhs=t,this.rhs=d(e["@"]),"variable"!==this.rhs.type?p({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)})),y("#",e["#"],(function(t){return this.lhs=t,this.rhs=d(e["#"]),"variable"!==this.rhs.type?p({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)})),y("?",e["?"],(function(e){return this.type="condition",this.condition=e,this.then=d(0),":"===o.id&&(h(":"),this.else=d(0)),this})),m("|",(function(){return this.type="transform",this.pattern=d(0),h("|"),this.update=d(0),","===o.id&&(h(","),this.delete=d(0)),h("|"),this}));var w=function(e){var t;if("function"!==e.type||e.predicate)if("condition"===e.type)e.then=w(e.then),void 0!==e.else&&(e.else=w(e.else)),t=e;else if("block"===e.type){var r=e.expressions.length;r>0&&(e.expressions[r-1]=w(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},x=0,k=0,E=[],S=function(e,t){switch(e.type){case"name":case"wildcard":t.level--,0===t.level&&(void 0===e.ancestor||(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=S(e.expressions[e.expressions.length-1],t));break;case"path":e.tuple=!0;var r=e.steps.length-1;for(t=S(e.steps[r--],t);t.level>0&&r>=0;)t=S(e.steps[r--],t);break;default:throw{code:"S0217",token:e.type,position:e.position}}return t},A=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)}},O=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=S(i,o)}}},_=function(e){var t;switch(e.type){case"binary":switch(e.value){case".":var r=_(e.lhs);t="path"===r.type?r:{type:"path",steps:[r]},"parent"===r.type&&(t.seekingParent=[r.slot]);var n=_(e.rhs);"function"===n.type&&"path"===n.procedure.type&&1===n.procedure.steps.length&&"name"===n.procedure.steps[0].type&&"function"===t.steps[t.steps.length-1].type&&(t.steps[t.steps.length-1].nextFunction=n.procedure.steps[0].value),"path"===n.type?Array.prototype.push.apply(t.steps,n.steps):(void 0!==n.predicate&&(n.stages=n.predicate,delete n.predicate),t.steps.push(n)),t.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"})),t.steps.filter((function(e){return!0===e.keepArray})).length>0&&(t.keepSingletonArray=!0);var o=t.steps[0];"unary"===o.type&&"["===o.value&&(o.consarray=!0);var i=t.steps[t.steps.length-1];"unary"===i.type&&"["===i.value&&(i.consarray=!0),O(t);break;case"[":var s=t=_(e.lhs),c="predicate";if("path"===t.type&&(s=t.steps[t.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 l=_(e.rhs);void 0!==l.seekingParent&&(l.seekingParent.forEach((e=>{1===e.level?S(s,e):e.level--})),A(s,l)),s[c].push({type:"filter",expr:l,position:e.position});break;case"{":if(void 0!==(t=_(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};t.group={lhs:e.rhs.map((function(e){return[_(e[0]),_(e[1])]})),position:e.position};break;case"^":"path"!==(t=_(e.lhs)).type&&(t={type:"path",steps:[t]});var f={type:"sort",position:e.position};f.terms=e.rhs.map((function(e){var t=_(e.expression);return A(f,t),{descending:e.descending,expression:t}})),t.steps.push(f),O(t);break;case":=":(t={type:"bind",value:e.value,position:e.position}).lhs=_(e.lhs),t.rhs=_(e.rhs),A(t,t.rhs);break;case"@":if(t=_(e.lhs),s=t,"path"===t.type&&(s=t.steps[t.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"#":t=_(e.lhs),s=t,"path"===t.type?s=t.steps[t.steps.length-1]:(t={type:"path",steps:[t]},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"~>":(t={type:"apply",value:e.value,position:e.position}).lhs=_(e.lhs),t.rhs=_(e.rhs);break;default:(t={type:e.type,value:e.value,position:e.position}).lhs=_(e.lhs),t.rhs=_(e.rhs),A(t,t.lhs),A(t,t.rhs)}break;case"unary":t={type:e.type,value:e.value,position:e.position},"["===e.value?t.expressions=e.expressions.map((function(e){var r=_(e);return A(t,r),r})):"{"===e.value?t.lhs=e.lhs.map((function(e){var r=_(e[0]);A(t,r);var n=_(e[1]);return A(t,n),[r,n]})):(t.expression=_(e.expression),"-"===e.value&&"number"===t.expression.type?(t=t.expression).value=-t.value:A(t,t.expression));break;case"function":case"partial":(t={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map((function(e){var r=_(e);return A(t,r),r})),t.procedure=_(e.procedure);break;case"lambda":t={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var p=_(e.body);t.body=w(p);break;case"condition":(t={type:e.type,position:e.position}).condition=_(e.condition),A(t,t.condition),t.then=_(e.then),A(t,t.then),void 0!==e.else&&(t.else=_(e.else),A(t,t.else));break;case"transform":(t={type:e.type,position:e.position}).pattern=_(e.pattern),t.update=_(e.update),void 0!==e.delete&&(t.delete=_(e.delete));break;case"block":(t={type:e.type,position:e.position}).expressions=e.expressions.map((function(e){var r=_(e);return A(t,r),(r.consarray||"path"===r.type&&r.steps[0].consarray)&&(t.consarray=!0),r}));break;case"name":t={type:"path",steps:[e]},e.keepArray&&(t.keepSingletonArray=!0);break;case"parent":t={type:"parent",slot:{label:"!"+x++,level:1,index:k++}},E.push(t);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":t=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",t=_(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};t=e}break;case"error":t=e,e.lhs&&(t=_(e.lhs));break;default:var h="S0206";"(end)"===e.id&&(h="S0207");var d={code:h,position:e.position,token:e.value};if(a)return u.push(d),{type:"error",error:d};throw d.stack=(new Error).stack,d}return e.keepArray&&(t.keepArray=!0),t};i=r(t),h();var j=d(0);if("(end)"!==o.id){var T={code:"S0201",position:o.position,token:o.value};p(T)}if("parent"===(j=_(j)).type||void 0!==j.seekingParent)throw{code:"S0217",token:j.type,position:j.position};return u.length>0&&(j.errors=u),j}})();t.exports=a},{"./signature":5}],5:[function(e,t,r){var n=e("./utils");const a=(()=>{"use strict";var e={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function t(t){for(var r=1,a=[],o={},i=o;r<t.length;){var s=t.charAt(r);if(":"===s)break;var u=function(){a.push(o),i=o,o={}},c=function(e,t,r,n){for(var a=1,o=t;o<e.length;)if(o++,(s=e.charAt(o))===n){if(0==--a)break}else s===r&&a++;return o};switch(s){case"s":case"n":case"b":case"l":case"o":o.regex="["+s+"m]",o.type=s,u();break;case"a":o.regex="[asnblfom]",o.type=s,o.array=!0,u();break;case"f":o.regex="f",o.type=s,u();break;case"j":o.regex="[asnblom]",o.type=s,u();break;case"x":o.regex="[asnblfom]",o.type=s,u();break;case"-":i.context=!0,i.contextRegex=new RegExp(i.regex),i.regex+="?";break;case"?":case"+":i.regex+=s;break;case"(":var l=c(t,r,"(",")"),f=t.substring(r+1,l);if(-1!==f.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:f,offset:r};o.regex="["+f+"m]",o.type="("+f+")",r=l,u();break;case"<":if("a"!==i.type&&"f"!==i.type)throw{code:"S0401",stack:(new Error).stack,value:i.type,offset:r};var p=c(t,r,"<",">");i.subtype=t.substring(r+1,p),r=p}r++}var h="^"+a.map((function(e){return"("+e.regex+")"})).join("")+"$",d=new RegExp(h),v=function(e){var t;if(n.isFunction(e))t="f";else switch(typeof 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;default:t="m"}return t},y=function(e,t){for(var r="^",n=0,o=0;o<a.length;o++){r+=a[o].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}};return{definition:t,validate:function(t,r){var n="";t.forEach((function(e){n+=v(e)}));var o=d.exec(n);if(o){var i=[],s=0;return a.forEach((function(n,a){var u=t[s],c=o[a+1];if(""===c)if(n.context&&n.contextRegex){var l=v(r);if(!n.contextRegex.test(l))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=v(u[0]);a=o===n.subtype.charAt(0)&&0===u.filter((function(e){return v(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}y(t,n)}}}return t})();t.exports=a},{"./utils":6}],6:[function(e,t,r){const n=(()=>{"use strict";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}function t(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter((function(e){return"string"!=typeof e})).length),t}function r(t){var r=!1;return Array.isArray(t)&&(r=0===t.filter((function(t){return!e(t)})).length),r}function n(){var e=[];return e.sequence=!0,1===arguments.length&&e.push(arguments[0]),e}function a(e){return!0===e.sequence&&Array.isArray(e)}function o(e){return e&&(!0===e._jsonata_function||!0===e._jsonata_lambda)||"function"==typeof e}function i(e){return"number"==typeof e.arity?e.arity:"function"==typeof e.implementation?e.implementation.length:"number"==typeof e.length?e.length:e.arguments.length}function s(e){return e&&!0===e._jsonata_lambda}var u=("function"==typeof Symbol?Symbol:{}).iterator||"@@iterator";function c(e){return"object"==typeof e&&null!==e&&u in e&&"next"in e&&"function"==typeof e.next}function l(e,t){if(e===t)return!0;if("object"==typeof e&&"object"==typeof t&&null!==e&&null!==t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!l(e[r],t[r]))return!1;return!0}var n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertyNames(t);if(n.length!==a.length)return!1;for(n=n.sort(),a=a.sort(),r=0;r<n.length;r++)if(n[r]!==a[r])return!1;for(r=0;r<n.length;r++){var o=n[r];if(!l(e[o],t[o]))return!1}return!0}return!1}function f(e){var t=[];for(let r of e)t.push(r);return t}return{isNumeric:e,isArrayOfStrings:t,isArrayOfNumbers:r,createSequence:n,isSequence:a,isFunction:o,isLambda:s,isIterable:c,getFunctionArity:i,isDeepEqual:l,stringToArray:f}})();t.exports=n},{}]},{},[3])(3)},e=>{"use strict";function t(){var e=Object.create(null),t=0,r=0,n=0,a=!1;function o(t){n--,delete e[t]}this.put=function(t,r,a,i){if(void 0!==a&&("number"!=typeof a||isNaN(a)||a<=0))throw new Error("Cache timeout must be a positive number");if(void 0!==i&&"function"!=typeof i)throw new Error("Cache timeout callback must be a function");var s=e[t];s?clearTimeout(s.timeout):n++;var u={value:r,expire:a+Date.now()};return isNaN(u.expire)||(u.timeout=setTimeout(function(){o(t),i&&i(t,r)}.bind(this),a)),e[t]=u,r},this.del=function(t){var r=!0,n=e[t];return n?(clearTimeout(n.timeout),!isNaN(n.expire)&&n.expire<Date.now()&&(r=!1)):r=!1,r&&o(t),r},this.clear=function(){for(var o in e)clearTimeout(e[o].timeout);n=0,e=Object.create(null),a&&(t=0,r=0)},this.get=function(o){var i=e[o];if(void 0!==i){if(isNaN(i.expire)||i.expire>=Date.now())return a&&t++,i.value;a&&r++,n--,delete e[o]}else a&&r++;return null},this.size=function(){return n},this.memsize=function(){var t,r=0;for(t in e)r++;return r},this.debug=function(e){a=e},this.hits=function(){return t},this.misses=function(){return r},this.keys=function(){return Object.keys(e)},this.exportJson=function(){var t={};for(var r in e){var n=e[r];t[r]={value:n.value,expire:n.expire||"NaN"}}return JSON.stringify(t)},this.importJson=function(t,r){var n=JSON.parse(t),a=Date.now(),o=r&&r.skipDuplicates;for(var i in n)if(n.hasOwnProperty(i)){if(o)if(e[i])continue;var s=n[i],u=s.expire-a;if(u<=0){this.del(i);continue}u=u>0?u:void 0,this.put(i,s.value,u)}return this.size()}}e.exports=new t,e.exports.Cache=t},,e=>{"use strict";e.exports=o},e=>{"use strict";e.exports=i}],c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,loaded:!1,exports:{}};return u[e].call(r.exports,r,r.exports,l),r.loaded=!0,r.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var f={};return(()=>{"use strict";l.r(f),l.d(f,{plugin:()=>ur});var e=l(3);function t(e,r){return Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,r)}var r=l(0),n=l.n(r);var a=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);a.insertRule(e,o?0:a.cssRules.length)}catch(e){0}}else n.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();const o=function(e){function t(e,n,u,c,p){for(var h,d,v,y,w,k=0,E=0,S=0,A=0,O=0,D=0,I=v=h=0,$=0,M=0,L=0,R=0,z=u.length,U=z-1,q="",B="",G="",W="";$<z;){if(d=u.charCodeAt($),$===U&&0!==E+A+S+k&&(0!==E&&(d=47===E?10:47),A=S=k=0,z++,U++),0===E+A+S+k){if($===U&&(0<M&&(q=q.replace(f,"")),0<q.trim().length)){switch(d){case 32:case 9:case 59:case 13:case 10:break;default:q+=u.charAt($)}d=59}switch(d){case 123:for(h=(q=q.trim()).charCodeAt(0),v=1,R=++$;$<z;){switch(d=u.charCodeAt($)){case 123:v++;break;case 125:v--;break;case 47:switch(d=u.charCodeAt($+1)){case 42:case 47:e:{for(I=$+1;I<U;++I)switch(u.charCodeAt(I)){case 47:if(42===d&&42===u.charCodeAt(I-1)&&$+2!==I){$=I+1;break e}break;case 10:if(47===d){$=I+1;break e}}$=I}}break;case 91:d++;case 40:d++;case 34:case 39:for(;$++<U&&u.charCodeAt($)!==d;);}if(0===v)break;$++}if(v=u.substring(R,$),0===h&&(h=(q=q.replace(l,"").trim()).charCodeAt(0)),64===h){switch(0<M&&(q=q.replace(f,"")),d=q.charCodeAt(1)){case 100:case 109:case 115:case 45:M=n;break;default:M=C}if(R=(v=t(n,M,v,d,p+1)).length,0<P&&(w=s(3,v,M=r(C,q,L),n,j,_,R,d,p,c),q=M.join(""),void 0!==w&&0===(R=(v=w.trim()).length)&&(d=0,v="")),0<R)switch(d){case 115:q=q.replace(x,i);case 100:case 109:case 45:v=q+"{"+v+"}";break;case 107:v=(q=q.replace(g,"$1 $2"))+"{"+v+"}",v=1===F||2===F&&o("@"+v,3)?"@-webkit-"+v+"@"+v:"@"+v;break;default:v=q+v,112===c&&(B+=v,v="")}else v=""}else v=t(n,r(n,q,L),v,c,p+1);G+=v,v=L=M=I=h=0,q="",d=u.charCodeAt(++$);break;case 125:case 59:if(1<(R=(q=(0<M?q.replace(f,""):q).trim()).length))switch(0===I&&(h=q.charCodeAt(0),45===h||96<h&&123>h)&&(R=(q=q.replace(" ",":")).length),0<P&&void 0!==(w=s(1,q,n,e,j,_,B.length,c,p,c))&&0===(R=(q=w.trim()).length)&&(q="\0\0"),h=q.charCodeAt(0),d=q.charCodeAt(1),h){case 0:break;case 64:if(105===d||99===d){W+=q+u.charAt($);break}default:58!==q.charCodeAt(R-1)&&(B+=a(q,h,d,q.charCodeAt(2)))}L=M=I=h=0,q="",d=u.charCodeAt(++$)}}switch(d){case 13:case 10:47===E?E=0:0===1+h&&107!==c&&0<q.length&&(M=1,q+="\0"),0<P*N&&s(0,q,n,e,j,_,B.length,c,p,c),_=1,j++;break;case 59:case 125:if(0===E+A+S+k){_++;break}default:switch(_++,y=u.charAt($),d){case 9:case 32:if(0===A+k+E)switch(O){case 44:case 58:case 9:case 32:y="";break;default:32!==d&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===A+E+k&&(M=L=1,y="\f"+y);break;case 108:if(0===A+E+k+T&&0<I)switch($-I){case 2:112===O&&58===u.charCodeAt($-3)&&(T=O);case 8:111===D&&(T=D)}break;case 58:0===A+E+k&&(I=$);break;case 44:0===E+S+A+k&&(M=1,y+="\r");break;case 34:case 39:0===E&&(A=A===d?0:0===A?d:A);break;case 91:0===A+E+S&&k++;break;case 93:0===A+E+S&&k--;break;case 41:0===A+E+k&&S--;break;case 40:if(0===A+E+k){if(0===h)if(2*O+3*D==533);else h=1;S++}break;case 64:0===E+S+A+k+I+v&&(v=1);break;case 42:case 47:if(!(0<A+k+S))switch(E){case 0:switch(2*d+3*u.charCodeAt($+1)){case 235:E=47;break;case 220:R=$,E=42}break;case 42:47===d&&42===O&&R+2!==$&&(33===u.charCodeAt(R+2)&&(B+=u.substring(R,$+1)),y="",E=0)}}0===E&&(q+=y)}D=O,O=d,$++}if(0<(R=B.length)){if(M=n,0<P&&(void 0!==(w=s(2,B,M,e,j,_,R,c,p,c))&&0===(B=w).length))return W+B+G;if(B=M.join(",")+"{"+B+"}",0!=F*T){switch(2!==F||o(B,2)||(T=0),T){case 111:B=B.replace(b,":-moz-$1")+B;break;case 112:B=B.replace(m,"::-webkit-input-$1")+B.replace(m,"::-moz-$1")+B.replace(m,":-ms-input-$1")+B}T=0}}return W+B+G}function r(e,t,r){var a=t.trim().split(v);t=a;var o=a.length,i=e.length;switch(i){case 0:case 1:var s=0;for(e=0===i?"":e[0]+" ";s<o;++s)t[s]=n(e,t[s],r).trim();break;default:var u=s=0;for(t=[];s<o;++s)for(var c=0;c<i;++c)t[u++]=n(e[c]+" ",a[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(y,"$1"+e.trim());case 58:return e.trim()+t.replace(y,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(y,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function a(e,t,r,n){var i=e+";",s=2*t+3*r+4*n;if(944===s){e=i.indexOf(":",9)+1;var u=i.substring(e,i.length-1).trim();return u=i.substring(0,e).trim()+u+";",1===F||2===F&&o(u,1)?"-webkit-"+u+u:u}if(0===F||2===F&&!o(i,1))return i;switch(s){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(O,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(u=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+u+i;case 1005:return h.test(i)?i.replace(p,":-webkit-")+i.replace(p,":-moz-")+i:i;case 1e3:switch(t=(u=i.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(t)){case 226:u=i.replace(w,"tb");break;case 232:u=i.replace(w,"tb-rl");break;case 220:u=i.replace(w,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+u+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,s=(u=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:i=i.replace(u,"-webkit-"+u)+";"+i;break;case 207:case 102:i=i.replace(u,"-webkit-"+(102<s?"inline-":"")+"box")+";"+i.replace(u,"-webkit-"+u)+";"+i.replace(u,"-ms-"+u+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return u=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+u+"-ms-flex-"+u+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(E,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(E,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===A.test(e))return 115===(u=e.substring(e.indexOf(":")+1)).charCodeAt(0)?a(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):i.replace(u,"-webkit-"+u)+i.replace(u,"-moz-"+u.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+n&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(d,"$1-webkit-$2")+i}return i}function o(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),I(2!==t?n:n.replace(S,"$1"),r,t)}function i(e,t){var r=a(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(k," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,a,o,i,s,u,l){for(var f,p=0,h=t;p<P;++p)switch(f=D[p].call(c,e,h,r,n,a,o,i,s,u,l)){case void 0:case!1:case!0:case null:break;default:h=f}if(h!==t)return h}function u(e){return void 0!==(e=e.prefix)&&(I=null,e?"function"!=typeof e?F=1:(F=2,I=e):F=0),u}function c(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<P){var a=s(-1,r,n,n,j,_,0,0,0,0);void 0!==a&&"string"==typeof a&&(r=a)}var o=t(C,n,r,0,0);return 0<P&&(void 0!==(a=s(-2,o,n,n,j,_,o.length,0,0,0))&&(o=a)),"",T=0,_=j=1,o}var l=/^\0+/g,f=/[\0\r\f]/g,p=/: */g,h=/zoo|gra/,d=/([,: ])(transform)/g,v=/,\r+?/g,y=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,m=/::(place)/g,b=/:(read-only)/g,w=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,k=/([\s\S]*?);/g,E=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,A=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,_=1,j=1,T=0,F=1,C=[],D=[],P=0,I=null,N=0;return c.use=function e(t){switch(t){case void 0:case null:P=D.length=0;break;default:if("function"==typeof t)D[P++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else N=0|!!t}return e},c.set=u,void 0!==e&&u(e),c};var i="/*|*/",s=i+"}";function u(e){e&&c.current.insert(e+"}")}var c={current:null},p=function(e,t,r,n,a,o,l,f,p,h){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return c.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===f)return t+i;break;case 3:switch(f){case 102:case 112:return c.current.insert(r[0]+t),"";default:return t+(0===h?i:"")}case-2:t.split(s).forEach(u)}};const h=function(e){void 0===e&&(e={});var t,r=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var n=new o(t);var i,s={};i=e.container||document.head;var u,l=document.querySelectorAll("style[data-emotion-"+r+"]");Array.prototype.forEach.call(l,(function(e){e.getAttribute("data-emotion-"+r).split(" ").forEach((function(e){s[e]=!0})),e.parentNode!==i&&i.appendChild(e)})),n.use(e.stylisPlugins)(p),u=function(e,t,r,a){var o=t.name;c.current=r,n(e,t.styles),a&&(f.inserted[o]=!0)};var f={key:r,sheet:new a({key:r,container:i,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:s,registered:{},insert:u};return f};var d=function(e,t,r){var n=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var a=t;do{e.insert("."+n,a,e.sheet,!0);a=a.next}while(void 0!==a)}};const v=function(e){for(var t,r=0,n=0,a=e.length;a>=4;++n,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(a){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)};const y={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var g=/[A-Z]|^ms/g,m=/_EMO_([^_]+?)_([^]*?)_EMO_/g,b=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!=typeof e},x=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}((function(e){return b(e)?e:e.replace(g,"-$&").toLowerCase()})),k=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(m,(function(e,t,r){return S={name:t,styles:r,next:S},t}))}return 1===y[e]||b(e)||"number"!=typeof t||0===t?t:t+"px"};function E(e,t,r,n){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return S={name:r.name,styles:r.styles,next:S},r.name;if(void 0!==r.styles){var a=r.next;if(void 0!==a)for(;void 0!==a;)S={name:a.name,styles:a.styles,next:S},a=a.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=E(e,t,r[a],!1);else for(var o in r){var i=r[o];if("object"!=typeof i)null!=t&&void 0!==t[i]?n+=o+"{"+t[i]+"}":w(i)&&(n+=x(o)+":"+k(o,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var s=E(e,t,i,!1);switch(o){case"animation":case"animationName":n+=x(o)+":"+s+";";break;default:n+=o+"{"+s+"}"}}else for(var u=0;u<i.length;u++)w(i[u])&&(n+=x(o)+":"+k(o,i[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=S,i=r(e);return S=o,E(e,t,i,n)}}if(null==t)return r;var s=t[r];return void 0===s||n?r:s}var S,A=/label:\s*([^\s;\n{]+)\s*;/g;l(19);var O=(0,r.createContext)("undefined"!=typeof HTMLElement?h():null),_=(0,r.createContext)({}),j=(O.Provider,function(e){return(0,r.forwardRef)((function(t,n){return(0,r.createElement)(O.Consumer,null,(function(r){return e(t,r,n)}))}))});Object.prototype.hasOwnProperty;r.Component;var T=function e(t){for(var r=t.length,n=0,a="";n<r;n++){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(a&&(a+=" "),a+=i)}}return a};j((function(e,t){return(0,r.createElement)(_.Consumer,null,(function(r){var n=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,a="";S=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,a+=E(r,t,o,!1)):a+=o[0];for(var i=1;i<e.length;i++)a+=E(r,t,e[i],46===a.charCodeAt(a.length-1)),n&&(a+=o[i]);A.lastIndex=0;for(var s,u="";null!==(s=A.exec(a));)u+="-"+s[1];return{name:v(a)+u,styles:a,next:S}}(r,t.registered);return d(t,a,!1),t.key+"-"+a.name},a={css:n,cx:function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return function(e,t,r){var n=[],a=function(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]):n+=r+" "})),n}(e,n,r);return n.length<2?r:a+t(n)}(t.registered,n,T(r))},theme:r},o=e.children(a);return!0,o}))}));var F,C=l(1);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}function P(e){return P="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},P(e)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function N(e,t){return N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},N(e,t)}function $(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function M(e,t,r){return M=$()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&N(a,r.prototype),a},M.apply(null,arguments)}function L(e){var t="function"==typeof Map?new Map:void 0;return L=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return M(e,arguments,I(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),N(n,e)},L(e)}function R(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return q(e,t);var r=Object.prototype.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)?q(e,t):void 0}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var B=Object.prototype.hasOwnProperty;function G(e,t){return(e=e.slice()).push(t),e}function W(e,t){return(t=t.slice()).unshift(e),t}var Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}(a,e);var t,r,n=(t=a,r=$(),function(){var e,n=I(t);if(r){var a=I(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return R(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=n.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew=!0,t.value=e,t.name="NewError",t}return a}(L(Error));function H(e,t,r,n,a){if(!(this instanceof H))try{return new H(e,t,r,n,a)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(a=n,n=r,r=t,t=e,e=null);var o=e&&"object"===P(e);if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!B.call(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||a||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){var i={path:o?e.path:t};o?"json"in e&&(i.json=e.json):i.json=r;var s=this.evaluate(i);if(!s||"object"!==P(s))throw new Y(s);return s}}H.prototype.evaluate=function(e,t,r,n){var a=this,o=this.parent,i=this.parentProperty,s=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"===P(e)&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!B.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');t=e.json,s=B.call(e,"flatten")?e.flatten:s,this.currResultType=B.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=B.call(e,"sandbox")?e.sandbox:this.currSandbox,u=B.call(e,"wrap")?e.wrap:u,this.currPreventEval=B.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=B.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=B.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=B.call(e,"parent")?e.parent:o,i=B.call(e,"parentProperty")?e.parentProperty:i,e=e.path}if(o=o||null,i=i||null,Array.isArray(e)&&(e=H.toPathString(e)),(e||""===e)&&t){var c=H.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;var l=this._trace(c,t,["$"],o,i,r).filter((function(e){return e&&!e.isParentSelector}));return l.length?u||1!==l.length||l[0].hasArrExpr?l.reduce((function(e,t){var r=a._getPreferredOutput(t);return s&&Array.isArray(r)?e=e.concat(r):e.push(r),e}),[]):this._getPreferredOutput(l[0]):u?[]:void 0}},H.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":var r=Array.isArray(e.path)?e.path:H.toPathArray(e.path);return e.pointer=H.toPointer(r),e.path="string"==typeof e.path?e.path:H.toPathString(e.path),e;case"value":case"parent":case"parentProperty":return e[t];case"path":return H.toPathString(e[t]);case"pointer":return H.toPointer(e.path);default:throw new TypeError("Unknown result type")}},H.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:H.toPathString(e.path),t(n,r,e)}},H.prototype._trace=function(e,t,r,n,a,o,i,s){var u,c=this;if(!e.length)return u={path:r,value:t,parent:n,parentProperty:a,hasArrExpr:i},this._handleCallback(u,o,"value"),u;var l=e[0],f=e.slice(1),p=[];function h(e){Array.isArray(e)?e.forEach((function(e){p.push(e)})):p.push(e)}if(("string"!=typeof l||s)&&t&&B.call(t,l))h(this._trace(f,t[l],G(r,l),t,l,o,i));else if("*"===l)this._walk(l,f,t,r,n,a,o,(function(e,t,r,n,a,o,i,s){h(c._trace(W(e,r),n,a,o,i,s,!0,!0))}));else if(".."===l)h(this._trace(f,t,r,n,a,o,i)),this._walk(l,f,t,r,n,a,o,(function(e,t,r,n,a,o,i,s){"object"===P(n[e])&&h(c._trace(W(t,r),n[e],G(a,e),n,e,s,!0))}));else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:f,isParentSelector:!0};if("~"===l)return u={path:G(r,l),value:a,parent:n,parentProperty:null},this._handleCallback(u,o,"property"),u;if("$"===l)h(this._trace(f,t,r,null,null,o,i));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))h(this._slice(l,f,t,r,n,a,o));else if(0===l.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,f,t,r,n,a,o,(function(e,t,r,n,a,o,i,s){c._eval(t.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),n[e],e,a,o,i)&&h(c._trace(W(e,r),n,a,o,i,s,!0))}))}else if("("===l[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(W(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,a),f),t,r,n,a,o,i))}else if("@"===l[0]){var d=!1,v=l.slice(1,-2);switch(v){case"scalar":t&&["object","function"].includes(P(t))||(d=!0);break;case"boolean":case"string":case"undefined":case"function":P(t)===v&&(d=!0);break;case"integer":!Number.isFinite(t)||t%1||(d=!0);break;case"number":Number.isFinite(t)&&(d=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(d=!0);break;case"object":t&&P(t)===v&&(d=!0);break;case"array":Array.isArray(t)&&(d=!0);break;case"other":d=this.currOtherTypeCallback(t,r,n,a);break;case"null":null===t&&(d=!0);break;default:throw new TypeError("Unknown value type "+v)}if(d)return u={path:r,value:t,parent:n,parentProperty:a},this._handleCallback(u,o,"value"),u}else if("`"===l[0]&&t&&B.call(t,l.slice(1))){var y=l.slice(1);h(this._trace(f,t[y],G(r,y),t,y,o,i,!0))}else if(l.includes(",")){var g,m=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=U(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 o,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}(l.split(","));try{for(m.s();!(g=m.n()).done;){var b=g.value;h(this._trace(W(b,f),t,r,n,a,o,!0))}}catch(e){m.e(e)}finally{m.f()}}else!s&&t&&B.call(t,l)&&h(this._trace(f,t[l],G(r,l),t,l,o,i,!0))}if(this._hasParentSelector)for(var w=0;w<p.length;w++){var x=p[w];if(x&&x.isParentSelector){var k=this._trace(x.expr,t,x.path,n,a,o,i);if(Array.isArray(k)){p[w]=k[0];for(var E=k.length,S=1;S<E;S++)w++,p.splice(w,0,k[S])}else p[w]=k}}return p},H.prototype._walk=function(e,t,r,n,a,o,i,s){if(Array.isArray(r))for(var u=r.length,c=0;c<u;c++)s(c,e,t,r,n,a,o,i);else r&&"object"===P(r)&&Object.keys(r).forEach((function(u){s(u,e,t,r,n,a,o,i)}))},H.prototype._slice=function(e,t,r,n,a,o,i){if(Array.isArray(r)){var s=r.length,u=e.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var p=[],h=l;h<f;h+=c){this._trace(W(h,t),r,n,a,o,i,!0).forEach((function(e){p.push(e)}))}return p}},H.prototype._eval=function(e,t,r,n,a,o){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=o,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=a,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=r,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=H.toPathString(n.concat([r])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(t){throw new Error("jsonPath: "+t.message+": "+e)}},H.cache={},H.toPathString=function(e){for(var t=e,r=t.length,n="$",a=1;a<r;a++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[a])||(n+=/^[\*0-9]+$/.test(t[a])?"["+t[a]+"]":"['"+t[a]+"']");return n},H.toPointer=function(e){for(var t=e,r=t.length,n="",a=1;a<r;a++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[a])||(n+="/"+t[a].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n},H.toPathArray=function(e){var t=H.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,(function(e,t){return"[#"+(r.push(t)-1)+"]"})).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,(function(e,t){return"['"+t.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"})).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,(function(e,t){return";"+t.split("").join(";")+";"})).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"").split(";").map((function(e){var t=e.match(/#([0-9]+)/);return t&&t[1]?r[t[1]]:e}));return t[e]=n,t[e].concat()};var J,V,Z,Q,X,K,ee,te,re;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(this,arguments)}H.prototype.vm={runInNewContext:function(e,t){var r=Object.keys(t),n=[];!function(e,t,r){for(var n=e.length,a=0;a<n;a++)r(e[a])&&t.push(e.splice(a--,1)[0])}(r,n,(function(e){return"function"==typeof t[e]}));var a=r.map((function(e,r){return t[e]})),o=n.reduce((function(e,r){var n=t[r].toString();return/function/.test(n)||(n="function "+n),"var "+r+"="+n+";"+e}),"");/(["'])use strict\1/.test(e=o+e)||r.includes("arguments")||(e="var arguments = undefined;"+e);var i=(e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"")).lastIndexOf(";"),s=i>-1?e.slice(0,i+1)+" return "+e.slice(i+1):" return "+e;return M(Function,z(r).concat([s])).apply(void 0,z(a))}};var ae=function(e){var t=e.query,r=e.onChange,a=e.onRunQuery,o=e.editorContext,i=t.experimentalGroupByField,s=function(e){r(ne({},t,{experimentalGroupByField:e})),a()},u=t.experimentalMetricField,c=function(e){r(ne({},t,{experimentalMetricField:e})),a()},l=t.experimentalVariableTextField,f=function(e){r(ne({},t,{experimentalVariableTextField:e})),a()},p=t.experimentalVariableValueField,h=function(e){r(ne({},t,{experimentalVariableValueField:e})),a()},d=t.fields.map((function(e){if("jsonpath"===e.language){if(e.name)return e.name;var t=H.toPathArray(e.jsonPath);return t[t.length-1]}return e.name})).filter((function(e){return e})).map((function(e){return{label:e,value:e}}));return n().createElement(n().Fragment,null,n().createElement(C.InfoBox,{severity:"warning",style:{maxWidth:"700px",whiteSpace:"normal"}},J||(J=n().createElement("p",null,"The features listed here are experimental. They might change or be removed without notice. In the tooltip for\n each feature, there's a link to a pull request where you can submit feedback for that feature."))),"default"===o&&n().createElement(n().Fragment,null,n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{labelWidth:12,label:"Group by",tooltip:n().createElement(n().Fragment,null,V||(V=n().createElement("p",null,"Groups the query result into multiple results. This can be useful when you want to graph multiple time series in the same panel.")),Z||(Z=n().createElement("a",{href:"https://github.com/grafana/grafana-json-datasource/issues/36",target:"_blank",rel:"noreferrer"},"Share feedback")))},n().createElement(C.Select,{placeholder:"Field",width:20,isClearable:!0,value:d.find((function(e){return e.value===i})),options:d,onChange:function(e){return s(null==e?void 0:e.value)}}))),n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{labelWidth:12,label:"Metric",tooltip:n().createElement(n().Fragment,null,Q||(Q=n().createElement("p",null,"Set the display name of the selected field to the name of the query result.")),X||(X=n().createElement("a",{href:"https://github.com/grafana/grafana-json-datasource/issues/36",target:"_blank",rel:"noreferrer"},"Share feedback")))},n().createElement(C.Select,{placeholder:"Field",width:20,isClearable:!0,value:d.find((function(e){return e.value===u})),options:d,onChange:function(e){return c(null==e?void 0:e.value)}})))),"variables"===o&&n().createElement(n().Fragment,null,n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{labelWidth:15,label:"Variable text",tooltip:n().createElement(n().Fragment,null,K||(K=n().createElement("p",null,"Field to use for the text label of a variable query.")),ee||(ee=n().createElement("a",{href:"https://github.com/grafana/grafana-json-datasource/issues/79",target:"_blank",rel:"noreferrer"},"Share feedback")))},n().createElement(C.Select,{placeholder:"Field",width:20,isClearable:!0,value:d.find((function(e){return e.value===l})),options:d,onChange:function(e){return f(null==e?void 0:e.value)}}))),n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{labelWidth:15,label:"Variable value",tooltip:n().createElement(n().Fragment,null,te||(te=n().createElement("p",null,"Field to use for the value of a variable query.")),re||(re=n().createElement("a",{href:"https://github.com/grafana/grafana-json-datasource/issues/79",target:"_blank",rel:"noreferrer"},"Share feedback")))},n().createElement(C.Select,{placeholder:"Field",width:20,isClearable:!0,value:d.find((function(e){return e.value===p})),options:d,onChange:function(e){return h(null==e?void 0:e.value)}})))))},oe=function(e){var t=e.query,r=e.onBlur,a=e.onChange,o=[(0,C.BracesPlugin)(),(0,C.SlatePrism)({onlyIn:function(e){return"code_block"===e.type},getSyntax:function(){return"js"}})];return n().createElement(C.QueryField,{additionalPlugins:o,query:t,onRunQuery:r,onChange:a,portalOrigin:"jsonapi",placeholder:"$sum(orders.(price*quantity))"})};function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ie.apply(this,arguments)}function se(e){return H(ie({},e,{preventEval:!0}))}function ue(){ue=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new A(a||[]);return n(i,"_invoke",{value:x(e,r,s)}),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function p(){}function h(){}function d(){}var v={};u(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==t&&r.call(g,o)&&(v=g);var m=d.prototype=p.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(n,o,i,s){var u=l(e[n],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==fe(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,s)}),(function(e){a("throw",e,i,s)})):t.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return a("throw",e,i,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){a(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return _()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=k(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=l(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=u(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(c(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(m),u(m,s,"Generator"),u(m,o,(function(){return this})),u(m,"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=O,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.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,f):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),f},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),S(r),f}},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;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function ce(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)||function(e,t){if(!e)return;if("string"==typeof e)return le(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(e,t)}(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 le(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fe(e){return fe="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},fe(e)}function pe(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)}var he,de,ve,ye=function(){var e,t=(e=ue().mark((function e(t,r){var n,a,o,i,s,u,c,l,f,p,h,d;return ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.value,a={suggestions:[]},n){e.next=4;break}return e.abrupt("return",a);case 4:if(o=n.document.getTextsAtRange(n.selection),i=1===o.size?o.first().getText():null){e.next=8;break}return e.abrupt("return",a);case 8:if(s=i.slice(0,n.selection.anchor.offset),u=/[\$\]a-zA-Z0-9]\.$/,c=/\[$/,l=/@\.$/,/[a-zA-Z0-9]$/.test(s)||u.test(s)||l.test(s)||c.test(s)){e.next=16;break}return e.abrupt("return",a);case 16:if(!c.test(s)){e.next=18;break}return e.abrupt("return",{suggestions:[{label:"Operators",items:[{label:"*",documentation:"Returns all elements."},{label:":",documentation:"Returns a slice of the array."},{label:"?",insertText:"?()",move:-1,documentation:"Returns elements based on a filter expression."}]}]});case 18:return f=s.lastIndexOf("[")>s.lastIndexOf("]"),p=f?s.slice(0,s.lastIndexOf("[")+1)+":]":i.slice(0,i.lastIndexOf(".")),e.next=22,r();case 22:if(h=e.sent,"object"===fe((d=se({path:p,json:h}))[0])){e.next=26;break}return e.abrupt("return",a);case 26:return e.abrupt("return",{suggestions:[{label:"Elements",items:Object.entries(d[0]).map((function(e){var t=ce(e,2),r=t[0],n=t[1];return Array.isArray(n)?{label:r,insertText:r+"[]",move:-1,documentation:"_array (".concat(n.length,")_")}:{label:r,documentation:"_".concat(fe(n),"_\n\n**Preview:**\n\n`").concat(n,"`")}}))}]});case 27:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){pe(o,n,a,i,s,"next",e)}function s(e){pe(o,n,a,i,s,"throw",e)}i(void 0)}))});return function(e,r){return t.apply(this,arguments)}}(),ge=function(e){var t=e.query,r=e.onBlur,a=e.onChange,o=e.onData,i=[(0,C.BracesPlugin)(),(0,C.SlatePrism)({onlyIn:function(e){return"code_block"===e.type},getSyntax:function(){return"js"}})];return n().createElement(C.QueryField,{additionalPlugins:i,query:t,cleanText:function(e){return e.replace(/[{}[\]="(),!~+\-*/^%\|\$@\.]/g,"").trim()},onTypeahead:function(e){return ye(e,o)},onRunQuery:r,onChange:a,portalOrigin:"jsonapi",placeholder:"$.items[*].name"})};function me(e){return function(e){if(Array.isArray(e))return be(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return be(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return be(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},we.apply(this,arguments)}var xe=function(e){var t=e.value,r=void 0===t?[]:t,a=e.onChange,o=e.limit,i=e.onComplete,s=function(e){return function(t){a(r.map((function(n,a){return e===a?we({},r[e],{jsonPath:t}):n})))}},u=function(e){return function(t){a(r.map((function(n,a){return e===a?we({},r[e],{type:"auto"===t.value?void 0:t.value}):n})))}},c=function(e){return function(t){a(r.map((function(n,a){return e===a?we({},r[e],{name:t.currentTarget.value}):n})))}},l=function(e,t){return function(){(!o||r.length<o)&&a([].concat(me(r.slice(0,e+1)),[we({name:"",jsonPath:""},t)],me(r.slice(e+1))))}},f=function(e){return function(){a([].concat(me(r.slice(0,e)),me(r.slice(e+1))))}};return n().createElement(n().Fragment,null,r.map((function(e,t){var p,h,d,v;return n().createElement(C.InlineFieldRow,{key:t},n().createElement(C.InlineField,{label:"Field",tooltip:he||(he=n().createElement("div",null,"A ",n().createElement("a",{href:"https://goessner.net/articles/JsonPath/"},"JSON Path")," query that selects one or more values from a JSON object.")),grow:!0},"jsonata"===e.language?n().createElement(oe,{onBlur:function(){return a(r)},onChange:s(t),query:e.jsonPath}):n().createElement(ge,{onBlur:function(){return a(r)},onChange:s(t),query:e.jsonPath,onData:i})),n().createElement(C.InlineField,null,n().createElement(C.Select,{value:null!==(p=e.language)&&void 0!==p?p:"jsonpath",width:14,onChange:(v=t,function(e){a(r.map((function(t,n){return v===n?we({},r[v],{language:e.value}):t})))}),options:[{label:"JSONPath",value:"jsonpath"},{label:"JSONata",value:"jsonata"}]})),n().createElement(C.InlineField,{label:"Type",tooltip:"If Auto is set, the JSON property type is used to detect the field type."},n().createElement(C.Select,{value:null!==(h=e.type)&&void 0!==h?h:"auto",width:12,onChange:u(t),options:[{label:"Auto",value:"auto"},{label:"String",value:"string"},{label:"Number",value:"number"},{label:"Time",value:"time"},{label:"Boolean",value:"boolean"}]})),n().createElement(C.InlineField,{label:"Alias",tooltip:"If left blank, the field uses the name of the queried element."},n().createElement(C.Input,{width:12,value:e.name,onChange:c(t)})),(!o||r.length<o)&&n().createElement("a",{className:"gf-form-label",onClick:l(t,{language:null!==(d=e.language)&&void 0!==d?d:"jsonpath"})},de||(de=n().createElement(C.Icon,{name:"plus"}))),r.length>1?n().createElement("a",{className:"gf-form-label",onClick:f(t)},ve||(ve=n().createElement(C.Icon,{name:"minus"}))):null)})))},ke=l(20),Ee=l(7),Se=l.n(Ee),Ae=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},je=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Te=void 0;Te="undefined"!=typeof window?window:"undefined"!=typeof self?self:l.g;var Fe=null,Ce=null,De=Te.clearTimeout,Pe=Te.setTimeout,Ie=Te.cancelAnimationFrame||Te.mozCancelAnimationFrame||Te.webkitCancelAnimationFrame,Ne=Te.requestAnimationFrame||Te.mozRequestAnimationFrame||Te.webkitRequestAnimationFrame;function $e(e){var t=void 0,r=void 0,n=void 0,a=void 0,o=void 0,i=void 0,s=void 0,u="undefined"!=typeof document&&document.attachEvent;if(!u){i=function(e){var t=e.__resizeTriggers__,r=t.firstElementChild,n=t.lastElementChild,a=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,a.style.width=r.offsetWidth+1+"px",a.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},o=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},s=function(e){if(!(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)){var t=this;i(this),this.__resizeRAF__&&Fe(this.__resizeRAF__),this.__resizeRAF__=Ce((function(){o(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(r){r.call(t,e)})))}))}};var c=!1,l="";n="animationstart";var f="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),h=document.createElement("fakeelement");if(void 0!==h.style.animationName&&(c=!0),!1===c)for(var d=0;d<f.length;d++)if(void 0!==h.style[f[d]+"AnimationName"]){l="-"+f[d].toLowerCase()+"-",n=p[d],c=!0;break}t="@"+l+"keyframes "+(r="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",a=l+"animation: 1ms "+r+"; "}return{addResizeListener:function(o,c){if(u)o.attachEvent("onresize",c);else{if(!o.__resizeTriggers__){var l=o.ownerDocument,f=Te.getComputedStyle(o);f&&"static"===f.position&&(o.style.position="relative"),function(r){if(!r.getElementById("detectElementResize")){var n=(t||"")+".resize-triggers { "+(a||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',o=r.head||r.getElementsByTagName("head")[0],i=r.createElement("style");i.id="detectElementResize",i.type="text/css",null!=e&&i.setAttribute("nonce",e),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(r.createTextNode(n)),o.appendChild(i)}}(l),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=l.createElement("div")).className="resize-triggers";var p=l.createElement("div");p.className="expand-trigger",p.appendChild(l.createElement("div"));var h=l.createElement("div");h.className="contract-trigger",o.__resizeTriggers__.appendChild(p),o.__resizeTriggers__.appendChild(h),o.appendChild(o.__resizeTriggers__),i(o),o.addEventListener("scroll",s,!0),n&&(o.__resizeTriggers__.__animationListener__=function(e){e.animationName===r&&i(o)},o.__resizeTriggers__.addEventListener(n,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(c)}},removeResizeListener:function(e,t){if(u)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==Ie||null==Ne?(Fe=De,Ce=function(e){return Pe(e,20)}):(Fe=function(e){var t=je(e,2),r=t[0],n=t[1];Ie(r),De(n)},Ce=function(e){var t=Ne((function(){De(r),e()})),r=Pe((function(){Ie(t),e()}),20);return[t,r]});var Me=function(e){function t(){var e,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=n=_e(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),n.state={height:n.props.defaultHeight||0,width:n.props.defaultWidth||0},n._onResize=function(){var e=n.props,t=e.disableHeight,r=e.disableWidth,a=e.onResize;if(n._parentNode){var o=n._parentNode.offsetHeight||0,i=n._parentNode.offsetWidth||0,s=window.getComputedStyle(n._parentNode)||{},u=parseInt(s.paddingLeft,10)||0,c=parseInt(s.paddingRight,10)||0,l=parseInt(s.paddingTop,10)||0,f=parseInt(s.paddingBottom,10)||0,p=o-l-f,h=i-u-c;(!t&&n.state.height!==p||!r&&n.state.width!==h)&&(n.setState({height:o-l-f,width:i-u-c}),a({height:o,width:i}))}},n._setRef=function(e){n._autoSizer=e},_e(n,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),Ae(t,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=$e(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.disableHeight,o=e.disableWidth,i=e.style,s=this.state,u=s.height,c=s.width,l={overflow:"visible"},f={},p=!1;return a||(0===u&&(p=!0),l.height=0,f.height=u),o||(0===c&&(p=!0),l.width=0,f.width=c),(0,r.createElement)("div",{className:n,ref:this._setRef,style:Oe({},l,i)},!p&&t(f))}}]),t}(r.PureComponent);Me.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};const Le=Me;var Re,ze,Ue,qe,Be,Ge,We,Ye,He,Je,Ve,Ze,Qe={cacheDurationSeconds:300,method:"GET",queryParams:"",urlPath:"",fields:[{jsonPath:""}]};function Xe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ke(e){return function(e){if(Array.isArray(e))return rt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(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)||tt(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 tt(e,t){if(e){if("string"==typeof e)return rt(e,t);var r=Object.prototype.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)?rt(e,t):void 0}}function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var nt,at=function(e){var t=e.columns,r=e.values,a=e.onChange,o=e.addRowLabel,i=e.onBlur,s=(0,C.useTheme)(),u=ot(s),c=function(e,t,n){a(r.map((function(r,a){var o=et(r,2),i=o[0],s=o[1];return t===a?0===e?[n,s]:1===e?[i,n]:[i,s]:[i,s]})))},l=function(e){a([].concat(Ke(r.slice(0,e+1)),[["",""]],Ke(r.slice(e+1))))};return 0===r.length?n().createElement(C.Button,{variant:"secondary",onClick:function(){l(0)}},o):n().createElement("table",{className:u.root},n().createElement("thead",{className:u.thead},n().createElement("tr",{className:u.row},t.map((function(e,t){return n().createElement("th",{key:t,className:u.th},e)})),n().createElement("th",{className:u.th}))),n().createElement("tbody",{className:u.tbody},r.map((function(e,t){return n().createElement("tr",{key:t,className:u.row},e.map((function(e,r){return n().createElement("td",{key:r,className:u.td},n().createElement("input",{value:e,onChange:function(e){return c(r,t,e.currentTarget.value)},onBlur:i,className:u.input}))})),n().createElement("td",{className:u.td},n().createElement("div",{className:(0,ke.css)(Re||(Re=Xe(["\n display: flex;\n & > * {\n margin-right: ",";\n }\n & > *:last-child {\n margin-right: 0;\n }\n "])),s.spacing.xs)},n().createElement("a",{className:(0,ke.css)(ze||(ze=Xe(["\n display: flex;\n background: ",";\n padding: "," ",";\n align-items: center;\n border-radius: ",";\n "])),s.colors.bg2,s.spacing.xs,s.spacing.sm,s.border.radius.sm),onClick:function(){return l(t)}},Ue||(Ue=n().createElement(C.Icon,{name:"plus"}))),n().createElement("a",{className:(0,ke.css)(qe||(qe=Xe(["\n display: flex;\n background: ",";\n padding: "," ",";\n align-items: center;\n border-radius: ",";\n "])),s.colors.bg2,s.spacing.xs,s.spacing.sm,s.border.radius.sm),onClick:function(){return e=t,void a([].concat(Ke(r.slice(0,e)),Ke(r.slice(e+1))));var e}},Be||(Be=n().createElement(C.Icon,{name:"minus"}))))))}))))},ot=(0,C.stylesFactory)((function(e){return{root:(0,ke.css)(Ge||(Ge=Xe(["\n table-layout: auto;\n border: 1px solid ",";\n border-collapse: separate;\n border-radius: ",";\n border-spacing: 0;\n border-left: 0;\n width: 100%;\n "])),e.colors.formInputBorder,e.border.radius.sm),thead:(0,ke.css)(We||(We=Xe(["\n display: table-header-group;\n vertical-align: middle;\n border-color: inherit;\n border-collapse: separate;\n\n &:first-child tr:first-child th:first-child {\n border-radius: "," 0 0 0;\n }\n &:last-child tr:last-child th:first-child {\n border-radius: 0 0 0 ",";\n }\n "])),e.border.radius.sm,e.border.radius.sm),tbody:(0,ke.css)(Ye||(Ye=Xe(["\n &:first-child tr:first-child td:first-child {\n border-radius: "," 0 0 0;\n }\n\n &:last-child tr:last-child td:first-child {\n border-radius: 0 0 0 ",";\n }\n "])),e.border.radius.sm,e.border.radius.sm),input:(0,ke.css)(He||(He=Xe(["\n outline: none;\n border: 0;\n background: transparent;\n width: 100%;\n "]))),row:(0,ke.css)(Je||(Je=Xe(["\n display: table-row;\n vertical-align: inherit;\n border-color: inherit;\n "]))),th:(0,ke.css)(Ve||(Ve=Xe(["\n padding: "," ",";\n border-left: solid "," 1px;\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n &:last-child {\n border-left: 0;\n }\n "])),e.spacing.xs,e.spacing.sm,e.colors.formInputBorder,e.typography.size.sm,e.colors.textSemiWeak,e.typography.weight.regular),td:(0,ke.css)(Ze||(Ze=Xe(["\n padding: "," ",";\n border: 1px solid transparent;\n border-left: solid "," 1px;\n border-top: solid "," 1px;\n background-color: ",";\n &:last-child {\n border-left: 0;\n width: 32px;\n padding-left: 0;\n padding-right: ",";\n }\n "])),e.spacing.xs,e.spacing.sm,e.colors.formInputBorder,e.colors.formInputBorder,e.colors.formInputBg,e.spacing.xs)}})),it=function(e){var t=e.method,r=e.onMethodChange,a=e.path,o=e.onPathChange;return n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,null,n().createElement(C.Select,{value:t,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"}],onChange:function(e){var t;return r(null!==(t=e.value)&&void 0!==t?t:"GET")}})),n().createElement(C.InlineField,{grow:!0},n().createElement(C.Input,{placeholder:"/orders/${orderId}",value:a,onChange:function(e){return o(e.currentTarget.value)}})))};function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},st.apply(this,arguments)}function ut(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)||function(e,t){if(!e)return;if("string"==typeof e)return ct(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ct(e,t)}(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 ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var lt=["authorization","proxy-authorization","x-api-key"],ft=function(e){var t,a,o,i,s,u,c,l=e.query,f=e.onChange,p=e.onRunQuery,h=e.fieldsTab,d=e.experimentalTab,v=ut((0,r.useState)("plaintext"),2),y=v[0],g=v[1],m=ut((0,r.useState)(0),2),b=m[0],w=m[1],x=(0,C.useTheme)(),k=Se()(l,Qe),E=function(e){f(st({},k,{body:e})),p()},S=[{title:"Fields",content:h},{title:"Path",content:n().createElement(it,{method:null!==(t=k.method)&&void 0!==t?t:"GET",onMethodChange:function(e){f(st({},k,{method:e})),p()},path:null!==(a=k.urlPath)&&void 0!==a?a:"",onPathChange:function(e){f(st({},k,{urlPath:e})),p()}})},{title:"Params",content:n().createElement(at,{addRowLabel:"Add param",columns:["Key","Value"],values:null!==(o=k.params)&&void 0!==o?o:[],onChange:function(e){f(st({},k,{params:e})),p()},onBlur:function(){return p()}})},{title:"Headers",content:n().createElement(at,{addRowLabel:"Add header",columns:["Key","Value"],values:null!==(i=k.headers)&&void 0!==i?i:[],onChange:function(e){f(st({},k,{headers:e})),p()},onBlur:function(){return p()}})},{title:"Body",content:n().createElement(n().Fragment,null,n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{label:"Syntax highlighting"},n().createElement(C.RadioButtonGroup,{value:y,onChange:function(e){return g(null!=e?e:"plaintext")},options:[{label:"Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"XML",value:"xml"}]}))),n().createElement(C.InlineFieldRow,null,n().createElement(Le,{disableHeight:!0,className:(0,ke.css)(nt||(u=["\n margin-bottom: ",";\n "],c||(c=u.slice(0)),nt=Object.freeze(Object.defineProperties(u,{raw:{value:Object.freeze(c)}}))),x.spacing.sm)},(function(e){var t=e.width;return n().createElement(C.CodeEditor,{value:k.body||"",language:y,width:t,height:"200px",showMiniMap:!1,showLineNumbers:!0,onBlur:E})}))))},{title:"Experimental",content:d}];return n().createElement(n().Fragment,null,n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,null,n().createElement(C.RadioButtonGroup,{onChange:function(e){return w(null!=e?e:0)},value:b,options:S.map((function(e,t){return{label:e.title,value:t}}))})),n().createElement(C.InlineField,{label:"Cache Time",tooltip:"Time in seconds that the response will be cached in Grafana after receiving it."},n().createElement(C.Segment,{value:{label:pt(k.cacheDurationSeconds),value:k.cacheDurationSeconds},options:[0,5,10,30,60,120,300,600,1800,3600,7200,18e3].map((function(e){return{label:pt(e),value:e,description:e?"":"Response is not cached at all"}})),onChange:function(e){var t=e.value;return f(st({},k,{cacheDurationSeconds:t}))}}))),"GET"===k.method&&k.body&&n().createElement(C.InfoBox,{severity:"warning",style:{maxWidth:"700px",whiteSpace:"normal"}},"GET requests can't have a body. The body you've defined will be ignored."),(null!==(s=k.headers)&&void 0!==s?s:[]).map((function(e){var t=ut(e,2),r=t[0];t[1];return r.toLowerCase()})).find((function(e){return lt.includes(e)}))&&n().createElement(C.InfoBox,{severity:"warning",style:{maxWidth:"700px",whiteSpace:"normal"}},"It looks like you're adding credentials in the header. Since queries are stored unencrypted, it's strongly recommended that you add any secrets to the data source config instead."),S[b].content)},pt=function(e){return e<60?e+"s":e<3600?e/60+"m":e/3600+"h"};function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ht.apply(this,arguments)}var dt=function(e){var t=e.query,r=e.editorContext,a=e.onChange,o=e.onRunQuery;return n().createElement(ft,ht({},e,{editorContext:r||"default",fieldsTab:n().createElement(xe,{value:t.fields,onChange:function(e){a(ht({},t,{fields:e})),o()},limit:e.limitFields,onComplete:function(){return e.datasource.metadataRequest(e.query,e.range)}}),experimentalTab:n().createElement(ae,{query:t,onChange:a,onRunQuery:o,editorContext:r||"default"})}))};function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vt.apply(this,arguments)}var yt=l(51),gt=l(52),mt=l.n(gt),bt=l(55),wt=l.n(bt),xt=l(53),kt=l.n(xt);function Et(e){return Et="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},Et(e)}function St(){St=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new A(a||[]);return n(i,"_invoke",{value:x(e,r,s)}),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function p(){}function h(){}function d(){}var v={};u(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==t&&r.call(g,o)&&(v=g);var m=d.prototype=p.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(n,o,i,s){var u=l(e[n],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Et(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,s)}),(function(e){a("throw",e,i,s)})):t.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return a("throw",e,i,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){a(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return _()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=k(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=l(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=u(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(c(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(m),u(m,s,"Generator"),u(m,o,(function(){return this})),u(m,"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=O,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.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,f):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),f},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),S(r),f}},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;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function At(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)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ot(e,t)}(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 Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _t(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 jt(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){_t(o,n,a,i,s,"next",e)}function s(e){_t(o,n,a,i,s,"throw",e)}i(void 0)}))}}function Tt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ct(n.key),n)}}function Ft(e,t,r){return(t=Ct(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ct(e){var t=function(e,t){if("object"!==Et(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Et(t)?t:String(t)}var Dt=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ft(this,"cache",void 0),Ft(this,"baseUrl",void 0),Ft(this,"params",void 0),Ft(this,"lastCacheDuration",void 0),this.baseUrl=t,this.params=new URLSearchParams("?"+r),this.cache=new(kt().Cache)}var t,r,n,a,o,i;return t=e,r=[{key:"get",value:(i=jt(St().mark((function e(t,r,n,a,o){var i,s,u;return St().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},s=0,(null!=n?n:[]).forEach((function(e){var t=At(e,2),r=t[0],n=t[1];r&&(i[r+"__"+s]=n,s++)})),this.params.forEach((function(e,t){i[t]=e})),u=this._request(t,r,i,a,o),e.next=7,u.toPromise();case 7:return e.abrupt("return",e.sent.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,a){return i.apply(this,arguments)})},{key:"test",value:(o=jt(St().mark((function e(){var t;return St().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},this.params.forEach((function(e,r){t[r]=e})),e.abrupt("return",this._request("GET","",t).toPromise());case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"cachedGet",value:(a=jt(St().mark((function e(t,r,n,a,o,i){var s,u,c;return St().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=4;break}return e.next=3,this.get(r,n,a,o,i);case 3:return e.abrupt("return",e.sent);case 4:if(s=this.baseUrl+n,a&&Object.keys(a).length>0&&(s=s+(s.search(/\?/)>=0?"&":"?")+a.map((function(e){var t=At(e,2),r=t[0],n=t[1];return"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))})).join("&")),this.lastCacheDuration!==t&&this.cache.del(s),this.lastCacheDuration=t,!(u=this.cache.get(s))){e.next=11;break}return e.abrupt("return",Promise.resolve(u));case 11:return e.next=13,this.get(r,n,a,o,i);case 13:return c=e.sent,this.cache.put(s,c,1e3*t),e.abrupt("return",c);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o,i){return a.apply(this,arguments)})},{key:"_request",value:function(e,t,r,n,a){var o={};(null!=n?n:[]).filter((function(e){var t=At(e,2),r=t[0];return t[1],r})).forEach((function(e){var t=At(e,2),r=t[0],n=t[1];o[r]=n}));var i={url:this.baseUrl+t,method:e,headers:o};return"GET"!==i.method&&a&&(i.data=a),i.url=i.url.replace(/[\/]+/g,"/"),r&&Object.keys(r).length>0&&(i.url=i.url+(i.url.search(/\?/)>=0?"&":"?")+Object.entries(r).map((function(e){var t=At(e,2),r=t[0],n=t[1];return"".concat(encodeURIComponent(r.replace(/__\d+$/,"")),"=").concat(encodeURIComponent(n))})).join("&")),(0,yt.getBackendSrv)().fetch(i)}}],r&&Tt(t.prototype,r),n&&Tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Pt=l(56),It=l.n(Pt),Nt=function(t){return t.every((function(e){return null===e}))?e.FieldType.string:t.filter((function(e){return null!==e})).every((function(e){return It()(e,[It().defaultFormat,"YYYY-MM-DD"],!0).isValid()}))?e.FieldType.time:t.every((function(e){return"number"==typeof e}))?e.FieldType.number:t.every((function(e){return"boolean"==typeof e}))?e.FieldType.boolean:e.FieldType.string},$t=l(18),Mt=l.n($t);function Lt(e){return Lt="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},Lt(e)}var Rt=function(t,r){switch(r){case e.FieldType.time:if(t.filter((function(e){return e})).every((function(e){return"string"==typeof e})))return t.map((function(e){return null!==e?Mt()(e).valueOf():e}));if(t.filter((function(e){return e})).every((function(e){return"number"==typeof e}))){return t.filter((function(e){return e})).every((function(e){return e<1e12}))?t.map((function(e){return null!==e?1e3*e:e})):t}throw new Error("Unsupported time property");case e.FieldType.string:return t.every((function(e){return"string"==typeof e}))?t:t.map((function(e){return null===e?e:"object"===Lt(e)?JSON.stringify(e):e.toString()}));case e.FieldType.number:return t.every((function(e){return"number"==typeof e}))?t:t.map((function(e){return null!==e?parseFloat(e):e}));case e.FieldType.boolean:return t.every((function(e){return"boolean"==typeof e}))?t:t.map((function(e){if(null===e)return e;switch(e.toString()){case"0":case"false":case"FALSE":case"False":return!1;case"1":case"true":case"TRUE":case"True":return!0;default:throw new Error("Found non-boolean values in a field of type boolean: "+e.toString())}}));default:throw new Error("Unsupported field type")}};function zt(e){return zt="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},zt(e)}function Ut(e){return function(e){if(Array.isArray(e))return Gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Bt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(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)||Bt(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 Bt(e,t){if(e){if("string"==typeof e)return Gt(e,t);var r=Object.prototype.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)?Gt(e,t):void 0}}function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wt.apply(this,arguments)}function Yt(){Yt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new A(a||[]);return n(i,"_invoke",{value:x(e,r,s)}),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function p(){}function h(){}function d(){}var v={};u(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==t&&r.call(g,o)&&(v=g);var m=d.prototype=p.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(n,o,i,s){var u=l(e[n],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==zt(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,s)}),(function(e){a("throw",e,i,s)})):t.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return a("throw",e,i,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){a(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return _()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=k(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=l(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=u(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(c(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(m),u(m,s,"Generator"),u(m,o,(function(){return this})),u(m,"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=O,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.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,f):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),f},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),S(r),f}},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;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function Ht(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 Jt(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ht(o,n,a,i,s,"next",e)}function s(e){Ht(o,n,a,i,s,"throw",e)}i(void 0)}))}}function Vt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tr(n.key),n)}}function Zt(e,t){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zt(e,t)}function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var a=Kt(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===zt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xt(e)}(this,r)}}function Xt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kt(e)}function er(e,t,r){return(t=tr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tr(e){var t=function(e,t){if("object"!==zt(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===zt(t)?t:String(t)}var rr=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zt(e,t)}(p,t);var r,n,a,o,i,s,u,c,l,f=Qt(p);function p(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),er(Xt(t=f.call(this,e)),"api",void 0),er(Xt(t),"annotations",{}),t.api=new Dt(e.url,e.jsonData.queryParams||""),t}return r=p,n=[{key:"metadataRequest",value:(l=Jt(Yt().mark((function e(t,r){return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestJson(t,nr({},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"query",value:(c=Jt(Yt().mark((function e(t){var r,n,a=this;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.targets.filter((function(e){return!e.hide})).flatMap((function(e){return a.doRequest(e,t.range,t.scopedVars)}));case 2:return r=e.sent,e.next=5,Promise.all(r);case 5:return n=e.sent,e.abrupt("return",{data:n.flatMap((function(e){return e}))});case 7:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)})},{key:"metricFindQuery",value:(u=Jt(Yt().mark((function e(t,r){var n,a,o,i,s,u;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.doRequest(t,r.range);case 2:if(o=e.sent,(i=o[0]).fields.length){e.next=6;break}return e.abrupt("return",[]);case 6:return s=null!==(n=i.fields.find((function(e){return e.name===t.experimentalVariableTextField})))&&void 0!==n?n:i.fields[0],u=null!==(a=i.fields.find((function(e){return e.name===t.experimentalVariableValueField})))&&void 0!==a?a:s,e.abrupt("return",Array.from({length:i.length}).map((function(e,t){return{text:s.values.get(t),value:u.values.get(t)}})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"testDatasource",value:(s=Jt(Yt().mark((function e(){var t,r,n;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="Cannot connect to API",e.prev=1,e.next=4,this.api.test();case 4:if(200!==(r=e.sent).status){e.next=9;break}return e.abrupt("return",{status:"success",message:"Success"});case 9:return e.abrupt("return",{status:"error",message:r.statusText?r.statusText:t});case 10:e.next=22;break;case 12:if(e.prev=12,e.t0=e.catch(1),!wt().isString(e.t0)){e.next=18;break}return e.abrupt("return",{status:"error",message:e.t0});case 18:return n="JSON API: ",n+=e.t0.statusText?e.t0.statusText:t,e.t0.data&&e.t0.data.error&&e.t0.data.error.code&&(n+=": "+e.t0.data.error.code+". "+e.t0.data.error.message),e.abrupt("return",{status:"error",message:n});case 22:case"end":return e.stop()}}),e,this,[[1,12]])}))),function(){return s.apply(this,arguments)})},{key:"doRequest",value:(i=Jt(Yt().mark((function t(r,n,a){var o,i,s,u,c,l,f;return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=nr(a,n),t.next=3,this.requestJson(r,i);case 3:if(s=t.sent){t.next=6;break}throw new Error("Query returned empty data");case 6:if(u=(null!==(o=r.fields)&&void 0!==o?o:[]).filter((function(e){return e.jsonPath})).map((function(t,a){var o,u;if("jsonata"===t.language){var c=mt()(t.jsonPath),l={};(0,yt.getTemplateSrv)().getVariables().map((function(e){return{name:e.name,value:ir(e.name)}})).forEach((function(e){l[e.name]=e.value})),sr.map((function(e){return{name:e,value:ir(e)}})).forEach((function(e){l[e.name]=e.value})),n&&(l.__unixEpochFrom=n.from.valueOf(),l.__unixEpochTo=n.to.valueOf(),l.__isoFrom=n.from.toISOString(),l.__isoTo=n.to.toISOString());var f=c.evaluate(s,l),p=Array.isArray(f)?f:[f];return{name:i(null!==(o=t.name)&&void 0!==o?o:"")||(r.fields.length>1?"result".concat(a):"result"),type:t.type?t.type:Nt(p),values:new e.ArrayVector(p),config:{}}}var h=i(t.jsonPath),d=se({path:h,json:s}),v=H.toPathArray(h),y=t.type?t.type:Nt(d),g=Rt(d,y);return{name:i(null!==(u=t.name)&&void 0!==u?u:"")||v[v.length-1],type:y,values:new e.ArrayVector(g),config:{}}})),c=u.map((function(e){return e.values.length})),!(Array.from(new Set(c)).length>1)){t.next=11;break}throw new Error("Fields have different lengths");case 11:return l=r.experimentalGroupByField?or((0,e.toDataFrame)({name:r.refId,refId:r.refId,fields:u}),r.experimentalGroupByField):[(0,e.toDataFrame)({name:r.refId,refId:r.refId,fields:u})],f=l.map((function(e){return Wt({},e,{fields:e.fields.map((function(t){return t.name===r.experimentalMetricField?Wt({},t,{config:{displayNameFromDS:e.name}}):t}))})})),t.abrupt("return",f);case 14:case"end":return t.stop()}}),t,this)}))),function(e,t,r){return i.apply(this,arguments)})},{key:"requestJson",value:(o=Jt(Yt().mark((function e(t,r){var n,a,o;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){var t=qt(e,2),n=t[0],a=t[1];return[r(n),r(a)]},e.next=3,this.api.cachedGet(t.cacheDurationSeconds,t.method,r(t.urlPath),(null!==(n=t.params)&&void 0!==n?n:[]).map(o),(null!==(a=t.headers)&&void 0!==a?a:[]).map(o),r(t.body));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})}],n&&Vt(r.prototype,n),a&&Vt(r,a),Object.defineProperty(r,"prototype",{writable:!1}),p}(e.DataSourceApi),nr=function(e,t){return function(r){return ar((0,yt.getTemplateSrv)().replace(r,e),t)}},ar=function(e,t){return t?e.replace(/\$__unixEpochFrom\(\)/g,t.from.unix().toString()).replace(/\$__unixEpochTo\(\)/g,t.to.unix().toString()).replace(/\$__isoFrom\(\)/g,t.from.toISOString()).replace(/\$__isoTo\(\)/g,t.to.toISOString()):e},or=function(t,r){var n=t.fields.find((function(e){return e.name===r}));return n?Ut(new Set(n.values.toArray())).map((function(r){var a=t.fields.filter((function(e){return e.name.toString()!==n.name})).map((function(t){return Wt({},t,{values:new e.ArrayVector(t.values.toArray().filter((function(e,t){return n.values.get(t)===r})))})}));return(0,e.toDataFrame)({name:r,refId:t.refId,fields:a})})):[t]},ir=function(e){var t=[];return(0,yt.getTemplateSrv)().replace("$".concat(e),{},(function(e){return Array.isArray(e)?t.push.apply(t,Ut(e)):t.push(e),""})),t},sr=["__dashboard","__from","__to","__interval","__interval_ms","__name","__org","__user","__range","__rate_interval","timeFilter","__timeFilter"],ur=new e.DataSourcePlugin(rr).setConfigEditor((function(e){var t=e.options,r=e.onOptionsChange;return n().createElement(n().Fragment,null,n().createElement(C.DataSourceHttpSettings,{defaultUrl:"http://localhost:8080",dataSourceConfig:t,onChange:r}),F||(F=n().createElement("h3",{className:"page-heading"},"Misc")),n().createElement(C.InlineFieldRow,null,n().createElement(C.InlineField,{label:"Query string",tooltip:"Add a custom query string to your queries."},n().createElement(C.Input,{width:50,value:t.jsonData.queryParams,onChange:function(e){r(D({},t,{jsonData:D({},t.jsonData,{queryParams:e.currentTarget.value})}))},spellCheck:!1,placeholder:"page=1&limit=100"}))))})).setQueryEditor(dt).setVariableQueryEditor((function(e){var t=e.query,r=e.onChange,a=Se()(t,Qe);return n().createElement(dt,vt({},e,{onRunQuery:function(){},onChange:function(e){e&&r(e,e.fields[0].jsonPath)},query:a,limitFields:2,editorContext:"variables"}))}))})(),f})()));
|
|
//# sourceMappingURL=module.js.map
|