@cubejs-backend/server-core 1.6.38 → 1.6.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,6 +138,9 @@ export declare class RefreshScheduler {
138
138
  sealAt?: string;
139
139
  rollupLambdaId?: string;
140
140
  lastRollupLambda?: boolean;
141
+ usageMapping?: Record<string, {
142
+ dateRange?: import("@cubejs-backend/query-orchestrator").QueryDateRange;
143
+ }>;
141
144
  }[];
142
145
  cacheMode: string;
143
146
  requestId: any;
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshScheduler.d.ts","sourceRoot":"","sources":["../../../src/core/RefreshScheduler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,KAAK,+BAA+B,GAAG,QAAQ,CAAC,uBAAuB,EAAE,aAAa,GAAG,eAAe,CAAC,GAAG;IAC1G,cAAc,EAAE;QACd,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,eAAe,EAAE;QACf,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;KACtB,EAAE,CAAC;IACJ,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,yBAAyB,EAAE,CAAC;IACxC,iBAAiB,EAAE,yBAAyB,EAAE,EAAE,CAAC;CAClD,CAAC;AAeF,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QAAE,eAAe,EAAE,GAAG,CAAA;KAAE,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,GAAG,EAAE,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAwDF,qBAAa,gBAAgB;IAEzB,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB;gBAA5B,UAAU,EAAE,gBAAgB;cAIjC,+BAA+B,CAC7C,OAAO,KAAA,EACP,WAAW,EAAE,WAAW,EACxB,cAAc,KAAA,EACd,eAAe,EAAE,+BAA+B,GAC/C,OAAO,CAAC,cAAc,CAAC;cA6CV,0BAA0B,CACxC,WAAW,EAAE,WAAW,EACxB,cAAc,KAAA,EACd,eAAe,EAAE,+BAA+B;IAiClD;;OAEG;cACa,uBAAuB,CACrC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAuBZ,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,uBAAuB,CAAC;;;IA0DvG;;OAEG;cACa,cAAc,CAC5B,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW;cAiBV,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,+BAA+B;IAwCrC,wBAAwB,CACnC,OAAO,KAAA,EACP,eAAe,EAAE,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwGjC,6CAA6C,CAAC,OAAO,KAAA,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,KAAA,EAAE,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2GzK,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,+BAA+B;IA6ErC,oBAAoB,CAC/B,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,8BAA8B;IA2CjD;;OAEG;IACU,aAAa,CACxB,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,8BAA8B,GAC9C,OAAO,CAAC,MAAM,EAAE,CAAC;IA6FpB;;OAEG;IACU,kBAAkB,CAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC;QAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAoBvD"}
1
+ {"version":3,"file":"RefreshScheduler.d.ts","sourceRoot":"","sources":["../../../src/core/RefreshScheduler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,KAAK,+BAA+B,GAAG,QAAQ,CAAC,uBAAuB,EAAE,aAAa,GAAG,eAAe,CAAC,GAAG;IAC1G,cAAc,EAAE;QACd,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,eAAe,EAAE;QACf,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;KACtB,EAAE,CAAC;IACJ,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,yBAAyB,EAAE,CAAC;IACxC,iBAAiB,EAAE,yBAAyB,EAAE,EAAE,CAAC;CAClD,CAAC;AAeF,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QAAE,eAAe,EAAE,GAAG,CAAA;KAAE,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,GAAG,EAAE,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAwDF,qBAAa,gBAAgB;IAEzB,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB;gBAA5B,UAAU,EAAE,gBAAgB;cAIjC,+BAA+B,CAC7C,OAAO,KAAA,EACP,WAAW,EAAE,WAAW,EACxB,cAAc,KAAA,EACd,eAAe,EAAE,+BAA+B,GAC/C,OAAO,CAAC,cAAc,CAAC;cA6CV,0BAA0B,CACxC,WAAW,EAAE,WAAW,EACxB,cAAc,KAAA,EACd,eAAe,EAAE,+BAA+B;IAiClD;;OAEG;cACa,uBAAuB,CACrC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAuBZ,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,uBAAuB,CAAC;;;IA0DvG;;OAEG;cACa,cAAc,CAC5B,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW;cAiBV,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,+BAA+B;IAwCrC,wBAAwB,CACnC,OAAO,KAAA,EACP,eAAe,EAAE,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwGjC,6CAA6C,CAAC,OAAO,KAAA,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,KAAA,EAAE,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2GzK,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,+BAA+B;IA6ErC,oBAAoB,CAC/B,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,8BAA8B;IA2CjD;;OAEG;IACU,aAAa,CACxB,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,8BAA8B,GAC9C,OAAO,CAAC,MAAM,EAAE,CAAC;IA6FpB;;OAEG;IACU,kBAAkB,CAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC;QAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAoBvD"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cubejs-backend/server-core",
3
3
  "description": "Cube.js base component to wire all backend components together",
4
4
  "author": "Cube Dev, Inc.",
5
- "version": "1.6.38",
5
+ "version": "1.6.40",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.git",
@@ -29,16 +29,16 @@
29
29
  "unit": "jest --runInBand --forceExit --coverage dist/test"
30
30
  },
31
31
  "dependencies": {
32
- "@cubejs-backend/api-gateway": "1.6.38",
33
- "@cubejs-backend/base-driver": "1.6.38",
34
- "@cubejs-backend/cloud": "1.6.38",
35
- "@cubejs-backend/cubestore-driver": "1.6.38",
32
+ "@cubejs-backend/api-gateway": "1.6.40",
33
+ "@cubejs-backend/base-driver": "1.6.40",
34
+ "@cubejs-backend/cloud": "1.6.40",
35
+ "@cubejs-backend/cubestore-driver": "1.6.40",
36
36
  "@cubejs-backend/dotenv": "^9.0.2",
37
- "@cubejs-backend/native": "1.6.38",
38
- "@cubejs-backend/query-orchestrator": "1.6.38",
39
- "@cubejs-backend/schema-compiler": "1.6.38",
40
- "@cubejs-backend/shared": "1.6.38",
41
- "@cubejs-backend/templates": "1.6.38",
37
+ "@cubejs-backend/native": "1.6.40",
38
+ "@cubejs-backend/query-orchestrator": "1.6.40",
39
+ "@cubejs-backend/schema-compiler": "1.6.40",
40
+ "@cubejs-backend/shared": "1.6.40",
41
+ "@cubejs-backend/templates": "1.6.40",
42
42
  "codesandbox-import-utils": "^2.1.12",
43
43
  "cross-spawn": "^7.0.1",
44
44
  "fs-extra": "^8.1.0",
@@ -62,8 +62,8 @@
62
62
  "ws": "^7.5.3"
63
63
  },
64
64
  "devDependencies": {
65
- "@cubejs-backend/linter": "1.6.38",
66
- "@cubejs-client/playground": "1.6.38",
65
+ "@cubejs-backend/linter": "1.6.40",
66
+ "@cubejs-client/playground": "1.6.40",
67
67
  "@types/cross-spawn": "^6.0.2",
68
68
  "@types/express": "^4.17.21",
69
69
  "@types/fs-extra": "^9.0.8",
@@ -80,5 +80,5 @@
80
80
  "eslintConfig": {
81
81
  "extends": "../cubejs-linter"
82
82
  },
83
- "gitHead": "7f1ec2ec0b59a9a0e4749b8edff17326b0423ebb"
83
+ "gitHead": "ca686109d640b6b9e8ba0f4dc484f6de266d5860"
84
84
  }
@@ -974,7 +974,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
974
974
  ${l=>l.theme.background}
975
975
  );
976
976
  }
