@testiny/cli 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/{licenses.txt → LICENSES.txt} +1 -1
- package/README.md +89 -89
- package/package.json +21 -21
- package/testiny-importer.js +2 -2
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright Mategra GmbH - All rights reserved
|
|
2
|
-
|
|
3
|
-
Intended only for use with Testiny SaaS platform
|
|
4
|
-
https://www.testiny.io/terms-of-use/
|
|
1
|
+
Copyright Mategra GmbH - All rights reserved
|
|
2
|
+
|
|
3
|
+
Intended only for use with Testiny SaaS platform
|
|
4
|
+
https://www.testiny.io/terms-of-use/
|
|
@@ -129,7 +129,7 @@ SOFTWARE.
|
|
|
129
129
|
|
|
130
130
|
================================================================================
|
|
131
131
|
Package: axios
|
|
132
|
-
Version: 1.3.
|
|
132
|
+
Version: 1.3.5
|
|
133
133
|
Repository: (https://github.com/axios/axios)
|
|
134
134
|
|
|
135
135
|
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
package/README.md
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
# Testiny CLI
|
|
2
|
-
|
|
3
|
-
Use the Testiny CLI to import test cases and test runs into your Testiny Organization.
|
|
4
|
-
|
|
5
|
-
- Test cases can be imported from CSV files (see example below)
|
|
6
|
-
- Test runs can be imported from CSV, JUnit and Playwright JSON
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
- Create an API key with write permissions on the project you want to import to
|
|
11
|
-
- Set the API key as the TESTINY_API_KEY environment variable or pass with ``--apikey``
|
|
12
|
-
- Running just ``testiny-
|
|
13
|
-
|
|
14
|
-
## General Options
|
|
15
|
-
|
|
16
|
-
```plain
|
|
17
|
-
Usage: testiny-importer [options] [command]
|
|
18
|
-
|
|
19
|
-
Options:
|
|
20
|
-
--app <url> App endpoint to use (default: "https://app.testiny.io/")
|
|
21
|
-
-P, --project <nameOrKey> Target project id or key
|
|
22
|
-
-y, --confirm Do not prompt for confirmation before starting import
|
|
23
|
-
--disable-custom-fields Disable custom field import. Will fail if required custom fields
|
|
24
|
-
with no defaults are enabled
|
|
25
|
-
--disable-tc-keys Disable test case import key hints
|
|
26
|
-
--disable-nested-folders Disable nesting of imported folders (flat mode)
|
|
27
|
-
--folder-separator <token> Token for folder name separation (default ' > ')
|
|
28
|
-
--duplicates <duplicate mode> Controls how duplicates are detected (choices: "off", "title",
|
|
29
|
-
"folder_title", default: "folder_title")
|
|
30
|
-
--licenses Show included package licenses
|
|
31
|
-
--apikey <apiKey> The API key to use. Not recommended - use the environment variable
|
|
32
|
-
TESTINY_API_KEY or TESTINY_IMPORT_API_KEY instead
|
|
33
|
-
-h, --help display help for command
|
|
34
|
-
|
|
35
|
-
Commands:
|
|
36
|
-
testcase [options] Import testcases (with folders)
|
|
37
|
-
testrun [options] Import test case results as a testrun
|
|
38
|
-
help [command] display help for command
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Importing Test Cases
|
|
42
|
-
|
|
43
|
-
```plain
|
|
44
|
-
Usage: testiny-importer testcase [options]
|
|
45
|
-
|
|
46
|
-
Import testcases (with folders)
|
|
47
|
-
|
|
48
|
-
Options:
|
|
49
|
-
--csv <file> Import this CSV file
|
|
50
|
-
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
51
|
-
--steps <step mode> Controls how steps are imported (choices: "off", "rows", "newlines", "numbered", "numbered_bracket")
|
|
52
|
-
-h, --help display help for command
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Importing Test Runs
|
|
56
|
-
|
|
57
|
-
```plain
|
|
58
|
-
Usage: testiny-importer testrun [options]
|
|
59
|
-
|
|
60
|
-
Import test case results as a testrun
|
|
61
|
-
|
|
62
|
-
Options:
|
|
63
|
-
--csv <file> Import this CSV file
|
|
64
|
-
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
65
|
-
--junit <file> Import this JUnit XML file
|
|
66
|
-
--playwright <file> Import this Playwright JSON file
|
|
67
|
-
--name <test run name> Name of the test run (use %date, %host and %source as placeholders)
|
|
68
|
-
--update Allow run with given name to be updated, otherwise creates a new run with that name (default: false)
|
|
69
|
-
--close Close the testrun after a successful import (default: false)
|
|
70
|
-
--folder <folder name> Override folder name for all created testcases
|
|
71
|
-
--testplan <nameOrKey> Target testplan id or title
|
|
72
|
-
--testcases <tc mode> Controls how testcases are created if no existing TC is found (choices: "ignore", "fail", "create",
|
|
73
|
-
default: "create")
|
|
74
|
-
-h, --help display help for command
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Example Files
|
|
78
|
-
|
|
79
|
-
CSV Example for importing test cases
|
|
80
|
-
|
|
81
|
-
```csv
|
|
82
|
-
folder,title,precondition,steps,expected_result
|
|
83
|
-
"Folder Name", "Test case title", "Precondition text, can be empty", "Steps text (depends on step mode setting)", "Expected result, can be empty"
|
|
84
|
-
"Folder Name > Subfolder Name", "Another test case title", "", "Folders can be nested by using the folder separator token", ""
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Bundled licenses
|
|
88
|
-
|
|
89
|
-
For licenses of bundled dependencies, please see LICENSE.txt in the package directory
|
|
1
|
+
# Testiny CLI
|
|
2
|
+
|
|
3
|
+
Use the Testiny CLI to import test cases and test runs into your Testiny Organization.
|
|
4
|
+
|
|
5
|
+
- Test cases can be imported from CSV files (see example below)
|
|
6
|
+
- Test runs can be imported from CSV, JUnit and Playwright JSON
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
- Create an API key with write permissions on the project you want to import to
|
|
11
|
+
- Set the API key as the TESTINY_API_KEY environment variable or pass with ``--apikey``
|
|
12
|
+
- Running just ``testiny-importer testcase`` or ``testiny-importer testrun`` command prompts for required options
|
|
13
|
+
|
|
14
|
+
## General Options
|
|
15
|
+
|
|
16
|
+
```plain
|
|
17
|
+
Usage: testiny-importer [options] [command]
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
--app <url> App endpoint to use (default: "https://app.testiny.io/")
|
|
21
|
+
-P, --project <nameOrKey> Target project id or key
|
|
22
|
+
-y, --confirm Do not prompt for confirmation before starting import
|
|
23
|
+
--disable-custom-fields Disable custom field import. Will fail if required custom fields
|
|
24
|
+
with no defaults are enabled
|
|
25
|
+
--disable-tc-keys Disable test case import key hints
|
|
26
|
+
--disable-nested-folders Disable nesting of imported folders (flat mode)
|
|
27
|
+
--folder-separator <token> Token for folder name separation (default ' > ')
|
|
28
|
+
--duplicates <duplicate mode> Controls how duplicates are detected (choices: "off", "title",
|
|
29
|
+
"folder_title", default: "folder_title")
|
|
30
|
+
--licenses Show included package licenses
|
|
31
|
+
--apikey <apiKey> The API key to use. Not recommended - use the environment variable
|
|
32
|
+
TESTINY_API_KEY or TESTINY_IMPORT_API_KEY instead
|
|
33
|
+
-h, --help display help for command
|
|
34
|
+
|
|
35
|
+
Commands:
|
|
36
|
+
testcase [options] Import testcases (with folders)
|
|
37
|
+
testrun [options] Import test case results as a testrun
|
|
38
|
+
help [command] display help for command
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Importing Test Cases
|
|
42
|
+
|
|
43
|
+
```plain
|
|
44
|
+
Usage: testiny-importer testcase [options]
|
|
45
|
+
|
|
46
|
+
Import testcases (with folders)
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
--csv <file> Import this CSV file
|
|
50
|
+
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
51
|
+
--steps <step mode> Controls how steps are imported (choices: "off", "rows", "newlines", "numbered", "numbered_bracket")
|
|
52
|
+
-h, --help display help for command
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Importing Test Runs
|
|
56
|
+
|
|
57
|
+
```plain
|
|
58
|
+
Usage: testiny-importer testrun [options]
|
|
59
|
+
|
|
60
|
+
Import test case results as a testrun
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
--csv <file> Import this CSV file
|
|
64
|
+
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
65
|
+
--junit <file> Import this JUnit XML file
|
|
66
|
+
--playwright <file> Import this Playwright JSON file
|
|
67
|
+
--name <test run name> Name of the test run (use %date, %host and %source as placeholders)
|
|
68
|
+
--update Allow run with given name to be updated, otherwise creates a new run with that name (default: false)
|
|
69
|
+
--close Close the testrun after a successful import (default: false)
|
|
70
|
+
--folder <folder name> Override folder name for all created testcases
|
|
71
|
+
--testplan <nameOrKey> Target testplan id or title
|
|
72
|
+
--testcases <tc mode> Controls how testcases are created if no existing TC is found (choices: "ignore", "fail", "create",
|
|
73
|
+
default: "create")
|
|
74
|
+
-h, --help display help for command
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Example Files
|
|
78
|
+
|
|
79
|
+
CSV Example for importing test cases
|
|
80
|
+
|
|
81
|
+
```csv
|
|
82
|
+
folder,title,precondition,steps,expected_result
|
|
83
|
+
"Folder Name", "Test case title", "Precondition text, can be empty", "Steps text (depends on step mode setting)", "Expected result, can be empty"
|
|
84
|
+
"Folder Name > Subfolder Name", "Another test case title", "", "Folders can be nested by using the folder separator token", ""
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Bundled licenses
|
|
88
|
+
|
|
89
|
+
For licenses of bundled dependencies, please see LICENSE.txt in the package directory
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@testiny/cli",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "A command-line client for Testiny",
|
|
5
|
-
"main": "./testiny-importer.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"testiny-importer": "./testiny-importer.js"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://www.testiny.io/",
|
|
10
|
-
"engines": {
|
|
11
|
-
"node": ">=16.0.0"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"testiny",
|
|
15
|
-
"testmanagement",
|
|
16
|
-
"testautomation"
|
|
17
|
-
],
|
|
18
|
-
"author": "Mategra GmbH",
|
|
19
|
-
"devDependencies": {},
|
|
20
|
-
"dependencies": {}
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@testiny/cli",
|
|
3
|
+
"version": "1.2.5",
|
|
4
|
+
"description": "A command-line client for Testiny",
|
|
5
|
+
"main": "./testiny-importer.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"testiny-importer": "./testiny-importer.js"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://www.testiny.io/",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16.0.0"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"testiny",
|
|
15
|
+
"testmanagement",
|
|
16
|
+
"testautomation"
|
|
17
|
+
],
|
|
18
|
+
"author": "Mategra GmbH",
|
|
19
|
+
"devDependencies": {},
|
|
20
|
+
"dependencies": {}
|
|
21
|
+
}
|
package/testiny-importer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
'#!/usr/bin/env node'
|
|
2
2
|
"use strict";var tZ=Object.create;var Mm=Object.defineProperty;var QE=Object.getOwnPropertyDescriptor;var rZ=Object.getOwnPropertyNames;var iZ=Object.getPrototypeOf,nZ=Object.prototype.hasOwnProperty;var aZ=(t,e,r)=>e in t?Mm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var c=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var oZ=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of rZ(e))!nZ.call(t,n)&&n!==r&&Mm(t,n,{get:()=>e[n],enumerable:!(i=QE(e,n))||i.enumerable});return t};var X=(t,e,r)=>(r=t!=null?tZ(iZ(t)):{},oZ(e||!t||!t.__esModule?Mm(r,"default",{value:t,enumerable:!0}):r,t));var T=(t,e,r,i)=>{for(var n=i>1?void 0:i?QE(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Mm(e,r,n),n};var An=(t,e,r)=>(aZ(t,typeof e!="symbol"?e+"":e,r),r),eC=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var tC=(t,e,r)=>(eC(t,e,"read from private field"),r?r.call(t):e.get(t)),rC=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},G1=(t,e,r,i)=>(eC(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var nC=c((Y7e,iC)=>{"use strict";iC.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var K1=c((J7e,oC)=>{var Tc=nC(),aC={};for(let t of Object.keys(Tc))aC[Tc[t]]=t;var W={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};oC.exports=W;for(let t of Object.keys(W)){if(!("channels"in W[t]))throw new Error("missing channels property: "+t);if(!("labels"in W[t]))throw new Error("missing channel labels property: "+t);if(W[t].labels.length!==W[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=W[t];delete W[t].channels,delete W[t].labels,Object.defineProperty(W[t],"channels",{value:e}),Object.defineProperty(W[t],"labels",{value:r})}W.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s,u;a===n?s=0:e===a?s=(r-i)/o:r===a?s=2+(i-e)/o:i===a&&(s=4+(e-r)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(n+a)/2;return a===n?u=0:l<=.5?u=o/(a+n):u=o/(2-a-n),[s,u*100,l*100]};W.rgb.hsv=function(t){let e,r,i,n,a,o=t[0]/255,s=t[1]/255,u=t[2]/255,l=Math.max(o,s,u),d=l-Math.min(o,s,u),p=function(f){return(l-f)/6/d+1/2};return d===0?(n=0,a=0):(a=d/l,e=p(o),r=p(s),i=p(u),o===l?n=i-r:s===l?n=1/3+e-i:u===l&&(n=2/3+r-e),n<0?n+=1:n>1&&(n-=1)),[n*360,a*100,l*100]};W.rgb.hwb=function(t){let e=t[0],r=t[1],i=t[2],n=W.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[n,a*100,i*100]};W.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(1-e,1-r,1-i),a=(1-e-n)/(1-n)||0,o=(1-r-n)/(1-n)||0,s=(1-i-n)/(1-n)||0;return[a*100,o*100,s*100,n*100]};function sZ(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}W.rgb.keyword=function(t){let e=aC[t];if(e)return e;let r=1/0,i;for(let n of Object.keys(Tc)){let a=Tc[n],o=sZ(t,a);o<r&&(r=o,i=n)}return i};W.keyword.rgb=function(t){return Tc[t]};W.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=e*.4124+r*.3576+i*.1805,a=e*.2126+r*.7152+i*.0722,o=e*.0193+r*.1192+i*.9505;return[n*100,a*100,o*100]};W.rgb.lab=function(t){let e=W.rgb.xyz(t),r=e[0],i=e[1],n=e[2];r/=95.047,i/=100,n/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let a=116*i-16,o=500*(r-i),s=200*(i-n);return[a,o,s]};W.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n,a,o;if(r===0)return o=i*255,[o,o,o];i<.5?n=i*(1+r):n=i+r-i*r;let s=2*i-n,u=[0,0,0];for(let l=0;l<3;l++)a=e+1/3*-(l-1),a<0&&a++,a>1&&a--,6*a<1?o=s+(n-s)*6*a:2*a<1?o=n:3*a<2?o=s+(n-s)*(2/3-a)*6:o=s,u[l]=o*255;return u};W.hsl.hsv=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=r,a=Math.max(i,.01);i*=2,r*=i<=1?i:2-i,n*=a<=1?a:2-a;let o=(i+r)/2,s=i===0?2*n/(a+n):2*r/(i+r);return[e,s*100,o*100]};W.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,i=t[2]/100,n=Math.floor(e)%6,a=e-Math.floor(e),o=255*i*(1-r),s=255*i*(1-r*a),u=255*i*(1-r*(1-a));switch(i*=255,n){case 0:return[i,u,o];case 1:return[s,i,o];case 2:return[o,i,u];case 3:return[o,s,i];case 4:return[u,o,i];case 5:return[i,o,s]}};W.hsv.hsl=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=Math.max(i,.01),a,o;o=(2-r)*i;let s=(2-r)*n;return a=r*n,a/=s<=1?s:2-s,a=a||0,o/=2,[e,a*100,o*100]};W.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n=r+i,a;n>1&&(r/=n,i/=n);let o=Math.floor(6*e),s=1-i;a=6*e-o,o&1&&(a=1-a);let u=r+a*(s-r),l,d,p;switch(o){default:case 6:case 0:l=s,d=u,p=r;break;case 1:l=u,d=s,p=r;break;case 2:l=r,d=s,p=u;break;case 3:l=r,d=u,p=s;break;case 4:l=u,d=r,p=s;break;case 5:l=s,d=r,p=u;break}return[l*255,d*255,p*255]};W.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=t[3]/100,a=1-Math.min(1,e*(1-n)+n),o=1-Math.min(1,r*(1-n)+n),s=1-Math.min(1,i*(1-n)+n);return[a*255,o*255,s*255]};W.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n,a,o;return n=e*3.2406+r*-1.5372+i*-.4986,a=e*-.9689+r*1.8758+i*.0415,o=e*.0557+r*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,n=Math.min(Math.max(0,n),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[n*255,a*255,o*255]};W.xyz.lab=function(t){let e=t[0],r=t[1],i=t[2];e/=95.047,r/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*r-16,a=500*(e-r),o=200*(r-i);return[n,a,o]};W.lab.xyz=function(t){let e=t[0],r=t[1],i=t[2],n,a,o;a=(e+16)/116,n=r/500+a,o=a-i/200;let s=a**3,u=n**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,n*=95.047,a*=100,o*=108.883,[n,a,o]};W.lab.lch=function(t){let e=t[0],r=t[1],i=t[2],n;n=Math.atan2(i,r)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(r*r+i*i);return[e,o,n]};W.lch.lab=function(t){let e=t[0],r=t[1],n=t[2]/360*2*Math.PI,a=r*Math.cos(n),o=r*Math.sin(n);return[e,a,o]};W.rgb.ansi16=function(t,e=null){let[r,i,n]=t,a=e===null?W.rgb.hsv(t)[2]:e;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return a===2&&(o+=60),o};W.hsv.ansi16=function(t){return W.rgb.ansi16(W.hsv.rgb(t),t[2])};W.rgb.ansi256=function(t){let e=t[0],r=t[1],i=t[2];return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)};W.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,i=(e&1)*r*255,n=(e>>1&1)*r*255,a=(e>>2&1)*r*255;return[i,n,a]};W.ansi256.rgb=function(t){if(t>=232){let a=(t-232)*10+8;return[a,a,a]}t-=16;let e,r=Math.floor(t/36)/5*255,i=Math.floor((e=t%36)/6)/5*255,n=e%6/5*255;return[r,i,n]};W.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};W.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(s=>s+s).join(""));let i=parseInt(r,16),n=i>>16&255,a=i>>8&255,o=i&255;return[n,a,o]};W.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.max(Math.max(e,r),i),a=Math.min(Math.min(e,r),i),o=n-a,s,u;return o<1?s=a/(1-o):s=0,o<=0?u=0:n===e?u=(r-i)/o%6:n===r?u=2+(i-e)/o:u=4+(e-r)/o,u/=6,u%=1,[u*360,o*100,s*100]};W.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=r<.5?2*e*r:2*e*(1-r),n=0;return i<1&&(n=(r-.5*i)/(1-i)),[t[0],i*100,n*100]};W.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=e*r,n=0;return i<1&&(n=(r-i)/(1-i)),[t[0],i*100,n*100]};W.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return[i*255,i*255,i*255];let n=[0,0,0],a=e%1*6,o=a%1,s=1-o,u=0;switch(Math.floor(a)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return u=(1-r)*i,[(r*n[0]+u)*255,(r*n[1]+u)*255,(r*n[2]+u)*255]};W.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e),n=0;return i>0&&(n=e/i),[t[0],n*100,i*100]};W.hcg.hsl=function(t){let e=t[1]/100,i=t[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[t[0],n*100,i*100]};W.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return[t[0],(i-e)*100,(1-i)*100]};W.hwb.hcg=function(t){let e=t[1]/100,i=1-t[2]/100,n=i-e,a=0;return n<1&&(a=(i-n)/(1-n)),[t[0],n*100,a*100]};W.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};W.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};W.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};W.gray.hsl=function(t){return[0,0,t[0]]};W.gray.hsv=W.gray.hsl;W.gray.hwb=function(t){return[0,100,t[0]]};W.gray.cmyk=function(t){return[0,0,0,t[0]]};W.gray.lab=function(t){return[t[0],0,0]};W.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};W.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var uC=c((X7e,sC)=>{var Nm=K1();function uZ(){let t={},e=Object.keys(Nm);for(let r=e.length,i=0;i<r;i++)t[e[i]]={distance:-1,parent:null};return t}function lZ(t){let e=uZ(),r=[t];for(e[t].distance=0;r.length;){let i=r.pop(),n=Object.keys(Nm[i]);for(let a=n.length,o=0;o<a;o++){let s=n[o],u=e[s];u.distance===-1&&(u.distance=e[i].distance+1,u.parent=i,r.unshift(s))}}return e}function cZ(t,e){return function(r){return e(t(r))}}function dZ(t,e){let r=[e[t].parent,t],i=Nm[e[t].parent][t],n=e[t].parent;for(;e[n].parent;)r.unshift(e[n].parent),i=cZ(Nm[e[n].parent][n],i),n=e[n].parent;return i.conversion=r,i}sC.exports=function(t){let e=lZ(t),r={},i=Object.keys(e);for(let n=i.length,a=0;a<n;a++){let o=i[a];e[o].parent!==null&&(r[o]=dZ(o,e))}return r}});var cC=c((Q7e,lC)=>{var Z1=K1(),pZ=uC(),yu={},fZ=Object.keys(Z1);function mZ(t){let e=function(...r){let i=r[0];return i==null?i:(i.length>1&&(r=i),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function hZ(t){let e=function(...r){let i=r[0];if(i==null)return i;i.length>1&&(r=i);let n=t(r);if(typeof n=="object")for(let a=n.length,o=0;o<a;o++)n[o]=Math.round(n[o]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}fZ.forEach(t=>{yu[t]={},Object.defineProperty(yu[t],"channels",{value:Z1[t].channels}),Object.defineProperty(yu[t],"labels",{value:Z1[t].labels});let e=pZ(t);Object.keys(e).forEach(i=>{let n=e[i];yu[t][i]=hZ(n),yu[t][i].raw=mZ(n)})});lC.exports=yu});var gC=c((eLe,hC)=>{"use strict";var dC=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,pC=(t,e)=>(...r)=>{let i=t(...r);return`\x1B[${38+e};5;${i}m`},fC=(t,e)=>(...r)=>{let i=t(...r);return`\x1B[${38+e};2;${i[0]};${i[1]};${i[2]}m`},Dm=t=>t,mC=(t,e,r)=>[t,e,r],_u=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let i=r();return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},Y1,xu=(t,e,r,i)=>{Y1===void 0&&(Y1=cC());let n=i?10:0,a={};for(let[o,s]of Object.entries(Y1)){let u=o==="ansi16"?"ansi":o;o===e?a[u]=t(r,n):typeof s=="object"&&(a[u]=t(s[e],n))}return a};function gZ(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,i]of Object.entries(e)){for(let[n,a]of Object.entries(i))e[n]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},i[n]=e[n],t.set(a[0],a[1]);Object.defineProperty(e,r,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",_u(e.color,"ansi",()=>xu(dC,"ansi16",Dm,!1)),_u(e.color,"ansi256",()=>xu(pC,"ansi256",Dm,!1)),_u(e.color,"ansi16m",()=>xu(fC,"rgb",mC,!1)),_u(e.bgColor,"ansi",()=>xu(dC,"ansi16",Dm,!0)),_u(e.bgColor,"ansi256",()=>xu(pC,"ansi256",Dm,!0)),_u(e.bgColor,"ansi16m",()=>xu(fC,"rgb",mC,!0)),e}Object.defineProperty(hC,"exports",{enumerable:!0,get:gZ})});var bC=c((tLe,vC)=>{"use strict";vC.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var xC=c((rLe,_C)=>{"use strict";var vZ=require("os"),yC=require("tty"),yr=bC(),{env:wt}=process,bo;yr("no-color")||yr("no-colors")||yr("color=false")||yr("color=never")?bo=0:(yr("color")||yr("colors")||yr("color=true")||yr("color=always"))&&(bo=1);"FORCE_COLOR"in wt&&(wt.FORCE_COLOR==="true"?bo=1:wt.FORCE_COLOR==="false"?bo=0:bo=wt.FORCE_COLOR.length===0?1:Math.min(parseInt(wt.FORCE_COLOR,10),3));function J1(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function X1(t,e){if(bo===0)return 0;if(yr("color=16m")||yr("color=full")||yr("color=truecolor"))return 3;if(yr("color=256"))return 2;if(t&&!e&&bo===void 0)return 0;let r=bo||0;if(wt.TERM==="dumb")return r;if(process.platform==="win32"){let i=vZ.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in wt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in wt)||wt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in wt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(wt.TEAMCITY_VERSION)?1:0;if(wt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in wt){let i=parseInt((wt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(wt.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(wt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(wt.TERM)||"COLORTERM"in wt?1:r}function bZ(t){let e=X1(t,t&&t.isTTY);return J1(e)}_C.exports={supportsColor:bZ,stdout:J1(X1(!0,yC.isatty(1))),stderr:J1(X1(!0,yC.isatty(2)))}});var wC=c((iLe,SC)=>{"use strict";var yZ=(t,e,r)=>{let i=t.indexOf(e);if(i===-1)return t;let n=e.length,a=0,o="";do o+=t.substr(a,i-a)+e+r,a=i+n,i=t.indexOf(e,a);while(i!==-1);return o+=t.substr(a),o},_Z=(t,e,r,i)=>{let n=0,a="";do{let o=t[i-1]==="\r";a+=t.substr(n,(o?i-1:i)-n)+e+(o?`\r
|
|
3
3
|
`:`
|
|
4
4
|
`)+r,n=i+1,i=t.indexOf(`
|
|
@@ -196,7 +196,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
196
196
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let i=new this(e);return r.forEach(n=>i.set(n)),i}static accessor(e){let i=(this[CM]=this[CM]={accessors:{}}).accessors,n=this.prototype;function a(o){let s=Wc(o);i[s]||(kee(n,o),i[s]=!0)}return w.isArray(e)?e.forEach(a):a(e),this}};$u.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.freezeMethods($u.prototype);w.freezeMethods($u);var vt=$u;function Hc(t,e){let r=this||ju,i=e||r,n=vt.from(i.headers),a=i.data;return w.forEach(t,function(s){a=s.call(r,a,n.normalize(),e?e.status:void 0)}),n.normalize(),a}function Gc(t){return!!(t&&t.__CANCEL__)}function PM(t,e,r){U.call(this,t??"canceled",U.ERR_CANCELED,e,r),this.name="CanceledError"}w.inherits(PM,U,{__CANCEL__:!0});var Br=PM;function To(t,e,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?t(r):e(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Wx(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Hx(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Cs(t,e){return t&&!Wx(e)?Hx(t,e):e}var pN=X($M(),1),fN=X(require("http"),1),mN=X(require("https"),1),hN=X(require("util"),1),gN=X(eN(),1),ca=X(require("zlib"),1);var Ms="1.3.4";function Jc(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var lte=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function r2(t,e,r){let i=r&&r.Blob||ct.classes.Blob,n=Jc(t);if(e===void 0&&i&&(e=!0),n==="data"){t=n.length?t.slice(n.length+1):t;let a=lte.exec(t);if(!a)throw new U("Invalid URL",U.ERR_INVALID_URL);let o=a[1],s=a[2],u=a[3],l=Buffer.from(decodeURIComponent(u),s?"base64":"utf8");if(e){if(!i)throw new U("Blob is not supported",U.ERR_NOT_SUPPORT);return new i([l],{type:o})}return l}throw new U("Unsupported protocol "+n,U.ERR_NOT_SUPPORT)}var Ns=X(require("stream"),1);var rN=X(require("stream"),1);function cte(t,e){let r=0,i=1e3/e,n=null;return function(o,s){let u=Date.now();if(o||u-r>i)return n&&(clearTimeout(n),n=null),r=u,t.apply(null,s);n||(n=setTimeout(()=>(n=null,r=Date.now(),t.apply(null,s)),i-(u-r)))}}var tN=cte;function dte(t,e){t=t||10;let r=new Array(t),i=new Array(t),n=0,a=0,o;return e=e!==void 0?e:1e3,function(u){let l=Date.now(),d=i[a];o||(o=l),r[n]=u,i[n]=l;let p=a,f=0;for(;p!==n;)f+=r[p++],p=p%t;if(n=(n+1)%t,n===a&&(a=(a+1)%t),l-o<e)return;let m=d&&l-d;return m?Math.round(f*1e3/m):void 0}}var yh=dte;var _h=Symbol("internals"),i2=class extends rN.default.Transform{constructor(e){e=w.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,u)=>!w.isUndefined(u[s])),super({readableHighWaterMark:e.chunkSize});let r=this,i=this[_h]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},n=yh(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",s=>{s==="progress"&&(i.isCaptured||(i.isCaptured=!0))});let a=0;i.updateProgress=tN(function(){let u=i.length,l=i.bytesSeen,d=l-a;if(!d||r.destroyed)return;let p=n(d);a=l,process.nextTick(()=>{r.emit("progress",{loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:p||void 0,estimated:p&&u&&l<=u?(u-l)/p:void 0})})},i.ticksRate);let o=()=>{i.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let r=this[_h];return r.onReadCallback&&r.onReadCallback(),super._read(e)}_transform(e,r,i){let n=this,a=this[_h],o=a.maxRate,s=this.readableHighWaterMark,u=a.timeWindow,l=1e3/u,d=o/l,p=a.minChunkSize!==!1?Math.max(a.minChunkSize,d*.01):0;function f(g,v){let b=Buffer.byteLength(g);a.bytesSeen+=b,a.bytes+=b,a.isCaptured&&a.updateProgress(),n.push(g)?process.nextTick(v):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(v)}}let m=(g,v)=>{let b=Buffer.byteLength(g),x=null,k=s,P,$=0;if(o){let D=Date.now();(!a.ts||($=D-a.ts)>=u)&&(a.ts=D,P=d-a.bytes,a.bytes=P<0?-P:0,$=0),P=d-a.bytes}if(o){if(P<=0)return setTimeout(()=>{v(null,g)},u-$);P<k&&(k=P)}k&&b>k&&b-k>p&&(x=g.subarray(k),g=g.subarray(0,k)),f(g,x?()=>{process.nextTick(v,null,x)}:v)};m(e,function g(v,b){if(v)return i(v);b?m(b,g):i(null)})}setLength(e){return this[_h].length=+e,this}},n2=i2;var vN=X(require("events"),1);var nN=require("util"),aN=require("stream");var{asyncIterator:iN}=Symbol,pte=async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[iN]?yield*t[iN]():yield t},xh=pte;var fte=w.ALPHABET.ALPHA_DIGIT+"-_",Xc=new nN.TextEncoder,Oo=`\r
|
|
197
197
|
`,mte=Xc.encode(Oo),hte=2,a2=class{constructor(e,r){let{escapeName:i}=this.constructor,n=w.isString(r),a=`Content-Disposition: form-data; name="${i(e)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${Oo}`;n?r=Xc.encode(String(r).replace(/\r?\n|\r\n?/g,Oo)):a+=`Content-Type: ${r.type||"application/octet-stream"}${Oo}`,this.headers=Xc.encode(a+Oo),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+hte,this.name=e,this.value=r}async*encode(){yield this.headers;let{value:e}=this;w.isTypedArray(e)?yield e:yield*xh(e),yield mte}static escapeName(e){return String(e).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},gte=(t,e,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+w.generateString(n,fte)}=r||{};if(!w.isFormData(t))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=Xc.encode("--"+a+Oo),s=Xc.encode("--"+a+"--"+Oo+Oo),u=s.byteLength,l=Array.from(t.entries()).map(([p,f])=>{let m=new a2(p,f);return u+=m.size,m});u+=o.byteLength*l.length,u=w.toFiniteNumber(u);let d={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(u)&&(d["Content-Length"]=u),e&&e(d),aN.Readable.from(async function*(){for(let p of l)yield o,yield*p.encode();yield s}())},oN=gte;var sN=X(require("stream"),1),o2=class extends sN.default.Transform{__transform(e,r,i){this.push(e),i()}_transform(e,r,i){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,r)}this.__transform(e,r,i)}},uN=o2;var lN={flush:ca.default.constants.Z_SYNC_FLUSH,finishFlush:ca.default.constants.Z_SYNC_FLUSH},vte={flush:ca.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ca.default.constants.BROTLI_OPERATION_FLUSH},cN=w.isFunction(ca.default.createBrotliDecompress),{http:bte,https:yte}=gN.default,_te=/https:?/,dN=ct.protocols.map(t=>t+":");function xte(t){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t)}function bN(t,e,r){let i=e;if(!i&&i!==!1){let n=(0,pN.getProxyForUrl)(r);n&&(i=new URL(n))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let a=Buffer.from(i.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+a}t.headers.host=t.hostname+(t.port?":"+t.port:"");let n=i.hostname||i.host;t.hostname=n,t.host=n,t.port=i.port,t.path=r,i.protocol&&(t.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}t.beforeRedirects.proxy=function(a){bN(a,e,a.href)}}var Ste=typeof process<"u"&&w.kindOf(process)==="process",wte=t=>new Promise((e,r)=>{let i,n,a=(u,l)=>{n||(n=!0,i&&i(u,l))},o=u=>{a(u),e(u)},s=u=>{a(u,!0),r(u)};t(o,s,u=>i=u).catch(s)}),yN=Ste&&function(e){return wte(async function(i,n,a){let{data:o}=e,{responseType:s,responseEncoding:u}=e,l=e.method.toUpperCase(),d,p=!1,f,m=new vN.default,g=()=>{e.cancelToken&&e.cancelToken.unsubscribe(v),e.signal&&e.signal.removeEventListener("abort",v),m.removeAllListeners()};a((A,C)=>{d=!0,C&&(p=!0,g())});function v(A){m.emit("abort",!A||A.type?new Br(null,e,f):A)}m.once("abort",n),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(v),e.signal&&(e.signal.aborted?v():e.signal.addEventListener("abort",v)));let b=Cs(e.baseURL,e.url),x=new URL(b,"http://localhost"),k=x.protocol||dN[0];if(k==="data:"){let A;if(l!=="GET")return To(i,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{A=r2(e.url,s==="blob",{Blob:e.env&&e.env.Blob})}catch(C){throw U.from(C,U.ERR_BAD_REQUEST,e)}return s==="text"?(A=A.toString(u),(!u||u==="utf8")&&(A=w.stripBOM(A))):s==="stream"&&(A=Ns.default.Readable.from(A)),To(i,n,{data:A,status:200,statusText:"OK",headers:new vt,config:e})}if(dN.indexOf(k)===-1)return n(new U("Unsupported protocol "+k,U.ERR_BAD_REQUEST,e));let P=vt.from(e.headers).normalize();P.set("User-Agent","axios/"+Ms,!1);let $=e.onDownloadProgress,D=e.onUploadProgress,te=e.maxRate,V,pe;if(w.isSpecCompliantForm(o)){let A=P.getContentType(/boundary=([-_\w\d]{10,70})/i);o=oN(o,C=>{P.set(C)},{tag:`axios-${Ms}-boundary`,boundary:A&&A[1]||void 0})}else if(w.isFormData(o)&&w.isFunction(o.getHeaders)){if(P.set(o.getHeaders()),!P.hasContentLength())try{let A=await hN.default.promisify(o.getLength).call(o);Number.isFinite(A)&&A>=0&&P.setContentLength(A)}catch{}}else if(w.isBlob(o))o.size&&P.setContentType(o.type||"application/octet-stream"),P.setContentLength(o.size||0),o=Ns.default.Readable.from(xh(o));else if(o&&!w.isStream(o)){if(!Buffer.isBuffer(o))if(w.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(w.isString(o))o=Buffer.from(o,"utf-8");else return n(new U("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",U.ERR_BAD_REQUEST,e));if(P.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return n(new U("Request body larger than maxBodyLength limit",U.ERR_BAD_REQUEST,e))}let oe=w.toFiniteNumber(P.getContentLength());w.isArray(te)?(V=te[0],pe=te[1]):V=pe=te,o&&(D||V)&&(w.isStream(o)||(o=Ns.default.Readable.from(o,{objectMode:!1})),o=Ns.default.pipeline([o,new n2({length:oe,maxRate:w.toFiniteNumber(V)})],w.noop),D&&o.on("progress",A=>{D(Object.assign(A,{upload:!0}))}));let fe;if(e.auth){let A=e.auth.username||"",C=e.auth.password||"";fe=A+":"+C}if(!fe&&x.username){let A=x.username,C=x.password;fe=A+":"+C}fe&&P.delete("authorization");let re;try{re=Es(x.pathname+x.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(A){let C=new Error(A.message);return C.config=e,C.url=e.url,C.exists=!0,n(C)}P.set("Accept-Encoding","gzip, compress, deflate"+(cN?", br":""),!1);let _={path:re,method:l,headers:P.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:fe,protocol:k,beforeRedirect:xte,beforeRedirects:{}};e.socketPath?_.socketPath=e.socketPath:(_.hostname=x.hostname,_.port=x.port,bN(_,e.proxy,k+"//"+x.hostname+(x.port?":"+x.port:"")+_.path));let S,j=_te.test(_.protocol);if(_.agent=j?e.httpsAgent:e.httpAgent,e.transport?S=e.transport:e.maxRedirects===0?S=j?mN.default:fN.default:(e.maxRedirects&&(_.maxRedirects=e.maxRedirects),e.beforeRedirect&&(_.beforeRedirects.config=e.beforeRedirect),S=j?yte:bte),e.maxBodyLength>-1?_.maxBodyLength=e.maxBodyLength:_.maxBodyLength=1/0,e.insecureHTTPParser&&(_.insecureHTTPParser=e.insecureHTTPParser),f=S.request(_,function(C){if(f.destroyed)return;let K=[C],q=+C.headers["content-length"];if($){let Z=new n2({length:w.toFiniteNumber(q),maxRate:w.toFiniteNumber(pe)});$&&Z.on("progress",Pt=>{$(Object.assign(Pt,{download:!0}))}),K.push(Z)}let z=C,ie=C.req||f;if(e.decompress!==!1&&C.headers["content-encoding"])switch((l==="HEAD"||C.statusCode===204)&&delete C.headers["content-encoding"],C.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":K.push(ca.default.createUnzip(lN)),delete C.headers["content-encoding"];break;case"deflate":K.push(new uN),K.push(ca.default.createUnzip(lN)),delete C.headers["content-encoding"];break;case"br":cN&&(K.push(ca.default.createBrotliDecompress(vte)),delete C.headers["content-encoding"])}z=K.length>1?Ns.default.pipeline(K,w.noop):K[0];let L=Ns.default.finished(z,()=>{L(),g()}),Xe={status:C.statusCode,statusText:C.statusMessage,headers:new vt(C.headers),config:e,request:ie};if(s==="stream")Xe.data=z,To(i,n,Xe);else{let Z=[],Pt=0;z.on("data",function(Y){Z.push(Y),Pt+=Y.length,e.maxContentLength>-1&&Pt>e.maxContentLength&&(p=!0,z.destroy(),n(new U("maxContentLength size of "+e.maxContentLength+" exceeded",U.ERR_BAD_RESPONSE,e,ie)))}),z.on("aborted",function(){if(p)return;let Y=new U("maxContentLength size of "+e.maxContentLength+" exceeded",U.ERR_BAD_RESPONSE,e,ie);z.destroy(Y),n(Y)}),z.on("error",function(Y){f.destroyed||n(U.from(Y,null,e,ie))}),z.on("end",function(){try{let Y=Z.length===1?Z[0]:Buffer.concat(Z);s!=="arraybuffer"&&(Y=Y.toString(u),(!u||u==="utf8")&&(Y=w.stripBOM(Y))),Xe.data=Y}catch(Y){n(U.from(Y,null,e,Xe.request,Xe))}To(i,n,Xe)})}m.once("abort",Z=>{z.destroyed||(z.emit("error",Z),z.destroy())})}),m.once("abort",A=>{n(A),f.destroy(A)}),f.on("error",function(C){n(U.from(C,null,e,f))}),f.on("socket",function(C){C.setKeepAlive(!0,1e3*60)}),e.timeout){let A=parseInt(e.timeout,10);if(isNaN(A)){n(new U("error trying to parse `config.timeout` to int",U.ERR_BAD_OPTION_VALUE,e,f));return}f.setTimeout(A,function(){if(d)return;let K=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",q=e.transitional||Pu;e.timeoutErrorMessage&&(K=e.timeoutErrorMessage),n(new U(K,q.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,f)),v()})}if(w.isStream(o)){let A=!1,C=!1;o.on("end",()=>{A=!0}),o.once("error",K=>{C=!0,f.destroy(K)}),o.on("close",()=>{!A&&!C&&v(new Br("Request stream has been aborted",e,f))}),o.pipe(f)}else f.end(o)})};var _N=ct.isStandardBrowserEnv?function(){return{write:function(r,i,n,a,o,s){let u=[];u.push(r+"="+encodeURIComponent(i)),w.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),w.isString(a)&&u.push("path="+a),w.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){let i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();var xN=ct.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function n(a){let o=a;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=n(window.location.href),function(o){let s=w.isString(o)?n(o):o;return s.protocol===i.protocol&&s.host===i.host}}():function(){return function(){return!0}}();function SN(t,e){let r=0,i=yh(50,250);return n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,u=i(s),l=a<=o;r=a;let d={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&l?(o-a)/u:void 0,event:n};d[e?"download":"upload"]=!0,t(d)}}var kte=typeof XMLHttpRequest<"u",wN=kte&&function(t){return new Promise(function(r,i){let n=t.data,a=vt.from(t.headers).normalize(),o=t.responseType,s;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}w.isFormData(n)&&(ct.isStandardBrowserEnv||ct.isStandardBrowserWebWorkerEnv)&&a.setContentType(!1);let l=new XMLHttpRequest;if(t.auth){let m=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(m+":"+g))}let d=Cs(t.baseURL,t.url);l.open(t.method.toUpperCase(),Es(d,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function p(){if(!l)return;let m=vt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:m,config:t,request:l};To(function(x){r(x),u()},function(x){i(x),u()},v),l=null}if("onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(p)},l.onabort=function(){l&&(i(new U("Request aborted",U.ECONNABORTED,t,l)),l=null)},l.onerror=function(){i(new U("Network Error",U.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let g=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",v=t.transitional||Pu;t.timeoutErrorMessage&&(g=t.timeoutErrorMessage),i(new U(g,v.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,t,l)),l=null},ct.isStandardBrowserEnv){let m=(t.withCredentials||xN(d))&&t.xsrfCookieName&&_N.read(t.xsrfCookieName);m&&a.set(t.xsrfHeaderName,m)}n===void 0&&a.setContentType(null),"setRequestHeader"in l&&w.forEach(a.toJSON(),function(g,v){l.setRequestHeader(v,g)}),w.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),o&&o!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",SN(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",SN(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=m=>{l&&(i(!m||m.type?new Br(null,t,l):m),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));let f=Jc(d);if(f&&ct.protocols.indexOf(f)===-1){i(new U("Unsupported protocol "+f+":",U.ERR_BAD_REQUEST,t));return}l.send(n||null)})};var Sh={http:yN,xhr:wN};w.forEach(Sh,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var kN={getAdapter:t=>{t=w.isArray(t)?t:[t];let{length:e}=t,r,i;for(let n=0;n<e&&(r=t[n],!(i=w.isString(r)?Sh[r.toLowerCase()]:r));n++);if(!i)throw i===!1?new U(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(w.hasOwnProp(Sh,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!w.isFunction(i))throw new TypeError("adapter is not a function");return i},adapters:Sh};function s2(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Br(null,t)}function wh(t){return s2(t),t.headers=vt.from(t.headers),t.data=Hc.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),kN.getAdapter(t.adapter||ju.adapter)(t).then(function(i){return s2(t),i.data=Hc.call(t,t.transformResponse,i),i.headers=vt.from(i.headers),i},function(i){return Gc(i)||(s2(t),i&&i.response&&(i.response.data=Hc.call(t,t.transformResponse,i.response),i.response.headers=vt.from(i.response.headers))),Promise.reject(i)})}var TN=t=>t instanceof vt?t.toJSON():t;function da(t,e){e=e||{};let r={};function i(l,d,p){return w.isPlainObject(l)&&w.isPlainObject(d)?w.merge.call({caseless:p},l,d):w.isPlainObject(d)?w.merge({},d):w.isArray(d)?d.slice():d}function n(l,d,p){if(w.isUndefined(d)){if(!w.isUndefined(l))return i(void 0,l,p)}else return i(l,d,p)}function a(l,d){if(!w.isUndefined(d))return i(void 0,d)}function o(l,d){if(w.isUndefined(d)){if(!w.isUndefined(l))return i(void 0,l)}else return i(void 0,d)}function s(l,d,p){if(p in e)return i(l,d);if(p in t)return i(void 0,l)}let u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,d)=>n(TN(l),TN(d),!0)};return w.forEach(Object.keys(t).concat(Object.keys(e)),function(d){let p=u[d]||n,f=p(t[d],e[d],d);w.isUndefined(f)&&p!==s||(r[d]=f)}),r}var u2={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{u2[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var ON={};u2.transitional=function(e,r,i){function n(a,o){return"[Axios v"+Ms+"] Transitional option '"+a+"'"+o+(i?". "+i:"")}return(a,o,s)=>{if(e===!1)throw new U(n(o," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!ON[o]&&(ON[o]=!0,console.warn(n(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,o,s):!0}};function Tte(t,e,r){if(typeof t!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),n=i.length;for(;n-- >0;){let a=i[n],o=e[a];if(o){let s=t[a],u=s===void 0||o(s,a,t);if(u!==!0)throw new U("option "+a+" must be "+u,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+a,U.ERR_BAD_OPTION)}}var kh={assertOptions:Tte,validators:u2};var Ao=kh.validators,qu=class{constructor(e){this.defaults=e,this.interceptors={request:new Vx,response:new Vx}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=da(this.defaults,r);let{transitional:i,paramsSerializer:n,headers:a}=r;i!==void 0&&kh.assertOptions(i,{silentJSONParsing:Ao.transitional(Ao.boolean),forcedJSONParsing:Ao.transitional(Ao.boolean),clarifyTimeoutError:Ao.transitional(Ao.boolean)},!1),n!==void 0&&kh.assertOptions(n,{encode:Ao.function,serialize:Ao.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o;o=a&&w.merge(a.common,a[r.method]),o&&w.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),r.headers=vt.concat(o,a);let s=[],u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});let l=[];this.interceptors.response.forEach(function(v){l.push(v.fulfilled,v.rejected)});let d,p=0,f;if(!u){let g=[wh.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,l),f=g.length,d=Promise.resolve(r);p<f;)d=d.then(g[p++],g[p++]);return d}f=s.length;let m=r;for(p=0;p<f;){let g=s[p++],v=s[p++];try{m=g(m)}catch(b){v.call(this,b);break}}try{d=wh.call(this,m)}catch(g){return Promise.reject(g)}for(p=0,f=l.length;p<f;)d=d.then(l[p++],l[p++]);return d}getUri(e){e=da(this.defaults,e);let r=Cs(e.baseURL,e.url);return Es(r,e.params,e.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(e){qu.prototype[e]=function(r,i){return this.request(da(i||{},{method:e,url:r,data:(i||{}).data}))}});w.forEach(["post","put","patch"],function(e){function r(i){return function(a,o,s){return this.request(da(s||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}qu.prototype[e]=r(),qu.prototype[e+"Form"]=r(!0)});var Qc=qu;var ed=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});let i=this;this.promise.then(n=>{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](n);i._listeners=null}),this.promise.then=n=>{let a,o=new Promise(s=>{i.subscribe(s),a=s}).then(n);return o.cancel=function(){i.unsubscribe(a)},o},e(function(a,o,s){i.reason||(i.reason=new Br(a,o,s),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new ed(function(n){e=n}),cancel:e}}},AN=ed;function l2(t){return function(r){return t.apply(null,r)}}function c2(t){return w.isObject(t)&&t.isAxiosError===!0}var d2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(d2).forEach(([t,e])=>{d2[e]=t});var IN=d2;function EN(t){let e=new Qc(t),r=Vc(Qc.prototype.request,e);return w.extend(r,Qc.prototype,e,{allOwnKeys:!0}),w.extend(r,e,null,{allOwnKeys:!0}),r.create=function(n){return EN(da(t,n))},r}var bt=EN(ju);bt.Axios=Qc;bt.CanceledError=Br;bt.CancelToken=AN;bt.isCancel=Gc;bt.VERSION=Ms;bt.toFormData=ko;bt.AxiosError=U;bt.Cancel=bt.CanceledError;bt.all=function(e){return Promise.all(e)};bt.spread=l2;bt.isAxiosError=c2;bt.mergeConfig=da;bt.AxiosHeaders=vt;bt.formToJSON=t=>dh(w.isHTMLForm(t)?new FormData(t):t);bt.HttpStatusCode=IN;bt.default=bt;var Th=bt;var{Axios:oWe,AxiosError:sWe,CanceledError:uWe,isCancel:lWe,CancelToken:cWe,VERSION:dWe,all:pWe,Cancel:fWe,isAxiosError:mWe,spread:hWe,toFormData:gWe,AxiosHeaders:vWe,HttpStatusCode:bWe,formToJSON:yWe,mergeConfig:_We}=Th;var rH=X(Z4()),T3=X(_d()),iu=X(Q5());var fk=X(require("crypto"),1);var P_e=128,Ys,El,j_e=t=>{!Ys||Ys.length<t?(Ys=Buffer.allocUnsafe(t*P_e),fk.default.randomFillSync(Ys),El=0):El+t>Ys.length&&(fk.default.randomFillSync(Ys),El=0),El+=t},$_e=t=>(j_e(t-=0),Ys.subarray(El-t,El)),M_e=(t,e,r)=>{let i=(2<<31-Math.clz32(t.length-1|1))-1,n=Math.ceil(1.6*i*e/t.length);return(a=e)=>{let o="";for(;;){let s=r(n),u=n;for(;u--;)if(o+=t[s[u]&i]||"",o.length===a)return o}}},Js=(t,e=21)=>M_e(t,e,$_e);var iy="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",cYe=Js(iy,20),dYe=Js(iy,32),ny=Js(iy,10),pYe=Js(iy,6);function t8(t,...e){return t=e8(t,"/")+"/",t+e.map(r=>e8(r,"/")).filter(r=>r.length>0).join("/")}function mk(t,e,r,i){if(typeof t!="string"||!t)return t;let n=0,a=t.length-1;if(r)for(;e.includes(t[n]);)n++;if(i)for(;e.includes(t[a]);)a--;return n<a?t.substring(n,a+1):""}function e8(t,e){return mk(t,e,!0,!0)}function ay(t,e){return mk(t,e,!0,!1)}function r8(t,e){return mk(t,e,!1,!0)}function i8(t){return typeof t!="string"?"":t.replace(/[^a-z0-9-_]/gi,"")}function n8(t){return!t||typeof t!="string"?!1:/^\w+$/.test(t)}function a8(t){return!t||typeof t!="string"?!1:/^[a-zA-Z]/.test(t)}function xd(t,e){return typeof t!="string"||e<0||t.length<=e?t:t.substring(0,e)}function o8(t,e){return t.length<=e?t:`${t.substring(0,e-1)}\u2026`}var Cl=class extends Error{code;status=500;meta;privateDebugInfo;constructor(e,r=void 0,i=0,n,a){super(r),i||(i=N_e(e)),this.status=i,this.code=e,n&&(this.stack=n+`
|
|
198
198
|
(end of wrapped stack)
|
|
199
|
-
`+this.stack),this.meta=a}toString(){return`${this.code}(${this.status}): ${this.message}`}};function s8(t){return t.message??t+""}function N_e(t){return t==="AUTH_INVALID_USER_OR_PASSWORD"||t==="AUTH_INACTIVE_USER"||t==="AUTH_UNCONFIRMED_USER"||t==="AUTH_UNSUPPORTED_AUTH_TYPE"||t==="AUTH_TOKEN_EXPIRED"||t==="API_ACCESS_DENIED"?403:t==="API_INVALID_REQUEST"||t==="API_INVALID_INPUT"||t==="API_INVALID_INPUT_DATA"||t==="API_INPUT_DATA_CONFLICT"||t==="API_STORAGE_QUOTA_EXCEEDED"?400:500}function z0(t){return t!==void 0&&t!=null}function w3(t){return typeof t!="object"||t===null?!1:Object.keys(t).length>0}var Xl=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","prototype","toLocaleString","toString","valueOf"]);var KW=Symbol("TypeHint");function Ql(t,e,r,i){let n=t.constructor[KW]=t.constructor[KW]||{};n[e]=n[e]||[],n[e].push({from:r,to:i})}function qf(t,e,r=!0){if(e){for(let i in e)(i in t||typeof e[i]=="object"||i.startsWith("cf__"))&&!Xl.has(i)&&typeof t[i]!="function"&&(t[i]=e[i]);if(!r){let i=Object.keys(t);for(let n of i)n in e||delete t[n]}}}function tu(){return function(t,e){Ql(t,e,OFe,AFe)}}function ru(){return function(t,e){Ql(t,e,EFe,G0)}}function Gt(){return function(t,e){Ql(t,e,IFe,G0)}}function ZW(){return function(t,e){Ql(t,e,G0,W0)}}function dn(){return function(t,e){Ql(t,e,G0,W0)}}function H0(){return function(t,e){Ql(t,e,W0,W0)}}function OFe(t,e){let r=t[e];typeof r=="string"&&(t[e]=JSON.parse(r))}function AFe(t,e){let r=t[e];typeof r=="object"&&(t[e]=JSON.stringify(r))}function IFe(t,e){let r=t[e];typeof r=="string"?t[e]=r==="true"||r==="True"||r==="1":typeof r=="number"?t[e]=r!==0:r===null&&(t[e]=!1)}function YW(t,e){let r=t[e];typeof r=="string"?t[e]=r==="true"||r==="True"||r==="1":typeof r=="number"&&(t[e]=r!==0)}function EFe(t,e){let r=t[e];typeof r=="string"?t[e]=Number.parseInt(r):typeof r=="number"?t[e]=r:r!==void 0&&(t[e]=0)}function W0(t,e){delete t[e]}function G0(t,e){}function Ot(t){return t==null?[]:Array.isArray(t)?t:[t]}function K0(t){let e=new Set(t);return Array.from(e.values())}function JW(...t){if(t.length===0)return new Set;let e=new Set;for(let r of t)if(r!=null)for(let i of r)e.add(i);return e}function k3(...t){if(t.length===0)return new Set;t=t.filter(i=>i);let e=new Set;for(let i of t[0])t.every(n=>r(i,n))&&e.add(i);function r(i,n){return n?Array.isArray(n)?n.includes(i):n.has(i):!0}return e}function XW(t,e){!t||typeof t!="object"||Array.isArray(t)||!e||Object.keys(t).forEach(r=>{let i=r;e(i,t[i],n=>t[i]=n,t)})}async function Z0(t,e,r){let i=e.batchSize??Math.max(1,Math.floor(t.length/e.maxConcurrent));if(i<=0)throw new Error("Batch size must be positive");if(t.length<=i)return r(t,0);let n=e.maxConcurrent<=1,a=[];for(let o=0;o<t.length;o+=i){let s=r(t.slice(o,o+i),Math.floor(o/i));n?await s:(a.push(Promise.resolve(s)),a.length>=e.maxConcurrent&&(await Promise.all(a),a.splice(0)))}a.length>0&&await Promise.all(a)}var QW=(0,rH.wrapper)(Th),CFe="/api/v1",eH=60*1e3,_e=class{endpointUrl;timeout=eH;notifications=void 0;apiKey=void 0;enableCookies=!0;customHeaders={};static get numPendingRequests(){return _e._numPendingRequests}static clearCookies(){var e;(e=_e.cookieJar)==null||e.removeAllCookiesSync()}static getCookies(){var e;return((e=_e.cookieJar)==null?void 0:e.toJSON())??{}}static setCookies(e){_e.cookieJar=e}static configureWithUrl(e){let r=new URL(e);_e.configureDefaults({default:{host:r.hostname,port:r.port?Number.parseInt(r.port):r.protocol==="https:"?443:80,protocol:r.protocol},services:{}})}static setBasicAuth(e,r){this.basicAuth={username:e,password:r}}static configureDefaults(e){e??={default:{},services:{}},_e.services={default:{}},r("default",e.default,{}),XW(e.services,(i,n)=>r(i,n,e.default));function r(i,n,a){typeof document=="object"?(n.protocol??=document.location.protocol.replace(/:/,""),n.host??=document.location.hostname,n.port??=document.location.port?parseInt(document.location.port):document.location.protocol==="https:"?443:80):(n.protocol??="http",n.protocol=n.protocol.replace(/:/,""),n.host??="localhost",n.port??=n.protocol==="https"?443:80),_e.services[i]={...a,baseUrl:`${n.protocol}://${n.host}:${n.port}${n.api??CFe}`,timeout:n.timeout??eH}}}constructor(e,r="default"){let i=_e.services[r]??_e.services.default;e?this.endpointUrl=r8(e.includes("://")?e:`${i.baseUrl}/${ay(e,"/")}`,"/"):this.endpointUrl=i.baseUrl,this.timeout=i.timeout}useNotificationsBase(e,r,i,n,a){this.notifications||(this.notifications=e,e.dataInserted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.insert.next(o)}),e.dataUpdated.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.update.next(o)}),e.dataDeleted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{a&&o.values.forEach(a),r.delete.next(o)}),e.dataUndeleted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.undelete.next(o)}),e.dataMapped.pipe((0,iu.filter)(o=>k3(i,o.entities).size>0)).subscribe(r.map),e.dataUnmapped.pipe((0,iu.filter)(o=>k3(i,o.entities).size>0)).subscribe(r.unmap))}async get(e,r){return this.internalRequest("get",e,void 0,r)}async post(e,r,i){return this.internalRequest("post",e,r,i)}async put(e,r,i){return this.internalRequest("put",e,r,i)}async delete(e,r,i){return this.internalRequest("delete",e,r,i)}async uploadBinary(e,r,i,n,a){try{return _e.onNumPendingChange.next(++_e._numPendingRequests),(await QW.post(`${this.endpointUrl}/${ay(e,"/")}${tH(n)}`,r,{headers:{Accept:"application/json","Content-Type":i},responseType:"json",withCredentials:!0,jar:this.enableCookies?_e.cookieJar:void 0,auth:_e.basicAuth,maxRedirects:0,onUploadProgress:a?s=>a(s.loaded??0,s.total??0):void 0})).data}catch(o){let s=this.formatError(o);throw _e.onNetworkError.next(s),s}finally{_e.onNumPendingChange.next(--_e._numPendingRequests)}}strongify(e,r,i=!0){return Array.isArray(e)?e.map(a=>this.toClassObject(a,r,i)):this.toClassObject(e,r,i)}toClassObject(e,r,i=!0){let n=new r;return qf(n,e,i),n}async internalRequest(e,r,i,n){var a;try{_e.onNumPendingChange.next(++_e._numPendingRequests),_e.cookieJar=_e.cookieJar??((a=_e.cookieJarFactory)==null?void 0:a.call(_e));let o=`${this.endpointUrl}/${ay(r,"/")}${tH(n)}`;return(await QW.request({url:o,data:i,method:e,responseType:"json",withCredentials:!0,maxRedirects:0,timeout:this.timeout,jar:this.enableCookies?_e.cookieJar:void 0,auth:_e.basicAuth,headers:{Accept:"application/json","Content-Type":"application/json","x-tab-hint":_e.tabHint,"x-wf-client":_e.clientInfo,...this.apiKey?{"x-api-key":this.apiKey}:void 0,...this.customHeaders}})).data}catch(o){let s=this.formatError(o);throw _e.onNetworkError.next(s),s}finally{_e.onNumPendingChange.next(--_e._numPendingRequests)}}formatError(e){if(e.response){let r=e.response,i=r.data;throw new Cl((i==null?void 0:i.code)??"API_INTERNAL_ERROR",(i==null?void 0:i.message)??r.statusText,r.status,i==null?void 0:i.stack,i==null?void 0:i.meta)}else throw new Cl("API_INTERNAL_ERROR",e.message??`Request failed (${e})`,0)}},Ce=_e;An(Ce,"services"),An(Ce,"basicAuth"),An(Ce,"cookieJar"),An(Ce,"cookieJarFactory"),An(Ce,"_numPendingRequests",0),An(Ce,"tabHint",ny()),An(Ce,"clientInfo","unknown"),An(Ce,"onNetworkError",new T3.Subject),An(Ce,"onNumPendingChange",new T3.Subject);Ce.configureDefaults();function tH(t){if(!t||Object.keys(t).length===0)return"";return"?"+Object.keys(t).map(r=>t[r]!==void 0?`${encodeURIComponent(r)}=${encodeURIComponent(e(t[r]))}`:"").filter(r=>r).join("&");function e(r){return Array.isArray(r)?r.map(i=>e(i)).join(","):typeof r=="string"?r:typeof r=="number"?r.toString():typeof r=="boolean"?r?"1":"0":""}}var ec=class extends Ce{constructor(e){super(e,"auth")}async login(e,r,i,n,a){return await this.post("/auth/login",{...a,email:e,password:r,tenant:i,remember:n??!1})}async getLoginInfo(e){return await this.post("/auth/login/info",{email:e})}async getTenantUserLoginStatus(){return await this.get("/auth/login/tenant-status")}async logout(){await this.post("/auth/logout",{})}async logoutAll(e){await this.post(`/auth/logout-all?keep_current=${e?"1":"0"}`,{})}async switchToTenant(e){return await this.post("/auth/switch/"+encodeURIComponent(e),{})}async changePassword(e,r,i){return await this.post("/account/changepassword",{email:e,password:r,newPassword:i})}async changeEmail(e,r,i){return await this.post("/account/changeemail",{currentEmail:e,password:r,newEmail:i})}async changeEmailConfirm(e){await this.post("/account/changeemail/confirm",{token:e})}async me(){try{return await this.get("/account/me")}catch(e){return{loggedIn:!1,requestFailed:!0,error:s8(e)}}}async updateData(e){return await this.put("/account/userdata",e)}async recover(e){await this.post("/account/recover",{email:e})}async recoverConfirm(e,r){await this.post("/account/recover/confirm/"+e,{newPassword:r})}async register(e){await this.post("/signup/register",e)}async checkTenantName(e){return await this.get("/signup/register/check/tenant/"+encodeURIComponent(e))}async checkEmail(e){return await this.get("/signup/register/check/email/"+encodeURIComponent(e))}async invite(e,r,i,n,a){await this.post("/signup/invite",{email:e,tenant:r,firstName:a==null?void 0:a.firstName,lastName:a==null?void 0:a.lastName,initialRoleId:i,initialRoleProjectId:n})}async uninvite(e,r){await this.post("/signup/uninvite",{email:e,tenant:r})}async getInviteInfo(e){return await this.get("/signup/invite/info/"+encodeURIComponent(e))}async getRegisterInfo(e){return await this.get("/signup/register/info/"+encodeURIComponent(e))}async registerConfirm(e,r){await this.post("/signup/register/confirm/"+encodeURIComponent(e),r)}async inviteConfirm(e){await this.post("/signup/invite/confirm",{token:e})}async inviteConfirmCreate(e,r,i,n,a){await this.post("/signup/invite/confirm",{token:e,userDisplayName:n,newPassword:a,firstName:r,lastName:i})}async resend(e){await this.post("/signup/register/confirm-resend",{email:e})}};var Cr=X(ot());var st=X(ot());var uH=X(ot());function Tr(t,e){return new pn(t??"schema",!0,e)}var Zn=class extends Error{constructor(e){super(e)}},se=class extends Zn{constructor(r,i){super(`${r} at ${i.join(".")}`);this.path=i}},oH=Symbol("JsonSchema"),O3=Symbol("JsonPublishedSchema");function iH(t,e){return t[oH]=!0,t[O3]=e,t}var pn=class{constructor(e,r,i){this.name=e;this.isPublished=r;if(i){this.allowExtra=i.allowExtra,this.validator=i.validator,this.allowOverride=!0;for(let[n,a]of i.specs.entries())this.specs.set(n,a)}this.validator=this.createObjectValidator(this),this.jsonSchema=iH({type:"object",title:r?e:void 0,properties:{}},r)}specs=new Map;validator;allowExtra=!1;allowOverride=!1;contextProp;jsonSchema;object(e,r){let i,n;typeof e=="function"?(i="",n=e):(i=e,n=r);let a=new pn(i,!1);return n(a),this.updateJsonSchema(i,!0,a.jsonSchema),this.setupValidationFunc(i,this.createObjectValidator(a)),this.contextProp=i,this}record(e,r,i){let n,a,o;typeof e=="string"?(n=e,typeof r=="function"&&typeof i!="function"?(a=void 0,o=r):(a=r,o=i)):(n="",typeof e=="function"&&typeof r!="function"?(a=void 0,o=e):(a=e,o=r));let s=new pn(n+"_record",!1);return this.setupValidationFunc(n,this.createRecordValidator(a,s)),o(s),this.updateJsonSchema(n,!0,{type:"object",additionalProperties:s.jsonSchema,properties:{}}),this}array(e,r,i){let n="",a,o,s;return typeof e=="function"||Array.isArray(e)?(n="",a=e,s=r):typeof r=="function"||Array.isArray(r)?(n=e,a=r,s=i):typeof e=="object"&&!Array.isArray(e)?(n="",o=e,s=r):typeof r=="object"&&!Array.isArray(r)&&(n=e,o=r,s=i),this.setupArray(n,a,s,o,!1),this.contextProp=n,this}arrayOrOne(e,r,i){let n="",a,o,s;return typeof e=="function"?(n="",a=e,s=r):typeof r=="function"?(n=e,a=r,s=i):typeof e=="object"?(n="",o=e,s=r):typeof r=="object"&&(n=e,o=r,s=i),this.setupArrayOrOne(n,a,s,o,!1),this.contextProp=n,this}string(e,r,i){let n,a,o,s;return typeof e=="string"?(n=e,u(r),typeof i=="object"&&(a=i)):(n="",u(e),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createStringValidator(a,s,o)),this.updateJsonSchema(n,!0,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values,minLength:a==null?void 0:a.minLen,maxLength:a==null?void 0:a.maxLen}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(s=l),typeof l=="function"&&(o=l),typeof l=="object"&&(a=l)}}number(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createNumberValidator(n,a)),this.updateJsonSchema(i,!0,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}integer(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createNumberValidator({...n,integer:!0},a)),this.updateJsonSchema(i,!0,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}bool(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(void 0)),this.updateJsonSchema(r,!0,{type:"boolean"}),this.contextProp=r,this}basic(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBasicValueValidator()),this.updateJsonSchema(r,!0,{nullable:!0,oneOf:[{type:"string"},{type:"number"},{type:"boolean"}]}),this.contextProp=r,this}is(e,r){let i,n;typeof e=="string"?(i=[e],n=r):Array.isArray(e)?(i=e,n=r):(i=[""],n=e);for(let a of i)this.setupValidationFunc(a,n.validator),this.updateJsonSchema(a,!0,n.jsonSchema);return i.length===1&&(this.contextProp=i[0]),this}objectOpt(e,r){let i,n;typeof e=="function"?(i="",n=e):(i=e,n=r);let a=new pn(i,!1);return n(a),this.setupValidationFunc(i,this.createOptValidator(this.createObjectValidator(a))),this.updateJsonSchema(i,!1,a.jsonSchema),this.contextProp=i,this}recordOpt(e,r,i){let n,a,o;typeof e=="string"?(n=e,typeof r=="function"&&typeof i!="function"?(a=void 0,o=r):(a=r,o=i)):(n="",typeof e=="function"&&typeof r!="function"?(a=void 0,o=e):(a=e,o=r));let s=new pn(n+"_record",!1);return this.setupValidationFunc(n,this.createOptValidator(this.createRecordValidator(a,s))),this.updateJsonSchema(n,!1,{type:"object",additionalProperties:s.jsonSchema,properties:{}}),o(s),this}arrayOpt(e,r,i){let n="",a,o,s;return typeof e=="function"||Array.isArray(e)?(n="",a=e,s=r):typeof r=="function"||Array.isArray(r)?(n=e,a=r,s=i):typeof e=="object"&&!Array.isArray(e)?(n="",o=e,s=r):typeof r=="object"&&!Array.isArray(r)&&(n=e,o=r,s=i),this.setupArray(n,a,s,o,!0),this.contextProp=n,this}arrayOrOneOpt(e,r,i){let n="",a,o,s;return typeof e=="function"?(n="",a=e,s=r):typeof r=="function"?(n=e,a=r,s=i):typeof e=="object"?(n="",o=e,s=r):typeof r=="object"&&(n=e,o=r,s=i),this.setupArrayOrOne(n,a,s,o,!0),this.contextProp=n,this}stringOpt(e,r,i){let n,a,o,s;return typeof e=="string"?(n=e,u(r),typeof i=="object"&&(a=i)):(n="",u(e),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createOptValidator(this.createStringValidator(a,s,o))),this.updateJsonSchema(n,!1,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(s=l),typeof l=="function"&&(o=l),typeof l=="object"&&(a=l)}}numberOpt(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator(n,a))),this.updateJsonSchema(i,!1,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}integerOpt(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator({...n,integer:!0},a))),this.updateJsonSchema(i,!1,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}boolOpt(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createOptValidator(this.createBooleanValidator(void 0))),this.updateJsonSchema(r,!1,{type:"boolean"}),this.contextProp=r,this}optIs(e,r){let i,n;return typeof e=="string"?(i=e,n=r):(i="",n=e),this.setupValidationFunc(i,this.createOptValidator(n.validator)),this.updateJsonSchema(i,!1,n.jsonSchema),this.contextProp=i,this}isTrue(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(!0)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!0]}),this.contextProp=r,this}isFalse(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(!1)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!1]}),this.contextProp=r,this}isNull(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createNullValidator()),this.updateJsonSchema(r,!0,{type:"string",nullable:!0,maxLength:0}),this.contextProp=r,this}isNotDefined(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createUndefinedValidator()),this.updateJsonSchema(r,!1,{not:{required:[r]}}),this.contextProp=r,this}isAny(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createAnyValidator()),this.updateJsonSchema(r,!1,{}),this.contextProp=r,this}allowExtraProps(){return this.allowExtra=!0,this}oneOf(...e){let r,i;if(typeof e[0]=="string"?(r=e[0],i=e.slice(1)):(r="",i=e),i.length===0)throw new Zn(`Must specify at least one alternative for prop '${r}'`);let n=i.map((a,o)=>{let s=new pn(`alt${o}`,!1);return a(s),s});return this.setupValidationFunc(r,this.createAlternativesValidator(n.map(a=>a.validator))),this.updateJsonSchema(r,!0,{oneOf:n.map(a=>a.jsonSchema)}),this.contextProp=r,this}build(){return this.contextProp=void 0,this}setupValidationFunc(e,r){if(e){if(!this.allowOverride&&this.specs.has(e))throw new Zn(`Property '${e}' is already defined`);this.specs.set(e,r)}else{if(this.specs.size>0)throw new Zn("Cannot replace schema root if props have defined previously");this.validator=r}}setupArray(e,r,i,n,a){if(r){let o=Array.isArray(r)?r:[r];if(o.length===0)throw new Zn("Element definitions must contain at least one schema");let s=[];for(let l of o){let d=new pn(`${e}_element`,!1);if(l(d),!d.validator)throw new Zn(`Missing root definition in array element schema (at '${e}')`);s.push(d)}let u=this.createArrayValidator(s,i??{});this.setupValidationFunc(e,a?this.createOptValidator(u):u),o.length===1?this.updateJsonSchema(e,!a,{type:"array",items:s[0].jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}):this.updateJsonSchema(e,!a,{type:"array",prefixItems:s.map(l=>l.jsonSchema),items:!1,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}else if(n){let o=this.createArrayValidator([n],i??{});this.setupValidationFunc(e,a?this.createOptValidator(o):o),this.updateJsonSchema(e,!a,{type:"array",items:n.jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}}setupArrayOrOne(e,r,i,n,a){let o;if(r){let s=new pn(`${e}_element`,!1);if(r(s),!s.validator)throw new Zn(`Missing root definition in array element schema (at '${e}')`);let u=this.createArrayOrOneValidator(s,i??{});o=s.jsonSchema,this.setupValidationFunc(e,a?this.createOptValidator(u):u)}else if(n){let s=this.createArrayOrOneValidator(n,i??{});this.setupValidationFunc(e,a?this.createOptValidator(s):s),o=n.jsonSchema}else throw new Error("Internal error - No definition or nested schema");this.updateJsonSchema(e,!a,{oneOf:[o,{type:"array",items:o,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}]})}assertContextProp(){let e=this.contextProp,r=this.specs.get(e);if(!e||!r)throw new Zn("Missing previously defined property for opt()");return{prop:e,spec:r}}doc(e,r){if(this.contextProp&&this.jsonSchema.type==="object"){this.jsonSchema.properties??={};let i=this.jsonSchema.properties[this.contextProp];i.description=e,i.default=r}else this.contextProp||(this.jsonSchema.description=e,this.jsonSchema.default=r);return this}validate(e,r){return this.validator(e,{depth:0,maxDepth:(r==null?void 0:r.maxDepth)??100,path:[this.name],allowCycles:(r==null?void 0:r.allowCycles)??!1,seen:[new Set]},!1),e}toJsonSchema(e){let r=this.jsonSchema;return JSON.parse(JSON.stringify(this.jsonSchema,(i,n)=>{if(typeof n=="object"&&n[oH]){let a=n;if(n===r)return i?{$ref:"#"}:n;if(n[O3])return{$ref:e+a.title}}return n}))}createObjectValidator(e){return function(i,n,a){if(typeof i!="object"||i===null){if(a)return!1;throw new se("Expected object",n.path)}nH(i,n);let o=n.seen.at(-1);o&&o.add(i);for(let[s,u]of e.specs.entries()){let l=i[s];if(o&&l!==null&&typeof l=="object"&&o.has(l)){if(!n.allowCycles)throw new se("Cycle detected",[...n.path,s]);continue}n.path.push(s),n.depth++;try{if(n.depth>n.maxDepth)throw new se("Maximum object depth reached",n.path);if(!u(l,n,a))return!1}finally{n.path.pop(),n.depth--}}if(!e.allowExtra){for(let s of Object.keys(i))if(!e.specs.get(s)){if(a)return!1;throw new se(`Unexpected object property '${s}'`,n.path)}}return!0}}createRecordValidator(e,r){let i=e instanceof RegExp?n=>e.test(n):e;return function(a,o,s){if(typeof a!="object"||a===null){if(s)return!1;throw new se("Expected record object",o.path)}nH(a,o);let u=o.seen.at(-1);u&&u.add(a);for(let l of Object.keys(a)){if(i&&!i(l)){if(s)return!1;throw new se(`Unexpected record property name '${l}' not matching '${i.name||"propValidator"}'`,o.path)}let d=a[l];if(u&&d!==null&&typeof d=="object"&&u.has(d)){if(!o.allowCycles)throw new se("Cycle detected",[...o.path,l]);continue}o.path.push(l),o.depth++;try{if(o.depth>o.maxDepth)throw new se("Maximum object depth reached",o.path);let p=r.validator;if(!p(d,o,s))return!1}finally{o.path.pop(),o.depth--}}return!0}}createArrayValidator(e,r){return function(n,a,o){if(!Array.isArray(n)){if(o)return!1;throw new se("Expected array",a.path)}if(r){if(r.len!==void 0&&r.len!==n.length){if(o)return!1;throw new se(`Expected array length ${r.len} but actual is ${n.length}`,a.path)}if(r.minLen!==void 0&&r.minLen>n.length){if(o)return!1;throw new se(`Expected minimum array length ${r.minLen} but actual is ${n.length}`,a.path)}if(r.maxLen!==void 0&&r.maxLen<n.length){if(o)return!1;throw new se(`Expected maximum array length ${r.maxLen} but actual is ${n.length}`,a.path)}}let s=a.seen.at(-1);s&&s.add(n);let u=e.at(-1),l=e.length===1?n.length:Math.max(e.length,n.length);for(let d=0;d<l;d++){let p=n[d];if(s&&p!==null&&typeof p=="object"&&s.has(p)){if(!a.allowCycles)throw new se("Cycle detected",[...a.path,d.toString()]);continue}a.path.push(d.toString()),a.depth++;try{if(a.depth>a.maxDepth)throw new se("Maximum object depth reached",a.path);let f=(e[d]??u).validator;if(!f(p,a,o))return!1}finally{a.path.pop(),a.depth--}}return!0}}createStringValidator(e,r,i){return function(a,o,s){if(typeof a!="string")if(e!=null&&e.allowToString)a=`${a}`;else{if(s)return!1;throw new se("Expected string",o.path)}if(typeof a!="string")return!1;if(e){if(e.len!==void 0&&e.len!==a.length){if(s)return!1;throw new se(`Expected string length ${e.len} but actual is ${a.length}`,o.path)}if(e.minLen!==void 0&&e.minLen>a.length){if(s)return!1;throw new se(`Expected string min length ${e.minLen} but actual is ${a.length}`,o.path)}if(e.maxLen!==void 0&&e.maxLen<a.length){if(s)return!1;throw new se(`Expected string max length ${e.maxLen} but actual is ${a.length}`,o.path)}if(e.values&&!e.values.includes(a)){if(s)return!1;throw new se(`String must have one of the allowed values: ${e.values.join("|")}`,o.path)}if(e.value&&e.value!==a){if(s)return!1;throw new se(`String must have the following value: '${e.value}'`,o.path)}}if(r&&!r.test(a)){if(s)return!1;throw new se(`Value '${o8(a,200)}' does not match required regular expression`,o.path)}if(i){let u=aH(i,a);if(u){if(s)return!1;throw new se(`Invalid string: ${u}`,o.path)}}return!0}}createNumberValidator(e,r){return function(n,a,o){if(typeof n!="number"){if(o)return!1;throw new se("Expected number",a.path)}if(e){if(e.integer&&!Number.isSafeInteger(n)){if(o)return!1;throw new se(`Expected integer number but actual is ${n}`,a.path)}if(e.positive&&n<=0){if(o)return!1;throw new se(`Expected number with positive value but actual is ${n}`,a.path)}if(e.nonNegative&&n<0){if(o)return!1;throw new se(`Expected number with non-negative value but actual is ${n}`,a.path)}if(e.min!==void 0&&e.min>n){if(o)return!1;throw new se(`Expected number min value ${e.min} but actual is ${n}`,a.path)}if(e.max!==void 0&&e.max<n){if(o)return!1;throw new se(`Expected number max value ${e.max} but actual is ${n}`,a.path)}if(e.allowNotFinite!==!0&&!Number.isFinite(n)){if(o)return!1;throw new se(`Expected number with finite value but actual is ${n}`,a.path)}if(e.negative&&n>=0){if(o)return!1;throw new se(`Expected number with negative value but actual is ${n}`,a.path)}if(e.values&&!e.values.includes(n)){if(o)return!1;throw new se(`Number must have one of the allowed values: ${e.values.join("|")}`,a.path)}}if(r){let s=aH(r,n);if(s){if(o)return!1;throw new se(`Invalid number: ${s}`,a.path)}}return!0}}createBooleanValidator(e){return function(i,n,a){if(typeof i!="boolean"){if(a)return!1;throw new se("Expected boolean",n.path)}let o=e===void 0||i===e;if(!o&&!a)throw new se(`Expected boolean value ${e}`,n.path);return o}}createNullValidator(){return function(r,i,n){if(r!==null){if(n)return!1;throw new se("Expected null",i.path)}return!0}}createUndefinedValidator(){return function(r,i,n){if(r!==void 0){if(n)return!1;throw new se("Expected undefined",i.path)}return!0}}createBasicValueValidator(){return function(r,i,n){let a=typeof r;if(a!=="string"&&a!=="number"&&a!=="boolean"&&r!==null){if(n)return!1;throw new se("Expected basic value",i.path)}return!0}}createAnyValidator(){return function(r,i,n){return!0}}createOptValidator(e){return function(i,n,a){return i===void 0?!0:e(i,n,a)}}createOrNullValidator(e){return function(i,n,a){return i===null?!0:e(i,n,a)}}createOptOrNullValidator(e){return function(i,n,a){return i==null?!0:e(i,n,a)}}createAlternativesValidator(e){return function(i,n,a){let o=[];for(let s of e)try{if(n.seen&&n.seen.push(new Set),s(i,n,!0))return!0}finally{n.seen&&n.seen.pop()}if(a)return!1;for(let s of e)try{s(i,n,!1)}catch(u){o.push(u.message)}throw new se(`Validation failed because no alternatives match: '${o.join(", ")}'`,n.path)}}createArrayOrOneValidator(e,r){let i=this.createArrayValidator([e],r),n=e.validator;return function(o,s,u){if(Array.isArray(o)){if(!i(o,s,u))return!1}else if(!n(o,s,u))return!1;return!0}}updateJsonSchema(e,r,i){if(e){let n=this.jsonSchema;if(n.type!=="object")throw new Error("Internal error: wrong json schema base type: "+n.type);n.properties??={},n.properties[e]=i,r&&(n.required??=[],n.required.push(e))}else{let n=this.jsonSchema.title;this.jsonSchema=iH(i,!!i[O3]),this.jsonSchema.title??=n}}};function nH(t,e){if(Object.prototype.hasOwnProperty.call(t,"__proto__")||t.prototype!==void 0)throw new se("Unexpected forbidden prototype property",e.path)}function aH(t,e){try{let r=t(e);if(r===!1)throw new Error(`'${t.name||"Value"}' validation failed`);if(Array.isArray(r))throw new Error(r.join(", "));if(typeof r=="string")throw new Error(r)}catch(r){return r.message}}var Y0=["eq","not_eq","like","not_like","in","not_in","like_in","not_like_in","gt","lt","lte","gte","range"];var At=t=>/^[$a-z][$a-z0-9_.]*$/i.test(t)&&!Xl.has(t),tc=t=>!Xl.has(t),PFe=t=>!Xl.has(t),Rf=t=>typeof t=="string"&&t.length===24&&t[23]==="Z"&&(0,uH.isISO8601)(t),sH=Tr("ByKeysValue").basic().doc("Any basic JSON value (string, number, boolean, null)"),jFe=Tr("FkIds").record(PFe,t=>t.integer()).doc("Entity ids for mapped entities, e.g. testcase_id"),io=Tr("ByKeys");io.record(At,t=>t.oneOf(e=>e.arrayOrOne(sH),e=>e.object(r=>r.string("op",{values:Y0}).doc("The comparison/matching operation to perform on the value: "+Y0.join(", ")).arrayOrOne("value",sH).doc("The target value(s) or pattern").isNotDefined("col")),e=>e.object(r=>r.string("op",{values:Y0}).doc("The comparison/matching operation to perform on the value: "+Y0.join(", ")).isNotDefined("value").string("col",At).doc("The target column/prop name (instead of fixed value)")),e=>e.arrayOrOne(io))).doc("Describes matching/filtering conditions");var A3=Tr("MapJoin");A3.arrayOrOneOpt("entities",t=>t.string(tc,{allowToString:!0})).doc("The list of entity names which are part of the mapping (for mapping relationship tables)").stringOpt("entity",tc,{allowToString:!0}).doc("The entity name (for direct mapping via a foreign key)").arrayOrOneOpt("ids",t=>t.is(jFe)).doc("A list of id tuples to filter by").boolOpt("inverse").doc("Inverts the result to retrieve non-mapped entities",!1).optIs("filter",io).doc("The filter expression applied to the mapping relationship entity").optIs("resultFilter",io).doc("The filter expression applied to the result entity (if 'result' is set)").boolOpt("countOnly").doc("Only returns a count instead of a list of entities",!1).boolOpt("idOnly").doc("Only retrieves entity ids, omitting all other columns",!1).boolOpt("optional").doc("Indicates that the mapping is optional and may be 'null' in the result",!1).boolOpt("includeDeleted").doc("Includes deleted member entities in the mapping search result",!1).boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).boolOpt("omit").doc("Omit the mapping result from result entities - For intermediate nested mappings").stringOpt("result",tc,{allowToString:!0}).doc("The entity to use as the result instead of the mapping relationship entity data").arrayOrOneOpt("map",A3).doc("Nested mapping starting from one of the member entities of this mapping");var lH=Tr("DataReadParams").objectOpt("pagination",t=>t.integerOpt("offset").doc("The offset the result starts at",0).integerOpt("pageAtId").doc("Selects the page with the given id in the result, given a limit (= page size)").integerOpt("inflate").doc("Adds a number of items before the start offset and after the limit (for pagination use)").integerOpt("limit").doc("The maximum number of result rows")).doc("Pagination settings control how much data from a result is fetched").arrayOpt("order",t=>t.oneOf(e=>e.string("order",{value:"seq"}).doc("Ordering by a pre-defined value sequence - the partial ordering of the given values in the result is preserved").string("column",At).doc("The name of the column to order by").array("seq",r=>r.number()),e=>e.string("column",At).doc("The name of the column to order by").string("order",{values:["asc","desc"]}).doc("Either 'asc'ending or 'desc'ending order for the given column"))).doc("Controls the ordering of the result").boolOpt("includeTotalCount").doc("Includes the total result count if pagination options were given").optIs("filter",io).doc("Filter/search terms").arrayOpt("computedColumns",t=>t.string(At)).doc("List of computed columns to include (by default includes all)").integerOpt("id",{nonNegative:!0}).doc("Only return the entity with the given id, returns one or none").arrayOpt("ids",t=>t.integer({nonNegative:!0})).doc("Only return the entities with the given ids").arrayOrOneOpt("map",A3).doc("Map expression to expand properties or relationships with other entities").boolOpt("includeDeleted").doc("Includes soft-deleted entitites in the result (if applicable)").boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).stringOpt("asOf",Rf).doc("Perform a history query given the asOf timestamp (if available)").boolOpt("idOnly").doc("Only returns ids in the result, omitting all other properties").boolOpt("countOnly").doc("Returns only the length of the result list instead of the result list itself").build(),Het=Tr("WithId").integer("id").doc("The unique entity id").allowExtraProps();function I3(t){let e=t;return e.ctors?e.ctors.map(r=>r.entityName).sort():Array.isArray(t)?t.map(r=>typeof r!="string"?r.entityName:r).sort():typeof t!="string"?t.entityName:t}var E3=0,$Fe=2147483647;function J0(t){return t!==void 0&&Number.isSafeInteger(t)&&t<=$Fe&&t!==E3}var Lf="_traits";function no(t){return t[Lf]=t[Lf]??[],t[Lf].push(t),t}function Bf(t,e){let r=t[Lf]??t.constructor[Lf];return r?r.find&&!!r.find(i=>i.name===e.name):!1}var ao=class extends Error{},X0=class extends ao{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},Q0=class extends ao{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},e1=class extends ao{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},oo=class extends ao{},rc=class extends ao{constructor(e){super(`Invalid unit ${e}`)}},It=class extends ao{},fn=class extends ao{constructor(){super("Zone is an abstract class")}};var F="numeric",mn="short",vr="long",ds={year:F,month:F,day:F},Vf={year:F,month:mn,day:F},C3={year:F,month:mn,day:F,weekday:mn},Uf={year:F,month:vr,day:F},zf={year:F,month:vr,day:F,weekday:vr},Wf={hour:F,minute:F},Hf={hour:F,minute:F,second:F},Gf={hour:F,minute:F,second:F,timeZoneName:mn},Kf={hour:F,minute:F,second:F,timeZoneName:vr},Zf={hour:F,minute:F,hourCycle:"h23"},Yf={hour:F,minute:F,second:F,hourCycle:"h23"},Jf={hour:F,minute:F,second:F,hourCycle:"h23",timeZoneName:mn},Xf={hour:F,minute:F,second:F,hourCycle:"h23",timeZoneName:vr},Qf={year:F,month:F,day:F,hour:F,minute:F},em={year:F,month:F,day:F,hour:F,minute:F,second:F},tm={year:F,month:mn,day:F,hour:F,minute:F},rm={year:F,month:mn,day:F,hour:F,minute:F,second:F},P3={year:F,month:mn,day:F,weekday:mn,hour:F,minute:F},im={year:F,month:vr,day:F,hour:F,minute:F,timeZoneName:mn},nm={year:F,month:vr,day:F,hour:F,minute:F,second:F,timeZoneName:mn},am={year:F,month:vr,day:F,weekday:vr,hour:F,minute:F,timeZoneName:vr},om={year:F,month:vr,day:F,weekday:vr,hour:F,minute:F,second:F,timeZoneName:vr};var nr=class{get type(){throw new fn}get name(){throw new fn}get ianaName(){return this.name}get isUniversal(){throw new fn}offsetName(e,r){throw new fn}formatOffset(e,r){throw new fn}offset(e){throw new fn}equals(e){throw new fn}get isValid(){throw new fn}};var j3=null,Yn=class extends nr{static get instance(){return j3===null&&(j3=new Yn),j3}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return r1(e,r,i)}formatOffset(e,r){return ps(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}};var n1={};function MFe(t){return n1[t]||(n1[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),n1[t]}var NFe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function DFe(t,e){let r=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,a,o,s,u,l,d]=i;return[o,n,a,s,u,l,d]}function FFe(t,e){let r=t.formatToParts(e),i=[];for(let n=0;n<r.length;n++){let{type:a,value:o}=r[n],s=NFe[a];a==="era"?i[s]=o:ue(s)||(i[s]=parseInt(o,10))}return i}var i1={},yt=class extends nr{static create(e){return i1[e]||(i1[e]=new yt(e)),i1[e]}static resetCache(){i1={},n1={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=yt.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return r1(e,r,i,this.name)}formatOffset(e,r){return ps(this.offset(e),r)}offset(e){let r=new Date(e);if(isNaN(r))return NaN;let i=MFe(this.name),[n,a,o,s,u,l,d]=i.formatToParts?FFe(i,r):DFe(i,r);s==="BC"&&(n=-Math.abs(n)+1);let f=sm({year:n,month:a,day:o,hour:u===24?0:u,minute:l,second:d,millisecond:0}),m=+r,g=m%1e3;return m-=g>=0?g:1e3+g,(f-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}};var cH={};function qFe(t,e={}){let r=JSON.stringify([t,e]),i=cH[r];return i||(i=new Intl.ListFormat(t,e),cH[r]=i),i}var $3={};function M3(t,e={}){let r=JSON.stringify([t,e]),i=$3[r];return i||(i=new Intl.DateTimeFormat(t,e),$3[r]=i),i}var N3={};function RFe(t,e={}){let r=JSON.stringify([t,e]),i=N3[r];return i||(i=new Intl.NumberFormat(t,e),N3[r]=i),i}var D3={};function LFe(t,e={}){let{base:r,...i}=e,n=JSON.stringify([t,i]),a=D3[n];return a||(a=new Intl.RelativeTimeFormat(t,e),D3[n]=a),a}var um=null;function BFe(){return um||(um=new Intl.DateTimeFormat().resolvedOptions().locale,um)}function VFe(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let i,n;try{i=M3(t).resolvedOptions(),n=t}catch{let u=t.substring(0,r);i=M3(u).resolvedOptions(),n=u}let{numberingSystem:a,calendar:o}=i;return[n,a,o]}}function UFe(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function zFe(t){let e=[];for(let r=1;r<=12;r++){let i=H.utc(2016,r,1);e.push(t(i))}return e}function WFe(t){let e=[];for(let r=1;r<=7;r++){let i=H.utc(2016,11,13+r);e.push(t(i))}return e}function a1(t,e,r,i,n){let a=t.listingMode(r);return a==="error"?null:a==="en"?i(e):n(e)}function HFe(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var F3=class{constructor(e,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:a,...o}=i;if(!r||Object.keys(o).length>0){let s={useGrouping:!1,...i};i.padTo>0&&(s.minimumIntegerDigits=i.padTo),this.inf=RFe(e,s)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):ic(e,3);return Ke(r,this.padTo)}}},q3=class{constructor(e,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let o=-1*(e.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&yt.create(s).valid?(n=s,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=M3(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},R3=class{constructor(e,r,i){this.opts={style:"long",...i},!r&&o1()&&(this.rtf=LFe(e,i))}format(e,r){return this.rtf?this.rtf.format(e,r):dH(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},xe=class{static fromOpts(e){return xe.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,r,i,n=!1){let a=e||Te.defaultLocale,o=a||(n?"en-US":BFe()),s=r||Te.defaultNumberingSystem,u=i||Te.defaultOutputCalendar;return new xe(o,s,u,a)}static resetCache(){um=null,$3={},N3={},D3={}}static fromObject({locale:e,numberingSystem:r,outputCalendar:i}={}){return xe.create(e,r,i)}constructor(e,r,i,n){let[a,o,s]=VFe(e);this.locale=a,this.numberingSystem=r||o||null,this.outputCalendar=i||s||null,this.intl=UFe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=HFe(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:xe.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1,i=!0){return a1(this,e,i,L3,()=>{let n=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=zFe(o=>this.extract(o,n,"month"))),this.monthsCache[a][e]})}weekdays(e,r=!1,i=!0){return a1(this,e,i,B3,()=>{let n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=r?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=WFe(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[a][e]})}meridiems(e=!0){return a1(this,void 0,e,()=>V3,()=>{if(!this.meridiemCache){let r={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[H.utc(2016,11,13,9),H.utc(2016,11,13,19)].map(i=>this.extract(i,r,"dayperiod"))}return this.meridiemCache})}eras(e,r=!0){return a1(this,e,r,U3,()=>{let i={era:e};return this.eraCache[e]||(this.eraCache[e]=[H.utc(-40,1,1),H.utc(2017,1,1)].map(n=>this.extract(n,i,"era"))),this.eraCache[e]})}extract(e,r,i){let n=this.dtFormatter(e,r),a=n.formatToParts(),o=a.find(s=>s.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new F3(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new q3(e,this.intl,r)}relFormatter(e={}){return new R3(this.intl,this.isEnglish(),e)}listFormatter(e={}){return qFe(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}};var W3=null,Ze=class extends nr{static get utcInstance(){return W3===null&&(W3=new Ze(0)),W3}static instance(e){return e===0?Ze.utcInstance:new Ze(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new Ze(nu(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ps(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ps(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return ps(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}};var nc=class extends nr{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function hn(t,e){let r;if(ue(t)||t===null)return e;if(t instanceof nr)return t;if(pH(t)){let i=t.toLowerCase();return i==="default"?e:i==="local"||i==="system"?Yn.instance:i==="utc"||i==="gmt"?Ze.utcInstance:Ze.parseSpecifier(i)||yt.create(t)}else return Jn(t)?Ze.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new nc(t)}var fH=()=>Date.now(),mH="system",hH=null,gH=null,vH=null,bH=60,yH,Te=class{static get now(){return fH}static set now(e){fH=e}static set defaultZone(e){mH=e}static get defaultZone(){return hn(mH,Yn.instance)}static get defaultLocale(){return hH}static set defaultLocale(e){hH=e}static get defaultNumberingSystem(){return gH}static set defaultNumberingSystem(e){gH=e}static get defaultOutputCalendar(){return vH}static set defaultOutputCalendar(e){vH=e}static get twoDigitCutoffYear(){return bH}static set twoDigitCutoffYear(e){bH=e%100}static get throwOnInvalid(){return yH}static set throwOnInvalid(e){yH=e}static resetCaches(){xe.resetCache(),yt.resetCache()}};function ue(t){return typeof t>"u"}function Jn(t){return typeof t=="number"}function lm(t){return typeof t=="number"&&t%1===0}function pH(t){return typeof t=="string"}function _H(t){return Object.prototype.toString.call(t)==="[object Date]"}function o1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function xH(t){return Array.isArray(t)?t:[t]}function H3(t,e,r){if(t.length!==0)return t.reduce((i,n)=>{let a=[e(n),n];return i&&r(i[0],a[0])===i[0]?i:a},null)[1]}function SH(t,e){return e.reduce((r,i)=>(r[i]=t[i],r),{})}function fs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xn(t,e,r){return lm(t)&&t>=e&&t<=r}function GFe(t,e){return t-e*Math.floor(t/e)}function Ke(t,e=2){let r=t<0,i;return r?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function so(t){if(!(ue(t)||t===null||t===""))return parseInt(t,10)}function ms(t){if(!(ue(t)||t===null||t===""))return parseFloat(t)}function cm(t){if(!(ue(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function ic(t,e,r=!1){let i=10**e;return(r?Math.trunc:Math.round)(t*i)/i}function au(t){return t%4===0&&(t%100!==0||t%400===0)}function ou(t){return au(t)?366:365}function ac(t,e){let r=GFe(e-1,12)+1,i=t+(e-r)/12;return r===2?au(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function sm(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function oc(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,r=t-1,i=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return e===4||i===3?53:52}function dm(t){return t>99?t:t>Te.twoDigitCutoffYear?1900+t:2e3+t}function r1(t,e,r,i=null){let n=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(a.timeZone=i);let o={timeZoneName:e,...a},s=new Intl.DateTimeFormat(r,o).formatToParts(n).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function nu(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let i=parseInt(e,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function G3(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new It(`Invalid unit value ${t}`);return e}function sc(t,e){let r={};for(let i in t)if(fs(t,i)){let n=t[i];if(n==null)continue;r[e(i)]=G3(n)}return r}function ps(t,e){let r=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${Ke(r,2)}:${Ke(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${Ke(r,2)}${Ke(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pm(t){return SH(t,["hour","minute","second","millisecond"])}var KFe=["January","February","March","April","May","June","July","August","September","October","November","December"],K3=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ZFe=["J","F","M","A","M","J","J","A","S","O","N","D"];function L3(t){switch(t){case"narrow":return[...ZFe];case"short":return[...K3];case"long":return[...KFe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Z3=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Y3=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],YFe=["M","T","W","T","F","S","S"];function B3(t){switch(t){case"narrow":return[...YFe];case"short":return[...Y3];case"long":return[...Z3];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var V3=["AM","PM"],JFe=["Before Christ","Anno Domini"],XFe=["BC","AD"],QFe=["B","A"];function U3(t){switch(t){case"narrow":return[...QFe];case"short":return[...XFe];case"long":return[...JFe];default:return null}}function wH(t){return V3[t.hour<12?0:1]}function kH(t,e){return B3(e)[t.weekday-1]}function TH(t,e){return L3(e)[t.month-1]}function OH(t,e){return U3(e)[t.year<0?0:1]}function dH(t,e,r="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){let p=t==="days";switch(e){case 1:return p?"tomorrow":`next ${n[t][0]}`;case-1:return p?"yesterday":`last ${n[t][0]}`;case 0:return p?"today":`this ${n[t][0]}`;default:}}let o=Object.is(e,-0)||e<0,s=Math.abs(e),u=s===1,l=n[t],d=i?u?l[1]:l[2]||l[1]:u?n[t][0]:t;return o?`${s} ${d} ago`:`in ${s} ${d}`}function AH(t,e){let r="";for(let i of t)i.literal?r+=i.val:r+=e(i.val);return r}var eqe={D:ds,DD:Vf,DDD:Uf,DDDD:zf,t:Wf,tt:Hf,ttt:Gf,tttt:Kf,T:Zf,TT:Yf,TTT:Jf,TTTT:Xf,f:Qf,ff:tm,fff:im,ffff:am,F:em,FF:rm,FFF:nm,FFFF:om},Ye=class{static create(e,r={}){return new Ye(e,r)}static parseFormat(e){let r=null,i="",n=!1,a=[];for(let o=0;o<e.length;o++){let s=e.charAt(o);s==="'"?(i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),r=null,i="",n=!n):n||s===r?i+=s:(i.length>0&&a.push({literal:/^\s+$/.test(i),val:i}),i=s,r=s)}return i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),a}static macroTokenToFormatOpts(e){return eqe[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTime(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTimeParts(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).formatToParts()}formatInterval(e,r={}){return this.loc.dtFormatter(e.start,{...this.opts,...r}).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).resolvedOptions()}num(e,r=0){if(this.opts.forceSimple)return Ke(e,r);let i={...this.opts};return r>0&&(i.padTo=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,r){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(m,g)=>this.loc.extract(e,m,g),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",s=()=>i?wH(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,g)=>i?TH(e,m):a(g?{month:m}:{month:m,day:"numeric"},"month"),l=(m,g)=>i?kH(e,m):a(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),d=m=>{let g=Ye.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},p=m=>i?OH(e,m):a({era:m},"era"),f=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(m)}};return AH(Ye.parseFormat(r),f)}formatDurationFromString(e,r){let i=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=u=>l=>{let d=i(l);return d?this.num(u.get(d),l.length):l},a=Ye.parseFormat(r),o=a.reduce((u,{literal:l,val:d})=>l?u:u.concat(d),[]),s=e.shiftTo(...o.map(i).filter(u=>u));return AH(a,n(s))}};var Et=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var EH=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function lc(...t){let e=t.reduce((r,i)=>r+i.source,"");return RegExp(`^${e}$`)}function cc(...t){return e=>t.reduce(([r,i,n],a)=>{let[o,s,u]=a(e,n);return[{...r,...o},s||i,u]},[{},null,1]).slice(0,2)}function dc(t,...e){if(t==null)return[null,null];for(let[r,i]of e){let n=r.exec(t);if(n)return i(n)}return[null,null]}function CH(...t){return(e,r)=>{let i={},n;for(n=0;n<t.length;n++)i[t[n]]=so(e[r+n]);return[i,null,r+n]}}var PH=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,tqe=`(?:${PH.source}?(?:\\[(${EH.source})\\])?)?`,J3=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jH=RegExp(`${J3.source}${tqe}`),X3=RegExp(`(?:T${jH.source})?`),rqe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,iqe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,nqe=/(\d{4})-?(\d{3})/,aqe=CH("weekYear","weekNumber","weekDay"),oqe=CH("year","ordinal"),sqe=/(\d{4})-(\d\d)-(\d\d)/,$H=RegExp(`${J3.source} ?(?:${PH.source}|(${EH.source}))?`),uqe=RegExp(`(?: ${$H.source})?`);function uc(t,e,r){let i=t[e];return ue(i)?r:so(i)}function lqe(t,e){return[{year:uc(t,e),month:uc(t,e+1,1),day:uc(t,e+2,1)},null,e+3]}function pc(t,e){return[{hours:uc(t,e,0),minutes:uc(t,e+1,0),seconds:uc(t,e+2,0),milliseconds:cm(t[e+3])},null,e+4]}function fm(t,e){let r=!t[e]&&!t[e+1],i=nu(t[e+1],t[e+2]),n=r?null:Ze.instance(i);return[{},n,e+3]}function mm(t,e){let r=t[e]?yt.create(t[e]):null;return[{},r,e+1]}var cqe=RegExp(`^T?${J3.source}$`),dqe=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function pqe(t){let[e,r,i,n,a,o,s,u,l]=t,d=e[0]==="-",p=u&&u[0]==="-",f=(m,g=!1)=>m!==void 0&&(g||m&&d)?-m:m;return[{years:f(ms(r)),months:f(ms(i)),weeks:f(ms(n)),days:f(ms(a)),hours:f(ms(o)),minutes:f(ms(s)),seconds:f(ms(u),u==="-0"),milliseconds:f(cm(l),p)}]}var fqe={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Q3(t,e,r,i,n,a,o){let s={year:e.length===2?dm(so(e)):so(e),month:K3.indexOf(r)+1,day:so(i),hour:so(n),minute:so(a)};return o&&(s.second=so(o)),t&&(s.weekday=t.length>3?Z3.indexOf(t)+1:Y3.indexOf(t)+1),s}var mqe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hqe(t){let[,e,r,i,n,a,o,s,u,l,d,p]=t,f=Q3(e,n,i,r,a,o,s),m;return u?m=fqe[u]:l?m=0:m=nu(d,p),[f,new Ze(m)]}function gqe(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var vqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,bqe=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,yqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function IH(t){let[,e,r,i,n,a,o,s]=t;return[Q3(e,n,i,r,a,o,s),Ze.utcInstance]}function _qe(t){let[,e,r,i,n,a,o,s]=t;return[Q3(e,s,r,i,n,a,o),Ze.utcInstance]}var xqe=lc(rqe,X3),Sqe=lc(iqe,X3),wqe=lc(nqe,X3),kqe=lc(jH),MH=cc(lqe,pc,fm,mm),Tqe=cc(aqe,pc,fm,mm),Oqe=cc(oqe,pc,fm,mm),Aqe=cc(pc,fm,mm);function NH(t){return dc(t,[xqe,MH],[Sqe,Tqe],[wqe,Oqe],[kqe,Aqe])}function DH(t){return dc(gqe(t),[mqe,hqe])}function FH(t){return dc(t,[vqe,IH],[bqe,IH],[yqe,_qe])}function qH(t){return dc(t,[dqe,pqe])}var Iqe=cc(pc);function RH(t){return dc(t,[cqe,Iqe])}var Eqe=lc(sqe,uqe),Cqe=lc($H),Pqe=cc(pc,fm,mm);function LH(t){return dc(t,[Eqe,MH],[Cqe,Pqe])}var jqe="Invalid Duration",BH={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},$qe={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...BH},Or=146097/400,fc=146097/4800,Mqe={years:{quarters:4,months:12,weeks:Or/7,days:Or,hours:Or*24,minutes:Or*24*60,seconds:Or*24*60*60,milliseconds:Or*24*60*60*1e3},quarters:{months:3,weeks:Or/28,days:Or/4,hours:Or*24/4,minutes:Or*24*60/4,seconds:Or*24*60*60/4,milliseconds:Or*24*60*60*1e3/4},months:{weeks:fc/7,days:fc,hours:fc*24,minutes:fc*24*60,seconds:fc*24*60*60,milliseconds:fc*24*60*60*1e3},...BH},su=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Nqe=su.slice(0).reverse();function hs(t,e,r=!1){let i={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ne(i)}function Dqe(t){return t<0?Math.floor(t):Math.ceil(t)}function VH(t,e,r,i,n){let a=t[n][r],o=e[r]/a,s=Math.sign(o)===Math.sign(i[n]),u=!s&&i[n]!==0&&Math.abs(o)<=1?Dqe(o):Math.trunc(o);i[n]+=u,e[r]-=u*a}function Fqe(t,e){Nqe.reduce((r,i)=>ue(e[i])?r:(r&&VH(t,e,r,e,i),i),null)}function qqe(t){let e={};for(let[r,i]of Object.entries(t))i!==0&&(e[r]=i);return e}var ne=class{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,i=r?Mqe:$qe;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||xe.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,r){return ne.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new It(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ne({values:sc(e,ne.normalizeUnit),loc:xe.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(Jn(e))return ne.fromMillis(e);if(ne.isDuration(e))return e;if(typeof e=="object")return ne.fromObject(e);throw new It(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[i]=qH(e);return i?ne.fromObject(i,r):ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[i]=RH(e);return i?ne.fromObject(i,r):ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the Duration is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new e1(i);return new ne({invalid:i})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new rc(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ye.create(this.loc,i).formatDurationFromString(this,e):jqe}toHuman(e={}){let r=su.map(i=>{let n=this.values[i];return ue(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ic(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();if(r<0||r>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};let i=this.shiftTo("hours","minutes","seconds","milliseconds"),n=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(n+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(n+=".SSS"));let a=i.toFormat(n);return e.includePrefix&&(a="T"+a),a}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e),i={};for(let n of su)(fs(r.values,n)||fs(this.values,n))&&(i[n]=r.get(n)+this.get(n));return hs(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let i of Object.keys(this.values))r[i]=G3(e(this.values[i],i));return hs(this,{values:r},!0)}get(e){return this[ne.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...sc(e,ne.normalizeUnit)};return hs(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){let o={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:n,conversionAccuracy:i};return hs(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Fqe(this.matrix,e),hs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=qqe(this.normalize().shiftToAll().toObject());return hs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ne.normalizeUnit(o));let r={},i={},n=this.toObject(),a;for(let o of su)if(e.indexOf(o)>=0){a=o;let s=0;for(let l in i)s+=this.matrix[l][o]*i[l],i[l]=0;Jn(n[o])&&(s+=n[o]);let u=Math.trunc(s);r[o]=u,i[o]=(s*1e3-u*1e3)/1e3;for(let l in n)su.indexOf(l)>su.indexOf(o)&&VH(this.matrix,n,l,r,o)}else Jn(n[o])&&(i[o]=n[o]);for(let o in i)i[o]!==0&&(r[a]+=o===a?i[o]:i[o]/this.matrix[a][o]);return hs(this,{values:r},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return hs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of su)if(!r(this.values[i],e.values[i]))return!1;return!0}};var mc="Invalid Interval";function Rqe(t,e){return!t||!t.isValid?Ne.invalid("missing or invalid start"):!e||!e.isValid?Ne.invalid("missing or invalid end"):e<t?Ne.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var Ne=class{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the Interval is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new Q0(i);return new Ne({invalid:i})}static fromDateTimes(e,r){let i=hc(e),n=hc(r),a=Rqe(i,n);return a??new Ne({start:i,end:n})}static after(e,r){let i=ne.fromDurationLike(r),n=hc(e);return Ne.fromDateTimes(n,n.plus(i))}static before(e,r){let i=ne.fromDurationLike(r),n=hc(e);return Ne.fromDateTimes(n.minus(i),n)}static fromISO(e,r){let[i,n]=(e||"").split("/",2);if(i&&n){let a,o;try{a=H.fromISO(i,r),o=a.isValid}catch{o=!1}let s,u;try{s=H.fromISO(n,r),u=s.isValid}catch{u=!1}if(o&&u)return Ne.fromDateTimes(a,s);if(o){let l=ne.fromISO(n,r);if(l.isValid)return Ne.after(a,l)}else if(u){let l=ne.fromISO(i,r);if(l.isValid)return Ne.before(s,l)}}return Ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;let r=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?Ne.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(hc).filter(o=>this.contains(o)).sort(),i=[],{s:n}=this,a=0;for(;n<this.e;){let o=r[a]||this.e,s=+o>+this.e?this.e:o;i.push(Ne.fromDateTimes(n,s)),n=s,a+=1}return i}splitBy(e){let r=ne.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,a,o=[];for(;i<this.e;){let s=this.start.plus(r.mapUnits(u=>u*n));a=+s>+this.e?this.e:s,o.push(Ne.fromDateTimes(i,a)),i=a,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return r>=i?null:Ne.fromDateTimes(r,i)}union(e){if(!this.isValid)return this;let r=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return Ne.fromDateTimes(r,i)}static merge(e){let[r,i]=e.sort((n,a)=>n.s-a.s).reduce(([n,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[n,a.union(o)]:[n.concat([a]),o]:[n,o],[[],null]);return i&&r.push(i),r}static xor(e){let r=null,i=0,n=[],a=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((u,l)=>u.time-l.time);for(let u of s)i+=u.type==="s"?1:-1,i===1?r=u.time:(r&&+r!=+u.time&&n.push(Ne.fromDateTimes(r,u.time)),r=null);return Ne.merge(n)}difference(...e){return Ne.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:mc}toLocaleString(e=ds,r={}){return this.isValid?Ye.create(this.s.loc.clone(r),e).formatInterval(this):mc}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:mc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:mc}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:mc}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:mc}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):ne.invalid(this.invalidReason)}mapEndpoints(e){return Ne.fromDateTimes(e(this.s),e(this.e))}};var uo=class{static hasDST(e=Te.defaultZone){let r=H.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return yt.isValidZone(e)}static normalizeZone(e){return hn(e,Te.defaultZone)}static months(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||xe.create(r,i,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||xe.create(r,i,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||xe.create(r,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||xe.create(r,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return xe.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return xe.create(r,null,"gregory").eras(e)}static features(){return{relative:o1()}}};function UH(t,e){let r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(e)-r(t);return Math.floor(ne.fromMillis(i).as("days"))}function Lqe(t,e,r){let i=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let d=UH(u,l);return(d-d%7)/7}],["days",UH]],n={},a=t,o,s;for(let[u,l]of i)r.indexOf(u)>=0&&(o=u,n[u]=l(t,e),s=a.plus(n),s>e?(n[u]--,t=a.plus(n)):t=s);return[t,n,s,o]}function zH(t,e,r,i){let[n,a,o,s]=Lqe(t,e,r),u=e-n,l=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);l.length===0&&(o<e&&(o=n.plus({[s]:1})),o!==n&&(a[s]=(a[s]||0)+u/(o-n)));let d=ne.fromObject(a,i);return l.length>0?ne.fromMillis(u,i).shiftTo(...l).plus(d):d}var eE={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},WH={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Bqe=eE.hanidec.replace(/[\[|\]]/g,"").split("");function HH(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);if(t[r].search(eE.hanidec)!==-1)e+=Bqe.indexOf(t[r]);else for(let n in WH){let[a,o]=WH[n];i>=a&&i<=o&&(e+=i-a)}}return parseInt(e,10)}else return e}function Ar({numberingSystem:t},e=""){return new RegExp(`${eE[t||"latn"]}${e}`)}var Vqe="missing Intl.DateTimeFormat.formatToParts support";function we(t,e=r=>r){return{regex:t,deser:([r])=>e(HH(r))}}var Uqe=String.fromCharCode(160),ZH=`[ ${Uqe}]`,YH=new RegExp(ZH,"g");function zqe(t){return t.replace(/\./g,"\\.?").replace(YH,ZH)}function GH(t){return t.replace(/\./g,"").replace(YH," ").toLowerCase()}function gn(t,e){return t===null?null:{regex:RegExp(t.map(zqe).join("|")),deser:([r])=>t.findIndex(i=>GH(r)===GH(i))+e}}function KH(t,e){return{regex:t,deser:([,r,i])=>nu(r,i),groups:e}}function s1(t){return{regex:t,deser:([e])=>e}}function Wqe(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Hqe(t,e){let r=Ar(e),i=Ar(e,"{2}"),n=Ar(e,"{3}"),a=Ar(e,"{4}"),o=Ar(e,"{6}"),s=Ar(e,"{1,2}"),u=Ar(e,"{1,3}"),l=Ar(e,"{1,6}"),d=Ar(e,"{1,9}"),p=Ar(e,"{2,4}"),f=Ar(e,"{4,6}"),m=b=>({regex:RegExp(Wqe(b.val)),deser:([x])=>x,literal:!0}),v=(b=>{if(t.literal)return m(b);switch(b.val){case"G":return gn(e.eras("short",!1),0);case"GG":return gn(e.eras("long",!1),0);case"y":return we(l);case"yy":return we(p,dm);case"yyyy":return we(a);case"yyyyy":return we(f);case"yyyyyy":return we(o);case"M":return we(s);case"MM":return we(i);case"MMM":return gn(e.months("short",!0,!1),1);case"MMMM":return gn(e.months("long",!0,!1),1);case"L":return we(s);case"LL":return we(i);case"LLL":return gn(e.months("short",!1,!1),1);case"LLLL":return gn(e.months("long",!1,!1),1);case"d":return we(s);case"dd":return we(i);case"o":return we(u);case"ooo":return we(n);case"HH":return we(i);case"H":return we(s);case"hh":return we(i);case"h":return we(s);case"mm":return we(i);case"m":return we(s);case"q":return we(s);case"qq":return we(i);case"s":return we(s);case"ss":return we(i);case"S":return we(u);case"SSS":return we(n);case"u":return s1(d);case"uu":return s1(s);case"uuu":return we(r);case"a":return gn(e.meridiems(),0);case"kkkk":return we(a);case"kk":return we(p,dm);case"W":return we(s);case"WW":return we(i);case"E":case"c":return we(r);case"EEE":return gn(e.weekdays("short",!1,!1),1);case"EEEE":return gn(e.weekdays("long",!1,!1),1);case"ccc":return gn(e.weekdays("short",!0,!1),1);case"cccc":return gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return KH(new RegExp(`([+-]${s.source})(?::(${i.source}))?`),2);case"ZZZ":return KH(new RegExp(`([+-]${s.source})(${i.source})?`),2);case"z":return s1(/[a-z_+-/]{1,256}?/i);case" ":return s1(/[^\S\n\r]/);default:return m(b)}})(t)||{invalidReason:Vqe};return v.token=t,v}var Gqe={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Kqe(t,e){let{type:r,value:i}=t;if(r==="literal"){let o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}let n=e[r],a=Gqe[r];if(typeof a=="object"&&(a=a[n]),a)return{literal:!1,val:a}}function Zqe(t){return[`^${t.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,t]}function Yqe(t,e,r){let i=t.match(e);if(i){let n={},a=1;for(let o in r)if(fs(r,o)){let s=r[o],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(n[s.token.val[0]]=s.deser(i.slice(a,a+u))),a+=u}return[i,n]}else return[i,{}]}function Jqe(t){let e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,i;return ue(t.z)||(r=yt.create(t.z)),ue(t.Z)||(r||(r=new Ze(t.Z)),i=t.Z),ue(t.q)||(t.M=(t.q-1)*3+1),ue(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),ue(t.u)||(t.S=cm(t.u)),[Object.keys(t).reduce((a,o)=>{let s=e(o);return s&&(a[s]=t[o]),a},{}),r,i]}var tE=null;function Xqe(){return tE||(tE=H.fromMillis(1555555555555)),tE}function Qqe(t,e){if(t.literal)return t;let r=Ye.macroTokenToFormatOpts(t.val),i=nE(r,e);return i==null||i.includes(void 0)?t:i}function rE(t,e){return Array.prototype.concat(...t.map(r=>Qqe(r,e)))}function iE(t,e,r){let i=rE(Ye.parseFormat(r),t),n=i.map(o=>Hqe(o,t)),a=n.find(o=>o.invalidReason);if(a)return{input:e,tokens:i,invalidReason:a.invalidReason};{let[o,s]=Zqe(n),u=RegExp(o,"i"),[l,d]=Yqe(e,u,s),[p,f,m]=d?Jqe(d):[null,null,void 0];if(fs(d,"a")&&fs(d,"H"))throw new oo("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:u,rawMatches:l,matches:d,result:p,zone:f,specificOffset:m}}}function JH(t,e,r){let{result:i,zone:n,specificOffset:a,invalidReason:o}=iE(t,e,r);return[i,n,a,o]}function nE(t,e){return t?Ye.create(e,t).formatDateTimeParts(Xqe()).map(n=>Kqe(n,t)):null}var XH=[0,31,59,90,120,151,181,212,243,273,304,334],QH=[0,31,60,91,121,152,182,213,244,274,305,335];function Ir(t,e){return new Et("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function eG(t,e,r){let i=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function tG(t,e,r){return r+(au(t)?QH:XH)[e-1]}function rG(t,e){let r=au(t)?QH:XH,i=r.findIndex(a=>a<e),n=e-r[i];return{month:i+1,day:n}}function u1(t){let{year:e,month:r,day:i}=t,n=tG(e,r,i),a=eG(e,r,i),o=Math.floor((n-a+10)/7),s;return o<1?(s=e-1,o=oc(s)):o>oc(e)?(s=e+1,o=1):s=e,{weekYear:s,weekNumber:o,weekday:a,...pm(t)}}function aE(t){let{weekYear:e,weekNumber:r,weekday:i}=t,n=eG(e,1,4),a=ou(e),o=r*7+i-n-3,s;o<1?(s=e-1,o+=ou(s)):o>a?(s=e+1,o-=ou(e)):s=e;let{month:u,day:l}=rG(s,o);return{year:s,month:u,day:l,...pm(t)}}function l1(t){let{year:e,month:r,day:i}=t,n=tG(e,r,i);return{year:e,ordinal:n,...pm(t)}}function oE(t){let{year:e,ordinal:r}=t,{month:i,day:n}=rG(e,r);return{year:e,month:i,day:n,...pm(t)}}function iG(t){let e=lm(t.weekYear),r=Xn(t.weekNumber,1,oc(t.weekYear)),i=Xn(t.weekday,1,7);return e?r?i?!1:Ir("weekday",t.weekday):Ir("week",t.week):Ir("weekYear",t.weekYear)}function nG(t){let e=lm(t.year),r=Xn(t.ordinal,1,ou(t.year));return e?r?!1:Ir("ordinal",t.ordinal):Ir("year",t.year)}function sE(t){let e=lm(t.year),r=Xn(t.month,1,12),i=Xn(t.day,1,ac(t.year,t.month));return e?r?i?!1:Ir("day",t.day):Ir("month",t.month):Ir("year",t.year)}function uE(t){let{hour:e,minute:r,second:i,millisecond:n}=t,a=Xn(e,0,23)||e===24&&r===0&&i===0&&n===0,o=Xn(r,0,59),s=Xn(i,0,59),u=Xn(n,0,999);return a?o?s?u?!1:Ir("millisecond",n):Ir("second",i):Ir("minute",r):Ir("hour",e)}var lE="Invalid DateTime",aG=864e13;function c1(t){return new Et("unsupported zone",`the zone "${t.name}" is not supported`)}function cE(t){return t.weekData===null&&(t.weekData=u1(t.c)),t.weekData}function hm(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new H({...r,...e,old:r})}function fG(t,e,r){let i=t-e*60*1e3,n=r.offset(i);if(e===n)return[i,e];i-=(n-e)*60*1e3;let a=r.offset(i);return n===a?[i,n]:[t-Math.min(n,a)*60*1e3,Math.max(n,a)]}function oG(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function p1(t,e,r){return fG(sm(t),e,r)}function sG(t,e){let r=t.o,i=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:i,month:n,day:Math.min(t.c.day,ac(i,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ne.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=sm(a),[u,l]=fG(s,r,t.zone);return o!==0&&(u+=o,l=t.zone.offset(u)),{ts:u,o:l}}function gm(t,e,r,i,n,a){let{setZone:o,zone:s}=r;if(t&&Object.keys(t).length!==0||e){let u=e||s,l=H.fromObject(t,{...r,zone:u,specificOffset:a});return o?l:l.setZone(s)}else return H.invalid(new Et("unparsable",`the input "${n}" can't be parsed as ${i}`))}function d1(t,e,r=!0){return t.isValid?Ye.create(xe.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function dE(t,e){let r=t.c.year>9999||t.c.year<0,i="";return r&&t.c.year>=0&&(i+="+"),i+=Ke(t.c.year,r?6:4),e?(i+="-",i+=Ke(t.c.month),i+="-",i+=Ke(t.c.day)):(i+=Ke(t.c.month),i+=Ke(t.c.day)),i}function uG(t,e,r,i,n,a){let o=Ke(t.c.hour);return e?(o+=":",o+=Ke(t.c.minute),(t.c.second!==0||!r)&&(o+=":")):o+=Ke(t.c.minute),(t.c.second!==0||!r)&&(o+=Ke(t.c.second),(t.c.millisecond!==0||!i)&&(o+=".",o+=Ke(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!a?o+="Z":t.o<0?(o+="-",o+=Ke(Math.trunc(-t.o/60)),o+=":",o+=Ke(Math.trunc(-t.o%60))):(o+="+",o+=Ke(Math.trunc(t.o/60)),o+=":",o+=Ke(Math.trunc(t.o%60)))),a&&(o+="["+t.zone.ianaName+"]"),o}var mG={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},eRe={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tRe={ordinal:1,hour:0,minute:0,second:0,millisecond:0},hG=["year","month","day","hour","minute","second","millisecond"],rRe=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],iRe=["year","ordinal","hour","minute","second","millisecond"];function lG(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new rc(t);return e}function cG(t,e){let r=hn(e.zone,Te.defaultZone),i=xe.fromObject(e),n=Te.now(),a,o;if(ue(t.year))a=n;else{for(let l of hG)ue(t[l])&&(t[l]=mG[l]);let s=sE(t)||uE(t);if(s)return H.invalid(s);let u=r.offset(n);[a,o]=p1(t,u,r)}return new H({ts:a,zone:r,loc:i,o})}function dG(t,e,r){let i=ue(r.round)?!0:r.round,n=(o,s)=>(o=ic(o,i||r.calendary?0:2,!0),e.loc.clone(r).relFormatter(r).format(o,s)),a=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return n(a(r.unit),r.unit);for(let o of r.units){let s=a(o);if(Math.abs(s)>=1)return n(s,o)}return n(t>e?-0:0,r.units[r.units.length-1])}function pG(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var H=class{constructor(e){let r=e.zone||Te.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Et("invalid input"):null)||(r.isValid?null:c1(r));this.ts=ue(e.ts)?Te.now():e.ts;let n=null,a=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[n,a]=[e.old.c,e.old.o];else{let s=r.offset(this.ts);n=oG(this.ts,s),i=Number.isNaN(n.year)?new Et("invalid input"):null,n=i?null:n,a=i?null:s}this._zone=r,this.loc=e.loc||xe.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new H({})}static local(){let[e,r]=pG(arguments),[i,n,a,o,s,u,l]=r;return cG({year:i,month:n,day:a,hour:o,minute:s,second:u,millisecond:l},e)}static utc(){let[e,r]=pG(arguments),[i,n,a,o,s,u,l]=r;return e.zone=Ze.utcInstance,cG({year:i,month:n,day:a,hour:o,minute:s,second:u,millisecond:l},e)}static fromJSDate(e,r={}){let i=_H(e)?e.valueOf():NaN;if(Number.isNaN(i))return H.invalid("invalid input");let n=hn(r.zone,Te.defaultZone);return n.isValid?new H({ts:i,zone:n,loc:xe.fromObject(r)}):H.invalid(c1(n))}static fromMillis(e,r={}){if(Jn(e))return e<-aG||e>aG?H.invalid("Timestamp out of range"):new H({ts:e,zone:hn(r.zone,Te.defaultZone),loc:xe.fromObject(r)});throw new It(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(Jn(e))return new H({ts:e*1e3,zone:hn(r.zone,Te.defaultZone),loc:xe.fromObject(r)});throw new It("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let i=hn(r.zone,Te.defaultZone);if(!i.isValid)return H.invalid(c1(i));let n=Te.now(),a=ue(r.specificOffset)?i.offset(n):r.specificOffset,o=sc(e,lG),s=!ue(o.ordinal),u=!ue(o.year),l=!ue(o.month)||!ue(o.day),d=u||l,p=o.weekYear||o.weekNumber,f=xe.fromObject(r);if((d||s)&&p)throw new oo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new oo("Can't mix ordinal dates with month/day");let m=p||o.weekday&&!d,g,v,b=oG(n,a);m?(g=rRe,v=eRe,b=u1(b)):s?(g=iRe,v=tRe,b=l1(b)):(g=hG,v=mG);let x=!1;for(let pe of g){let oe=o[pe];ue(oe)?x?o[pe]=v[pe]:o[pe]=b[pe]:x=!0}let k=m?iG(o):s?nG(o):sE(o),P=k||uE(o);if(P)return H.invalid(P);let $=m?aE(o):s?oE(o):o,[D,te]=p1($,a,i),V=new H({ts:D,zone:i,o:te,loc:f});return o.weekday&&d&&e.weekday!==V.weekday?H.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${V.toISO()}`):V}static fromISO(e,r={}){let[i,n]=NH(e);return gm(i,n,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[i,n]=DH(e);return gm(i,n,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[i,n]=FH(e);return gm(i,n,r,"HTTP",r)}static fromFormat(e,r,i={}){if(ue(e)||ue(r))throw new It("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:a=null}=i,o=xe.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[s,u,l,d]=JH(o,e,r);return d?H.invalid(d):gm(s,u,i,`format ${r}`,e,l)}static fromString(e,r,i={}){return H.fromFormat(e,r,i)}static fromSQL(e,r={}){let[i,n]=LH(e);return gm(i,n,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the DateTime is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new X0(i);return new H({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let i=nE(e,xe.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(e,r={}){return rE(Ye.parseFormat(e),xe.fromObject(r)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?cE(this).weekYear:NaN}get weekNumber(){return this.isValid?cE(this).weekNumber:NaN}get weekday(){return this.isValid?cE(this).weekday:NaN}get ordinal(){return this.isValid?l1(this.c).ordinal:NaN}get monthShort(){return this.isValid?uo.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?uo.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?uo.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?uo.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return au(this.year)}get daysInMonth(){return ac(this.year,this.month)}get daysInYear(){return this.isValid?ou(this.year):NaN}get weeksInWeekYear(){return this.isValid?oc(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:i,calendar:n}=Ye.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(e=0,r={}){return this.setZone(Ze.instance(e),r)}toLocal(){return this.setZone(Te.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(e=hn(e,Te.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(r||i){let a=e.offset(this.ts),o=this.toObject();[n]=p1(o,a,e)}return hm(this,{ts:n,zone:e})}else return H.invalid(c1(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:i}={}){let n=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:i});return hm(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=sc(e,lG),i=!ue(r.weekYear)||!ue(r.weekNumber)||!ue(r.weekday),n=!ue(r.ordinal),a=!ue(r.year),o=!ue(r.month)||!ue(r.day),s=a||o,u=r.weekYear||r.weekNumber;if((s||n)&&u)throw new oo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new oo("Can't mix ordinal dates with month/day");let l;i?l=aE({...u1(this.c),...r}):ue(r.ordinal)?(l={...this.toObject(),...r},ue(r.day)&&(l.day=Math.min(ac(l.year,l.month),l.day))):l=oE({...l1(this.c),...r});let[d,p]=p1(l,this.o,this.zone);return hm(this,{ts:d,o:p})}plus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e);return hm(this,sG(this,r))}minus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e).negate();return hm(this,sG(this,r))}startOf(e){if(!this.isValid)return this;let r={},i=ne.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break;case"milliseconds":break}if(i==="weeks"&&(r.weekday=1),i==="quarters"){let n=Math.ceil(this.month/3);r.month=(n-1)*3+1}return this.set(r)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,r={}){return this.isValid?Ye.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):lE}toLocaleString(e=ds,r={}){return this.isValid?Ye.create(this.loc.clone(r),e).formatDateTime(this):lE}toLocaleParts(e={}){return this.isValid?Ye.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let o=e==="extended",s=dE(this,o);return s+="T",s+=uG(this,o,r,i,n,a),s}toISODate({format:e="extended"}={}){return this.isValid?dE(this,e==="extended"):null}toISOWeekDate(){return d1(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+uG(this,o==="extended",r,e,i,a):null}toRFC2822(){return d1(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return d1(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?dE(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||e)&&(i&&(n+=" "),r?n+="z":e&&(n+="ZZ")),d1(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lE}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",i={}){if(!this.isValid||!e.isValid)return ne.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},a=xH(r).map(ne.normalizeUnit),o=e.valueOf()>this.valueOf(),s=o?this:e,u=o?e:this,l=zH(s,u,a,n);return o?l.negate():l}diffNow(e="milliseconds",r={}){return this.diff(H.now(),e,r)}until(e){return this.isValid?Ne.fromDateTimes(this,e):this}hasSame(e,r){if(!this.isValid)return!1;let i=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(r)<=i&&i<=n.endOf(r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||H.fromObject({},{zone:this.zone}),i=e.padding?this<r?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),dG(r,this.plus(i),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?dG(e.base||H.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(H.isDateTime))throw new It("min requires all arguments be DateTimes");return H3(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(H.isDateTime))throw new It("max requires all arguments be DateTimes");return H3(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,i={}){let{locale:n=null,numberingSystem:a=null}=i,o=xe.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return iE(o,e,r)}static fromStringExplain(e,r,i={}){return H.fromFormatExplain(e,r,i)}static get DATE_SHORT(){return ds}static get DATE_MED(){return Vf}static get DATE_MED_WITH_WEEKDAY(){return C3}static get DATE_FULL(){return Uf}static get DATE_HUGE(){return zf}static get TIME_SIMPLE(){return Wf}static get TIME_WITH_SECONDS(){return Hf}static get TIME_WITH_SHORT_OFFSET(){return Gf}static get TIME_WITH_LONG_OFFSET(){return Kf}static get TIME_24_SIMPLE(){return Zf}static get TIME_24_WITH_SECONDS(){return Yf}static get TIME_24_WITH_SHORT_OFFSET(){return Jf}static get TIME_24_WITH_LONG_OFFSET(){return Xf}static get DATETIME_SHORT(){return Qf}static get DATETIME_SHORT_WITH_SECONDS(){return em}static get DATETIME_MED(){return tm}static get DATETIME_MED_WITH_SECONDS(){return rm}static get DATETIME_MED_WITH_WEEKDAY(){return P3}static get DATETIME_FULL(){return im}static get DATETIME_FULL_WITH_SECONDS(){return nm}static get DATETIME_HUGE(){return am}static get DATETIME_HUGE_WITH_SECONDS(){return om}};function hc(t){if(H.isDateTime(t))return t;if(t&&t.valueOf&&Jn(t.valueOf()))return H.fromJSDate(t);if(t&&typeof t=="object")return H.fromObject(t);throw new It(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var uu="1970-01-01T00:00:00.000Z",pE;function fE(){return(pE==null?void 0:pE())??new Date().toISOString()}function gG(){return H.fromISO(fE(),{zone:"utc"})}function vG(t){if(t!==void 0)return t.toUTC().toISO()}function bG(t){if(t instanceof H)return t;if(t!=null)return H.fromJSDate(new Date(t)).toUTC()}var f1=Symbol("DocProp");function R(t,e){return function(r,i){let n=r.constructor[f1]=r.constructor[f1]||{};n[i]={description:t,omit:!1,...e}}}function lu(){return function(t,e){let r=t.constructor[f1]=t.constructor[f1]||{};r[e]={description:"",omit:!0}}}var yG=/^_?[a-z0-9]+(_[a-z0-9]+)*$/;function Be(t,e,r,i,n){if(!yG.test(t))throw new Error("Internal error: invalid table name in entity definition: "+t);if(!yG.test(e))throw new Error("Internal error: invalid entity name in entity definition: "+e);let a=i??"ENTITY",s=class{id=0;key(){return`${s.keyPrefix}${J0(this.id)?this.id:"New"}`}initialize(l){qf(this,l)}static get tableName(){return t}static get entityName(){return e}static get parentSchemas(){return r}static idName=`${e}_id`;static keyPrefix=`${a}-`;static urlPrefix=a.toLowerCase();static allowCustomFields=(n==null?void 0:n.allowCustomFields)??!1;static toJSON(){return e}static toString(){return e}},o=s;return T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The unique entity id - must be a positive integer")],o.prototype,"id",2),o}function gs(t,e,...r){let i=typeof e=="function"?(r.unshift(e),{}):e;class n{static mapName=t;static mapTableName=r.map(o=>o.entityName).sort().join("_")+"_map";static ctors=r;static parentSchemas=Array.from(JW(r.map(o=>o.parentSchemas).flat()));static toJSON(){return t}static toString(){return t}static allowCustomFields=(i==null?void 0:i.allowCustomFields)??!1;initialize(o){o&&qf(this,o)}}for(let a of r)if(a===void 0)throw new Error("An entity constructor is undefined");if(K0(r).length!==r.length)throw new Error("Entity constructors must be distinct");return n}function it(t){class e extends t{is_deleted=!1}return T([(0,st.IsOptional)(),Gt(),R("If the entity has been soft-deleted this value is true")],e.prototype,"is_deleted",2),no(e)}var cit=Symbol("ConflictTagMissing");function vs(t){class e extends t{_etag=""}return T([(0,st.IsOptional)(),(0,st.IsString)(),R("A tag for detecting conflicting modifications - current value must be passed along in an update (or update must be forced)")],e.prototype,"_etag",2),no(e)}function De(t){class e extends t{created_at=uu;created_by=0;modified_at=void 0;modified_by=0;deleted_at=void 0;deleted_by=0}return T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The creation time for this entity or mapping value",{example:uu})],e.prototype,"created_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The creator user id of this entity or mapping value - or zero if created by the system",{example:0})],e.prototype,"created_by",2),T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The last modification time for this entity or mapping value",{example:uu})],e.prototype,"modified_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The id of the user who last modified or undeleted this entity or mapping value - or zero if modified by the system",{example:0})],e.prototype,"modified_by",2),T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The soft-deletion time for this entity or mapping value",{example:uu})],e.prototype,"deleted_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The id of the user who deleted this entity or mapping value - or zero if deleted by the system",{example:0})],e.prototype,"deleted_by",2),no(e)}function Je(t){class e extends t{}return no(e)}var Er=X(ot());function bs(t,e){let r=(e==null?void 0:e.context)??[];for(let i=0;i<t.length;i++)r[`constraint${i+1}`]=t[i];return{...e,context:r}}function _G(t,e){return Er.MinLength(t,bs([t],e))}function de(t,e){return Er.MaxLength(t,bs([t],e))}function m1(t,e){return Er.Min(t,bs([t],e))}function xG(t,e){return Er.Max(t,bs([t],e))}function SG(t,e){return Er.Matches(t,bs([t],e))}var mE=Symbol("_trackRefs");function ge(t,e){return function(r,i){r.constructor[mE]??=[],r.constructor.ctors?r.constructor[mE].push({type:"map_prop",propName:i,sourceEntityName:r.constructor.mapName,targetEntityName:t,withHistory:Bf(r.constructor,Je),hintOnly:e??!1}):r.constructor[mE].push({type:"prop",propName:i,sourceEntityName:r.constructor.entityName,targetEntityName:t,withHistory:Bf(r.constructor,Je),hintOnly:e??!1})}}var git=Symbol("_trackLargeProps");var nt=X(ot());var nRe=/[\\/:*?"<>|]+/g,aRe=/^(|nul|prn|con|lpt[0-9]|com[0-9]|\.)(\.|$)/i;function oRe(t){return typeof t=="string"&&!t.match(nRe)&&!t.match(aRe)}function wG(t){return(0,nt.ValidateBy)({name:"isValidFilename",validator:{validate:oRe,defaultMessage:(0,nt.buildMessage)(e=>e+"Value '$value' is not a valid filename",t)}},t)}function sRe(t,e){return typeof t=="string"&&(0,nt.minLength)(t.trim().replace(/\p{Cf}/u,""),e)}function lo(t,e){let r=bs([t],e);return(0,nt.ValidateBy)({name:"minLengthTrimmed",constraints:[t],validator:{validate:(i,n)=>sRe(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,nt.buildMessage)(i=>i+"Trimmed $property must be longer than or equal to $constraint1 characters",r)}},r)}function uRe(t,e){return typeof t=="string"&&(0,nt.maxLength)(t.trim(),e)}function kG(t,e){let r=bs([t],e);return(0,nt.ValidateBy)({name:"maxLengthTrimmed",constraints:[t],validator:{validate:(i,n)=>uRe(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,nt.buildMessage)(i=>i+"Trimmed $property must be shorter than or equal to $constraint1 characters",r)}},r)}function TG(t){return(0,nt.ValidateBy)({name:"isWord",validator:{validate:(e,r)=>n8(e),defaultMessage:(0,nt.buildMessage)(e=>e+"$property must only contain numbers, letters and underscores",t)}},t)}function OG(t){return(0,nt.ValidateBy)({name:"startsWithLetter",validator:{validate:(e,r)=>a8(e),defaultMessage:(0,nt.buildMessage)(e=>e+"$property must start with a letter",t)}},t)}function AG(t,e){return(0,nt.ValidateBy)({name:"isValidId",validator:{validate:(r,i)=>typeof r=="number"&&(J0(r)||!!t&&r===0),defaultMessage:(0,nt.buildMessage)(r=>r+"$property must be a valid entity id",e)}},e)}function IG(t,e){let r;return(0,nt.ValidateBy)({name:"isSchema",validator:{validate:(i,n)=>{try{return r=void 0,t.validate(i,{allowCycles:!0}),!0}catch(a){return r=a,!1}},defaultMessage:(0,nt.buildMessage)(i=>i+`$property must be a valid '${t.name}'.${r!==void 0?" "+r:""}`,e)}},e)}var ys=class extends vs(De(it(Be("projects","project",["tenant"],"P")))){owner_user_id=0;name="";project_key=void 0;description="";constructor(e){super(),this.initialize(e)}};T([ge("user"),(0,Cr.IsInt)(),R("Reserved for future use")],ys.prototype,"owner_user_id",2),T([(0,Cr.IsString)(),lo(3),de(40),R("The project name")],ys.prototype,"name",2),T([(0,Cr.IsString)(),(0,Cr.IsOptional)(),lo(2),kG(5),(0,Cr.IsAlphanumeric)(),(0,Cr.IsUppercase)(),R("An optional project shorthand key",{nullable:!0,example:"PRO"})],ys.prototype,"project_key",2),T([(0,Cr.IsString)(),R("An optional descriptive text for the project")],ys.prototype,"description",2);var fu=X(_d());var vm=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,EG=new Set,lRe=(t,e,r,i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},cRe=t=>!EG.has(t),jit=Symbol("type"),_s=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),CG=t=>_s(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?vc:null:null,vc=class extends Array{constructor(e){super(e),this.fill(0)}},bc,gc=class{heap;length;static create(e){let r=CG(e);if(!r)return[];G1(gc,bc,!0);let i=new gc(e,r);return G1(gc,bc,!1),i}constructor(e,r){if(!tC(gc,bc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},h1=gc;bc=new WeakMap,rC(h1,bc,!1);var bm=class{#f;#c;#b;#m;#E;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#h;#n;#r;#e;#u;#d;#s;#a;#g;#o;#S;#w;#v;#y;#T;#l;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#S,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#d,get head(){return e.#s},get tail(){return e.#a},free:e.#g,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,i,n,a)=>e.#j(r,i,n,a),moveToTail:r=>e.#I(r),indexes:r=>e.#_(r),rindexes:r=>e.#x(r),isStale:r=>e.#p(r)}}get max(){return this.#f}get maxSize(){return this.#c}get calculatedSize(){return this.#h}get size(){return this.#i}get fetchMethod(){return this.#E}get dispose(){return this.#b}get disposeAfter(){return this.#m}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:u,dispose:l,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:m=0,maxEntrySize:g=0,sizeCalculation:v,fetchMethod:b,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:$,ignoreFetchAbort:D}=e;if(r!==0&&!_s(r))throw new TypeError("max option must be a nonnegative integer");let te=r?CG(r):Array;if(!te)throw new Error("invalid max value: "+r);if(this.#f=r,this.#c=m,this.maxEntrySize=g||this.#c,this.sizeCalculation=v,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#E=b,this.#T=!!b,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new te(r),this.#d=new te(r),this.#s=0,this.#a=0,this.#g=h1.create(r),this.#i=0,this.#h=0,typeof l=="function"&&(this.#b=l),typeof d=="function"?(this.#m=d,this.#o=[]):(this.#m=void 0,this.#o=void 0),this.#y=!!this.#b,this.#l=!!this.#m,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!$,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#c!==0&&!_s(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_s(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=_s(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!_s(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(this.#f===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#f&&!this.#c){let V="LRU_CACHE_UNBOUNDED";cRe(V)&&(EG.add(V),lRe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",V,bm))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#$(){let e=new vc(this.#f),r=new vc(this.#f);this.#v=e,this.#w=r,this.#M=(a,o,s=vm.now())=>{if(r[a]=o!==0?s:0,e[a]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#p(a)&&this.delete(this.#r[a])},o+1);u.unref&&u.unref()}},this.#O=a=>{r[a]=e[a]!==0?vm.now():0},this.#k=(a,o)=>{if(e[o]){let s=e[o],u=r[o];a.ttl=s,a.start=u,a.now=i||n(),a.remainingTTL=a.now+s-u}};let i=0,n=()=>{let a=vm.now();if(this.ttlResolution>0){i=a;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{let o=this.#n.get(a);return o===void 0?0:e[o]===0||r[o]===0?1/0:r[o]+e[o]-(i||n())},this.#p=a=>e[a]!==0&&r[a]!==0&&(i||n())-r[a]>e[a]}#O=()=>{};#k=()=>{};#M=()=>{};#p=()=>!1;#q(){let e=new vc(this.#f);this.#h=0,this.#S=e,this.#A=r=>{this.#h-=e[r],e[r]=0},this.#N=(r,i,n,a)=>{if(this.#t(i))return 0;if(!_s(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(i,r),!_s(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#C=(r,i,n)=>{if(e[r]=i,this.#c){let a=this.#c-e[r];for(;this.#h>a;)this.#P(!0)}this.#h+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#h)}}#A=e=>{};#C=(e,r,i)=>{};#N=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#_({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#s));)r=this.#d[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#s;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#u[r]}#D(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#_())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#x())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#_()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#_())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#x())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;if(a!==void 0&&e(a,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(e,r=this){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&e.call(r,a,this.#r[i],this)}}rforEach(e,r=this){for(let i of this.#x()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&e.call(r,a,this.#r[i],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#p(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#_({allowStale:!0})){let i=this.#r[r],n=this.#e[r],a=this.#t(n)?n.__staleWhileFetching:n;if(a===void 0||i===void 0)continue;let o={value:a};if(this.#v&&this.#w){o.ttl=this.#v[r];let s=vm.now()-this.#w[r];o.start=Math.floor(Date.now()-s)}this.#S&&(o.size=this.#S[r]),e.unshift([i,o])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=vm.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){var f,m,g;let{ttl:n=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,d=this.#N(e,r,i.size||0,s);if(this.maxEntrySize&&d>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#i===0?void 0:this.#n.get(e);if(p===void 0)p=this.#i===0?this.#a:this.#g.length!==0?this.#g.pop():this.#i===this.#f?this.#P(!1):this.#i,this.#r[p]=e,this.#e[p]=r,this.#n.set(e,p),this.#u[this.#a]=p,this.#d[p]=this.#a,this.#a=p,this.#i++,this.#C(p,d,u),u&&(u.set="add"),l=!1;else{this.#I(p);let v=this.#e[p];if(r!==v){if(this.#T&&this.#t(v)?v.__abortController.abort(new Error("replaced")):o||(this.#y&&((f=this.#b)==null||f.call(this,v,e,"set")),this.#l&&((m=this.#o)==null||m.push([v,e,"set"]))),this.#A(p),this.#C(p,d,u),this.#e[p]=r,u){u.set="replace";let b=v&&this.#t(v)?v.__staleWhileFetching:v;b!==void 0&&(u.oldValue=b)}}else u&&(u.set="update")}if(n!==0&&!this.#v&&this.#$(),this.#v&&(l||this.#M(p,n,a),u&&this.#k(u,p)),!o&&this.#l&&this.#o){let v=this.#o,b;for(;b=v==null?void 0:v.shift();)(g=this.#m)==null||g.call(this,...b)}return this}pop(){var e;try{for(;this.#i;){let r=this.#e[this.#s];if(this.#P(!0),this.#t(r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(this.#l&&this.#o){let r=this.#o,i;for(;i=r==null?void 0:r.shift();)(e=this.#m)==null||e.call(this,...i)}}}#P(e){var a,o;let r=this.#s,i=this.#r[r],n=this.#e[r];return this.#T&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#y||this.#l)&&(this.#y&&((a=this.#b)==null||a.call(this,n,i,"evict")),this.#l&&((o=this.#o)==null||o.push([n,i,"evict"]))),this.#A(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#g.push(r)),this.#i===1?(this.#s=this.#a=0,this.#g.length=0):this.#s=this.#u[r],this.#n.delete(i),this.#i--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,a=this.#n.get(e);if(a!==void 0){let o=this.#e[a];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(a))n&&(n.has="stale",this.#k(n,a));else return i&&this.#O(a),n&&(n.has="hit",this.#k(n,a)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(e);if(n!==void 0&&(i||!this.#p(n))){let a=this.#e[n];return this.#t(a)?a.__staleWhileFetching:a}}#j(e,r,i,n){let a=r===void 0?void 0:this.#e[r];if(this.#t(a))return a;let o=new AbortController,{signal:s}=i;s==null||s.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(v,b=!1)=>{let{aborted:x}=o.signal,k=i.ignoreFetchAbort&&v!==void 0;if(i.status&&(x&&!b?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,k&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),x&&!k&&!b)return p(o.signal.reason);let P=m;return this.#e[r]===m&&(v===void 0?P.__staleWhileFetching?this.#e[r]=P.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,v,u.options))),v},d=v=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=v),p(v)),p=v=>{let{aborted:b}=o.signal,x=b&&i.allowStaleOnFetchAbort,k=x||i.allowStaleOnFetchRejection,P=k||i.noDeleteOnFetchRejection,$=m;if(this.#e[r]===m&&(!P||$.__staleWhileFetching===void 0?this.delete(e):x||(this.#e[r]=$.__staleWhileFetching)),k)return i.status&&$.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw v},f=(v,b)=>{var k;let x=(k=this.#E)==null?void 0:k.call(this,e,a,u);x&&x instanceof Promise&&x.then(P=>v(P),b),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(v(),i.allowStaleOnFetchAbort&&(v=P=>l(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);let m=new Promise(f).then(l,d),g=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,g,{...u.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=g,g}#t(e){if(!this.#T)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:x,signal:k}=r;if(!this.#T)return x&&(x.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:x});let P={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:s,size:u,sizeCalculation:l,noUpdateTTL:d,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:x,signal:k},$=this.#n.get(e);if($===void 0){x&&(x.fetch="miss");let D=this.#j(e,$,P,v);return D.__returned=D}else{let D=this.#e[$];if(this.#t(D)){let fe=i&&D.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",fe&&(x.returnedStale=!0)),fe?D.__staleWhileFetching:D.__returned=D}let te=this.#p($);if(!b&&!te)return x&&(x.fetch="hit"),this.#I($),n&&this.#O($),x&&this.#k(x,$),D;let V=this.#j(e,$,P,v),oe=V.__staleWhileFetching!==void 0&&i;return x&&(x.fetch=te?"stale":"refresh",oe&&te&&(x.returnedStale=!0)),oe?V.__staleWhileFetching:V.__returned=V}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=r,s=this.#n.get(e);if(s!==void 0){let u=this.#e[s],l=this.#t(u);return o&&this.#k(o,s),this.#p(s)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?u.__staleWhileFetching:void 0):(a||this.delete(e),o&&i&&(o.returnedStale=!0),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#I(s),n&&this.#O(s),u))}else o&&(o.get="miss")}#F(e,r){this.#d[r]=e,this.#u[e]=r}#I(e){e!==this.#a&&(e===this.#s?this.#s=this.#u[e]:this.#F(this.#d[e],this.#u[e]),this.#F(this.#a,e),this.#a=e)}delete(e){var i,n,a,o;let r=!1;if(this.#i!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#i===1)this.clear();else{this.#A(s);let u=this.#e[s];this.#t(u)?u.__abortController.abort(new Error("deleted")):(this.#y||this.#l)&&(this.#y&&((i=this.#b)==null||i.call(this,u,e,"delete")),this.#l&&((n=this.#o)==null||n.push([u,e,"delete"]))),this.#n.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a?this.#a=this.#d[s]:s===this.#s?this.#s=this.#u[s]:(this.#u[this.#d[s]]=this.#u[s],this.#d[this.#u[s]]=this.#d[s]),this.#i--,this.#g.push(s)}}if(this.#l&&((a=this.#o)!=null&&a.length)){let s=this.#o,u;for(;u=s==null?void 0:s.shift();)(o=this.#m)==null||o.call(this,...u)}return r}clear(){var e,r,i;for(let n of this.#x({allowStale:!0})){let a=this.#e[n];if(this.#t(a))a.__abortController.abort(new Error("deleted"));else{let o=this.#r[n];this.#y&&((e=this.#b)==null||e.call(this,a,o,"delete")),this.#l&&((r=this.#o)==null||r.push([a,o,"delete"]))}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#v&&this.#w&&(this.#v.fill(0),this.#w.fill(0)),this.#S&&this.#S.fill(0),this.#s=0,this.#a=0,this.#g.length=0,this.#h=0,this.#i=0,this.#l&&this.#o){let n=this.#o,a;for(;a=n==null?void 0:n.shift();)(i=this.#m)==null||i.call(this,...a)}}},PG=bm;function jG(t,e){let r=e-t;return Math.round(t+r/2+r/10*(Math.random()-.5))}function hE(t,e){return t=t.trim(),/^[-+]?(\d+)$/.test(t)?Number.parseInt(t,e):NaN}function gE(t){return t=t.trim().replaceAll(",","."),/^[-]?(0|[1-9][0-9]*)(\.[0-9]*)?(e[+-]?[0-9]+)?$/i.test(t)?Number.parseFloat(t):NaN}var ym=Object.freeze({});var du=class{constructor(e,r,i){this.maxAgeSec=r;if(!e||!r&&r!==0)throw new Error("Internal error - Cache must have maxKeys>0, maxAge>=0");this.internalCache=new PG({max:e,ttl:1e3*r,updateAgeOnGet:!1}),dRe(this.internalCache,r,e),this.keyTransform=i}internalCache;keyTransform;hitCounter=0;missCounter=0;get metrics(){let e=this.hitCounter+this.missCounter;return{gauge:[this.internalCache.size,e>0?this.hitCounter/e:0],counter:[this.hitCounter,this.missCounter]}}get(e){var n;let r=((n=this.keyTransform)==null?void 0:n.call(this,e))??e,i=this.internalCache.get(r);return i!==void 0?this.hitCounter++:this.missCounter++,i!==ym?i:null}set(e,r,i=0){var a;let n=((a=this.keyTransform)==null?void 0:a.call(this,e))??e;if(r!==void 0){let o=i>0&&this.maxAgeSec>i?1e3*i:void 0;this.internalCache.set(n,r!==null?r:ym,{ttl:o})}else this.internalCache.delete(n);return r}getOrSet(e,r){let i=this.get(e);return i||this.set(e,r)}has(e){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,e))??e;return this.internalCache.has(r)}del(e){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,e))??e;this.internalCache.delete(r)}clear(){this.internalCache.clear()}find(e){let r=[];return this.internalCache.forEach(i=>{i!==ym&&e(i)&&r.push(i)}),r}purge(e){let r=[];this.internalCache.forEach((i,n)=>{i!==ym&&e(i)&&r.push(n)});for(let i of r)this.internalCache.delete(i)}purgeStale(){return this.internalCache.purgeStale()}forEach(e){this.internalCache.forEach((r,i)=>{e(r!==ym?r:null,i)})}get count(){return this.internalCache.size}};function dRe(t,e,r){if(e>0&&r>10){let i=setInterval(()=>{t.purgeStale()},1e3*jG(e/3,e/2));typeof i=="object"&&i.unref()}}var pu=X(_d());var vE="data-changed",bE="data-mapped";function $G(t){return t.categories.subject===vE}function MG(t){return t.categories.subject===bE}var g1=class{constructor(e){this.filter=e}currentFilter=void 0;notificationClient=void 0;notificationSubscription=void 0;setup(e){var r;this.notificationClient=e,(r=this.notificationSubscription)==null||r.unsubscribe(),this.notificationSubscription=e.messageReceived().subscribe(i=>this.processMessage(i)),this.currentFilter&&e.addOrReplaceSubscription(this.currentFilter,this.currentFilter)}setCurrentProject(e){let r={projectId:[e,0],...this.filter};this.currentFilter=this.notificationClient?this.notificationClient.addOrReplaceSubscription(r,this.currentFilter):r}};var yE=class extends g1{dataInserted=new pu.Subject;dataUpdated=new pu.Subject;dataDeleted=new pu.Subject;dataUndeleted=new pu.Subject;dataMapped=new pu.Subject;dataUnmapped=new pu.Subject;constructor(){super({subject:[vE,bE]})}processMessage(e){if($G(e)&&e.data){let r={...e.data,origin:e.to.tokenId===e.data.byTokenId&&(e.data.byTabHint===Ce.tabHint||!e.data.byTabHint)?"self":"other"};e.data.op==="insert"?this.dataInserted.next(r):e.data.op==="update"?this.dataUpdated.next(r):e.data.op==="delete"?this.dataDeleted.next(r):e.data.op==="undelete"&&this.dataUndeleted.next(r)}else if(MG(e)&&e.data){let r={...e.data,origin:e.to.tokenId===e.data.byTokenId&&(e.data.byTabHint===Ce.tabHint||!e.data.byTabHint)?"self":"other"};e.data.op==="map"?this.dataMapped.next(r):e.data.op==="unmap"&&this.dataUnmapped.next(r)}}},pRe=new yE;function yc(){return pRe}function fRe(){let t,e,r=new Promise((i,n)=>{t=i,e=n});return r.catch(()=>{}),r.resolve=t,r.reject=e,r}var v1=class{acquired;get isFree(){return this.acquired===void 0}async acquire(){for(;this.acquired;)await this.acquired;this.acquired=fRe()}release(){if(!this.acquired)throw new Error("Trying to release a non-acquired mutex.");this.acquired.resolve(),this.acquired=void 0}async waitForRelease(){this.acquired&&await this.acquired}};var NG=1e3,DG=8*3600,mRe=500;var _E=class extends Ce{serviceName;ctor;entityCache=new du(NG,DG);cachePrefillMutex=new v1;nextCachePrefillTime=H.now();findCachedMutexes=new Map;cacheDeleted;events;uniqueCacheKeys=[];constructor(e,r,i,n){super(i,n),this.ctor=r,this.cacheDeleted=Bf(r,it),this.serviceName=e,this.events={insert:new fu.Subject,update:new fu.Subject,delete:new fu.Subject,undelete:new fu.Subject,map:new fu.Subject,unmap:new fu.Subject},this.useNotifications(yc())}useNotifications(e){this.useNotificationsBase(e,this.events,[this.ctor.entityName],r=>{let i=["id",...this.uniqueCacheKeys];for(let n of i){let a=r[n];z0(a)&&this.entityCache.set(`${n}:${a}`,r)}},r=>{if(this.cacheDeleted){let i=this.entityCache.find(n=>(n==null?void 0:n.id)===r.id);for(let n of i)n.is_deleted=!0}else this.entityCache.purge(i=>(i==null?void 0:i.id)===r.id)})}async findOne(e){if(typeof e=="object"){let i={...e};return i.pagination=i.pagination??{},i.pagination.limit=1,(await this.find(i)).data[0]}if(!e)throw new Error("findOne needs a valid id as an argument");return(await this.find({id:e})).data[0]}async findIds(e){let r=await this.find({...e,idOnly:!0});return{...r,data:r.data.map(i=>i.id)}}async find(e,r){e=hRe(e);let i=JSON.stringify(e),n=i.length>=mRe?await this.post(`/${this.serviceName}/find`,e):await this.get(`/${this.serviceName}`,{q:i});return e!=null&&e.idOnly||(n.data=n.data.map(a=>this.toClassObject(a,r??this.ctor))),n}async count(e,r){return(await this.find({...e,countOnly:!0},r)).meta.count}async findCached(e,r,i,n=!1){if(i||await this.cachePrefillMutex.waitForRelease(),e===void 0&&r===void 0){let u=new Set,l=this.entityCache.find(p=>p!==null),d=[];for(let p of l)!u.has(p.id)&&(n||!this.cacheDeleted||!p.is_deleted)&&(d.push(p),u.add(p.id));return d}let a=Ot(e);r??="id";let o=`keys:${a.join(",")}; byKey:${String(r)??""}; ${n}`;for(;;){let u=this.findCachedMutexes.get(o);if(u===void 0)break;await u}let s=new Map;for(let u of a){let l=`${String(r)}:${u}`,d=this.entityCache.get(l);d!==void 0&&(d===null||n||!this.cacheDeleted||!d.is_deleted)&&s.set(u,d)}if(!i){let u=["id",...this.uniqueCacheKeys];if(!u.includes(r))throw new Error("Invalid cache key for entity");let l=a.filter(p=>!s.has(p));if(l.length>0){let f=(async g=>{let v=r==="id"?await this.find({ids:l}):await this.find({filter:{[r]:{op:"in",value:l}},includeDeleted:n});for(let b of v.data){s.set(b[r],b);for(let x of g){let k=`${x}:${b[r]}`;this.entityCache.set(k,b)}}})(u),m=f.catch(()=>{});this.findCachedMutexes.set(o,m);try{await f}finally{this.findCachedMutexes.delete(o)}}a.filter(p=>!s.has(p)).forEach(p=>{let f=`${String(r)}:${p}`;n?this.entityCache.set(f,null):this.entityCache.getOrSet(f,null)})}return Array.isArray(e)?a.map(u=>s.get(u)).filter(z0):s.get(a[0])??void 0}async prefillCache(e){if(Ot(e==null?void 0:e.map).find(r=>r.result))throw new Error("Internal error: prefilled entities must be of the same type as data client");await this.cachePrefillMutex.acquire();try{if(H.now()>=this.nextCachePrefillTime){let r=await this.find({...e,pagination:{limit:NG},idOnly:!1,includeTotalCount:!1,countOnly:!1,order:void 0,includeDeleted:(e==null?void 0:e.includeDeleted)??this.cacheDeleted}),i=["id",...this.uniqueCacheKeys];for(let n of r.data)for(let a of i){let o=n[a];if(z0(o)){let s=`${a}:${o}`;this.entityCache.set(s,n)}}this.nextCachePrefillTime=H.now().plus({seconds:DG})}}finally{this.cachePrefillMutex.release()}return this.entityCache.count}purgeCache(){this.entityCache.clear()}async insert(e){e=this.strongify(e,this.ctor,!1);let r=await this.post(`/${this.serviceName}/${Array.isArray(e)?"bulk":""}`,e),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataInserted,{values:n}),i}async update(e,r=!1){e=this.strongify(e,this.ctor,!1);let i=r?"?force=1":"",n=await this.put(`/${this.serviceName}/${Array.isArray(e)?"bulk":e.id}${i}`,e),a=Array.isArray(n)?n:this.strongify(n,this.ctor),o=Ot(a);return this.notifications&&this.dispatch(this.notifications.dataUpdated,{values:o}),a}async remove(e){let i=Array.isArray(e)?await this.delete(`/${this.serviceName}/bulk`,void 0,{ids:e.map(a=>a.id).join(",").toString()}):await this.delete(`/${this.serviceName}/${e.id}`),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataDeleted,{values:n}),i}async undelete(e){let r=Array.isArray(e)?await this.post(`/${this.serviceName}/bulk/undelete`,e.map(a=>({id:a.id}))):await this.post(`/${this.serviceName}/undelete/${e.id}`,{}),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataUndeleted,{values:n}),i}async addMappings(e,r,i){return this.executeMappings(i?"add_or_update":"add",e,Ot(r))}async updateMappings(e,r){return this.executeMappings("update",e,Ot(r))}async removeMappings(e,r){return this.executeMappings("delete",e,Ot(r))}async addMapping(e,r,i){return this.addMappings(e,[r],i)}async updateMapping(e,r){return this.updateMappings(e,[r])}async removeMapping(e,r){return this.removeMappings(e,[r])}async executeMappings(e,r,i){let n=I3(r);await this.post(`/${this.serviceName}/mapping/bulk/${n.join(":")}?op=${e}`,i),this.notifications&&this.dispatchMappingEvents(e,r,i)}dispatchMappingEvents(e,r,i){let n=I3(r);if(e!=="update")e==="add"||e==="add_or_update"?this.dispatch(this.notifications.dataMapped,{values:i,mapOp:e,entities:n}):this.dispatch(this.notifications.dataUnmapped,{values:i,entities:n,mapOp:e});else{let a=i.filter(s=>!w3(s.newIds)),o=i.filter(s=>w3(s.newIds));a.length>0&&this.dispatch(this.notifications.dataMapped,{values:a,mapOp:e,entities:n}),o.length>0&&(this.dispatch(this.notifications.dataUnmapped,{values:o.map(s=>({...s,ids:{...s.ids,...s.newIds},mapped:void 0})),entities:n,mapOp:e}),this.dispatch(this.notifications.dataMapped,{values:o.map(s=>({...s,ids:{...s.ids,...s.newIds}})),entities:n,mapOp:"add"}))}}dispatch(e,r){let i=JSON.parse(JSON.stringify(r));setTimeout(()=>{e.next({...i,origin:"local",byTokenId:"LOCAL",byUserId:0,entity:this.ctor.entityName})},1)}},Pr=class extends _E{constructor(e,r,i,n){super(e,r,i,n)}async findOne(e){return super.findOne(e)}async find(e,r){return super.find(e,r)}async findIds(e){return super.findIds(e)}async count(e,r){return super.count(e,r)}async findCached(e,r,i,n){return typeof e=="boolean"&&(n=e,e=void 0),super.findCached(e,r,i,n)}async prefillCache(e){return super.prefillCache(e)}async insert(e){return super.insert(e)}async update(e,r=!1){return super.update(e,r)}async remove(e){return super.remove(e)}async undelete(e){return super.undelete(e)}async addMappings(e,r,i){return super.addMappings(e,r,i)}async removeMappings(e,r){return super.removeMappings(e,r)}async updateMappings(e,r){return super.updateMappings(e,r)}async addMapping(e,r,i){return super.addMapping(e,r,i)}async updateMapping(e,r){return super.updateMapping(e,r)}async removeMapping(e,r){return super.removeMapping(e,r)}};function hRe(t){return t||{}}var b1=class extends Pr{constructor(e){super("project",ys,e)}};var BG=X(ot());var _1=X(ot());var y1=1e15,qG=1e8;function _c(t){class e extends t{sort_index=0}return T([(0,_1.IsInt)(),xG(y1),m1(-y1),R(`An integer sort index for natural ordering of this entity or mapping value - value must in range (${-y1+1},${y1-1})`)],e.prototype,"sort_index",2),no(e)}function Bt(t){class e extends t{project_id=0}return T([ge("project"),AG(),R("The project id this entity or mapping belongs to")],e.prototype,"project_id",2),no(e)}var FG=3;function jr(t){class e extends t{title=""}return T([(0,_1.IsString)(),lo(FG),de(200),R(`A descriptive title for this entity or mapping (3 to ${FG} characters)`,{example:"A Descriptive Title"})],e.prototype,"title",2),no(e)}function LG(t){let e=Symbol(t+"Attribute");return[function(r){return function(i,n){(i.constructor[e]??=[]).push({prop:n,data:r})}},function(r){return RG(r,e).map(i=>i.prop)},function(r,i){var n;return(n=RG(r,e).find(a=>a.prop===i))==null?void 0:n.data}]}function RG(t,e){var i;let r=typeof t=="function";return!t||typeof t!="object"&&!r?[]:((i=r?t:t.constructor)==null?void 0:i[e])??[]}var x1=(f=>(f.Code="code",f.Grid="t",f.GridRow="tr",f.GridCell="td",f.Heading="h1",f.Li="li",f.Link="a",f.Image="img",f.Ol="ol",f.Paragraph="p",f.QuickCopy="cp",f.Ul="ul",f))(x1||{}),$e=x1,Nnt=new Map([[$e.Paragraph,{childTypes:[$e.Link,$e.QuickCopy,$e.Image],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0}],[$e.Heading,{childTypes:[$e.Link,$e.QuickCopy],disallowedAncestors:["h1"],canBeRoot:!0,canHaveText:!0}],[$e.QuickCopy,{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}],[$e.Code,{childTypes:[],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0}],[$e.Link,{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}],[$e.Image,{childTypes:[],disallowedAncestors:["li"],canBeRoot:!1,canHaveText:!1}],[$e.Grid,{childTypes:[$e.GridRow],disallowedAncestors:[],canBeRoot:!0,canHaveText:!1}],[$e.GridRow,{childTypes:[$e.GridCell],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1}],[$e.GridCell,{childTypes:[$e.Paragraph,$e.Ul,$e.Ol,$e.Heading,$e.Code],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1}],[$e.Ul,{childTypes:[$e.Li],disallowedAncestors:["ul","ol"],canBeRoot:!1,canHaveText:!1}],[$e.Ol,{childTypes:[$e.Li],disallowedAncestors:["ul","ol"],canBeRoot:!1,canHaveText:!1}],[$e.Li,{childTypes:[$e.QuickCopy,$e.Link],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}]]);var[vn,Vnt]=LG("DocumentText");function S1(t,e){return JSON.stringify({v:1,t:"slate",c:t},(r,i)=>r[0]!=="_"?i:void 0,e)}var w1=X(ot());var _m=5e3,qt=class extends Je(Bt(vs(De(it(_c(jr(Be("testcase_folders","testcase_folder",["tenant"],"TCF")))))))){testcase_folder_parent_id=0;description="";constructor(e){super(),this.initialize(e)}};T([ge("testcase_folder"),(0,w1.IsInt)(),R("The id of the folder's parent in the tree structure (no cycles allowed)")],qt.prototype,"testcase_folder_parent_id",2),T([(0,w1.IsString)(),vn(),de(_m),ge("blob",!0),R("An optional description for this test case folder (can be a rich text document)")],qt.prototype,"description",2);var bn=class extends Je(De(Bt(it(jr(Be("testplans","testplan",["tenant"],"TP")))))){description="";$testrun_count=0;$last_testrun_created=null;$open_testrun_count=0;$query_count=0;constructor(e){super(),this.initialize(e)}};T([(0,BG.IsString)(),vn(),de(_m),ge("blob",!0),R("An optional description for this test plan (can be a rich text document)")],bn.prototype,"description",2),T([dn(),ru(),R("The number of test runs linked to this test plan - read only")],bn.prototype,"$testrun_count",2),T([dn(),R("The time the last test run was created from this test plan - read only")],bn.prototype,"$last_testrun_created",2),T([dn(),ru(),R("The number of open test runs linked to this test plan - read only")],bn.prototype,"$open_testrun_count",2),T([dn(),ru(),R("The number of tset case queries linked to this test plan - read only")],bn.prototype,"$query_count",2);var k1=class extends Pr{constructor(e){super("testplan",bn,e)}};var mu=X(_d());var xm=X(ot());var $r=class extends Be("permission_groups","permission_group",["central","tenant"]){name="";description="";is_builtin=!1;constructor(e){super(),this.initialize(e)}};T([(0,xm.IsString)(),de(100)],$r.prototype,"name",2),T([(0,xm.IsString)(),de(1e3)],$r.prototype,"description",2),T([(0,xm.IsBoolean)(),Gt()],$r.prototype,"is_builtin",2);var Sm=X(ot());var Mr=class extends Be("permission_roles","permission_role",["central","tenant"]){name="";description="";is_builtin=!1;constructor(e){super(),this.initialize(e)}};T([(0,Sm.IsString)(),de(100)],Mr.prototype,"name",2),T([(0,Sm.IsString)(),de(1e3)],Mr.prototype,"description",2),T([(0,Sm.IsBoolean)(),Gt()],Mr.prototype,"is_builtin",2);var wm=class extends Ce{events;constructor(e){super(e),this.events={insert:new mu.Subject,update:new mu.Subject,delete:new mu.Subject,undelete:new mu.Subject,map:new mu.Subject,unmap:new mu.Subject},this.useNotifications(yc())}useNotifications(e){this.useNotificationsBase(e,this.events,[$r.entityName,Mr.entityName])}async getPermissions(e){return(await this.get(`/permission/me?project_id=${e}`)).permissions}async getProjectPermissions(){return await this.get("/permission/me/projects")}async getUsersWithPermissions(e,r){return r=Ot(r),(await this.get(`/permission/users?project_id=${e}&permissions=${encodeURIComponent(r.join(","))}`)).users}async getUserPermissions(e,r=0){return(await this.get(`/permission/user/${e}?project_id=${r}`)).permissions}async getGroups(){let e=await this.get("/permission/groups");return this.strongify(e,$r)}async getRoles(){let e=await this.get("/permission/roles");return this.strongify(e,Mr)}async getRoleUsers(e){return(await this.get(`/permission/users/role/${e}`)).users}async getGroupUsers(e){return(await this.get(`/permission/users/group/${e}`)).users}async getUserRoles(e,r){let i=await this.get(`/permission/roles/user/${e}?project_id=${r}`);return this.strongify(i,Mr)}async getAllUserRoles(){return await this.get("/permission/users/roles")}async getUserGroups(e){let r=await this.get(`/permission/groups/user/${e}`);return this.strongify(r,$r)}async getRoleGroups(e){let r=await this.get(`/permission/groups/role/${e}`);return this.strongify(r,$r)}async getGroupRoles(e,r){let i=await this.get(`/permission/roles/group/${e}?project_id=${r}`);return this.strongify(i,Mr)}async getAllPermissions(){return(await this.get("/permission/all")).permissions}async getRolePermissions(e,r=0){return(await this.get(`/permission/role/${e}?project_id=${r}`)).permissions}async getGroupPermissions(e,r=0){return(await this.get(`/permission/group/${e}?project_id=${r}`)).permissions}async addRole(e){let r=await this.post("/permission/role",e);return this.strongify(r,Mr)}async addGroup(e){let r=await this.post("/permission/group",e);return this.strongify(r,$r)}async addUserRole(e,r,i){await this.post(`/permission/role/${e}/user/${r}?project_id=${i}`,{})}async setUserRolesForProject(e,r,i){await this.post("/permission/user-roles",{subjectId:e,roleIds:r,projectId:i})}async setGroupRolesForProject(e,r,i){await this.post("/permission/group-roles",{subjectId:e,roleIds:r,projectId:i})}async addUserToGroup(e,r){await this.post(`/permission/group/${e}/user/${r}`,{})}async addGroupRole(e,r,i){await this.post(`/permission/role/${e}/group/${r}?project_id=${i}`,{})}async addRolePermission(e,r,i=0){await this.post(`/permission/role/${e}/permission/${r}?project_id=${i}`,{})}async updateRole(e){let r=await this.put("/permission/role",e);return this.strongify(r,Mr)}async updateGroup(e){let r=await this.put("/permission/group",e);return this.strongify(r,$r)}async removeUserRole(e,r,i){await this.delete(`/permission/role/${e}/user/${r}?project_id=${i}`)}async removeUserFromGroup(e,r){await this.delete(`/permission/group/${e}/user/${r}`)}async removeRole(e){await this.delete(`/permission/role/${e}`)}async removeGroup(e){await this.delete(`/permission/group/${e}`)}async removeGroupRole(e,r,i){await this.delete(`/permission/role/${e}/group/${r}?project_id=${i}`)}async removeRolePermission(e,r,i=0){await this.delete(`/permission/role/${e}/permission/${r}?project_id=${i}`)}};var T1=(g=>(g.UNSET="",g.CAN_READ="CAN_READ",g.CAN_MANAGE_TENANT="CAN_MANAGE_TENANT",g.CAN_MANAGE_USERS="CAN_MANAGE_USERS",g.CAN_MANAGE_PROJECTS="CAN_MANAGE_PROJECTS",g.CAN_CREATE_TESTCASES="CAN_CREATE_TESTCASES",g.CAN_DELETE_TESTCASES="CAN_DELETE_TESTCASES",g.CAN_RUN_TESTCASES="CAN_RUN_TESTCASES",g.CAN_COMMENT="CAN_COMMENT",g.CAN_CREATE_TESTPLANS="CAN_CREATE_TESTPLANS",g.CAN_DELETE_TESTPLANS="CAN_DELETE_TESTPLANS",g.CAN_MANAGE_AGENTS="CAN_MANAGE_AGENTS",g.CAN_ACT_AS_AGENT="CAN_ACT_AS_AGENT",g.CAN_MANAGE_BILLING="CAN_MANAGE_BILLING",g))(T1||{}),jat=xE(Object.keys(T1).map(t=>T1[t]).filter(t=>t!=="")),$at=xE(["CAN_READ"]),Mat=xE(["CAN_COMMENT","CAN_READ"]);function xE(t){return K0(t).sort()}var SE=5e3,VG=["title","steps"],UG=["folder","expected_result","precondition","key"],wE=new Map([["parent_folder_name","folder"],["parent_folder","folder"],["expected_results","expected_result"],["preconditions","precondition"]]),kE=" > ";var zG=["title","result"],WG=["folder","comment","key"];var ZG=X(AE());var ut=X(ot());var IE=class{map=new Map;get size(){return this.map.size}get(e){return this.map.get(e)}has(e){return this.map.has(e)}set(e,r){this.map.set(e,Array.isArray(r)?r:[r])}delete(e){return this.map.delete(e)}add(e,r){let i=this.map.get(e);i||this.map.set(e,i=[]),i.push(r)}addAll(e,r){let i=this.map.get(e);i||this.map.set(e,i=[]),i.push(...r)}remove(e,r){let i=this.get(e);if(i===void 0)return!1;let n=typeof r=="function",a=r,o=!1;for(let s=i.length-1;s>=0;s--){let u=i[s];(n&&a(u)||!n&&u===r)&&(i.splice(s,1),o=!0)}return i.length===0&&this.delete(e),o}[Symbol.iterator](){return this.map[Symbol.iterator]()}keys(){return Array.from(this.map.keys())}entries(){return Array.from(this.map.entries())}forEach(e){this.map.forEach(e)}clear(){this.map.clear()}};var bRe=200,yRe=1e4,EE="cf__",_Re=new RegExp(`^(?!${EE})`);var HG=new Map([["string",{type:"string",validator:t=>typeof t=="string"&&t.length<=bRe,convFromString:t=>t}],["text",{type:"text",validator:t=>typeof t=="string"&&t.length<=yRe,convFromString:t=>t}],["boolean",{type:"boolean",validator:t=>typeof t=="boolean",convFromDb:YW,convFromString:t=>t==="true"||t==="True"||t==="1"}],["integer",{type:"integer",validator:t=>(0,ut.isInt)(t),convFromString:t=>hE(t)}],["number",{type:"number",validator:t=>(0,ut.isNumber)(t,{allowNaN:!1}),convFromString:t=>gE(t)}],["date",{type:"date",validator:t=>(0,ut.isISO8601)(t),convToDb:(t,e)=>t[e]!==void 0?t[e]=new Date(t[e]).toISOString():void 0,convFromString:t=>vG(bG(t))}],["duration",{type:"duration",validator:t=>(0,ut.isNumber)(t,{allowNaN:!1}),convFromString:t=>gE(t)}],["tag",{type:"tag",validator:t=>typeof t=="string",convFromString:t=>t}],["user_id",{type:"user_id",validator:t=>(0,ut.isInt)(t)&&t!==0,convFromString:t=>hE(t)}],["url",{type:"url",validator:t=>typeof t=="string"&&(0,ut.isURL)(t),convFromString:t=>t}]]),yn=class extends _c(De(Be("custom_fields","custom_field",["tenant"],"CF"))){table="";name="";display_name=void 0;type="string";is_builtin=!1;options={projectIds:[],required:!1,visible:!1,includeByDefault:!1,allowCustomValues:!1,description:""};constructor(e){super(),this.initialize(e)}};T([(0,ut.IsString)(),de(40)],yn.prototype,"table",2),T([SG(_Re),(0,ut.IsLowercase)(),lo(3),de(28),(0,ut.IsString)(),TG(),OG()],yn.prototype,"name",2),T([(0,ut.IsString)(),(0,ut.IsOptional)(),de(40)],yn.prototype,"display_name",2),T([(0,ut.IsString)()],yn.prototype,"type",2),T([(0,ut.IsBoolean)(),Gt()],yn.prototype,"is_builtin",2),T([tu()],yn.prototype,"options",2);var xRe=1;function _n(t,e,r,i,n){let a=e?n||SRe(r):void 0;if(a)return`$KEY$${a}`;if(t==="off")return(xRe++).toString();if(t==="title")return(r??"").trim();if(t==="folder_title")return`${i.join(`
|
|
199
|
+
`+this.stack),this.meta=a}toString(){return`${this.code}(${this.status}): ${this.message}`}};function s8(t){return t.message??t+""}function N_e(t){return t==="AUTH_INVALID_USER_OR_PASSWORD"||t==="AUTH_INACTIVE_USER"||t==="AUTH_UNCONFIRMED_USER"||t==="AUTH_UNSUPPORTED_AUTH_TYPE"||t==="AUTH_TOKEN_EXPIRED"||t==="API_ACCESS_DENIED"?403:t==="API_INVALID_REQUEST"||t==="API_INVALID_INPUT"||t==="API_INVALID_INPUT_DATA"||t==="API_INPUT_DATA_CONFLICT"||t==="API_STORAGE_QUOTA_EXCEEDED"?400:500}function z0(t){return t!==void 0&&t!=null}function w3(t){return typeof t!="object"||t===null?!1:Object.keys(t).length>0}var Xl=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","prototype","toLocaleString","toString","valueOf"]);var KW=Symbol("TypeHint");function Ql(t,e,r,i){let n=t.constructor[KW]=t.constructor[KW]||{};n[e]=n[e]||[],n[e].push({from:r,to:i})}function qf(t,e,r=!0){if(e){for(let i in e)(i in t||typeof e[i]=="object"||i.startsWith("cf__"))&&!Xl.has(i)&&typeof t[i]!="function"&&(t[i]=e[i]);if(!r){let i=Object.keys(t);for(let n of i)n in e||delete t[n]}}}function tu(){return function(t,e){Ql(t,e,OFe,AFe)}}function ru(){return function(t,e){Ql(t,e,EFe,G0)}}function Gt(){return function(t,e){Ql(t,e,IFe,G0)}}function ZW(){return function(t,e){Ql(t,e,G0,W0)}}function dn(){return function(t,e){Ql(t,e,G0,W0)}}function H0(){return function(t,e){Ql(t,e,W0,W0)}}function OFe(t,e){let r=t[e];typeof r=="string"&&(t[e]=JSON.parse(r))}function AFe(t,e){let r=t[e];typeof r=="object"&&(t[e]=JSON.stringify(r))}function IFe(t,e){let r=t[e];typeof r=="string"?t[e]=r==="true"||r==="True"||r==="1":typeof r=="number"?t[e]=r!==0:r===null&&(t[e]=!1)}function YW(t,e){let r=t[e];typeof r=="string"?t[e]=r==="true"||r==="True"||r==="1":typeof r=="number"&&(t[e]=r!==0)}function EFe(t,e){let r=t[e];typeof r=="string"?t[e]=Number.parseInt(r):typeof r=="number"?t[e]=r:r!==void 0&&(t[e]=0)}function W0(t,e){delete t[e]}function G0(t,e){}function Ot(t){return t==null?[]:Array.isArray(t)?t:[t]}function K0(t){let e=new Set(t);return Array.from(e.values())}function JW(...t){if(t.length===0)return new Set;let e=new Set;for(let r of t)if(r!=null)for(let i of r)e.add(i);return e}function k3(...t){if(t.length===0)return new Set;t=t.filter(i=>i);let e=new Set;for(let i of t[0])t.every(n=>r(i,n))&&e.add(i);function r(i,n){return n?Array.isArray(n)?n.includes(i):n.has(i):!0}return e}function XW(t,e){!t||typeof t!="object"||Array.isArray(t)||!e||Object.keys(t).forEach(r=>{let i=r;e(i,t[i],n=>t[i]=n,t)})}async function Z0(t,e,r){let i=e.batchSize??Math.max(1,Math.floor(t.length/e.maxConcurrent));if(i<=0)throw new Error("Batch size must be positive");if(t.length<=i)return r(t,0);let n=e.maxConcurrent<=1,a=[];for(let o=0;o<t.length;o+=i){let s=r(t.slice(o,o+i),Math.floor(o/i));n?await s:(a.push(Promise.resolve(s)),a.length>=e.maxConcurrent&&(await Promise.all(a),a.splice(0)))}a.length>0&&await Promise.all(a)}var QW=(0,rH.wrapper)(Th),CFe="/api/v1",eH=60*1e3,_e=class{endpointUrl;timeout=eH;notifications=void 0;apiKey=void 0;enableCookies=!0;customHeaders={};static get numPendingRequests(){return _e._numPendingRequests}static clearCookies(){var e;(e=_e.cookieJar)==null||e.removeAllCookiesSync()}static getCookies(){var e;return((e=_e.cookieJar)==null?void 0:e.toJSON())??{}}static setCookies(e){_e.cookieJar=e}static configureWithUrl(e){let r=new URL(e);_e.configureDefaults({default:{host:r.hostname,port:r.port?Number.parseInt(r.port):r.protocol==="https:"?443:80,protocol:r.protocol},services:{}})}static setBasicAuth(e,r){this.basicAuth={username:e,password:r}}static configureDefaults(e){e??={default:{},services:{}},_e.services={default:{}},r("default",e.default,{}),XW(e.services,(i,n)=>r(i,n,e.default));function r(i,n,a){typeof document=="object"?(n.protocol??=document.location.protocol.replace(/:/,""),n.host??=document.location.hostname,n.port??=document.location.port?parseInt(document.location.port):document.location.protocol==="https:"?443:80):(n.protocol??="http",n.protocol=n.protocol.replace(/:/,""),n.host??="localhost",n.port??=n.protocol==="https"?443:80),_e.services[i]={...a,baseUrl:`${n.protocol}://${n.host}:${n.port}${n.api??CFe}`,timeout:n.timeout??eH}}}constructor(e,r="default"){let i=_e.services[r]??_e.services.default;e?this.endpointUrl=r8(e.includes("://")?e:`${i.baseUrl}/${ay(e,"/")}`,"/"):this.endpointUrl=i.baseUrl,this.timeout=i.timeout}useNotificationsBase(e,r,i,n,a){this.notifications||(this.notifications=e,e.dataInserted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.insert.next(o)}),e.dataUpdated.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.update.next(o)}),e.dataDeleted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{a&&o.values.forEach(a),r.delete.next(o)}),e.dataUndeleted.pipe((0,iu.filter)(o=>i.includes(o.entity))).subscribe(o=>{n&&o.values.forEach(s=>n(s)),r.undelete.next(o)}),e.dataMapped.pipe((0,iu.filter)(o=>k3(i,o.entities).size>0)).subscribe(r.map),e.dataUnmapped.pipe((0,iu.filter)(o=>k3(i,o.entities).size>0)).subscribe(r.unmap))}async get(e,r){return this.internalRequest("get",e,void 0,r)}async post(e,r,i){return this.internalRequest("post",e,r,i)}async put(e,r,i){return this.internalRequest("put",e,r,i)}async delete(e,r,i){return this.internalRequest("delete",e,r,i)}async uploadBinary(e,r,i,n,a){try{return _e.onNumPendingChange.next(++_e._numPendingRequests),(await QW.post(`${this.endpointUrl}/${ay(e,"/")}${tH(n)}`,r,{headers:{Accept:"application/json","Content-Type":i},responseType:"json",withCredentials:!0,jar:this.enableCookies?_e.cookieJar:void 0,auth:_e.basicAuth,maxRedirects:0,onUploadProgress:a?s=>a(s.loaded??0,s.total??0):void 0})).data}catch(o){let s=this.formatError(o);throw _e.onNetworkError.next(s),s}finally{_e.onNumPendingChange.next(--_e._numPendingRequests)}}strongify(e,r,i=!0){return Array.isArray(e)?e.map(a=>this.toClassObject(a,r,i)):this.toClassObject(e,r,i)}toClassObject(e,r,i=!0){let n=new r;return qf(n,e,i),n}async internalRequest(e,r,i,n){var a;try{_e.onNumPendingChange.next(++_e._numPendingRequests),_e.cookieJar=_e.cookieJar??((a=_e.cookieJarFactory)==null?void 0:a.call(_e));let o=`${this.endpointUrl}/${ay(r,"/")}${tH(n)}`;return(await QW.request({url:o,data:i,method:e,responseType:"json",withCredentials:!0,maxRedirects:0,timeout:this.timeout,jar:this.enableCookies?_e.cookieJar:void 0,auth:_e.basicAuth,headers:{Accept:"application/json","Content-Type":"application/json","x-tab-hint":_e.tabHint,"x-wf-client":_e.clientInfo,...this.apiKey?{"x-api-key":this.apiKey}:void 0,...this.customHeaders}})).data}catch(o){let s=this.formatError(o);throw _e.onNetworkError.next(s),s}finally{_e.onNumPendingChange.next(--_e._numPendingRequests)}}formatError(e){if(e.response){let r=e.response,i=r.data;throw new Cl((i==null?void 0:i.code)??"API_INTERNAL_ERROR",(i==null?void 0:i.message)??r.statusText,r.status,i==null?void 0:i.stack,i==null?void 0:i.meta)}else throw new Cl("API_INTERNAL_ERROR",e.message??`Request failed (${e})`,0)}},Ce=_e;An(Ce,"services"),An(Ce,"basicAuth"),An(Ce,"cookieJar"),An(Ce,"cookieJarFactory"),An(Ce,"_numPendingRequests",0),An(Ce,"tabHint",ny()),An(Ce,"clientInfo","unknown"),An(Ce,"onNetworkError",new T3.Subject),An(Ce,"onNumPendingChange",new T3.Subject);Ce.configureDefaults();function tH(t){if(!t||Object.keys(t).length===0)return"";return"?"+Object.keys(t).map(r=>t[r]!==void 0?`${encodeURIComponent(r)}=${encodeURIComponent(e(t[r]))}`:"").filter(r=>r).join("&");function e(r){return Array.isArray(r)?r.map(i=>e(i)).join(","):typeof r=="string"?r:typeof r=="number"?r.toString():typeof r=="boolean"?r?"1":"0":""}}var ec=class extends Ce{constructor(e){super(e,"auth")}async login(e,r,i,n,a){return await this.post("/auth/login",{...a,email:e,password:r,tenant:i,remember:n??!1})}async getLoginInfo(e){return await this.post("/auth/login/info",{email:e})}async getTenantUserLoginStatus(){return await this.get("/auth/login/tenant-status")}async logout(){await this.post("/auth/logout",{})}async logoutAll(e){await this.post(`/auth/logout-all?keep_current=${e?"1":"0"}`,{})}async switchToTenant(e){return await this.post("/auth/switch/"+encodeURIComponent(e),{})}async changePassword(e,r,i){return await this.post("/account/changepassword",{email:e,password:r,newPassword:i})}async changeEmail(e,r,i){return await this.post("/account/changeemail",{currentEmail:e,password:r,newEmail:i})}async changeEmailConfirm(e){await this.post("/account/changeemail/confirm",{token:e})}async me(){try{return await this.get("/account/me")}catch(e){return{loggedIn:!1,requestFailed:!0,error:s8(e)}}}async updateData(e){return await this.put("/account/userdata",e)}async recover(e){await this.post("/account/recover",{email:e})}async recoverConfirm(e,r){await this.post("/account/recover/confirm/"+e,{newPassword:r})}async register(e){await this.post("/signup/register",e)}async checkTenantName(e){return await this.get("/signup/register/check/tenant/"+encodeURIComponent(e))}async checkEmail(e){return await this.get("/signup/register/check/email/"+encodeURIComponent(e))}async invite(e,r,i,n,a){await this.post("/signup/invite",{email:e,tenant:r,firstName:a==null?void 0:a.firstName,lastName:a==null?void 0:a.lastName,initialRoleId:i,initialRoleProjectId:n})}async uninvite(e,r){await this.post("/signup/uninvite",{email:e,tenant:r})}async getInviteInfo(e){return await this.get("/signup/invite/info/"+encodeURIComponent(e))}async getRegisterInfo(e){return await this.get("/signup/register/info/"+encodeURIComponent(e))}async registerConfirm(e,r){await this.post("/signup/register/confirm/"+encodeURIComponent(e),r)}async inviteConfirm(e){await this.post("/signup/invite/confirm",{token:e})}async inviteConfirmCreate(e,r,i,n,a){await this.post("/signup/invite/confirm",{token:e,userDisplayName:n,newPassword:a,firstName:r,lastName:i})}async resend(e){await this.post("/signup/register/confirm-resend",{email:e})}};var Cr=X(ot());var st=X(ot());var uH=X(ot());function Tr(t,e){return new pn(t??"schema",!0,e)}var Zn=class extends Error{constructor(e){super(e)}},se=class extends Zn{constructor(r,i){super(`${r} at ${i.join(".")}`);this.path=i}},oH=Symbol("JsonSchema"),O3=Symbol("JsonPublishedSchema");function iH(t,e){return t[oH]=!0,t[O3]=e,t}var pn=class{constructor(e,r,i){this.name=e;this.isPublished=r;if(i){this.allowExtra=i.allowExtra,this.validator=i.validator,this.allowOverride=!0;for(let[n,a]of i.specs.entries())this.specs.set(n,a)}this.validator=this.createObjectValidator(this),this.jsonSchema=iH({type:"object",title:r?e:void 0,properties:{}},r)}specs=new Map;validator;allowExtra=!1;allowOverride=!1;contextProp;jsonSchema;object(e,r){let i,n;typeof e=="function"?(i="",n=e):(i=e,n=r);let a=new pn(i,!1);return n(a),this.updateJsonSchema(i,!0,a.jsonSchema),this.setupValidationFunc(i,this.createObjectValidator(a)),this.contextProp=i,this}record(e,r,i){let n,a,o;typeof e=="string"?(n=e,typeof r=="function"&&typeof i!="function"?(a=void 0,o=r):(a=r,o=i)):(n="",typeof e=="function"&&typeof r!="function"?(a=void 0,o=e):(a=e,o=r));let s=new pn(n+"_record",!1);return this.setupValidationFunc(n,this.createRecordValidator(a,s)),o(s),this.updateJsonSchema(n,!0,{type:"object",additionalProperties:s.jsonSchema,properties:{}}),this}array(e,r,i){let n="",a,o,s;return typeof e=="function"||Array.isArray(e)?(n="",a=e,s=r):typeof r=="function"||Array.isArray(r)?(n=e,a=r,s=i):typeof e=="object"&&!Array.isArray(e)?(n="",o=e,s=r):typeof r=="object"&&!Array.isArray(r)&&(n=e,o=r,s=i),this.setupArray(n,a,s,o,!1),this.contextProp=n,this}arrayOrOne(e,r,i){let n="",a,o,s;return typeof e=="function"?(n="",a=e,s=r):typeof r=="function"?(n=e,a=r,s=i):typeof e=="object"?(n="",o=e,s=r):typeof r=="object"&&(n=e,o=r,s=i),this.setupArrayOrOne(n,a,s,o,!1),this.contextProp=n,this}string(e,r,i){let n,a,o,s;return typeof e=="string"?(n=e,u(r),typeof i=="object"&&(a=i)):(n="",u(e),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createStringValidator(a,s,o)),this.updateJsonSchema(n,!0,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values,minLength:a==null?void 0:a.minLen,maxLength:a==null?void 0:a.maxLen}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(s=l),typeof l=="function"&&(o=l),typeof l=="object"&&(a=l)}}number(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createNumberValidator(n,a)),this.updateJsonSchema(i,!0,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}integer(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createNumberValidator({...n,integer:!0},a)),this.updateJsonSchema(i,!0,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}bool(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(void 0)),this.updateJsonSchema(r,!0,{type:"boolean"}),this.contextProp=r,this}basic(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBasicValueValidator()),this.updateJsonSchema(r,!0,{nullable:!0,oneOf:[{type:"string"},{type:"number"},{type:"boolean"}]}),this.contextProp=r,this}is(e,r){let i,n;typeof e=="string"?(i=[e],n=r):Array.isArray(e)?(i=e,n=r):(i=[""],n=e);for(let a of i)this.setupValidationFunc(a,n.validator),this.updateJsonSchema(a,!0,n.jsonSchema);return i.length===1&&(this.contextProp=i[0]),this}objectOpt(e,r){let i,n;typeof e=="function"?(i="",n=e):(i=e,n=r);let a=new pn(i,!1);return n(a),this.setupValidationFunc(i,this.createOptValidator(this.createObjectValidator(a))),this.updateJsonSchema(i,!1,a.jsonSchema),this.contextProp=i,this}recordOpt(e,r,i){let n,a,o;typeof e=="string"?(n=e,typeof r=="function"&&typeof i!="function"?(a=void 0,o=r):(a=r,o=i)):(n="",typeof e=="function"&&typeof r!="function"?(a=void 0,o=e):(a=e,o=r));let s=new pn(n+"_record",!1);return this.setupValidationFunc(n,this.createOptValidator(this.createRecordValidator(a,s))),this.updateJsonSchema(n,!1,{type:"object",additionalProperties:s.jsonSchema,properties:{}}),o(s),this}arrayOpt(e,r,i){let n="",a,o,s;return typeof e=="function"||Array.isArray(e)?(n="",a=e,s=r):typeof r=="function"||Array.isArray(r)?(n=e,a=r,s=i):typeof e=="object"&&!Array.isArray(e)?(n="",o=e,s=r):typeof r=="object"&&!Array.isArray(r)&&(n=e,o=r,s=i),this.setupArray(n,a,s,o,!0),this.contextProp=n,this}arrayOrOneOpt(e,r,i){let n="",a,o,s;return typeof e=="function"?(n="",a=e,s=r):typeof r=="function"?(n=e,a=r,s=i):typeof e=="object"?(n="",o=e,s=r):typeof r=="object"&&(n=e,o=r,s=i),this.setupArrayOrOne(n,a,s,o,!0),this.contextProp=n,this}stringOpt(e,r,i){let n,a,o,s;return typeof e=="string"?(n=e,u(r),typeof i=="object"&&(a=i)):(n="",u(e),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createOptValidator(this.createStringValidator(a,s,o))),this.updateJsonSchema(n,!1,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(s=l),typeof l=="function"&&(o=l),typeof l=="object"&&(a=l)}}numberOpt(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator(n,a))),this.updateJsonSchema(i,!1,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}integerOpt(e,r){let i,n,a;return typeof e=="string"?(i=e,o(r)):(i="",o(e)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator({...n,integer:!0},a))),this.updateJsonSchema(i,!1,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function o(s){typeof s=="function"&&(a=s),typeof s=="object"&&(n=s)}}boolOpt(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createOptValidator(this.createBooleanValidator(void 0))),this.updateJsonSchema(r,!1,{type:"boolean"}),this.contextProp=r,this}optIs(e,r){let i,n;return typeof e=="string"?(i=e,n=r):(i="",n=e),this.setupValidationFunc(i,this.createOptValidator(n.validator)),this.updateJsonSchema(i,!1,n.jsonSchema),this.contextProp=i,this}isTrue(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(!0)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!0]}),this.contextProp=r,this}isFalse(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createBooleanValidator(!1)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!1]}),this.contextProp=r,this}isNull(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createNullValidator()),this.updateJsonSchema(r,!0,{type:"string",nullable:!0,maxLength:0}),this.contextProp=r,this}isNotDefined(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createUndefinedValidator()),this.updateJsonSchema(r,!1,{not:{required:[r]}}),this.contextProp=r,this}isAny(e){let r=typeof e=="string"?e:"";return this.setupValidationFunc(r,this.createAnyValidator()),this.updateJsonSchema(r,!1,{}),this.contextProp=r,this}allowExtraProps(){return this.allowExtra=!0,this}oneOf(...e){let r,i;if(typeof e[0]=="string"?(r=e[0],i=e.slice(1)):(r="",i=e),i.length===0)throw new Zn(`Must specify at least one alternative for prop '${r}'`);let n=i.map((a,o)=>{let s=new pn(`alt${o}`,!1);return a(s),s});return this.setupValidationFunc(r,this.createAlternativesValidator(n.map(a=>a.validator))),this.updateJsonSchema(r,!0,{oneOf:n.map(a=>a.jsonSchema)}),this.contextProp=r,this}build(){return this.contextProp=void 0,this}setupValidationFunc(e,r){if(e){if(!this.allowOverride&&this.specs.has(e))throw new Zn(`Property '${e}' is already defined`);this.specs.set(e,r)}else{if(this.specs.size>0)throw new Zn("Cannot replace schema root if props have defined previously");this.validator=r}}setupArray(e,r,i,n,a){if(r){let o=Array.isArray(r)?r:[r];if(o.length===0)throw new Zn("Element definitions must contain at least one schema");let s=[];for(let l of o){let d=new pn(`${e}_element`,!1);if(l(d),!d.validator)throw new Zn(`Missing root definition in array element schema (at '${e}')`);s.push(d)}let u=this.createArrayValidator(s,i??{});this.setupValidationFunc(e,a?this.createOptValidator(u):u),o.length===1?this.updateJsonSchema(e,!a,{type:"array",items:s[0].jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}):this.updateJsonSchema(e,!a,{type:"array",prefixItems:s.map(l=>l.jsonSchema),items:!1,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}else if(n){let o=this.createArrayValidator([n],i??{});this.setupValidationFunc(e,a?this.createOptValidator(o):o),this.updateJsonSchema(e,!a,{type:"array",items:n.jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}}setupArrayOrOne(e,r,i,n,a){let o;if(r){let s=new pn(`${e}_element`,!1);if(r(s),!s.validator)throw new Zn(`Missing root definition in array element schema (at '${e}')`);let u=this.createArrayOrOneValidator(s,i??{});o=s.jsonSchema,this.setupValidationFunc(e,a?this.createOptValidator(u):u)}else if(n){let s=this.createArrayOrOneValidator(n,i??{});this.setupValidationFunc(e,a?this.createOptValidator(s):s),o=n.jsonSchema}else throw new Error("Internal error - No definition or nested schema");this.updateJsonSchema(e,!a,{oneOf:[o,{type:"array",items:o,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}]})}assertContextProp(){let e=this.contextProp,r=this.specs.get(e);if(!e||!r)throw new Zn("Missing previously defined property for opt()");return{prop:e,spec:r}}doc(e,r){if(this.contextProp&&this.jsonSchema.type==="object"){this.jsonSchema.properties??={};let i=this.jsonSchema.properties[this.contextProp];i.description=e,i.default=r}else this.contextProp||(this.jsonSchema.description=e,this.jsonSchema.default=r);return this}validate(e,r){return this.validator(e,{depth:0,maxDepth:(r==null?void 0:r.maxDepth)??100,path:[this.name],allowCycles:(r==null?void 0:r.allowCycles)??!1,seen:[new Set]},!1),e}toJsonSchema(e){let r=this.jsonSchema;return JSON.parse(JSON.stringify(this.jsonSchema,(i,n)=>{if(typeof n=="object"&&n[oH]){let a=n;if(n===r)return i?{$ref:"#"}:n;if(n[O3])return{$ref:e+a.title}}return n}))}createObjectValidator(e){return function(i,n,a){if(typeof i!="object"||i===null){if(a)return!1;throw new se("Expected object",n.path)}nH(i,n);let o=n.seen.at(-1);o&&o.add(i);for(let[s,u]of e.specs.entries()){let l=i[s];if(o&&l!==null&&typeof l=="object"&&o.has(l)){if(!n.allowCycles)throw new se("Cycle detected",[...n.path,s]);continue}n.path.push(s),n.depth++;try{if(n.depth>n.maxDepth)throw new se("Maximum object depth reached",n.path);if(!u(l,n,a))return!1}finally{n.path.pop(),n.depth--}}if(!e.allowExtra){for(let s of Object.keys(i))if(!e.specs.get(s)){if(a)return!1;throw new se(`Unexpected object property '${s}'`,n.path)}}return!0}}createRecordValidator(e,r){let i=e instanceof RegExp?n=>e.test(n):e;return function(a,o,s){if(typeof a!="object"||a===null){if(s)return!1;throw new se("Expected record object",o.path)}nH(a,o);let u=o.seen.at(-1);u&&u.add(a);for(let l of Object.keys(a)){if(i&&!i(l)){if(s)return!1;throw new se(`Unexpected record property name '${l}' not matching '${i.name||"propValidator"}'`,o.path)}let d=a[l];if(u&&d!==null&&typeof d=="object"&&u.has(d)){if(!o.allowCycles)throw new se("Cycle detected",[...o.path,l]);continue}o.path.push(l),o.depth++;try{if(o.depth>o.maxDepth)throw new se("Maximum object depth reached",o.path);let p=r.validator;if(!p(d,o,s))return!1}finally{o.path.pop(),o.depth--}}return!0}}createArrayValidator(e,r){return function(n,a,o){if(!Array.isArray(n)){if(o)return!1;throw new se("Expected array",a.path)}if(r){if(r.len!==void 0&&r.len!==n.length){if(o)return!1;throw new se(`Expected array length ${r.len} but actual is ${n.length}`,a.path)}if(r.minLen!==void 0&&r.minLen>n.length){if(o)return!1;throw new se(`Expected minimum array length ${r.minLen} but actual is ${n.length}`,a.path)}if(r.maxLen!==void 0&&r.maxLen<n.length){if(o)return!1;throw new se(`Expected maximum array length ${r.maxLen} but actual is ${n.length}`,a.path)}}let s=a.seen.at(-1);s&&s.add(n);let u=e.at(-1),l=e.length===1?n.length:Math.max(e.length,n.length);for(let d=0;d<l;d++){let p=n[d];if(s&&p!==null&&typeof p=="object"&&s.has(p)){if(!a.allowCycles)throw new se("Cycle detected",[...a.path,d.toString()]);continue}a.path.push(d.toString()),a.depth++;try{if(a.depth>a.maxDepth)throw new se("Maximum object depth reached",a.path);let f=(e[d]??u).validator;if(!f(p,a,o))return!1}finally{a.path.pop(),a.depth--}}return!0}}createStringValidator(e,r,i){return function(a,o,s){if(typeof a!="string")if(e!=null&&e.allowToString)a=`${a}`;else{if(s)return!1;throw new se("Expected string",o.path)}if(typeof a!="string")return!1;if(e){if(e.len!==void 0&&e.len!==a.length){if(s)return!1;throw new se(`Expected string length ${e.len} but actual is ${a.length}`,o.path)}if(e.minLen!==void 0&&e.minLen>a.length){if(s)return!1;throw new se(`Expected string min length ${e.minLen} but actual is ${a.length}`,o.path)}if(e.maxLen!==void 0&&e.maxLen<a.length){if(s)return!1;throw new se(`Expected string max length ${e.maxLen} but actual is ${a.length}`,o.path)}if(e.values&&!e.values.includes(a)){if(s)return!1;throw new se(`String must have one of the allowed values: ${e.values.join("|")}`,o.path)}if(e.value&&e.value!==a){if(s)return!1;throw new se(`String must have the following value: '${e.value}'`,o.path)}}if(r&&!r.test(a)){if(s)return!1;throw new se(`Value '${o8(a,200)}' does not match required regular expression`,o.path)}if(i){let u=aH(i,a);if(u){if(s)return!1;throw new se(`Invalid string: ${u}`,o.path)}}return!0}}createNumberValidator(e,r){return function(n,a,o){if(typeof n!="number"){if(o)return!1;throw new se("Expected number",a.path)}if(e){if(e.integer&&!Number.isSafeInteger(n)){if(o)return!1;throw new se(`Expected integer number but actual is ${n}`,a.path)}if(e.positive&&n<=0){if(o)return!1;throw new se(`Expected number with positive value but actual is ${n}`,a.path)}if(e.nonNegative&&n<0){if(o)return!1;throw new se(`Expected number with non-negative value but actual is ${n}`,a.path)}if(e.min!==void 0&&e.min>n){if(o)return!1;throw new se(`Expected number min value ${e.min} but actual is ${n}`,a.path)}if(e.max!==void 0&&e.max<n){if(o)return!1;throw new se(`Expected number max value ${e.max} but actual is ${n}`,a.path)}if(e.allowNotFinite!==!0&&!Number.isFinite(n)){if(o)return!1;throw new se(`Expected number with finite value but actual is ${n}`,a.path)}if(e.negative&&n>=0){if(o)return!1;throw new se(`Expected number with negative value but actual is ${n}`,a.path)}if(e.values&&!e.values.includes(n)){if(o)return!1;throw new se(`Number must have one of the allowed values: ${e.values.join("|")}`,a.path)}}if(r){let s=aH(r,n);if(s){if(o)return!1;throw new se(`Invalid number: ${s}`,a.path)}}return!0}}createBooleanValidator(e){return function(i,n,a){if(typeof i!="boolean"){if(a)return!1;throw new se("Expected boolean",n.path)}let o=e===void 0||i===e;if(!o&&!a)throw new se(`Expected boolean value ${e}`,n.path);return o}}createNullValidator(){return function(r,i,n){if(r!==null){if(n)return!1;throw new se("Expected null",i.path)}return!0}}createUndefinedValidator(){return function(r,i,n){if(r!==void 0){if(n)return!1;throw new se("Expected undefined",i.path)}return!0}}createBasicValueValidator(){return function(r,i,n){let a=typeof r;if(a!=="string"&&a!=="number"&&a!=="boolean"&&r!==null){if(n)return!1;throw new se("Expected basic value",i.path)}return!0}}createAnyValidator(){return function(r,i,n){return!0}}createOptValidator(e){return function(i,n,a){return i===void 0?!0:e(i,n,a)}}createOrNullValidator(e){return function(i,n,a){return i===null?!0:e(i,n,a)}}createOptOrNullValidator(e){return function(i,n,a){return i==null?!0:e(i,n,a)}}createAlternativesValidator(e){return function(i,n,a){let o=[];for(let s of e)try{if(n.seen&&n.seen.push(new Set),s(i,n,!0))return!0}finally{n.seen&&n.seen.pop()}if(a)return!1;for(let s of e)try{s(i,n,!1)}catch(u){o.push(u.message)}throw new se(`Validation failed because no alternatives match: '${o.join(", ")}'`,n.path)}}createArrayOrOneValidator(e,r){let i=this.createArrayValidator([e],r),n=e.validator;return function(o,s,u){if(Array.isArray(o)){if(!i(o,s,u))return!1}else if(!n(o,s,u))return!1;return!0}}updateJsonSchema(e,r,i){if(e){let n=this.jsonSchema;if(n.type!=="object")throw new Error("Internal error: wrong json schema base type: "+n.type);n.properties??={},n.properties[e]=i,r&&(n.required??=[],n.required.push(e))}else{let n=this.jsonSchema.title;this.jsonSchema=iH(i,!!i[O3]),this.jsonSchema.title??=n}}};function nH(t,e){if(Object.prototype.hasOwnProperty.call(t,"__proto__")||t.prototype!==void 0)throw new se("Unexpected forbidden prototype property",e.path)}function aH(t,e){try{let r=t(e);if(r===!1)throw new Error(`'${t.name||"Value"}' validation failed`);if(Array.isArray(r))throw new Error(r.join(", "));if(typeof r=="string")throw new Error(r)}catch(r){return r.message}}var Y0=["eq","not_eq","like","not_like","in","not_in","like_in","not_like_in","gt","lt","lte","gte","range"];var At=t=>/^[$a-z][$a-z0-9_.]*$/i.test(t)&&!Xl.has(t),tc=t=>!Xl.has(t),PFe=t=>!Xl.has(t),Rf=t=>typeof t=="string"&&t.length===24&&t[23]==="Z"&&(0,uH.isISO8601)(t),sH=Tr("ByKeysValue").basic().doc("Any basic JSON value (string, number, boolean, null)"),jFe=Tr("FkIds").record(PFe,t=>t.integer()).doc("Entity ids for mapped entities, e.g. testcase_id"),io=Tr("ByKeys");io.record(At,t=>t.oneOf(e=>e.arrayOrOne(sH),e=>e.object(r=>r.string("op",{values:Y0}).doc("The comparison/matching operation to perform on the value: "+Y0.join(", ")).arrayOrOne("value",sH).doc("The target value(s) or pattern").isNotDefined("col")),e=>e.object(r=>r.string("op",{values:Y0}).doc("The comparison/matching operation to perform on the value: "+Y0.join(", ")).isNotDefined("value").string("col",At).doc("The target column/prop name (instead of fixed value)")),e=>e.arrayOrOne(io))).doc("Describes matching/filtering conditions");var A3=Tr("MapJoin");A3.arrayOrOneOpt("entities",t=>t.string(tc,{allowToString:!0})).doc("The list of entity names which are part of the mapping (for mapping relationship tables)").stringOpt("entity",tc,{allowToString:!0}).doc("The entity name (for direct mapping via a foreign key)").arrayOrOneOpt("ids",t=>t.is(jFe)).doc("A list of id tuples to filter by").boolOpt("inverse").doc("Inverts the result to retrieve non-mapped entities",!1).optIs("filter",io).doc("The filter expression applied to the mapping relationship entity").optIs("resultFilter",io).doc("The filter expression applied to the result entity (if 'result' is set)").boolOpt("countOnly").doc("Only returns a count instead of a list of entities",!1).boolOpt("idOnly").doc("Only retrieves entity ids, omitting all other columns",!1).boolOpt("optional").doc("Indicates that the mapping is optional and may be 'null' in the result",!1).boolOpt("includeDeleted").doc("Includes deleted member entities in the mapping search result",!1).boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).boolOpt("omit").doc("Omit the mapping result from result entities - For intermediate nested mappings").stringOpt("result",tc,{allowToString:!0}).doc("The entity to use as the result instead of the mapping relationship entity data").arrayOrOneOpt("map",A3).doc("Nested mapping starting from one of the member entities of this mapping");var lH=Tr("DataReadParams").objectOpt("pagination",t=>t.integerOpt("offset").doc("The offset the result starts at",0).integerOpt("pageAtId").doc("Selects the page with the given id in the result, given a limit (= page size)").integerOpt("inflate").doc("Adds a number of items before the start offset and after the limit (for pagination use)").integerOpt("limit").doc("The maximum number of result rows")).doc("Pagination settings control how much data from a result is fetched").arrayOpt("order",t=>t.oneOf(e=>e.string("order",{value:"seq"}).doc("Ordering by a pre-defined value sequence - the partial ordering of the given values in the result is preserved").string("column",At).doc("The name of the column to order by").array("seq",r=>r.number()),e=>e.string("column",At).doc("The name of the column to order by").string("order",{values:["asc","desc"]}).doc("Either 'asc'ending or 'desc'ending order for the given column"))).doc("Controls the ordering of the result").boolOpt("includeTotalCount").doc("Includes the total result count if pagination options were given").optIs("filter",io).doc("Filter/search terms").arrayOpt("computedColumns",t=>t.string(At)).doc("List of computed columns to include (by default includes all)").integerOpt("id",{nonNegative:!0}).doc("Only return the entity with the given id, returns one or none").arrayOpt("ids",t=>t.integer({nonNegative:!0})).doc("Only return the entities with the given ids").arrayOrOneOpt("map",A3).doc("Map expression to expand properties or relationships with other entities").boolOpt("includeDeleted").doc("Includes soft-deleted entitites in the result (if applicable)").boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).stringOpt("asOf",Rf).doc("Perform a history query given the asOf timestamp (if available)").boolOpt("idOnly").doc("Only returns ids in the result, omitting all other properties").boolOpt("countOnly").doc("Returns only the length of the result list instead of the result list itself").build(),Het=Tr("WithId").integer("id").doc("The unique entity id").allowExtraProps();function I3(t){let e=t;return e.ctors?e.ctors.map(r=>r.entityName).sort():Array.isArray(t)?t.map(r=>typeof r!="string"?r.entityName:r).sort():typeof t!="string"?t.entityName:t}var E3=0,$Fe=2147483647;function J0(t){return t!==void 0&&Number.isSafeInteger(t)&&t<=$Fe&&t!==E3}var Lf="_traits";function no(t){return t[Lf]=t[Lf]??[],t[Lf].push(t),t}function Bf(t,e){let r=t[Lf]??t.constructor[Lf];return r?r.find&&!!r.find(i=>i.name===e.name):!1}var ao=class extends Error{},X0=class extends ao{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},Q0=class extends ao{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},e1=class extends ao{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},oo=class extends ao{},rc=class extends ao{constructor(e){super(`Invalid unit ${e}`)}},It=class extends ao{},fn=class extends ao{constructor(){super("Zone is an abstract class")}};var F="numeric",mn="short",vr="long",ds={year:F,month:F,day:F},Vf={year:F,month:mn,day:F},C3={year:F,month:mn,day:F,weekday:mn},Uf={year:F,month:vr,day:F},zf={year:F,month:vr,day:F,weekday:vr},Wf={hour:F,minute:F},Hf={hour:F,minute:F,second:F},Gf={hour:F,minute:F,second:F,timeZoneName:mn},Kf={hour:F,minute:F,second:F,timeZoneName:vr},Zf={hour:F,minute:F,hourCycle:"h23"},Yf={hour:F,minute:F,second:F,hourCycle:"h23"},Jf={hour:F,minute:F,second:F,hourCycle:"h23",timeZoneName:mn},Xf={hour:F,minute:F,second:F,hourCycle:"h23",timeZoneName:vr},Qf={year:F,month:F,day:F,hour:F,minute:F},em={year:F,month:F,day:F,hour:F,minute:F,second:F},tm={year:F,month:mn,day:F,hour:F,minute:F},rm={year:F,month:mn,day:F,hour:F,minute:F,second:F},P3={year:F,month:mn,day:F,weekday:mn,hour:F,minute:F},im={year:F,month:vr,day:F,hour:F,minute:F,timeZoneName:mn},nm={year:F,month:vr,day:F,hour:F,minute:F,second:F,timeZoneName:mn},am={year:F,month:vr,day:F,weekday:vr,hour:F,minute:F,timeZoneName:vr},om={year:F,month:vr,day:F,weekday:vr,hour:F,minute:F,second:F,timeZoneName:vr};var nr=class{get type(){throw new fn}get name(){throw new fn}get ianaName(){return this.name}get isUniversal(){throw new fn}offsetName(e,r){throw new fn}formatOffset(e,r){throw new fn}offset(e){throw new fn}equals(e){throw new fn}get isValid(){throw new fn}};var j3=null,Yn=class extends nr{static get instance(){return j3===null&&(j3=new Yn),j3}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return r1(e,r,i)}formatOffset(e,r){return ps(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}};var n1={};function MFe(t){return n1[t]||(n1[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),n1[t]}var NFe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function DFe(t,e){let r=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,a,o,s,u,l,d]=i;return[o,n,a,s,u,l,d]}function FFe(t,e){let r=t.formatToParts(e),i=[];for(let n=0;n<r.length;n++){let{type:a,value:o}=r[n],s=NFe[a];a==="era"?i[s]=o:ue(s)||(i[s]=parseInt(o,10))}return i}var i1={},yt=class extends nr{static create(e){return i1[e]||(i1[e]=new yt(e)),i1[e]}static resetCache(){i1={},n1={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=yt.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return r1(e,r,i,this.name)}formatOffset(e,r){return ps(this.offset(e),r)}offset(e){let r=new Date(e);if(isNaN(r))return NaN;let i=MFe(this.name),[n,a,o,s,u,l,d]=i.formatToParts?FFe(i,r):DFe(i,r);s==="BC"&&(n=-Math.abs(n)+1);let f=sm({year:n,month:a,day:o,hour:u===24?0:u,minute:l,second:d,millisecond:0}),m=+r,g=m%1e3;return m-=g>=0?g:1e3+g,(f-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}};var cH={};function qFe(t,e={}){let r=JSON.stringify([t,e]),i=cH[r];return i||(i=new Intl.ListFormat(t,e),cH[r]=i),i}var $3={};function M3(t,e={}){let r=JSON.stringify([t,e]),i=$3[r];return i||(i=new Intl.DateTimeFormat(t,e),$3[r]=i),i}var N3={};function RFe(t,e={}){let r=JSON.stringify([t,e]),i=N3[r];return i||(i=new Intl.NumberFormat(t,e),N3[r]=i),i}var D3={};function LFe(t,e={}){let{base:r,...i}=e,n=JSON.stringify([t,i]),a=D3[n];return a||(a=new Intl.RelativeTimeFormat(t,e),D3[n]=a),a}var um=null;function BFe(){return um||(um=new Intl.DateTimeFormat().resolvedOptions().locale,um)}function VFe(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let i,n;try{i=M3(t).resolvedOptions(),n=t}catch{let u=t.substring(0,r);i=M3(u).resolvedOptions(),n=u}let{numberingSystem:a,calendar:o}=i;return[n,a,o]}}function UFe(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function zFe(t){let e=[];for(let r=1;r<=12;r++){let i=H.utc(2016,r,1);e.push(t(i))}return e}function WFe(t){let e=[];for(let r=1;r<=7;r++){let i=H.utc(2016,11,13+r);e.push(t(i))}return e}function a1(t,e,r,i,n){let a=t.listingMode(r);return a==="error"?null:a==="en"?i(e):n(e)}function HFe(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var F3=class{constructor(e,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:a,...o}=i;if(!r||Object.keys(o).length>0){let s={useGrouping:!1,...i};i.padTo>0&&(s.minimumIntegerDigits=i.padTo),this.inf=RFe(e,s)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):ic(e,3);return Ke(r,this.padTo)}}},q3=class{constructor(e,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let o=-1*(e.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&yt.create(s).valid?(n=s,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=M3(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},R3=class{constructor(e,r,i){this.opts={style:"long",...i},!r&&o1()&&(this.rtf=LFe(e,i))}format(e,r){return this.rtf?this.rtf.format(e,r):dH(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},xe=class{static fromOpts(e){return xe.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,r,i,n=!1){let a=e||Te.defaultLocale,o=a||(n?"en-US":BFe()),s=r||Te.defaultNumberingSystem,u=i||Te.defaultOutputCalendar;return new xe(o,s,u,a)}static resetCache(){um=null,$3={},N3={},D3={}}static fromObject({locale:e,numberingSystem:r,outputCalendar:i}={}){return xe.create(e,r,i)}constructor(e,r,i,n){let[a,o,s]=VFe(e);this.locale=a,this.numberingSystem=r||o||null,this.outputCalendar=i||s||null,this.intl=UFe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=HFe(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:xe.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1,i=!0){return a1(this,e,i,L3,()=>{let n=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=zFe(o=>this.extract(o,n,"month"))),this.monthsCache[a][e]})}weekdays(e,r=!1,i=!0){return a1(this,e,i,B3,()=>{let n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=r?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=WFe(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[a][e]})}meridiems(e=!0){return a1(this,void 0,e,()=>V3,()=>{if(!this.meridiemCache){let r={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[H.utc(2016,11,13,9),H.utc(2016,11,13,19)].map(i=>this.extract(i,r,"dayperiod"))}return this.meridiemCache})}eras(e,r=!0){return a1(this,e,r,U3,()=>{let i={era:e};return this.eraCache[e]||(this.eraCache[e]=[H.utc(-40,1,1),H.utc(2017,1,1)].map(n=>this.extract(n,i,"era"))),this.eraCache[e]})}extract(e,r,i){let n=this.dtFormatter(e,r),a=n.formatToParts(),o=a.find(s=>s.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new F3(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new q3(e,this.intl,r)}relFormatter(e={}){return new R3(this.intl,this.isEnglish(),e)}listFormatter(e={}){return qFe(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}};var W3=null,Ze=class extends nr{static get utcInstance(){return W3===null&&(W3=new Ze(0)),W3}static instance(e){return e===0?Ze.utcInstance:new Ze(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new Ze(nu(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ps(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ps(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return ps(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}};var nc=class extends nr{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function hn(t,e){let r;if(ue(t)||t===null)return e;if(t instanceof nr)return t;if(pH(t)){let i=t.toLowerCase();return i==="default"?e:i==="local"||i==="system"?Yn.instance:i==="utc"||i==="gmt"?Ze.utcInstance:Ze.parseSpecifier(i)||yt.create(t)}else return Jn(t)?Ze.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new nc(t)}var fH=()=>Date.now(),mH="system",hH=null,gH=null,vH=null,bH=60,yH,Te=class{static get now(){return fH}static set now(e){fH=e}static set defaultZone(e){mH=e}static get defaultZone(){return hn(mH,Yn.instance)}static get defaultLocale(){return hH}static set defaultLocale(e){hH=e}static get defaultNumberingSystem(){return gH}static set defaultNumberingSystem(e){gH=e}static get defaultOutputCalendar(){return vH}static set defaultOutputCalendar(e){vH=e}static get twoDigitCutoffYear(){return bH}static set twoDigitCutoffYear(e){bH=e%100}static get throwOnInvalid(){return yH}static set throwOnInvalid(e){yH=e}static resetCaches(){xe.resetCache(),yt.resetCache()}};function ue(t){return typeof t>"u"}function Jn(t){return typeof t=="number"}function lm(t){return typeof t=="number"&&t%1===0}function pH(t){return typeof t=="string"}function _H(t){return Object.prototype.toString.call(t)==="[object Date]"}function o1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function xH(t){return Array.isArray(t)?t:[t]}function H3(t,e,r){if(t.length!==0)return t.reduce((i,n)=>{let a=[e(n),n];return i&&r(i[0],a[0])===i[0]?i:a},null)[1]}function SH(t,e){return e.reduce((r,i)=>(r[i]=t[i],r),{})}function fs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xn(t,e,r){return lm(t)&&t>=e&&t<=r}function GFe(t,e){return t-e*Math.floor(t/e)}function Ke(t,e=2){let r=t<0,i;return r?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function so(t){if(!(ue(t)||t===null||t===""))return parseInt(t,10)}function ms(t){if(!(ue(t)||t===null||t===""))return parseFloat(t)}function cm(t){if(!(ue(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function ic(t,e,r=!1){let i=10**e;return(r?Math.trunc:Math.round)(t*i)/i}function au(t){return t%4===0&&(t%100!==0||t%400===0)}function ou(t){return au(t)?366:365}function ac(t,e){let r=GFe(e-1,12)+1,i=t+(e-r)/12;return r===2?au(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function sm(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function oc(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,r=t-1,i=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return e===4||i===3?53:52}function dm(t){return t>99?t:t>Te.twoDigitCutoffYear?1900+t:2e3+t}function r1(t,e,r,i=null){let n=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(a.timeZone=i);let o={timeZoneName:e,...a},s=new Intl.DateTimeFormat(r,o).formatToParts(n).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function nu(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let i=parseInt(e,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function G3(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new It(`Invalid unit value ${t}`);return e}function sc(t,e){let r={};for(let i in t)if(fs(t,i)){let n=t[i];if(n==null)continue;r[e(i)]=G3(n)}return r}function ps(t,e){let r=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${Ke(r,2)}:${Ke(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${Ke(r,2)}${Ke(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pm(t){return SH(t,["hour","minute","second","millisecond"])}var KFe=["January","February","March","April","May","June","July","August","September","October","November","December"],K3=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ZFe=["J","F","M","A","M","J","J","A","S","O","N","D"];function L3(t){switch(t){case"narrow":return[...ZFe];case"short":return[...K3];case"long":return[...KFe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Z3=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Y3=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],YFe=["M","T","W","T","F","S","S"];function B3(t){switch(t){case"narrow":return[...YFe];case"short":return[...Y3];case"long":return[...Z3];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var V3=["AM","PM"],JFe=["Before Christ","Anno Domini"],XFe=["BC","AD"],QFe=["B","A"];function U3(t){switch(t){case"narrow":return[...QFe];case"short":return[...XFe];case"long":return[...JFe];default:return null}}function wH(t){return V3[t.hour<12?0:1]}function kH(t,e){return B3(e)[t.weekday-1]}function TH(t,e){return L3(e)[t.month-1]}function OH(t,e){return U3(e)[t.year<0?0:1]}function dH(t,e,r="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){let p=t==="days";switch(e){case 1:return p?"tomorrow":`next ${n[t][0]}`;case-1:return p?"yesterday":`last ${n[t][0]}`;case 0:return p?"today":`this ${n[t][0]}`;default:}}let o=Object.is(e,-0)||e<0,s=Math.abs(e),u=s===1,l=n[t],d=i?u?l[1]:l[2]||l[1]:u?n[t][0]:t;return o?`${s} ${d} ago`:`in ${s} ${d}`}function AH(t,e){let r="";for(let i of t)i.literal?r+=i.val:r+=e(i.val);return r}var eqe={D:ds,DD:Vf,DDD:Uf,DDDD:zf,t:Wf,tt:Hf,ttt:Gf,tttt:Kf,T:Zf,TT:Yf,TTT:Jf,TTTT:Xf,f:Qf,ff:tm,fff:im,ffff:am,F:em,FF:rm,FFF:nm,FFFF:om},Ye=class{static create(e,r={}){return new Ye(e,r)}static parseFormat(e){let r=null,i="",n=!1,a=[];for(let o=0;o<e.length;o++){let s=e.charAt(o);s==="'"?(i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),r=null,i="",n=!n):n||s===r?i+=s:(i.length>0&&a.push({literal:/^\s+$/.test(i),val:i}),i=s,r=s)}return i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),a}static macroTokenToFormatOpts(e){return eqe[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTime(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTimeParts(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).formatToParts()}formatInterval(e,r={}){return this.loc.dtFormatter(e.start,{...this.opts,...r}).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).resolvedOptions()}num(e,r=0){if(this.opts.forceSimple)return Ke(e,r);let i={...this.opts};return r>0&&(i.padTo=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,r){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(m,g)=>this.loc.extract(e,m,g),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",s=()=>i?wH(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,g)=>i?TH(e,m):a(g?{month:m}:{month:m,day:"numeric"},"month"),l=(m,g)=>i?kH(e,m):a(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),d=m=>{let g=Ye.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},p=m=>i?OH(e,m):a({era:m},"era"),f=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(m)}};return AH(Ye.parseFormat(r),f)}formatDurationFromString(e,r){let i=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=u=>l=>{let d=i(l);return d?this.num(u.get(d),l.length):l},a=Ye.parseFormat(r),o=a.reduce((u,{literal:l,val:d})=>l?u:u.concat(d),[]),s=e.shiftTo(...o.map(i).filter(u=>u));return AH(a,n(s))}};var Et=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var EH=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function lc(...t){let e=t.reduce((r,i)=>r+i.source,"");return RegExp(`^${e}$`)}function cc(...t){return e=>t.reduce(([r,i,n],a)=>{let[o,s,u]=a(e,n);return[{...r,...o},s||i,u]},[{},null,1]).slice(0,2)}function dc(t,...e){if(t==null)return[null,null];for(let[r,i]of e){let n=r.exec(t);if(n)return i(n)}return[null,null]}function CH(...t){return(e,r)=>{let i={},n;for(n=0;n<t.length;n++)i[t[n]]=so(e[r+n]);return[i,null,r+n]}}var PH=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,tqe=`(?:${PH.source}?(?:\\[(${EH.source})\\])?)?`,J3=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jH=RegExp(`${J3.source}${tqe}`),X3=RegExp(`(?:T${jH.source})?`),rqe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,iqe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,nqe=/(\d{4})-?(\d{3})/,aqe=CH("weekYear","weekNumber","weekDay"),oqe=CH("year","ordinal"),sqe=/(\d{4})-(\d\d)-(\d\d)/,$H=RegExp(`${J3.source} ?(?:${PH.source}|(${EH.source}))?`),uqe=RegExp(`(?: ${$H.source})?`);function uc(t,e,r){let i=t[e];return ue(i)?r:so(i)}function lqe(t,e){return[{year:uc(t,e),month:uc(t,e+1,1),day:uc(t,e+2,1)},null,e+3]}function pc(t,e){return[{hours:uc(t,e,0),minutes:uc(t,e+1,0),seconds:uc(t,e+2,0),milliseconds:cm(t[e+3])},null,e+4]}function fm(t,e){let r=!t[e]&&!t[e+1],i=nu(t[e+1],t[e+2]),n=r?null:Ze.instance(i);return[{},n,e+3]}function mm(t,e){let r=t[e]?yt.create(t[e]):null;return[{},r,e+1]}var cqe=RegExp(`^T?${J3.source}$`),dqe=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function pqe(t){let[e,r,i,n,a,o,s,u,l]=t,d=e[0]==="-",p=u&&u[0]==="-",f=(m,g=!1)=>m!==void 0&&(g||m&&d)?-m:m;return[{years:f(ms(r)),months:f(ms(i)),weeks:f(ms(n)),days:f(ms(a)),hours:f(ms(o)),minutes:f(ms(s)),seconds:f(ms(u),u==="-0"),milliseconds:f(cm(l),p)}]}var fqe={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Q3(t,e,r,i,n,a,o){let s={year:e.length===2?dm(so(e)):so(e),month:K3.indexOf(r)+1,day:so(i),hour:so(n),minute:so(a)};return o&&(s.second=so(o)),t&&(s.weekday=t.length>3?Z3.indexOf(t)+1:Y3.indexOf(t)+1),s}var mqe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hqe(t){let[,e,r,i,n,a,o,s,u,l,d,p]=t,f=Q3(e,n,i,r,a,o,s),m;return u?m=fqe[u]:l?m=0:m=nu(d,p),[f,new Ze(m)]}function gqe(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var vqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,bqe=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,yqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function IH(t){let[,e,r,i,n,a,o,s]=t;return[Q3(e,n,i,r,a,o,s),Ze.utcInstance]}function _qe(t){let[,e,r,i,n,a,o,s]=t;return[Q3(e,s,r,i,n,a,o),Ze.utcInstance]}var xqe=lc(rqe,X3),Sqe=lc(iqe,X3),wqe=lc(nqe,X3),kqe=lc(jH),MH=cc(lqe,pc,fm,mm),Tqe=cc(aqe,pc,fm,mm),Oqe=cc(oqe,pc,fm,mm),Aqe=cc(pc,fm,mm);function NH(t){return dc(t,[xqe,MH],[Sqe,Tqe],[wqe,Oqe],[kqe,Aqe])}function DH(t){return dc(gqe(t),[mqe,hqe])}function FH(t){return dc(t,[vqe,IH],[bqe,IH],[yqe,_qe])}function qH(t){return dc(t,[dqe,pqe])}var Iqe=cc(pc);function RH(t){return dc(t,[cqe,Iqe])}var Eqe=lc(sqe,uqe),Cqe=lc($H),Pqe=cc(pc,fm,mm);function LH(t){return dc(t,[Eqe,MH],[Cqe,Pqe])}var jqe="Invalid Duration",BH={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},$qe={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...BH},Or=146097/400,fc=146097/4800,Mqe={years:{quarters:4,months:12,weeks:Or/7,days:Or,hours:Or*24,minutes:Or*24*60,seconds:Or*24*60*60,milliseconds:Or*24*60*60*1e3},quarters:{months:3,weeks:Or/28,days:Or/4,hours:Or*24/4,minutes:Or*24*60/4,seconds:Or*24*60*60/4,milliseconds:Or*24*60*60*1e3/4},months:{weeks:fc/7,days:fc,hours:fc*24,minutes:fc*24*60,seconds:fc*24*60*60,milliseconds:fc*24*60*60*1e3},...BH},su=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Nqe=su.slice(0).reverse();function hs(t,e,r=!1){let i={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ne(i)}function Dqe(t){return t<0?Math.floor(t):Math.ceil(t)}function VH(t,e,r,i,n){let a=t[n][r],o=e[r]/a,s=Math.sign(o)===Math.sign(i[n]),u=!s&&i[n]!==0&&Math.abs(o)<=1?Dqe(o):Math.trunc(o);i[n]+=u,e[r]-=u*a}function Fqe(t,e){Nqe.reduce((r,i)=>ue(e[i])?r:(r&&VH(t,e,r,e,i),i),null)}function qqe(t){let e={};for(let[r,i]of Object.entries(t))i!==0&&(e[r]=i);return e}var ne=class{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,i=r?Mqe:$qe;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||xe.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,r){return ne.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new It(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ne({values:sc(e,ne.normalizeUnit),loc:xe.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(Jn(e))return ne.fromMillis(e);if(ne.isDuration(e))return e;if(typeof e=="object")return ne.fromObject(e);throw new It(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[i]=qH(e);return i?ne.fromObject(i,r):ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[i]=RH(e);return i?ne.fromObject(i,r):ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the Duration is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new e1(i);return new ne({invalid:i})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new rc(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ye.create(this.loc,i).formatDurationFromString(this,e):jqe}toHuman(e={}){let r=su.map(i=>{let n=this.values[i];return ue(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ic(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();if(r<0||r>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};let i=this.shiftTo("hours","minutes","seconds","milliseconds"),n=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(n+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(n+=".SSS"));let a=i.toFormat(n);return e.includePrefix&&(a="T"+a),a}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e),i={};for(let n of su)(fs(r.values,n)||fs(this.values,n))&&(i[n]=r.get(n)+this.get(n));return hs(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let i of Object.keys(this.values))r[i]=G3(e(this.values[i],i));return hs(this,{values:r},!0)}get(e){return this[ne.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...sc(e,ne.normalizeUnit)};return hs(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){let o={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:n,conversionAccuracy:i};return hs(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Fqe(this.matrix,e),hs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=qqe(this.normalize().shiftToAll().toObject());return hs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ne.normalizeUnit(o));let r={},i={},n=this.toObject(),a;for(let o of su)if(e.indexOf(o)>=0){a=o;let s=0;for(let l in i)s+=this.matrix[l][o]*i[l],i[l]=0;Jn(n[o])&&(s+=n[o]);let u=Math.trunc(s);r[o]=u,i[o]=(s*1e3-u*1e3)/1e3;for(let l in n)su.indexOf(l)>su.indexOf(o)&&VH(this.matrix,n,l,r,o)}else Jn(n[o])&&(i[o]=n[o]);for(let o in i)i[o]!==0&&(r[a]+=o===a?i[o]:i[o]/this.matrix[a][o]);return hs(this,{values:r},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return hs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of su)if(!r(this.values[i],e.values[i]))return!1;return!0}};var mc="Invalid Interval";function Rqe(t,e){return!t||!t.isValid?Ne.invalid("missing or invalid start"):!e||!e.isValid?Ne.invalid("missing or invalid end"):e<t?Ne.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var Ne=class{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the Interval is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new Q0(i);return new Ne({invalid:i})}static fromDateTimes(e,r){let i=hc(e),n=hc(r),a=Rqe(i,n);return a??new Ne({start:i,end:n})}static after(e,r){let i=ne.fromDurationLike(r),n=hc(e);return Ne.fromDateTimes(n,n.plus(i))}static before(e,r){let i=ne.fromDurationLike(r),n=hc(e);return Ne.fromDateTimes(n.minus(i),n)}static fromISO(e,r){let[i,n]=(e||"").split("/",2);if(i&&n){let a,o;try{a=H.fromISO(i,r),o=a.isValid}catch{o=!1}let s,u;try{s=H.fromISO(n,r),u=s.isValid}catch{u=!1}if(o&&u)return Ne.fromDateTimes(a,s);if(o){let l=ne.fromISO(n,r);if(l.isValid)return Ne.after(a,l)}else if(u){let l=ne.fromISO(i,r);if(l.isValid)return Ne.before(s,l)}}return Ne.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;let r=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?Ne.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(hc).filter(o=>this.contains(o)).sort(),i=[],{s:n}=this,a=0;for(;n<this.e;){let o=r[a]||this.e,s=+o>+this.e?this.e:o;i.push(Ne.fromDateTimes(n,s)),n=s,a+=1}return i}splitBy(e){let r=ne.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,a,o=[];for(;i<this.e;){let s=this.start.plus(r.mapUnits(u=>u*n));a=+s>+this.e?this.e:s,o.push(Ne.fromDateTimes(i,a)),i=a,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return r>=i?null:Ne.fromDateTimes(r,i)}union(e){if(!this.isValid)return this;let r=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return Ne.fromDateTimes(r,i)}static merge(e){let[r,i]=e.sort((n,a)=>n.s-a.s).reduce(([n,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[n,a.union(o)]:[n.concat([a]),o]:[n,o],[[],null]);return i&&r.push(i),r}static xor(e){let r=null,i=0,n=[],a=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((u,l)=>u.time-l.time);for(let u of s)i+=u.type==="s"?1:-1,i===1?r=u.time:(r&&+r!=+u.time&&n.push(Ne.fromDateTimes(r,u.time)),r=null);return Ne.merge(n)}difference(...e){return Ne.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:mc}toLocaleString(e=ds,r={}){return this.isValid?Ye.create(this.s.loc.clone(r),e).formatInterval(this):mc}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:mc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:mc}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:mc}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:mc}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):ne.invalid(this.invalidReason)}mapEndpoints(e){return Ne.fromDateTimes(e(this.s),e(this.e))}};var uo=class{static hasDST(e=Te.defaultZone){let r=H.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return yt.isValidZone(e)}static normalizeZone(e){return hn(e,Te.defaultZone)}static months(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||xe.create(r,i,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||xe.create(r,i,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||xe.create(r,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||xe.create(r,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return xe.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return xe.create(r,null,"gregory").eras(e)}static features(){return{relative:o1()}}};function UH(t,e){let r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(e)-r(t);return Math.floor(ne.fromMillis(i).as("days"))}function Lqe(t,e,r){let i=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let d=UH(u,l);return(d-d%7)/7}],["days",UH]],n={},a=t,o,s;for(let[u,l]of i)r.indexOf(u)>=0&&(o=u,n[u]=l(t,e),s=a.plus(n),s>e?(n[u]--,t=a.plus(n)):t=s);return[t,n,s,o]}function zH(t,e,r,i){let[n,a,o,s]=Lqe(t,e,r),u=e-n,l=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);l.length===0&&(o<e&&(o=n.plus({[s]:1})),o!==n&&(a[s]=(a[s]||0)+u/(o-n)));let d=ne.fromObject(a,i);return l.length>0?ne.fromMillis(u,i).shiftTo(...l).plus(d):d}var eE={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},WH={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Bqe=eE.hanidec.replace(/[\[|\]]/g,"").split("");function HH(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);if(t[r].search(eE.hanidec)!==-1)e+=Bqe.indexOf(t[r]);else for(let n in WH){let[a,o]=WH[n];i>=a&&i<=o&&(e+=i-a)}}return parseInt(e,10)}else return e}function Ar({numberingSystem:t},e=""){return new RegExp(`${eE[t||"latn"]}${e}`)}var Vqe="missing Intl.DateTimeFormat.formatToParts support";function we(t,e=r=>r){return{regex:t,deser:([r])=>e(HH(r))}}var Uqe=String.fromCharCode(160),ZH=`[ ${Uqe}]`,YH=new RegExp(ZH,"g");function zqe(t){return t.replace(/\./g,"\\.?").replace(YH,ZH)}function GH(t){return t.replace(/\./g,"").replace(YH," ").toLowerCase()}function gn(t,e){return t===null?null:{regex:RegExp(t.map(zqe).join("|")),deser:([r])=>t.findIndex(i=>GH(r)===GH(i))+e}}function KH(t,e){return{regex:t,deser:([,r,i])=>nu(r,i),groups:e}}function s1(t){return{regex:t,deser:([e])=>e}}function Wqe(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Hqe(t,e){let r=Ar(e),i=Ar(e,"{2}"),n=Ar(e,"{3}"),a=Ar(e,"{4}"),o=Ar(e,"{6}"),s=Ar(e,"{1,2}"),u=Ar(e,"{1,3}"),l=Ar(e,"{1,6}"),d=Ar(e,"{1,9}"),p=Ar(e,"{2,4}"),f=Ar(e,"{4,6}"),m=b=>({regex:RegExp(Wqe(b.val)),deser:([x])=>x,literal:!0}),v=(b=>{if(t.literal)return m(b);switch(b.val){case"G":return gn(e.eras("short",!1),0);case"GG":return gn(e.eras("long",!1),0);case"y":return we(l);case"yy":return we(p,dm);case"yyyy":return we(a);case"yyyyy":return we(f);case"yyyyyy":return we(o);case"M":return we(s);case"MM":return we(i);case"MMM":return gn(e.months("short",!0,!1),1);case"MMMM":return gn(e.months("long",!0,!1),1);case"L":return we(s);case"LL":return we(i);case"LLL":return gn(e.months("short",!1,!1),1);case"LLLL":return gn(e.months("long",!1,!1),1);case"d":return we(s);case"dd":return we(i);case"o":return we(u);case"ooo":return we(n);case"HH":return we(i);case"H":return we(s);case"hh":return we(i);case"h":return we(s);case"mm":return we(i);case"m":return we(s);case"q":return we(s);case"qq":return we(i);case"s":return we(s);case"ss":return we(i);case"S":return we(u);case"SSS":return we(n);case"u":return s1(d);case"uu":return s1(s);case"uuu":return we(r);case"a":return gn(e.meridiems(),0);case"kkkk":return we(a);case"kk":return we(p,dm);case"W":return we(s);case"WW":return we(i);case"E":case"c":return we(r);case"EEE":return gn(e.weekdays("short",!1,!1),1);case"EEEE":return gn(e.weekdays("long",!1,!1),1);case"ccc":return gn(e.weekdays("short",!0,!1),1);case"cccc":return gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return KH(new RegExp(`([+-]${s.source})(?::(${i.source}))?`),2);case"ZZZ":return KH(new RegExp(`([+-]${s.source})(${i.source})?`),2);case"z":return s1(/[a-z_+-/]{1,256}?/i);case" ":return s1(/[^\S\n\r]/);default:return m(b)}})(t)||{invalidReason:Vqe};return v.token=t,v}var Gqe={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Kqe(t,e){let{type:r,value:i}=t;if(r==="literal"){let o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}let n=e[r],a=Gqe[r];if(typeof a=="object"&&(a=a[n]),a)return{literal:!1,val:a}}function Zqe(t){return[`^${t.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,t]}function Yqe(t,e,r){let i=t.match(e);if(i){let n={},a=1;for(let o in r)if(fs(r,o)){let s=r[o],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(n[s.token.val[0]]=s.deser(i.slice(a,a+u))),a+=u}return[i,n]}else return[i,{}]}function Jqe(t){let e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,i;return ue(t.z)||(r=yt.create(t.z)),ue(t.Z)||(r||(r=new Ze(t.Z)),i=t.Z),ue(t.q)||(t.M=(t.q-1)*3+1),ue(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),ue(t.u)||(t.S=cm(t.u)),[Object.keys(t).reduce((a,o)=>{let s=e(o);return s&&(a[s]=t[o]),a},{}),r,i]}var tE=null;function Xqe(){return tE||(tE=H.fromMillis(1555555555555)),tE}function Qqe(t,e){if(t.literal)return t;let r=Ye.macroTokenToFormatOpts(t.val),i=nE(r,e);return i==null||i.includes(void 0)?t:i}function rE(t,e){return Array.prototype.concat(...t.map(r=>Qqe(r,e)))}function iE(t,e,r){let i=rE(Ye.parseFormat(r),t),n=i.map(o=>Hqe(o,t)),a=n.find(o=>o.invalidReason);if(a)return{input:e,tokens:i,invalidReason:a.invalidReason};{let[o,s]=Zqe(n),u=RegExp(o,"i"),[l,d]=Yqe(e,u,s),[p,f,m]=d?Jqe(d):[null,null,void 0];if(fs(d,"a")&&fs(d,"H"))throw new oo("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:u,rawMatches:l,matches:d,result:p,zone:f,specificOffset:m}}}function JH(t,e,r){let{result:i,zone:n,specificOffset:a,invalidReason:o}=iE(t,e,r);return[i,n,a,o]}function nE(t,e){return t?Ye.create(e,t).formatDateTimeParts(Xqe()).map(n=>Kqe(n,t)):null}var XH=[0,31,59,90,120,151,181,212,243,273,304,334],QH=[0,31,60,91,121,152,182,213,244,274,305,335];function Ir(t,e){return new Et("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function eG(t,e,r){let i=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function tG(t,e,r){return r+(au(t)?QH:XH)[e-1]}function rG(t,e){let r=au(t)?QH:XH,i=r.findIndex(a=>a<e),n=e-r[i];return{month:i+1,day:n}}function u1(t){let{year:e,month:r,day:i}=t,n=tG(e,r,i),a=eG(e,r,i),o=Math.floor((n-a+10)/7),s;return o<1?(s=e-1,o=oc(s)):o>oc(e)?(s=e+1,o=1):s=e,{weekYear:s,weekNumber:o,weekday:a,...pm(t)}}function aE(t){let{weekYear:e,weekNumber:r,weekday:i}=t,n=eG(e,1,4),a=ou(e),o=r*7+i-n-3,s;o<1?(s=e-1,o+=ou(s)):o>a?(s=e+1,o-=ou(e)):s=e;let{month:u,day:l}=rG(s,o);return{year:s,month:u,day:l,...pm(t)}}function l1(t){let{year:e,month:r,day:i}=t,n=tG(e,r,i);return{year:e,ordinal:n,...pm(t)}}function oE(t){let{year:e,ordinal:r}=t,{month:i,day:n}=rG(e,r);return{year:e,month:i,day:n,...pm(t)}}function iG(t){let e=lm(t.weekYear),r=Xn(t.weekNumber,1,oc(t.weekYear)),i=Xn(t.weekday,1,7);return e?r?i?!1:Ir("weekday",t.weekday):Ir("week",t.week):Ir("weekYear",t.weekYear)}function nG(t){let e=lm(t.year),r=Xn(t.ordinal,1,ou(t.year));return e?r?!1:Ir("ordinal",t.ordinal):Ir("year",t.year)}function sE(t){let e=lm(t.year),r=Xn(t.month,1,12),i=Xn(t.day,1,ac(t.year,t.month));return e?r?i?!1:Ir("day",t.day):Ir("month",t.month):Ir("year",t.year)}function uE(t){let{hour:e,minute:r,second:i,millisecond:n}=t,a=Xn(e,0,23)||e===24&&r===0&&i===0&&n===0,o=Xn(r,0,59),s=Xn(i,0,59),u=Xn(n,0,999);return a?o?s?u?!1:Ir("millisecond",n):Ir("second",i):Ir("minute",r):Ir("hour",e)}var lE="Invalid DateTime",aG=864e13;function c1(t){return new Et("unsupported zone",`the zone "${t.name}" is not supported`)}function cE(t){return t.weekData===null&&(t.weekData=u1(t.c)),t.weekData}function hm(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new H({...r,...e,old:r})}function fG(t,e,r){let i=t-e*60*1e3,n=r.offset(i);if(e===n)return[i,e];i-=(n-e)*60*1e3;let a=r.offset(i);return n===a?[i,n]:[t-Math.min(n,a)*60*1e3,Math.max(n,a)]}function oG(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function p1(t,e,r){return fG(sm(t),e,r)}function sG(t,e){let r=t.o,i=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:i,month:n,day:Math.min(t.c.day,ac(i,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ne.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=sm(a),[u,l]=fG(s,r,t.zone);return o!==0&&(u+=o,l=t.zone.offset(u)),{ts:u,o:l}}function gm(t,e,r,i,n,a){let{setZone:o,zone:s}=r;if(t&&Object.keys(t).length!==0||e){let u=e||s,l=H.fromObject(t,{...r,zone:u,specificOffset:a});return o?l:l.setZone(s)}else return H.invalid(new Et("unparsable",`the input "${n}" can't be parsed as ${i}`))}function d1(t,e,r=!0){return t.isValid?Ye.create(xe.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function dE(t,e){let r=t.c.year>9999||t.c.year<0,i="";return r&&t.c.year>=0&&(i+="+"),i+=Ke(t.c.year,r?6:4),e?(i+="-",i+=Ke(t.c.month),i+="-",i+=Ke(t.c.day)):(i+=Ke(t.c.month),i+=Ke(t.c.day)),i}function uG(t,e,r,i,n,a){let o=Ke(t.c.hour);return e?(o+=":",o+=Ke(t.c.minute),(t.c.second!==0||!r)&&(o+=":")):o+=Ke(t.c.minute),(t.c.second!==0||!r)&&(o+=Ke(t.c.second),(t.c.millisecond!==0||!i)&&(o+=".",o+=Ke(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!a?o+="Z":t.o<0?(o+="-",o+=Ke(Math.trunc(-t.o/60)),o+=":",o+=Ke(Math.trunc(-t.o%60))):(o+="+",o+=Ke(Math.trunc(t.o/60)),o+=":",o+=Ke(Math.trunc(t.o%60)))),a&&(o+="["+t.zone.ianaName+"]"),o}var mG={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},eRe={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tRe={ordinal:1,hour:0,minute:0,second:0,millisecond:0},hG=["year","month","day","hour","minute","second","millisecond"],rRe=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],iRe=["year","ordinal","hour","minute","second","millisecond"];function lG(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new rc(t);return e}function cG(t,e){let r=hn(e.zone,Te.defaultZone),i=xe.fromObject(e),n=Te.now(),a,o;if(ue(t.year))a=n;else{for(let l of hG)ue(t[l])&&(t[l]=mG[l]);let s=sE(t)||uE(t);if(s)return H.invalid(s);let u=r.offset(n);[a,o]=p1(t,u,r)}return new H({ts:a,zone:r,loc:i,o})}function dG(t,e,r){let i=ue(r.round)?!0:r.round,n=(o,s)=>(o=ic(o,i||r.calendary?0:2,!0),e.loc.clone(r).relFormatter(r).format(o,s)),a=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return n(a(r.unit),r.unit);for(let o of r.units){let s=a(o);if(Math.abs(s)>=1)return n(s,o)}return n(t>e?-0:0,r.units[r.units.length-1])}function pG(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var H=class{constructor(e){let r=e.zone||Te.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Et("invalid input"):null)||(r.isValid?null:c1(r));this.ts=ue(e.ts)?Te.now():e.ts;let n=null,a=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[n,a]=[e.old.c,e.old.o];else{let s=r.offset(this.ts);n=oG(this.ts,s),i=Number.isNaN(n.year)?new Et("invalid input"):null,n=i?null:n,a=i?null:s}this._zone=r,this.loc=e.loc||xe.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new H({})}static local(){let[e,r]=pG(arguments),[i,n,a,o,s,u,l]=r;return cG({year:i,month:n,day:a,hour:o,minute:s,second:u,millisecond:l},e)}static utc(){let[e,r]=pG(arguments),[i,n,a,o,s,u,l]=r;return e.zone=Ze.utcInstance,cG({year:i,month:n,day:a,hour:o,minute:s,second:u,millisecond:l},e)}static fromJSDate(e,r={}){let i=_H(e)?e.valueOf():NaN;if(Number.isNaN(i))return H.invalid("invalid input");let n=hn(r.zone,Te.defaultZone);return n.isValid?new H({ts:i,zone:n,loc:xe.fromObject(r)}):H.invalid(c1(n))}static fromMillis(e,r={}){if(Jn(e))return e<-aG||e>aG?H.invalid("Timestamp out of range"):new H({ts:e,zone:hn(r.zone,Te.defaultZone),loc:xe.fromObject(r)});throw new It(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(Jn(e))return new H({ts:e*1e3,zone:hn(r.zone,Te.defaultZone),loc:xe.fromObject(r)});throw new It("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let i=hn(r.zone,Te.defaultZone);if(!i.isValid)return H.invalid(c1(i));let n=Te.now(),a=ue(r.specificOffset)?i.offset(n):r.specificOffset,o=sc(e,lG),s=!ue(o.ordinal),u=!ue(o.year),l=!ue(o.month)||!ue(o.day),d=u||l,p=o.weekYear||o.weekNumber,f=xe.fromObject(r);if((d||s)&&p)throw new oo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new oo("Can't mix ordinal dates with month/day");let m=p||o.weekday&&!d,g,v,b=oG(n,a);m?(g=rRe,v=eRe,b=u1(b)):s?(g=iRe,v=tRe,b=l1(b)):(g=hG,v=mG);let x=!1;for(let pe of g){let oe=o[pe];ue(oe)?x?o[pe]=v[pe]:o[pe]=b[pe]:x=!0}let k=m?iG(o):s?nG(o):sE(o),P=k||uE(o);if(P)return H.invalid(P);let $=m?aE(o):s?oE(o):o,[D,te]=p1($,a,i),V=new H({ts:D,zone:i,o:te,loc:f});return o.weekday&&d&&e.weekday!==V.weekday?H.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${V.toISO()}`):V}static fromISO(e,r={}){let[i,n]=NH(e);return gm(i,n,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[i,n]=DH(e);return gm(i,n,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[i,n]=FH(e);return gm(i,n,r,"HTTP",r)}static fromFormat(e,r,i={}){if(ue(e)||ue(r))throw new It("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:a=null}=i,o=xe.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[s,u,l,d]=JH(o,e,r);return d?H.invalid(d):gm(s,u,i,`format ${r}`,e,l)}static fromString(e,r,i={}){return H.fromFormat(e,r,i)}static fromSQL(e,r={}){let[i,n]=LH(e);return gm(i,n,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new It("need to specify a reason the DateTime is invalid");let i=e instanceof Et?e:new Et(e,r);if(Te.throwOnInvalid)throw new X0(i);return new H({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let i=nE(e,xe.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(e,r={}){return rE(Ye.parseFormat(e),xe.fromObject(r)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?cE(this).weekYear:NaN}get weekNumber(){return this.isValid?cE(this).weekNumber:NaN}get weekday(){return this.isValid?cE(this).weekday:NaN}get ordinal(){return this.isValid?l1(this.c).ordinal:NaN}get monthShort(){return this.isValid?uo.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?uo.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?uo.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?uo.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return au(this.year)}get daysInMonth(){return ac(this.year,this.month)}get daysInYear(){return this.isValid?ou(this.year):NaN}get weeksInWeekYear(){return this.isValid?oc(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:i,calendar:n}=Ye.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(e=0,r={}){return this.setZone(Ze.instance(e),r)}toLocal(){return this.setZone(Te.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(e=hn(e,Te.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(r||i){let a=e.offset(this.ts),o=this.toObject();[n]=p1(o,a,e)}return hm(this,{ts:n,zone:e})}else return H.invalid(c1(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:i}={}){let n=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:i});return hm(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=sc(e,lG),i=!ue(r.weekYear)||!ue(r.weekNumber)||!ue(r.weekday),n=!ue(r.ordinal),a=!ue(r.year),o=!ue(r.month)||!ue(r.day),s=a||o,u=r.weekYear||r.weekNumber;if((s||n)&&u)throw new oo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new oo("Can't mix ordinal dates with month/day");let l;i?l=aE({...u1(this.c),...r}):ue(r.ordinal)?(l={...this.toObject(),...r},ue(r.day)&&(l.day=Math.min(ac(l.year,l.month),l.day))):l=oE({...l1(this.c),...r});let[d,p]=p1(l,this.o,this.zone);return hm(this,{ts:d,o:p})}plus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e);return hm(this,sG(this,r))}minus(e){if(!this.isValid)return this;let r=ne.fromDurationLike(e).negate();return hm(this,sG(this,r))}startOf(e){if(!this.isValid)return this;let r={},i=ne.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break;case"milliseconds":break}if(i==="weeks"&&(r.weekday=1),i==="quarters"){let n=Math.ceil(this.month/3);r.month=(n-1)*3+1}return this.set(r)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,r={}){return this.isValid?Ye.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):lE}toLocaleString(e=ds,r={}){return this.isValid?Ye.create(this.loc.clone(r),e).formatDateTime(this):lE}toLocaleParts(e={}){return this.isValid?Ye.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let o=e==="extended",s=dE(this,o);return s+="T",s+=uG(this,o,r,i,n,a),s}toISODate({format:e="extended"}={}){return this.isValid?dE(this,e==="extended"):null}toISOWeekDate(){return d1(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+uG(this,o==="extended",r,e,i,a):null}toRFC2822(){return d1(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return d1(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?dE(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||e)&&(i&&(n+=" "),r?n+="z":e&&(n+="ZZ")),d1(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lE}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",i={}){if(!this.isValid||!e.isValid)return ne.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},a=xH(r).map(ne.normalizeUnit),o=e.valueOf()>this.valueOf(),s=o?this:e,u=o?e:this,l=zH(s,u,a,n);return o?l.negate():l}diffNow(e="milliseconds",r={}){return this.diff(H.now(),e,r)}until(e){return this.isValid?Ne.fromDateTimes(this,e):this}hasSame(e,r){if(!this.isValid)return!1;let i=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(r)<=i&&i<=n.endOf(r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||H.fromObject({},{zone:this.zone}),i=e.padding?this<r?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),dG(r,this.plus(i),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?dG(e.base||H.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(H.isDateTime))throw new It("min requires all arguments be DateTimes");return H3(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(H.isDateTime))throw new It("max requires all arguments be DateTimes");return H3(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,i={}){let{locale:n=null,numberingSystem:a=null}=i,o=xe.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return iE(o,e,r)}static fromStringExplain(e,r,i={}){return H.fromFormatExplain(e,r,i)}static get DATE_SHORT(){return ds}static get DATE_MED(){return Vf}static get DATE_MED_WITH_WEEKDAY(){return C3}static get DATE_FULL(){return Uf}static get DATE_HUGE(){return zf}static get TIME_SIMPLE(){return Wf}static get TIME_WITH_SECONDS(){return Hf}static get TIME_WITH_SHORT_OFFSET(){return Gf}static get TIME_WITH_LONG_OFFSET(){return Kf}static get TIME_24_SIMPLE(){return Zf}static get TIME_24_WITH_SECONDS(){return Yf}static get TIME_24_WITH_SHORT_OFFSET(){return Jf}static get TIME_24_WITH_LONG_OFFSET(){return Xf}static get DATETIME_SHORT(){return Qf}static get DATETIME_SHORT_WITH_SECONDS(){return em}static get DATETIME_MED(){return tm}static get DATETIME_MED_WITH_SECONDS(){return rm}static get DATETIME_MED_WITH_WEEKDAY(){return P3}static get DATETIME_FULL(){return im}static get DATETIME_FULL_WITH_SECONDS(){return nm}static get DATETIME_HUGE(){return am}static get DATETIME_HUGE_WITH_SECONDS(){return om}};function hc(t){if(H.isDateTime(t))return t;if(t&&t.valueOf&&Jn(t.valueOf()))return H.fromJSDate(t);if(t&&typeof t=="object")return H.fromObject(t);throw new It(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var uu="1970-01-01T00:00:00.000Z",pE;function fE(){return(pE==null?void 0:pE())??new Date().toISOString()}function gG(){return H.fromISO(fE(),{zone:"utc"})}function vG(t){if(t!==void 0)return t.toUTC().toISO()}function bG(t){if(t instanceof H)return t;if(t!=null)return H.fromJSDate(new Date(t)).toUTC()}var f1=Symbol("DocProp");function R(t,e){return function(r,i){let n=r.constructor[f1]=r.constructor[f1]||{};n[i]={description:t,omit:!1,...e}}}function lu(){return function(t,e){let r=t.constructor[f1]=t.constructor[f1]||{};r[e]={description:"",omit:!0}}}var yG=/^_?[a-z0-9]+(_[a-z0-9]+)*$/;function Be(t,e,r,i,n){if(!yG.test(t))throw new Error("Internal error: invalid table name in entity definition: "+t);if(!yG.test(e))throw new Error("Internal error: invalid entity name in entity definition: "+e);let a=i??"ENTITY",s=class{id=0;key(){return`${s.keyPrefix}${J0(this.id)?this.id:"New"}`}initialize(l){qf(this,l)}static get tableName(){return t}static get entityName(){return e}static get parentSchemas(){return r}static idName=`${e}_id`;static keyPrefix=`${a}-`;static urlPrefix=a.toLowerCase();static allowCustomFields=(n==null?void 0:n.allowCustomFields)??!1;static toJSON(){return e}static toString(){return e}},o=s;return T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The unique entity id - must be a positive integer")],o.prototype,"id",2),o}function gs(t,e,...r){let i=typeof e=="function"?(r.unshift(e),{}):e;class n{static mapName=t;static mapTableName=r.map(o=>o.entityName).sort().join("_")+"_map";static ctors=r;static parentSchemas=Array.from(JW(r.map(o=>o.parentSchemas).flat()));static toJSON(){return t}static toString(){return t}static allowCustomFields=(i==null?void 0:i.allowCustomFields)??!1;initialize(o){o&&qf(this,o)}}for(let a of r)if(a===void 0)throw new Error("An entity constructor is undefined");if(K0(r).length!==r.length)throw new Error("Entity constructors must be distinct");return n}function it(t){class e extends t{is_deleted=!1}return T([(0,st.IsOptional)(),Gt(),R("If the entity has been soft-deleted this value is true")],e.prototype,"is_deleted",2),no(e)}var cit=Symbol("ConflictTagMissing");function vs(t){class e extends t{_etag=""}return T([(0,st.IsOptional)(),(0,st.IsString)(),R("A tag for detecting conflicting modifications - current value must be passed along in an update (or update must be forced)")],e.prototype,"_etag",2),no(e)}function De(t){class e extends t{created_at=uu;created_by=0;modified_at=void 0;modified_by=0;deleted_at=void 0;deleted_by=0}return T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The creation time for this entity or mapping value",{example:uu})],e.prototype,"created_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The creator user id of this entity or mapping value - or zero if created by the system",{example:0})],e.prototype,"created_by",2),T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The last modification time for this entity or mapping value",{example:uu})],e.prototype,"modified_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The id of the user who last modified or undeleted this entity or mapping value - or zero if modified by the system",{example:0})],e.prototype,"modified_by",2),T([(0,st.IsISO8601)(),(0,st.IsOptional)(),R("The soft-deletion time for this entity or mapping value",{example:uu})],e.prototype,"deleted_at",2),T([(0,st.IsInt)(),(0,st.IsOptional)(),R("The id of the user who deleted this entity or mapping value - or zero if deleted by the system",{example:0})],e.prototype,"deleted_by",2),no(e)}function Je(t){class e extends t{}return no(e)}var Er=X(ot());function bs(t,e){let r=(e==null?void 0:e.context)??[];for(let i=0;i<t.length;i++)r[`constraint${i+1}`]=t[i];return{...e,context:r}}function _G(t,e){return Er.MinLength(t,bs([t],e))}function de(t,e){return Er.MaxLength(t,bs([t],e))}function m1(t,e){return Er.Min(t,bs([t],e))}function xG(t,e){return Er.Max(t,bs([t],e))}function SG(t,e){return Er.Matches(t,bs([t],e))}var mE=Symbol("_trackRefs");function ge(t,e){return function(r,i){r.constructor[mE]??=[],r.constructor.ctors?r.constructor[mE].push({type:"map_prop",propName:i,sourceEntityName:r.constructor.mapName,targetEntityName:t,withHistory:Bf(r.constructor,Je),hintOnly:e??!1}):r.constructor[mE].push({type:"prop",propName:i,sourceEntityName:r.constructor.entityName,targetEntityName:t,withHistory:Bf(r.constructor,Je),hintOnly:e??!1})}}var git=Symbol("_trackLargeProps");var nt=X(ot());var nRe=/[\\/:*?"<>|]+/g,aRe=/^(|nul|prn|con|lpt[0-9]|com[0-9]|\.)(\.|$)/i;function oRe(t){return typeof t=="string"&&!t.match(nRe)&&!t.match(aRe)}function wG(t){return(0,nt.ValidateBy)({name:"isValidFilename",validator:{validate:oRe,defaultMessage:(0,nt.buildMessage)(e=>e+"Value '$value' is not a valid filename",t)}},t)}function sRe(t,e){return typeof t=="string"&&(0,nt.minLength)(t.trim().replace(/\p{Cf}/u,""),e)}function lo(t,e){let r=bs([t],e);return(0,nt.ValidateBy)({name:"minLengthTrimmed",constraints:[t],validator:{validate:(i,n)=>sRe(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,nt.buildMessage)(i=>i+"Trimmed $property must be longer than or equal to $constraint1 characters",r)}},r)}function uRe(t,e){return typeof t=="string"&&(0,nt.maxLength)(t.trim(),e)}function kG(t,e){let r=bs([t],e);return(0,nt.ValidateBy)({name:"maxLengthTrimmed",constraints:[t],validator:{validate:(i,n)=>uRe(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,nt.buildMessage)(i=>i+"Trimmed $property must be shorter than or equal to $constraint1 characters",r)}},r)}function TG(t){return(0,nt.ValidateBy)({name:"isWord",validator:{validate:(e,r)=>n8(e),defaultMessage:(0,nt.buildMessage)(e=>e+"$property must only contain numbers, letters and underscores",t)}},t)}function OG(t){return(0,nt.ValidateBy)({name:"startsWithLetter",validator:{validate:(e,r)=>a8(e),defaultMessage:(0,nt.buildMessage)(e=>e+"$property must start with a letter",t)}},t)}function AG(t,e){return(0,nt.ValidateBy)({name:"isValidId",validator:{validate:(r,i)=>typeof r=="number"&&(J0(r)||!!t&&r===0),defaultMessage:(0,nt.buildMessage)(r=>r+"$property must be a valid entity id",e)}},e)}function IG(t,e){let r;return(0,nt.ValidateBy)({name:"isSchema",validator:{validate:(i,n)=>{try{return r=void 0,t.validate(i,{allowCycles:!0}),!0}catch(a){return r=a,!1}},defaultMessage:(0,nt.buildMessage)(i=>i+`$property must be a valid '${t.name}'.${r!==void 0?" "+r:""}`,e)}},e)}var ys=class extends vs(De(it(Be("projects","project",["tenant"],"P")))){owner_user_id=0;name="";project_key=void 0;description="";constructor(e){super(),this.initialize(e)}};T([ge("user"),(0,Cr.IsInt)(),R("Reserved for future use")],ys.prototype,"owner_user_id",2),T([(0,Cr.IsString)(),lo(3),de(40),R("The project name")],ys.prototype,"name",2),T([(0,Cr.IsString)(),(0,Cr.IsOptional)(),lo(2),kG(5),(0,Cr.IsAlphanumeric)(),(0,Cr.IsUppercase)(),R("An optional project shorthand key",{nullable:!0,example:"PRO"})],ys.prototype,"project_key",2),T([(0,Cr.IsString)(),R("An optional descriptive text for the project")],ys.prototype,"description",2);var fu=X(_d());var vm=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,EG=new Set,lRe=(t,e,r,i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},cRe=t=>!EG.has(t),jit=Symbol("type"),_s=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),CG=t=>_s(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?vc:null:null,vc=class extends Array{constructor(e){super(e),this.fill(0)}},bc,gc=class{heap;length;static create(e){let r=CG(e);if(!r)return[];G1(gc,bc,!0);let i=new gc(e,r);return G1(gc,bc,!1),i}constructor(e,r){if(!tC(gc,bc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},h1=gc;bc=new WeakMap,rC(h1,bc,!1);var bm=class{#f;#c;#b;#m;#E;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#h;#n;#r;#e;#u;#d;#s;#a;#g;#o;#S;#w;#v;#y;#T;#l;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#S,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#d,get head(){return e.#s},get tail(){return e.#a},free:e.#g,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,i,n,a)=>e.#j(r,i,n,a),moveToTail:r=>e.#I(r),indexes:r=>e.#_(r),rindexes:r=>e.#x(r),isStale:r=>e.#p(r)}}get max(){return this.#f}get maxSize(){return this.#c}get calculatedSize(){return this.#h}get size(){return this.#i}get fetchMethod(){return this.#E}get dispose(){return this.#b}get disposeAfter(){return this.#m}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:u,dispose:l,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:m=0,maxEntrySize:g=0,sizeCalculation:v,fetchMethod:b,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:$,ignoreFetchAbort:D}=e;if(r!==0&&!_s(r))throw new TypeError("max option must be a nonnegative integer");let te=r?CG(r):Array;if(!te)throw new Error("invalid max value: "+r);if(this.#f=r,this.#c=m,this.maxEntrySize=g||this.#c,this.sizeCalculation=v,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#E=b,this.#T=!!b,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new te(r),this.#d=new te(r),this.#s=0,this.#a=0,this.#g=h1.create(r),this.#i=0,this.#h=0,typeof l=="function"&&(this.#b=l),typeof d=="function"?(this.#m=d,this.#o=[]):(this.#m=void 0,this.#o=void 0),this.#y=!!this.#b,this.#l=!!this.#m,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!$,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#c!==0&&!_s(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_s(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=_s(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!_s(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(this.#f===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#f&&!this.#c){let V="LRU_CACHE_UNBOUNDED";cRe(V)&&(EG.add(V),lRe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",V,bm))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#$(){let e=new vc(this.#f),r=new vc(this.#f);this.#v=e,this.#w=r,this.#M=(a,o,s=vm.now())=>{if(r[a]=o!==0?s:0,e[a]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#p(a)&&this.delete(this.#r[a])},o+1);u.unref&&u.unref()}},this.#O=a=>{r[a]=e[a]!==0?vm.now():0},this.#k=(a,o)=>{if(e[o]){let s=e[o],u=r[o];a.ttl=s,a.start=u,a.now=i||n(),a.remainingTTL=a.now+s-u}};let i=0,n=()=>{let a=vm.now();if(this.ttlResolution>0){i=a;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{let o=this.#n.get(a);return o===void 0?0:e[o]===0||r[o]===0?1/0:r[o]+e[o]-(i||n())},this.#p=a=>e[a]!==0&&r[a]!==0&&(i||n())-r[a]>e[a]}#O=()=>{};#k=()=>{};#M=()=>{};#p=()=>!1;#q(){let e=new vc(this.#f);this.#h=0,this.#S=e,this.#A=r=>{this.#h-=e[r],e[r]=0},this.#N=(r,i,n,a)=>{if(this.#t(i))return 0;if(!_s(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(i,r),!_s(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#C=(r,i,n)=>{if(e[r]=i,this.#c){let a=this.#c-e[r];for(;this.#h>a;)this.#P(!0)}this.#h+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#h)}}#A=e=>{};#C=(e,r,i)=>{};#N=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#_({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#s));)r=this.#d[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#s;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#u[r]}#D(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#_())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#x())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#_()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#_())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#x())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;if(a!==void 0&&e(a,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(e,r=this){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&e.call(r,a,this.#r[i],this)}}rforEach(e,r=this){for(let i of this.#x()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&e.call(r,a,this.#r[i],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#p(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#_({allowStale:!0})){let i=this.#r[r],n=this.#e[r],a=this.#t(n)?n.__staleWhileFetching:n;if(a===void 0||i===void 0)continue;let o={value:a};if(this.#v&&this.#w){o.ttl=this.#v[r];let s=vm.now()-this.#w[r];o.start=Math.floor(Date.now()-s)}this.#S&&(o.size=this.#S[r]),e.unshift([i,o])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=vm.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){var f,m,g;let{ttl:n=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,d=this.#N(e,r,i.size||0,s);if(this.maxEntrySize&&d>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#i===0?void 0:this.#n.get(e);if(p===void 0)p=this.#i===0?this.#a:this.#g.length!==0?this.#g.pop():this.#i===this.#f?this.#P(!1):this.#i,this.#r[p]=e,this.#e[p]=r,this.#n.set(e,p),this.#u[this.#a]=p,this.#d[p]=this.#a,this.#a=p,this.#i++,this.#C(p,d,u),u&&(u.set="add"),l=!1;else{this.#I(p);let v=this.#e[p];if(r!==v){if(this.#T&&this.#t(v)?v.__abortController.abort(new Error("replaced")):o||(this.#y&&((f=this.#b)==null||f.call(this,v,e,"set")),this.#l&&((m=this.#o)==null||m.push([v,e,"set"]))),this.#A(p),this.#C(p,d,u),this.#e[p]=r,u){u.set="replace";let b=v&&this.#t(v)?v.__staleWhileFetching:v;b!==void 0&&(u.oldValue=b)}}else u&&(u.set="update")}if(n!==0&&!this.#v&&this.#$(),this.#v&&(l||this.#M(p,n,a),u&&this.#k(u,p)),!o&&this.#l&&this.#o){let v=this.#o,b;for(;b=v==null?void 0:v.shift();)(g=this.#m)==null||g.call(this,...b)}return this}pop(){var e;try{for(;this.#i;){let r=this.#e[this.#s];if(this.#P(!0),this.#t(r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(this.#l&&this.#o){let r=this.#o,i;for(;i=r==null?void 0:r.shift();)(e=this.#m)==null||e.call(this,...i)}}}#P(e){var a,o;let r=this.#s,i=this.#r[r],n=this.#e[r];return this.#T&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#y||this.#l)&&(this.#y&&((a=this.#b)==null||a.call(this,n,i,"evict")),this.#l&&((o=this.#o)==null||o.push([n,i,"evict"]))),this.#A(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#g.push(r)),this.#i===1?(this.#s=this.#a=0,this.#g.length=0):this.#s=this.#u[r],this.#n.delete(i),this.#i--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,a=this.#n.get(e);if(a!==void 0){let o=this.#e[a];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(a))n&&(n.has="stale",this.#k(n,a));else return i&&this.#O(a),n&&(n.has="hit",this.#k(n,a)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(e);if(n!==void 0&&(i||!this.#p(n))){let a=this.#e[n];return this.#t(a)?a.__staleWhileFetching:a}}#j(e,r,i,n){let a=r===void 0?void 0:this.#e[r];if(this.#t(a))return a;let o=new AbortController,{signal:s}=i;s==null||s.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(v,b=!1)=>{let{aborted:x}=o.signal,k=i.ignoreFetchAbort&&v!==void 0;if(i.status&&(x&&!b?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,k&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),x&&!k&&!b)return p(o.signal.reason);let P=m;return this.#e[r]===m&&(v===void 0?P.__staleWhileFetching?this.#e[r]=P.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,v,u.options))),v},d=v=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=v),p(v)),p=v=>{let{aborted:b}=o.signal,x=b&&i.allowStaleOnFetchAbort,k=x||i.allowStaleOnFetchRejection,P=k||i.noDeleteOnFetchRejection,$=m;if(this.#e[r]===m&&(!P||$.__staleWhileFetching===void 0?this.delete(e):x||(this.#e[r]=$.__staleWhileFetching)),k)return i.status&&$.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw v},f=(v,b)=>{var k;let x=(k=this.#E)==null?void 0:k.call(this,e,a,u);x&&x instanceof Promise&&x.then(P=>v(P),b),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(v(),i.allowStaleOnFetchAbort&&(v=P=>l(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);let m=new Promise(f).then(l,d),g=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,g,{...u.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=g,g}#t(e){if(!this.#T)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:x,signal:k}=r;if(!this.#T)return x&&(x.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:x});let P={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:s,size:u,sizeCalculation:l,noUpdateTTL:d,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:x,signal:k},$=this.#n.get(e);if($===void 0){x&&(x.fetch="miss");let D=this.#j(e,$,P,v);return D.__returned=D}else{let D=this.#e[$];if(this.#t(D)){let fe=i&&D.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",fe&&(x.returnedStale=!0)),fe?D.__staleWhileFetching:D.__returned=D}let te=this.#p($);if(!b&&!te)return x&&(x.fetch="hit"),this.#I($),n&&this.#O($),x&&this.#k(x,$),D;let V=this.#j(e,$,P,v),oe=V.__staleWhileFetching!==void 0&&i;return x&&(x.fetch=te?"stale":"refresh",oe&&te&&(x.returnedStale=!0)),oe?V.__staleWhileFetching:V.__returned=V}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=r,s=this.#n.get(e);if(s!==void 0){let u=this.#e[s],l=this.#t(u);return o&&this.#k(o,s),this.#p(s)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?u.__staleWhileFetching:void 0):(a||this.delete(e),o&&i&&(o.returnedStale=!0),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#I(s),n&&this.#O(s),u))}else o&&(o.get="miss")}#F(e,r){this.#d[r]=e,this.#u[e]=r}#I(e){e!==this.#a&&(e===this.#s?this.#s=this.#u[e]:this.#F(this.#d[e],this.#u[e]),this.#F(this.#a,e),this.#a=e)}delete(e){var i,n,a,o;let r=!1;if(this.#i!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#i===1)this.clear();else{this.#A(s);let u=this.#e[s];this.#t(u)?u.__abortController.abort(new Error("deleted")):(this.#y||this.#l)&&(this.#y&&((i=this.#b)==null||i.call(this,u,e,"delete")),this.#l&&((n=this.#o)==null||n.push([u,e,"delete"]))),this.#n.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a?this.#a=this.#d[s]:s===this.#s?this.#s=this.#u[s]:(this.#u[this.#d[s]]=this.#u[s],this.#d[this.#u[s]]=this.#d[s]),this.#i--,this.#g.push(s)}}if(this.#l&&((a=this.#o)!=null&&a.length)){let s=this.#o,u;for(;u=s==null?void 0:s.shift();)(o=this.#m)==null||o.call(this,...u)}return r}clear(){var e,r,i;for(let n of this.#x({allowStale:!0})){let a=this.#e[n];if(this.#t(a))a.__abortController.abort(new Error("deleted"));else{let o=this.#r[n];this.#y&&((e=this.#b)==null||e.call(this,a,o,"delete")),this.#l&&((r=this.#o)==null||r.push([a,o,"delete"]))}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#v&&this.#w&&(this.#v.fill(0),this.#w.fill(0)),this.#S&&this.#S.fill(0),this.#s=0,this.#a=0,this.#g.length=0,this.#h=0,this.#i=0,this.#l&&this.#o){let n=this.#o,a;for(;a=n==null?void 0:n.shift();)(i=this.#m)==null||i.call(this,...a)}}},PG=bm;function jG(t,e){let r=e-t;return Math.round(t+r/2+r/10*(Math.random()-.5))}function hE(t,e){return t=t.trim(),/^[-+]?(\d+)$/.test(t)?Number.parseInt(t,e):NaN}function gE(t){return t=t.trim().replaceAll(",","."),/^[-]?(0|[1-9][0-9]*)(\.[0-9]*)?(e[+-]?[0-9]+)?$/i.test(t)?Number.parseFloat(t):NaN}var ym=Object.freeze({});var du=class{constructor(e,r,i){this.maxAgeSec=r;if(!e||!r&&r!==0)throw new Error("Internal error - Cache must have maxKeys>0, maxAge>=0");this.internalCache=new PG({max:e,ttl:1e3*r,updateAgeOnGet:!1}),dRe(this.internalCache,r,e),this.keyTransform=i}internalCache;keyTransform;hitCounter=0;missCounter=0;get metrics(){let e=this.hitCounter+this.missCounter;return{gauge:[this.internalCache.size,e>0?this.hitCounter/e:0],counter:[this.hitCounter,this.missCounter]}}get(e){var n;let r=((n=this.keyTransform)==null?void 0:n.call(this,e))??e,i=this.internalCache.get(r);return i!==void 0?this.hitCounter++:this.missCounter++,i!==ym?i:null}set(e,r,i=0){var a;let n=((a=this.keyTransform)==null?void 0:a.call(this,e))??e;if(r!==void 0){let o=i>0&&this.maxAgeSec>i?1e3*i:void 0;this.internalCache.set(n,r!==null?r:ym,{ttl:o})}else this.internalCache.delete(n);return r}getOrSet(e,r){let i=this.get(e);return i||this.set(e,r)}has(e){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,e))??e;return this.internalCache.has(r)}del(e){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,e))??e;this.internalCache.delete(r)}clear(){this.internalCache.clear()}find(e){let r=[];return this.internalCache.forEach(i=>{i!==ym&&e(i)&&r.push(i)}),r}purge(e){let r=[];this.internalCache.forEach((i,n)=>{i!==ym&&e(i)&&r.push(n)});for(let i of r)this.internalCache.delete(i)}purgeStale(){return this.internalCache.purgeStale()}forEach(e){this.internalCache.forEach((r,i)=>{e(r!==ym?r:null,i)})}get count(){return this.internalCache.size}};function dRe(t,e,r){if(e>0&&r>10){let i=setInterval(()=>{t.purgeStale()},1e3*jG(e/3,e/2));typeof i=="object"&&i.unref()}}var pu=X(_d());var vE="data-changed",bE="data-mapped";function $G(t){return t.categories.subject===vE}function MG(t){return t.categories.subject===bE}var g1=class{constructor(e){this.filter=e}currentFilter=void 0;notificationClient=void 0;notificationSubscription=void 0;setup(e){var r;this.notificationClient=e,(r=this.notificationSubscription)==null||r.unsubscribe(),this.notificationSubscription=e.messageReceived().subscribe(i=>this.processMessage(i)),this.currentFilter&&e.addOrReplaceSubscription(this.currentFilter,this.currentFilter)}setCurrentProject(e){let r={projectId:[e,0],...this.filter};this.currentFilter=this.notificationClient?this.notificationClient.addOrReplaceSubscription(r,this.currentFilter):r}};var yE=class extends g1{dataInserted=new pu.Subject;dataUpdated=new pu.Subject;dataDeleted=new pu.Subject;dataUndeleted=new pu.Subject;dataMapped=new pu.Subject;dataUnmapped=new pu.Subject;constructor(){super({subject:[vE,bE]})}processMessage(e){if($G(e)&&e.data){let r={...e.data,origin:e.to.tokenId===e.data.byTokenId&&(e.data.byTabHint===Ce.tabHint||!e.data.byTabHint)?"self":"other"};e.data.op==="insert"?this.dataInserted.next(r):e.data.op==="update"?this.dataUpdated.next(r):e.data.op==="delete"?this.dataDeleted.next(r):e.data.op==="undelete"&&this.dataUndeleted.next(r)}else if(MG(e)&&e.data){let r={...e.data,origin:e.to.tokenId===e.data.byTokenId&&(e.data.byTabHint===Ce.tabHint||!e.data.byTabHint)?"self":"other"};e.data.op==="map"?this.dataMapped.next(r):e.data.op==="unmap"&&this.dataUnmapped.next(r)}}},pRe=new yE;function yc(){return pRe}function fRe(){let t,e,r=new Promise((i,n)=>{t=i,e=n});return r.catch(()=>{}),r.resolve=t,r.reject=e,r}var v1=class{acquired;get isFree(){return this.acquired===void 0}async acquire(){for(;this.acquired;)await this.acquired;this.acquired=fRe()}release(){if(!this.acquired)throw new Error("Trying to release a non-acquired mutex.");this.acquired.resolve(),this.acquired=void 0}async waitForRelease(){this.acquired&&await this.acquired}};var NG=1e3,DG=8*3600,mRe=500;var _E=class extends Ce{serviceName;ctor;entityCache=new du(NG,DG);cachePrefillMutex=new v1;nextCachePrefillTime=H.now();findCachedMutexes=new Map;cacheDeleted;events;uniqueCacheKeys=[];constructor(e,r,i,n){super(i,n),this.ctor=r,this.cacheDeleted=Bf(r,it),this.serviceName=e,this.events={insert:new fu.Subject,update:new fu.Subject,delete:new fu.Subject,undelete:new fu.Subject,map:new fu.Subject,unmap:new fu.Subject},this.useNotifications(yc())}useNotifications(e){this.useNotificationsBase(e,this.events,[this.ctor.entityName],r=>{let i=["id",...this.uniqueCacheKeys];for(let n of i){let a=r[n];z0(a)&&this.entityCache.set(`${n}:${a}`,r)}},r=>{if(this.cacheDeleted){let i=this.entityCache.find(n=>(n==null?void 0:n.id)===r.id);for(let n of i)n.is_deleted=!0}else this.entityCache.purge(i=>(i==null?void 0:i.id)===r.id)})}async findOne(e){if(typeof e=="object"){let i={...e};return i.pagination=i.pagination??{},i.pagination.limit=1,(await this.find(i)).data[0]}if(!e)throw new Error("findOne needs a valid id as an argument");return(await this.find({id:e})).data[0]}async findIds(e){let r=await this.find({...e,idOnly:!0});return{...r,data:r.data.map(i=>i.id)}}async find(e,r){e=hRe(e);let i=JSON.stringify(e),n=i.length>=mRe?await this.post(`/${this.serviceName}/find`,e):await this.get(`/${this.serviceName}`,{q:i});return e!=null&&e.idOnly||(n.data=n.data.map(a=>this.toClassObject(a,r??this.ctor))),n}async count(e,r){return(await this.find({...e,countOnly:!0},r)).meta.count}async findCached(e,r,i,n=!1){if(i||await this.cachePrefillMutex.waitForRelease(),e===void 0&&r===void 0){let u=new Set,l=this.entityCache.find(p=>p!==null),d=[];for(let p of l)!u.has(p.id)&&(n||!this.cacheDeleted||!p.is_deleted)&&(d.push(p),u.add(p.id));return d}let a=Ot(e);r??="id";let o=`keys:${a.join(",")}; byKey:${String(r)??""}; ${n}`;for(;;){let u=this.findCachedMutexes.get(o);if(u===void 0)break;await u}let s=new Map;for(let u of a){let l=`${String(r)}:${u}`,d=this.entityCache.get(l);d!==void 0&&(d===null||n||!this.cacheDeleted||!d.is_deleted)&&s.set(u,d)}if(!i){let u=["id",...this.uniqueCacheKeys];if(!u.includes(r))throw new Error("Invalid cache key for entity");let l=a.filter(p=>!s.has(p));if(l.length>0){let f=(async g=>{let v=r==="id"?await this.find({ids:l}):await this.find({filter:{[r]:{op:"in",value:l}},includeDeleted:n});for(let b of v.data){s.set(b[r],b);for(let x of g){let k=`${x}:${b[r]}`;this.entityCache.set(k,b)}}})(u),m=f.catch(()=>{});this.findCachedMutexes.set(o,m);try{await f}finally{this.findCachedMutexes.delete(o)}}a.filter(p=>!s.has(p)).forEach(p=>{let f=`${String(r)}:${p}`;n?this.entityCache.set(f,null):this.entityCache.getOrSet(f,null)})}return Array.isArray(e)?a.map(u=>s.get(u)).filter(z0):s.get(a[0])??void 0}async prefillCache(e){if(Ot(e==null?void 0:e.map).find(r=>r.result))throw new Error("Internal error: prefilled entities must be of the same type as data client");await this.cachePrefillMutex.acquire();try{if(H.now()>=this.nextCachePrefillTime){let r=await this.find({...e,pagination:{limit:NG},idOnly:!1,includeTotalCount:!1,countOnly:!1,order:void 0,includeDeleted:(e==null?void 0:e.includeDeleted)??this.cacheDeleted}),i=["id",...this.uniqueCacheKeys];for(let n of r.data)for(let a of i){let o=n[a];if(z0(o)){let s=`${a}:${o}`;this.entityCache.set(s,n)}}this.nextCachePrefillTime=H.now().plus({seconds:DG})}}finally{this.cachePrefillMutex.release()}return this.entityCache.count}purgeCache(){this.entityCache.clear()}async insert(e){e=this.strongify(e,this.ctor,!1);let r=await this.post(`/${this.serviceName}/${Array.isArray(e)?"bulk":""}`,e),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataInserted,{values:n,batchIndex:0}),i}async update(e,r=!1){e=this.strongify(e,this.ctor,!1);let i=r?"?force=1":"",n=await this.put(`/${this.serviceName}/${Array.isArray(e)?"bulk":e.id}${i}`,e),a=Array.isArray(n)?n:this.strongify(n,this.ctor),o=Ot(a);return this.notifications&&this.dispatch(this.notifications.dataUpdated,{values:o,batchIndex:0}),a}async remove(e){let i=Array.isArray(e)?await this.delete(`/${this.serviceName}/bulk`,void 0,{ids:e.map(a=>a.id).join(",").toString()}):await this.delete(`/${this.serviceName}/${e.id}`),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataDeleted,{values:n,batchIndex:0}),i}async undelete(e){let r=Array.isArray(e)?await this.post(`/${this.serviceName}/bulk/undelete`,e.map(a=>({id:a.id}))):await this.post(`/${this.serviceName}/undelete/${e.id}`,{}),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=Ot(i);return this.notifications&&this.dispatch(this.notifications.dataUndeleted,{values:n,batchIndex:0}),i}async addMappings(e,r,i){return this.executeMappings(i?"add_or_update":"add",e,Ot(r))}async updateMappings(e,r){return this.executeMappings("update",e,Ot(r))}async removeMappings(e,r){return this.executeMappings("delete",e,Ot(r))}async addMapping(e,r,i){return this.addMappings(e,[r],i)}async updateMapping(e,r){return this.updateMappings(e,[r])}async removeMapping(e,r){return this.removeMappings(e,[r])}async executeMappings(e,r,i){let n=I3(r);await this.post(`/${this.serviceName}/mapping/bulk/${n.join(":")}?op=${e}`,i),this.notifications&&this.dispatchMappingEvents(e,r,i)}dispatchMappingEvents(e,r,i){let n=I3(r);if(e!=="update")e==="add"||e==="add_or_update"?this.dispatch(this.notifications.dataMapped,{values:i,mapOp:e,entities:n,batchIndex:0}):this.dispatch(this.notifications.dataUnmapped,{values:i,entities:n,mapOp:e,batchIndex:0});else{let a=i.filter(s=>!w3(s.newIds)),o=i.filter(s=>w3(s.newIds));a.length>0&&this.dispatch(this.notifications.dataMapped,{values:a,mapOp:e,entities:n,batchIndex:0}),o.length>0&&(this.dispatch(this.notifications.dataUnmapped,{values:o.map(s=>({...s,ids:{...s.ids,...s.newIds},mapped:void 0})),entities:n,mapOp:e,batchIndex:0}),this.dispatch(this.notifications.dataMapped,{values:o.map(s=>({...s,ids:{...s.ids,...s.newIds}})),entities:n,mapOp:"add",batchIndex:0}))}}dispatch(e,r){let i=JSON.parse(JSON.stringify(r));setTimeout(()=>{e.next({...i,origin:"local",byTokenId:"LOCAL",byUserId:0,entity:this.ctor.entityName})},1)}},Pr=class extends _E{constructor(e,r,i,n){super(e,r,i,n)}async findOne(e){return super.findOne(e)}async find(e,r){return super.find(e,r)}async findIds(e){return super.findIds(e)}async count(e,r){return super.count(e,r)}async findCached(e,r,i,n){return typeof e=="boolean"&&(n=e,e=void 0),super.findCached(e,r,i,n)}async prefillCache(e){return super.prefillCache(e)}async insert(e){return super.insert(e)}async update(e,r=!1){return super.update(e,r)}async remove(e){return super.remove(e)}async undelete(e){return super.undelete(e)}async addMappings(e,r,i){return super.addMappings(e,r,i)}async removeMappings(e,r){return super.removeMappings(e,r)}async updateMappings(e,r){return super.updateMappings(e,r)}async addMapping(e,r,i){return super.addMapping(e,r,i)}async updateMapping(e,r){return super.updateMapping(e,r)}async removeMapping(e,r){return super.removeMapping(e,r)}};function hRe(t){return t||{}}var b1=class extends Pr{constructor(e){super("project",ys,e)}};var BG=X(ot());var _1=X(ot());var y1=1e15,qG=1e8;function _c(t){class e extends t{sort_index=0}return T([(0,_1.IsInt)(),xG(y1),m1(-y1),R(`An integer sort index for natural ordering of this entity or mapping value - value must in range (${-y1+1},${y1-1})`)],e.prototype,"sort_index",2),no(e)}function Bt(t){class e extends t{project_id=0}return T([ge("project"),AG(),R("The project id this entity or mapping belongs to")],e.prototype,"project_id",2),no(e)}var FG=3;function jr(t){class e extends t{title=""}return T([(0,_1.IsString)(),lo(FG),de(200),R(`A descriptive title for this entity or mapping (3 to ${FG} characters)`,{example:"A Descriptive Title"})],e.prototype,"title",2),no(e)}function LG(t){let e=Symbol(t+"Attribute");return[function(r){return function(i,n){(i.constructor[e]??=[]).push({prop:n,data:r})}},function(r){return RG(r,e).map(i=>i.prop)},function(r,i){var n;return(n=RG(r,e).find(a=>a.prop===i))==null?void 0:n.data}]}function RG(t,e){var i;let r=typeof t=="function";return!t||typeof t!="object"&&!r?[]:((i=r?t:t.constructor)==null?void 0:i[e])??[]}var x1=(f=>(f.Code="code",f.Grid="t",f.GridRow="tr",f.GridCell="td",f.Heading="h1",f.Li="li",f.Link="a",f.Image="img",f.Ol="ol",f.Paragraph="p",f.QuickCopy="cp",f.Ul="ul",f))(x1||{}),$e=x1,Nnt=new Map([[$e.Paragraph,{childTypes:[$e.Link,$e.QuickCopy,$e.Image],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0}],[$e.Heading,{childTypes:[$e.Link,$e.QuickCopy],disallowedAncestors:["h1"],canBeRoot:!0,canHaveText:!0}],[$e.QuickCopy,{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}],[$e.Code,{childTypes:[],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0}],[$e.Link,{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}],[$e.Image,{childTypes:[],disallowedAncestors:["li"],canBeRoot:!1,canHaveText:!1}],[$e.Grid,{childTypes:[$e.GridRow],disallowedAncestors:[],canBeRoot:!0,canHaveText:!1}],[$e.GridRow,{childTypes:[$e.GridCell],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1}],[$e.GridCell,{childTypes:[$e.Paragraph,$e.Ul,$e.Ol,$e.Heading,$e.Code],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1}],[$e.Ul,{childTypes:[$e.Li],disallowedAncestors:["ul","ol"],canBeRoot:!1,canHaveText:!1}],[$e.Ol,{childTypes:[$e.Li],disallowedAncestors:["ul","ol"],canBeRoot:!1,canHaveText:!1}],[$e.Li,{childTypes:[$e.QuickCopy,$e.Link],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0}]]);var[vn,Vnt]=LG("DocumentText");function S1(t,e){return JSON.stringify({v:1,t:"slate",c:t},(r,i)=>r[0]!=="_"?i:void 0,e)}var w1=X(ot());var _m=5e3,qt=class extends Je(Bt(vs(De(it(_c(jr(Be("testcase_folders","testcase_folder",["tenant"],"TCF")))))))){testcase_folder_parent_id=0;description="";constructor(e){super(),this.initialize(e)}};T([ge("testcase_folder"),(0,w1.IsInt)(),R("The id of the folder's parent in the tree structure (no cycles allowed)")],qt.prototype,"testcase_folder_parent_id",2),T([(0,w1.IsString)(),vn(),de(_m),ge("blob",!0),R("An optional description for this test case folder (can be a rich text document)")],qt.prototype,"description",2);var bn=class extends Je(De(Bt(it(jr(Be("testplans","testplan",["tenant"],"TP")))))){description="";$testrun_count=0;$last_testrun_created=null;$open_testrun_count=0;$query_count=0;constructor(e){super(),this.initialize(e)}};T([(0,BG.IsString)(),vn(),de(_m),ge("blob",!0),R("An optional description for this test plan (can be a rich text document)")],bn.prototype,"description",2),T([dn(),ru(),R("The number of test runs linked to this test plan - read only")],bn.prototype,"$testrun_count",2),T([dn(),R("The time the last test run was created from this test plan - read only")],bn.prototype,"$last_testrun_created",2),T([dn(),ru(),R("The number of open test runs linked to this test plan - read only")],bn.prototype,"$open_testrun_count",2),T([dn(),ru(),R("The number of tset case queries linked to this test plan - read only")],bn.prototype,"$query_count",2);var k1=class extends Pr{constructor(e){super("testplan",bn,e)}};var mu=X(_d());var xm=X(ot());var $r=class extends Be("permission_groups","permission_group",["central","tenant"]){name="";description="";is_builtin=!1;constructor(e){super(),this.initialize(e)}};T([(0,xm.IsString)(),de(100)],$r.prototype,"name",2),T([(0,xm.IsString)(),de(1e3)],$r.prototype,"description",2),T([(0,xm.IsBoolean)(),Gt()],$r.prototype,"is_builtin",2);var Sm=X(ot());var Mr=class extends Be("permission_roles","permission_role",["central","tenant"]){name="";description="";is_builtin=!1;constructor(e){super(),this.initialize(e)}};T([(0,Sm.IsString)(),de(100)],Mr.prototype,"name",2),T([(0,Sm.IsString)(),de(1e3)],Mr.prototype,"description",2),T([(0,Sm.IsBoolean)(),Gt()],Mr.prototype,"is_builtin",2);var wm=class extends Ce{events;constructor(e){super(e),this.events={insert:new mu.Subject,update:new mu.Subject,delete:new mu.Subject,undelete:new mu.Subject,map:new mu.Subject,unmap:new mu.Subject},this.useNotifications(yc())}useNotifications(e){this.useNotificationsBase(e,this.events,[$r.entityName,Mr.entityName])}async getPermissions(e){return(await this.get(`/permission/me?project_id=${e}`)).permissions}async getProjectPermissions(){return await this.get("/permission/me/projects")}async getUsersWithPermissions(e,r){return r=Ot(r),(await this.get(`/permission/users?project_id=${e}&permissions=${encodeURIComponent(r.join(","))}`)).users}async getUserPermissions(e,r=0){return(await this.get(`/permission/user/${e}?project_id=${r}`)).permissions}async getGroups(){let e=await this.get("/permission/groups");return this.strongify(e,$r)}async getRoles(){let e=await this.get("/permission/roles");return this.strongify(e,Mr)}async getRoleUsers(e){return(await this.get(`/permission/users/role/${e}`)).users}async getGroupUsers(e){return(await this.get(`/permission/users/group/${e}`)).users}async getUserRoles(e,r){let i=await this.get(`/permission/roles/user/${e}?project_id=${r}`);return this.strongify(i,Mr)}async getAllUserRoles(){return await this.get("/permission/users/roles")}async getUserGroups(e){let r=await this.get(`/permission/groups/user/${e}`);return this.strongify(r,$r)}async getRoleGroups(e){let r=await this.get(`/permission/groups/role/${e}`);return this.strongify(r,$r)}async getGroupRoles(e,r){let i=await this.get(`/permission/roles/group/${e}?project_id=${r}`);return this.strongify(i,Mr)}async getAllPermissions(){return(await this.get("/permission/all")).permissions}async getRolePermissions(e,r=0){return(await this.get(`/permission/role/${e}?project_id=${r}`)).permissions}async getGroupPermissions(e,r=0){return(await this.get(`/permission/group/${e}?project_id=${r}`)).permissions}async addRole(e){let r=await this.post("/permission/role",e);return this.strongify(r,Mr)}async addGroup(e){let r=await this.post("/permission/group",e);return this.strongify(r,$r)}async addUserRole(e,r,i){await this.post(`/permission/role/${e}/user/${r}?project_id=${i}`,{})}async setUserRolesForProject(e,r,i){await this.post("/permission/user-roles",{subjectId:e,roleIds:r,projectId:i})}async setGroupRolesForProject(e,r,i){await this.post("/permission/group-roles",{subjectId:e,roleIds:r,projectId:i})}async addUserToGroup(e,r){await this.post(`/permission/group/${e}/user/${r}`,{})}async addGroupRole(e,r,i){await this.post(`/permission/role/${e}/group/${r}?project_id=${i}`,{})}async addRolePermission(e,r,i=0){await this.post(`/permission/role/${e}/permission/${r}?project_id=${i}`,{})}async updateRole(e){let r=await this.put("/permission/role",e);return this.strongify(r,Mr)}async updateGroup(e){let r=await this.put("/permission/group",e);return this.strongify(r,$r)}async removeUserRole(e,r,i){await this.delete(`/permission/role/${e}/user/${r}?project_id=${i}`)}async removeUserFromGroup(e,r){await this.delete(`/permission/group/${e}/user/${r}`)}async removeRole(e){await this.delete(`/permission/role/${e}`)}async removeGroup(e){await this.delete(`/permission/group/${e}`)}async removeGroupRole(e,r,i){await this.delete(`/permission/role/${e}/group/${r}?project_id=${i}`)}async removeRolePermission(e,r,i=0){await this.delete(`/permission/role/${e}/permission/${r}?project_id=${i}`)}};var T1=(g=>(g.UNSET="",g.CAN_READ="CAN_READ",g.CAN_MANAGE_TENANT="CAN_MANAGE_TENANT",g.CAN_MANAGE_USERS="CAN_MANAGE_USERS",g.CAN_MANAGE_PROJECTS="CAN_MANAGE_PROJECTS",g.CAN_CREATE_TESTCASES="CAN_CREATE_TESTCASES",g.CAN_DELETE_TESTCASES="CAN_DELETE_TESTCASES",g.CAN_RUN_TESTCASES="CAN_RUN_TESTCASES",g.CAN_COMMENT="CAN_COMMENT",g.CAN_CREATE_TESTPLANS="CAN_CREATE_TESTPLANS",g.CAN_DELETE_TESTPLANS="CAN_DELETE_TESTPLANS",g.CAN_MANAGE_AGENTS="CAN_MANAGE_AGENTS",g.CAN_ACT_AS_AGENT="CAN_ACT_AS_AGENT",g.CAN_MANAGE_BILLING="CAN_MANAGE_BILLING",g))(T1||{}),jat=xE(Object.keys(T1).map(t=>T1[t]).filter(t=>t!=="")),$at=xE(["CAN_READ"]),Mat=xE(["CAN_COMMENT","CAN_READ"]);function xE(t){return K0(t).sort()}var SE=5e3,VG=["title","steps"],UG=["folder","expected_result","precondition","key"],wE=new Map([["parent_folder_name","folder"],["parent_folder","folder"],["expected_results","expected_result"],["preconditions","precondition"]]),kE=" > ";var zG=["title","result"],WG=["folder","comment","key"];var ZG=X(AE());var ut=X(ot());var IE=class{map=new Map;get size(){return this.map.size}get(e){return this.map.get(e)}has(e){return this.map.has(e)}set(e,r){this.map.set(e,Array.isArray(r)?r:[r])}delete(e){return this.map.delete(e)}add(e,r){let i=this.map.get(e);i||this.map.set(e,i=[]),i.push(r)}addAll(e,r){let i=this.map.get(e);i||this.map.set(e,i=[]),i.push(...r)}remove(e,r){let i=this.get(e);if(i===void 0)return!1;let n=typeof r=="function",a=r,o=!1;for(let s=i.length-1;s>=0;s--){let u=i[s];(n&&a(u)||!n&&u===r)&&(i.splice(s,1),o=!0)}return i.length===0&&this.delete(e),o}[Symbol.iterator](){return this.map[Symbol.iterator]()}keys(){return Array.from(this.map.keys())}entries(){return Array.from(this.map.entries())}forEach(e){this.map.forEach(e)}clear(){this.map.clear()}};var bRe=200,yRe=1e4,EE="cf__",_Re=new RegExp(`^(?!${EE})`);var HG=new Map([["string",{type:"string",validator:t=>typeof t=="string"&&t.length<=bRe,convFromString:t=>t}],["text",{type:"text",validator:t=>typeof t=="string"&&t.length<=yRe,convFromString:t=>t}],["boolean",{type:"boolean",validator:t=>typeof t=="boolean",convFromDb:YW,convFromString:t=>t==="true"||t==="True"||t==="1"}],["integer",{type:"integer",validator:t=>(0,ut.isInt)(t),convFromString:t=>hE(t)}],["number",{type:"number",validator:t=>(0,ut.isNumber)(t,{allowNaN:!1}),convFromString:t=>gE(t)}],["date",{type:"date",validator:t=>(0,ut.isISO8601)(t),convToDb:(t,e)=>t[e]!==void 0?t[e]=new Date(t[e]).toISOString():void 0,convFromString:t=>vG(bG(t))}],["duration",{type:"duration",validator:t=>(0,ut.isNumber)(t,{allowNaN:!1}),convFromString:t=>gE(t)}],["tag",{type:"tag",validator:t=>typeof t=="string",convFromString:t=>t}],["user_id",{type:"user_id",validator:t=>(0,ut.isInt)(t)&&t!==0,convFromString:t=>hE(t)}],["url",{type:"url",validator:t=>typeof t=="string"&&(0,ut.isURL)(t),convFromString:t=>t}]]),yn=class extends _c(De(Be("custom_fields","custom_field",["tenant"],"CF"))){table="";name="";display_name=void 0;type="string";is_builtin=!1;options={projectIds:[],required:!1,visible:!1,includeByDefault:!1,allowCustomValues:!1,description:""};constructor(e){super(),this.initialize(e)}};T([(0,ut.IsString)(),de(40)],yn.prototype,"table",2),T([SG(_Re),(0,ut.IsLowercase)(),lo(3),de(28),(0,ut.IsString)(),TG(),OG()],yn.prototype,"name",2),T([(0,ut.IsString)(),(0,ut.IsOptional)(),de(40)],yn.prototype,"display_name",2),T([(0,ut.IsString)()],yn.prototype,"type",2),T([(0,ut.IsBoolean)(),Gt()],yn.prototype,"is_builtin",2),T([tu()],yn.prototype,"options",2);var xRe=1;function _n(t,e,r,i,n){let a=e?n||SRe(r):void 0;if(a)return`$KEY$${a}`;if(t==="off")return(xRe++).toString();if(t==="title")return(r??"").trim();if(t==="folder_title")return`${i.join(`
|
|
200
200
|
`).trim()}:|:${(r??"").trim()}`;throw new Error("Invalid import duplicate mode")}function SRe(t,e){var i;if(e)return e;let r=(i=/(?:TC-|#)(\d{1,8})(?:\W|$)/gi.exec(t??""))==null?void 0:i[1];if(r)return r}function O1(t,e){let r={};if(e.size===0)return r;for(let i of Object.keys(t)){let n=t[i],a=e.get(i),o=a?HG.get(a.type):void 0;if(a&&o){let s=o.convFromString(n);if(s!==void 0){let u=a.is_builtin?a.name:`${EE}${a.name}`;r[u]=s!==""?s:null}}}return r}function A1(t,e){let r=new Map,i=new Set;for(let n of t)for(let a of Object.keys(n.custom??{}))i.add(a);for(let n of i){let a=n.toLowerCase(),o=e.find(s=>{var u;return s.name.toLowerCase()===a||((u=s.display_name)==null?void 0:u.toLowerCase())===a});o&&r.set(n,o)}return r}function I1(t,e,r){let i=e.filter(o=>!t.includes(o));if(i.length>0)throw new Error(`Required column(s) '${i.join(", ")}' missing in CSV file`);let n=r.filter(o=>!t.includes(o));return{cfCands:t.filter(o=>!e.includes(o)&&!r.includes(o)),missingOptionals:n}}function GG(t,e){for(let r of Object.keys(t)){let i=e.get(r.toLowerCase());i&&(t[i]=t[r],delete t[r])}return t}function KG(t,e){let r=[];for(let i of t){let n=e.get(i);n?r.includes(n)||r.push(n):r.push(i)}return r}function hu(t,e,r){if(Array.isArray(t))return t;if(!e)return[t];let i=t.split(r).filter(n=>n);return i.length===0&&i.push(""),i}function E1(t,e){let r=[],i=t;for(;i;)r.push(i.title),i=e.get(i.testcase_folder_parent_id);return r.length>0?r.reverse():[""]}var C1=class{async prepareImport(e,r,i){let n=(0,ZG.parse)(await i.fileReader(e.csvFile,e.encoding??"utf8"),{header:!0,skipEmptyLines:!0});for(let f of n.errors)i.log(`CSV parse error: ${i.hlError(f.message)} at row ${i.hl(f.row.toString())}`);i.log(`CSV import: ${i.hl(n.data.length.toString())} rows`);let a=KG(n.meta.fields,wE),{cfCands:o,missingOptionals:s}=r.checkRequiredAndOptionalFields(a??[]);s.length>0&&i.log(`Optional column(s) '${i.hl(s.join(", "))}' not present in CSV file`);let u=n.data;if(u.length===0)return i.log(i.hlSuccess("No test cases need to be imported")),[];let l=0,d=new Map,p=e.stepMode==="rows";for(let f of u){GG(f,wE);let m=`${f.folder??""}:::${f.title}`;if(!f.title)throw new Error(`Row ${l+1} is missing title`);let g=p?d.get(m):void 0;g?(g.precondition[g.precondition.length-1]!==f.precondition&&g.precondition.push(f.precondition??""),g.steps.push(f.steps??""),g.expected_result.push(f.expected_result??"")):d.set(m,{title:f.title,folder:f.folder??"",steps:[f.steps??""],precondition:[f.precondition??""],expected_result:[f.expected_result??""],idx:l,key:f.key??"",custom:o.reduce((v,b)=>(v[b]=f[b],v),{})}),l++}return Array.from(d.values()).sort((f,m)=>f.idx-m.idx)}};var YG=X(AE()),P1=class{async prepareImport(e,r,i){let n=(0,YG.parse)(await i.fileReader(e.csvFile,e.encoding??"utf8"),{header:!0,skipEmptyLines:!0});for(let u of n.errors)i.log(`CSV parse error: ${i.hlError(u.message)} at row ${i.hl(u.row.toString())}`);i.log(`CSV import: ${i.hl(n.data.length.toString())} rows`);let{cfCands:a,missingOptionals:o}=r.checkRequiredAndOptionalFields(n.meta.fields??[]);o.length>0&&i.log(`Optional column(s) '${i.hl(o.join(", "))}' not present in CSV file`);let s=n.data;return s.length===0?(i.log(i.hlSuccess("No test case results to be imported")),[]):s.map(u=>({title:u.title,folder:u.folder,result:wRe(u.result),comment:u.comment,custom:a.reduce((l,d)=>(l[d]=u[d],l),{})}))}};function wRe(t){let e=(t==null?void 0:t.toLowerCase().trim())??"";if(["pass","passed","ok","success","1","true"].includes(e))return"passed";if(["fail","failed","nok","failure","0","false"].includes(e))return"failed";if(["blocked","block"].includes(e))return"blocked";if(["skipped","skip","notrun","not run","-"].includes(e))return"skipped";throw Error(`Unknown test result status: '${t}'`)}var EK=X(AK());var j1=class{async prepareImport(e,r,i){try{let n=new EK.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"_",textNodeName:"TEXT"}),a=await i.fileReader(e.xmlFile,"utf8"),o=n.parse(a);(!o||!o.testsuite&&!o.testsuites)&&i.log(i.hlError("XML file is not a JUnit file - nothing imported"));let s=[],u=o.testsuites?Ot(o.testsuites.testsuite):o.testsuite?Ot(o.testsuite):[];for(let l of u){let d=Ot(l==null?void 0:l.testcase).map(p=>{let f=!p._classname||p._name===p._classname||p._classname.includes(l._name)?p._name:`${p._classname} - ${p._name}`;return f.startsWith(l._name)&&f.length>l._name.length+2&&(f=f.substring(l._name.length).trim()),{title:f,folder:l._name??"",result:p.error||p.failure?"failed":"passed",comment:IK(p.error)||IK(p.failure)}});s.push(...d)}return i.log(`JUnit XML import: ${i.hl(s.length.toString())} rows`),s.length===0?(i.log(i.hlError("JUnit file contains no testcases - nothing imported")),[]):s}catch(n){throw new Error(`XML parsing error: ${n.message}`)}}};function IK(t){return t?typeof t=="string"?t:`${t._message?t._message+`
|
|
201
201
|
`:""}${t.TEXT}`:""}var CK=require("fs/promises"),$1=class{async prepareImport(e,r,i){try{let l=function(f,m){let g=f.title??"",v=f.file??"",b=f.suites??[],x=f.specs??[],k=g&&g!==v?[...m,g]:m;b.forEach(P=>l(P,k)),x.forEach(P=>d(P,k))},d=function(f,m){f.tests.forEach(g=>p(g,m,f.title??""))},p=function(f,m,g){let v=f.projectName??"",b=f.results??[];if(b.length>0){let x=b.at(-1),k={title:`${g} [${v}]`,folder:m,result:f.status!=="expected"?"failed":"passed",comment:f.status!=="expected"?C7e(x):"",key:"",custom:{}};u.push(k)}};var n=l,a=d,o=p;let s=JSON.parse(await(0,CK.readFile)(e.jsonFile,"utf-8"));(!s||!s.suites)&&i.log(i.hlError("Playwright JSON file is invalid - missing suites key"));let u=[];return l(s,[]),i.log(`Playwright JSON import: ${i.hl(u.length.toString())} rows`),u.length===0?(i.log(i.hlError("Playwright file contains no testcases - nothing imported")),[]):u}catch(s){throw new Error(`Playwright JSON parsing error: ${s.message}`)}}},E7e=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","gm");function C7e(t){return`${t.status} `+t.errors.map(e=>e.message.slice(0,1e4).replace(E7e,"")).join(`
|
|
202
202
|
`)}var DK=X(jK());var M7e=["count","count_distinct","sum","min","max","avg","maxGroup","minGroup"],LE=Tr("DurationSpec").numberOpt("years").numberOpt("months").numberOpt("days").numberOpt("hours").numberOpt("minutes").numberOpt("seconds"),Pot=Tr("DataAnalysisParams").record("tables",At,t=>t.arrayOrOne(e=>e.string(tc),{minLen:1})).recordOpt("columns",At,t=>t.arrayOrOne(e=>e.string(At))).record("aggr",At,t=>t.record(At,e=>e.arrayOrOne(r=>r.string({values:M7e}),{minLen:1}))).stringOpt("groupAggrOn",At).recordOpt("group",At,t=>t.arrayOrOne(e=>e.string(At))).recordOpt("order",At,t=>t.arrayOrOne(e=>e.string(r=>At(r[0]==="-"?r.substring(1):r)))).recordOpt("alias",At,t=>t.string(At)).arrayOpt("optionalTables",t=>t.string(tc)).optIs("filter",io).objectOpt("time",t=>t.oneOf("from",e=>e.string(Rf),e=>e.is(LE)).oneOf("to",e=>e.string(Rf),e=>e.is(LE),e=>e.string({value:"now"})).oneOf("steps",e=>e.integer({nonNegative:!0}),e=>e.is(LE))).stringOpt("asOf",Rf).integerOpt("projectId",{nonNegative:!0}).boolOpt("withComputed").boolOpt("includeDeleted");function $K(t){let e=H.fromISO(fE());if(typeof t!="string"){let r=ne.fromObject(t);return r.toMillis()>0?e.minus(r):e.plus(r)}else return t==="now"?e:H.fromISO(t,{zone:"utc"})}var M1=class extends Map{getOrSet(e,r){let i=this.get(e);return i===void 0&&(i=typeof r=="function"?r():r,this.set(e,i)),i}upsert(e,r,i){let n=this.get(e);return n===void 0&&(n=typeof i=="function"?i():i),r(n),n!==void 0&&this.set(e,n),n}keyList(){return Array.from(this.keys())}valueList(){return Array.from(this.values())}};var FK=15*60,N7e=15*60;var MK=!1,NK=new du(100,FK),D1=new du(100,N7e),Om=new M1,xn=class extends Ce{constructor(e){super(e),D7e()}async analyze(e,r){F7e(e),r=xn.inferCacheOpts(r,e);let i=xn.queryCache(e,r);return i?(i.cached=!0,i):(i=await this.post("/analyze",e),xn.updateCache(e,i,r),i)}static queryCache(e,r){if(r.mode===3){let i=N1(e);return NK.get(i)}else if(r.mode===2){let i=N1(e);return D1.get(i)}}static updateCache(e,r,i){var n,a;if(i.mode===3){let o=N1(e);NK.set(o,r)}else if(i.mode===2){if((((n=i.watchedEntities)==null?void 0:n.length)??0)<=0)throw new Error("Validation mode requires watchedEntities");let o=N1(e);D1.set(o,r),(a=i.watchedEntities)==null||a.forEach(s=>{Om.getOrSet(s,()=>new Set).add(o)})}}static inferCacheOpts(e,r){return e??={mode:1,watchedEntities:[]},e.mode===4&&(e.mode=!r.time||$K(r.time.to)>H.now().minus(ne.fromObject({seconds:FK}))?2:3),e}};function D7e(){if(!MK){let i=function(a){let o=Om.get(a.entity);o==null||o.forEach(s=>D1.del(s)),Om.delete(a.entity)},n=function(a){for(let o of a.entities){let s=Om.get(o);s==null||s.forEach(u=>D1.del(u)),Om.delete(o)}};var t=i,e=n;let r=yc();r.dataInserted.subscribe(i),r.dataUpdated.subscribe(i),r.dataDeleted.subscribe(i),r.dataUndeleted.subscribe(i),r.dataMapped.subscribe(n),r.dataUnmapped.subscribe(n),MK=!0}}function N1(t){return(0,DK.default)(JSON.stringify(t))}function F7e(t){for(let e of Object.keys(t.tables)){let r=t.tables[e];if(typeof r!="function")continue;let i=r.tableName;t.tables[e]=i??r.ctors.map(n=>n.tableName)}}var q1=class extends Ce{async execute(e){return await this.post("/data-batch",e)}build(){return new BE(this)}},BE=class{constructor(e){this.client=e;this.p={steps:[]}}p;get isEmpty(){return this.p.steps.length===0}async execute(){if(this.isEmpty)return{};let e={},r=this.p.steps.filter(n=>{if(n.op==="analyze"){let a=xn.inferCacheOpts(n.opts,n.params),o=xn.queryCache(n.params,a);if(o)return o.cached=!0,e[n.as]=o,!1}return!0}),i=r.length>0?await this.client.execute({...this.p,steps:r}):{};for(let n of r)if(n.op==="analyze"){let a=xn.inferCacheOpts(n.opts,n.params);i[n.as]&&xn.updateCache(n.params,i[n.as],a)}return{...e,...i}}if(e,r){return e?r(this):this}read(e,r){return this.p.steps.push({op:"read",as:"",entity:e,readParams:r,result:!1}),this}analyze(e,r){return this.p.steps.push({op:"analyze",as:"",params:e,opts:r}),this}insert(e,r){let{entity:i,_inputData:n}=F1(r,e);return this.p.steps.push({op:"insert",entity:i,inputData:n,result:!1}),this}update(e,r){let{entity:i,_inputData:n}=F1(r,e);return this.p.steps.push({op:"update",entity:i,inputData:n,result:!1}),this}delete(e,r){let{entity:i,_inputData:n}=F1(r,e,"idsOnly");return this.p.steps.push({op:"delete",entity:i,inputData:n}),this}undelete(e,r){let{entity:i,_inputData:n}=F1(r,e,"idsOnly");return this.p.steps.push({op:"undelete",entity:i,inputData:n,result:!1}),this}mapAdd(e,r){let i=Array.isArray(e)?e:e.ctors;return this.p.steps.push({op:"map",mapOp:"add",sourceEntity:i[0],entities:i,mappings:r}),this}mapUpdate(e,r){let i=Array.isArray(e)?e:e.ctors;return this.p.steps.push({op:"map",mapOp:"update",sourceEntity:i[0],entities:i,mappings:r}),this}mapAddOrUpdate(e,r){let i=Array.isArray(e)?e:e.ctors;return this.p.steps.push({op:"map",mapOp:"add_or_update",sourceEntity:i[0],entities:i,mappings:r}),this}mapDelete(e,r){var n;let i=Array.isArray(e)?e:e.ctors;return this.p.steps.push({op:"map",mapOp:"delete",sourceEntity:i[0],entities:i,mappings:(n=r[0])!=null&&n.ids?r:r.map(a=>({ids:a}))}),this}asResult(e){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete"||r.op==="map"||r.op==="analyze")&&(r.as=e,r.result=!0),this}as(e){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete")&&(r.as=e,r.result=!1),this}fromSource(e,r){let i=this.current;if(i&&typeof e=="string"&&(i.op==="delete"||i.op==="update"||i.op==="undelete"))i.from=e,i.inputData=void 0;else if(i&&r&&i.op==="map"){let n=i.entities.findIndex(a=>(typeof a=="string"?a:a.entityName)===r.entityName);n>=0&&(i.from??=[],i.from[n]=e)}return this}get current(){return this.p.steps[this.p.steps.length-1]}};function F1(t,e,r){var i;if(Array.isArray(e)){let n=(i=e==null?void 0:e[0])==null?void 0:i.constructor;if(!n)throw new Error("Internal error: Cannot autoresolve entity ctor");return{entity:n,_inputData:r?qK(e):e}}else{if(e)return{entity:e,_inputData:r?qK(t):t};throw new Error("Invalid arguments")}}function qK(t){return t?t.map(e=>({id:e.id})):void 0}var _t=X(ot());var RK=5e3,VE=3e4,q7e=2*VE,Am=(r=>(r.Text="TEXT",r.Steps="STEPS",r))(Am||{}),nst=Object.keys(Am).map(t=>Am[t]),me=class extends Je(Bt(vs(De(it(_c(jr(Be("testcases","testcase",["tenant"],"TC",{allowCustomFields:!0})))))))){owner_user_id=0;$owner_name="";type="";description="";template="TEXT";precondition_text=void 0;content_text=void 0;steps_text=void 0;expected_result_text=void 0;priority=void 0;status=void 0;testcase_type=void 0;automation=void 0;estimate=void 0;constructor(e){super(),this.initialize(e)}};T([ge("user"),(0,_t.IsInt)(),R("The global user id of the test case owner")],me.prototype,"owner_user_id",2),T([dn(),R("The resolved display name of the owner user - read only")],me.prototype,"$owner_name",2),T([(0,_t.IsString)(),de(30),(0,_t.IsOptional)(),R("Reserved for future use")],me.prototype,"type",2),T([(0,_t.IsString)(),de(RK),(0,_t.IsOptional)(),lu(),R("Reserved for future use")],me.prototype,"description",2),T([(0,_t.IsString)(),(0,_t.IsEnum)(Am),R("The template type used for the test case: STEPS or TEXT")],me.prototype,"template",2),T([(0,_t.IsString)(),vn(),(0,_t.IsOptional)(),de(RK),ge("blob",!0),R("A description of the precondition required for the test case (can be a rich text document)",{example:""})],me.prototype,"precondition_text",2),T([(0,_t.IsString)(),vn(),(0,_t.IsOptional)(),de(q7e),ge("blob",!0),R("The test case content - used with template TEXT (can be a rich text document)",{example:""})],me.prototype,"content_text",2),T([(0,_t.IsString)(),vn(),(0,_t.IsOptional)(),de(VE),ge("blob",!0),R("The test case content - used with template STEPS (can be a rich text document)",{example:""})],me.prototype,"steps_text",2),T([(0,_t.IsString)(),vn(),(0,_t.IsOptional)(),de(VE),ge("blob",!0),R("The test case expected result - used with template TEXT (can be a rich text document)",{example:""})],me.prototype,"expected_result_text",2),T([R("The test case priority (This is a builtin-custom field)",{example:1})],me.prototype,"priority",2),T([R("The test case status (This is a builtin-custom field)",{example:""})],me.prototype,"status",2),T([R("The test case type (This is a builtin-custom field)",{example:""})],me.prototype,"testcase_type",2),T([R("The test case automation status (This is a builtin-custom field)",{example:""})],me.prototype,"automation",2),T([R("A test case time estimate (This is a builtin-custom field)",{example:100})],me.prototype,"estimate",2);var R1=class extends Pr{constructor(e){super("testcase",me,e)}};var L1=class extends Pr{constructor(e){super("testcase-folder",qt,e)}};var Nr=X(ot());var Kt=class extends Je(Bt(vs(De(it(jr(Be("testruns","testrun",["tenant"],"TR",{allowCustomFields:!0}))))))){testplan_id=void 0;closed_at=void 0;is_closed=!1;description=void 0;constructor(e){super(),this.initialize(e)}};T([ge("testplan"),(0,Nr.IsInt)(),(0,Nr.IsOptional)(),R("The optional id of the test plan this test run is associated with",{example:0})],Kt.prototype,"testplan_id",2),T([(0,Nr.IsOptional)(),(0,Nr.IsISO8601)(),R("The time this run was closed - all referenced test case data uses this as a historic timestamp",{example:uu})],Kt.prototype,"closed_at",2),T([Gt(),(0,Nr.IsBoolean)(),R("Whether the test run is closed or not - closed runs can not be modified until reopened")],Kt.prototype,"is_closed",2),T([(0,Nr.IsString)(),vn(),de(_m),ge("blob",!0),(0,Nr.IsOptional)(),R("An optional description for this test run (can be a rich text document)",{example:""})],Kt.prototype,"description",2);var B1=class extends Pr{constructor(e){super("testrun",Kt,e)}};var V1=class extends Ce{constructor(e){super(e)}async getCustomFieldsMetadata(){return await this.get("/custom-field/all")}async createCustomField(e){let r=await this.post("/custom-field",e);return this.strongify(r,yn)}async updateCustomField(e){let r=await this.put("/custom-field",Ot(e)),i=this.strongify(r,yn);return Array.isArray(e)?i:i[0]}async purgeCustomFieldAndData(e){await this.delete(`/custom-field/purge/${e.id}`)}};var zE=X(ot());var LK=/\s?\(?\d{1,2}\.\)?\s|\s?\(?\d{1,2}\.?\)\s/gm,BK=/\s?\[\d{1,3}\]\s/gm;function xc(t){return t.join(`
|