977
- `;function CodeSnippet({code:l,language:p,style:h,copyMessage:de,theme:pe=`dark`}){return(0,import_jsx_runtime.jsx)(ot,{theme:{background:pe===`dark`?`#F6F6F8`:`#FFFFFF`},children:(0,import_jsx_runtime.jsxs)(StyledCodeSnippet,{style:h,children:[(0,import_jsx_runtime.jsx)(PrismCode,{code:l,language:p,style:{flexGrow:1}}),(0,import_jsx_runtime.jsx)(ButtonWrapper$1,{children:(0,import_jsx_runtime.jsx)(button_default,{icon:(0,import_jsx_runtime.jsx)(RefIcon$26,{}),onClick:()=>copyToClipboard(l,de||`Copied`)})})]})})}function useAppContext(){return(0,import_react.useContext)(AppContext$1)}function usePlaygroundContext(){let{playgroundContext:l}=useAppContext();return l}function useToken(){let{token:l}=useAppContext();return l}var byteToHex$1=[];for(let l=0;l<256;++l)byteToHex$1.push((l+256).toString(16).slice(1));function unsafeStringify(l,p=0){return(byteToHex$1[l[p+0]]+byteToHex$1[l[p+1]]+byteToHex$1[l[p+2]]+byteToHex$1[l[p+3]]+`-`+byteToHex$1[l[p+4]]+byteToHex$1[l[p+5]]+`-`+byteToHex$1[l[p+6]]+byteToHex$1[l[p+7]]+`-`+byteToHex$1[l[p+8]]+byteToHex$1[l[p+9]]+`-`+byteToHex$1[l[p+10]]+byteToHex$1[l[p+11]]+byteToHex$1[l[p+12]]+byteToHex$1[l[p+13]]+byteToHex$1[l[p+14]]+byteToHex$1[l[p+15]]).toLowerCase()}var getRandomValues$1,rnds8$1=new Uint8Array(16);function rng$1(){if(!getRandomValues$1){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);getRandomValues$1=crypto.getRandomValues.bind(crypto)}return getRandomValues$1(rnds8$1)}var randomUUID=typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native_default={randomUUID};function v4$1(l,p,h){if(native_default.randomUUID&&!p&&!l)return native_default.randomUUID();l=l||{};let de=l.random??l.rng?.()??rng$1();if(de.length<16)throw Error(`Random bytes length must be >= 16`);if(de[6]=de[6]&15|64,de[8]=de[8]&63|128,p){if(h=h||0,h<0||h+16>p.length)throw RangeError(`UUID byte range ${h}:${h+15} is out of buffer bounds`);for(let l=0;l<16;++l)p[h+l]=de[l];return p}return unsafeStringify(de)}var require_dayjs_min=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs=de()})(l,(function(){var l=1e3,p=6e4,h=36e5,de=`millisecond`,pe=`second`,me=`minute`,nt=`hour`,st=`day`,mt=`week`,_t=`month`,yt=`quarter`,bt=`year`,xt=`date`,St=`Invalid Date`,Ct=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,wt=/\[([^\]]+)]|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,Tt={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(`_`)},Et=function(l,p,h){var de=String(l);return!de||de.length>=p?l:``+Array(p+1-de.length).join(h)+l},Dt={s:Et,z:function(l){var p=-l.utcOffset(),h=Math.abs(p),de=Math.floor(h/60),pe=h%60;return(p<=0?`+`:`-`)+Et(de,2,`0`)+`:`+Et(pe,2,`0`)},m:function l(p,h){if(p.date()<h.date())return-l(h,p);var de=12*(h.year()-p.year())+(h.month()-p.month()),pe=p.clone().add(de,_t),me=h-pe<0,nt=p.clone().add(de+(me?-1:1),_t);return+(-(de+(h-pe)/(me?pe-nt:nt-pe))||0)},a:function(l){return l<0?Math.ceil(l)||0:Math.floor(l)},p:function(l){return{M:_t,y:bt,w:mt,d:st,D:xt,h:nt,m:me,s:pe,ms:de,Q:yt}[l]||String(l||``).toLowerCase().replace(/s$/,``)},u:function(l){return l===void 0}},Ot=`en`,kt={};kt[Ot]=Tt;var At=function(l){return l instanceof Pt},jt=function(l,p,h){var de;if(!l)return Ot;if(typeof l==`string`)kt[l]&&(de=l),p&&(kt[l]=p,de=l);else{var pe=l.name;kt[pe]=l,de=pe}return!h&&de&&(Ot=de),de||!h&&Ot},Mt=function(l,p){if(At(l))return l.clone();var h=typeof p==`object`?p:{};return h.date=l,h.args=arguments,new Pt(h)},Nt=Dt;Nt.l=jt,Nt.i=At,Nt.w=function(l,p){return Mt(l,{locale:p.$L,utc:p.$u,x:p.$x,$offset:p.$offset})};var Pt=function(){function Tt(l){this.$L=jt(l.locale,null,!0),this.parse(l)}var Et=Tt.prototype;return Et.parse=function(l){this.$d=function(l){var p=l.date,h=l.utc;if(p===null)return new Date(NaN);if(Nt.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p==`string`&&!/Z$/i.test(p)){var de=p.match(Ct);if(de){var pe=de[2]-1||0,me=(de[7]||`0`).substring(0,3);return h?new Date(Date.UTC(de[1],pe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,me)):new Date(de[1],pe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,me)}}return new Date(p)}(l),this.$x=l.x||{},this.init()},Et.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},Et.$utils=function(){return Nt},Et.isValid=function(){return this.$d.toString()!==St},Et.isSame=function(l,p){var h=Mt(l);return this.startOf(p)<=h&&h<=this.endOf(p)},Et.isAfter=function(l,p){return Mt(l)<this.startOf(p)},Et.isBefore=function(l,p){return this.endOf(p)<Mt(l)},Et.$g=function(l,p,h){return Nt.u(l)?this[p]:this.set(h,l)},Et.unix=function(){return Math.floor(this.valueOf()/1e3)},Et.valueOf=function(){return this.$d.getTime()},Et.startOf=function(l,p){var h=this,de=!!Nt.u(p)||p,yt=Nt.p(l),St=function(l,p){var pe=Nt.w(h.$u?Date.UTC(h.$y,p,l):new Date(h.$y,p,l),h);return de?pe:pe.endOf(st)},Ct=function(l,p){return Nt.w(h.toDate()[l].apply(h.toDate(`s`),(de?[0,0,0,0]:[23,59,59,999]).slice(p)),h)},wt=this.$W,Tt=this.$M,Et=this.$D,Dt=`set`+(this.$u?`UTC`:``);switch(yt){case bt:return de?St(1,0):St(31,11);case _t:return de?St(1,Tt):St(0,Tt+1);case mt:var Ot=this.$locale().weekStart||0,kt=(wt<Ot?wt+7:wt)-Ot;return St(de?Et-kt:Et+(6-kt),Tt);case st:case xt:return Ct(Dt+`Hours`,0);case nt:return Ct(Dt+`Minutes`,1);case me:return Ct(Dt+`Seconds`,2);case pe:return Ct(Dt+`Milliseconds`,3);default:return this.clone()}},Et.endOf=function(l){return this.startOf(l,!1)},Et.$set=function(l,p){var h,mt=Nt.p(l),yt=`set`+(this.$u?`UTC`:``),St=(h={},h[st]=yt+`Date`,h[xt]=yt+`Date`,h[_t]=yt+`Month`,h[bt]=yt+`FullYear`,h[nt]=yt+`Hours`,h[me]=yt+`Minutes`,h[pe]=yt+`Seconds`,h[de]=yt+`Milliseconds`,h)[mt],Ct=mt===st?this.$D+(p-this.$W):p;if(mt===_t||mt===bt){var wt=this.clone().set(xt,1);wt.$d[St](Ct),wt.init(),this.$d=wt.set(xt,Math.min(this.$D,wt.daysInMonth())).$d}else St&&this.$d[St](Ct);return this.init(),this},Et.set=function(l,p){return this.clone().$set(l,p)},Et.get=function(l){return this[Nt.p(l)]()},Et.add=function(de,yt){var xt,St=this;de=Number(de);var Ct=Nt.p(yt),wt=function(l){var p=Mt(St);return Nt.w(p.date(p.date()+Math.round(l*de)),St)};if(Ct===_t)return this.set(_t,this.$M+de);if(Ct===bt)return this.set(bt,this.$y+de);if(Ct===st)return wt(1);if(Ct===mt)return wt(7);var Tt=(xt={},xt[me]=p,xt[nt]=h,xt[pe]=l,xt)[Ct]||1,Et=this.$d.getTime()+de*Tt;return Nt.w(Et,this)},Et.subtract=function(l,p){return this.add(-1*l,p)},Et.format=function(l){var p=this,h=this.$locale();if(!this.isValid())return h.invalidDate||St;var de=l||`YYYY-MM-DDTHH:mm:ssZ`,pe=Nt.z(this),me=this.$H,nt=this.$m,st=this.$M,mt=h.weekdays,_t=h.months,yt=function(l,h,pe,me){return l&&(l[h]||l(p,de))||pe[h].substr(0,me)},bt=function(l){return Nt.s(me%12||12,l,`0`)},xt=h.meridiem||function(l,p,h){var de=l<12?`AM`:`PM`;return h?de.toLowerCase():de},Ct={YY:String(this.$y).slice(-2),YYYY:this.$y,M:st+1,MM:Nt.s(st+1,2,`0`),MMM:yt(h.monthsShort,st,_t,3),MMMM:yt(_t,st),D:this.$D,DD:Nt.s(this.$D,2,`0`),d:String(this.$W),dd:yt(h.weekdaysMin,this.$W,mt,2),ddd:yt(h.weekdaysShort,this.$W,mt,3),dddd:mt[this.$W],H:String(me),HH:Nt.s(me,2,`0`),h:bt(1),hh:bt(2),a:xt(me,nt,!0),A:xt(me,nt,!1),m:String(nt),mm:Nt.s(nt,2,`0`),s:String(this.$s),ss:Nt.s(this.$s,2,`0`),SSS:Nt.s(this.$ms,3,`0`),Z:pe};return de.replace(wt,(function(l,p){return p||Ct[l]||pe.replace(`:`,``)}))},Et.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Et.diff=function(de,xt,St){var Ct,wt=Nt.p(xt),Tt=Mt(de),Et=(Tt.utcOffset()-this.utcOffset())*p,Dt=this-Tt,Ot=Nt.m(this,Tt);return Ot=(Ct={},Ct[bt]=Ot/12,Ct[_t]=Ot,Ct[yt]=Ot/3,Ct[mt]=(Dt-Et)/6048e5,Ct[st]=(Dt-Et)/864e5,Ct[nt]=Dt/h,Ct[me]=Dt/p,Ct[pe]=Dt/l,Ct)[wt]||Dt,St?Ot:Nt.a(Ot)},Et.daysInMonth=function(){return this.endOf(_t).$D},Et.$locale=function(){return kt[this.$L]},Et.locale=function(l,p){if(!l)return this.$L;var h=this.clone(),de=jt(l,p,!0);return de&&(h.$L=de),h},Et.clone=function(){return Nt.w(this.$d,this)},Et.toDate=function(){return new Date(this.valueOf())},Et.toJSON=function(){return this.isValid()?this.toISOString():null},Et.toISOString=function(){return this.$d.toISOString()},Et.toString=function(){return this.$d.toUTCString()},Tt}(),Ft=Pt.prototype;return Mt.prototype=Ft,[[`$ms`,de],[`$s`,pe],[`$m`,me],[`$H`,nt],[`$W`,st],[`$M`,_t],[`$y`,bt],[`$D`,xt]].forEach((function(l){Ft[l[1]]=function(p){return this.$g(p,l[0],l[1])}})),Mt.extend=function(l,p){return l.$i||(l(p,Pt,Mt),l.$i=!0),Mt},Mt.locale=jt,Mt.isDayjs=At,Mt.unix=function(l){return Mt(1e3*l)},Mt.en=kt[Ot],Mt.Ls=kt,Mt.p={},Mt}))}));function _isPlaceholder(l){return typeof l==`object`&&!!l&&l[`@@functional/placeholder`]===!0}function _curry1(l){return function p(h){return arguments.length===0||_isPlaceholder(h)?p:l.apply(this,arguments)}}function _curry2(l){return function p(h,de){switch(arguments.length){case 0:return p;case 1:return _isPlaceholder(h)?p:_curry1(function(p){return l(h,p)});default:return _isPlaceholder(h)&&_isPlaceholder(de)?p:_isPlaceholder(h)?_curry1(function(p){return l(p,de)}):_isPlaceholder(de)?_curry1(function(p){return l(h,p)}):l(h,de)}}}function _arity(l,p){switch(l){case 0:return function(){return p.apply(this,arguments)};case 1:return function(l){return p.apply(this,arguments)};case 2:return function(l,h){return p.apply(this,arguments)};case 3:return function(l,h,de){return p.apply(this,arguments)};case 4:return function(l,h,de,pe){return p.apply(this,arguments)};case 5:return function(l,h,de,pe,me){return p.apply(this,arguments)};case 6:return function(l,h,de,pe,me,nt){return p.apply(this,arguments)};case 7:return function(l,h,de,pe,me,nt,st){return p.apply(this,arguments)};case 8:return function(l,h,de,pe,me,nt,st,mt){return p.apply(this,arguments)};case 9:return function(l,h,de,pe,me,nt,st,mt,_t){return p.apply(this,arguments)};case 10:return function(l,h,de,pe,me,nt,st,mt,_t,yt){return p.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function _curryN(l,p,h){return function(){for(var de=[],pe=0,me=l,nt=0;nt<p.length||pe<arguments.length;){var st;nt<p.length&&(!_isPlaceholder(p[nt])||pe>=arguments.length)?st=p[nt]:(st=arguments[pe],pe+=1),de[nt]=st,_isPlaceholder(st)||--me,nt+=1}return me<=0?h.apply(this,de):_arity(me,_curryN(l,de,h))}}var curryN$1=_curry2(function(l,p){return l===1?_curry1(p):_arity(l,_curryN(l,[],p))});function _curry3(l){return function p(h,de,pe){switch(arguments.length){case 0:return p;case 1:return _isPlaceholder(h)?p:_curry2(function(p,de){return l(h,p,de)});case 2:return _isPlaceholder(h)&&_isPlaceholder(de)?p:_isPlaceholder(h)?_curry2(function(p,h){return l(p,de,h)}):_isPlaceholder(de)?_curry2(function(p,de){return l(h,p,de)}):_curry1(function(p){return l(h,de,p)});default:return _isPlaceholder(h)&&_isPlaceholder(de)&&_isPlaceholder(pe)?p:_isPlaceholder(h)&&_isPlaceholder(de)?_curry2(function(p,h){return l(p,h,pe)}):_isPlaceholder(h)&&_isPlaceholder(pe)?_curry2(function(p,h){return l(p,de,h)}):_isPlaceholder(de)&&_isPlaceholder(pe)?_curry2(function(p,de){return l(h,p,de)}):_isPlaceholder(h)?_curry1(function(p){return l(p,de,pe)}):_isPlaceholder(de)?_curry1(function(p){return l(h,p,pe)}):_isPlaceholder(pe)?_curry1(function(p){return l(h,de,p)}):l(h,de,pe)}}}var _isArray_default=Array.isArray||function(l){return l!=null&&l.length>=0&&Object.prototype.toString.call(l)===`[object Array]`};function _isTransformer(l){return l!=null&&typeof l[`@@transducer/step`]==`function`}function _dispatchable(l,p,h){return function(){if(arguments.length===0)return h();var de=Array.prototype.slice.call(arguments,0),pe=de.pop();if(!_isArray_default(pe)){for(var me=0;me<l.length;){if(typeof pe[l[me]]==`function`)return pe[l[me]].apply(pe,de);me+=1}if(_isTransformer(pe))return p.apply(null,de)(pe)}return h.apply(this,arguments)}}function _reduced(l){return l&&l[`@@transducer/reduced`]?l:{"@@transducer/value":l,"@@transducer/reduced":!0}}var _xfBase_default={init:function(){return this.xf[`@@transducer/init`]()},result:function(l){return this.xf[`@@transducer/result`](l)}};function _map(l,p){for(var h=0,de=p.length,pe=Array(de);h<de;)pe[h]=l(p[h]),h+=1;return pe}function _isString(l){return Object.prototype.toString.call(l)===`[object String]`}var _isArrayLike=_curry1(function(l){return _isArray_default(l)?!0:!l||typeof l!=`object`||_isString(l)?!1:l.nodeType===1?!!l.length:l.length===0?!0:l.length>0?l.hasOwnProperty(0)&&l.hasOwnProperty(l.length-1):!1}),XWrap=function(){function l(l){this.f=l}return l.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},l.prototype[`@@transducer/result`]=function(l){return l},l.prototype[`@@transducer/step`]=function(l,p){return this.f(l,p)},l}();function _xwrap(l){return new XWrap(l)}var bind$1=_curry2(function(l,p){return _arity(l.length,function(){return l.apply(p,arguments)})});function _arrayReduce(l,p,h){for(var de=0,pe=h.length;de<pe;){if(p=l[`@@transducer/step`](p,h[de]),p&&p[`@@transducer/reduced`]){p=p[`@@transducer/value`];break}de+=1}return l[`@@transducer/result`](p)}function _iterableReduce(l,p,h){for(var de=h.next();!de.done;){if(p=l[`@@transducer/step`](p,de.value),p&&p[`@@transducer/reduced`]){p=p[`@@transducer/value`];break}de=h.next()}return l[`@@transducer/result`](p)}function _methodReduce(l,p,h,de){return l[`@@transducer/result`](h[de](bind$1(l[`@@transducer/step`],l),p))}var symIterator=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function _reduce(l,p,h){if(typeof l==`function`&&(l=_xwrap(l)),_isArrayLike(h))return _arrayReduce(l,p,h);if(typeof h[`fantasy-land/reduce`]==`function`)return _methodReduce(l,p,h,`fantasy-land/reduce`);if(h[symIterator]!=null)return _iterableReduce(l,p,h[symIterator]());if(typeof h.next==`function`)return _iterableReduce(l,p,h);if(typeof h.reduce==`function`)return _methodReduce(l,p,h,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}var XMap=function(){function l(l,p){this.xf=p,this.f=l}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=_xfBase_default.result,l.prototype[`@@transducer/step`]=function(l,p){return this.xf[`@@transducer/step`](l,this.f(p))},l}(),_xmap=_curry2(function(l,p){return new XMap(l,p)});function _has(l,p){return Object.prototype.hasOwnProperty.call(p,l)}var toString$2=Object.prototype.toString,_isArguments=function(){return toString$2.call(arguments)===`[object Arguments]`?function(l){return toString$2.call(l)===`[object Arguments]`}:function(l){return _has(`callee`,l)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable(`toString`),nonEnumerableProps=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable(`length`)}(),contains$1=function(l,p){for(var h=0;h<l.length;){if(l[h]===p)return!0;h+=1}return!1},keys$1=_curry1(typeof Object.keys==`function`&&!hasArgsEnumBug?function(l){return Object(l)===l?Object.keys(l):[]}:function(l){if(Object(l)!==l)return[];var p,h,de=[],pe=hasArgsEnumBug&&_isArguments(l);for(p in l)_has(p,l)&&(!pe||p!==`length`)&&(de[de.length]=p);if(hasEnumBug)for(h=nonEnumerableProps.length-1;h>=0;)p=nonEnumerableProps[h],_has(p,l)&&!contains$1(de,p)&&(de[de.length]=p),--h;return de}),map$3=_curry2(_dispatchable([`fantasy-land/map`,`map`],_xmap,function(l,p){switch(Object.prototype.toString.call(p)){case`[object Function]`:return curryN$1(p.length,function(){return l.call(this,p.apply(this,arguments))});case`[object Object]`:return _reduce(function(h,de){return h[de]=l(p[de]),h},{},keys$1(p));default:return _map(l,p)}})),_isInteger_default=Number.isInteger||function(l){return l<<0===l},nth=_curry2(function(l,p){var h=l<0?p.length+l:l;return _isString(p)?p.charAt(h):p[h]}),paths=_curry2(function(l,p){return l.map(function(l){for(var h=p,de=0,pe;de<l.length;){if(h==null)return;pe=l[de],h=_isInteger_default(pe)?nth(pe,h):h[pe],de+=1}return h})}),path$1=_curry2(function(l,p){return paths([l],p)[0]}),prop=_curry2(function(l,p){return path$1([l],p)}),reduce=_curry3(_reduce);function _makeFlat(l){return function p(h){for(var de,pe,me,nt=[],st=0,mt=h.length;st<mt;){if(_isArrayLike(h[st]))for(de=l?p(h[st]):h[st],me=0,pe=de.length;me<pe;)nt[nt.length]=de[me],me+=1;else nt[nt.length]=h[st];st+=1}return nt}}function _forceReduced(l){return{"@@transducer/value":l,"@@transducer/reduced":!0}}var preservingReduced=function(l){return{"@@transducer/init":_xfBase_default.init,"@@transducer/result":function(p){return l[`@@transducer/result`](p)},"@@transducer/step":function(p,h){var de=l[`@@transducer/step`](p,h);return de[`@@transducer/reduced`]?_forceReduced(de):de}}},_flatCat=function(l){var p=preservingReduced(l);return{"@@transducer/init":_xfBase_default.init,"@@transducer/result":function(l){return p[`@@transducer/result`](l)},"@@transducer/step":function(l,h){return _isArrayLike(h)?_reduce(p,l,h):_reduce(p,l,[h])}}},_xchain=_curry2(function(l,p){return map$3(l,_flatCat(p))}),chain=_curry2(_dispatchable([`fantasy-land/chain`,`chain`],_xchain,function(l,p){return typeof p==`function`?function(h){return l(p(h))(h)}:_makeFlat(!1)(map$3(l,p))}));function _cloneRegExp(l){return new RegExp(l.source,(l.global?`g`:``)+(l.ignoreCase?`i`:``)+(l.multiline?`m`:``)+(l.sticky?`y`:``)+(l.unicode?`u`:``))}var type$1=_curry1(function(l){return l===null?`Null`:l===void 0?`Undefined`:Object.prototype.toString.call(l).slice(8,-1)});function _clone(l,p,h,de){var pe=function(pe){for(var me=p.length,nt=0;nt<me;){if(l===p[nt])return h[nt];nt+=1}for(var st in p[nt+1]=l,h[nt+1]=pe,l)pe[st]=de?_clone(l[st],p,h,!0):l[st];return pe};switch(type$1(l)){case`Object`:return pe({});case`Array`:return pe([]);case`Date`:return new Date(l.valueOf());case`RegExp`:return _cloneRegExp(l);default:return l}}var clone=_curry1(function(l){return l!=null&&typeof l.clone==`function`?l.clone():_clone(l,[],[],!0)});function _pipe(l,p){return function(){return p.call(this,l.apply(this,arguments))}}function _checkForMethod(l,p){return function(){var h=arguments.length;if(h===0)return p();var de=arguments[h-1];return _isArray_default(de)||typeof de[l]!=`function`?p.apply(this,arguments):de[l].apply(de,Array.prototype.slice.call(arguments,0,h-1))}}var slice$3=_curry3(_checkForMethod(`slice`,function(l,p,h){return Array.prototype.slice.call(h,l,p)})),tail=_curry1(_checkForMethod(`tail`,slice$3(1,1/0)));function pipe(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}function _identity(l){return l}var identity$5=_curry1(_identity);function _arrayFromIterator(l){for(var p=[],h;!(h=l.next()).done;)p.push(h.value);return p}function _includesWith(l,p,h){for(var de=0,pe=h.length;de<pe;){if(l(p,h[de]))return!0;de+=1}return!1}function _functionName(l){var p=String(l).match(/^function (\w*)/);return p==null?``:p[1]}function _objectIs(l,p){return l===p?l!==0||1/l==1/p:l!==l&&p!==p}var _objectIs_default=typeof Object.is==`function`?Object.is:_objectIs;function _uniqContentEquals(l,p,h,de){var pe=_arrayFromIterator(l),me=_arrayFromIterator(p);function nt(l,p){return _equals(l,p,h.slice(),de.slice())}return!_includesWith(function(l,p){return!_includesWith(nt,p,l)},me,pe)}function _equals(l,p,h,de){if(_objectIs_default(l,p))return!0;var pe=type$1(l);if(pe!==type$1(p)||l==null||p==null)return!1;if(typeof l[`fantasy-land/equals`]==`function`||typeof p[`fantasy-land/equals`]==`function`)return typeof l[`fantasy-land/equals`]==`function`&&l[`fantasy-land/equals`](p)&&typeof p[`fantasy-land/equals`]==`function`&&p[`fantasy-land/equals`](l);if(typeof l.equals==`function`||typeof p.equals==`function`)return typeof l.equals==`function`&&l.equals(p)&&typeof p.equals==`function`&&p.equals(l);switch(pe){case`Arguments`:case`Array`:case`Object`:if(typeof l.constructor==`function`&&_functionName(l.constructor)===`Promise`)return l===p;break;case`Boolean`:case`Number`:case`String`:if(!(typeof l==typeof p&&_objectIs_default(l.valueOf(),p.valueOf())))return!1;break;case`Date`:if(!_objectIs_default(l.valueOf(),p.valueOf()))return!1;break;case`Error`:return l.name===p.name&&l.message===p.message;case`RegExp`:if(!(l.source===p.source&&l.global===p.global&&l.ignoreCase===p.ignoreCase&&l.multiline===p.multiline&&l.sticky===p.sticky&&l.unicode===p.unicode))return!1;break}for(var me=h.length-1;me>=0;){if(h[me]===l)return de[me]===p;--me}switch(pe){case`Map`:return l.size===p.size?_uniqContentEquals(l.entries(),p.entries(),h.concat([l]),de.concat([p])):!1;case`Set`:return l.size===p.size?_uniqContentEquals(l.values(),p.values(),h.concat([l]),de.concat([p])):!1;case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var nt=keys$1(l);if(nt.length!==keys$1(p).length)return!1;var st=h.concat([l]),mt=de.concat([p]);for(me=nt.length-1;me>=0;){var _t=nt[me];if(!(_has(_t,p)&&_equals(p[_t],l[_t],st,mt)))return!1;--me}return!0}var equals$2=_curry2(function(l,p){return _equals(l,p,[],[])});function _indexOf(l,p,h){var de,pe;if(typeof l.indexOf==`function`)switch(typeof p){case`number`:if(p===0){for(de=1/p;h<l.length;){if(pe=l[h],pe===0&&1/pe===de)return h;h+=1}return-1}else if(p!==p){for(;h<l.length;){if(pe=l[h],typeof pe==`number`&&pe!==pe)return h;h+=1}return-1}return l.indexOf(p,h);case`string`:case`boolean`:case`function`:case`undefined`:return l.indexOf(p,h);case`object`:if(p===null)return l.indexOf(p,h)}for(;h<l.length;){if(equals$2(l[h],p))return h;h+=1}return-1}function _includes(l,p){return _indexOf(p,l,0)>=0}function _isObject(l){return Object.prototype.toString.call(l)===`[object Object]`}var XReduceBy=function(){function l(l,p,h,de){this.valueFn=l,this.valueAcc=p,this.keyFn=h,this.xf=de,this.inputs={}}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=function(l){for(var p in this.inputs)if(_has(p,this.inputs)&&(l=this.xf[`@@transducer/step`](l,this.inputs[p]),l[`@@transducer/reduced`])){l=l[`@@transducer/value`];break}return this.inputs=null,this.xf[`@@transducer/result`](l)},l.prototype[`@@transducer/step`]=function(l,p){var h=this.keyFn(p);return this.inputs[h]=this.inputs[h]||[h,this.valueAcc],this.inputs[h][1]=this.valueFn(this.inputs[h][1],p),l},l}(),_xreduceBy=_curryN(4,[],function(l,p,h,de){return new XReduceBy(l,p,h,de)}),reduceBy=_curryN(4,[],_dispatchable([],_xreduceBy,function(l,p,h,de){return _reduce(function(de,pe){var me=h(pe);return de[me]=l(_has(me,de)?de[me]:_clone(p,[],[],!1),pe),de},{},de)})),_Set=function(){function l(){this._nativeSet=typeof Set==`function`?new Set:null,this._items={}}return l.prototype.add=function(l){return!hasOrAdd(l,!0,this)},l.prototype.has=function(l){return hasOrAdd(l,!1,this)},l}();function hasOrAdd(l,p,h){var de=typeof l,pe,me;switch(de){case`string`:case`number`:return l===0&&1/l==-1/0?h._items[`-0`]?!0:(p&&(h._items[`-0`]=!0),!1):h._nativeSet===null?de in h._items?l in h._items[de]?!0:(p&&(h._items[de][l]=!0),!1):(p&&(h._items[de]={},h._items[de][l]=!0),!1):p?(pe=h._nativeSet.size,h._nativeSet.add(l),me=h._nativeSet.size,me===pe):h._nativeSet.has(l);case`boolean`:if(de in h._items){var nt=+!!l;return h._items[de][nt]?!0:(p&&(h._items[de][nt]=!0),!1)}else return p&&(h._items[de]=l?[!1,!0]:[!0,!1]),!1;case`function`:return h._nativeSet===null?de in h._items?_includes(l,h._items[de])?!0:(p&&h._items[de].push(l),!1):(p&&(h._items[de]=[l]),!1):p?(pe=h._nativeSet.size,h._nativeSet.add(l),me=h._nativeSet.size,me===pe):h._nativeSet.has(l);case`undefined`:return h._items[de]?!0:(p&&(h._items[de]=!0),!1);case`object`:if(l===null)return h._items.null?!0:(p&&(h._items.null=!0),!1);default:return de=Object.prototype.toString.call(l),de in h._items?_includes(l,h._items[de])?!0:(p&&h._items[de].push(l),!1):(p&&(h._items[de]=[l]),!1)}}var XTake=function(){function l(l,p){this.xf=p,this.n=l,this.i=0}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=_xfBase_default.result,l.prototype[`@@transducer/step`]=function(l,p){this.i+=1;var h=this.n===0?l:this.xf[`@@transducer/step`](l,p);return this.n>=0&&this.i>=this.n?_reduced(h):h},l}(),_xtake=_curry2(function(l,p){return new XTake(l,p)}),take=_curry2(_dispatchable([`take`],_xtake,function(l,p){return slice$3(0,l<0?1/0:l,p)}));function dropLast$1(l,p){return take(l<p.length?p.length-l:0,p)}var XDropLast=function(){function l(l,p){this.xf=p,this.pos=0,this.full=!1,this.acc=Array(l)}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=function(l){return this.acc=null,this.xf[`@@transducer/result`](l)},l.prototype[`@@transducer/step`]=function(l,p){return this.full&&(l=this.xf[`@@transducer/step`](l,this.acc[this.pos])),this.store(p),l},l.prototype.store=function(l){this.acc[this.pos]=l,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},l}(),_xdropLast=_curry2(function(l,p){return new XDropLast(l,p)}),dropLast=_curry2(_dispatchable([],_xdropLast,dropLast$1)),flatten$1=_curry1(_makeFlat(!0)),fromPairs=_curry1(function(l){for(var p={},h=0;h<l.length;)p[l[h][0]]=l[h][1],h+=1;return p}),groupBy=_curry2(_checkForMethod(`groupBy`,reduceBy(function(l,p){return l??(l=[]),l.push(p),l},null))),indexBy=reduceBy(function(l,p){return p},null),uniqBy$1=_curry2(function(l,p){for(var h=new _Set,de=[],pe=0,me,nt;pe<p.length;)nt=p[pe],me=l(nt),h.add(me)&&de.push(nt),pe+=1;return de}),uniq=uniqBy$1(identity$5),maxBy$1=_curry3(function(l,p,h){return l(h)>l(p)?h:p}),mergeWithKey=_curry3(function(l,p,h){var de={},pe;for(pe in p)_has(pe,p)&&(de[pe]=_has(pe,h)?l(pe,p[pe],h[pe]):p[pe]);for(pe in h)_has(pe,h)&&!_has(pe,de)&&(de[pe]=h[pe]);return de}),mergeDeepWithKey=_curry3(function l(p,h,de){return mergeWithKey(function(h,de,pe){return _isObject(de)&&_isObject(pe)?l(p,de,pe):p(h,de,pe)},h,de)}),mergeDeepLeft=_curry2(function(l,p){return mergeDeepWithKey(function(l,p,h){return p},l,p)}),minBy$1=_curry3(function(l,p,h){return l(h)<l(p)?h:p}),pick=_curry2(function(l,p){for(var h={},de=0;de<l.length;)l[de]in p&&(h[l[de]]=p[l[de]]),de+=1;return h}),toPairs=_curry1(function(l){var p=[];for(var h in l)_has(h,l)&&(p[p.length]=[h,l[h]]);return p}),unnest$1=chain(_identity),require_quarterOfYear=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_quarterOfYear=de()})(l,(function(){var l=`month`,p=`quarter`;return function(h,de){var pe=de.prototype;pe.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var me=pe.add;pe.add=function(h,de){return h=Number(h),this.$utils().p(de)===p?this.add(3*h,l):me.bind(this)(h,de)};var nt=pe.startOf;pe.startOf=function(h,de){var pe=this.$utils(),me=!!pe.u(de)||de;if(pe.p(h)===p){var st=this.quarter()-1;return me?this.month(3*st).startOf(l).startOf(`day`):this.month(3*st+2).endOf(l).endOf(`day`)}return nt.bind(this)(h,de)}}}))})),require_duration=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_duration=de()})(l,(function(){var l,p,h=1e3,de=6e4,pe=36e5,me=864e5,nt=/\[([^\]]+)]|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,st=31536e6,mt=2592e6,_t=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,yt={years:st,months:mt,days:me,hours:pe,minutes:de,seconds:h,milliseconds:1,weeks:6048e5},bt=function(l){return l instanceof Dt},xt=function(l,p,h){return new Dt(l,h,p.$l)},St=function(l){return p.p(l)+`s`},Ct=function(l){return l<0},wt=function(l){return Ct(l)?Math.ceil(l):Math.floor(l)},Tt=function(l){return Math.abs(l)},Et=function(l,p){return l?Ct(l)?{negative:!0,format:``+Tt(l)+p}:{negative:!1,format:``+l+p}:{negative:!1,format:``}},Dt=function(){function Ct(l,p,h){var de=this;if(this.$d={},this.$l=h,l===void 0&&(this.$ms=0,this.parseFromMilliseconds()),p)return xt(l*yt[St(p)],this);if(typeof l==`number`)return this.$ms=l,this.parseFromMilliseconds(),this;if(typeof l==`object`)return Object.keys(l).forEach((function(p){de.$d[St(p)]=l[p]})),this.calMilliseconds(),this;if(typeof l==`string`){var pe=l.match(_t);if(pe){var me=pe.slice(2).map((function(l){return l==null?0:Number(l)}));return this.$d.years=me[0],this.$d.months=me[1],this.$d.weeks=me[2],this.$d.days=me[3],this.$d.hours=me[4],this.$d.minutes=me[5],this.$d.seconds=me[6],this.calMilliseconds(),this}}return this}var Tt=Ct.prototype;return Tt.calMilliseconds=function(){var l=this;this.$ms=Object.keys(this.$d).reduce((function(p,h){return p+(l.$d[h]||0)*yt[h]}),0)},Tt.parseFromMilliseconds=function(){var l=this.$ms;this.$d.years=wt(l/st),l%=st,this.$d.months=wt(l/mt),l%=mt,this.$d.days=wt(l/me),l%=me,this.$d.hours=wt(l/pe),l%=pe,this.$d.minutes=wt(l/de),l%=de,this.$d.seconds=wt(l/h),l%=h,this.$d.milliseconds=l},Tt.toISOString=function(){var l=Et(this.$d.years,`Y`),p=Et(this.$d.months,`M`),h=+this.$d.days||0;this.$d.weeks&&(h+=7*this.$d.weeks);var de=Et(h,`D`),pe=Et(this.$d.hours,`H`),me=Et(this.$d.minutes,`M`),nt=this.$d.seconds||0;this.$d.milliseconds&&(nt+=this.$d.milliseconds/1e3);var st=Et(nt,`S`),mt=l.negative||p.negative||de.negative||pe.negative||me.negative||st.negative,_t=pe.format||me.format||st.format?`T`:``,yt=(mt?`-`:``)+`P`+l.format+p.format+de.format+_t+pe.format+me.format+st.format;return yt===`P`||yt===`-P`?`P0D`:yt},Tt.toJSON=function(){return this.toISOString()},Tt.format=function(l){var h=l||`YYYY-MM-DDTHH:mm:ss`,de={Y:this.$d.years,YY:p.s(this.$d.years,2,`0`),YYYY:p.s(this.$d.years,4,`0`),M:this.$d.months,MM:p.s(this.$d.months,2,`0`),D:this.$d.days,DD:p.s(this.$d.days,2,`0`),H:this.$d.hours,HH:p.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:p.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:p.s(this.$d.seconds,2,`0`),SSS:p.s(this.$d.milliseconds,3,`0`)};return h.replace(nt,(function(l,p){return p||String(de[l])}))},Tt.as=function(l){return this.$ms/yt[St(l)]},Tt.get=function(l){var p=this.$ms,h=St(l);return h===`milliseconds`?p%=1e3:p=h===`weeks`?wt(p/yt[h]):this.$d[h],p===0?0:p},Tt.add=function(l,p,h){var de;return de=p?l*yt[St(p)]:bt(l)?l.$ms:xt(l,this).$ms,xt(this.$ms+de*(h?-1:1),this)},Tt.subtract=function(l,p){return this.add(l,p,!0)},Tt.locale=function(l){var p=this.clone();return p.$l=l,p},Tt.clone=function(){return xt(this.$ms,this)},Tt.humanize=function(p){return l().add(this.$ms,`ms`).locale(this.$l).fromNow(!p)},Tt.milliseconds=function(){return this.get(`milliseconds`)},Tt.asMilliseconds=function(){return this.as(`milliseconds`)},Tt.seconds=function(){return this.get(`seconds`)},Tt.asSeconds=function(){return this.as(`seconds`)},Tt.minutes=function(){return this.get(`minutes`)},Tt.asMinutes=function(){return this.as(`minutes`)},Tt.hours=function(){return this.get(`hours`)},Tt.asHours=function(){return this.as(`hours`)},Tt.days=function(){return this.get(`days`)},Tt.asDays=function(){return this.as(`days`)},Tt.weeks=function(){return this.get(`weeks`)},Tt.asWeeks=function(){return this.as(`weeks`)},Tt.months=function(){return this.get(`months`)},Tt.asMonths=function(){return this.as(`months`)},Tt.years=function(){return this.get(`years`)},Tt.asYears=function(){return this.as(`years`)},Ct}();return function(h,de,pe){l=pe,p=pe().$utils(),pe.duration=function(l,p){return xt(l,{$l:pe.locale()},p)},pe.isDuration=bt;var me=de.prototype.add,nt=de.prototype.subtract;de.prototype.add=function(l,p){return bt(l)&&(l=l.asMilliseconds()),me.bind(this)(l,p)},de.prototype.subtract=function(l,p){return bt(l)&&(l=l.asMilliseconds()),nt.bind(this)(l,p)}}}))})),require_isoWeek=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_isoWeek=de()})(l,(function(){var l=`day`;return function(p,h,de){var pe=function(p){return p.add(4-p.isoWeekday(),l)},me=h.prototype;me.isoWeekYear=function(){return pe(this).year()},me.isoWeek=function(p){if(!this.$utils().u(p))return this.add(7*(p-this.isoWeek()),l);var h,me,nt,st,mt=pe(this),_t=(h=this.isoWeekYear(),me=this.$u,nt=(me?de.utc:de)().year(h).startOf(`year`),st=4-nt.isoWeekday(),nt.isoWeekday()>4&&(st+=7),nt.add(st,l));return mt.diff(_t,`week`)+1},me.isoWeekday=function(l){return this.$utils().u(l)?this.day()||7:this.day(this.day()%7?l:l-7)};var nt=me.startOf;me.startOf=function(l,p){var h=this.$utils(),de=!!h.u(p)||p;return h.p(l)===`isoweek`?de?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):nt.bind(this)(l,p)}}}))})),require_en=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_locale_en=de()})(l,(function(){return{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(`_`)}}))})),import_dayjs_min=__toESM(require_dayjs_min()),import_quarterOfYear=__toESM(require_quarterOfYear()),import_duration=__toESM(require_duration()),import_isoWeek=__toESM(require_isoWeek()),import_en=__toESM(require_en());import_dayjs_min.default.extend(import_quarterOfYear.default),import_dayjs_min.default.extend(import_duration.default),import_dayjs_min.default.extend(import_isoWeek.default);var cubeInternalLocale=`cube-internal-en`,customLocale={...import_en.default,name:cubeInternalLocale,weekStart:1};import_dayjs_min.default.Ls[cubeInternalLocale]=customLocale;var GRANULARITIES=[{name:void 0,title:`w/o grouping`},{name:`second`,title:`Second`},{name:`minute`,title:`Minute`},{name:`hour`,title:`Hour`},{name:`day`,title:`Day`},{name:`week`,title:`Week`},{name:`month`,title:`Month`},{name:`quarter`,title:`Quarter`},{name:`year`,title:`Year`}],internalDayjs=(...l)=>(0,import_dayjs_min.default)(...l).locale(cubeInternalLocale),TIME_SERIES={day:l=>l.by(`d`).map(l=>l.format(`YYYY-MM-DDT00:00:00.000`)),month:l=>l.snapTo(`month`).by(`M`).map(l=>l.format(`YYYY-MM-01T00:00:00.000`)),year:l=>l.snapTo(`year`).by(`y`).map(l=>l.format(`YYYY-01-01T00:00:00.000`)),hour:l=>l.by(`h`).map(l=>l.format(`YYYY-MM-DDTHH:00:00.000`)),minute:l=>l.by(`m`).map(l=>l.format(`YYYY-MM-DDTHH:mm:00.000`)),second:l=>l.by(`s`).map(l=>l.format(`YYYY-MM-DDTHH:mm:ss.000`)),week:l=>l.snapTo(`week`).by(`w`).map(l=>l.startOf(`week`).format(`YYYY-MM-DDT00:00:00.000`)),quarter:l=>l.snapTo(`quarter`).by(`quarter`).map(l=>l.startOf(`quarter`).format(`YYYY-MM-DDT00:00:00.000`))},isPredefinedGranularity=l=>!!TIME_SERIES[l],DateRegex=/^\d\d\d\d-\d\d-\d\d$/,LocalDateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;function parseSqlInterval(l){let p={},h=l.split(/\s+/);for(let l=0;l<h.length;l+=2){let de=parseInt(h[l],10),pe=h[l+1],me=pe.endsWith(`s`)?pe.slice(0,-1):pe;p[me]=de}return p}function addInterval(l,p){let h=l.clone();return Object.entries(p).forEach(([l,p])=>{h=h.add(p,l)}),h}function subtractInterval(l,p){let h=l.clone();return Object.entries(p).forEach(([l,p])=>{h=h.subtract(p,l)}),h}function alignToOrigin(l,p,h){let de=l.clone(),pe,me=!1,nt=addInterval(h,p);if(nt.isBefore(h)&&(me=!0),nt=h.clone(),l.isBefore(h)){for(pe=me?addInterval:subtractInterval;nt.isAfter(l);)nt=pe(nt,p);de=nt}else{for(pe=me?subtractInterval:addInterval;nt.isBefore(l);)de=nt.clone(),nt=pe(nt,p);nt.isSame(l)&&(de=nt)}return de}var dayRange=(l,p,h)=>({by:h=>{let de=[],pe=internalDayjs(l),me=internalDayjs(p);for(;pe.startOf(h).isBefore(me)||pe.isSame(me);)de.push(pe),pe=pe.add(1,h);return de},snapTo:de=>{if(!isPredefinedGranularity(de)&&h){let p;for(let l of Object.keys(h))if(l.endsWith(`.${de}`)&&h[l].granularity){p=h[l].granularity;break}if(p?.interval){let de=parseSqlInterval(p.interval),pe=internalDayjs(l);if(p.origin||p.offset){let l;l=p.origin?internalDayjs(p.origin):addInterval(internalDayjs().startOf(`year`),parseSqlInterval(p.offset)),pe=alignToOrigin(pe,de,l)}let me=addInterval(pe,de).subtract(1,`millisecond`);return dayRange(pe,me,h)}}return dayRange(internalDayjs(l).startOf(de),internalDayjs(p).endOf(de),h)},start:internalDayjs(l),end:internalDayjs(p)}),timeSeriesFromCustomInterval=(l,p,h)=>{let de=parseSqlInterval(h.interval),pe=internalDayjs(l),me=internalDayjs(p),nt=h.origin?internalDayjs(h.origin):internalDayjs().startOf(`year`);h.offset&&(nt=addInterval(nt,parseSqlInterval(h.offset)));let st=alignToOrigin(pe,de,nt),mt=[];for(;st.isBefore(me)||st.isSame(me);)mt.push(st.format(`YYYY-MM-DDTHH:mm:ss.000`)),st=addInterval(st,de);return mt},diffTimeUnitForInterval=l=>/second/i.test(l)?`second`:/minute/i.test(l)?`minute`:/hour/i.test(l)?`hour`:/day/i.test(l)||/week/i.test(l)?`day`:/month/i.test(l)||/quarter/i.test(l)?`month`:`year`,granularityOrder=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`],minGranularityForIntervals=(l,p)=>{let h=diffTimeUnitForInterval(l),de=diffTimeUnitForInterval(p);return granularityOrder.indexOf(h)>granularityOrder.indexOf(de)?h:de},granularityFor=l=>{let p=internalDayjs(l),h=p.month(),de=p.date(),pe=p.hour(),me=p.minute(),nt=p.second(),st=p.millisecond(),mt=p.isoWeekday();return h===0&&de===1&&pe===0&&me===0&&nt===0&&st===0?`year`:de===1&&pe===0&&me===0&&nt===0&&st===0?`month`:mt===1&&pe===0&&me===0&&nt===0&&st===0?`week`:pe===0&&me===0&&nt===0&&st===0?`day`:me===0&&nt===0&&st===0?`hour`:nt===0&&st===0?`minute`:`second`};function removeEmptyQueryFields(l){return fromPairs(toPairs(l||{}).flatMap(([l,p])=>[`measures`,`dimensions`,`segments`,`timeDimensions`,`filters`].includes(l)&&Array.isArray(p)&&p.length===0||l===`order`&&p&&(Array.isArray(p)&&p.length===0||!Object.keys(p).length)?[]:[[l,p]]))}function validateQuery$1(l){let p=l||{};return removeEmptyQueryFields({...p,filters:(p.filters||[]).filter(l=>`operator`in l),timeDimensions:(p.timeDimensions||[]).filter(l=>!(!l.dateRange&&!l.granularity))})}function areQueriesEqual(l,p){return equals$2(Object.entries(l?.order||{}),Object.entries(p?.order||{}))&&equals$2(l,p)}function defaultOrder(l){let p=(l.timeDimensions||[]).find(l=>l.granularity);return p?{[p.dimension]:`asc`}:(l.measures||[]).length>0&&(l.dimensions||[]).length>0?{[l.measures[0]]:`desc`}:(l.dimensions||[]).length>0?{[l.dimensions[0]]:`asc`}:{}}function defaultHeuristics(l,p,h){let{query:de,...pe}=clone(l),{meta:me,sessionGranularity:nt}=h,st=nt||`day`,mt={shouldApplyHeuristicOrder:!1,pivotConfig:null,query:de,...pe},_t=null;if(areQueriesEqual(de,p)||(_t=de),Array.isArray(_t)||Array.isArray(p))return{shouldApplyHeuristicOrder:!1,pivotConfig:null,...l};if(_t){if((p.timeDimensions||[]).length===1&&(_t.timeDimensions||[]).length===1&&_t.timeDimensions[0].granularity&&p.timeDimensions[0].granularity!==_t.timeDimensions[0].granularity&&(mt={...mt,sessionGranularity:_t.timeDimensions[0].granularity}),(p.measures||[]).length===0&&(_t.measures||[]).length>0||(p.measures||[]).length===1&&(_t.measures||[]).length===1&&p.measures[0]!==_t.measures[0]){let[l]=_t.timeDimensions||[],p=me.defaultTimeDimensionNameFor(_t.measures[0]);return _t={..._t,timeDimensions:p?[{dimension:p,granularity:l?.granularity||st,dateRange:l?.dateRange}]:[]},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:p?`line`:`number`}}return(p.dimensions||[]).length===0&&(_t.dimensions||[]).length>0?(_t={..._t,timeDimensions:(_t.timeDimensions||[]).map(l=>({...l,granularity:void 0}))},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:`table`}):(p.dimensions||[]).length>0&&(_t.dimensions||[]).length===0?(_t={..._t,timeDimensions:(_t.timeDimensions||[]).map(l=>({...l,granularity:l.granularity||st}))},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:(_t.timeDimensions||[]).length?`line`:`number`}):((p.dimensions||[]).length>0||(p.measures||[]).length>0)&&(_t.dimensions||[]).length===0&&(_t.measures||[]).length===0?(_t={..._t,timeDimensions:[],filters:[]},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,sessionGranularity:null}):mt}if(mt.chartType){let l=mt.chartType;if((l===`line`||l===`area`)&&(p.timeDimensions||[]).length===1&&!p.timeDimensions[0].granularity){let[l]=p.timeDimensions;return{...mt,pivotConfig:null,query:{...p,timeDimensions:[{...l,granularity:st}]}}}if((l===`pie`||l===`table`||l===`number`)&&(p.timeDimensions||[]).length===1&&p.timeDimensions[0].granularity){let[l]=p.timeDimensions;return{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:{...p,timeDimensions:[{...l,granularity:void 0}]}}}}return mt}function isQueryPresent(l){return l?(Array.isArray(l)?l:[l]).every(l=>l.measures?.length||l.dimensions?.length||l.timeDimensions?.length):!1}function movePivotItem$1(l,p,h,de,pe){let me={...l,x:[...l.x||[]],y:[...l.y||[]]},nt=l[de][p],st=me[pe].length-1;return nt===`measures`?h=st+1:de===pe&&h>=st&&me[pe][st]===`measures`?h=st-1:de!==pe&&h>st&&me[pe][st]===`measures`&&(h=st),me[de].splice(p,1),me[pe].splice(h,0,nt),me}function moveItemInArray(l,p,h){let de=[...l],[pe]=de.splice(p,1);return de.splice(h,0,pe),de}function flattenFilters(l=[]){return l.reduce((l,p)=>`or`in p?[...l,...flattenFilters(p.or)]:`and`in p?[...l,...flattenFilters(p.and)]:[...l,p],[])}function getQueryMembers(l={}){let p=[`measures`,`dimensions`,`segments`],h=new Set;return p.forEach(p=>(l[p]||[]).forEach(l=>h.add(l))),(l.timeDimensions||[]).forEach(l=>h.add(l.dimension)),flattenFilters(l.filters).forEach(l=>{let p=l.dimension||l.member;typeof p==`string`&&h.add(p)}),[...h]}function aliasSeries(l,p,h,de=new Set){let pe=l.filter(l=>l!=null);return h?.aliasSeries?.[p]?[h.aliasSeries[p],...pe]:de.has(pe[0])?[p,...pe]:pe}var groupByToPairs=function(l){let p=new Map;return h=>(h.forEach(h=>{let de=l(h);p.has(de)||p.set(de,[]),p.get(de).push(h)}),Array.from(p.entries()))},unnest=l=>{let p=[];return l.forEach(l=>{l.forEach(l=>p.push(l))}),p},QUERY_TYPE={REGULAR_QUERY:`regularQuery`,COMPARE_DATE_RANGE_QUERY:`compareDateRangeQuery`,BLENDING_QUERY:`blendingQuery`},ResultSet=class l{static measureFromAxis(l){return l[l.length-1]}static timeDimensionMember(l){return`${l.dimension}.${l.granularity}`}static deserialize(p,h){return new l(p.loadResponse,h)}constructor(l,p={}){if(`queryType`in l&&l.queryType!=null?(this.loadResponse=l,this.queryType=l.queryType,this.loadResponses=l.results):(this.queryType=QUERY_TYPE.REGULAR_QUERY,this.loadResponse={...l,pivotQuery:{...l.query,queryType:this.queryType}},this.loadResponses=[l]),!Object.values(QUERY_TYPE).includes(this.queryType))throw Error(`Unknown query type`);this.parseDateMeasures=p.parseDateMeasures,this.options=p,this.backwardCompatibleData=[]}drillDown(l,p){if(this.queryType===QUERY_TYPE.COMPARE_DATE_RANGE_QUERY)throw Error(`compareDateRange drillDown query is not currently supported`);if(this.queryType===QUERY_TYPE.BLENDING_QUERY)throw Error(`Data blending drillDown query is not currently supported`);let{query:h}=this.loadResponses[0],de=l?.xValues??[],pe=l?.yValues??[],me=this.normalizePivotConfig(p),nt=[];me?.x.forEach((l,p)=>nt.push([l,de[p]])),me?.y.forEach((l,p)=>nt.push([l,pe[p]]));let{filters:st=[],segments:mt=[]}=this.query(),{measures:_t,timeDimensions:yt}=this.loadResponses[0].annotation,[,bt]=nt.find(([l])=>l===`measures`)||[];if(bt===void 0&&([bt]=Object.keys(_t)),!(_t[bt]?.drillMembers?.length??0))return null;let xt=[{member:bt,operator:`measureFilter`},...st],St=[];return nt.filter(([l])=>l!==`measures`).forEach(([l,p])=>{let[de,pe,me]=l.split(`.`);if(me!==void 0){let l=dayRange(p,p,yt).snapTo(me),nt=h.timeDimensions?.find(l=>l.dimension),st=[l.start,l.end];if(nt?.dateRange){let[p,h]=nt.dateRange;st=[(0,import_dayjs_min.default)(p)>l.start?(0,import_dayjs_min.default)(p):l.start,(0,import_dayjs_min.default)(h)<l.end?(0,import_dayjs_min.default)(h):l.end]}St.push({dimension:[de,pe].join(`.`),dateRange:st.map(l=>l.format(`YYYY-MM-DDTHH:mm:ss.SSS`))})}else p==null?xt.push({member:l,operator:`notSet`}):xt.push({member:l,operator:`equals`,values:[p.toString()]})}),St.length===0&&Array.isArray(h.timeDimensions)&&h.timeDimensions.length>0&&h.timeDimensions[0].granularity==null&&St.push(h.timeDimensions[0]),{..._t[bt].drillMembersGrouped,filters:xt,...mt.length>0?{segments:mt}:{},timeDimensions:St,segments:mt,timezone:h.timezone}}series(l){return this.seriesNames(l).map(({title:p,shortTitle:h,key:de})=>({title:p,shortTitle:h,key:de,series:this.chartPivot(l).map(({x:l,...p})=>({value:p[de],x:l}))}))}axisValues(l,p=0){let{query:h}=this.loadResponses[p],de=l.filter(l=>l!==`measures`),pe=l.includes(`measures`)&&h.measures||[];return l=>{let p=p=>{let h=de.map(p=>l[p]??null);return p&&h.push(p),h};return pe.length>0?pe.map(p):[p()]}}axisValuesString(l,p=`, `){return l.map(l=>l==null?`∅`:l===``?`[Empty string]`:l).join(p)}static getNormalizedPivotConfig(p,h){let de={x:[],y:[],fillMissingDates:!0,joinDateRange:!1},{measures:pe=[],dimensions:me=[]}=p||{},nt=(p?.timeDimensions||[]).filter(l=>!!l.granularity);h=h||(nt.length?{x:nt.map(p=>l.timeDimensionMember(p)),y:me}:{x:me,y:[]});let st=mergeDeepLeft(h,de),mt=h=>h.map(h=>nt.find(l=>l.dimension===h)&&!me.find(l=>l===h)?l.timeDimensionMember((p?.timeDimensions||[]).find(l=>l.dimension===h)):h);st.x=mt(st.x),st.y=mt(st.y);let _t=st.x.concat(st.y),yt=nt.map(p=>l.timeDimensionMember(p)).concat(me),bt=l=>yt.includes(l)||l===`measures`;return st.x=st.x.concat(yt.filter(l=>!_t.includes(l)&&l!==`compareDateRange`)).filter(bt),st.y=st.y.filter(bt),st.x.concat(st.y).find(l=>l===`measures`)||st.y.push(`measures`),me.includes(`compareDateRange`)&&!st.y.concat(st.x).includes(`compareDateRange`)&&st.y.unshift(`compareDateRange`),pe.length||(st.x=st.x.filter(l=>l!==`measures`),st.y=st.y.filter(l=>l!==`measures`)),st}normalizePivotConfig(p){return l.getNormalizedPivotConfig(this.loadResponse.pivotQuery,p)}timeSeries(p,h,de){if(!p.granularity)return null;let pe;if(pe=p.dateRange,!pe){let de=l.timeDimensionMember(p),me=this.timeDimensionBackwardCompatibleData(h||0).map(l=>{let p=l[de];return p?internalDayjs(p):null}).filter(l=>!!l);pe=me.length&&[reduce(minBy$1(l=>l.toDate()),me[0],me).toString(),reduce(maxBy$1(l=>l.toDate()),me[0],me).toString()]||null}if(!pe)return null;let me=p.dateRange?p.dateRange.find(l=>l.match(DateRegex)):![`hour`,`minute`,`second`].includes(p.granularity),[nt,st]=pe,mt=dayRange(nt,st,de);if(isPredefinedGranularity(p.granularity))return TIME_SERIES[p.granularity](me?mt.snapTo(`d`):mt);if(!de?.[`${p.dimension}.${p.granularity}`])throw Error(`Granularity "${p.granularity}" not found in time dimension "${p.dimension}"`);return timeSeriesFromCustomInterval(nt,st,de[`${p.dimension}.${p.granularity}`].granularity)}pivot(p){let h=this.normalizePivotConfig(p),{pivotQuery:de}=this.loadResponse,pe=(p=0)=>{let pe=groupByToPairs(({xValues:l})=>this.axisValuesString(l)),me=(l,p)=>l[p]??h.fillWithValue??0;if(h.fillMissingDates&&h.x.length===1&&equals$2(h.x,(de.timeDimensions||[]).filter(l=>!!l.granularity).map(p=>l.timeDimensionMember(p)))){let l=this.loadResponses.map(l=>this.timeSeries(l.query.timeDimensions[0],p,l.annotation.timeDimensions));l[0]&&(pe=h=>{let de=groupBy(({xValues:l})=>l[0],h);return l[p]?.map(l=>[l,de[l]||[{xValues:[l],row:{}}]])??[]})}let nt=this.axisValues(h.x,p),st=this.axisValues(h.y,p),mt=pipe(map$3(l=>nt(l).map(p=>({xValues:p,row:l}))),unnest,pe)(this.timeDimensionBackwardCompatibleData(p)),_t={};mt.forEach(([,l])=>{l.forEach(({row:l})=>{st(l).forEach(p=>{Object.keys(l).length>0&&(_t[p.join()]=p)})})});let yt=Object.values(_t),bt=h.x.includes(`measures`);return mt.map(([,p])=>{let{xValues:h}=p[0],de={};return p.forEach(({row:l})=>{st(l).map(p=>({yValues:p,row:l})).forEach(l=>{de[this.axisValuesString(l.yValues)]=l})}),{xValues:h,yValuesArray:unnest(yt.map(p=>{let pe=bt?l.measureFromAxis(h):l.measureFromAxis(p);return[[p,me((de[this.axisValuesString(p)]||{row:{}}).row,pe)]]}))}})},me=this.loadResponses.length>1?this.loadResponses.map((l,p)=>pe(p)):[];return me.length?this.mergePivots(me,h.joinDateRange||!1):pe()}mergePivots(l,p){let h=l.reduce((l,p)=>l!=null&&p.length>=l.length?l:p,null)||[];return h.map((de,pe)=>({xValues:p?[l.map(l=>l[pe]?.xValues||[]).join(`, `)]:h[pe].xValues,yValuesArray:unnest(l.map(l=>l[pe].yValuesArray))}))}chartPivot(l){let p=l=>this.parseDateMeasures&&LocalDateRegex.test(l)?new Date(l):Number.isNaN(Number.parseFloat(l))?l:Number.parseFloat(l),h=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:l})=>l.measures??[])).filter((l,p,h)=>h.indexOf(l)!==p).forEach(l=>h.add(l)),this.pivot(l).map(({xValues:de,yValuesArray:pe})=>{let me={};return pe.forEach(([de,pe],nt)=>{me[this.axisValuesString(aliasSeries(de,nt,l,h),`,`)]=pe&&p(pe)}),{x:this.axisValuesString(de,`,`),xValues:de,...me}})}tablePivot(l){let p=this.normalizePivotConfig(l||{}),h=p.x.concat(p.y).includes(`measures`);return this.pivot(p).map(({xValues:l,yValuesArray:de})=>fromPairs([...p.x.map((p,h)=>[p,l[h]]),...h?de.map(([l,p])=>[l.length?l.join():`value`,p]):[]]))}tableColumns(l){let p=this.normalizePivotConfig(l||{}),h=this.loadResponses.map(l=>l.annotation).reduce((l,p)=>mergeDeepLeft(l,p),{dimensions:{},measures:{},timeDimensions:{},segments:{}}),de=Object.values(h).reduce((l,p)=>({...l,...p}),{}),pe={},me=l=>{let{title:p,shortTitle:h,type:pe,format:me,meta:nt,currency:st,granularity:mt}=de[l]||{};return{key:l,title:p,shortTitle:h,type:pe,format:me,meta:nt,currency:st,granularity:mt?.name}},nt=this.pivot(p);(nt[0]?.yValuesArray||[]).forEach(([l])=>{if(l.length>0){let h=pe;l.forEach((l,de)=>{h[`_${l}`]={key:l,memberId:p.y[de]===`measures`?l:p.y[de],children:h[`_${l}`]?.children||{}},h=h[`_${l}`].children})}});let st=(l={},p=[])=>Object.keys(l).length===0?[]:Object.values(l).map(({key:l,...h})=>{let de=st(h.children,[...p,l]),{title:pe,shortTitle:nt,...mt}=me(h.memberId),_t=l!==h.memberId||pe==null?l:``;return de.length?{...mt,key:l,title:[pe,_t].join(` `).trim(),shortTitle:_t||nt,children:de}:{...mt,key:l,dataIndex:[...p,l].join(),title:[pe,_t].join(` `).trim(),shortTitle:_t||nt}}),mt=[];return!nt.length&&p.y.includes(`measures`)&&(mt=(this.loadResponses[0].query.measures||[]).map(l=>({...me(l),dataIndex:l}))),!p.y.length&&p.x.includes(`measures`)&&mt.push({key:`value`,dataIndex:`value`,title:`Value`,shortTitle:`Value`,type:`string`}),p.x.map(l=>l===`measures`?{key:`measures`,dataIndex:`measures`,title:`Measures`,shortTitle:`Measures`,type:`string`}:{...me(l),dataIndex:l}).concat(st(pe)).concat(mt)}totalRow(l){return this.chartPivot(l)[0]}categories(l){return this.chartPivot(l)}seriesNames(p){let h=this.normalizePivotConfig(p),de=this.loadResponses.map(l=>l.annotation.measures).reduce((l,p)=>({...l,...p}),{}),pe=unnest(this.loadResponses.map((l,p)=>pipe(map$3(this.axisValues(h.y,p)),unnest,uniq)(this.timeDimensionBackwardCompatibleData(p)))),me=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:l})=>l.measures??[])).filter((l,p,h)=>h.indexOf(l)!==p).forEach(l=>me.add(l)),pe.map((p,pe)=>{let nt=aliasSeries(p,pe,h,me);return{title:this.axisValuesString(h.y.find(l=>l===`measures`)?dropLast(1,nt).concat(de[l.measureFromAxis(p)].title):nt,`, `),shortTitle:this.axisValuesString(h.y.find(l=>l===`measures`)?dropLast(1,nt).concat(de[l.measureFromAxis(p)].shortTitle):nt,`, `),key:this.axisValuesString(nt,`,`),yValues:p}})}query(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].query}pivotQuery(){return this.loadResponse.pivotQuery||null}totalRows(){return this.loadResponses[0].total}rawData(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].data}annotation(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].annotation}timeDimensionBackwardCompatibleData(p){if(p===void 0)throw Error(`resultIndex is required`);if(!this.backwardCompatibleData[p]){let{data:h,query:de}=this.loadResponses[p],pe=(de.timeDimensions||[]).filter(l=>!!l.granularity);this.backwardCompatibleData[p]=h.map(p=>({...p,...fromPairs(Object.keys(p).filter(h=>{let de=pe.find(l=>l.dimension===h);return de&&!p[l.timeDimensionMember(de)]}).map(h=>[l.timeDimensionMember(pe.find(l=>l.dimension===h)),p[h]]))}))}return this.backwardCompatibleData[p]}decompose(){return this.loadResponses.map(p=>new l({queryType:QUERY_TYPE.REGULAR_QUERY,pivotQuery:{...p.query,queryType:QUERY_TYPE.REGULAR_QUERY},results:[p]},this.options))}serialize(){return{loadResponse:clone(this.loadResponse)}}},SqlQuery=class{constructor(l){this.sqlQuery=l}rawQuery(){return this.sqlQuery.sql}sql(){return this.rawQuery().sql[0]}},memberMap=l=>fromPairs(l.map(l=>[l.name,l])),operators$1={string:[{name:`contains`,title:`contains`},{name:`notContains`,title:`does not contain`},{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`startsWith`,title:`starts with`},{name:`notStartsWith`,title:`does not start with`},{name:`endsWith`,title:`ends with`},{name:`notEndsWith`,title:`does not end with`}],number:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`gt`,title:`>`},{name:`gte`,title:`>=`},{name:`lt`,title:`<`},{name:`lte`,title:`<=`}],time:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`inDateRange`,title:`in date range`},{name:`notInDateRange`,title:`not in date range`},{name:`afterDate`,title:`after date`},{name:`afterOrOnDate`,title:`after or on date`},{name:`beforeDate`,title:`before date`},{name:`beforeOrOnDate`,title:`before or on date`}]},Meta=class{constructor(l){this.meta=l;let{cubes:p}=this.meta;this.cubes=p,this.cubesMap=fromPairs(p.map(l=>[l.name,{measures:memberMap(l.measures),dimensions:memberMap(l.dimensions),segments:memberMap(l.segments)}]))}membersForQuery(l,p){return unnest$1(this.cubes.map(l=>l[p])).sort((l,p)=>l.title>p.title?1:-1)}membersGroupedByCube(){let l=[`measures`,`dimensions`,`segments`,`timeDimensions`];return this.cubes.reduce((p,h)=>(l.forEach(l=>{let de=[];switch(l){case`measures`:de=h.measures||[];break;case`dimensions`:de=h.dimensions||[];break;case`segments`:de=h.segments||[];break;case`timeDimensions`:de=h.dimensions.filter(l=>l.type===`time`)||[];break}p[l].push({cubeName:h.name,cubeTitle:h.title,type:h.type,public:h.public,members:de})}),p),{measures:[],dimensions:[],segments:[],timeDimensions:[]})}resolveMember(l,p){let[h]=l.split(`.`);return this.cubesMap[h]?(Array.isArray(p)?p:[p]).map(p=>this.cubesMap[h][p]&&this.cubesMap[h][p][l]).find(l=>l)||{title:l,error:`Path not found '${l}'`}:{title:l,error:`Cube not found ${h} for path '${l}'`}}defaultTimeDimensionNameFor(l){let[p]=l.split(`.`);return this.cubesMap[p]?Object.keys(this.cubesMap[p].dimensions||{}).find(l=>this.cubesMap[p].dimensions[l].type===`time`):null}filterOperatorsForMember(l,p){let h=this.resolveMember(l,p);return`error`in h||!(`type`in h)||h.type===`boolean`?operators$1.string:operators$1[h.type]||operators$1.string}},ProgressResult=class{constructor(l){this.progressResponse=l}stage(){return this.progressResponse.stage}timeElapsed(){return this.progressResponse.timeElapsed}},require_browser_ponyfill=__commonJSMin(((l,p)=>{var h=typeof self<`u`?self:l,de=(function(){function l(){this.fetch=!1,this.DOMException=h.DOMException}return l.prototype=h,new l})();(function(l){(function(p){var h={searchParams:`URLSearchParams`in l,iterable:`Symbol`in l&&`iterator`in Symbol,blob:`FileReader`in l&&`Blob`in l&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:`FormData`in l,arrayBuffer:`ArrayBuffer`in l};function de(l){return l&&DataView.prototype.isPrototypeOf(l)}if(h.arrayBuffer)var pe=[`[object Int8Array]`,`[object Uint8Array]`,`[object Uint8ClampedArray]`,`[object Int16Array]`,`[object Uint16Array]`,`[object Int32Array]`,`[object Uint32Array]`,`[object Float32Array]`,`[object Float64Array]`],me=ArrayBuffer.isView||function(l){return l&&pe.indexOf(Object.prototype.toString.call(l))>-1};function nt(l){if(typeof l!=`string`&&(l=String(l)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))throw TypeError(`Invalid character in header field name`);return l.toLowerCase()}function st(l){return typeof l!=`string`&&(l=String(l)),l}function mt(l){var p={next:function(){var p=l.shift();return{done:p===void 0,value:p}}};return h.iterable&&(p[Symbol.iterator]=function(){return p}),p}function _t(l){this.map={},l instanceof _t?l.forEach(function(l,p){this.append(p,l)},this):Array.isArray(l)?l.forEach(function(l){this.append(l[0],l[1])},this):l&&Object.getOwnPropertyNames(l).forEach(function(p){this.append(p,l[p])},this)}_t.prototype.append=function(l,p){l=nt(l),p=st(p);var h=this.map[l];this.map[l]=h?h+`, `+p:p},_t.prototype.delete=function(l){delete this.map[nt(l)]},_t.prototype.get=function(l){return l=nt(l),this.has(l)?this.map[l]:null},_t.prototype.has=function(l){return this.map.hasOwnProperty(nt(l))},_t.prototype.set=function(l,p){this.map[nt(l)]=st(p)},_t.prototype.forEach=function(l,p){for(var h in this.map)this.map.hasOwnProperty(h)&&l.call(p,this.map[h],h,this)},_t.prototype.keys=function(){var l=[];return this.forEach(function(p,h){l.push(h)}),mt(l)},_t.prototype.values=function(){var l=[];return this.forEach(function(p){l.push(p)}),mt(l)},_t.prototype.entries=function(){var l=[];return this.forEach(function(p,h){l.push([h,p])}),mt(l)},h.iterable&&(_t.prototype[Symbol.iterator]=_t.prototype.entries);function yt(l){if(l.bodyUsed)return Promise.reject(TypeError(`Already read`));l.bodyUsed=!0}function bt(l){return new Promise(function(p,h){l.onload=function(){p(l.result)},l.onerror=function(){h(l.error)}})}function xt(l){var p=new FileReader,h=bt(p);return p.readAsArrayBuffer(l),h}function St(l){var p=new FileReader,h=bt(p);return p.readAsText(l),h}function Ct(l){for(var p=new Uint8Array(l),h=Array(p.length),de=0;de<p.length;de++)h[de]=String.fromCharCode(p[de]);return h.join(``)}function wt(l){if(l.slice)return l.slice(0);var p=new Uint8Array(l.byteLength);return p.set(new Uint8Array(l)),p.buffer}function Tt(){return this.bodyUsed=!1,this._initBody=function(l){this._bodyInit=l,l?typeof l==`string`?this._bodyText=l:h.blob&&Blob.prototype.isPrototypeOf(l)?this._bodyBlob=l:h.formData&&FormData.prototype.isPrototypeOf(l)?this._bodyFormData=l:h.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)?this._bodyText=l.toString():h.arrayBuffer&&h.blob&&de(l)?(this._bodyArrayBuffer=wt(l.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(l)||me(l))?this._bodyArrayBuffer=wt(l):this._bodyText=l=Object.prototype.toString.call(l):this._bodyText=``,this.headers.get(`content-type`)||(typeof l==`string`?this.headers.set(`content-type`,`text/plain;charset=UTF-8`):this._bodyBlob&&this._bodyBlob.type?this.headers.set(`content-type`,this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)&&this.headers.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`))},h.blob&&(this.blob=function(){var l=yt(this);if(l)return l;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error(`could not read FormData body as blob`);return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?yt(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(xt)}),this.text=function(){var l=yt(this);if(l)return l;if(this._bodyBlob)return St(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ct(this._bodyArrayBuffer));if(this._bodyFormData)throw Error(`could not read FormData body as text`);return Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(kt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Et=[`DELETE`,`GET`,`HEAD`,`OPTIONS`,`POST`,`PUT`];function Dt(l){var p=l.toUpperCase();return Et.indexOf(p)>-1?p:l}function Ot(l,p){p=p||{};var h=p.body;if(l instanceof Ot){if(l.bodyUsed)throw TypeError(`Already read`);this.url=l.url,this.credentials=l.credentials,p.headers||(this.headers=new _t(l.headers)),this.method=l.method,this.mode=l.mode,this.signal=l.signal,!h&&l._bodyInit!=null&&(h=l._bodyInit,l.bodyUsed=!0)}else this.url=String(l);if(this.credentials=p.credentials||this.credentials||`same-origin`,(p.headers||!this.headers)&&(this.headers=new _t(p.headers)),this.method=Dt(p.method||this.method||`GET`),this.mode=p.mode||this.mode||null,this.signal=p.signal||this.signal,this.referrer=null,(this.method===`GET`||this.method===`HEAD`)&&h)throw TypeError(`Body not allowed for GET or HEAD requests`);this._initBody(h)}Ot.prototype.clone=function(){return new Ot(this,{body:this._bodyInit})};function kt(l){var p=new FormData;return l.trim().split(`&`).forEach(function(l){if(l){var h=l.split(`=`),de=h.shift().replace(/\+/g,` `),pe=h.join(`=`).replace(/\+/g,` `);p.append(decodeURIComponent(de),decodeURIComponent(pe))}}),p}function At(l){var p=new _t;return l.replace(/\r?\n[\t ]+/g,` `).split(/\r?\n/).forEach(function(l){var h=l.split(`:`),de=h.shift().trim();if(de){var pe=h.join(`:`).trim();p.append(de,pe)}}),p}Tt.call(Ot.prototype);function jt(l,p){p||(p={}),this.type=`default`,this.status=p.status===void 0?200:p.status,this.ok=this.status>=200&&this.status<300,this.statusText=`statusText`in p?p.statusText:`OK`,this.headers=new _t(p.headers),this.url=p.url||``,this._initBody(l)}Tt.call(jt.prototype),jt.prototype.clone=function(){return new jt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _t(this.headers),url:this.url})},jt.error=function(){var l=new jt(null,{status:0,statusText:``});return l.type=`error`,l};var Mt=[301,302,303,307,308];jt.redirect=function(l,p){if(Mt.indexOf(p)===-1)throw RangeError(`Invalid status code`);return new jt(null,{status:p,headers:{location:l}})},p.DOMException=l.DOMException;try{new p.DOMException}catch{p.DOMException=function(l,p){this.message=l,this.name=p,this.stack=Error(l).stack},p.DOMException.prototype=Object.create(Error.prototype),p.DOMException.prototype.constructor=p.DOMException}function Nt(l,de){return new Promise(function(pe,me){var nt=new Ot(l,de);if(nt.signal&&nt.signal.aborted)return me(new p.DOMException(`Aborted`,`AbortError`));var st=new XMLHttpRequest;function mt(){st.abort()}st.onload=function(){var l={status:st.status,statusText:st.statusText,headers:At(st.getAllResponseHeaders()||``)};l.url=`responseURL`in st?st.responseURL:l.headers.get(`X-Request-URL`),pe(new jt(`response`in st?st.response:st.responseText,l))},st.onerror=function(){me(TypeError(`Network request failed`))},st.ontimeout=function(){me(TypeError(`Network request failed`))},st.onabort=function(){me(new p.DOMException(`Aborted`,`AbortError`))},st.open(nt.method,nt.url,!0),nt.credentials===`include`?st.withCredentials=!0:nt.credentials===`omit`&&(st.withCredentials=!1),`responseType`in st&&h.blob&&(st.responseType=`blob`),nt.headers.forEach(function(l,p){st.setRequestHeader(p,l)}),nt.signal&&(nt.signal.addEventListener(`abort`,mt),st.onreadystatechange=function(){st.readyState===4&&nt.signal.removeEventListener(`abort`,mt)}),st.send(nt._bodyInit===void 0?null:nt._bodyInit)})}return Nt.polyfill=!0,l.fetch||(l.fetch=Nt,l.Headers=_t,l.Request=Ot,l.Response=jt),p.Headers=_t,p.Request=Ot,p.Response=jt,p.fetch=Nt,Object.defineProperty(p,`__esModule`,{value:!0}),p})({})})(de),de.fetch.ponyfill=!0,delete de.fetch.polyfill;var pe=de;l=pe.fetch,l.default=pe.fetch,l.fetch=pe.fetch,l.Headers=pe.Headers,l.Request=pe.Request,l.Response=pe.Response,p.exports=l})),import_browser_ponyfill=__toESM(require_browser_ponyfill());(function(l){var p=l.URLSearchParams&&l.URLSearchParams.prototype.get?l.URLSearchParams:null,h=p&&new p({a:1}).toString()===`a=1`,de=p&&new p(`s=%2B`).get(`s`)===`+`,pe=`__URLSearchParams__`,me=p?(function(){var l=new p;return l.append(`s`,` &`),l.toString()===`s=+%26`})():!0,nt=mt.prototype,st=!!(l.Symbol&&l.Symbol.iterator);if(p&&h&&de&&me)return;function mt(l){l=l||``,(l instanceof URLSearchParams||l instanceof mt)&&(l=l.toString()),this[pe]=Ct(l)}nt.append=function(l,p){wt(this[pe],l,p)},nt.delete=function(l){delete this[pe][l]},nt.get=function(l){var p=this[pe];return l in p?p[l][0]:null},nt.getAll=function(l){var p=this[pe];return l in p?p[l].slice(0):[]},nt.has=function(l){return l in this[pe]},nt.set=function(l,p){this[pe][l]=[``+p]},nt.toString=function(){var l=this[pe],p=[],h,de,me,nt;for(de in l)for(me=bt(de),h=0,nt=l[de];h<nt.length;h++)p.push(me+`=`+bt(nt[h]));return p.join(`&`)};var _t=!!de&&p&&!h&&l.Proxy;Object.defineProperty(l,`URLSearchParams`,{value:_t?new Proxy(p,{construct:function(l,p){return new l(new mt(p[0]).toString())}}):mt});var yt=l.URLSearchParams.prototype;yt.polyfill=!0,yt.forEach=yt.forEach||function(l,p){var h=Ct(this.toString());Object.getOwnPropertyNames(h).forEach(function(de){h[de].forEach(function(h){l.call(p,h,de,this)},this)},this)},yt.sort=yt.sort||function(){var l=Ct(this.toString()),p=[],h,de,pe;for(h in l)p.push(h);for(p.sort(),de=0;de<p.length;de++)this.delete(p[de]);for(de=0;de<p.length;de++){var me=p[de],nt=l[me];for(pe=0;pe<nt.length;pe++)this.append(me,nt[pe])}},yt.keys=yt.keys||function(){var l=[];return this.forEach(function(p,h){l.push(h)}),St(l)},yt.values=yt.values||function(){var l=[];return this.forEach(function(p){l.push(p)}),St(l)},yt.entries=yt.entries||function(){var l=[];return this.forEach(function(p,h){l.push([h,p])}),St(l)},st&&(yt[l.Symbol.iterator]=yt[l.Symbol.iterator]||yt.entries);function bt(l){var p={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(l).replace(/[!'\(\)~]|%20|%00/g,function(l){return p[l]})}function xt(l){return l.replace(/[ +]/g,`%20`).replace(/(%[a-f0-9]{2})+/gi,function(l){return decodeURIComponent(l)})}function St(p){var h={next:function(){var l=p.shift();return{done:l===void 0,value:l}}};return st&&(h[l.Symbol.iterator]=function(){return h}),h}function Ct(l){var p={};if(typeof l==`object`)if(Tt(l))for(var h=0;h<l.length;h++){var de=l[h];if(Tt(de)&&de.length===2)wt(p,de[0],de[1]);else throw TypeError(`Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements`)}else for(var pe in l)l.hasOwnProperty(pe)&&wt(p,pe,l[pe]);else{l.indexOf(`?`)===0&&(l=l.slice(1));for(var me=l.split(`&`),nt=0;nt<me.length;nt++){var st=me[nt],mt=st.indexOf(`=`);-1<mt?wt(p,xt(st.slice(0,mt)),xt(st.slice(mt+1))):st&&wt(p,xt(st),``)}}return p}function wt(l,p,h){var de=typeof h==`string`?h:h!=null&&typeof h.toString==`function`?h.toString():JSON.stringify(h);p in l?l[p].push(de):l[p]=[de]}function Tt(l){return!!l&&Object.prototype.toString.call(l)===`[object Array]`}})(typeof global<`u`?global:typeof window<`u`?window:void 0);async function*responseChunks(l){let p=l.body;if(p&&typeof p.getReader==`function`){let l=p.getReader();try{for(;;){let{done:p,value:h}=await l.read();if(p)break;h&&(yield h)}}finally{l.releaseLock?.()}return}if(p&&Symbol.asyncIterator in p){for await(let l of p)typeof l==`string`?yield new TextEncoder().encode(l):yield new Uint8Array(l);return}throw Error(`Unsupported response body type for streaming`)}var HttpTransport=class{constructor({authorization:l,apiUrl:p,method:h,headers:de={},credentials:pe,fetchTimeout:me,signal:nt}){this.authorization=l,this.apiUrl=p,this.method=h,this.headers=de,this.credentials=pe,this.fetchTimeout=me,this.signal=nt}request(l,{method:p,fetchTimeout:h,baseRequestId:de,signal:pe,...me}){let nt=1,st=new URLSearchParams(me&&Object.keys(me).map(l=>({[l]:typeof me[l]==`object`?JSON.stringify(me[l]):me[l]})).reduce((l,p)=>({...l,...p}),{})),mt=`${this.apiUrl}/${l}${st.toString().length?`?${st}`:``}`,_t=p??this.method??(mt.length<2e3?`GET`:`POST`);_t===`POST`&&(mt=`${this.apiUrl}/${l}`,this.headers[`Content-Type`]=`application/json`);let yt=h??this.fetchTimeout,bt=pe||this.signal||(yt?AbortSignal.timeout(yt):void 0),xt=()=>(0,import_browser_ponyfill.default)(mt,{method:_t,headers:{Authorization:this.authorization,"x-request-id":de&&`${de}-span-${nt++}`,...this.headers},credentials:this.credentials,body:_t===`POST`?JSON.stringify(me):null,signal:bt});return{async subscribe(l){try{return l(await xt(),()=>this.subscribe(l))}catch(p){let h=`network Error`;return p.name===`AbortError`&&(h=bt?.reason===`TimeoutError`||bt?.reason?.name===`TimeoutError`?`timeout`:`aborted`),l({error:h},()=>this.subscribe(l))}}}}requestStream(l,{method:p,fetchTimeout:h,baseRequestId:de,signal:pe,params:me}){let nt={};me&&Object.keys(me).forEach(l=>{let p=me[l];p!==void 0&&(nt[l]=typeof p==`object`?JSON.stringify(p):String(p))});let st=new URLSearchParams(nt),mt=`${this.apiUrl}/${l}${st.toString().length?`?${st}`:``}`,_t=p??this.method??`POST`;_t===`POST`&&(mt=`${this.apiUrl}/${l}`,this.headers[`Content-Type`]=`application/json`);let yt=h??this.fetchTimeout,bt,xt=pe||this.signal;return!xt&&yt&&(bt=new AbortController,xt=bt.signal,setTimeout(()=>bt?.abort(),yt)),{stream:async()=>{let l=await(0,import_browser_ponyfill.default)(mt,{method:_t,headers:{Authorization:this.authorization,"x-request-id":de||`stream-request`,...this.headers},credentials:this.credentials,body:_t===`POST`?JSON.stringify(me||{}):null,signal:xt});if(!l.ok)throw Error(`HTTP ${l.status}: ${l.statusText}`);if(!l.body)throw Error(`No response body available for streaming`);return responseChunks(l)},unsubscribe:async()=>{bt&&bt.abort()}}}},RequestError=class extends Error{constructor(l,p,h){super(l),this.response=p,this.status=h}},mutexCounter=0,MUTEX_ERROR=`Mutex has been changed`;function mutexPromise(l){return l.then(l=>l).catch(l=>{if(l!==MUTEX_ERROR)throw l;return null})}var CubeApi=class{constructor(l,p){if(l&&!Array.isArray(l)&&typeof l==`object`&&(p=l,l=void 0),!p||!p.transport&&!p.apiUrl)throw Error("The `apiUrl` option is required");this.apiToken=l,this.apiUrl=p.apiUrl,this.method=p.method,this.headers=p.headers||{},this.credentials=p.credentials,this.transport=p.transport||new HttpTransport({authorization:typeof l==`string`?l:void 0,apiUrl:this.apiUrl,method:this.method,headers:this.headers,credentials:this.credentials,fetchTimeout:p.fetchTimeout,signal:p.signal}),this.pollInterval=p.pollInterval||5,this.parseDateMeasures=p.parseDateMeasures,this.castNumerics=typeof p.castNumerics==`boolean`?p.castNumerics:!1,this.networkErrorRetries=p.networkErrorRetries||0,this.updateAuthorizationPromise=null}request(l,p){return this.transport.request(l,{...p,baseRequestId:p?.baseRequestId||v4$1()})}loadMethod(l,p,h,de){let pe=++mutexCounter;typeof h==`function`&&!de&&(de=h,h=void 0),h=h||{};let me=h.mutexKey||`default`;h.mutexObj&&(h.mutexObj[me]=pe);let nt=this.updateTransportAuthorization().then(()=>l()),st=!0,mt=!1,_t=async()=>{let l=await nt;if(h&&h.mutexObj&&h.mutexObj[me]!==pe)throw mt=!0,l.unsubscribe&&await l.unsubscribe(),MUTEX_ERROR},yt=this.networkErrorRetries,bt=async(l,pe)=>{let me=await nt,bt=async()=>h?.subscribe&&!mt?(me.unsubscribe||await new Promise(l=>setTimeout(()=>l(),this.pollInterval*1e3)),pe()):null,xt=async(l=!1)=>mt?null:(l&&await new Promise(l=>setTimeout(()=>l(),this.pollInterval*1e3)),pe());if(h?.subscribe&&!st&&await this.updateTransportAuthorization(),st=!1,`status`in l&&l.status===502||`error`in l&&l.error?.toLowerCase()===`network error`&&--yt>=0)return await _t(),xt(!0);l=l;let St={},Ct=``;try{Ct=await l.text(),St=JSON.parse(Ct)}catch{St.error=Ct}if(St.error?.includes(`Continue wait`))return await _t(),h?.progressCallback&&h.progressCallback(new ProgressResult(St)),xt();if(l.status!==200){await _t(),!h?.subscribe&&me.unsubscribe&&await me.unsubscribe();let p=new RequestError(St.error||l.error||``,St,l.status);if(de)de(p);else throw p;return bt()}await _t(),!h?.subscribe&&me.unsubscribe&&await me.unsubscribe();let wt=p(St);if(de)de(null,wt);else return wt;return bt()},xt=nt.then(l=>mutexPromise(l.subscribe(bt)));return de?{unsubscribe:async()=>{let l=await nt;return mt=!0,l.unsubscribe?l.unsubscribe():null}}:xt}async updateTransportAuthorization(){if(this.updateAuthorizationPromise){await this.updateAuthorizationPromise;return}let l=this.apiToken;if(typeof l==`function`){let p=(async()=>{try{let p=await l();this.transport.authorization!==p&&(this.transport.authorization=p)}finally{this.updateAuthorizationPromise=null}})();this.updateAuthorizationPromise=p,await p}}patchQueryInternal(l,p){return p===`compact`&&l.responseFormat!==`compact`?{...l,responseFormat:`compact`}:l}loadResponseInternal(l,p={}){return l.results.length&&(p?.castNumerics&&l.results.forEach(l=>{let p=Object.entries({...l.annotation.measures,...l.annotation.dimensions}).reduce((l,[p,h])=>(h.type===`number`&&l.push(p),l),[]);l.data=l.data.map(l=>(p.forEach(p=>{l[p]!=null&&(l[p]=Number(l[p]))}),l))}),l.results[0].query.responseFormat&&l.results[0].query.responseFormat===`compact`&&l.results.forEach((p,h)=>{let de=[],{dataset:pe,members:me}=p.data;pe.forEach(l=>{let p={};me.forEach((h,de)=>{p[h]=l[de]}),de.push(p)}),l.results[h].data=de})),new ResultSet(l,{parseDateMeasures:this.parseDateMeasures})}load(l,p,h,de=`default`){[l,p]=this.prepareQueryOptions(l,p,de);let pe={query:l,queryType:`multi`,signal:p?.signal,baseRequestId:p?.baseRequestId};return p?.cache&&(pe.cache=p.cache),this.loadMethod(()=>this.request(`load`,pe),l=>this.loadResponseInternal(l,p),p,h)}prepareQueryOptions(l,p,h=`default`){return p={castNumerics:this.castNumerics,...p},h===`compact`?Array.isArray(l)?[l.map(l=>this.patchQueryInternal(l,`compact`)),p]:[this.patchQueryInternal(l,`compact`),p]:[l,p]}subscribe(l,p,h,de=`default`){return[l,p]=this.prepareQueryOptions(l,p,de),this.loadMethod(()=>this.request(`subscribe`,{query:l,queryType:`multi`,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>this.loadResponseInternal(l,p),{...p,subscribe:!0},h)}sql(l,p,h){return this.loadMethod(()=>this.request(`sql`,{query:l,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>Array.isArray(l)?l.map(l=>new SqlQuery(l)):new SqlQuery(l),p,h)}meta(l,p){return this.loadMethod(()=>this.request(`meta`,{signal:l?.signal,baseRequestId:l?.baseRequestId}),l=>new Meta(l),l,p)}dryRun(l,p,h){return this.loadMethod(()=>this.request(`dry-run`,{query:l,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>l,p,h)}cubeSql(l,p,h){return this.loadMethod(()=>{let h={query:l,method:`POST`,signal:p?.signal,fetchTimeout:p?.timeout,baseRequestId:p?.baseRequestId,throwContinueWait:!0};return p?.cache&&(h.cache=p.cache),this.request(`cubesql`,h)},l=>{if(!l||!l.error)throw Error(`Invalid response format`);if(l.error===`timeout`){let l=p?.timeout||300*1e3;throw Error(`CubeSQL query timed out after ${l}ms`)}if(l.error===`aborted`)throw Error(`CubeSQL query was aborted`);let[h,...de]=l.error.split(`
977
+ `;function CodeSnippet({code:l,language:p,style:h,copyMessage:de,theme:pe=`dark`}){return(0,import_jsx_runtime.jsx)(ot,{theme:{background:pe===`dark`?`#F6F6F8`:`#FFFFFF`},children:(0,import_jsx_runtime.jsxs)(StyledCodeSnippet,{style:h,children:[(0,import_jsx_runtime.jsx)(PrismCode,{code:l,language:p,style:{flexGrow:1}}),(0,import_jsx_runtime.jsx)(ButtonWrapper$1,{children:(0,import_jsx_runtime.jsx)(button_default,{icon:(0,import_jsx_runtime.jsx)(RefIcon$26,{}),onClick:()=>copyToClipboard(l,de||`Copied`)})})]})})}function useAppContext(){return(0,import_react.useContext)(AppContext$1)}function usePlaygroundContext(){let{playgroundContext:l}=useAppContext();return l}function useToken(){let{token:l}=useAppContext();return l}var byteToHex$1=[];for(let l=0;l<256;++l)byteToHex$1.push((l+256).toString(16).slice(1));function unsafeStringify(l,p=0){return(byteToHex$1[l[p+0]]+byteToHex$1[l[p+1]]+byteToHex$1[l[p+2]]+byteToHex$1[l[p+3]]+`-`+byteToHex$1[l[p+4]]+byteToHex$1[l[p+5]]+`-`+byteToHex$1[l[p+6]]+byteToHex$1[l[p+7]]+`-`+byteToHex$1[l[p+8]]+byteToHex$1[l[p+9]]+`-`+byteToHex$1[l[p+10]]+byteToHex$1[l[p+11]]+byteToHex$1[l[p+12]]+byteToHex$1[l[p+13]]+byteToHex$1[l[p+14]]+byteToHex$1[l[p+15]]).toLowerCase()}var getRandomValues$1,rnds8$1=new Uint8Array(16);function rng$1(){if(!getRandomValues$1){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);getRandomValues$1=crypto.getRandomValues.bind(crypto)}return getRandomValues$1(rnds8$1)}var randomUUID=typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native_default={randomUUID};function v4$1(l,p,h){if(native_default.randomUUID&&!p&&!l)return native_default.randomUUID();l=l||{};let de=l.random??l.rng?.()??rng$1();if(de.length<16)throw Error(`Random bytes length must be >= 16`);if(de[6]=de[6]&15|64,de[8]=de[8]&63|128,p){if(h=h||0,h<0||h+16>p.length)throw RangeError(`UUID byte range ${h}:${h+15} is out of buffer bounds`);for(let l=0;l<16;++l)p[h+l]=de[l];return p}return unsafeStringify(de)}var require_dayjs_min=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs=de()})(l,(function(){var l=1e3,p=6e4,h=36e5,de=`millisecond`,pe=`second`,me=`minute`,nt=`hour`,st=`day`,mt=`week`,_t=`month`,yt=`quarter`,bt=`year`,xt=`date`,St=`Invalid Date`,Ct=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,wt=/\[([^\]]+)]|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,Tt={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(`_`)},Et=function(l,p,h){var de=String(l);return!de||de.length>=p?l:``+Array(p+1-de.length).join(h)+l},Dt={s:Et,z:function(l){var p=-l.utcOffset(),h=Math.abs(p),de=Math.floor(h/60),pe=h%60;return(p<=0?`+`:`-`)+Et(de,2,`0`)+`:`+Et(pe,2,`0`)},m:function l(p,h){if(p.date()<h.date())return-l(h,p);var de=12*(h.year()-p.year())+(h.month()-p.month()),pe=p.clone().add(de,_t),me=h-pe<0,nt=p.clone().add(de+(me?-1:1),_t);return+(-(de+(h-pe)/(me?pe-nt:nt-pe))||0)},a:function(l){return l<0?Math.ceil(l)||0:Math.floor(l)},p:function(l){return{M:_t,y:bt,w:mt,d:st,D:xt,h:nt,m:me,s:pe,ms:de,Q:yt}[l]||String(l||``).toLowerCase().replace(/s$/,``)},u:function(l){return l===void 0}},Ot=`en`,kt={};kt[Ot]=Tt;var At=function(l){return l instanceof Pt},jt=function(l,p,h){var de;if(!l)return Ot;if(typeof l==`string`)kt[l]&&(de=l),p&&(kt[l]=p,de=l);else{var pe=l.name;kt[pe]=l,de=pe}return!h&&de&&(Ot=de),de||!h&&Ot},Mt=function(l,p){if(At(l))return l.clone();var h=typeof p==`object`?p:{};return h.date=l,h.args=arguments,new Pt(h)},Nt=Dt;Nt.l=jt,Nt.i=At,Nt.w=function(l,p){return Mt(l,{locale:p.$L,utc:p.$u,x:p.$x,$offset:p.$offset})};var Pt=function(){function Tt(l){this.$L=jt(l.locale,null,!0),this.parse(l)}var Et=Tt.prototype;return Et.parse=function(l){this.$d=function(l){var p=l.date,h=l.utc;if(p===null)return new Date(NaN);if(Nt.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p==`string`&&!/Z$/i.test(p)){var de=p.match(Ct);if(de){var pe=de[2]-1||0,me=(de[7]||`0`).substring(0,3);return h?new Date(Date.UTC(de[1],pe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,me)):new Date(de[1],pe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,me)}}return new Date(p)}(l),this.$x=l.x||{},this.init()},Et.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},Et.$utils=function(){return Nt},Et.isValid=function(){return this.$d.toString()!==St},Et.isSame=function(l,p){var h=Mt(l);return this.startOf(p)<=h&&h<=this.endOf(p)},Et.isAfter=function(l,p){return Mt(l)<this.startOf(p)},Et.isBefore=function(l,p){return this.endOf(p)<Mt(l)},Et.$g=function(l,p,h){return Nt.u(l)?this[p]:this.set(h,l)},Et.unix=function(){return Math.floor(this.valueOf()/1e3)},Et.valueOf=function(){return this.$d.getTime()},Et.startOf=function(l,p){var h=this,de=!!Nt.u(p)||p,yt=Nt.p(l),St=function(l,p){var pe=Nt.w(h.$u?Date.UTC(h.$y,p,l):new Date(h.$y,p,l),h);return de?pe:pe.endOf(st)},Ct=function(l,p){return Nt.w(h.toDate()[l].apply(h.toDate(`s`),(de?[0,0,0,0]:[23,59,59,999]).slice(p)),h)},wt=this.$W,Tt=this.$M,Et=this.$D,Dt=`set`+(this.$u?`UTC`:``);switch(yt){case bt:return de?St(1,0):St(31,11);case _t:return de?St(1,Tt):St(0,Tt+1);case mt:var Ot=this.$locale().weekStart||0,kt=(wt<Ot?wt+7:wt)-Ot;return St(de?Et-kt:Et+(6-kt),Tt);case st:case xt:return Ct(Dt+`Hours`,0);case nt:return Ct(Dt+`Minutes`,1);case me:return Ct(Dt+`Seconds`,2);case pe:return Ct(Dt+`Milliseconds`,3);default:return this.clone()}},Et.endOf=function(l){return this.startOf(l,!1)},Et.$set=function(l,p){var h,mt=Nt.p(l),yt=`set`+(this.$u?`UTC`:``),St=(h={},h[st]=yt+`Date`,h[xt]=yt+`Date`,h[_t]=yt+`Month`,h[bt]=yt+`FullYear`,h[nt]=yt+`Hours`,h[me]=yt+`Minutes`,h[pe]=yt+`Seconds`,h[de]=yt+`Milliseconds`,h)[mt],Ct=mt===st?this.$D+(p-this.$W):p;if(mt===_t||mt===bt){var wt=this.clone().set(xt,1);wt.$d[St](Ct),wt.init(),this.$d=wt.set(xt,Math.min(this.$D,wt.daysInMonth())).$d}else St&&this.$d[St](Ct);return this.init(),this},Et.set=function(l,p){return this.clone().$set(l,p)},Et.get=function(l){return this[Nt.p(l)]()},Et.add=function(de,yt){var xt,St=this;de=Number(de);var Ct=Nt.p(yt),wt=function(l){var p=Mt(St);return Nt.w(p.date(p.date()+Math.round(l*de)),St)};if(Ct===_t)return this.set(_t,this.$M+de);if(Ct===bt)return this.set(bt,this.$y+de);if(Ct===st)return wt(1);if(Ct===mt)return wt(7);var Tt=(xt={},xt[me]=p,xt[nt]=h,xt[pe]=l,xt)[Ct]||1,Et=this.$d.getTime()+de*Tt;return Nt.w(Et,this)},Et.subtract=function(l,p){return this.add(-1*l,p)},Et.format=function(l){var p=this,h=this.$locale();if(!this.isValid())return h.invalidDate||St;var de=l||`YYYY-MM-DDTHH:mm:ssZ`,pe=Nt.z(this),me=this.$H,nt=this.$m,st=this.$M,mt=h.weekdays,_t=h.months,yt=function(l,h,pe,me){return l&&(l[h]||l(p,de))||pe[h].substr(0,me)},bt=function(l){return Nt.s(me%12||12,l,`0`)},xt=h.meridiem||function(l,p,h){var de=l<12?`AM`:`PM`;return h?de.toLowerCase():de},Ct={YY:String(this.$y).slice(-2),YYYY:this.$y,M:st+1,MM:Nt.s(st+1,2,`0`),MMM:yt(h.monthsShort,st,_t,3),MMMM:yt(_t,st),D:this.$D,DD:Nt.s(this.$D,2,`0`),d:String(this.$W),dd:yt(h.weekdaysMin,this.$W,mt,2),ddd:yt(h.weekdaysShort,this.$W,mt,3),dddd:mt[this.$W],H:String(me),HH:Nt.s(me,2,`0`),h:bt(1),hh:bt(2),a:xt(me,nt,!0),A:xt(me,nt,!1),m:String(nt),mm:Nt.s(nt,2,`0`),s:String(this.$s),ss:Nt.s(this.$s,2,`0`),SSS:Nt.s(this.$ms,3,`0`),Z:pe};return de.replace(wt,(function(l,p){return p||Ct[l]||pe.replace(`:`,``)}))},Et.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Et.diff=function(de,xt,St){var Ct,wt=Nt.p(xt),Tt=Mt(de),Et=(Tt.utcOffset()-this.utcOffset())*p,Dt=this-Tt,Ot=Nt.m(this,Tt);return Ot=(Ct={},Ct[bt]=Ot/12,Ct[_t]=Ot,Ct[yt]=Ot/3,Ct[mt]=(Dt-Et)/6048e5,Ct[st]=(Dt-Et)/864e5,Ct[nt]=Dt/h,Ct[me]=Dt/p,Ct[pe]=Dt/l,Ct)[wt]||Dt,St?Ot:Nt.a(Ot)},Et.daysInMonth=function(){return this.endOf(_t).$D},Et.$locale=function(){return kt[this.$L]},Et.locale=function(l,p){if(!l)return this.$L;var h=this.clone(),de=jt(l,p,!0);return de&&(h.$L=de),h},Et.clone=function(){return Nt.w(this.$d,this)},Et.toDate=function(){return new Date(this.valueOf())},Et.toJSON=function(){return this.isValid()?this.toISOString():null},Et.toISOString=function(){return this.$d.toISOString()},Et.toString=function(){return this.$d.toUTCString()},Tt}(),Ft=Pt.prototype;return Mt.prototype=Ft,[[`$ms`,de],[`$s`,pe],[`$m`,me],[`$H`,nt],[`$W`,st],[`$M`,_t],[`$y`,bt],[`$D`,xt]].forEach((function(l){Ft[l[1]]=function(p){return this.$g(p,l[0],l[1])}})),Mt.extend=function(l,p){return l.$i||(l(p,Pt,Mt),l.$i=!0),Mt},Mt.locale=jt,Mt.isDayjs=At,Mt.unix=function(l){return Mt(1e3*l)},Mt.en=kt[Ot],Mt.Ls=kt,Mt.p={},Mt}))}));function _isPlaceholder(l){return typeof l==`object`&&!!l&&l[`@@functional/placeholder`]===!0}function _curry1(l){return function p(h){return arguments.length===0||_isPlaceholder(h)?p:l.apply(this,arguments)}}function _curry2(l){return function p(h,de){switch(arguments.length){case 0:return p;case 1:return _isPlaceholder(h)?p:_curry1(function(p){return l(h,p)});default:return _isPlaceholder(h)&&_isPlaceholder(de)?p:_isPlaceholder(h)?_curry1(function(p){return l(p,de)}):_isPlaceholder(de)?_curry1(function(p){return l(h,p)}):l(h,de)}}}function _arity(l,p){switch(l){case 0:return function(){return p.apply(this,arguments)};case 1:return function(l){return p.apply(this,arguments)};case 2:return function(l,h){return p.apply(this,arguments)};case 3:return function(l,h,de){return p.apply(this,arguments)};case 4:return function(l,h,de,pe){return p.apply(this,arguments)};case 5:return function(l,h,de,pe,me){return p.apply(this,arguments)};case 6:return function(l,h,de,pe,me,nt){return p.apply(this,arguments)};case 7:return function(l,h,de,pe,me,nt,st){return p.apply(this,arguments)};case 8:return function(l,h,de,pe,me,nt,st,mt){return p.apply(this,arguments)};case 9:return function(l,h,de,pe,me,nt,st,mt,_t){return p.apply(this,arguments)};case 10:return function(l,h,de,pe,me,nt,st,mt,_t,yt){return p.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function _curryN(l,p,h){return function(){for(var de=[],pe=0,me=l,nt=0;nt<p.length||pe<arguments.length;){var st;nt<p.length&&(!_isPlaceholder(p[nt])||pe>=arguments.length)?st=p[nt]:(st=arguments[pe],pe+=1),de[nt]=st,_isPlaceholder(st)||--me,nt+=1}return me<=0?h.apply(this,de):_arity(me,_curryN(l,de,h))}}var curryN$1=_curry2(function(l,p){return l===1?_curry1(p):_arity(l,_curryN(l,[],p))});function _curry3(l){return function p(h,de,pe){switch(arguments.length){case 0:return p;case 1:return _isPlaceholder(h)?p:_curry2(function(p,de){return l(h,p,de)});case 2:return _isPlaceholder(h)&&_isPlaceholder(de)?p:_isPlaceholder(h)?_curry2(function(p,h){return l(p,de,h)}):_isPlaceholder(de)?_curry2(function(p,de){return l(h,p,de)}):_curry1(function(p){return l(h,de,p)});default:return _isPlaceholder(h)&&_isPlaceholder(de)&&_isPlaceholder(pe)?p:_isPlaceholder(h)&&_isPlaceholder(de)?_curry2(function(p,h){return l(p,h,pe)}):_isPlaceholder(h)&&_isPlaceholder(pe)?_curry2(function(p,h){return l(p,de,h)}):_isPlaceholder(de)&&_isPlaceholder(pe)?_curry2(function(p,de){return l(h,p,de)}):_isPlaceholder(h)?_curry1(function(p){return l(p,de,pe)}):_isPlaceholder(de)?_curry1(function(p){return l(h,p,pe)}):_isPlaceholder(pe)?_curry1(function(p){return l(h,de,p)}):l(h,de,pe)}}}var _isArray_default=Array.isArray||function(l){return l!=null&&l.length>=0&&Object.prototype.toString.call(l)===`[object Array]`};function _isTransformer(l){return l!=null&&typeof l[`@@transducer/step`]==`function`}function _dispatchable(l,p,h){return function(){if(arguments.length===0)return h();var de=Array.prototype.slice.call(arguments,0),pe=de.pop();if(!_isArray_default(pe)){for(var me=0;me<l.length;){if(typeof pe[l[me]]==`function`)return pe[l[me]].apply(pe,de);me+=1}if(_isTransformer(pe))return p.apply(null,de)(pe)}return h.apply(this,arguments)}}function _reduced(l){return l&&l[`@@transducer/reduced`]?l:{"@@transducer/value":l,"@@transducer/reduced":!0}}var _xfBase_default={init:function(){return this.xf[`@@transducer/init`]()},result:function(l){return this.xf[`@@transducer/result`](l)}};function _map(l,p){for(var h=0,de=p.length,pe=Array(de);h<de;)pe[h]=l(p[h]),h+=1;return pe}function _isString(l){return Object.prototype.toString.call(l)===`[object String]`}var _isArrayLike=_curry1(function(l){return _isArray_default(l)?!0:!l||typeof l!=`object`||_isString(l)?!1:l.nodeType===1?!!l.length:l.length===0?!0:l.length>0?l.hasOwnProperty(0)&&l.hasOwnProperty(l.length-1):!1}),XWrap=function(){function l(l){this.f=l}return l.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},l.prototype[`@@transducer/result`]=function(l){return l},l.prototype[`@@transducer/step`]=function(l,p){return this.f(l,p)},l}();function _xwrap(l){return new XWrap(l)}var bind$1=_curry2(function(l,p){return _arity(l.length,function(){return l.apply(p,arguments)})});function _arrayReduce(l,p,h){for(var de=0,pe=h.length;de<pe;){if(p=l[`@@transducer/step`](p,h[de]),p&&p[`@@transducer/reduced`]){p=p[`@@transducer/value`];break}de+=1}return l[`@@transducer/result`](p)}function _iterableReduce(l,p,h){for(var de=h.next();!de.done;){if(p=l[`@@transducer/step`](p,de.value),p&&p[`@@transducer/reduced`]){p=p[`@@transducer/value`];break}de=h.next()}return l[`@@transducer/result`](p)}function _methodReduce(l,p,h,de){return l[`@@transducer/result`](h[de](bind$1(l[`@@transducer/step`],l),p))}var symIterator=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function _reduce(l,p,h){if(typeof l==`function`&&(l=_xwrap(l)),_isArrayLike(h))return _arrayReduce(l,p,h);if(typeof h[`fantasy-land/reduce`]==`function`)return _methodReduce(l,p,h,`fantasy-land/reduce`);if(h[symIterator]!=null)return _iterableReduce(l,p,h[symIterator]());if(typeof h.next==`function`)return _iterableReduce(l,p,h);if(typeof h.reduce==`function`)return _methodReduce(l,p,h,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}var XMap=function(){function l(l,p){this.xf=p,this.f=l}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=_xfBase_default.result,l.prototype[`@@transducer/step`]=function(l,p){return this.xf[`@@transducer/step`](l,this.f(p))},l}(),_xmap=_curry2(function(l,p){return new XMap(l,p)});function _has(l,p){return Object.prototype.hasOwnProperty.call(p,l)}var toString$2=Object.prototype.toString,_isArguments=function(){return toString$2.call(arguments)===`[object Arguments]`?function(l){return toString$2.call(l)===`[object Arguments]`}:function(l){return _has(`callee`,l)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable(`toString`),nonEnumerableProps=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable(`length`)}(),contains$1=function(l,p){for(var h=0;h<l.length;){if(l[h]===p)return!0;h+=1}return!1},keys$1=_curry1(typeof Object.keys==`function`&&!hasArgsEnumBug?function(l){return Object(l)===l?Object.keys(l):[]}:function(l){if(Object(l)!==l)return[];var p,h,de=[],pe=hasArgsEnumBug&&_isArguments(l);for(p in l)_has(p,l)&&(!pe||p!==`length`)&&(de[de.length]=p);if(hasEnumBug)for(h=nonEnumerableProps.length-1;h>=0;)p=nonEnumerableProps[h],_has(p,l)&&!contains$1(de,p)&&(de[de.length]=p),--h;return de}),map$3=_curry2(_dispatchable([`fantasy-land/map`,`map`],_xmap,function(l,p){switch(Object.prototype.toString.call(p)){case`[object Function]`:return curryN$1(p.length,function(){return l.call(this,p.apply(this,arguments))});case`[object Object]`:return _reduce(function(h,de){return h[de]=l(p[de]),h},{},keys$1(p));default:return _map(l,p)}})),_isInteger_default=Number.isInteger||function(l){return l<<0===l},nth=_curry2(function(l,p){var h=l<0?p.length+l:l;return _isString(p)?p.charAt(h):p[h]}),paths=_curry2(function(l,p){return l.map(function(l){for(var h=p,de=0,pe;de<l.length;){if(h==null)return;pe=l[de],h=_isInteger_default(pe)?nth(pe,h):h[pe],de+=1}return h})}),path$1=_curry2(function(l,p){return paths([l],p)[0]}),prop=_curry2(function(l,p){return path$1([l],p)}),reduce=_curry3(_reduce);function _makeFlat(l){return function p(h){for(var de,pe,me,nt=[],st=0,mt=h.length;st<mt;){if(_isArrayLike(h[st]))for(de=l?p(h[st]):h[st],me=0,pe=de.length;me<pe;)nt[nt.length]=de[me],me+=1;else nt[nt.length]=h[st];st+=1}return nt}}function _forceReduced(l){return{"@@transducer/value":l,"@@transducer/reduced":!0}}var preservingReduced=function(l){return{"@@transducer/init":_xfBase_default.init,"@@transducer/result":function(p){return l[`@@transducer/result`](p)},"@@transducer/step":function(p,h){var de=l[`@@transducer/step`](p,h);return de[`@@transducer/reduced`]?_forceReduced(de):de}}},_flatCat=function(l){var p=preservingReduced(l);return{"@@transducer/init":_xfBase_default.init,"@@transducer/result":function(l){return p[`@@transducer/result`](l)},"@@transducer/step":function(l,h){return _isArrayLike(h)?_reduce(p,l,h):_reduce(p,l,[h])}}},_xchain=_curry2(function(l,p){return map$3(l,_flatCat(p))}),chain=_curry2(_dispatchable([`fantasy-land/chain`,`chain`],_xchain,function(l,p){return typeof p==`function`?function(h){return l(p(h))(h)}:_makeFlat(!1)(map$3(l,p))}));function _cloneRegExp(l){return new RegExp(l.source,(l.global?`g`:``)+(l.ignoreCase?`i`:``)+(l.multiline?`m`:``)+(l.sticky?`y`:``)+(l.unicode?`u`:``))}var type$1=_curry1(function(l){return l===null?`Null`:l===void 0?`Undefined`:Object.prototype.toString.call(l).slice(8,-1)});function _clone(l,p,h,de){var pe=function(pe){for(var me=p.length,nt=0;nt<me;){if(l===p[nt])return h[nt];nt+=1}for(var st in p[nt+1]=l,h[nt+1]=pe,l)pe[st]=de?_clone(l[st],p,h,!0):l[st];return pe};switch(type$1(l)){case`Object`:return pe({});case`Array`:return pe([]);case`Date`:return new Date(l.valueOf());case`RegExp`:return _cloneRegExp(l);default:return l}}var clone=_curry1(function(l){return l!=null&&typeof l.clone==`function`?l.clone():_clone(l,[],[],!0)});function _pipe(l,p){return function(){return p.call(this,l.apply(this,arguments))}}function _checkForMethod(l,p){return function(){var h=arguments.length;if(h===0)return p();var de=arguments[h-1];return _isArray_default(de)||typeof de[l]!=`function`?p.apply(this,arguments):de[l].apply(de,Array.prototype.slice.call(arguments,0,h-1))}}var slice$3=_curry3(_checkForMethod(`slice`,function(l,p,h){return Array.prototype.slice.call(h,l,p)})),tail=_curry1(_checkForMethod(`tail`,slice$3(1,1/0)));function pipe(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}function _identity(l){return l}var identity$5=_curry1(_identity);function _arrayFromIterator(l){for(var p=[],h;!(h=l.next()).done;)p.push(h.value);return p}function _includesWith(l,p,h){for(var de=0,pe=h.length;de<pe;){if(l(p,h[de]))return!0;de+=1}return!1}function _functionName(l){var p=String(l).match(/^function (\w*)/);return p==null?``:p[1]}function _objectIs(l,p){return l===p?l!==0||1/l==1/p:l!==l&&p!==p}var _objectIs_default=typeof Object.is==`function`?Object.is:_objectIs;function _uniqContentEquals(l,p,h,de){var pe=_arrayFromIterator(l),me=_arrayFromIterator(p);function nt(l,p){return _equals(l,p,h.slice(),de.slice())}return!_includesWith(function(l,p){return!_includesWith(nt,p,l)},me,pe)}function _equals(l,p,h,de){if(_objectIs_default(l,p))return!0;var pe=type$1(l);if(pe!==type$1(p)||l==null||p==null)return!1;if(typeof l[`fantasy-land/equals`]==`function`||typeof p[`fantasy-land/equals`]==`function`)return typeof l[`fantasy-land/equals`]==`function`&&l[`fantasy-land/equals`](p)&&typeof p[`fantasy-land/equals`]==`function`&&p[`fantasy-land/equals`](l);if(typeof l.equals==`function`||typeof p.equals==`function`)return typeof l.equals==`function`&&l.equals(p)&&typeof p.equals==`function`&&p.equals(l);switch(pe){case`Arguments`:case`Array`:case`Object`:if(typeof l.constructor==`function`&&_functionName(l.constructor)===`Promise`)return l===p;break;case`Boolean`:case`Number`:case`String`:if(!(typeof l==typeof p&&_objectIs_default(l.valueOf(),p.valueOf())))return!1;break;case`Date`:if(!_objectIs_default(l.valueOf(),p.valueOf()))return!1;break;case`Error`:return l.name===p.name&&l.message===p.message;case`RegExp`:if(!(l.source===p.source&&l.global===p.global&&l.ignoreCase===p.ignoreCase&&l.multiline===p.multiline&&l.sticky===p.sticky&&l.unicode===p.unicode))return!1;break}for(var me=h.length-1;me>=0;){if(h[me]===l)return de[me]===p;--me}switch(pe){case`Map`:return l.size===p.size?_uniqContentEquals(l.entries(),p.entries(),h.concat([l]),de.concat([p])):!1;case`Set`:return l.size===p.size?_uniqContentEquals(l.values(),p.values(),h.concat([l]),de.concat([p])):!1;case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var nt=keys$1(l);if(nt.length!==keys$1(p).length)return!1;var st=h.concat([l]),mt=de.concat([p]);for(me=nt.length-1;me>=0;){var _t=nt[me];if(!(_has(_t,p)&&_equals(p[_t],l[_t],st,mt)))return!1;--me}return!0}var equals$2=_curry2(function(l,p){return _equals(l,p,[],[])});function _indexOf(l,p,h){var de,pe;if(typeof l.indexOf==`function`)switch(typeof p){case`number`:if(p===0){for(de=1/p;h<l.length;){if(pe=l[h],pe===0&&1/pe===de)return h;h+=1}return-1}else if(p!==p){for(;h<l.length;){if(pe=l[h],typeof pe==`number`&&pe!==pe)return h;h+=1}return-1}return l.indexOf(p,h);case`string`:case`boolean`:case`function`:case`undefined`:return l.indexOf(p,h);case`object`:if(p===null)return l.indexOf(p,h)}for(;h<l.length;){if(equals$2(l[h],p))return h;h+=1}return-1}function _includes(l,p){return _indexOf(p,l,0)>=0}function _isObject(l){return Object.prototype.toString.call(l)===`[object Object]`}var XReduceBy=function(){function l(l,p,h,de){this.valueFn=l,this.valueAcc=p,this.keyFn=h,this.xf=de,this.inputs={}}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=function(l){for(var p in this.inputs)if(_has(p,this.inputs)&&(l=this.xf[`@@transducer/step`](l,this.inputs[p]),l[`@@transducer/reduced`])){l=l[`@@transducer/value`];break}return this.inputs=null,this.xf[`@@transducer/result`](l)},l.prototype[`@@transducer/step`]=function(l,p){var h=this.keyFn(p);return this.inputs[h]=this.inputs[h]||[h,this.valueAcc],this.inputs[h][1]=this.valueFn(this.inputs[h][1],p),l},l}(),_xreduceBy=_curryN(4,[],function(l,p,h,de){return new XReduceBy(l,p,h,de)}),reduceBy=_curryN(4,[],_dispatchable([],_xreduceBy,function(l,p,h,de){return _reduce(function(de,pe){var me=h(pe);return de[me]=l(_has(me,de)?de[me]:_clone(p,[],[],!1),pe),de},{},de)})),_Set=function(){function l(){this._nativeSet=typeof Set==`function`?new Set:null,this._items={}}return l.prototype.add=function(l){return!hasOrAdd(l,!0,this)},l.prototype.has=function(l){return hasOrAdd(l,!1,this)},l}();function hasOrAdd(l,p,h){var de=typeof l,pe,me;switch(de){case`string`:case`number`:return l===0&&1/l==-1/0?h._items[`-0`]?!0:(p&&(h._items[`-0`]=!0),!1):h._nativeSet===null?de in h._items?l in h._items[de]?!0:(p&&(h._items[de][l]=!0),!1):(p&&(h._items[de]={},h._items[de][l]=!0),!1):p?(pe=h._nativeSet.size,h._nativeSet.add(l),me=h._nativeSet.size,me===pe):h._nativeSet.has(l);case`boolean`:if(de in h._items){var nt=+!!l;return h._items[de][nt]?!0:(p&&(h._items[de][nt]=!0),!1)}else return p&&(h._items[de]=l?[!1,!0]:[!0,!1]),!1;case`function`:return h._nativeSet===null?de in h._items?_includes(l,h._items[de])?!0:(p&&h._items[de].push(l),!1):(p&&(h._items[de]=[l]),!1):p?(pe=h._nativeSet.size,h._nativeSet.add(l),me=h._nativeSet.size,me===pe):h._nativeSet.has(l);case`undefined`:return h._items[de]?!0:(p&&(h._items[de]=!0),!1);case`object`:if(l===null)return h._items.null?!0:(p&&(h._items.null=!0),!1);default:return de=Object.prototype.toString.call(l),de in h._items?_includes(l,h._items[de])?!0:(p&&h._items[de].push(l),!1):(p&&(h._items[de]=[l]),!1)}}var XTake=function(){function l(l,p){this.xf=p,this.n=l,this.i=0}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=_xfBase_default.result,l.prototype[`@@transducer/step`]=function(l,p){this.i+=1;var h=this.n===0?l:this.xf[`@@transducer/step`](l,p);return this.n>=0&&this.i>=this.n?_reduced(h):h},l}(),_xtake=_curry2(function(l,p){return new XTake(l,p)}),take=_curry2(_dispatchable([`take`],_xtake,function(l,p){return slice$3(0,l<0?1/0:l,p)}));function dropLast$1(l,p){return take(l<p.length?p.length-l:0,p)}var XDropLast=function(){function l(l,p){this.xf=p,this.pos=0,this.full=!1,this.acc=Array(l)}return l.prototype[`@@transducer/init`]=_xfBase_default.init,l.prototype[`@@transducer/result`]=function(l){return this.acc=null,this.xf[`@@transducer/result`](l)},l.prototype[`@@transducer/step`]=function(l,p){return this.full&&(l=this.xf[`@@transducer/step`](l,this.acc[this.pos])),this.store(p),l},l.prototype.store=function(l){this.acc[this.pos]=l,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},l}(),_xdropLast=_curry2(function(l,p){return new XDropLast(l,p)}),dropLast=_curry2(_dispatchable([],_xdropLast,dropLast$1)),flatten$1=_curry1(_makeFlat(!0)),fromPairs=_curry1(function(l){for(var p={},h=0;h<l.length;)p[l[h][0]]=l[h][1],h+=1;return p}),groupBy=_curry2(_checkForMethod(`groupBy`,reduceBy(function(l,p){return l??(l=[]),l.push(p),l},null))),indexBy=reduceBy(function(l,p){return p},null),uniqBy$1=_curry2(function(l,p){for(var h=new _Set,de=[],pe=0,me,nt;pe<p.length;)nt=p[pe],me=l(nt),h.add(me)&&de.push(nt),pe+=1;return de}),uniq=uniqBy$1(identity$5),maxBy$1=_curry3(function(l,p,h){return l(h)>l(p)?h:p}),mergeWithKey=_curry3(function(l,p,h){var de={},pe;for(pe in p)_has(pe,p)&&(de[pe]=_has(pe,h)?l(pe,p[pe],h[pe]):p[pe]);for(pe in h)_has(pe,h)&&!_has(pe,de)&&(de[pe]=h[pe]);return de}),mergeDeepWithKey=_curry3(function l(p,h,de){return mergeWithKey(function(h,de,pe){return _isObject(de)&&_isObject(pe)?l(p,de,pe):p(h,de,pe)},h,de)}),mergeDeepLeft=_curry2(function(l,p){return mergeDeepWithKey(function(l,p,h){return p},l,p)}),minBy$1=_curry3(function(l,p,h){return l(h)<l(p)?h:p}),pick=_curry2(function(l,p){for(var h={},de=0;de<l.length;)l[de]in p&&(h[l[de]]=p[l[de]]),de+=1;return h}),toPairs=_curry1(function(l){var p=[];for(var h in l)_has(h,l)&&(p[p.length]=[h,l[h]]);return p}),unnest$1=chain(_identity),require_quarterOfYear=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_quarterOfYear=de()})(l,(function(){var l=`month`,p=`quarter`;return function(h,de){var pe=de.prototype;pe.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var me=pe.add;pe.add=function(h,de){return h=Number(h),this.$utils().p(de)===p?this.add(3*h,l):me.bind(this)(h,de)};var nt=pe.startOf;pe.startOf=function(h,de){var pe=this.$utils(),me=!!pe.u(de)||de;if(pe.p(h)===p){var st=this.quarter()-1;return me?this.month(3*st).startOf(l).startOf(`day`):this.month(3*st+2).endOf(l).endOf(`day`)}return nt.bind(this)(h,de)}}}))})),require_duration=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_duration=de()})(l,(function(){var l,p,h=1e3,de=6e4,pe=36e5,me=864e5,nt=/\[([^\]]+)]|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,st=31536e6,mt=2592e6,_t=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,yt={years:st,months:mt,days:me,hours:pe,minutes:de,seconds:h,milliseconds:1,weeks:6048e5},bt=function(l){return l instanceof Dt},xt=function(l,p,h){return new Dt(l,h,p.$l)},St=function(l){return p.p(l)+`s`},Ct=function(l){return l<0},wt=function(l){return Ct(l)?Math.ceil(l):Math.floor(l)},Tt=function(l){return Math.abs(l)},Et=function(l,p){return l?Ct(l)?{negative:!0,format:``+Tt(l)+p}:{negative:!1,format:``+l+p}:{negative:!1,format:``}},Dt=function(){function Ct(l,p,h){var de=this;if(this.$d={},this.$l=h,l===void 0&&(this.$ms=0,this.parseFromMilliseconds()),p)return xt(l*yt[St(p)],this);if(typeof l==`number`)return this.$ms=l,this.parseFromMilliseconds(),this;if(typeof l==`object`)return Object.keys(l).forEach((function(p){de.$d[St(p)]=l[p]})),this.calMilliseconds(),this;if(typeof l==`string`){var pe=l.match(_t);if(pe){var me=pe.slice(2).map((function(l){return l==null?0:Number(l)}));return this.$d.years=me[0],this.$d.months=me[1],this.$d.weeks=me[2],this.$d.days=me[3],this.$d.hours=me[4],this.$d.minutes=me[5],this.$d.seconds=me[6],this.calMilliseconds(),this}}return this}var Tt=Ct.prototype;return Tt.calMilliseconds=function(){var l=this;this.$ms=Object.keys(this.$d).reduce((function(p,h){return p+(l.$d[h]||0)*yt[h]}),0)},Tt.parseFromMilliseconds=function(){var l=this.$ms;this.$d.years=wt(l/st),l%=st,this.$d.months=wt(l/mt),l%=mt,this.$d.days=wt(l/me),l%=me,this.$d.hours=wt(l/pe),l%=pe,this.$d.minutes=wt(l/de),l%=de,this.$d.seconds=wt(l/h),l%=h,this.$d.milliseconds=l},Tt.toISOString=function(){var l=Et(this.$d.years,`Y`),p=Et(this.$d.months,`M`),h=+this.$d.days||0;this.$d.weeks&&(h+=7*this.$d.weeks);var de=Et(h,`D`),pe=Et(this.$d.hours,`H`),me=Et(this.$d.minutes,`M`),nt=this.$d.seconds||0;this.$d.milliseconds&&(nt+=this.$d.milliseconds/1e3);var st=Et(nt,`S`),mt=l.negative||p.negative||de.negative||pe.negative||me.negative||st.negative,_t=pe.format||me.format||st.format?`T`:``,yt=(mt?`-`:``)+`P`+l.format+p.format+de.format+_t+pe.format+me.format+st.format;return yt===`P`||yt===`-P`?`P0D`:yt},Tt.toJSON=function(){return this.toISOString()},Tt.format=function(l){var h=l||`YYYY-MM-DDTHH:mm:ss`,de={Y:this.$d.years,YY:p.s(this.$d.years,2,`0`),YYYY:p.s(this.$d.years,4,`0`),M:this.$d.months,MM:p.s(this.$d.months,2,`0`),D:this.$d.days,DD:p.s(this.$d.days,2,`0`),H:this.$d.hours,HH:p.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:p.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:p.s(this.$d.seconds,2,`0`),SSS:p.s(this.$d.milliseconds,3,`0`)};return h.replace(nt,(function(l,p){return p||String(de[l])}))},Tt.as=function(l){return this.$ms/yt[St(l)]},Tt.get=function(l){var p=this.$ms,h=St(l);return h===`milliseconds`?p%=1e3:p=h===`weeks`?wt(p/yt[h]):this.$d[h],p===0?0:p},Tt.add=function(l,p,h){var de;return de=p?l*yt[St(p)]:bt(l)?l.$ms:xt(l,this).$ms,xt(this.$ms+de*(h?-1:1),this)},Tt.subtract=function(l,p){return this.add(l,p,!0)},Tt.locale=function(l){var p=this.clone();return p.$l=l,p},Tt.clone=function(){return xt(this.$ms,this)},Tt.humanize=function(p){return l().add(this.$ms,`ms`).locale(this.$l).fromNow(!p)},Tt.milliseconds=function(){return this.get(`milliseconds`)},Tt.asMilliseconds=function(){return this.as(`milliseconds`)},Tt.seconds=function(){return this.get(`seconds`)},Tt.asSeconds=function(){return this.as(`seconds`)},Tt.minutes=function(){return this.get(`minutes`)},Tt.asMinutes=function(){return this.as(`minutes`)},Tt.hours=function(){return this.get(`hours`)},Tt.asHours=function(){return this.as(`hours`)},Tt.days=function(){return this.get(`days`)},Tt.asDays=function(){return this.as(`days`)},Tt.weeks=function(){return this.get(`weeks`)},Tt.asWeeks=function(){return this.as(`weeks`)},Tt.months=function(){return this.get(`months`)},Tt.asMonths=function(){return this.as(`months`)},Tt.years=function(){return this.get(`years`)},Tt.asYears=function(){return this.as(`years`)},Ct}();return function(h,de,pe){l=pe,p=pe().$utils(),pe.duration=function(l,p){return xt(l,{$l:pe.locale()},p)},pe.isDuration=bt;var me=de.prototype.add,nt=de.prototype.subtract;de.prototype.add=function(l,p){return bt(l)&&(l=l.asMilliseconds()),me.bind(this)(l,p)},de.prototype.subtract=function(l,p){return bt(l)&&(l=l.asMilliseconds()),nt.bind(this)(l,p)}}}))})),require_isoWeek=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_plugin_isoWeek=de()})(l,(function(){var l=`day`;return function(p,h,de){var pe=function(p){return p.add(4-p.isoWeekday(),l)},me=h.prototype;me.isoWeekYear=function(){return pe(this).year()},me.isoWeek=function(p){if(!this.$utils().u(p))return this.add(7*(p-this.isoWeek()),l);var h,me,nt,st,mt=pe(this),_t=(h=this.isoWeekYear(),me=this.$u,nt=(me?de.utc:de)().year(h).startOf(`year`),st=4-nt.isoWeekday(),nt.isoWeekday()>4&&(st+=7),nt.add(st,l));return mt.diff(_t,`week`)+1},me.isoWeekday=function(l){return this.$utils().u(l)?this.day()||7:this.day(this.day()%7?l:l-7)};var nt=me.startOf;me.startOf=function(l,p){var h=this.$utils(),de=!!h.u(p)||p;return h.p(l)===`isoweek`?de?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):nt.bind(this)(l,p)}}}))})),require_en=__commonJSMin(((l,p)=>{(function(h,de){typeof l==`object`&&p!==void 0?p.exports=de():typeof define==`function`&&define.amd?define(de):(h=typeof globalThis<`u`?globalThis:h||self).dayjs_locale_en=de()})(l,(function(){return{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(`_`)}}))})),import_dayjs_min=__toESM(require_dayjs_min()),import_quarterOfYear=__toESM(require_quarterOfYear()),import_duration=__toESM(require_duration()),import_isoWeek=__toESM(require_isoWeek()),import_en=__toESM(require_en());import_dayjs_min.default.extend(import_quarterOfYear.default),import_dayjs_min.default.extend(import_duration.default),import_dayjs_min.default.extend(import_isoWeek.default);var cubeInternalLocale=`cube-internal-en`,customLocale={...import_en.default,name:cubeInternalLocale,weekStart:1};import_dayjs_min.default.Ls[cubeInternalLocale]=customLocale;var GRANULARITIES=[{name:void 0,title:`w/o grouping`},{name:`second`,title:`Second`},{name:`minute`,title:`Minute`},{name:`hour`,title:`Hour`},{name:`day`,title:`Day`},{name:`week`,title:`Week`},{name:`month`,title:`Month`},{name:`quarter`,title:`Quarter`},{name:`year`,title:`Year`}],internalDayjs=(...l)=>(0,import_dayjs_min.default)(...l).locale(cubeInternalLocale),TIME_SERIES={day:l=>l.by(`d`).map(l=>l.format(`YYYY-MM-DDT00:00:00.000`)),month:l=>l.snapTo(`month`).by(`M`).map(l=>l.format(`YYYY-MM-01T00:00:00.000`)),year:l=>l.snapTo(`year`).by(`y`).map(l=>l.format(`YYYY-01-01T00:00:00.000`)),hour:l=>l.by(`h`).map(l=>l.format(`YYYY-MM-DDTHH:00:00.000`)),minute:l=>l.by(`m`).map(l=>l.format(`YYYY-MM-DDTHH:mm:00.000`)),second:l=>l.by(`s`).map(l=>l.format(`YYYY-MM-DDTHH:mm:ss.000`)),week:l=>l.snapTo(`week`).by(`w`).map(l=>l.startOf(`week`).format(`YYYY-MM-DDT00:00:00.000`)),quarter:l=>l.snapTo(`quarter`).by(`quarter`).map(l=>l.startOf(`quarter`).format(`YYYY-MM-DDT00:00:00.000`))},isPredefinedGranularity=l=>!!TIME_SERIES[l],DateRegex=/^\d\d\d\d-\d\d-\d\d$/,LocalDateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;function parseSqlInterval(l){let p={},h=l.split(/\s+/);for(let l=0;l<h.length;l+=2){let de=parseInt(h[l],10),pe=h[l+1],me=pe.endsWith(`s`)?pe.slice(0,-1):pe;p[me]=de}return p}function addInterval(l,p){let h=l.clone();return Object.entries(p).forEach(([l,p])=>{h=h.add(p,l)}),h}function subtractInterval(l,p){let h=l.clone();return Object.entries(p).forEach(([l,p])=>{h=h.subtract(p,l)}),h}function alignToOrigin(l,p,h){let de=l.clone(),pe,me=!1,nt=addInterval(h,p);if(nt.isBefore(h)&&(me=!0),nt=h.clone(),l.isBefore(h)){for(pe=me?addInterval:subtractInterval;nt.isAfter(l);)nt=pe(nt,p);de=nt}else{for(pe=me?subtractInterval:addInterval;nt.isBefore(l);)de=nt.clone(),nt=pe(nt,p);nt.isSame(l)&&(de=nt)}return de}var dayRange=(l,p,h)=>({by:h=>{let de=[],pe=internalDayjs(l),me=internalDayjs(p);for(;pe.startOf(h).isBefore(me)||pe.isSame(me);)de.push(pe),pe=pe.add(1,h);return de},snapTo:de=>{if(!isPredefinedGranularity(de)&&h){let p;for(let l of Object.keys(h))if(l.endsWith(`.${de}`)&&h[l].granularity){p=h[l].granularity;break}if(p?.interval){let de=parseSqlInterval(p.interval),pe=internalDayjs(l);if(p.origin||p.offset){let l;l=p.origin?internalDayjs(p.origin):addInterval(internalDayjs().startOf(`year`),parseSqlInterval(p.offset)),pe=alignToOrigin(pe,de,l)}let me=addInterval(pe,de).subtract(1,`millisecond`);return dayRange(pe,me,h)}}return dayRange(internalDayjs(l).startOf(de),internalDayjs(p).endOf(de),h)},start:internalDayjs(l),end:internalDayjs(p)}),timeSeriesFromCustomInterval=(l,p,h)=>{let de=parseSqlInterval(h.interval),pe=internalDayjs(l),me=internalDayjs(p),nt=h.origin?internalDayjs(h.origin):internalDayjs().startOf(`year`);h.offset&&(nt=addInterval(nt,parseSqlInterval(h.offset)));let st=alignToOrigin(pe,de,nt),mt=[];for(;st.isBefore(me)||st.isSame(me);)mt.push(st.format(`YYYY-MM-DDTHH:mm:ss.000`)),st=addInterval(st,de);return mt},diffTimeUnitForInterval=l=>/second/i.test(l)?`second`:/minute/i.test(l)?`minute`:/hour/i.test(l)?`hour`:/day/i.test(l)||/week/i.test(l)?`day`:/month/i.test(l)||/quarter/i.test(l)?`month`:`year`,granularityOrder=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`],minGranularityForIntervals=(l,p)=>{let h=diffTimeUnitForInterval(l),de=diffTimeUnitForInterval(p);return granularityOrder.indexOf(h)>granularityOrder.indexOf(de)?h:de},granularityFor=l=>{let p=internalDayjs(l),h=p.month(),de=p.date(),pe=p.hour(),me=p.minute(),nt=p.second(),st=p.millisecond(),mt=p.isoWeekday();return h===0&&de===1&&pe===0&&me===0&&nt===0&&st===0?`year`:de===1&&pe===0&&me===0&&nt===0&&st===0?`month`:mt===1&&pe===0&&me===0&&nt===0&&st===0?`week`:pe===0&&me===0&&nt===0&&st===0?`day`:me===0&&nt===0&&st===0?`hour`:nt===0&&st===0?`minute`:`second`};function removeEmptyQueryFields(l){return fromPairs(toPairs(l||{}).flatMap(([l,p])=>[`measures`,`dimensions`,`segments`,`timeDimensions`,`filters`].includes(l)&&Array.isArray(p)&&p.length===0||l===`order`&&p&&(Array.isArray(p)&&p.length===0||!Object.keys(p).length)?[]:[[l,p]]))}function validateQuery$1(l){let p=l||{};return removeEmptyQueryFields({...p,filters:(p.filters||[]).filter(l=>`operator`in l),timeDimensions:(p.timeDimensions||[]).filter(l=>!(!l.dateRange&&!l.granularity))})}function areQueriesEqual(l,p){return equals$2(Object.entries(l?.order||{}),Object.entries(p?.order||{}))&&equals$2(l,p)}function defaultOrder(l){let p=(l.timeDimensions||[]).find(l=>l.granularity);return p?{[p.dimension]:`asc`}:(l.measures||[]).length>0&&(l.dimensions||[]).length>0?{[l.measures[0]]:`desc`}:(l.dimensions||[]).length>0?{[l.dimensions[0]]:`asc`}:{}}function defaultHeuristics(l,p,h){let{query:de,...pe}=clone(l),{meta:me,sessionGranularity:nt}=h,st=nt||`day`,mt={shouldApplyHeuristicOrder:!1,pivotConfig:null,query:de,...pe},_t=null;if(areQueriesEqual(de,p)||(_t=de),Array.isArray(_t)||Array.isArray(p))return{shouldApplyHeuristicOrder:!1,pivotConfig:null,...l};if(_t){if((p.timeDimensions||[]).length===1&&(_t.timeDimensions||[]).length===1&&_t.timeDimensions[0].granularity&&p.timeDimensions[0].granularity!==_t.timeDimensions[0].granularity&&(mt={...mt,sessionGranularity:_t.timeDimensions[0].granularity}),(p.measures||[]).length===0&&(_t.measures||[]).length>0||(p.measures||[]).length===1&&(_t.measures||[]).length===1&&p.measures[0]!==_t.measures[0]){let[l]=_t.timeDimensions||[],p=me.defaultTimeDimensionNameFor(_t.measures[0]);return _t={..._t,timeDimensions:p?[{dimension:p,granularity:l?.granularity||st,dateRange:l?.dateRange}]:[]},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:p?`line`:`number`}}return(p.dimensions||[]).length===0&&(_t.dimensions||[]).length>0?(_t={..._t,timeDimensions:(_t.timeDimensions||[]).map(l=>({...l,granularity:void 0}))},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:`table`}):(p.dimensions||[]).length>0&&(_t.dimensions||[]).length===0?(_t={..._t,timeDimensions:(_t.timeDimensions||[]).map(l=>({...l,granularity:l.granularity||st}))},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,chartType:(_t.timeDimensions||[]).length?`line`:`number`}):((p.dimensions||[]).length>0||(p.measures||[]).length>0)&&(_t.dimensions||[]).length===0&&(_t.measures||[]).length===0?(_t={..._t,timeDimensions:[],filters:[]},{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:_t,sessionGranularity:null}):mt}if(mt.chartType){let l=mt.chartType;if((l===`line`||l===`area`)&&(p.timeDimensions||[]).length===1&&!p.timeDimensions[0].granularity){let[l]=p.timeDimensions;return{...mt,pivotConfig:null,query:{...p,timeDimensions:[{...l,granularity:st}]}}}if((l===`pie`||l===`table`||l===`number`)&&(p.timeDimensions||[]).length===1&&p.timeDimensions[0].granularity){let[l]=p.timeDimensions;return{...mt,pivotConfig:null,shouldApplyHeuristicOrder:!0,query:{...p,timeDimensions:[{...l,granularity:void 0}]}}}}return mt}function isQueryPresent(l){return l?(Array.isArray(l)?l:[l]).every(l=>l.measures?.length||l.dimensions?.length||l.timeDimensions?.length):!1}function movePivotItem$1(l,p,h,de,pe){let me={...l,x:[...l.x||[]],y:[...l.y||[]]},nt=l[de][p],st=me[pe].length-1;return nt===`measures`?h=st+1:de===pe&&h>=st&&me[pe][st]===`measures`?h=st-1:de!==pe&&h>st&&me[pe][st]===`measures`&&(h=st),me[de].splice(p,1),me[pe].splice(h,0,nt),me}function moveItemInArray(l,p,h){let de=[...l],[pe]=de.splice(p,1);return de.splice(h,0,pe),de}function flattenFilters(l=[]){return l.reduce((l,p)=>`or`in p?[...l,...flattenFilters(p.or)]:`and`in p?[...l,...flattenFilters(p.and)]:[...l,p],[])}function getQueryMembers(l={}){let p=[`measures`,`dimensions`,`segments`],h=new Set;return p.forEach(p=>(l[p]||[]).forEach(l=>h.add(l))),(l.timeDimensions||[]).forEach(l=>h.add(l.dimension)),flattenFilters(l.filters).forEach(l=>{let p=l.dimension||l.member;typeof p==`string`&&h.add(p)}),[...h]}function aliasSeries(l,p,h,de=new Set){let pe=l.filter(l=>l!=null);return h?.aliasSeries?.[p]?[h.aliasSeries[p],...pe]:de.has(pe[0])?[p,...pe]:pe}var groupByToPairs=function(l){let p=new Map;return h=>(h.forEach(h=>{let de=l(h);p.has(de)||p.set(de,[]),p.get(de).push(h)}),Array.from(p.entries()))},unnest=l=>{let p=[];return l.forEach(l=>{l.forEach(l=>p.push(l))}),p},QUERY_TYPE={REGULAR_QUERY:`regularQuery`,COMPARE_DATE_RANGE_QUERY:`compareDateRangeQuery`,BLENDING_QUERY:`blendingQuery`},ResultSet=class l{static measureFromAxis(l){return l[l.length-1]}static timeDimensionMember(l){return`${l.dimension}.${l.granularity}`}static deserialize(p,h){return new l(p.loadResponse,h)}constructor(l,p={}){if(`queryType`in l&&l.queryType!=null?(this.loadResponse=l,this.queryType=l.queryType,this.loadResponses=l.results):(this.queryType=QUERY_TYPE.REGULAR_QUERY,this.loadResponse={...l,pivotQuery:{...l.query,queryType:this.queryType}},this.loadResponses=[l]),!Object.values(QUERY_TYPE).includes(this.queryType))throw Error(`Unknown query type`);this.parseDateMeasures=p.parseDateMeasures,this.options=p,this.backwardCompatibleData=[]}drillDown(l,p){if(this.queryType===QUERY_TYPE.COMPARE_DATE_RANGE_QUERY)throw Error(`compareDateRange drillDown query is not currently supported`);if(this.queryType===QUERY_TYPE.BLENDING_QUERY)throw Error(`Data blending drillDown query is not currently supported`);let{query:h}=this.loadResponses[0],de=l?.xValues??[],pe=l?.yValues??[],me=this.normalizePivotConfig(p),nt=[];me?.x.forEach((l,p)=>nt.push([l,de[p]])),me?.y.forEach((l,p)=>nt.push([l,pe[p]]));let{filters:st=[],segments:mt=[]}=this.query(),{measures:_t,timeDimensions:yt}=this.loadResponses[0].annotation,[,bt]=nt.find(([l])=>l===`measures`)||[];if(bt===void 0&&([bt]=Object.keys(_t)),!(_t[bt]?.drillMembers?.length??0))return null;let xt=[{member:bt,operator:`measureFilter`},...st],St=[];return nt.filter(([l])=>l!==`measures`).forEach(([l,p])=>{let[de,pe,me]=l.split(`.`);if(me!==void 0){let l=dayRange(p,p,yt).snapTo(me),nt=h.timeDimensions?.find(l=>l.dimension),st=[l.start,l.end];if(nt?.dateRange){let[p,h]=nt.dateRange;st=[(0,import_dayjs_min.default)(p)>l.start?(0,import_dayjs_min.default)(p):l.start,(0,import_dayjs_min.default)(h)<l.end?(0,import_dayjs_min.default)(h):l.end]}St.push({dimension:[de,pe].join(`.`),dateRange:st.map(l=>l.format(`YYYY-MM-DDTHH:mm:ss.SSS`))})}else p==null?xt.push({member:l,operator:`notSet`}):xt.push({member:l,operator:`equals`,values:[p.toString()]})}),St.length===0&&Array.isArray(h.timeDimensions)&&h.timeDimensions.length>0&&h.timeDimensions[0].granularity==null&&St.push(h.timeDimensions[0]),{..._t[bt].drillMembersGrouped,filters:xt,...mt.length>0?{segments:mt}:{},timeDimensions:St,segments:mt,timezone:h.timezone}}series(l){return this.seriesNames(l).map(({title:p,shortTitle:h,key:de})=>({title:p,shortTitle:h,key:de,series:this.chartPivot(l).map(({x:l,...p})=>({value:p[de],x:l}))}))}axisValues(l,p=0){let{query:h}=this.loadResponses[p],de=l.filter(l=>l!==`measures`),pe=l.includes(`measures`)&&h.measures||[];return l=>{let p=p=>{let h=de.map(p=>l[p]??null);return p&&h.push(p),h};return pe.length>0?pe.map(p):[p()]}}axisValuesString(l,p=`, `){return l.map(l=>l==null?`∅`:l===``?`[Empty string]`:l).join(p)}static getNormalizedPivotConfig(p,h){let de={x:[],y:[],fillMissingDates:!0,joinDateRange:!1},{measures:pe=[],dimensions:me=[]}=p||{},nt=(p?.timeDimensions||[]).filter(l=>!!l.granularity);h=h||(nt.length?{x:nt.map(p=>l.timeDimensionMember(p)),y:me}:{x:me,y:[]});let st=mergeDeepLeft(h,de),mt=h=>h.map(h=>nt.find(l=>l.dimension===h)&&!me.find(l=>l===h)?l.timeDimensionMember((p?.timeDimensions||[]).find(l=>l.dimension===h)):h);st.x=mt(st.x),st.y=mt(st.y);let _t=st.x.concat(st.y),yt=nt.map(p=>l.timeDimensionMember(p)).concat(me),bt=l=>yt.includes(l)||l===`measures`;return st.x=st.x.concat(yt.filter(l=>!_t.includes(l)&&l!==`compareDateRange`)).filter(bt),st.y=st.y.filter(bt),st.x.concat(st.y).find(l=>l===`measures`)||st.y.push(`measures`),me.includes(`compareDateRange`)&&!st.y.concat(st.x).includes(`compareDateRange`)&&st.y.unshift(`compareDateRange`),pe.length||(st.x=st.x.filter(l=>l!==`measures`),st.y=st.y.filter(l=>l!==`measures`)),st}normalizePivotConfig(p){return l.getNormalizedPivotConfig(this.loadResponse.pivotQuery,p)}timeSeries(p,h,de){if(!p.granularity)return null;let pe;if(pe=p.dateRange,!pe){let de=l.timeDimensionMember(p),me=this.timeDimensionBackwardCompatibleData(h||0).map(l=>{let p=l[de];return p?internalDayjs(p):null}).filter(l=>!!l);pe=me.length&&[reduce(minBy$1(l=>l.toDate()),me[0],me).toString(),reduce(maxBy$1(l=>l.toDate()),me[0],me).toString()]||null}if(!pe)return null;let me=p.dateRange?p.dateRange.find(l=>l.match(DateRegex)):![`hour`,`minute`,`second`].includes(p.granularity),[nt,st]=pe,mt=dayRange(nt,st,de);if(isPredefinedGranularity(p.granularity))return TIME_SERIES[p.granularity](me?mt.snapTo(`d`):mt);if(!de?.[`${p.dimension}.${p.granularity}`])throw Error(`Granularity "${p.granularity}" not found in time dimension "${p.dimension}"`);return timeSeriesFromCustomInterval(nt,st,de[`${p.dimension}.${p.granularity}`].granularity)}pivot(p){let h=this.normalizePivotConfig(p),{pivotQuery:de}=this.loadResponse,pe=(p=0)=>{let pe=groupByToPairs(({xValues:l})=>this.axisValuesString(l)),me=(l,p)=>l[p]??h.fillWithValue??0;if(h.fillMissingDates&&h.x.length===1&&equals$2(h.x,(de.timeDimensions||[]).filter(l=>!!l.granularity).map(p=>l.timeDimensionMember(p)))){let l=this.loadResponses.map(l=>this.timeSeries(l.query.timeDimensions[0],p,l.annotation.timeDimensions));l[0]&&(pe=h=>{let de=groupBy(({xValues:l})=>l[0],h);return l[p]?.map(l=>[l,de[l]||[{xValues:[l],row:{}}]])??[]})}let nt=this.axisValues(h.x,p),st=this.axisValues(h.y,p),mt=pipe(map$3(l=>nt(l).map(p=>({xValues:p,row:l}))),unnest,pe)(this.timeDimensionBackwardCompatibleData(p)),_t={};mt.forEach(([,l])=>{l.forEach(({row:l})=>{st(l).forEach(p=>{Object.keys(l).length>0&&(_t[p.join()]=p)})})});let yt=Object.values(_t),bt=h.x.includes(`measures`);return mt.map(([,p])=>{let{xValues:h}=p[0],de={};return p.forEach(({row:l})=>{st(l).map(p=>({yValues:p,row:l})).forEach(l=>{de[this.axisValuesString(l.yValues)]=l})}),{xValues:h,yValuesArray:unnest(yt.map(p=>{let pe=bt?l.measureFromAxis(h):l.measureFromAxis(p);return[[p,me((de[this.axisValuesString(p)]||{row:{}}).row,pe)]]}))}})},me=this.loadResponses.length>1?this.loadResponses.map((l,p)=>pe(p)):[];return me.length?this.mergePivots(me,h.joinDateRange||!1):pe()}mergePivots(l,p){let h=l.reduce((l,p)=>l!=null&&p.length>=l.length?l:p,null)||[];return h.map((de,pe)=>({xValues:p?[l.map(l=>l[pe]?.xValues||[]).join(`, `)]:h[pe].xValues,yValuesArray:unnest(l.map(l=>l[pe].yValuesArray))}))}chartPivot(l){let p=l=>this.parseDateMeasures&&LocalDateRegex.test(l)?new Date(l):Number.isNaN(Number.parseFloat(l))?l:Number.parseFloat(l),h=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:l})=>l.measures??[])).filter((l,p,h)=>h.indexOf(l)!==p).forEach(l=>h.add(l)),this.pivot(l).map(({xValues:de,yValuesArray:pe})=>{let me={};return pe.forEach(([de,pe],nt)=>{me[this.axisValuesString(aliasSeries(de,nt,l,h),`,`)]=pe&&p(pe)}),{x:this.axisValuesString(de,`,`),xValues:de,...me}})}tablePivot(l){let p=this.normalizePivotConfig(l||{}),h=p.x.concat(p.y).includes(`measures`);return this.pivot(p).map(({xValues:l,yValuesArray:de})=>fromPairs([...p.x.map((p,h)=>[p,l[h]]),...h?de.map(([l,p])=>[l.length?l.join():`value`,p]):[]]))}tableColumns(l){let p=this.normalizePivotConfig(l||{}),h=this.loadResponses.map(l=>l.annotation).reduce((l,p)=>mergeDeepLeft(l,p),{dimensions:{},measures:{},timeDimensions:{},segments:{}}),de=Object.values(h).reduce((l,p)=>({...l,...p}),{}),pe={},me=l=>{let{title:p,shortTitle:h,type:pe,format:me,meta:nt,currency:st,granularity:mt}=de[l]||{};return{key:l,title:p,shortTitle:h,type:pe,format:me,meta:nt,currency:st,granularity:mt?.name}},nt=this.pivot(p);(nt[0]?.yValuesArray||[]).forEach(([l])=>{if(l.length>0){let h=pe;l.forEach((l,de)=>{h[`_${l}`]={key:l,memberId:p.y[de]===`measures`?l:p.y[de],children:h[`_${l}`]?.children||{}},h=h[`_${l}`].children})}});let st=(l={},p=[])=>Object.keys(l).length===0?[]:Object.values(l).map(({key:l,...h})=>{let de=st(h.children,[...p,l]),{title:pe,shortTitle:nt,...mt}=me(h.memberId),_t=l!==h.memberId||pe==null?l:``;return de.length?{...mt,key:l,title:[pe,_t].join(` `).trim(),shortTitle:_t||nt,children:de}:{...mt,key:l,dataIndex:[...p,l].join(),title:[pe,_t].join(` `).trim(),shortTitle:_t||nt}}),mt=[];return!nt.length&&p.y.includes(`measures`)&&(mt=(this.loadResponses[0].query.measures||[]).map(l=>({...me(l),dataIndex:l}))),!p.y.length&&p.x.includes(`measures`)&&mt.push({key:`value`,dataIndex:`value`,title:`Value`,shortTitle:`Value`,type:`string`}),p.x.map(l=>l===`measures`?{key:`measures`,dataIndex:`measures`,title:`Measures`,shortTitle:`Measures`,type:`string`}:{...me(l),dataIndex:l}).concat(st(pe)).concat(mt)}totalRow(l){return this.chartPivot(l)[0]}categories(l){return this.chartPivot(l)}seriesNames(p){let h=this.normalizePivotConfig(p),de=this.loadResponses.map(l=>l.annotation.measures).reduce((l,p)=>({...l,...p}),{}),pe=unnest(this.loadResponses.map((l,p)=>pipe(map$3(this.axisValues(h.y,p)),unnest,uniq)(this.timeDimensionBackwardCompatibleData(p)))),me=new Set;return this.queryType===QUERY_TYPE.BLENDING_QUERY&&flatten$1(this.loadResponses.map(({query:l})=>l.measures??[])).filter((l,p,h)=>h.indexOf(l)!==p).forEach(l=>me.add(l)),pe.map((p,pe)=>{let nt=aliasSeries(p,pe,h,me);return{title:this.axisValuesString(h.y.find(l=>l===`measures`)?dropLast(1,nt).concat(de[l.measureFromAxis(p)].title):nt,`, `),shortTitle:this.axisValuesString(h.y.find(l=>l===`measures`)?dropLast(1,nt).concat(de[l.measureFromAxis(p)].shortTitle):nt,`, `),key:this.axisValuesString(nt,`,`),yValues:p}})}query(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].query}pivotQuery(){return this.loadResponse.pivotQuery||null}totalRows(){return this.loadResponses[0].total}rawData(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].data}annotation(){if(this.queryType!==QUERY_TYPE.REGULAR_QUERY)throw Error(`Method is not supported for a '${this.queryType}' query type. Please use decompose`);return this.loadResponses[0].annotation}timeDimensionBackwardCompatibleData(p){if(p===void 0)throw Error(`resultIndex is required`);if(!this.backwardCompatibleData[p]){let{data:h,query:de}=this.loadResponses[p],pe=(de.timeDimensions||[]).filter(l=>!!l.granularity);this.backwardCompatibleData[p]=h.map(p=>({...p,...fromPairs(Object.keys(p).filter(h=>{let de=pe.find(l=>l.dimension===h);return de&&!p[l.timeDimensionMember(de)]}).map(h=>[l.timeDimensionMember(pe.find(l=>l.dimension===h)),p[h]]))}))}return this.backwardCompatibleData[p]}decompose(){return this.loadResponses.map(p=>new l({queryType:QUERY_TYPE.REGULAR_QUERY,pivotQuery:{...p.query,queryType:QUERY_TYPE.REGULAR_QUERY},results:[p]},this.options))}serialize(){return{loadResponse:clone(this.loadResponse)}}},SqlQuery=class{constructor(l){this.sqlQuery=l}rawQuery(){return this.sqlQuery.sql}sql(){return this.rawQuery().sql[0]}},memberMap=l=>fromPairs(l.map(l=>[l.name,l])),operators$1={string:[{name:`contains`,title:`contains`},{name:`notContains`,title:`does not contain`},{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`startsWith`,title:`starts with`},{name:`notStartsWith`,title:`does not start with`},{name:`endsWith`,title:`ends with`},{name:`notEndsWith`,title:`does not end with`}],number:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`set`,title:`is set`},{name:`notSet`,title:`is not set`},{name:`gt`,title:`>`},{name:`gte`,title:`>=`},{name:`lt`,title:`<`},{name:`lte`,title:`<=`}],time:[{name:`equals`,title:`equals`},{name:`notEquals`,title:`does not equal`},{name:`inDateRange`,title:`in date range`},{name:`notInDateRange`,title:`not in date range`},{name:`afterDate`,title:`after date`},{name:`afterOrOnDate`,title:`after or on date`},{name:`beforeDate`,title:`before date`},{name:`beforeOrOnDate`,title:`before or on date`}]},Meta=class{constructor(l){this.meta=l;let{cubes:p}=this.meta;this.cubes=p,this.cubesMap=fromPairs(p.map(l=>[l.name,{measures:memberMap(l.measures),dimensions:memberMap(l.dimensions),segments:memberMap(l.segments)}]))}membersForQuery(l,p){return unnest$1(this.cubes.map(l=>l[p])).sort((l,p)=>l.title>p.title?1:-1)}membersGroupedByCube(){let l=[`measures`,`dimensions`,`segments`,`timeDimensions`];return this.cubes.reduce((p,h)=>(l.forEach(l=>{let de=[];switch(l){case`measures`:de=h.measures||[];break;case`dimensions`:de=h.dimensions||[];break;case`segments`:de=h.segments||[];break;case`timeDimensions`:de=h.dimensions.filter(l=>l.type===`time`)||[];break}p[l].push({cubeName:h.name,cubeTitle:h.title,type:h.type,public:h.public,members:de})}),p),{measures:[],dimensions:[],segments:[],timeDimensions:[]})}resolveMember(l,p){let[h]=l.split(`.`);return this.cubesMap[h]?(Array.isArray(p)?p:[p]).map(p=>this.cubesMap[h][p]&&this.cubesMap[h][p][l]).find(l=>l)||{title:l,error:`Path not found '${l}'`}:{title:l,error:`Cube not found ${h} for path '${l}'`}}defaultTimeDimensionNameFor(l){let[p]=l.split(`.`);return this.cubesMap[p]?Object.keys(this.cubesMap[p].dimensions||{}).find(l=>this.cubesMap[p].dimensions[l].type===`time`):null}filterOperatorsForMember(l,p){let h=this.resolveMember(l,p);return`error`in h||!(`type`in h)||h.type===`boolean`?operators$1.string:operators$1[h.type]||operators$1.string}},ProgressResult=class{constructor(l){this.progressResponse=l}stage(){return this.progressResponse.stage}timeElapsed(){return this.progressResponse.timeElapsed}},require_browser_ponyfill=__commonJSMin(((l,p)=>{var h=typeof self<`u`?self:l,de=(function(){function l(){this.fetch=!1,this.DOMException=h.DOMException}return l.prototype=h,new l})();(function(l){(function(p){var h={searchParams:`URLSearchParams`in l,iterable:`Symbol`in l&&`iterator`in Symbol,blob:`FileReader`in l&&`Blob`in l&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:`FormData`in l,arrayBuffer:`ArrayBuffer`in l};function de(l){return l&&DataView.prototype.isPrototypeOf(l)}if(h.arrayBuffer)var pe=[`[object Int8Array]`,`[object Uint8Array]`,`[object Uint8ClampedArray]`,`[object Int16Array]`,`[object Uint16Array]`,`[object Int32Array]`,`[object Uint32Array]`,`[object Float32Array]`,`[object Float64Array]`],me=ArrayBuffer.isView||function(l){return l&&pe.indexOf(Object.prototype.toString.call(l))>-1};function nt(l){if(typeof l!=`string`&&(l=String(l)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))throw TypeError(`Invalid character in header field name`);return l.toLowerCase()}function st(l){return typeof l!=`string`&&(l=String(l)),l}function mt(l){var p={next:function(){var p=l.shift();return{done:p===void 0,value:p}}};return h.iterable&&(p[Symbol.iterator]=function(){return p}),p}function _t(l){this.map={},l instanceof _t?l.forEach(function(l,p){this.append(p,l)},this):Array.isArray(l)?l.forEach(function(l){this.append(l[0],l[1])},this):l&&Object.getOwnPropertyNames(l).forEach(function(p){this.append(p,l[p])},this)}_t.prototype.append=function(l,p){l=nt(l),p=st(p);var h=this.map[l];this.map[l]=h?h+`, `+p:p},_t.prototype.delete=function(l){delete this.map[nt(l)]},_t.prototype.get=function(l){return l=nt(l),this.has(l)?this.map[l]:null},_t.prototype.has=function(l){return this.map.hasOwnProperty(nt(l))},_t.prototype.set=function(l,p){this.map[nt(l)]=st(p)},_t.prototype.forEach=function(l,p){for(var h in this.map)this.map.hasOwnProperty(h)&&l.call(p,this.map[h],h,this)},_t.prototype.keys=function(){var l=[];return this.forEach(function(p,h){l.push(h)}),mt(l)},_t.prototype.values=function(){var l=[];return this.forEach(function(p){l.push(p)}),mt(l)},_t.prototype.entries=function(){var l=[];return this.forEach(function(p,h){l.push([h,p])}),mt(l)},h.iterable&&(_t.prototype[Symbol.iterator]=_t.prototype.entries);function yt(l){if(l.bodyUsed)return Promise.reject(TypeError(`Already read`));l.bodyUsed=!0}function bt(l){return new Promise(function(p,h){l.onload=function(){p(l.result)},l.onerror=function(){h(l.error)}})}function xt(l){var p=new FileReader,h=bt(p);return p.readAsArrayBuffer(l),h}function St(l){var p=new FileReader,h=bt(p);return p.readAsText(l),h}function Ct(l){for(var p=new Uint8Array(l),h=Array(p.length),de=0;de<p.length;de++)h[de]=String.fromCharCode(p[de]);return h.join(``)}function wt(l){if(l.slice)return l.slice(0);var p=new Uint8Array(l.byteLength);return p.set(new Uint8Array(l)),p.buffer}function Tt(){return this.bodyUsed=!1,this._initBody=function(l){this._bodyInit=l,l?typeof l==`string`?this._bodyText=l:h.blob&&Blob.prototype.isPrototypeOf(l)?this._bodyBlob=l:h.formData&&FormData.prototype.isPrototypeOf(l)?this._bodyFormData=l:h.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)?this._bodyText=l.toString():h.arrayBuffer&&h.blob&&de(l)?(this._bodyArrayBuffer=wt(l.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(l)||me(l))?this._bodyArrayBuffer=wt(l):this._bodyText=l=Object.prototype.toString.call(l):this._bodyText=``,this.headers.get(`content-type`)||(typeof l==`string`?this.headers.set(`content-type`,`text/plain;charset=UTF-8`):this._bodyBlob&&this._bodyBlob.type?this.headers.set(`content-type`,this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)&&this.headers.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`))},h.blob&&(this.blob=function(){var l=yt(this);if(l)return l;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error(`could not read FormData body as blob`);return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?yt(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(xt)}),this.text=function(){var l=yt(this);if(l)return l;if(this._bodyBlob)return St(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ct(this._bodyArrayBuffer));if(this._bodyFormData)throw Error(`could not read FormData body as text`);return Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(kt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Et=[`DELETE`,`GET`,`HEAD`,`OPTIONS`,`POST`,`PUT`];function Dt(l){var p=l.toUpperCase();return Et.indexOf(p)>-1?p:l}function Ot(l,p){p=p||{};var h=p.body;if(l instanceof Ot){if(l.bodyUsed)throw TypeError(`Already read`);this.url=l.url,this.credentials=l.credentials,p.headers||(this.headers=new _t(l.headers)),this.method=l.method,this.mode=l.mode,this.signal=l.signal,!h&&l._bodyInit!=null&&(h=l._bodyInit,l.bodyUsed=!0)}else this.url=String(l);if(this.credentials=p.credentials||this.credentials||`same-origin`,(p.headers||!this.headers)&&(this.headers=new _t(p.headers)),this.method=Dt(p.method||this.method||`GET`),this.mode=p.mode||this.mode||null,this.signal=p.signal||this.signal,this.referrer=null,(this.method===`GET`||this.method===`HEAD`)&&h)throw TypeError(`Body not allowed for GET or HEAD requests`);this._initBody(h)}Ot.prototype.clone=function(){return new Ot(this,{body:this._bodyInit})};function kt(l){var p=new FormData;return l.trim().split(`&`).forEach(function(l){if(l){var h=l.split(`=`),de=h.shift().replace(/\+/g,` `),pe=h.join(`=`).replace(/\+/g,` `);p.append(decodeURIComponent(de),decodeURIComponent(pe))}}),p}function At(l){var p=new _t;return l.replace(/\r?\n[\t ]+/g,` `).split(/\r?\n/).forEach(function(l){var h=l.split(`:`),de=h.shift().trim();if(de){var pe=h.join(`:`).trim();p.append(de,pe)}}),p}Tt.call(Ot.prototype);function jt(l,p){p||(p={}),this.type=`default`,this.status=p.status===void 0?200:p.status,this.ok=this.status>=200&&this.status<300,this.statusText=`statusText`in p?p.statusText:`OK`,this.headers=new _t(p.headers),this.url=p.url||``,this._initBody(l)}Tt.call(jt.prototype),jt.prototype.clone=function(){return new jt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _t(this.headers),url:this.url})},jt.error=function(){var l=new jt(null,{status:0,statusText:``});return l.type=`error`,l};var Mt=[301,302,303,307,308];jt.redirect=function(l,p){if(Mt.indexOf(p)===-1)throw RangeError(`Invalid status code`);return new jt(null,{status:p,headers:{location:l}})},p.DOMException=l.DOMException;try{new p.DOMException}catch{p.DOMException=function(l,p){this.message=l,this.name=p,this.stack=Error(l).stack},p.DOMException.prototype=Object.create(Error.prototype),p.DOMException.prototype.constructor=p.DOMException}function Nt(l,de){return new Promise(function(pe,me){var nt=new Ot(l,de);if(nt.signal&&nt.signal.aborted)return me(new p.DOMException(`Aborted`,`AbortError`));var st=new XMLHttpRequest;function mt(){st.abort()}st.onload=function(){var l={status:st.status,statusText:st.statusText,headers:At(st.getAllResponseHeaders()||``)};l.url=`responseURL`in st?st.responseURL:l.headers.get(`X-Request-URL`),pe(new jt(`response`in st?st.response:st.responseText,l))},st.onerror=function(){me(TypeError(`Network request failed`))},st.ontimeout=function(){me(TypeError(`Network request failed`))},st.onabort=function(){me(new p.DOMException(`Aborted`,`AbortError`))},st.open(nt.method,nt.url,!0),nt.credentials===`include`?st.withCredentials=!0:nt.credentials===`omit`&&(st.withCredentials=!1),`responseType`in st&&h.blob&&(st.responseType=`blob`),nt.headers.forEach(function(l,p){st.setRequestHeader(p,l)}),nt.signal&&(nt.signal.addEventListener(`abort`,mt),st.onreadystatechange=function(){st.readyState===4&&nt.signal.removeEventListener(`abort`,mt)}),st.send(nt._bodyInit===void 0?null:nt._bodyInit)})}return Nt.polyfill=!0,l.fetch||(l.fetch=Nt,l.Headers=_t,l.Request=Ot,l.Response=jt),p.Headers=_t,p.Request=Ot,p.Response=jt,p.fetch=Nt,Object.defineProperty(p,`__esModule`,{value:!0}),p})({})})(de),de.fetch.ponyfill=!0,delete de.fetch.polyfill;var pe=de;l=pe.fetch,l.default=pe.fetch,l.fetch=pe.fetch,l.Headers=pe.Headers,l.Request=pe.Request,l.Response=pe.Response,p.exports=l})),import_browser_ponyfill=__toESM(require_browser_ponyfill());(function(l){var p=l.URLSearchParams&&l.URLSearchParams.prototype.get?l.URLSearchParams:null,h=p&&new p({a:1}).toString()===`a=1`,de=p&&new p(`s=%2B`).get(`s`)===`+`,pe=`__URLSearchParams__`,me=p?(function(){var l=new p;return l.append(`s`,` &`),l.toString()===`s=+%26`})():!0,nt=mt.prototype,st=!!(l.Symbol&&l.Symbol.iterator);if(p&&h&&de&&me)return;function mt(l){l=l||``,(l instanceof URLSearchParams||l instanceof mt)&&(l=l.toString()),this[pe]=Ct(l)}nt.append=function(l,p){wt(this[pe],l,p)},nt.delete=function(l){delete this[pe][l]},nt.get=function(l){var p=this[pe];return l in p?p[l][0]:null},nt.getAll=function(l){var p=this[pe];return l in p?p[l].slice(0):[]},nt.has=function(l){return l in this[pe]},nt.set=function(l,p){this[pe][l]=[``+p]},nt.toString=function(){var l=this[pe],p=[],h,de,me,nt;for(de in l)for(me=bt(de),h=0,nt=l[de];h<nt.length;h++)p.push(me+`=`+bt(nt[h]));return p.join(`&`)};var _t=!!de&&p&&!h&&l.Proxy;Object.defineProperty(l,`URLSearchParams`,{value:_t?new Proxy(p,{construct:function(l,p){return new l(new mt(p[0]).toString())}}):mt});var yt=l.URLSearchParams.prototype;yt.polyfill=!0,yt.forEach=yt.forEach||function(l,p){var h=Ct(this.toString());Object.getOwnPropertyNames(h).forEach(function(de){h[de].forEach(function(h){l.call(p,h,de,this)},this)},this)},yt.sort=yt.sort||function(){var l=Ct(this.toString()),p=[],h,de,pe;for(h in l)p.push(h);for(p.sort(),de=0;de<p.length;de++)this.delete(p[de]);for(de=0;de<p.length;de++){var me=p[de],nt=l[me];for(pe=0;pe<nt.length;pe++)this.append(me,nt[pe])}},yt.keys=yt.keys||function(){var l=[];return this.forEach(function(p,h){l.push(h)}),St(l)},yt.values=yt.values||function(){var l=[];return this.forEach(function(p){l.push(p)}),St(l)},yt.entries=yt.entries||function(){var l=[];return this.forEach(function(p,h){l.push([h,p])}),St(l)},st&&(yt[l.Symbol.iterator]=yt[l.Symbol.iterator]||yt.entries);function bt(l){var p={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(l).replace(/[!'\(\)~]|%20|%00/g,function(l){return p[l]})}function xt(l){return l.replace(/[ +]/g,`%20`).replace(/(%[a-f0-9]{2})+/gi,function(l){return decodeURIComponent(l)})}function St(p){var h={next:function(){var l=p.shift();return{done:l===void 0,value:l}}};return st&&(h[l.Symbol.iterator]=function(){return h}),h}function Ct(l){var p={};if(typeof l==`object`)if(Tt(l))for(var h=0;h<l.length;h++){var de=l[h];if(Tt(de)&&de.length===2)wt(p,de[0],de[1]);else throw TypeError(`Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements`)}else for(var pe in l)l.hasOwnProperty(pe)&&wt(p,pe,l[pe]);else{l.indexOf(`?`)===0&&(l=l.slice(1));for(var me=l.split(`&`),nt=0;nt<me.length;nt++){var st=me[nt],mt=st.indexOf(`=`);-1<mt?wt(p,xt(st.slice(0,mt)),xt(st.slice(mt+1))):st&&wt(p,xt(st),``)}}return p}function wt(l,p,h){var de=typeof h==`string`?h:h!=null&&typeof h.toString==`function`?h.toString():JSON.stringify(h);p in l?l[p].push(de):l[p]=[de]}function Tt(l){return!!l&&Object.prototype.toString.call(l)===`[object Array]`}})(typeof global<`u`?global:typeof window<`u`?window:void 0);async function*responseChunks(l){let p=l.body;if(p&&typeof p.getReader==`function`){let l=p.getReader();try{for(;;){let{done:p,value:h}=await l.read();if(p)break;h&&(yield h)}}finally{l.releaseLock?.()}return}if(p&&Symbol.asyncIterator in p){for await(let l of p)typeof l==`string`?yield new TextEncoder().encode(l):yield new Uint8Array(l);return}throw Error(`Unsupported response body type for streaming`)}var HttpTransport=class{constructor({authorization:l,apiUrl:p,method:h,headers:de={},credentials:pe,fetchTimeout:me,signal:nt}){this.authorization=l,this.apiUrl=p,this.method=h,this.headers=de,this.credentials=pe,this.fetchTimeout=me,this.signal=nt}request(l,{method:p,fetchTimeout:h,baseRequestId:de,signal:pe,...me}){let nt=1,st=new URLSearchParams(me&&Object.keys(me).map(l=>({[l]:typeof me[l]==`object`?JSON.stringify(me[l]):me[l]})).reduce((l,p)=>({...l,...p}),{})),mt=`${this.apiUrl}/${l}${st.toString().length?`?${st}`:``}`,_t=p??this.method??(mt.length<2e3?`GET`:`POST`);_t===`POST`&&(mt=`${this.apiUrl}/${l}`,this.headers[`Content-Type`]=`application/json`);let yt=h??this.fetchTimeout,bt=pe||this.signal||(yt?AbortSignal.timeout(yt):void 0),xt=()=>(0,import_browser_ponyfill.default)(mt,{method:_t,headers:{Authorization:this.authorization,"x-request-id":de&&`${de}-span-${nt++}`,...this.headers},credentials:this.credentials,body:_t===`POST`?JSON.stringify(me):null,signal:bt});return{async subscribe(l){try{return l(await xt(),()=>this.subscribe(l))}catch(p){let h=`network Error`;return p.name===`AbortError`&&(h=bt?.reason===`TimeoutError`||bt?.reason?.name===`TimeoutError`?`timeout`:`aborted`),l({error:h},()=>this.subscribe(l))}}}}requestStream(l,{method:p,fetchTimeout:h,baseRequestId:de,signal:pe,params:me}){let nt={};me&&Object.keys(me).forEach(l=>{let p=me[l];p!==void 0&&(nt[l]=typeof p==`object`?JSON.stringify(p):String(p))});let st=new URLSearchParams(nt),mt=`${this.apiUrl}/${l}${st.toString().length?`?${st}`:``}`,_t=p??this.method??`POST`;_t===`POST`&&(mt=`${this.apiUrl}/${l}`,this.headers[`Content-Type`]=`application/json`);let yt=h??this.fetchTimeout,bt,xt=pe||this.signal;return!xt&&yt&&(bt=new AbortController,xt=bt.signal,setTimeout(()=>bt?.abort(),yt)),{stream:async()=>{let l=await(0,import_browser_ponyfill.default)(mt,{method:_t,headers:{Authorization:this.authorization,"x-request-id":de||`stream-request`,...this.headers},credentials:this.credentials,body:_t===`POST`?JSON.stringify(me||{}):null,signal:xt});if(!l.ok)throw Error(`HTTP ${l.status}: ${l.statusText}`);if(!l.body)throw Error(`No response body available for streaming`);return responseChunks(l)},unsubscribe:async()=>{bt&&bt.abort()}}}},RequestError=class extends Error{constructor(l,p,h){super(l),this.response=p,this.status=h}},mutexCounter=0,MUTEX_ERROR=`Mutex has been changed`;function mutexPromise(l){return l.then(l=>l).catch(l=>{if(l!==MUTEX_ERROR)throw l;return null})}var CubeApi=class{constructor(l,p){if(l&&!Array.isArray(l)&&typeof l==`object`&&(p=l,l=void 0),!p||!p.transport&&!p.apiUrl)throw Error("The `apiUrl` option is required");this.apiToken=l,this.apiUrl=p.apiUrl,this.method=p.method,this.headers=p.headers||{},this.credentials=p.credentials,this.transport=p.transport||new HttpTransport({authorization:typeof l==`string`?l:void 0,apiUrl:this.apiUrl,method:this.method,headers:this.headers,credentials:this.credentials,fetchTimeout:p.fetchTimeout,signal:p.signal}),this.pollInterval=p.pollInterval||5,this.parseDateMeasures=p.parseDateMeasures,this.castNumerics=typeof p.castNumerics==`boolean`?p.castNumerics:!1,this.networkErrorRetries=p.networkErrorRetries||0,this.updateAuthorizationPromise=null}request(l,p){return this.transport.request(l,{...p,baseRequestId:p?.baseRequestId||v4$1()})}loadMethod(l,p,h,de){let pe=++mutexCounter;typeof h==`function`&&!de&&(de=h,h=void 0),h=h||{};let me=h.mutexKey||`default`;h.mutexObj&&(h.mutexObj[me]=pe);let nt=this.updateTransportAuthorization().then(()=>l()),st=!0,mt=!1,_t=async()=>{let l=await nt;if(h&&h.mutexObj&&h.mutexObj[me]!==pe)throw mt=!0,l.unsubscribe&&await l.unsubscribe(),MUTEX_ERROR},yt=this.networkErrorRetries,bt=async(l,pe)=>{let me=await nt,bt=async()=>h?.subscribe&&!mt?(me.unsubscribe||await new Promise(l=>setTimeout(()=>l(),this.pollInterval*1e3)),pe()):null,xt=async(l=!1)=>mt?null:(l&&await new Promise(l=>setTimeout(()=>l(),this.pollInterval*1e3)),pe());if(h?.subscribe&&!st&&await this.updateTransportAuthorization(),st=!1,`status`in l&&l.status===502||`error`in l&&l.error?.toLowerCase()===`network error`&&--yt>=0)return await _t(),xt(!0);l=l;let St={},Ct=``;try{Ct=await l.text(),St=JSON.parse(Ct)}catch{St.error=Ct}if(St.error?.includes(`Continue wait`))return await _t(),h?.progressCallback&&h.progressCallback(new ProgressResult(St)),xt();if(l.status!==200){await _t(),!h?.subscribe&&me.unsubscribe&&await me.unsubscribe();let p=new RequestError(St.error||l.error||``,St,l.status);if(de)de(p);else throw p;return bt()}await _t(),!h?.subscribe&&me.unsubscribe&&await me.unsubscribe();let wt=p(St);if(de)de(null,wt);else return wt;return bt()},xt=nt.then(l=>mutexPromise(l.subscribe(bt)));return de?{unsubscribe:async()=>{let l=await nt;return mt=!0,l.unsubscribe?l.unsubscribe():null}}:xt}async updateTransportAuthorization(){if(this.updateAuthorizationPromise){await this.updateAuthorizationPromise;return}let l=this.apiToken;if(typeof l==`function`){let p=(async()=>{try{let p=await l();this.transport.authorization!==p&&(this.transport.authorization=p)}finally{this.updateAuthorizationPromise=null}})();this.updateAuthorizationPromise=p,await p}}patchQueryInternal(l,p){return(p===`compact`||p===`columnar`)&&l.responseFormat!==p?{...l,responseFormat:p}:l}loadResponseInternal(l,p={}){return l.results.length&&(p?.castNumerics&&l.results.forEach(l=>{let p=Object.entries({...l.annotation.measures,...l.annotation.dimensions}).reduce((l,[p,h])=>(h.type===`number`&&l.push(p),l),[]);l.data=l.data.map(l=>(p.forEach(p=>{l[p]!=null&&(l[p]=Number(l[p]))}),l))}),l.results[0].query.responseFormat&&l.results[0].query.responseFormat===`compact`?l.results.forEach((p,h)=>{let de=[],{dataset:pe,members:me}=p.data;pe.forEach(l=>{let p={};me.forEach((h,de)=>{p[h]=l[de]}),de.push(p)}),l.results[h].data=de}):l.results[0].query.responseFormat&&l.results[0].query.responseFormat===`columnar`&&l.results.forEach((p,h)=>{let{columns:de,members:pe}=p.data,me=de[0]?.length??0,nt=[];for(let l=0;l<me;l++){let p={};pe.forEach((h,pe)=>{p[h]=de[pe][l]}),nt.push(p)}l.results[h].data=nt})),new ResultSet(l,{parseDateMeasures:this.parseDateMeasures})}load(l,p,h,de=`default`){[l,p]=this.prepareQueryOptions(l,p,de);let pe={query:l,queryType:`multi`,signal:p?.signal,baseRequestId:p?.baseRequestId};return p?.cache&&(pe.cache=p.cache),this.loadMethod(()=>this.request(`load`,pe),l=>this.loadResponseInternal(l,p),p,h)}prepareQueryOptions(l,p,h=`default`){return p={castNumerics:this.castNumerics,...p},h===`compact`||h===`columnar`?Array.isArray(l)?[l.map(l=>this.patchQueryInternal(l,h)),p]:[this.patchQueryInternal(l,h),p]:[l,p]}subscribe(l,p,h,de=`default`){return[l,p]=this.prepareQueryOptions(l,p,de),this.loadMethod(()=>this.request(`subscribe`,{query:l,queryType:`multi`,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>this.loadResponseInternal(l,p),{...p,subscribe:!0},h)}sql(l,p,h){return this.loadMethod(()=>this.request(`sql`,{query:l,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>Array.isArray(l)?l.map(l=>new SqlQuery(l)):new SqlQuery(l),p,h)}meta(l,p){return this.loadMethod(()=>this.request(`meta`,{signal:l?.signal,baseRequestId:l?.baseRequestId}),l=>new Meta(l),l,p)}dryRun(l,p,h){return this.loadMethod(()=>this.request(`dry-run`,{query:l,signal:p?.signal,baseRequestId:p?.baseRequestId}),l=>l,p,h)}cubeSql(l,p,h){return this.loadMethod(()=>{let h={query:l,method:`POST`,signal:p?.signal,fetchTimeout:p?.timeout,baseRequestId:p?.baseRequestId,throwContinueWait:!0};return p?.cache&&(h.cache=p.cache),this.request(`cubesql`,h)},l=>{if(!l||!l.error)throw Error(`Invalid response format`);if(l.error===`timeout`){let l=p?.timeout||300*1e3;throw Error(`CubeSQL query timed out after ${l}ms`)}if(l.error===`aborted`)throw Error(`CubeSQL query was aborted`);let[h,...de]=l.error.split(`
978
978
  `);try{let l=JSON.parse(h);return{schema:l.schema,data:de.filter(l=>l.trim().length).map(l=>JSON.parse(l).data).reduce((l,p)=>l.concat(p),[]),...l.lastRefreshTime?{lastRefreshTime:l.lastRefreshTime}:{}}}catch{throw Error(l.error)}},p,h)}async*cubeSqlStream(l,p){if(!this.transport.requestStream)throw Error(`Transport does not support streaming`);let h=this.transport.requestStream(`cubesql`,{method:`POST`,signal:p?.signal,fetchTimeout:p?.timeout,baseRequestId:v4$1(),params:{query:l,cache:p?.cache}}),de=new TextDecoder,pe=``;try{let l=await h.stream();for await(let p of l){pe+=de.decode(p,{stream:!0});let l=pe.split(`
979
979
  `);pe=l.pop()||``;for(let p of l)if(p.trim())try{let l=JSON.parse(p);l.schema?yield{type:`schema`,schema:l.schema,...l.lastRefreshTime?{lastRefreshTime:l.lastRefreshTime}:{}}:l.data?yield{type:`data`,data:l.data}:l.error&&(yield{type:`error`,error:l.error})}catch{yield{type:`error`,error:`Failed to parse JSON line: ${p}`}}}if(pe.trim())try{let l=JSON.parse(pe);l.schema?yield{type:`schema`,schema:l.schema,...l.lastRefreshTime?{lastRefreshTime:l.lastRefreshTime}:{}}:l.data?yield{type:`data`,data:l.data}:l.error&&(yield{type:`error`,error:l.error})}catch{yield{type:`error`,error:`Failed to parse remaining JSON: ${pe}`}}}catch(l){throw l.name===`AbortError`?Error(`aborted`):l}finally{h.unsubscribe&&await h.unsubscribe()}}},src_default=(l,p)=>new CubeApi(l,p);function useCubejsApi(l,p){return(0,import_react.useMemo)(()=>!p||!l||p===`undefined`?null:src_default(p,{apiUrl:l}),[l,p])}var require_es6=__commonJSMin(((l,p)=>{p.exports=function l(p,h){if(p===h)return!0;if(p&&h&&typeof p==`object`&&typeof h==`object`){if(p.constructor!==h.constructor)return!1;var de,pe,me;if(Array.isArray(p)){if(de=p.length,de!=h.length)return!1;for(pe=de;pe--!==0;)if(!l(p[pe],h[pe]))return!1;return!0}if(p instanceof Map&&h instanceof Map){if(p.size!==h.size)return!1;for(pe of p.entries())if(!h.has(pe[0]))return!1;for(pe of p.entries())if(!l(pe[1],h.get(pe[0])))return!1;return!0}if(p instanceof Set&&h instanceof Set){if(p.size!==h.size)return!1;for(pe of p.entries())if(!h.has(pe[0]))return!1;return!0}if(ArrayBuffer.isView(p)&&ArrayBuffer.isView(h)){if(de=p.length,de!=h.length)return!1;for(pe=de;pe--!==0;)if(p[pe]!==h[pe])return!1;return!0}if(p.constructor===RegExp)return p.source===h.source&&p.flags===h.flags;if(p.valueOf!==Object.prototype.valueOf)return p.valueOf()===h.valueOf();if(p.toString!==Object.prototype.toString)return p.toString()===h.toString();if(me=Object.keys(p),de=me.length,de!==Object.keys(h).length)return!1;for(pe=de;pe--!==0;)if(!Object.prototype.hasOwnProperty.call(h,me[pe]))return!1;for(pe=de;pe--!==0;){var nt=me[pe];if(!l(p[nt],h[nt]))return!1}return!0}return p!==p&&h!==h}})),import_es6=__toESM(require_es6()),require_fast_deep_equal=__commonJSMin(((l,p)=>{p.exports=function l(p,h){if(p===h)return!0;if(p&&h&&typeof p==`object`&&typeof h==`object`){if(p.constructor!==h.constructor)return!1;var de,pe,me;if(Array.isArray(p)){if(de=p.length,de!=h.length)return!1;for(pe=de;pe--!==0;)if(!l(p[pe],h[pe]))return!1;return!0}if(p.constructor===RegExp)return p.source===h.source&&p.flags===h.flags;if(p.valueOf!==Object.prototype.valueOf)return p.valueOf()===h.valueOf();if(p.toString!==Object.prototype.toString)return p.toString()===h.toString();if(me=Object.keys(p),de=me.length,de!==Object.keys(h).length)return!1;for(pe=de;pe--!==0;)if(!Object.prototype.hasOwnProperty.call(h,me[pe]))return!1;for(pe=de;pe--!==0;){var nt=me[pe];if(!l(p[nt],h[nt]))return!1}return!0}return p!==p&&h!==h}})),import_fast_deep_equal=__toESM(require_fast_deep_equal());function useDeepDependencies$1(l){let p=(0,import_react.useRef)();return(0,import_fast_deep_equal.default)(p.current,l)||(p.current=l),p.current}function useDeepEffect(l,p){return(0,import_react.useEffect)(l,useDeepDependencies$1(p))}function useDeepMemo$1(l,p){return(0,import_react.useMemo)(l,useDeepDependencies$1(p)??[])}function useIdentifier(){let{identifier:l}=useAppContext();return l||``}function useIsMounted(){let l=(0,import_react.useRef)(!1),p=(0,import_react.useCallback)(()=>l.current,[]);return(0,import_react.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]),p}function playgroundFetch(l,p={}){let{retries:h=0,...de}=p;return fetch(l,de).then(async l=>{if(l.status===500){let p=await l.text();try{p=JSON.parse(p).error}catch{}throw p}return l}).catch(de=>{if(de.message===`Network request failed`&&h>0)return playgroundFetch(l,{options:p,retries:h-1});throw de})}function openWindow({url:l,title:p=``,width:h=640,height:de=720}){let pe=window.screenLeft===void 0?window.screenX:window.screenLeft,me=window.screenTop===void 0?window.screenY:window.screenTop,nt=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,st=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,mt=nt/window.screen.availWidth,_t=(nt-h)/2/mt+pe,yt=(st-de)/2/mt+me,bt=window.open(l,p,`
980
980
  scrollbars=yes,
@@ -23,7 +23,7 @@
23
23
  }
24
24
  </style>
25
25
  <title>Cube Playground</title>
26
- <script type="module" crossorigin src="./assets/index-D6_ZO5b0.js"></script>
26
+ <script type="module" crossorigin src="./assets/index-Cq-vQO9J.js"></script>
27
27
  <link rel="stylesheet" crossorigin href="./assets/index-zUXBBvSD.css">
28
28
  </head>
29
29
  <body>