@revisium/admin 2.7.0-alpha.2 → 2.7.0
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.
|
@@ -354,7 +354,7 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes — see `,`
|
|
|
354
354
|
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ee(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function te(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ne(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function O(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${se(e)}`}e.not=O;var k=oe(e.operators.AND);function re(...e){return e.reduce(k)}e.and=re;var ie=oe(e.operators.OR);function ae(...e){return e.reduce(ie)}e.or=ae;function oe(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${se(n)} ${e} ${se(r)}`}function se(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),Gc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=Wc(),n=Hc();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),Kc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),qc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=Wc(),n=Gc(),r=Kc();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),Zee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=qc(),n=Wc(),r=Kc(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),Jc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),Yc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),Xc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=Jc(),n=Yc(),r=qc(),i=Wc(),a=Gc(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
355
355
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
356
356
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
357
|
-
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),Qee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=Wc(),n=Gc();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),Zc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=Wc(),n=Gc(),r=Kc(),i=Gc();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),$ee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=Wc(),n=Kc(),r=Zc(),i=qc();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),ete=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=Wc(),n=Gc();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),Qc=i(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),tte=i(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),$c=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=Gc(),n=Qc(),r=tte(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),el=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=Zee(),n=Xc(),r=Yc(),i=Xc(),a=Qee(),o=$ee(),s=ete(),c=Wc(),l=Kc(),u=$c(),d=Gc(),f=qc();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ne(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),O(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ne(e),ee(e),te(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return re(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);re(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function ee(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function te(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ne({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function O(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&k(e),t.return((0,c._)`${l.default.errors} === 0`))}function k({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function re(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>me(e,`$ref`,h.all.$ref.definition));return}p.jtd||ae(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ie(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ie(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ie(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&me(e,n.keyword,n.definition,t.type)})}function ae(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(oe(e,t),e.opts.allowUnionTypes||se(e,t),ce(e,e.dataTypes))}function oe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{ue(e.dataTypes,t)||fe(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),de(e,t)}}function se(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&fe(e,`use allowUnionTypes to allow union type keyword`)}function ce(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>le(t,e))&&fe(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function le(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function ue(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function de(e,t){let n=[];for(let r of e.dataTypes)ue(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function fe(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var pe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,_e(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=pe;function me(e,t,n,r){let i=new pe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var he=/^\/(?:[^~]|~0|~1)*$/,ge=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _e(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!he.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=ge.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=_e})),tl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),nl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$c();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),rl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=Wc(),n=tl(),r=Kc(),i=$c(),a=Gc(),o=el(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),nte=r({$id:()=>il,additionalProperties:()=>!1,default:()=>ll,description:()=>al,properties:()=>cl,required:()=>sl,type:()=>ol}),il,al,ol,sl,cl,ll,rte=n((()=>{il=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,al=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,ol=`object`,sl=[`$data`],cl={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},ll={$id:il,description:al,type:ol,required:sl,properties:cl,additionalProperties:!1}})),ul=i(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,n){if(e.length){let r=i(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function c(e){let t=0,n={error:!1,address:``,zone:``},r=[],a=[],c=!1,l=!1,u=s;for(let i=0;i<e.length;i++){let s=e[i];if(!(s===`[`||s===`]`))if(s===`:`){if(c===!0&&(l=!0),!u(a,r,n))break;if(++t>7){n.error=!0;break}i>0&&e[i-1]===`:`&&(c=!0),r.push(`:`);continue}else if(s===`%`){if(!u(a,r,n))break;u=o}else{a.push(s);continue}}return a.length&&(u===o?n.zone=a.join(``):l?r.push(a.join(``)):r.push(i(a))),n.address=r.join(``),n}function l(e){if(u(e,`:`)<2)return{host:e,isIPV6:!1};let t=c(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function u(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function d(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}function f(e,t){let n=t===!0?unescape:escape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function p(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let t=l(n);n=t.isIPV6===!0?`[${t.escapedHost}]`:e.host}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:a,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:r,isUUID:n,normalizeIPv6:l,stringArrayToHexStripped:i}})),ite=i(((e,t)=>{var{isUUID:n}=ul(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),ate=i(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizeComponentEncoding:a,isIPv4:o,nonSimpleDomain:s}=ul(),{SCHEMES:c,getSchemeHandler:l}=ite();function u(e,t){return typeof e==`string`?e=m(g(e,t),t):typeof e==`object`&&(e=g(m(e,t),t)),e}function d(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=f(g(e,r),g(t,r),r,!0);return r.skipEscape=!0,m(i,r)}function f(e,t,n,i){let a={};return i||(e=g(m(e,n),n),t=g(m(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function p(e,t,n){return typeof e==`string`?(e=unescape(e),e=m(a(g(e,n),!0),{...n,skipEscape:!0})):typeof e==`object`&&(e=m(a(e,!0),{...n,skipEscape:!0})),typeof t==`string`?(t=unescape(t),t=m(a(g(t,n),!0),{...n,skipEscape:!0})):typeof t==`object`&&(t=m(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function m(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},a=Object.assign({},t),o=[],s=l(a.scheme||n.scheme);s&&s.serialize&&s.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),a.reference!==`suffix`&&n.scheme&&o.push(n.scheme,`:`);let c=i(n);if(c!==void 0&&(a.reference!==`suffix`&&o.push(`//`),o.push(c),n.path&&n.path[0]!==`/`&&o.push(`/`)),n.path!==void 0){let e=n.path;!a.absolutePath&&(!s||!s.absolutePath)&&(e=r(e)),c===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),o.push(e)}return n.query!==void 0&&o.push(`?`,n.query),n.fragment!==void 0&&o.push(`#`,n.fragment),o.join(``)}var h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let c=e.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||``,i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(o(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&a===!1&&s(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}(!t||t&&!t.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&=escape(unescape(i.path)),i.fragment&&=encodeURI(decodeURIComponent(i.fragment))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return i}var _={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:m,parse:g};t.exports=_,t.exports.default=_,t.exports.fastUri=_})),ote=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ate();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),ste=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=el();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=Wc();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=tl(),a=nl(),o=Jc(),s=rl(),c=Wc(),l=$c(),u=Xc(),d=Gc(),f=(rte(),t(nte).default),p=ote(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=te(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=D.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(O.call(this,n,t),!t)return(0,d.eachItem)(n,e=>k.call(this,e)),this;ie.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>k.call(this,e,r):e=>r.type.forEach(t=>k.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=oe(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,e.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function T(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function D(){let e={...this.opts};for(let t of h)delete e[t];return e}var ee={log(){},warn(){},error(){}};function te(e){if(e===!1)return ee;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ne=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function k(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?re.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function re(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function ie(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=oe(t)),e.validateSchema=this.compile(t,!0))}var ae={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function oe(e){return{anyOf:[e,ae]}}})),cte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),dl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=nl(),n=Zc(),r=Wc(),i=Kc(),a=rl(),o=Gc(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),lte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=cte(),n=dl();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),ute=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),dte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),fte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),pte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fte();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),mte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Gc(),r=Wc();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),hte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),gte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Wc(),r=Gc();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),_te=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),fl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Qc();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),vte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Xc(),n=Wc(),r=Gc(),i=fl();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),pl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fl();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),ml=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fl();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),hl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ute(),n=dte(),r=pte(),i=mte(),a=hte(),o=gte(),s=_te(),c=vte(),l=pl(),u=ml();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),gl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=Wc(),n=Gc(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),_l=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=Wc(),n=Gc(),r=Zc(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),vl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=_l();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),yl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=Zc(),i=gl();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),bl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),xl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=Wc(),n=Gc(),r=Zc();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
357
|
+
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),Qee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=Wc(),n=Gc();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),Zc=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=Wc(),n=Gc(),r=Kc(),i=Gc();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),$ee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=Wc(),n=Kc(),r=Zc(),i=qc();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),ete=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=Wc(),n=Gc();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),Qc=i(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),tte=i(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),$c=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=Gc(),n=Qc(),r=tte(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),el=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=Zee(),n=Xc(),r=Yc(),i=Xc(),a=Qee(),o=$ee(),s=ete(),c=Wc(),l=Kc(),u=$c(),d=Gc(),f=qc();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ne(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),O(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ne(e),ee(e),te(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return re(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);re(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function ee(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function te(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ne({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function O(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&k(e),t.return((0,c._)`${l.default.errors} === 0`))}function k({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function re(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>me(e,`$ref`,h.all.$ref.definition));return}p.jtd||ae(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ie(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ie(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ie(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&me(e,n.keyword,n.definition,t.type)})}function ae(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(oe(e,t),e.opts.allowUnionTypes||se(e,t),ce(e,e.dataTypes))}function oe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{ue(e.dataTypes,t)||fe(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),de(e,t)}}function se(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&fe(e,`use allowUnionTypes to allow union type keyword`)}function ce(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>le(t,e))&&fe(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function le(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function ue(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function de(e,t){let n=[];for(let r of e.dataTypes)ue(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function fe(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var pe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,_e(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=pe;function me(e,t,n,r){let i=new pe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var he=/^\/(?:[^~]|~0|~1)*$/,ge=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _e(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!he.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=ge.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=_e})),tl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),nl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$c();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),rl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=Wc(),n=tl(),r=Kc(),i=$c(),a=Gc(),o=el(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),nte=r({$id:()=>il,additionalProperties:()=>!1,default:()=>ll,description:()=>al,properties:()=>cl,required:()=>sl,type:()=>ol}),il,al,ol,sl,cl,ll,rte=n((()=>{il=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,al=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,ol=`object`,sl=[`$data`],cl={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},ll={$id:il,description:al,type:ol,required:sl,properties:cl,additionalProperties:!1}})),ul=i(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),ite=i(((e,t)=>{var{isUUID:n}=ul(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),ate=i(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=ul(),{SCHEMES:d,getSchemeHandler:f}=ite();function p(e,t){return typeof e==`string`?e=S(e,t):typeof e==`object`&&(e=x(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=h(x(e,r),x(t,r),r,!0);return r.skipEscape=!0,_(i,r)}function h(e,t,n,i){let a={};return i||(e=x(_(e,n),n),t=x(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=w(e,n),i=w(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function b(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(v);if(d){i.scheme=d[1],i.userinfo=d[3],i.host=d[4],i.port=parseInt(d[5],10),i.path=d[6]||``,i.query=d[7],i.fragment=d[8],isNaN(i.port)&&(i.port=d[5]);let t=y(i,d);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let p=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!p||!p.unicodeSupport)&&i.host&&(r.domainHost||p&&p.domainHost)&&s===!1&&u(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!p||p&&!p.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}p&&p.parse&&p.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function x(e,t){return b(e,t).parsed}function S(e,t){return C(e,t).normalized}function C(e,t){let{parsed:n,malformedAuthorityOrPort:r}=b(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function w(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=C(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var T={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:x};t.exports=T,t.exports.default=T,t.exports.fastUri=T})),ote=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ate();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),ste=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=el();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=Wc();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=tl(),a=nl(),o=Jc(),s=rl(),c=Wc(),l=$c(),u=Xc(),d=Gc(),f=(rte(),t(nte).default),p=ote(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=te(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=D.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(O.call(this,n,t),!t)return(0,d.eachItem)(n,e=>k.call(this,e)),this;ie.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>k.call(this,e,r):e=>r.type.forEach(t=>k.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=oe(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,e.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function T(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function D(){let e={...this.opts};for(let t of h)delete e[t];return e}var ee={log(){},warn(){},error(){}};function te(e){if(e===!1)return ee;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ne=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function k(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?re.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function re(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function ie(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=oe(t)),e.validateSchema=this.compile(t,!0))}var ae={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function oe(e){return{anyOf:[e,ae]}}})),cte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),dl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=nl(),n=Zc(),r=Wc(),i=Kc(),a=rl(),o=Gc(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),lte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=cte(),n=dl();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),ute=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),dte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),fte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),pte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fte();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),mte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Gc(),r=Wc();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),hte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),gte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Wc(),r=Gc();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),_te=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),fl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Qc();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),vte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Xc(),n=Wc(),r=Gc(),i=fl();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),pl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fl();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),ml=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=fl();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),hl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ute(),n=dte(),r=pte(),i=mte(),a=hte(),o=gte(),s=_te(),c=vte(),l=pl(),u=ml();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),gl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=Wc(),n=Gc(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),_l=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=Wc(),n=Gc(),r=Zc(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),vl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=_l();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),yl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=Zc(),i=gl();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),bl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),xl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=Wc(),n=Gc(),r=Zc();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
358
358
|
missingProperty: ${i},
|
|
359
359
|
depsCount: ${n},
|
|
360
360
|
deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),Sl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),Cl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Wc(),r=Kc(),i=Gc();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),wl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=el(),n=Zc(),r=Gc(),i=Cl();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),Tl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Zc(),n=Wc(),r=Gc(),i=Gc();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),El=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Gc();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),Dl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:Zc().validateUnion,error:{message:`must match a schema in anyOf`}}})),Ol=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),kl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Gc();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),yte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),bte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Gc();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),xte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gl(),n=vl(),r=_l(),i=yl(),a=bl(),o=xl(),s=Sl(),c=Cl(),l=wl(),u=Tl(),d=El(),f=Dl(),p=Ol(),m=kl(),h=yte(),g=bte();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),Al=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;var t=Wc(),n=Kc(),r=rl(),i=dl(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),jl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;var t=Wc(),n=Kc(),r=dl(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),Ste=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Al(),n=Gc();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),Cte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=jl();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),wte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Al(),n=jl(),r=Ste(),i=Cte();e.default=[t.default,n.default,r.default,i.default]})),Tte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xl();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),Ete=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xl();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),Dte=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Gc();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),Ml=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Tte(),n=Ete(),r=Dte();e.default=[t.default,n.default,r.default]})),Nl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc(),r=Kc();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),Pl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Gc();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),Fl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Nl(),n=Pl();e.default=[t.default,n.default]})),Il=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),Ll=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[Il().default]})),Rl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),zl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=lte(),n=hl(),r=xte(),i=wte(),a=Ml(),o=Fl(),s=Ll(),c=Rl();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),Bl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),Vl=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Wc(),n=Bl(),r=rl(),i=nl(),a=Gc();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),Hl=r({$comment:()=>Xl,$dynamicAnchor:()=>Kl,$id:()=>Wl,$schema:()=>Ul,$vocabulary:()=>Gl,allOf:()=>Jl,default:()=>Ql,properties:()=>Zl,title:()=>ql,type:()=>Yl}),Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l=n((()=>{Ul=`https://json-schema.org/draft/2020-12/schema`,Wl=`https://json-schema.org/draft/2020-12/schema`,Gl={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Kl=`meta`,ql=`Core and Validation specifications meta-schema`,Jl=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],Yl=[`object`,`boolean`],Xl=`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,Zl={definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}},Ql={$schema:Ul,$id:Wl,$vocabulary:Gl,$dynamicAnchor:Kl,title:ql,allOf:Jl,type:Yl,$comment:Xl,properties:Zl}})),eu=r({$defs:()=>cu,$dynamicAnchor:()=>iu,$id:()=>nu,$schema:()=>tu,$vocabulary:()=>ru,default:()=>lu,properties:()=>su,title:()=>au,type:()=>ou}),tu,nu,ru,iu,au,ou,su,cu,lu,Ote=n((()=>{tu=`https://json-schema.org/draft/2020-12/schema`,nu=`https://json-schema.org/draft/2020-12/meta/applicator`,ru={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},iu=`meta`,au=`Applicator vocabulary meta-schema`,ou=[`object`,`boolean`],su={prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},cu={schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}},lu={$schema:tu,$id:nu,$vocabulary:ru,$dynamicAnchor:iu,title:au,type:ou,properties:su,$defs:cu}})),kte=r({$dynamicAnchor:()=>pu,$id:()=>du,$schema:()=>uu,$vocabulary:()=>fu,default:()=>_u,properties:()=>gu,title:()=>mu,type:()=>hu}),uu,du,fu,pu,mu,hu,gu,_u,vu=n((()=>{uu=`https://json-schema.org/draft/2020-12/schema`,du=`https://json-schema.org/draft/2020-12/meta/unevaluated`,fu={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},pu=`meta`,mu=`Unevaluated applicator vocabulary meta-schema`,hu=[`object`,`boolean`],gu={unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}},_u={$schema:uu,$id:du,$vocabulary:fu,$dynamicAnchor:pu,title:mu,type:hu,properties:gu}})),yu=r({$dynamicAnchor:()=>Cu,$id:()=>xu,$schema:()=>bu,$vocabulary:()=>Su,default:()=>Du,properties:()=>Eu,title:()=>wu,type:()=>Tu}),bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou=n((()=>{bu=`https://json-schema.org/draft/2020-12/schema`,xu=`https://json-schema.org/draft/2020-12/meta/content`,Su={"https://json-schema.org/draft/2020-12/vocab/content":!0},Cu=`meta`,wu=`Content vocabulary meta-schema`,Tu=[`object`,`boolean`],Eu={contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}},Du={$schema:bu,$id:xu,$vocabulary:Su,$dynamicAnchor:Cu,title:wu,type:Tu,properties:Eu}})),ku=r({$defs:()=>Lu,$dynamicAnchor:()=>Nu,$id:()=>ju,$schema:()=>Au,$vocabulary:()=>Mu,default:()=>Ru,properties:()=>Iu,title:()=>Pu,type:()=>Fu}),Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu=n((()=>{Au=`https://json-schema.org/draft/2020-12/schema`,ju=`https://json-schema.org/draft/2020-12/meta/core`,Mu={"https://json-schema.org/draft/2020-12/vocab/core":!0},Nu=`meta`,Pu=`Core vocabulary meta-schema`,Fu=[`object`,`boolean`],Iu={$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},Lu={anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}},Ru={$schema:Au,$id:ju,$vocabulary:Mu,$dynamicAnchor:Nu,title:Pu,type:Fu,properties:Iu,$defs:Lu}})),Bu=r({$dynamicAnchor:()=>Wu,$id:()=>Hu,$schema:()=>Vu,$vocabulary:()=>Uu,default:()=>Ju,properties:()=>qu,title:()=>Gu,type:()=>Ku}),Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu=n((()=>{Vu=`https://json-schema.org/draft/2020-12/schema`,Hu=`https://json-schema.org/draft/2020-12/meta/format-annotation`,Uu={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Wu=`meta`,Gu=`Format vocabulary meta-schema for annotation results`,Ku=[`object`,`boolean`],qu={format:{type:`string`}},Ju={$schema:Vu,$id:Hu,$vocabulary:Uu,$dynamicAnchor:Wu,title:Gu,type:Ku,properties:qu}})),Xu=r({$dynamicAnchor:()=>ed,$id:()=>Qu,$schema:()=>Zu,$vocabulary:()=>$u,default:()=>id,properties:()=>rd,title:()=>td,type:()=>nd}),Zu,Qu,$u,ed,td,nd,rd,id,ad=n((()=>{Zu=`https://json-schema.org/draft/2020-12/schema`,Qu=`https://json-schema.org/draft/2020-12/meta/meta-data`,$u={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},ed=`meta`,td=`Meta-data vocabulary meta-schema`,nd=[`object`,`boolean`],rd={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},id={$schema:Zu,$id:Qu,$vocabulary:$u,$dynamicAnchor:ed,title:td,type:nd,properties:rd}})),od=r({$defs:()=>md,$dynamicAnchor:()=>ud,$id:()=>cd,$schema:()=>sd,$vocabulary:()=>ld,default:()=>hd,properties:()=>pd,title:()=>dd,type:()=>fd}),sd,cd,ld,ud,dd,fd,pd,md,hd,gd=n((()=>{sd=`https://json-schema.org/draft/2020-12/schema`,cd=`https://json-schema.org/draft/2020-12/meta/validation`,ld={"https://json-schema.org/draft/2020-12/vocab/validation":!0},ud=`meta`,dd=`Validation vocabulary meta-schema`,fd=[`object`,`boolean`],pd={type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},md={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},hd={$schema:sd,$id:cd,$vocabulary:ld,$dynamicAnchor:ud,title:dd,type:fd,properties:pd,$defs:md}})),_d=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=($l(),t(Hl).default),r=(Ote(),t(eu).default),i=(vu(),t(kte).default),a=(Ou(),t(yu).default),o=(zu(),t(ku).default),s=(Yu(),t(Bu).default),c=(ad(),t(Xu).default),l=(gd(),t(od).default),u=[`/properties`];function d(e){return[n,r,i,a,o,t(this,s),c,t(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,u):n}}e.default=d})),vd=i(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;var n=ste(),r=zl(),i=Vl(),a=_d(),o=`https://json-schema.org/draft/2020-12/schema`,s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=el();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=Wc();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=tl();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=nl();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})}));function yd(e,t,n){return bd(e,t,n)}function bd(e,t,n){let r=ja(e);if(!r.isValid)return{field:t,error:r.error,position:r.position};let i=wd(t),a=Td(t),o=xd(n,i);if(!o)return{field:t,error:`Cannot resolve schema context for path '${i}'`};let s=Aa(e),c=Ed(o),l=Ed(n);for(let e of s.dependencies)if(e.startsWith(`/`)){let n=Ad(e.slice(1));if(!l.has(n))return{field:t,error:`Unknown root field '${n}' in formula`}}else if(e.startsWith(`../`)){let r=Md(e,i,n,t);if(r)return r}else{let n=Ad(e);if(!c.has(n))return{field:t,error:`Unknown field '${n}' in formula`}}if(s.dependencies.some(e=>Ad(e)===a))return{field:t,error:`Formula cannot reference itself`};if(t.includes(`[`)){let n=Pd(e,t,Nd(o));if(n)return n}let u=o.properties?.[a],d=Od(u?.type),f=Vee(e,Dd(o));return kd(f,d)?null:{field:t,error:`Type mismatch: formula returns '${f}' but field expects '${d}'`}}function xd(e,t){if(!t)return e;let n=Sd(t),r=e;for(let e of n)if(e===`[]`)if(r.type===`array`&&r.items)r=r.items;else return null;else if(r.properties?.[e])r=r.properties[e];else return null;return r}function Sd(e){let t=[],n=``,r=!1;for(let i of e)i===`[`?(n&&=(t.push(n),``),r=!0):i===`]`?(r=!1,t.push(`[]`)):i===`.`&&!r?n&&=(t.push(n),``):r||(n+=i);return n&&t.push(n),t}function Cd(e){let t=[],n=``,r=!1;for(let i of e)i===`[`?(n&&=(t.push(n),``),r=!0):i===`]`?r=!1:i===`.`&&!r?n&&=(t.push(n),``):r||(n+=i);return n&&t.push(n),t}function wd(e){let t=e.lastIndexOf(`.`),n=e.lastIndexOf(`[`),r=Math.max(t,n);return r<=0?``:e.substring(0,r)}function Td(e){let t=e.lastIndexOf(`.`),n=e.lastIndexOf(`]`),r=Math.max(t,n);return r===-1?e:e.substring(r+1)}function Ed(e){let t=new Set,n=e.properties??{};for(let e of Object.keys(n))t.add(e);return t}function Dd(e){let t={},n=e.properties??{};for(let[e,r]of Object.entries(n)){let n=r.type;n===`integer`?t[e]=`number`:(n===`number`||n===`string`||n===`boolean`||n===`object`||n===`array`)&&(t[e]=n)}return t}function Od(e){return e===`number`||e===`integer`?`number`:e===`string`?`string`:e===`boolean`?`boolean`:null}function kd(e,t){return t===null||e===`unknown`?!0:e===t}function Ad(e){return e.split(`.`)[0]?.split(`[`)[0]||e}function jd(e){let t=0,n=e;for(;n.startsWith(`../`);)t++,n=n.slice(3);return t}function Md(e,t,n,r){let i=jd(e),a=Ad(e.replace(/^(\.\.\/)+/,``)),o=Cd(t),s=o.length-i;if(s<=0)return Ed(n).has(a)?null:{field:r,error:`Unknown root field '${a}' in formula`};let c=xd(n,o.slice(0,s).join(`.`));return c?Ed(c).has(a)?null:{field:r,error:`Unknown field '${a}' in formula`}:{field:r,error:`Cannot resolve schema for relative path '${e}'`}}function Nd(e){let t=new Set,n=e.properties??{};for(let[e,r]of Object.entries(n))r[`x-formula`]&&t.add(e);return t}function Pd(e,t,n){let r=e.matchAll(/@next\.(\w+)/g);for(let e of r){let r=e[1];if(r&&n.has(r))return{field:t,error:`Cannot reference computed field '${r}' via @next. Use @prev instead for cross-element computed field references.`}}let i=e.matchAll(/\/[\w[\]]+\[\d+\]\.(\w+)/g);for(let e of i){let r=e[1];if(r&&n.has(r))return{field:t,error:`Absolute index reference to computed field '${r}' may cause forward reference issues. Consider using @prev pattern instead.`}}return null}var F=(e=>(e.RowId=`urn:jsonschema:io:revisium:row-id-schema:1.0.0`,e.RowCreatedId=`urn:jsonschema:io:revisium:row-created-id-schema:1.0.0`,e.RowVersionId=`urn:jsonschema:io:revisium:row-version-id-schema:1.0.0`,e.RowCreatedAt=`urn:jsonschema:io:revisium:row-created-at-schema:1.0.0`,e.RowPublishedAt=`urn:jsonschema:io:revisium:row-published-at-schema:1.0.0`,e.RowUpdatedAt=`urn:jsonschema:io:revisium:row-updated-at-schema:1.0.0`,e.RowHash=`urn:jsonschema:io:revisium:row-hash-schema:1.0.0`,e.RowSchemaHash=`urn:jsonschema:io:revisium:row-schema-hash-schema:1.0.0`,e.File=`urn:jsonschema:io:revisium:file-schema:1.0.0`,e))(F||{}),I=Fe(),L=e(gn(),1),Fd=e(te(),1),R=e=>{let{children:t,disabled:n}=e,[r,i]=(0,L.useState)(e.container?.current),a=(0,L.useSyncExternalStore)(Ld,()=>!1,()=>!0),{getRootNode:o}=At();if((0,L.useEffect)(()=>{i(()=>e.container?.current)},[e.container]),a||n)return(0,I.jsx)(I.Fragment,{children:t});let s=r??Id(o);return(0,I.jsx)(I.Fragment,{children:L.Children.map(t,e=>(0,Fd.createPortal)(e,s))})},Id=e=>{let t=e?.(),n=t.getRootNode();return x(n)?n:Nt(t).body},Ld=()=>()=>{},Rd=e=>E(e),zd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Bd=L.createContext&&L.createContext(zd),Vd=[`attr`,`size`,`title`];function Hd(e,t){if(e==null)return{};var n=Ud(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ud(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wd(){return Wd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wd.apply(this,arguments)}function Gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gd(Object(n),!0).forEach(function(t){qd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qd(e,t,n){return t=Jd(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jd(e){var t=Yd(e,`string`);return typeof t==`symbol`?t:t+``}function Yd(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xd(e){return e&&e.map((e,t)=>L.createElement(e.tag,Kd({key:t},e.attr),Xd(e.child)))}function z(e){return t=>L.createElement(Zd,Wd({attr:Kd({},e.attr)},t),Xd(e.child))}function Zd(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=Hd(e,Vd),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),L.createElement(`svg`,Wd({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:Kd(Kd({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&L.createElement(`title`,null,i),e.children)};return Bd===void 0?t(zd):L.createElement(Bd.Consumer,null,e=>t(e))}function Qd(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`},child:[]}]})(e)}function $d(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`},child:[]}]})(e)}function ef(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`},child:[]}]})(e)}function tf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z`},child:[]}]})(e)}function nf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z`},child:[]}]})(e)}function rf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`},child:[]}]})(e)}function af(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`},child:[]}]})(e)}function of(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`},child:[]}]})(e)}function sf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z`},child:[]}]})(e)}function cf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`},child:[]}]})(e)}function lf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm0,184A80,80,0,1,1,181.34,68.37a8,8,0,0,1-10.67,11.92A64,64,0,1,0,191.5,136H128a8,8,0,0,1,0-16h72a8,8,0,0,1,8,8A80.09,80.09,0,0,1,128,208Z`},child:[]}]})(e)}function Ate(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`},child:[]}]})(e)}function jte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z`},child:[]}]})(e)}function uf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`},child:[]}]})(e)}function Mte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z`},child:[]}]})(e)}function df(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34Zm2,174a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Zm-37.76-84.24a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48-8.48L153.51,134H88a6,6,0,0,1,0-12h65.51l-21.75-21.76a6,6,0,0,1,8.48-8.48Z`},child:[]}]})(e)}function Nte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z`},child:[]}]})(e)}function ff(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M212.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48-8.48L193.51,182H48a6,6,0,0,1,0-12H193.51l-21.75-21.76a6,6,0,0,1,8.48-8.48ZM75.76,116.24a6,6,0,0,0,8.48-8.48L62.49,86H208a6,6,0,0,0,0-12H62.49L84.24,52.24a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48Z`},child:[]}]})(e)}function Pte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M240,210H222V96a14,14,0,0,0-14-14H142V32a14,14,0,0,0-21.77-11.64l-80,53.33A14,14,0,0,0,34,85.34V210H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM208,94a2,2,0,0,1,2,2V210H142V94ZM46,85.34a2,2,0,0,1,.89-1.66l80-53.34A2,2,0,0,1,130,32V210H46ZM110,112v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm-32,0v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm0,56v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Zm32,0v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Z`},child:[]}]})(e)}function pf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM148.24,92.24,112.49,128l35.75,35.76a6,6,0,1,1-8.48,8.48l-40-40a6,6,0,0,1,0-8.48l40-40a6,6,0,0,1,8.48,8.48Z`},child:[]}]})(e)}function Fte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M204.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L128.49,128ZM48.49,128l75.75-75.76a6,6,0,0,0-8.48-8.48l-80,80a6,6,0,0,0,0,8.48l80,80a6,6,0,1,0,8.48-8.48Z`},child:[]}]})(e)}function Ite(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M140.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L127.51,128,51.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,140.24,132.24Zm80-8.48-80-80a6,6,0,0,0-8.48,8.48L207.51,128l-75.75,75.76a6,6,0,1,0,8.48,8.48l80-80A6,6,0,0,0,220.24,123.76Z`},child:[]}]})(e)}function mf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`},child:[]}]})(e)}function hf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`},child:[]}]})(e)}function Lte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`},child:[]}]})(e)}function gf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`},child:[]}]})(e)}function _f(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M160,42A86.11,86.11,0,0,0,82.43,90.88,62,62,0,1,0,72,214h88a86,86,0,0,0,0-172Zm0,160H72a50,50,0,0,1,0-100,50.67,50.67,0,0,1,5.91.35A85.61,85.61,0,0,0,74,128a6,6,0,0,0,12,0,74,74,0,1,1,74,74Z`},child:[]}]})(e)}function Rte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M67.84,92.61,25.37,128l42.47,35.39a6,6,0,1,1-7.68,9.22l-48-40a6,6,0,0,1,0-9.22l48-40a6,6,0,0,1,7.68,9.22Zm176,30.78-48-40a6,6,0,1,0-7.68,9.22L230.63,128l-42.47,35.39a6,6,0,1,0,7.68,9.22l48-40a6,6,0,0,0,0-9.22Zm-81.79-89A6,6,0,0,0,154.36,38l-64,176A6,6,0,0,0,94,221.64a6.15,6.15,0,0,0,2,.36,6,6,0,0,0,5.64-3.95l64-176A6,6,0,0,0,162.05,34.36Z`},child:[]}]})(e)}function vf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`},child:[]}]})(e)}function zte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM32,62H224a2,2,0,0,1,2,2V90H30V64A2,2,0,0,1,32,62ZM224,194H32a2,2,0,0,1-2-2V102H226v90A2,2,0,0,1,224,194Zm-18-26a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h32A6,6,0,0,1,206,168Zm-64,0a6,6,0,0,1-6,6H120a6,6,0,0,1,0-12h16A6,6,0,0,1,142,168Z`},child:[]}]})(e)}function yf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,26C75.29,26,34,49.72,34,80v96c0,30.28,41.29,54,94,54s94-23.72,94-54V80C222,49.72,180.71,26,128,26Zm0,12c44.45,0,82,19.23,82,42s-37.55,42-82,42S46,102.77,46,80,83.55,38,128,38Zm82,138c0,22.77-37.55,42-82,42s-82-19.23-82-42V154.79C62,171.16,92.37,182,128,182s66-10.84,82-27.21Zm0-48c0,22.77-37.55,42-82,42s-82-19.23-82-42V106.79C62,123.16,92.37,134,128,134s66-10.84,82-27.21Z`},child:[]}]})(e)}function Bte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M98.3,130.46a6,6,0,0,0-6.54,1.3L69.51,154H48a6,6,0,0,0-6,6v40a6,6,0,0,0,6,6H69.51l22.25,22.24A6,6,0,0,0,102,224V136A6,6,0,0,0,98.3,130.46Zm-8.3,79L76.24,195.76A6,6,0,0,0,72,194H54V166H72a6,6,0,0,0,4.24-1.76L90,150.49ZM150,180a38.53,38.53,0,0,1-19,33.18A6,6,0,0,1,125,202.82a26.5,26.5,0,0,0,0-45.64A6,6,0,0,1,131,146.82,38.53,38.53,0,0,1,150,180Zm62.24-96.24-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v80a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H168a6,6,0,0,0,0,12h32a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158Z`},child:[]}]})(e)}function Vte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z`},child:[]}]})(e)}function Hte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z`},child:[]}]})(e)}function Ute(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z`},child:[]}]})(e)}function Wte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z`},child:[]}]})(e)}function Gte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158Zm-3.09,100.27a6,6,0,0,0-6.09.16L126,161.17V160a14,14,0,0,0-14-14H48a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h64a14,14,0,0,0,14-14v-1.17l22.82,14.26A6,6,0,0,0,158,216V152A6,6,0,0,0,154.91,146.75ZM114,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V160a2,2,0,0,1,2-2h64a2,2,0,0,1,2,2Zm32-2.83-20-12.5V175.33l20-12.5Z`},child:[]}]})(e)}function Kte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M220,200.8,158,97.48V38h10a6,6,0,0,0,0-12H88a6,6,0,0,0,0,12H98V97.48L36,200.8A14,14,0,0,0,48,222H208a14,14,0,0,0,12-21.2ZM109.15,102.23a6,6,0,0,0,.85-3.09V38h36V99.14a6,6,0,0,0,.85,3.09l39.65,66.08c-12.41,3.16-30.86,3-55.79-9.66-16.94-8.58-33-12.8-47.83-12.64ZM209.72,209a2,2,0,0,1-1.74,1H48a2,2,0,0,1-1.71-3l29-48.41c14.89-2.08,31.68,1.55,49.94,10.79C144,178.8,159.67,182,172.42,182A67.89,67.89,0,0,0,192.89,179l16.8,28A2,2,0,0,1,209.72,209Z`},child:[]}]})(e)}function bf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z`},child:[]}]})(e)}function xf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M206,40a6,6,0,0,1-6,6H170.71a26,26,0,0,0-25.58,21.35L135.19,122H184a6,6,0,0,1,0,12H133l-10.33,56.8A38,38,0,0,1,85.29,222H56a6,6,0,0,1,0-12H85.29a26,26,0,0,0,25.58-21.35L120.81,134H72a6,6,0,0,1,0-12h51l10.33-56.8A38,38,0,0,1,170.71,34H200A6,6,0,0,1,206,40Z`},child:[]}]})(e)}function Sf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z`},child:[]}]})(e)}function Cf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M230,64a30,30,0,1,0-36,29.4V112a10,10,0,0,1-10,10H96a21.84,21.84,0,0,0-10,2.42v-31a30,30,0,1,0-12,0v69.2a30,30,0,1,0,12,0V144a10,10,0,0,1,10-10h88a22,22,0,0,0,22-22V93.4A30.05,30.05,0,0,0,230,64ZM62,64A18,18,0,1,1,80,82,18,18,0,0,1,62,64ZM98,192a18,18,0,1,1-18-18A18,18,0,0,1,98,192ZM200,82a18,18,0,1,1,18-18A18,18,0,0,1,200,82Z`},child:[]}]})(e)}function qte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`},child:[]}]})(e)}function Jte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z`},child:[]}]})(e)}function wf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M200,154a29.87,29.87,0,0,0-19.5,7.23L154.88,141.3A29.83,29.83,0,0,0,158,128a30.52,30.52,0,0,0-.22-3.6L174,119a30,30,0,1,0-4-15,30.52,30.52,0,0,0,.22,3.6L154,113a29.91,29.91,0,0,0-32.42-14.31l-8.14-18.3a30,30,0,1,0-11,4.88l8.14,18.3A29.92,29.92,0,0,0,102.06,143L74,168a30.08,30.08,0,1,0,8,9L110,152a29.91,29.91,0,0,0,37.47-1.23l25.62,19.93A30,30,0,1,0,200,154Zm0-68a18,18,0,1,1-18,18A18,18,0,0,1,200,86ZM78,56A18,18,0,1,1,96,74,18,18,0,0,1,78,56ZM56,210a18,18,0,1,1,18-18A18,18,0,0,1,56,210Zm72-64a18,18,0,1,1,18-18A18,18,0,0,1,128,146Zm72,56a18,18,0,1,1,18-18A18,18,0,0,1,200,202Z`},child:[]}]})(e)}function Yte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z`},child:[]}]})(e)}function Xte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z`},child:[]}]})(e)}function Tf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z`},child:[]}]})(e)}function Ef(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`},child:[]}]})(e)}function Df(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z`},child:[]}]})(e)}function Zte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128ZM40,70H216a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12ZM216,186H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z`},child:[]}]})(e)}function Of(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,82H174V56a46,46,0,0,0-92,0V82H48A14,14,0,0,0,34,96V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V96A14,14,0,0,0,208,82ZM94,56a34,34,0,0,1,68,0V82H94ZM210,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V96a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Zm-72-56a10,10,0,1,1-10-10A10,10,0,0,1,138,152Z`},child:[]}]})(e)}function kf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,82H174V56a46,46,0,0,0-92,0V82H48A14,14,0,0,0,34,96V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V96A14,14,0,0,0,208,82ZM94,56a34,34,0,0,1,68,0V82H94ZM210,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V96a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`},child:[]}]})(e)}function Af(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`},child:[]}]})(e)}function jf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z`},child:[]}]})(e)}function Mf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`},child:[]}]})(e)}function Nf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z`},child:[]}]})(e)}function Pf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`},child:[]}]})(e)}function Qte(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`},child:[]}]})(e)}function $te(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M200,50H134V16a6,6,0,0,0-12,0V50H56A30,30,0,0,0,26,80V192a30,30,0,0,0,30,30H200a30,30,0,0,0,30-30V80A30,30,0,0,0,200,50Zm18,142a18,18,0,0,1-18,18H56a18,18,0,0,1-18-18V80A18,18,0,0,1,56,62H200a18,18,0,0,1,18,18ZM74,108a10,10,0,1,1,10,10A10,10,0,0,1,74,108Zm88,0a10,10,0,1,1,10,10A10,10,0,0,1,162,108Zm2,30H92a26,26,0,0,0,0,52h72a26,26,0,0,0,0-52Zm-22,12v28H114V150ZM78,164a14,14,0,0,1,14-14h10v28H92A14,14,0,0,1,78,164Zm86,14H154V150h10a14,14,0,0,1,0,28Z`},child:[]}]})(e)}function ene(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M236.24,179.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L217.52,190H200.94a70.16,70.16,0,0,1-57-29.31l-41.71-58.4A58.11,58.11,0,0,0,55.06,78H32a6,6,0,0,1,0-12H55.06a70.16,70.16,0,0,1,57,29.31l41.71,58.4A58.11,58.11,0,0,0,200.94,178h16.58l-13.76-13.76a6,6,0,0,1,8.48-8.48Zm-92.06-74.41a5.91,5.91,0,0,0,3.48,1.12,6,6,0,0,0,4.89-2.51l1.19-1.67A58.11,58.11,0,0,1,200.94,78h16.58L203.76,91.76a6,6,0,1,0,8.48,8.48l24-24a6,6,0,0,0,0-8.48l-24-24a6,6,0,0,0-8.48,8.48L217.52,66H200.94a70.16,70.16,0,0,0-57,29.31L142.78,97A6,6,0,0,0,144.18,105.35Zm-32.36,45.3a6,6,0,0,0-8.37,1.39l-1.19,1.67A58.11,58.11,0,0,1,55.06,178H32a6,6,0,0,0,0,12H55.06a70.16,70.16,0,0,0,57-29.31l1.19-1.67A6,6,0,0,0,111.82,150.65Z`},child:[]}]})(e)}function Ff(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z`},child:[]}]})(e)}function tne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`},child:[]}]})(e)}function nne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M200,34a6,6,0,0,0-6,6v72.84L71.37,36.14a14,14,0,0,0-14.21-.37A13.69,13.69,0,0,0,50,47.88V208.12a13.69,13.69,0,0,0,7.16,12.11,14,14,0,0,0,14.21-.37L194,143.17V216a6,6,0,0,0,12,0V40A6,6,0,0,0,200,34Zm-6.88,95.56L65,209.69a2,2,0,0,1-2,.05,1.79,1.79,0,0,1-1-1.62V47.88a1.79,1.79,0,0,1,1-1.62A2.1,2.1,0,0,1,64,46a2,2,0,0,1,1,.31l128.12,80.13a1.82,1.82,0,0,1,0,3.12Z`},child:[]}]})(e)}function If(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`},child:[]}]})(e)}function Lf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM38,110H82v36H38Zm56,0H218v36H94ZM218,62V98H38V62ZM38,192V158H82v36H40A2,2,0,0,1,38,192Zm178,2H94V158H218v34A2,2,0,0,1,216,194Z`},child:[]}]})(e)}function rne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M85.43,53.45a6,6,0,0,0-10.86,0l-64,136a6,6,0,1,0,10.86,5.11L38.63,158h82.74l17.2,36.55a6,6,0,1,0,10.86-5.11ZM44.28,146,80,70.09,115.72,146ZM200,98c-12.21,0-21.71,3.28-28.23,9.74a6,6,0,0,0,8.46,8.52c4.18-4.15,10.84-6.26,19.77-6.26,14.34,0,26,9.87,26,22v7.24A40.36,40.36,0,0,0,200,130c-20.95,0-38,15.25-38,34s17.05,34,38,34a40.36,40.36,0,0,0,26-9.24V192a6,6,0,0,0,12,0V132C238,113.25,221,98,200,98Zm0,88c-14.34,0-26-9.87-26-22s11.66-22,26-22,26,9.87,26,22S214.34,186,200,186Z`},child:[]}]})(e)}function Rf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`},child:[]}]})(e)}function ine(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M160,110h48a14,14,0,0,0,14-14V48a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14V66H128a22,22,0,0,0-22,22v34H70V112A14,14,0,0,0,56,98H24a14,14,0,0,0-14,14v32a14,14,0,0,0,14,14H56a14,14,0,0,0,14-14V134h36v34a22,22,0,0,0,22,22h18v18a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V160a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14v18H128a10,10,0,0,1-10-10V88a10,10,0,0,1,10-10h18V96A14,14,0,0,0,160,110ZM58,144a2,2,0,0,1-2,2H24a2,2,0,0,1-2-2V112a2,2,0,0,1,2-2H56a2,2,0,0,1,2,2Zm100,16a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2v48a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Zm0-112a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2V96a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Z`},child:[]}]})(e)}function ane(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M238,136v64a14,14,0,0,1-14,14H32a14,14,0,0,1-14-14V136a14,14,0,0,1,14-14H80a6,6,0,0,1,0,12H32a2,2,0,0,0-2,2v64a2,2,0,0,0,2,2H224a2,2,0,0,0,2-2V136a2,2,0,0,0-2-2H176a6,6,0,0,1,0-12h48A14,14,0,0,1,238,136ZM84.24,76.24,122,38.49V128a6,6,0,0,0,12,0V38.49l37.76,37.75a6,6,0,0,0,8.48-8.48l-48-48a6,6,0,0,0-8.48,0l-48,48a6,6,0,0,0,8.48,8.48ZM198,168a10,10,0,1,0-10,10A10,10,0,0,0,198,168Z`},child:[]}]})(e)}function zf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z`},child:[]}]})(e)}function Bf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M112.6,158.43a58,58,0,1,0-57.2,0A93.83,93.83,0,0,0,5.21,196.72a6,6,0,0,0,10.05,6.56,82,82,0,0,1,137.48,0,6,6,0,0,0,10-6.56A93.83,93.83,0,0,0,112.6,158.43ZM38,108a46,46,0,1,1,46,46A46.06,46.06,0,0,1,38,108Zm211,97a6,6,0,0,1-8.3-1.74A81.8,81.8,0,0,0,172,166a6,6,0,0,1,0-12,46,46,0,1,0-17.08-88.73,6,6,0,1,1-4.46-11.14,58,58,0,0,1,50.14,104.3,93.83,93.83,0,0,1,50.19,38.29A6,6,0,0,1,249,205Z`},child:[]}]})(e)}function Vf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`},child:[]}]})(e)}function one(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`},child:[]}]})(e)}function sne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`},child:[]}]})(e)}function Hf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`},child:[]}]})(e)}function Uf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z`},child:[]}]})(e)}function Wf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`},child:[]}]})(e)}function cne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z`},child:[]}]})(e)}function lne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z`},child:[]}]})(e)}function Gf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`},child:[]}]})(e)}function Kf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z`},child:[]}]})(e)}function qf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`},child:[]}]})(e)}function une(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M224,160a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,160ZM40,104H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Z`},child:[]}]})(e)}function dne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z`},child:[]}]})(e)}function Jf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z`},child:[]}]})(e)}function Yf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,40a8,8,0,0,1-8,8H170.71a24,24,0,0,0-23.62,19.71L137.59,120H184a8,8,0,0,1,0,16H134.68l-10,55.16A40,40,0,0,1,85.29,224H56a8,8,0,0,1,0-16H85.29a24,24,0,0,0,23.62-19.71l9.5-52.29H72a8,8,0,0,1,0-16h49.32l10-55.16A40,40,0,0,1,170.71,32H200A8,8,0,0,1,208,40Z`},child:[]}]})(e)}function Xf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`},child:[]}]})(e)}function Zf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`},child:[]}]})(e)}function Qf(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`},child:[]}]})(e)}function $f(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`},child:[]}]})(e)}function ep(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`},child:[]}]})(e)}function tp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,56V88a8,8,0,0,1-16,0V64H136V192h24a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16h24V64H64V88a8,8,0,0,1-16,0V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`},child:[]}]})(e)}function np(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`},child:[]}]})(e)}function rp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`},child:[]}]})(e)}function fne(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`},child:[]}]})(e)}function ip(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`},child:[]}]})(e)}function ap(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM164,96v48a4,4,0,0,1-8,0V105.66L98.83,162.83a4,4,0,0,1-5.66-5.66L150.34,100H112a4,4,0,0,1,0-8h48A4,4,0,0,1,164,96Z`},child:[]}]})(e)}function op(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M35.89,128C52,136.23,52,155.64,52,172c0,24.8,1.35,40,28,40a4,4,0,0,1,0,8c-36,0-36-26.61-36-48,0-24.8-1.35-40-28-40a4,4,0,0,1,0-8c26.65,0,28-15.2,28-40,0-21.39,0-48,36-48a4,4,0,0,1,0,8C53.35,44,52,59.2,52,84,52,100.36,52,119.77,35.89,128ZM240,124c-26.65,0-28-15.2-28-40,0-21.39,0-48-36-48a4,4,0,0,0,0,8c26.65,0,28,15.2,28,40,0,16.36,0,35.77,16.11,44C204,136.23,204,155.64,204,172c0,24.8-1.35,40-28,40a4,4,0,0,0,0,8c36,0,36-26.61,36-48,0-24.8,1.35-40,28-40a4,4,0,0,0,0-8Z`},child:[]}]})(e)}function sp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z`},child:[]}]})(e)}function cp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z`},child:[]}]})(e)}function lp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z`},child:[]}]})(e)}function up(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z`},child:[]}]})(e)}function dp(e){return z({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`},child:[]}]})(e)}var fp=1024,pp=0,mp=class{constructor(e,t){this.from=e,this.to=t}},hp=class{constructor(e={}){this.id=pp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=vp.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};hp.closedBy=new hp({deserialize:e=>e.split(` `)}),hp.openedBy=new hp({deserialize:e=>e.split(` `)}),hp.group=new hp({deserialize:e=>e.split(` `)}),hp.isolate=new hp({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),hp.contextHash=new hp({perNode:!0}),hp.lookAhead=new hp({perNode:!0}),hp.mounted=new hp({perNode:!0});var gp=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[hp.mounted.id]}},_p=Object.create(null),vp=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):_p,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(hp.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(hp.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};vp.none=new vp(``,Object.create(null),0,8);var yp=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new vp(e.name,r,e.id,e.flags):e)}return new e(n)}},bp=new WeakMap,xp=new WeakMap,Sp;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(Sp||={});var Cp=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=gp.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new Lp(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new Lp(bp.get(this)||this.topNode);return r.moveTo(e,t),bp.set(this,r._tree),r}get topNode(){return new kp(this,0,0,null)}resolve(e,t=0){let n=Dp(bp.get(this)||this.topNode,e,t,!1);return bp.set(this,n),n}resolveInner(e,t=0){let n=Dp(xp.get(this)||this.topNode,e,t,!0);return xp.set(this,n),n}resolveStack(e,t=0){return Ip(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Sp.IncludeAnonymous)>0;for(let e=this.cursor(a|Sp.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:Hp(vp.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(vp.none,t,n,r)))}static build(e){return zp(e)}};Cp.empty=new Cp(vp.none,[],[],0);var wp=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},Tp=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return vp.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(Ep(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function Ep(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Dp(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof kp&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Sp.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof kp&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var Op=class{cursor(e=0){return new Lp(this,e)}getChild(e,t=null,n=null){let r=Ap(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Ap(this,e,t,n)}resolve(e,t=0){return Dp(this,e,t,!1)}resolveInner(e,t=0){return Dp(this,e,t,!0)}matchContext(e){return jp(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},kp=class e extends Op{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if(!(!(a&Sp.EnterBracketed&&l instanceof Cp&&gp.get(l)?.overlay===null&&(u>=r||u+l.length<=r))&&!Ep(i,r,u,u+l.length))){if(l instanceof Tp){if(a&Sp.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new Np(new Mp(o,l,t,u),null,e)}else if(a&Sp.IncludeAnonymous||!l.type.isAnonymous||Rp(l)){let s;if(!(a&Sp.IgnoreMounts)&&(s=gp.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Sp.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&Sp.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&Sp.IgnoreOverlays)&&(i=gp.get(this._tree))&&i.overlay){let a=t-this.from,o=r&Sp.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Ap(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function jp(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Mp=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},Np=class e extends Op{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&Sp.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Cp(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Pp(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof kp&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Fp(i,n)}var Fp=class{constructor(e,t){this.heads=e,this.node=t}get next(){return Pp(this.heads)}};function Ip(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof kp?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=gp.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new kp(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(Dp(o,t,n,!1))}}return i?Pp(i):r}var Lp=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Sp.EnterBracketed,e instanceof kp)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof kp?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Sp.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Sp.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Sp.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Sp.IncludeAnonymous||e instanceof Tp||!e.type.isAnonymous||Rp(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new Np(this.buffer,t,this.stack[e]);return this.bufferNode=new Np(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return jp(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return jp(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function Rp(e){return e.children.some(e=>e instanceof Tp||!e.type.isAnonymous||Rp(e))}function zp(e){let{buffer:t,nodeSet:n,maxBufferLength:r=fp,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new wp(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let D=s[x],ee,te,ne=S-e;if(C-S<=r&&(te=h(o.pos-t,y))){let t=new Uint16Array(te.size-te.skip),r=o.pos-te.size,i=t.length;for(;o.pos>r;)i=g(te.start,t,i);ee=new Tp(t,C-te.start,n),ne=te.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);ee=Hp(D,t,n,0,t.length,0,C-S,e,e)}else ee=m(D,t,n,C-S,T-C,E)}_.push(ee),v.push(ne)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Tp(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Cp){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(hp.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[hp.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[hp.lookAhead,i];o=o?[e].concat(o):[e]}return new Cp(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Cp(s[e.topID],_.reverse(),v.reverse(),y)}var Bp=new WeakMap;function Vp(e,t){if(!e.isAnonymous||t instanceof Tp||t.type!=e)return 1;let n=Bp.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Cp)){n=1;break}n+=Vp(e,r)}Bp.set(t,n)}return n}function Hp(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=Vp(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=Vp(e,t[s]);for(s++;s<i;s++){let n=Vp(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(Hp(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var Up=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},Wp=class{startParse(e,t,n){return typeof e==`string`&&(e=new Gp(e)),n=n?n.length?n.map(e=>new mp(e.from,e.to)):[new mp(0,0)]:[new mp(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},Gp=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new hp({perNode:!0});var Kp=0,qp=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Kp++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new Yp(e);return e=>e.modified.indexOf(t)>-1?e:Yp.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},Jp=0,Yp=class e{constructor(e){this.name=e,this.instances=[],this.id=Jp++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Xp(n,e.modified));if(r)return r;let i=[],a=new qp(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Zp(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Xp(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Zp(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Qp(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new em(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return $p.add(t)}var $p=new hp({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new em(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),em=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};em.empty=new em([],2,null);function tm(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function nm(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function rm(e,t,n,r=0,i=e.length){let a=new im(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var im=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=am(e)||em.empty,u=nm(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(hp.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function am(e){let t=e.type.prop($p);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var B=qp.define,om=B(),sm=B(),cm=B(sm),lm=B(sm),um=B(),dm=B(um),fm=B(um),pm=B(),mm=B(pm),hm=B(),gm=B(),_m=B(),vm=B(_m),ym=B(),V={comment:om,lineComment:B(om),blockComment:B(om),docComment:B(om),name:sm,variableName:B(sm),typeName:cm,tagName:B(cm),propertyName:lm,attributeName:B(lm),className:B(sm),labelName:B(sm),namespace:B(sm),macroName:B(sm),literal:um,string:dm,docString:B(dm),character:B(dm),attributeValue:B(dm),number:fm,integer:B(fm),float:B(fm),bool:B(um),regexp:B(um),escape:B(um),color:B(um),url:B(um),keyword:hm,self:B(hm),null:B(hm),atom:B(hm),unit:B(hm),modifier:B(hm),operatorKeyword:B(hm),controlKeyword:B(hm),definitionKeyword:B(hm),moduleKeyword:B(hm),operator:gm,derefOperator:B(gm),arithmeticOperator:B(gm),logicOperator:B(gm),bitwiseOperator:B(gm),compareOperator:B(gm),updateOperator:B(gm),definitionOperator:B(gm),typeOperator:B(gm),controlOperator:B(gm),punctuation:_m,separator:B(_m),bracket:vm,angleBracket:B(vm),squareBracket:B(vm),paren:B(vm),brace:B(vm),content:pm,heading:mm,heading1:B(mm),heading2:B(mm),heading3:B(mm),heading4:B(mm),heading5:B(mm),heading6:B(mm),contentSeparator:B(pm),list:B(pm),quote:B(pm),emphasis:B(pm),strong:B(pm),link:B(pm),monospace:B(pm),strikethrough:B(pm),inserted:B(),deleted:B(),changed:B(),invalid:B(),meta:ym,documentMeta:B(ym),annotation:B(ym),processingInstruction:B(ym),definition:qp.defineModifier(`definition`),constant:qp.defineModifier(`constant`),function:qp.defineModifier(`function`),standard:qp.defineModifier(`standard`),local:qp.defineModifier(`local`),special:qp.defineModifier(`special`)};for(let e in V){let t=V[e];t instanceof qp&&(t.name=e)}tm([{tag:V.link,class:`tok-link`},{tag:V.heading,class:`tok-heading`},{tag:V.emphasis,class:`tok-emphasis`},{tag:V.strong,class:`tok-strong`},{tag:V.keyword,class:`tok-keyword`},{tag:V.atom,class:`tok-atom`},{tag:V.bool,class:`tok-bool`},{tag:V.url,class:`tok-url`},{tag:V.labelName,class:`tok-labelName`},{tag:V.inserted,class:`tok-inserted`},{tag:V.deleted,class:`tok-deleted`},{tag:V.literal,class:`tok-literal`},{tag:V.string,class:`tok-string`},{tag:V.number,class:`tok-number`},{tag:[V.regexp,V.escape,V.special(V.string)],class:`tok-string2`},{tag:V.variableName,class:`tok-variableName`},{tag:V.local(V.variableName),class:`tok-variableName tok-local`},{tag:V.definition(V.variableName),class:`tok-variableName tok-definition`},{tag:V.special(V.variableName),class:`tok-variableName2`},{tag:V.definition(V.propertyName),class:`tok-propertyName tok-definition`},{tag:V.typeName,class:`tok-typeName`},{tag:V.namespace,class:`tok-namespace`},{tag:V.className,class:`tok-className`},{tag:V.macroName,class:`tok-macroName`},{tag:V.propertyName,class:`tok-propertyName`},{tag:V.operator,class:`tok-operator`},{tag:V.comment,class:`tok-comment`},{tag:V.meta,class:`tok-meta`},{tag:V.invalid,class:`tok-invalid`},{tag:V.punctuation,class:`tok-punctuation`}]);var bm=[],xm=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?xm:bm).push(n+=e[t])})();function Sm(e){if(e<768)return!1;for(let t=0,n=bm.length;;){let r=t+n>>1;if(e<bm[r])n=r;else if(e>=xm[r])t=r+1;else return!0;if(t==n)return!1}}function Cm(e){return e>=127462&&e<=127487}var wm=8205;function Tm(e,t,n=!0,r=!0){return(n?Em:Dm)(e,t,r)}function Em(e,t,n){if(t==e.length)return t;t&&km(e.charCodeAt(t))&&Am(e.charCodeAt(t-1))&&t--;let r=Om(e,t);for(t+=jm(r);t<e.length;){let i=Om(e,t);if(r==wm||i==wm||n&&Sm(i))t+=jm(i),r=i;else if(Cm(i)){let n=0,r=t-2;for(;r>=0&&Cm(Om(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function Dm(e,t,n){for(;t>0;){let r=Em(e,t-2,n);if(r<t)return r;t--}return 0}function Om(e,t){let n=e.charCodeAt(t);if(!Am(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return km(r)?(n-55296<<10)+(r-56320)+65536:n}function km(e){return e>=56320&&e<57344}function Am(e){return e>=55296&&e<56320}function jm(e){return e<65536?1:2}var Mm=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Hm(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Pm.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Hm(this,e,t);let n=[];return this.decompose(e,t,n,0),Pm.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Rm(this),i=new Rm(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Rm(this,e)}iterRange(e,t=this.length){return new zm(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Bm(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new Nm(t):Pm.from(Nm.split(t,[]))}},Nm=class e extends Mm{constructor(e,t=Fm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Vm(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Lm(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=Im(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Hm(this,t,n);let i=Im(this.text,Im(r.text,Lm(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):Pm.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
@@ -379,7 +379,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
379
379
|
`?(KR(e),e.i++):n===`\r`&&e.i+1<t.length&&t[e.i+1]===`
|
|
380
380
|
`?(KR(e),e.i+=2):(e.currentField+=n,e.i++)}function JR(e){if(e.length===0)return[];let t={rows:[],currentRow:[],currentField:``,inQuotes:!1,i:0};for(;t.i<e.length;)t.inQuotes?GR(t,e):qR(t,e);return t.currentRow.push(t.currentField),WR(t.currentRow)&&t.rows.push(t.currentRow),t.rows}function YR(e){return e.includes(` `)||e.includes(`
|
|
381
381
|
`)||e.includes(`"`)?`"${e.replaceAll(`"`,`""`)}"`:e}function XR(e,t,n){let r=[];for(let i=e.startRow;i<=e.endRow;i++){let a=[];for(let r=e.startCol;r<=e.endCol;r++){let e=t[i],o=n[r];e&&o&&a.push(YR(e.getCellVM(o).displayValue))}r.push(a.join(` `))}try{return navigator.clipboard.writeText(r.join(`
|
|
382
|
-
`))}catch{return Promise.resolve()}}async function ZR(e,t,n,r){let i;try{i=await navigator.clipboard.readText()}catch{return}let a=JR(i);for(let[i,o]of a.entries()){let a=n[e+i];if(!a)break;for(let[e,n]of o.entries()){let i=r[t+e];if(!i)break;let o=a.getCellVM(i);o.isEditable&&o.applyPastedText(n)}}}function QR(e,t,n){let r=e.focusedCell;if(!r)return null;let i=t.findIndex(e=>e.field===r.field),a=n.findIndex(e=>e.rowId===r.rowId);return i===-1||a===-1?null:{colIndex:i,rowIndex:a}}function $R(e,t,n){for(let r=e.startRow;r<=e.endRow;r++)for(let i=e.startCol;i<=e.endCol;i++){let e=t[r],a=n[i];e&&a&&e.getCellVM(a).clearToDefault()}}var ez=`#ededed`,tz=`inset 0 -1px 0 0 ${ez}`;function nz(){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,left:`-8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:`var(--shadow-right-opacity, 0)`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}function rz(e,t){return t<=0?e:e===`0px`?`${t}px`:`calc(${e} + ${t}px)`}var iz=40,az=g(({field:e,columnsModel:t})=>{let[n,r]=(0,L.useState)(!1),i=(0,L.useRef)(0),a=(0,L.useRef)(0),o=(0,L.useRef)(0),s=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>{s.current&&s.current()},[]),(0,I.jsx)(A,{role:`separator`,position:`absolute`,right:`-4px`,top:0,bottom:0,width:`8px`,cursor:`col-resize`,zIndex:10,onMouseDown:(0,L.useCallback)(n=>{n.preventDefault(),n.stopPropagation();let c=t.resolveColumnWidth(e);i.current=n.clientX,a.current=c,r(!0),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let l=n=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{let r=n.clientX-i.current,o=Math.max(iz,a.current+r);t.setColumnWidth(e,o)})},u=()=>{cancelAnimationFrame(o.current),t.commitColumnWidth(),r(!1),document.body.style.cursor=``,document.body.style.userSelect=``,document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,d),s.current=null},d=()=>{u()};s.current=u,document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,d)},[e,t]),"data-testid":`resize-${e}`,children:(0,I.jsx)(A,{position:`absolute`,left:`3px`,top:0,bottom:0,width:`2px`,bg:n?`blue.500`:`transparent`,_groupHover:{bg:`blue.500`},transition:`background 0.1s`})})}),oz=g(({field:e,sortModel:t})=>{let n=t.getSortDirection(e),r=t.getSortIndex(e),i=t.sortCount>1;return n?(0,I.jsxs)(j,{alignItems:`center`,gap:`1px`,color:`blue.500`,fontSize:`xs`,flexShrink:0,"data-testid":`sort-indicator-${e}`,children:[n===`asc`?(0,I.jsx)(uk,{size:12}):(0,I.jsx)(ak,{size:12}),i&&r!==null&&(0,I.jsx)(A,{as:`span`,fontSize:`10px`,fontWeight:`medium`,lineHeight:1,children:r})]}):null}),sz=g(({field:e,columnsModel:t})=>t.isPinned(e)?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`pin-indicator-${e}`,children:(0,I.jsx)(Ck,{size:12})}):null),cz=g(({field:e,filterModel:t})=>t.hasFilterForField(e)?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`filter-indicator-${e}`,children:(0,I.jsx)(yk,{size:12})}):null),lz=({column:e})=>e.hasFormula?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`formula-indicator-${e.field}`,children:(0,I.jsx)(Yf,{size:12})}):null,uz=g(({field:e,sortModel:t})=>{let n=t.getSortDirection(e),r=t.isSorted(e);return(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:`Sort`}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`160px`,children:[(0,I.jsxs)(gt,{value:`sort-asc`,onClick:()=>{t.setSingleSort(e,`asc`)},color:n===`asc`?`blue.600`:void 0,children:[(0,I.jsx)(ck,{}),(0,I.jsx)(k,{children:`Sort A → Z`})]}),(0,I.jsxs)(gt,{value:`sort-desc`,onClick:()=>{t.setSingleSort(e,`desc`)},color:n===`desc`?`blue.600`:void 0,children:[(0,I.jsx)(ik,{}),(0,I.jsx)(k,{children:`Sort Z → A`})]}),r&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`remove-sort`,onClick:()=>{t.removeSort(e)},children:[(0,I.jsx)(Dk,{}),(0,I.jsx)(k,{children:`Remove sort`})]})]})]})})})]})}),dz=g(({field:e,columnsModel:t})=>{let n=t.canMoveLeft(e),r=t.canMoveRight(e),i=t.canMoveToStart(e),a=t.canMoveToEnd(e);return!n&&!r?null:(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:`Move column`}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`160px`,children:[n&&(0,I.jsxs)(gt,{value:`move-left`,onClick:()=>t.moveColumnLeft(e),children:[(0,I.jsx)(pk,{}),(0,I.jsx)(k,{children:`Move left`})]}),i&&(0,I.jsxs)(gt,{value:`move-to-start`,onClick:()=>t.moveColumnToStart(e),children:[(0,I.jsx)(ok,{}),(0,I.jsx)(k,{children:`Move to start`})]}),r&&(0,I.jsxs)(gt,{value:`move-right`,onClick:()=>t.moveColumnRight(e),children:[(0,I.jsx)(mk,{}),(0,I.jsx)(k,{children:`Move right`})]}),a&&(0,I.jsxs)(gt,{value:`move-to-end`,onClick:()=>t.moveColumnToEnd(e),children:[(0,I.jsx)(sk,{}),(0,I.jsx)(k,{children:`Move to end`})]})]})})})]})}),fz=(0,L.memo)(({field:e,name:t,fieldType:n,valuePrefix:r,onClick:i})=>(0,I.jsx)(gt,{value:r?`${r}-${e}`:e,onClick:()=>i(e),children:(0,I.jsxs)(A,{display:`flex`,alignItems:`center`,gap:2,width:`100%`,children:[(0,I.jsx)(A,{as:`span`,fontSize:`xs`,fontWeight:`medium`,color:`gray.400`,fontFamily:`mono`,minWidth:`20px`,children:sL(n)}),(0,I.jsx)(k,{truncate:!0,children:t||`(unnamed)`})]})})),pz=({group:e,parentVisible:t,valuePrefix:n,onClick:r})=>e.children.length===0&&!t?(0,I.jsx)(fz,{field:e.parent.field,name:e.parent.label,fieldType:e.parent.fieldType,valuePrefix:n,onClick:r}):(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{"data-testid":`file-group-${e.parent.field}`,children:[(0,I.jsxs)(A,{display:`flex`,alignItems:`center`,gap:2,flex:1,children:[(0,I.jsx)(A,{as:`span`,fontSize:`xs`,fontWeight:`medium`,color:`gray.400`,fontFamily:`mono`,minWidth:`20px`,children:sL(e.parent.fieldType)}),(0,I.jsx)(k,{truncate:!0,children:e.parent.label})]}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{maxH:`300px`,minW:`200px`,overflowY:`auto`,children:[!t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(fz,{field:e.parent.field,name:e.parent.label,fieldType:e.parent.fieldType,valuePrefix:n,onClick:r}),(0,I.jsx)(dt,{})]}),e.children.map(e=>(0,I.jsx)(fz,{field:e.field,name:e.label,fieldType:e.fieldType,valuePrefix:n,onClick:r},e.field))]})})})]}),mz=({label:e,valuePrefix:t,availableFields:n,allColumns:r,onSelect:i})=>{if(n.length===0)return null;let a=EI(n,r);return(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:e}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsx)(v,{maxH:`300px`,minW:`200px`,overflowY:`auto`,children:a.map(e=>TI(e)?(0,I.jsx)(pz,{group:e,parentVisible:e.parentVisible,valuePrefix:t,onClick:i},e.parent.field):(0,I.jsx)(fz,{field:e.field,name:e.label,fieldType:e.fieldType,valuePrefix:t,onClick:i},e.field))})})})]})},hz=g(({column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,onClose:a})=>{let o=t.canRemoveColumn,s=t.availableFieldsToInsert,c=s.length>0,l=t.canMoveLeft(e.field)||t.canMoveRight(e.field),u=t.isPinned(e.field),d=t.canPinLeft(e.field),f=t.canPinRight(e.field);return(0,I.jsxs)(v,{minW:`180px`,children:[n&&e.isSortable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uz,{field:e.field,sortModel:n}),(0,I.jsx)(dt,{})]}),r&&e.isSortable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(gt,{value:`add-filter`,onClick:()=>{r&&(r.addConditionForField(e.field),r.setOpen(!0))},children:[(0,I.jsx)(yk,{}),(0,I.jsx)(k,{children:`Add filter`})]}),(0,I.jsx)(dt,{})]}),u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(gt,{value:`unpin`,onClick:()=>{t.unpin(e.field)},children:[(0,I.jsx)(Sk,{}),(0,I.jsx)(k,{children:`Unpin column`})]}),(0,I.jsx)(dt,{})]}):(0,I.jsxs)(I.Fragment,{children:[d&&(0,I.jsxs)(gt,{value:`pin-left`,onClick:()=>{t.pinLeft(e.field)},children:[(0,I.jsx)(Ck,{}),(0,I.jsx)(k,{children:`Pin to left`})]}),f&&(0,I.jsxs)(gt,{value:`pin-right`,onClick:()=>{t.pinRight(e.field)},children:[(0,I.jsx)(Ck,{}),(0,I.jsx)(k,{children:`Pin to right`})]}),(d||f)&&(0,I.jsx)(dt,{})]}),l&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dz,{field:e.field,columnsModel:t}),(0,I.jsx)(dt,{})]}),c&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(mz,{label:`Insert before`,valuePrefix:`before`,availableFields:s,allColumns:t.allColumns,onSelect:n=>{t.insertColumnBefore(e.field,n),a?.()}}),(0,I.jsx)(mz,{label:`Insert after`,valuePrefix:`after`,availableFields:s,allColumns:t.allColumns,onSelect:n=>{t.insertColumnAfter(e.field,n),a?.()}}),(0,I.jsx)(dt,{})]}),(0,I.jsxs)(gt,{value:`hide`,disabled:!o,onClick:()=>{t.hideColumn(e.field)},children:[(0,I.jsx)(dne,{}),(0,I.jsx)(k,{children:`Hide column`})]}),(0,I.jsxs)(gt,{value:`hide-all`,disabled:!o,onClick:t.hideAll,children:[(0,I.jsx)(Qf,{}),(0,I.jsx)(k,{children:`Hide all columns`})]}),(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`copy-path`,onClick:()=>{i?i(e.field):navigator.clipboard.writeText(e.field).catch(()=>{})},children:[(0,I.jsx)(vk,{}),(0,I.jsx)(k,{children:`Copy path`})]})]})});function gz(e){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:e.side===`left`?`var(--shadow-left-opacity, 0)`:`var(--shadow-right-opacity, 0)`,...e.side===`left`?{right:`-8px`,boxShadow:`inset 8px 0 12px -8px rgba(0,0,0,0.1)`}:{left:`-8px`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}}function _z(e){return e?`${tz}, ${e.side===`left`?`inset -1px 0 0 0 ${ez}`:`inset 1px 0 0 0 ${ez}`}`:tz}var vz=g(({column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,stickyPosition:a})=>{let[o,s]=(0,L.useState)(!1),c=t.columnWidthCssVar(e.field),l=!!a;return(0,I.jsxs)(A,{as:`th`,position:l?`sticky`:`relative`,left:a?.side===`left`?a.offsetCss:void 0,right:a?.side===`right`?a.offsetCss:void 0,zIndex:l?2:void 0,width:c,minWidth:c,maxWidth:c,height:`inherit`,bg:`white`,boxShadow:_z(a),textAlign:`left`,fontWeight:`normal`,p:0,css:a?.isBoundary?gz(a):void 0,children:[(0,I.jsxs)(en,{positioning:{placement:`bottom-end`},lazyMount:!0,unmountOnExit:!0,open:o,onOpenChange:e=>s(e.open),children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsxs)(j,{alignItems:`center`,height:`100%`,pl:`8px`,pr:`16px`,gap:`4px`,cursor:`pointer`,transition:`background 0.15s`,overflow:`hidden`,_hover:{bg:`gray.100`},"data-testid":`header-${e.field}`,children:[(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,flexShrink:0,fontSize:`xs`,color:`gray.400`,width:`16px`,children:sL(e.fieldType)}),(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.400`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,overflow:`hidden`,flex:1,minWidth:0,textDecoration:e.isDeprecated?`line-through`:void 0,children:e.label}),(0,I.jsx)(lz,{column:e}),(0,I.jsx)(sz,{field:e.field,columnsModel:t}),r&&e.isSortable&&(0,I.jsx)(cz,{field:e.field,filterModel:r}),n&&e.isSortable&&(0,I.jsx)(oz,{field:e.field,sortModel:n})]})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsx)(hz,{column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,onClose:()=>s(!1)})})})]}),(0,I.jsx)(az,{field:e.field,columnsModel:t})]})}),yz=g(({columnsModel:e})=>{let t=e.availableFieldsToAdd,n=e.availableSystemFieldsToAdd;if(!e.hasHiddenColumns)return null;let r=EI(t,e.allColumns);return(0,I.jsx)(j,{alignItems:`center`,px:`4px`,height:`100%`,children:(0,I.jsxs)(en,{positioning:{placement:`bottom-start`},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsx)(Ze,{"aria-label":`Add column`,size:`xs`,variant:`ghost`,color:`gray.400`,_hover:{bg:`gray.100`,color:`gray.600`},focusRing:`none`,"data-testid":`add-column-button`,children:(0,I.jsx)(ep,{})})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`200px`,maxH:`340px`,overflowY:`auto`,children:[(0,I.jsxs)(gt,{value:`add-all`,onClick:e.addAll,children:[(0,I.jsx)(Qf,{}),(0,I.jsx)(k,{children:`Add all columns`})]}),r.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(tn,{children:[(0,I.jsx)(Ut,{fontWeight:`medium`,color:`gray.500`,fontSize:`xs`,children:`Data fields`}),r.map(t=>TI(t)?(0,I.jsx)(pz,{group:t,parentVisible:t.parentVisible,onClick:e.showColumn},t.parent.field):(0,I.jsx)(fz,{field:t.field,name:t.label,fieldType:t.fieldType,onClick:e.showColumn},t.field))]})]}),n.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(tn,{children:[(0,I.jsx)(Ut,{fontWeight:`medium`,color:`gray.500`,fontSize:`xs`,children:`System fields`}),n.map(t=>(0,I.jsx)(fz,{field:t.field,name:t.label,fieldType:t.fieldType,onClick:e.showColumn},t.field))]})]})]})})})]})})}),bz=40,xz=40,Sz=g(({columnsModel:e,sortModel:t,filterModel:n,onCopyPath:r,showSelection:i})=>{let a=i?bz:0,o=e.hasHiddenColumns;return(0,I.jsxs)(A,{as:`tr`,height:`40px`,children:[i&&(0,I.jsx)(A,{as:`th`,width:`40px`,minWidth:`40px`,maxWidth:`40px`,bg:`white`,p:0,position:`sticky`,left:0,zIndex:2,boxShadow:tz}),e.visibleColumns.map(i=>(0,I.jsx)(vz,{column:i,columnsModel:e,sortModel:t,filterModel:n,onCopyPath:r,stickyPosition:Cz(i.field,e,a,o)},i.field)),o?(0,I.jsx)(A,{as:`th`,width:`100%`,minWidth:`${xz}px`,bg:`white`,p:0,position:`sticky`,right:0,zIndex:2,boxShadow:tz,css:e.pinnedRightCount===0?nz():void 0,children:(0,I.jsx)(yz,{columnsModel:e})}):(0,I.jsx)(A,{as:`th`,width:`100%`,bg:`white`,p:0,boxShadow:tz})]})});function Cz(e,t,n,r){let i=t.getColumnStickyLeftCss(e,n);if(i!==void 0)return{side:`left`,offsetCss:i,isBoundary:t.isStickyLeftBoundary(e)};let a=t.getColumnStickyRightCss(e);if(a!==void 0)return{side:`right`,offsetCss:rz(a,r?xz:0),isBoundary:t.isStickyRightBoundary(e)}}var wz=({rowId:e,testIdPrefix:t,onSelect:n,onDuplicate:r,onDelete:i})=>(0,I.jsxs)(I.Fragment,{children:[n&&(0,I.jsxs)(gt,{value:`select`,onClick:()=>n(e),"data-testid":`${t}-select-${e}`,children:[(0,I.jsx)(Kf,{}),(0,I.jsx)(k,{children:`Select`})]}),r&&(0,I.jsxs)(gt,{value:`duplicate`,onClick:()=>r(e),"data-testid":`${t}-duplicate-${e}`,children:[(0,I.jsx)(vk,{}),(0,I.jsx)(k,{children:`Duplicate`})]}),i&&(0,I.jsxs)(I.Fragment,{children:[(n||r)&&(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`delete`,onClick:()=>i(e),"data-testid":`${t}-delete-${e}`,children:[(0,I.jsx)(Ek,{}),(0,I.jsx)(k,{color:`red.600`,children:`Delete`})]})]})]}),Tz=({rowId:e,onOpen:t,onPick:n,onSelect:r,onDuplicate:i,onDelete:a})=>{let[o,s]=(0,L.useState)(!1),c=n??t,l=n?Kf:df,u=n?`row-action-pick-${e}`:`row-action-open-${e}`,d=!!(t||r||i||a);return(0,I.jsx)(j,{position:`absolute`,right:`8px`,top:`50%`,transform:`translateY(-50%)`,alignItems:`center`,className:`row-action-buttons`,"data-menu-open":o||void 0,"data-testid":`row-action-buttons-${e}`,children:(0,I.jsxs)(j,{alignItems:`center`,height:`24px`,borderRadius:`6px`,bg:`white`,boxShadow:`0px 2px 8px rgba(0,0,0,0.16)`,overflow:`hidden`,"data-testid":`row-action-split-${e}`,children:[c&&(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,width:`28px`,minWidth:`28px`,cursor:`pointer`,_hover:{bg:`gray.100`},onClick:t=>{t.stopPropagation(),c(e)},"data-testid":u,children:(0,I.jsx)(Ve,{boxSize:`20px`,color:`gray.400`,as:l})}),d&&(0,I.jsxs)(en,{lazyMount:!0,unmountOnExit:!0,onOpenChange:({open:e})=>s(e),positioning:{placement:`bottom-start`},children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,width:`18px`,minWidth:`18px`,cursor:`pointer`,borderLeft:c?`1px solid`:void 0,borderColor:`gray.100`,_hover:{bg:`gray.100`},onClick:e=>e.stopPropagation(),"data-testid":`row-action-trigger-${e}`,children:(0,I.jsx)(Ve,{as:nf,boxSize:`16px`,color:`gray.300`})})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`180px`,"data-testid":`row-action-menu-${e}`,children:[t&&(0,I.jsxs)(gt,{value:`open`,onClick:()=>t(e),"data-testid":`row-action-menu-open-${e}`,children:[(0,I.jsx)(df,{}),(0,I.jsx)(k,{children:`Open`})]}),t&&(r||i||a)&&(0,I.jsx)(dt,{}),(0,I.jsx)(wz,{rowId:e,testIdPrefix:`row-action`,onSelect:r,onDuplicate:i,onDelete:a})]})})})]})]})})},Ez=({rowId:e,isSelected:t,onToggleSelection:n})=>(0,I.jsx)(A,{as:`td`,width:`40px`,minWidth:`40px`,maxWidth:`40px`,p:0,position:`sticky`,left:0,zIndex:1,bg:`white`,boxShadow:`inset 0 -1px 0 0 ${ez}, inset -1px 0 0 0 ${ez}`,children:(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,children:(0,I.jsxs)(Ne,{checked:t,onCheckedChange:()=>n(),size:`sm`,"data-testid":`select-${e}`,children:[(0,I.jsx)($e,{}),(0,I.jsx)(Ye,{})]})})}),Dz=40,Oz=40;function kz(e){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:e===`left`?`var(--shadow-left-opacity, 0)`:`var(--shadow-right-opacity, 0)`,...e===`left`?{right:`-8px`,boxShadow:`inset 8px 0 12px -8px rgba(0,0,0,0.1)`}:{left:`-8px`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}}function Az(e,t,n,r){let i=r&&n,a=i?{"& .row-action-buttons":{opacity:0},"&:hover .row-action-buttons, & .row-action-buttons[data-menu-open]":{opacity:1,transition:`opacity 0.15s ease`}}:{};if(e)return{...a,...kz(t)};if(i)return a}function jz(e,t,n,r){let i=t.getColumnStickyLeftCss(e.field,n),a=t.getColumnStickyRightCss(e.field),o=i!==void 0,s=a!==void 0,c=o||s,l=t.isStickyLeftBoundary(e.field),u=t.isStickyRightBoundary(e.field),d=s&&a!==void 0?rz(a,r):a;return{isSticky:c,isBoundary:l||u,boundarySide:o?`left`:`right`,leftCss:o?i:void 0,rightCss:s?d:void 0,colWidth:c?t.columnWidthCssVar(e.field):void 0}}function Mz(e,t){return e?`${tz}, ${t===`left`?`inset -1px 0 0 0 ${ez}`:`inset 1px 0 0 0 ${ez}`}`:tz}var Nz=g(({row:e,columnsModel:t,showSelection:n,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a,onOpenRow:o,onPickRow:s,onSelectRow:c,onDuplicateRow:l,onDeleteRow:u})=>{let d=!!(o||s||c||l||u),f=n?Dz:0,p=t.hasHiddenColumns,m=p?Oz:0;return(0,I.jsxs)(I.Fragment,{children:[n&&(0,I.jsx)(Ez,{rowId:e.rowId,isSelected:e.isSelected,onToggleSelection:()=>e.toggleSelection()}),t.visibleColumns.map((n,p)=>{let h=e.getCellVM(n),g=p===0,_=g&&d&&!h.isEditing,v=jz(n,t,f,m);return(0,I.jsxs)(A,{as:`td`,width:v.colWidth,minWidth:v.colWidth,maxWidth:v.isSticky?v.colWidth:`0`,overflow:v.isBoundary?`visible`:`hidden`,borderRight:v.isSticky?void 0:`1px solid`,borderColor:v.isSticky?void 0:ez,p:0,position:v.isSticky?`sticky`:`relative`,left:v.leftCss,right:v.rightCss,zIndex:v.isSticky?1:void 0,bg:v.isSticky?`white`:void 0,boxShadow:Mz(v.isSticky,v.boundarySide),css:Az(v.isBoundary,v.boundarySide,d,g),children:[v.isBoundary?(0,I.jsx)(A,{overflow:`hidden`,children:(0,I.jsx)(UR,{cell:h,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a})}):(0,I.jsx)(UR,{cell:h,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a}),_&&(0,I.jsx)(Tz,{rowId:e.rowId,onOpen:o,onPick:s,onSelect:c,onDuplicate:l,onDelete:u})]},n.field)}),p?(0,I.jsx)(A,{as:`td`,width:`100%`,minWidth:`${Oz}px`,p:0,position:`sticky`,right:0,zIndex:1,bg:`white`,boxShadow:tz,css:t.pinnedRightCount===0?nz():void 0}):(0,I.jsx)(A,{as:`td`,width:`100%`,p:0,boxShadow:tz})]})}),Pz=g(({selection:e,allRowIds:t,onDuplicate:n,onDelete:r})=>{let i=e.isAllSelected(t);return(0,I.jsx)(tee,{open:e.isSelectionMode,children:(0,I.jsx)(R,{children:(0,I.jsx)(vt,{zIndex:5,children:(0,I.jsxs)(pt,{"data-testid":`selection-toolbar`,children:[(0,I.jsxs)(zt,{children:[e.selectedCount,` selected`]}),(0,I.jsx)(wt,{}),!i&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>e.selectAll(t),"data-testid":`select-all`,children:[(0,I.jsx)(Kf,{}),`Select all`]}),n&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>n(e.selectedIds),"data-testid":`duplicate-selected`,children:[(0,I.jsx)(vk,{}),`Duplicate`]}),r&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>r(e.selectedIds),"data-testid":`delete-selected`,children:[(0,I.jsx)(Ek,{}),`Delete`]}),(0,I.jsx)(iee,{asChild:!0,children:(0,I.jsx)(N,{variant:`ghost`,size:`sm`,"aria-label":`Exit selection`,onClick:()=>e.exitSelectionMode(),"data-testid":`exit-selection`,children:(0,I.jsx)(ip,{})})})]})})})})}),Fz=({isOpen:e,onClose:t,onConfirm:n,count:r})=>{let i=(0,L.useRef)(null),a=r&&r>1?`Are you sure you want to delete ${r} rows?`:`Are you sure you want to delete this row?`;return(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>{e||t()},initialFocusEl:()=>i.current,role:`alertdialog`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{maxWidth:`400px`,"data-testid":`delete-confirm-dialog`,children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Delete confirmation`})}),(0,I.jsx)(be,{children:(0,I.jsx)(k,{children:a})}),(0,I.jsx)(w,{children:(0,I.jsxs)(j,{gap:2,children:[(0,I.jsx)(N,{ref:i,variant:`outline`,size:`sm`,onClick:t,"data-testid":`delete-cancel`,children:`Cancel`}),(0,I.jsx)(N,{colorPalette:`red`,size:`sm`,onClick:n,"data-testid":`delete-confirm`,children:`Delete`})]})})]})})]})})},Iz=({style:e,children:t,...n})=>(0,I.jsx)(`table`,{...n,style:{...e,width:`max-content`,minWidth:`100%`,tableLayout:`fixed`,borderCollapse:`separate`,borderSpacing:0},children:t}),Lz=({"data-index":e,context:t,style:n,children:r,...i})=>{let a=t?.rows[e];return(0,I.jsx)(`tr`,{...i,className:`group`,"data-testid":a?`row-${a.rowId}`:void 0,style:{...n,height:`40px`},children:r})},Rz={left:!1,right:!1},zz=class{_left=!1;_right=!1;_paused=!1;_dirty=!1;_onChange=null;get showLeftShadow(){return this._left}get showRightShadow(){return this._right}setOnChange(e){this._onChange=e}pause(){this._paused=!0,this._dirty=!1}resume(){this._paused=!1,this._dirty&&(this._dirty=!1,this._notify())}update(e,t){if(!(this._left===e&&this._right===t)){if(this._left=e,this._right=t,this._paused){this._dirty=!0;return}this._notify()}}reset(){if(!(!this._left&&!this._right)){if(this._left=!1,this._right=!1,this._paused){this._dirty=!0;return}this._notify()}}_notify(){this._onChange&&this._onChange({left:this._left,right:this._right})}};function Bz(e){return e instanceof HTMLElement?e:document.scrollingElement}function Vz(){let e=(0,L.useRef)(null);e.current||=new zz;let t=e.current,[n,r]=(0,L.useState)(Rz);t.setOnChange(r),(0,L.useEffect)(()=>()=>{t.setOnChange(null)},[t]);let i={"--shadow-left-opacity":n.left?`1`:`0`,"--shadow-right-opacity":n.right?`1`:`0`},a=(0,L.useRef)(null),o=(0,L.useRef)(0),s=(0,L.useRef)(null),c=(0,L.useCallback)(()=>{let e=a.current;if(!e)return;let n=Bz(e);if(!n)return;let r=n.scrollLeft,i=n.scrollWidth-n.clientWidth;t.update(r>0,i>1&&r<i-1)},[t]),l=(0,L.useCallback)(()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(c)},[c]),u=(0,L.useCallback)(e=>{let n=a.current;if(n&&n.removeEventListener(`scroll`,l),s.current&&=(s.current.disconnect(),null),e){a.current=e,e.addEventListener(`scroll`,l,{passive:!0}),o.current=requestAnimationFrame(c);let t=Bz(e);if(t){let e=new ResizeObserver(l),n=t.querySelector(`table`);n&&e.observe(n),s.current=e}}else a.current=null,t.reset()},[l,c,t]);return(0,L.useEffect)(()=>()=>{let e=a.current;e&&e.removeEventListener(`scroll`,l),s.current&&s.current.disconnect(),o.current&&cancelAnimationFrame(o.current)},[l]),{shadowCssVars:i,shadowModel:t,setScrollerRef:u}}var Hz={Table:Iz,TableRow:Lz},Uz=g(({rows:e,columnsModel:t,cellFSM:n,selection:r,sortModel:i,filterModel:a,onSearchForeignKey:o,onUploadFile:s,onOpenFile:c,onOpenRow:l,onPickRow:u,onDeleteSelected:d,onDuplicateSelected:f,onDeleteRow:p,onDuplicateRow:m,onCopyPath:h,onEndReached:g,isLoadingMore:_,useWindowScroll:v})=>{let y=r.isSelectionMode,b=e.map(e=>e.rowId),[x,S]=(0,L.useState)(null),{shadowCssVars:C,shadowModel:w,setScrollerRef:T}=Vz(),E=t.isResizing;(0,L.useEffect)(()=>{E?w.pause():w.resume()},[E,w]);let[D,ee]=(0,L.useState)(null),te=(0,L.useCallback)(e=>{ee(e),t.setWrapperElement(e)},[t]);(0,L.useEffect)(()=>{if(!(!v||!D))return T(D),()=>{T(null)}},[v,D,T]);let ne=(0,L.useCallback)(e=>{r.enterSelectionMode(e)},[r]),O=(0,L.useCallback)(e=>{S({rowId:e})},[]),re=(0,L.useCallback)(e=>{S({batchIds:e})},[]),ie=(0,L.useCallback)(()=>{x?.rowId?(r.deselect(x.rowId),p?p(x.rowId):d&&d([x.rowId])):x?.batchIds&&(d?.(x.batchIds),r.exitSelectionMode()),S(null)},[x,p,d,r]),ae=(0,L.useCallback)(()=>{S(null)},[]),oe=x?.batchIds?.length,se=!!(p||d),ce=!!m,le=se||ce||!!f,ue=(0,L.useMemo)(()=>({copyRange:()=>{let r=n?.getSelectedRange(),i=t.visibleColumns;r&&XR(r,e,i)},pasteRange:()=>{if(!n)return;let r=t.visibleColumns,i=n.getSelectedRange(),a=QR(n,r,e);i?ZR(i.startRow,i.startCol,e,r):a&&ZR(a.rowIndex,a.colIndex,e,r)},clearRange:()=>{let r=n?.getSelectedRange(),i=t.visibleColumns;r&&$R(r,e,i)}}),[n,e,t]),de=(0,L.useCallback)(r=>{if(!n)return;let i=r.ctrlKey||r.metaKey,a=t.visibleColumns;if(i&&r.key===`v`&&n.focusedCell){let t=n.getSelectedRange(),i=QR(n,a,e);t?(r.preventDefault(),ZR(t.startRow,t.startCol,e,a)):i&&(r.preventDefault(),ZR(i.rowIndex,i.colIndex,e,a));return}if(n.hasSelection){if(i&&r.key===`c`){let t=n.getSelectedRange();t&&(r.preventDefault(),XR(t,e,a));return}if(r.key===`Delete`||r.key===`Backspace`){let t=n.getSelectedRange();t&&(r.preventDefault(),$R(t,e,a))}}},[n,e,t]),fe=(0,L.useCallback)((e,n)=>(0,I.jsx)(Nz,{row:n,columnsModel:t,showSelection:y,onSearchForeignKey:o,onUploadFile:s,onOpenFile:c,onOpenRow:l,onPickRow:u,onSelectRow:le?ne:void 0,onDuplicateRow:ce?m:void 0,onDeleteRow:se?O:void 0}),[t,y,o,s,c,l,u,le,se,ce,ne,m,O]),pe=(0,L.useCallback)(()=>(0,I.jsx)(Sz,{columnsModel:t,sortModel:i,filterModel:a,onCopyPath:h,showSelection:y}),[t,i,a,h,y]),me=(0,L.useMemo)(()=>({rows:e}),[e]),he=t.visibleColumns.length+(y?2:1),ge=(0,L.useCallback)(()=>_?(0,I.jsx)(`tfoot`,{children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:he,style:{textAlign:`center`,padding:`16px 0`},children:(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`})})})}):null,[_,he]),_e=(0,L.useMemo)(()=>({...Hz,Footer:ge}),[ge]);return t.visibleColumns.length===0?(0,I.jsx)(A,{p:4,children:(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`No columns to display.`})}):(0,I.jsxs)(nR.Provider,{value:n?ue:null,children:[(0,I.jsxs)(A,{ref:te,position:`relative`,height:v?void 0:`100%`,overflowX:`auto`,overflowY:v?`clip`:void 0,"data-testid":`table-widget`,onKeyDown:de,style:{...t.columnWidthCssVars,...C},children:[e.length===0?(0,I.jsxs)(A,{children:[(0,I.jsx)(`table`,{style:{width:`max-content`,minWidth:`100%`,tableLayout:`fixed`,borderCollapse:`separate`,borderSpacing:0},children:(0,I.jsx)(`thead`,{children:(0,I.jsx)(Sz,{columnsModel:t,sortModel:i,filterModel:a,onCopyPath:h,showSelection:y})})}),(0,I.jsx)(A,{p:4,children:(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`No rows to display.`})})]}):(0,I.jsx)(Foe,{useWindowScroll:v,style:v?void 0:{height:`100%`},data:e,context:me,defaultItemHeight:40,initialItemCount:Math.min(e.length,20),increaseViewportBy:2e3,endReached:g,fixedHeaderContent:pe,itemContent:fe,components:_e,scrollerRef:v?void 0:T}),(0,I.jsx)(Pz,{selection:r,allRowIds:b,onDuplicate:f,onDelete:d?re:void 0})]}),(0,I.jsx)(Fz,{isOpen:x!==null,onClose:ae,onConfirm:ie,count:oe})]})}),Wz=class{_cellFSM;_columnsModel;constructor(e,t){this._cellFSM=e,this._columnsModel=t,f(this,{},{autoBind:!0})}get _focusedColumn(){let e=this._cellFSM.focusedCell;return e?this._columnsModel.allColumns.find(t=>t.field===e.field)??null:null}get isVisible(){return this._focusedColumn!==null&&!this._cellFSM.hasSelection}get fieldLabel(){return this._focusedColumn?.label??``}get formulaExpression(){return this._focusedColumn?.formulaExpression}get foreignKeyTableId(){return this._focusedColumn?.foreignKeyTableId}},Gz=class{_totalCount=0;_baseTotalCount=0;_isFiltering=!1;_isRefetching=!1;constructor(){f(this,{},{autoBind:!0})}get totalCount(){return this._totalCount}get baseTotalCount(){return this._baseTotalCount}get isFiltering(){return this._isFiltering}get isRefetching(){return this._isRefetching}get text(){return this._isFiltering?`${this._totalCount} of ${this._baseTotalCount} ${this._baseTotalCount===1?`row`:`rows`}`:`${this._totalCount} ${this._totalCount===1?`row`:`rows`}`}setTotalCount(e){this._totalCount=e}setBaseTotalCount(e){this._baseTotalCount=e}setIsFiltering(e){this._isFiltering=e}setRefetching(e){this._isRefetching=e}decrementBaseTotalCount(e=1){this._baseTotalCount=Math.max(0,this._baseTotalCount-e),this._totalCount=Math.max(0,this._totalCount-e)}},Kz=class{_snapshot=null;_currentSnapshot=null;_canSave=!1;_isPopoverOpen=!1;_onSave=null;_onRevert=null;constructor(){f(this,{},{autoBind:!0})}get hasChanges(){return this._snapshot!==this._currentSnapshot}get isVisible(){return this.hasChanges}get canSave(){return this._canSave}get isPopoverOpen(){return this._isPopoverOpen}saveSnapshot(e){let t=JSON.stringify(e);this._snapshot=t,this._currentSnapshot=t}checkForChanges(e){this._currentSnapshot=JSON.stringify(e)}async save(){this._onSave&&await this._onSave()}revert(){this._onRevert&&this._onRevert(),this._currentSnapshot=this._snapshot}setCanSave(e){this._canSave=e}setPopoverOpen(e){this._isPopoverOpen=e}setOnSave(e){this._onSave=e}setOnRevert(e){this._onRevert=e}dispose(){this._onSave=null,this._onRevert=null}},qz=50,Jz=class{columns;filters;sorts;search;viewBadge;cellFSM;selection;rowCount;cellInfo;_dataSource;_pageSize;_breadcrumbs;_callbacks;_tableId;_schemaContext=new oI;_readonly=!1;_rows=[];_isBootstrapping=!0;_isLoadingMore=!1;_hasNextPage=!1;_endCursor=null;_savedViewState=null;constructor(e,t){this._dataSource=e,this._tableId=t.tableId,this._pageSize=t.pageSize??qz,this._readonly=t.readonly??!1,this._breadcrumbs=t.breadcrumbs??[],this._callbacks=t.callbacks??{},this.columns=new wI,this.filters=new oL,this.sorts=new TL,this.search=new xL(e=>this._handleSearch(e)),this.viewBadge=new Kz,this.cellFSM=new GL,this.selection=new jL,this.rowCount=new Gz,this.cellInfo=new Wz(this.cellFSM,this.columns),this.columns.setOnChange(()=>this._handleColumnsChange()),this.filters.setOnChange(()=>this._handleFilterChange()),this.filters.setOnApply(e=>this._handleFilterApply()),this.sorts.setOnChange(()=>this._handleSortChange()),this.sorts.setOnApply(e=>this._handleSortApply()),this.viewBadge.setOnSave(()=>this._handleViewSave()),this.viewBadge.setOnRevert(()=>this._handleViewRevert()),this.cellFSM.setOnReadonlyEditAttempt(this._callbacks.onReadonlyEditAttempt??null),f(this,{},{autoBind:!0}),queueMicrotask(()=>void this._bootstrap())}get rows(){return this._rows}get isBootstrapping(){return this._isBootstrapping}get isLoadingMore(){return this._isLoadingMore}get readonly(){return this._readonly}get tableId(){return this._tableId}get breadcrumbs(){return this._breadcrumbs}get callbacks(){return this._callbacks}getViewState(){return{columns:this.columns.serializeToViewColumns(),filters:null,sorts:this.sorts.serializeToViewSorts(),search:``}}applyViewState(e){this.columns.applyViewColumns(e.columns),this.sorts.applyViewSorts(e.sorts)}async loadMore(){if(!(!this._hasNextPage||this._isLoadingMore)){this._isLoadingMore=!0;try{let e=this._buildQuery(this._endCursor),t=await this._dataSource.fetchRows(e);c(()=>{this._appendRowVMs(t.rows),this._endCursor=t.endCursor,this._hasNextPage=t.hasNextPage,this._isLoadingMore=!1})}catch{c(()=>{this._isLoadingMore=!1})}}}async deleteRows(e){(await this._dataSource.deleteRows(e)).ok&&c(()=>{let t=new Set(e);this._rows=this._rows.filter(e=>!t.has(e.rowId)),this.rowCount.decrementBaseTotalCount(e.length),this.selection.exitSelectionMode(),this._updateNavigationContext()})}dispose(){this.columns.dispose(),this.filters.dispose(),this.sorts.dispose(),this.search.dispose(),this.viewBadge.dispose(),this.selection.exitSelectionMode(),this.cellFSM.blur();for(let e of this._rows)e.dispose()}async _bootstrap(){try{let e=await this._dataSource.fetchMetadata();c(()=>{this._schemaContext.init(e.dataSchema,e.refSchemas),this._readonly=this._readonly||e.readonly,this.viewBadge.setCanSave(!this._readonly)}),this.columns.init(this._schemaContext.allColumns),this.sorts.init(this._schemaContext.sortableFields),this.filters.init(this._schemaContext.filterableFields),e.viewState&&this.applyViewState(e.viewState),this._saveViewSnapshot(),await this._loadRows(),c(()=>{this._isBootstrapping=!1})}catch{c(()=>{this._isBootstrapping=!1})}}_buildQuery(e=null){return{where:this.filters.hasActiveFilters?this.filters.buildCurrentWhereClause():null,orderBy:this.sorts.serializeToQuerySorts(),search:this.search.debouncedQuery,first:this._pageSize,after:e}}async _loadRows(){let e=this._buildQuery(),t=await this._dataSource.fetchRows(e);c(()=>{this._replaceRowVMs(t.rows),this._endCursor=t.endCursor,this._hasNextPage=t.hasNextPage;let e=this.filters.hasActiveFilters||this.search.hasActiveSearch;this.rowCount.setTotalCount(t.totalCount),e||this.rowCount.setBaseTotalCount(t.totalCount),this.rowCount.setIsFiltering(e),this._updateNavigationContext()})}async _reloadRows(){this._isBootstrapping||(this.selection.exitSelectionMode(),this.cellFSM.blur(),await this._loadRows())}_replaceRowVMs(e){for(let e of this._rows)e.dispose();this._rows=this._createRowVMs(e)}_appendRowVMs(e){let t=this._createRowVMs(e);this._rows=[...this._rows,...t],this._updateNavigationContext()}_createRowVMs(e){let t=this._schemaContext.wrappedDataSchema;if(!t)return[];let n=kc({tableId:this._tableId,schema:t,rows:e.map(e=>({rowId:e.rowId,data:{data:e.data}})),refSchemas:this._schemaContext.fullRefSchemas}),r=new Map;for(let t of e)r.set(t.rowId,this._buildSystemValues(t));return n.rows.map(e=>new qL(e,e.rowId,this.cellFSM,this.selection,(e,t,n,r)=>this._commitCell(e,t,n,r),r.get(e.rowId),this._readonly))}_buildSystemValues(e){return{...e.systemFields,id:e.rowId}}_toPatchField(e){return nI(e)}async _commitCell(e,t,n,r){let i=this._toPatchField(t),a=(await this._dataSource.patchCells([{rowId:e,field:i,value:n}]))[0];a&&!a.ok&&c(()=>{let n=this._rows.find(t=>t.rowId===e);if(n&&r!==void 0){let e=n.rowModel.get(t);e?.isPrimitive()?e.setValue(r):e?.isObject()&&e.setValue(r,{internal:!0})}})}_updateNavigationContext(){this.cellFSM.setNavigationContext(this.columns.visibleColumns.map(e=>e.field),this._rows.map(e=>e.rowId))}_handleColumnsChange(){this.cellFSM.updateNavigationContext(this.columns.visibleColumns.map(e=>e.field),this.cellFSM.rowIds),this._checkViewChanges()}_handleFilterChange(){}_handleFilterApply(){this._reloadRows()}_handleSortChange(){this._checkViewChanges()}_handleSortApply(){this._reloadRows(),this._checkViewChanges()}_handleSearch(e){this._reloadRows()}async _handleViewSave(){try{let e=this.getViewState();(await this._dataSource.saveView(e)).ok&&this._saveViewSnapshot()}catch{}}_handleViewRevert(){this._savedViewState&&(this.applyViewState(this._savedViewState),this._reloadRows())}_saveViewSnapshot(){let e=this.getViewState();this._savedViewState=e,this.viewBadge.saveSnapshot(e)}_checkViewChanges(){this.viewBadge.checkForChanges(this.getViewState())}};function Yz(e,{delayMs:t=150,minShowMs:n=300}={}){let[r,i]=(0,L.useState)(!1),a=(0,L.useRef)(null);return(0,L.useEffect)(()=>{if(e){let e=setTimeout(()=>{a.current=Date.now(),i(!0)},t);return()=>clearTimeout(e)}if(a.current!==null){let e=n-(Date.now()-a.current);if(e>0){let t=setTimeout(()=>{a.current=null,i(!1)},e);return()=>clearTimeout(t)}a.current=null}i(!1)},[e,t,n]),r}var Xz=g(({model:e})=>e.isVisible?(0,I.jsxs)(j,{alignItems:`center`,gap:2,overflow:`hidden`,flexShrink:1,minW:0,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-field`,children:e.fieldLabel}),e.formulaExpression&&(0,I.jsxs)(k,{fontSize:`sm`,color:`purple.400`,fontFamily:`mono`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-formula`,children:[`= `,e.formulaExpression]}),e.foreignKeyTableId&&!e.formulaExpression&&(0,I.jsxs)(k,{fontSize:`sm`,color:`blue.400`,fontFamily:`mono`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-fk`,children:[`→ `,e.foreignKeyTableId]})]}):null),Zz=g(({model:e})=>(0,I.jsxs)(j,{alignItems:`center`,gap:2,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,"data-testid":`row-count-text`,children:e.text}),e.isRefetching&&(0,I.jsx)(Ht,{size:`xs`,color:`gray.400`,"data-testid":`row-count-spinner`})]})),Qz=g(({model:e})=>{if(!e.isVisible)return null;let t=e.canSave?`orange`:`gray`,n=e.canSave?`orange.500`:`gray.400`,r=e.canSave?`unsaved`:`local`,i=e.canSave?`Unsaved view settings`:`Local view changes`,a=e.canSave?`Column order, widths, and sort settings will be saved to the Default view and shared with everyone.`:`View settings can only be saved in draft revisions. These changes are temporary and will be lost when you leave.`,o=e.canSave?`Revert`:`Reset`;return(0,I.jsxs)(ge,{open:e.isPopoverOpen,onOpenChange:t=>e.setPopoverOpen(t.open),lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsx)(me,{asChild:!0,children:(0,I.jsxs)(It,{variant:`subtle`,size:`sm`,colorPalette:t,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:1,_hover:{opacity:.8},"data-testid":`view-settings-badge`,children:[(0,I.jsx)(A,{width:`6px`,height:`6px`,borderRadius:`full`,bg:n}),r]})}),(0,I.jsx)(R,{children:(0,I.jsx)(se,{children:(0,I.jsxs)(le,{p:3,maxW:`300px`,children:[(0,I.jsxs)(P,{mb:2,children:[(0,I.jsx)(A,{color:`gray.400`,children:(0,I.jsx)(bk,{size:16})}),(0,I.jsx)(k,{fontWeight:`semibold`,fontSize:`sm`,children:i})]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,mb:3,children:a}),(0,I.jsxs)(P,{children:[(0,I.jsx)(N,{variant:`ghost`,size:`xs`,onClick:()=>{e.revert(),e.setPopoverOpen(!1)},"data-testid":`view-settings-revert`,children:o}),e.canSave&&(0,I.jsx)(N,{colorPalette:`blue`,size:`xs`,onClick:()=>{e.save(),e.setPopoverOpen(!1)},"data-testid":`view-settings-save`,children:`Save`})]})]})})})]})}),$z=40,eB=40,tB=8,nB=[120,150,120,100,130],rB=[[80,110,70,60,90],[100,90,100,80,110],[60,130,80,70,80],[90,100,60,90,100],[75,120,90,55,70],[110,80,75,80,120],[85,140,95,65,95],[95,70,110,85,80]],iB=({breadcrumbs:e,onBreadcrumbClick:t,showCreateButton:n,useWindowScroll:r})=>(0,I.jsxs)(A,{display:`flex`,flexDirection:`column`,height:r?void 0:`100%`,flex:r?1:void 0,children:[(0,I.jsxs)(j,{px:3,pt:`32px`,pb:`48px`,alignItems:`flex-start`,justifyContent:`space-between`,...r&&{position:`sticky`,top:0,zIndex:3,bg:`white`},children:[e.length>0?(0,I.jsx)(JN,{segments:e,highlightLast:!1,onSegmentClick:t,action:n?(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}):void 0}):(0,I.jsx)(A,{}),(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,children:[(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}),(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}),(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`})]})]}),(0,I.jsxs)(A,{children:[(0,I.jsx)(j,{height:`${$z}px`,alignItems:`center`,px:3,borderBottom:`1px solid`,borderColor:`gray.100`,children:nB.map((e,t)=>(0,I.jsx)(A,{width:`${e}px`,flexShrink:0,children:(0,I.jsx)(sn,{height:`12px`,width:`60px`,borderRadius:`4px`})},`h-${t}`))}),rB.slice(0,tB).map((e,t)=>(0,I.jsx)(j,{height:`${eB}px`,alignItems:`center`,px:3,borderBottom:`1px solid`,borderColor:`gray.100`,children:nB.map((n,r)=>(0,I.jsx)(A,{width:`${n}px`,flexShrink:0,children:(0,I.jsx)(sn,{height:`14px`,width:`${e[r]}px`,borderRadius:`4px`})},`r-${t}-c-${r}`))},`r-${t}`))]})]}),aB=()=>{};function oB(e,t,n){return{onDeleteRow:e?void 0:e=>t.deleteRows([e]),onDuplicateRow:e?void 0:n.onDuplicateRow,onDeleteSelected:e?void 0:e=>t.deleteRows(e),onUploadFile:e?void 0:n.onUploadFile}}var sB=g(({viewModel:e,useWindowScroll:t})=>{let n=Yz(e.isBootstrapping);if(e.isBootstrapping)return n?(0,I.jsx)(iB,{breadcrumbs:e.breadcrumbs,onBreadcrumbClick:e.callbacks.onBreadcrumbClick,showCreateButton:!e.readonly&&!!e.callbacks.onCreateRow,useWindowScroll:t}):null;let r=e.readonly,{breadcrumbs:i,callbacks:a}=e;return(0,I.jsxs)(A,{display:`flex`,flexDirection:`column`,height:t?void 0:`100%`,flex:t?1:void 0,children:[(0,I.jsxs)(j,{px:3,pt:`32px`,pb:`48px`,alignItems:`flex-start`,justifyContent:`space-between`,...t&&{position:`sticky`,top:0,zIndex:3,bg:`white`},children:[i.length>0&&(0,I.jsx)(JN,{segments:i,highlightLast:!1,onSegmentClick:a.onBreadcrumbClick,action:a.onCreateRow?(0,I.jsx)(XN,{tooltip:`New row`,onClick:a.onCreateRow,dataTestId:`create-row-button`}):void 0}),(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,children:[(0,I.jsx)(CL,{model:e.search}),(0,I.jsx)(bL,{model:e.filters,availableFields:e.columns.filterableFields}),(0,I.jsx)(AL,{model:e.sorts,availableFields:e.columns.sortableFields,onChange:aB})]})]}),(0,I.jsx)(A,{flex:1,minHeight:0,children:(0,I.jsx)(Uz,{rows:e.rows,columnsModel:e.columns,cellFSM:e.cellFSM,selection:e.selection,sortModel:e.sorts,filterModel:e.filters,isLoadingMore:e.isLoadingMore,onEndReached:e.loadMore,onOpenRow:a.onOpenRow,onPickRow:a.onPickRow,...oB(r,e,a),onSearchForeignKey:a.onSearchForeignKey,onOpenFile:a.onOpenFile,onCopyPath:a.onCopyPath,useWindowScroll:t})}),(0,I.jsxs)(j,{px:3,py:2,alignItems:`center`,overflow:`hidden`,...t&&{position:`sticky`,bottom:0,bg:`white`,zIndex:3},children:[(0,I.jsx)(Zz,{model:e.rowCount}),(0,I.jsxs)(j,{alignItems:`center`,gap:3,overflow:`hidden`,flexShrink:1,minW:0,flex:1,justifyContent:`flex-end`,children:[(0,I.jsx)(Xz,{model:e.cellInfo}),(0,I.jsx)(Qz,{model:e.viewBadge})]})]})]})}),cB=Sn(),lB=e=>{let t={BASE_URL:`/`,DEV:!1,GIT_BRANCH_NAME:`HEAD`,GIT_COMMIT_HASH:`59fa0fa`,MODE:`production`,PACKAGE_VERSION:`2.7.0-alpha.2`,PROD:!0,REACT_APP_ENDPOINT_HOST:``,REACT_APP_ENDPOINT_PORT:``,REACT_APP_ENDPOINT_SERVER_URL:`/endpoint`,REACT_APP_GRAPHQL_SERVER_URL:`/graphql`,REACT_APP_SWAGGER_SERVER_URL:`/api`,SSR:!1}[e];return globalThis.__env__?.[e]||t},uB=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},dB=[`light`,`dark`],fB=`(prefers-color-scheme: dark)`,pB=typeof window>`u`,mB=L.createContext(void 0),hB=e=>L.useContext(mB)?L.createElement(L.Fragment,null,e.children):L.createElement(_B,{...e}),gB=[`light`,`dark`],_B=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=gB,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=L.useState(()=>yB(i,o)),[m,h]=L.useState(()=>f===`system`?xB():f),g=c?Object.values(c):a,_=L.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=xB());let a=c?c[i]:i,l=t?bB(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=dB.includes(o)?o:null,t=dB.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=L.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=L.useCallback(t=>{h(xB(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);L.useEffect(()=>{let e=window.matchMedia(fB);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),L.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),L.useEffect(()=>{_(e??f)},[e,f]);let b=L.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return L.createElement(mB.Provider,{value:b},L.createElement(vB,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},vB=L.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return L.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${uB.toString()})(${u})`}})}),yB=(e,t)=>{if(pB)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},bB=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},xB=e=>(e||=window.matchMedia(fB),e.matches?`dark`:`light`),SB=()=>(0,L.useCallback)(e=>{e&&e.focus()},[]),CB=(e,...t)=>{let n=(0,L.useRef)(null),[r,i]=(0,L.useState)(t),a=(0,L.useMemo)(()=>r.length!==t.length||r.some((e,n)=>e!==t[n])?(i(t),t):r,[t,r]);return n.current||=Y.get(e),(0,L.useEffect)(()=>{let e=n.current;return e?.init?.(...a),()=>{e?.dispose?.()}},[a]),n.current};function wB(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function TB(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}var EB=365.2425,DB=6048e5,OB=864e5,kB=43200,AB=1440,jB=3600*24;jB*7,jB*EB/12*3;var MB={};function NB(){return MB}function PB(e,t){let n=NB(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=wB(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function FB(e){return PB(e,{weekStartsOn:1})}function IB(e){let t=wB(e),n=t.getFullYear(),r=TB(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=FB(r),a=TB(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=FB(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function LB(e){let t=wB(e);return t.setHours(0,0,0,0),t}function RB(e){let t=wB(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function zB(e,t){let n=LB(e),r=LB(t),i=+n-RB(n),a=+r-RB(r);return Math.round((i-a)/OB)}function BB(e){let t=IB(e),n=TB(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),FB(n)}function VB(e,t){let n=wB(e),r=wB(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function HB(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function UB(e){if(!HB(e)&&typeof e!=`number`)return!1;let t=wB(e);return!isNaN(Number(t))}function WB(e,t){let n=wB(e),r=wB(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function GB(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function KB(e,t){return wB(e)-+wB(t)}function qB(e){let t=wB(e);return t.setHours(23,59,59,999),t}function JB(e){let t=wB(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function YB(e){let t=wB(e);return+qB(t)==+JB(t)}function XB(e,t){let n=wB(e),r=wB(t),i=VB(n,r),a=Math.abs(WB(n,r)),o;if(a<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let t=VB(n,r)===-i;YB(wB(e))&&a===1&&VB(e,r)===1&&(t=!1),o=i*(a-Number(t))}return o===0?0:o}function ZB(e,t,n){let r=KB(e,t)/1e3;return GB(n?.roundingMethod)(r)}function QB(e){let t=wB(e),n=TB(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}var $B={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},eV=(e,t,n)=>{let r,i=$B[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function tV(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var nV={date:tV({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:tV({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:tV({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},rV={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},iV=(e,t,n,r)=>rV[e];function aV(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var oV={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:aV({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:aV({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:aV({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:aV({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:aV({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function sV(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?lV(s,e=>e.test(o)):cV(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function cV(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lV(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uV(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var dV={code:`en-US`,formatDistance:eV,formatLong:nV,formatRelative:iV,localize:oV,match:{ordinalNumber:uV({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sV({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:sV({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:sV({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:sV({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:sV({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function fV(e){let t=wB(e);return zB(t,QB(t))+1}function pV(e){let t=wB(e),n=FB(t)-+BB(t);return Math.round(n/DB)+1}function mV(e,t){let n=wB(e),r=n.getFullYear(),i=NB(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=TB(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=PB(o,t),c=TB(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=PB(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function hV(e,t){let n=NB(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=mV(e,t),a=TB(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),PB(a,t)}function gV(e,t){let n=wB(e),r=PB(n,t)-+hV(n,t);return Math.round(r/DB)+1}function _V(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var vV={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return _V(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):_V(n+1,2)},d(e,t){return _V(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return _V(e.getHours()%12||12,t.length)},H(e,t){return _V(e.getHours(),t.length)},m(e,t){return _V(e.getMinutes(),t.length)},s(e,t){return _V(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return _V(Math.trunc(r*10**(n-3)),t.length)}},yV={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},bV={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return vV.y(e,t)},Y:function(e,t,n,r){let i=mV(e,r),a=i>0?i:1-i;return t===`YY`?_V(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):_V(a,t.length)},R:function(e,t){return _V(IB(e),t.length)},u:function(e,t){return _V(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return _V(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return _V(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return vV.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return _V(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=gV(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):_V(i,t.length)},I:function(e,t,n){let r=pV(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):_V(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):vV.d(e,t)},D:function(e,t,n){let r=fV(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):_V(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return _V(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return _V(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return _V(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?yV.noon:r===0?yV.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?yV.evening:r>=12?yV.afternoon:r>=4?yV.morning:yV.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return vV.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):vV.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):_V(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):_V(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):vV.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):vV.s(e,t)},S:function(e,t){return vV.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return SV(r);case`XXXX`:case`XX`:return CV(r);default:return CV(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return SV(r);case`xxxx`:case`xx`:return CV(r);default:return CV(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+xV(r,`:`);default:return`GMT`+CV(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+xV(r,`:`);default:return`GMT`+CV(r,`:`)}},t:function(e,t,n){return _V(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return _V(e.getTime(),t.length)}};function xV(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+_V(a,2)}function SV(e,t){return e%60==0?(e>0?`-`:`+`)+_V(Math.abs(e)/60,2):CV(e,t)}function CV(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=_V(Math.trunc(r/60),2),a=_V(r%60,2);return n+i+t+a}var wV=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},TV=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},EV={p:TV,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return wV(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,wV(r,t)).replace(`{{time}}`,TV(i,t))}},DV=/^D+$/,OV=/^Y+$/,kV=[`D`,`DD`,`YY`,`YYYY`];function AV(e){return DV.test(e)}function jV(e){return OV.test(e)}function MV(e,t,n){let r=NV(e,t,n);if(console.warn(r),kV.includes(e))throw RangeError(r)}function NV(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var PV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IV=/^'([^]*?)'?$/,LV=/''/g,RV=/[a-zA-Z]/;function zV(e,t,n){let r=NB(),i=n?.locale??r.locale??dV,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=wB(e);if(!UB(s))throw RangeError(`Invalid time value`);let c=t.match(FV).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=EV[t];return n(e,i.formatLong)}return e}).join(``).match(PV).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:BV(e)};if(bV[t])return{isToken:!0,value:e};if(t.match(RV))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&jV(a)||!n?.useAdditionalDayOfYearTokens&&AV(a))&&MV(a,t,String(e));let o=bV[a[0]];return o(s,a,i.localize,l)}).join(``)}function BV(e){let t=e.match(IV);return t?t[1].replace(LV,`'`):e}function VV(e,t,n){let r=NB(),i=n?.locale??r.locale??dV,a=VB(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),s,c;a>0?(s=wB(t),c=wB(e)):(s=wB(e),c=wB(t));let l=ZB(c,s),u=(RB(c)-RB(s))/1e3,d=Math.round((l-u)/60),f;if(d<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):d===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,d,o);if(d<45)return i.formatDistance(`xMinutes`,d,o);if(d<90)return i.formatDistance(`aboutXHours`,1,o);if(d<1440){let e=Math.round(d/60);return i.formatDistance(`aboutXHours`,e,o)}else if(d<2520)return i.formatDistance(`xDays`,1,o);else if(d<43200){let e=Math.round(d/AB);return i.formatDistance(`xDays`,e,o)}else if(d<43200*2)return f=Math.round(d/kB),i.formatDistance(`aboutXMonths`,f,o);if(f=XB(c,s),f<12){let e=Math.round(d/kB);return i.formatDistance(`xMonths`,e,o)}else{let e=f%12,t=Math.trunc(f/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function HV(e,t){return VV(e,Date.now(),t)}function UV(e,t=`dd.MM.yyyy, HH:mm`,n){if(!e)return``;let r=new Date(e);return Number.isNaN(r.getTime())?(console.warn(`Invalid date:`,e),``):zV(r,t,{locale:n})}var WV=()=>globalThis.location.origin,GV=e=>navigator.clipboard.writeText(e),Y=new class{registrations=new Map;register(e,t,n){this.registrations.set(e,{factory:t,scope:n.scope})}get(e){let t=this.registrations.get(e);if(!t)throw Error(`No provider found for ${e.name}`);return t.scope===`singleton`?(t.instance??=t.factory(),t.instance):t.factory()}},KV=class extends Error{constructor(){super(`Aborted`),this.name=`AbortError`}},X=class e{_data=null;_error=null;_isLoading=!1;_isLoaded=!1;_abortController=null;static of(t,n){return new e(t,n)}constructor(e,t){this.fetchFunction=e,this.options=t,f(this)}get data(){return this._data}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get error(){return this._error}get errorMessage(){return this._error?.response.errors?.[0].message}abort(){this._abortController?.abort(),this._abortController=null}setDataDirectly(e){this._data=e,this._isLoaded=!0}async fetch(...e){this.abort(),this._abortController=new AbortController;let t=this._abortController.signal;this.options?.skipResetting||this.reset();try{this.setIsLoading(!0);let n=await this.fetchFunction(...e);return t.aborted?{isRight:!1,error:new KV}:(this.setData(n),{isRight:!0,data:n})}catch(e){return t.aborted?{isRight:!1,error:new KV}:(console.error(e),this.setError(e),{isRight:!1,error:e})}finally{this.setIsLoading(!1),this.setIsLoaded(!0)}}reset(){this.setIsLoading(!1),this.setData(null),this.setError(null)}setData(e){this._data=e}setIsLoading(e){this._isLoading=e}setIsLoaded(e){this._isLoaded=e}setError(e){this._error=e}};function qV(e){return!e.isRight&&e.error instanceof KV}var JV=class{values;constructor(e){this.values=e,f(this,{},{autoBind:!0})}setValue(e,t){this.values[e]=t}get isValid(){return Object.values(this.values).every(Boolean)}},YV=e=>{if(e&&e.startsWith(`/`)&&!e.startsWith(`//`))return e},XV=e=>{if(!e)return null;try{let t=JSON.parse(e)?.redirect;return typeof t==`string`?t:null}catch{return null}},ZV=e=>{if(e)return JSON.stringify({redirect:e})},QV=()=>YV(new URLSearchParams(globalThis.location.search).get(`redirect`)),$V=e=>{let t=YV(e);return!t||t===`/`?``:`?redirect=${encodeURIComponent(t)}`},eH=function(e){return e.Loading=`loading`,e.Empty=`empty`,e.List=`list`,e.NotFound=`notFound`,e.Error=`error`,e}({}),tH=class{_state=eH.Loading;_items=[];_hasNextPage=!1;_endCursor=null;_totalCount=0;_isInitialLoad=!0;constructor(){f(this,{},{autoBind:!0})}get state(){return this._state}get items(){return this._items}get hasNextPage(){return this._hasNextPage}get endCursor(){return this._endCursor}get totalCount(){return this._totalCount}get isInitialLoad(){return this._isInitialLoad}get showLoading(){return this._state===eH.Loading&&this._isInitialLoad}get showEmpty(){return this._state===eH.Empty}get showNotFound(){return this._state===eH.NotFound}get showList(){return this._state===eH.List}get showError(){return this._state===eH.Error}setLoading(){this._state=eH.Loading}setError(){this._isInitialLoad=!1,this._state=eH.Error}setItems(e,t){this._isInitialLoad=!1,this._items=e,this._hasNextPage=t.hasNextPage,this._endCursor=t.endCursor,this._totalCount=t.totalCount,e.length>0?this._state=eH.List:t.isSearching?this._state=eH.NotFound:this._state=eH.Empty}appendItems(e,t){this._items=[...this._items,...e],this._hasNextPage=t.hasNextPage,this._endCursor=t.endCursor}removeItem(e){let t=this._items.length;this._items=this._items.filter(t=>!e(t));let n=t-this._items.length;this._totalCount=Math.max(0,this._totalCount-n)}updateStateAfterRemove(e){this._items.length===0&&(this._state=e?eH.NotFound:eH.Empty)}reset(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._isInitialLoad=!1,this._state=eH.Loading}resetToLoading(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._totalCount=0,this._isInitialLoad=!0,this._state=eH.Loading}},nH=class{cachedItemViewModels=u.map();constructor(e){this.dataSource=e,h(this,{cachedItemViewModels:u,showLoading:a,showEmpty:a,showList:a,showError:a,items:a,totalCount:a,hasNextPage:a,init:m,dispose:m,tryToFetchNextPage:m,getOrCreateItemViewModel:!1})}get showLoading(){return this.dataSource.state===eH.Loading&&this.dataSource.isInitialLoad}get showEmpty(){return this.dataSource.state===eH.Empty}get showList(){return this.dataSource.state===eH.List}get showError(){return this.dataSource.state===eH.Error}get items(){return this.dataSource.items.map(e=>this.getOrCreateItemViewModel(e))}get totalCount(){return this.dataSource.totalCount}get hasNextPage(){return this.dataSource.hasNextPage}init(){this.dataSource.load()}dispose(){this.dataSource.dispose(),this.cachedItemViewModels.clear()}async tryToFetchNextPage(){await this.dataSource.loadNextPage()}getOrCreateItemViewModel(e){let t=this.getItemKey(e),n=this.cachedItemViewModels.get(t);return n||(n=this.createItemViewModel(e),this.cachedItemViewModels.set(t,n)),n}},rH=class{listState=new tH;request;config;constructor(e,t={}){this.request=X.of(e,{skipResetting:!0}),this.config={pageSize:t.pageSize??50},h(this,{items:a,hasNextPage:a,totalCount:a,isLoading:a,isInitialLoad:a,state:a,load:m,loadNextPage:m,reset:m,dispose:m},{autoBind:!0})}get items(){return this.listState.items}get hasNextPage(){return this.listState.hasNextPage}get totalCount(){return this.listState.totalCount}get isLoading(){return this.request.isLoading}get isInitialLoad(){return this.listState.isInitialLoad}get state(){return this.listState.state}async load(e){this.listState.setLoading();let t=await this.request.fetch(this.buildFetchArgs(e));if(!t.isRight){if(qV(t))return;c(()=>{this.listState.setError()});return}c(()=>{let e=this.extractItems(t.data),n=this.extractPageInfo(t.data);this.listState.setItems(e,n)})}async loadNextPage(){if(!this.hasNextPage||this.isLoading)return!1;let e=await this.request.fetch(this.buildFetchArgs(void 0,this.listState.endCursor||void 0));return e.isRight?(c(()=>{let t=this.extractItems(e.data),n=this.extractPageInfo(e.data);this.listState.appendItems(t,{hasNextPage:n.hasNextPage,endCursor:n.endCursor})}),!0):!1}reset(){this.listState.reset(),this.request.abort()}dispose(){this.request.abort()}},iH=class{id=ds();pendingRequestInternal=null;resolverInternal=null;constructor(){h(this,{pendingRequestInternal:u,hasPendingRequest:a,pendingRequest:a,setPendingRequest:m,clearPendingRequest:m})}setResolver(e){this.resolverInternal=e}resolve(e){this.resolverInternal?.(e)}get hasPendingRequest(){return this.pendingRequestInternal!==null}get pendingRequest(){return this.pendingRequestInternal}setPendingRequest(e){this.pendingRequestInternal=e}clearPendingRequest(){this.pendingRequestInternal=null}init(){}dispose(){}};function aH(e,t,n){return{payload:e,resolve:t,reject:n}}var oH=class{stack=[];constructor(){h(this,{stack:u,initStack:m.bound,pushRequest:m.bound,resolveToParent:m.bound,rejectRequest:m.bound,cancelFromItem:m.bound,dispose:m.bound})}initStack(e){this.stack=[e],this.setupItemResolver(e)}pushRequest(e,t,n,r){let i=aH(t,n,r);e.setPendingRequest(i);let a=this.createItemForRequest(i);this.addItem(a)}resolveToParent(e,t){let n=this.stack.indexOf(e);if(n===-1)return;let r=this.stack[n-1];r?.pendingRequest&&(r.pendingRequest.resolve(t),r.clearPendingRequest()),this.stack.splice(n).forEach(e=>e.dispose())}rejectRequest(e){let t=this.stack.indexOf(e);t!==-1&&this.stack.splice(t+1).forEach(e=>e.dispose());let n=t-1;if(n>=0){let e=this.stack[n];e.pendingRequest&&(e.pendingRequest.reject(),e.clearPendingRequest())}}cancelFromItem(e){let t=this.stack.indexOf(e);t!==-1&&(this.stack.splice(t+1).forEach(e=>e.dispose()),e.pendingRequest&&(e.pendingRequest.reject(),e.clearPendingRequest()))}dispose(){this.stack.forEach(e=>e.dispose()),this.stack=[]}addItem(e){this.setupItemResolver(e),this.stack.push(e)}setupItemResolver(e){e.setResolver(t=>this.handleItemResult(e,t))}},sH=class{_isFullscreen=!1;_isInitialized=!1;_containerRef=null;constructor(){h(this,{_isFullscreen:u,_containerRef:u,setContainerRef:m.bound,toggleFullscreen:m.bound,init:m.bound,dispose:m.bound,handleFullscreenChange:m.bound})}get isFullscreen(){return this._isFullscreen}setContainerRef(e){this._containerRef=e}toggleFullscreen(){this._isFullscreen?this.exitFullscreen():this.enterFullscreen()}init(){this._isInitialized||(this._isInitialized=!0,document.addEventListener(`fullscreenchange`,this.handleFullscreenChange))}dispose(){this._isInitialized&&(this._isInitialized=!1,document.removeEventListener(`fullscreenchange`,this.handleFullscreenChange),this._containerRef=null,this._isFullscreen=!1)}async enterFullscreen(){if(this._containerRef)try{await this._containerRef.requestFullscreen()}catch(e){console.error(e)}}async exitFullscreen(){try{await document.exitFullscreen()}catch(e){console.error(e)}}handleFullscreenChange(){this._isFullscreen=document.fullscreenElement===this._containerRef}},cH=class{_timer=null;constructor(e){this.delayMs=e}schedule(e){this.cancel(),this._timer=setTimeout(e,this.delayMs)}cancel(){this._timer&&=(clearTimeout(this._timer),null)}dispose(){this.cancel()}},lH=class{constructor(e,t){this.operator=e,this.value=t,Object.defineProperty(this,`t`,{writable:!0})}get notes(){return this.t}addNote(e){this.t=this.t||[],this.t.push(e)}},uH=class extends lH{},dH=class extends uH{constructor(e,t){if(!Array.isArray(t))throw Error(`"${e}" operator expects to receive an array of conditions`);super(e,t)}},fH=`__itself__`,pH=class extends lH{constructor(e,t,n){super(e,n),this.field=t}},mH=new uH(`__null__`,null),hH=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function gH(e,t){return t instanceof dH&&t.operator===e}function _H(e,t){return t.length===1?t[0]:new dH(e,function e(t,n,r){let i=r||[];for(let r=0,a=n.length;r<a;r++){let a=n[r];gH(t,a)?e(t,a.value,i):i.push(a)}return i}(e,t))}var vH=e=>e,yH=()=>Object.create(null),bH=Object.defineProperty(yH(),`__@type@__`,{value:`ignore value`});function xH(e,t,n=!1){if(!e||e&&e.constructor!==Object)return!1;for(let r in e)if(hH(e,r)&&hH(t,r)&&(!n||e[r]!==bH))return!0;return!1}function SH(e){let t=[];for(let n in e)hH(e,n)&&e[n]!==bH&&t.push(n);return t}function CH(e,t){t!==mH&&e.push(t)}var wH=e=>_H(`and`,e),TH={compound(e,t,n){let r=(Array.isArray(t)?t:[t]).map(e=>n.parse(e));return new dH(e.name,r)},field:(e,t,n)=>new pH(e.name,n.field,t),document:(e,t)=>new uH(e.name,t)},EH=class{constructor(e,t=yH()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:t.operatorToConditionName||vH,defaultOperatorName:t.defaultOperatorName||`eq`,mergeFinalConditions:t.mergeFinalConditions||wH},this.o=Object.keys(e).reduce((t,n)=>(t[n]=Object.assign({name:this.u.operatorToConditionName(n)},e[n]),t),{}),this.s=Object.assign({},t.fieldContext,{field:``,query:{},parse:this.parse,hasOperators:e=>xH(e,this.o,t.useIgnoreValue)}),this.i=Object.assign({},t.documentContext,{parse:this.parse,query:{}}),this.h=t.useIgnoreValue?SH:Object.keys}setParse(e){this.parse=e,this.s.parse=e,this.i.parse=e}parseField(e,t,n,r){let i=this.o[t];if(!i)throw Error(`Unsupported operator "${t}"`);if(i.type!==`field`)throw Error(`Unexpected ${i.type} operator "${t}" at field level`);return this.s.field=e,this.s.query=r,this.parseInstruction(i,n,this.s)}parseInstruction(e,t,n){return typeof e.validate==`function`&&e.validate(e,t),(e.parse||TH[e.type])(e,t,n)}parseFieldOperators(e,t){let n=[],r=this.h(t);for(let i=0,a=r.length;i<a;i++){let a=r[i];if(!this.o[a])throw Error(`Field query for "${e}" may contain only operators or a plain object as a value`);CH(n,this.parseField(e,a,t[a],t))}return n}parse(e){let t=[],n=this.h(e);this.i.query=e;for(let r=0,i=n.length;r<i;r++){let i=n[r],a=e[i],o=this.o[i];if(o){if(o.type!==`document`&&o.type!==`compound`)throw Error(`Cannot use parsing instruction for operator "${i}" in "document" context as it is supposed to be used in "${o.type}" context`);CH(t,this.parseInstruction(o,a,this.i))}else this.s.hasOperators(a)?t.push(...this.parseFieldOperators(i,a)):CH(t,this.parseField(i,this.u.defaultOperatorName,a,e))}return this.u.mergeFinalConditions(t)}};function DH(e,t){let n=e[t];if(typeof n!=`function`)throw Error(`Unable to interpret "${t}" condition. Did you forget to register interpreter for it?`);return n}function OH(e){return e.operator}function kH(e,t){let n=t,r=n&&n.getInterpreterName||OH,i;switch(n?n.numberOfArguments:0){case 1:i=t=>DH(e,r(t,n))(t,a);break;case 3:i=(t,i,o)=>DH(e,r(t,n))(t,i,o,a);break;default:i=(t,i)=>DH(e,r(t,n))(t,i,a)}let a=Object.assign({},n,{interpret:i});return a.interpret}function AH(e,t){return(n,...r)=>{let i=e(n,...r),a=t.bind(null,i);return a.ast=i,a}}EH.prototype.parseInstruction;function jH(e,t){if(!Array.isArray(t))throw Error(`"${e.name}" expects value to be an array`)}function MH(e,t){if(jH(e,t),!t.length)throw Error(`"${e.name}" expects to have at least one element in array`)}var NH=e=>(t,n)=>{if(typeof n!==e)throw Error(`"${t.name}" expects value to be a "${e}"`)},PH={type:`compound`,validate:MH,parse(e,t,{parse:n}){let r=t.map(e=>n(e));return _H(e.name,r)}},FH=PH,IH={type:`compound`,validate:MH},LH={type:`field`,validate(e,t){if(!(t&&(t instanceof RegExp||t.constructor===Object)))throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`)},parse(e,t,n){let r=t instanceof RegExp?new pH(`regex`,n.field,t):n.parse(t,n);return new dH(e.name,[r])}},RH={type:`field`,validate(e,t){if(!t||t.constructor!==Object)throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`)},parse(e,t,{parse:n,field:r,hasOperators:i}){let a=i(t)?n(t,{field:fH}):n(t);return new pH(e.name,r,a)}},zH={type:`field`,validate:NH(`number`)},BH={type:`field`,validate:jH},VH=BH,HH=BH,UH={type:`field`,validate(e,t){if(!Array.isArray(t)||t.length!==2)throw Error(`"${e.name}" expects an array with 2 numeric elements`)}},WH={type:`field`,validate:NH(`boolean`)},GH={type:`field`,validate:function(e,t){if(!(typeof t==`string`||typeof t==`number`||t instanceof Date))throw Error(`"${e.name}" expects value to be comparable (i.e., string, number or date)`)}},KH=GH,qH=KH,JH=KH,YH={type:`field`},XH=YH,ZH={type:`field`,validate(e,t){if(!(t instanceof RegExp)&&typeof t!=`string`)throw Error(`"${e.name}" expects value to be a regular expression or a string that represents regular expression`)},parse(e,t,n){let r=typeof t==`string`?new RegExp(t,n.query.$options||``):t;return new pH(e.name,n.field,r)}},QH={type:`field`,parse:()=>mH},$H={type:`document`,validate:NH(`function`)},eU=Object.freeze({__proto__:null,$and:PH,$or:FH,$nor:IH,$not:LH,$elemMatch:RH,$size:zH,$in:BH,$nin:VH,$all:HH,$mod:UH,$exists:WH,$gte:GH,$gt:KH,$lt:qH,$lte:JH,$eq:YH,$ne:XH,$regex:ZH,$options:QH,$where:$H}),tU=class extends EH{constructor(e){super(e,{defaultOperatorName:`$eq`,operatorToConditionName:e=>e.slice(1)})}parse(e,t){return t&&t.field?wH(this.parseFieldOperators(t.field,e)):super.parse(e)}},nU=eU;function rU(e,t,n){for(let r=0,i=e.length;r<i;r++)if(n(e[r],t)===0)return!0;return!1}function iU(e,t){return Array.isArray(e)&&Number.isNaN(Number(t))}function aU(e,t,n){if(!iU(e,t))return n(e,t);let r=[];for(let i=0;i<e.length;i++){let a=n(e[i],t);a!==void 0&&(r=r.concat(a))}return r}function oU(e){return(t,n,r)=>{let i=r.get(n,t.field);return Array.isArray(i)?i.some(n=>e(t,n,r)):e(t,i,r)}}var sU=(e,t)=>e[t];function cU(e,t,n){let r=t.lastIndexOf(`.`);return r===-1?[e,t]:[n(e,t.slice(0,r)),t.slice(r+1)]}function lU(e,t,n=sU){if(t===`__itself__`)return e;if(!e)throw Error(`Unable to get field "${t}" out of ${String(e)}.`);return function(e,t,n){if(t.indexOf(`.`)===-1)return aU(e,t,n);let r=t.split(`.`),i=e;for(let e=0,t=r.length;e<t;e++)if(i=aU(i,r[e],n),!i||typeof i!=`object`)return i;return i}(e,t,n)}function uU(e,t){return e===t?0:e>t?1:-1}function dU(e,t={}){return kH(e,Object.assign({get:lU,compare:uU},t))}var fU=(e,t,{interpret:n})=>e.value.some(e=>n(e,t)),pU=(e,t,n)=>!fU(e,t,n),mU=(e,t,{interpret:n})=>e.value.every(e=>n(e,t)),hU=(e,t,{interpret:n})=>!n(e.value[0],t),gU=(e,t,{compare:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&!Array.isArray(e.value)?rU(i,e.value,n):n(i,e.value)===0},_U=(e,t,n)=>!gU(e,t,n),vU=oU((e,t,n)=>{let r=n.compare(t,e.value);return r===0||r===-1}),yU=oU((e,t,n)=>n.compare(t,e.value)===-1),bU=oU((e,t,n)=>n.compare(t,e.value)===1),xU=oU((e,t,n)=>{let r=n.compare(t,e.value);return r===0||r===1}),SU=(e,t,{get:n})=>{if(e.field===`__itself__`)return t!==void 0;let[r,i]=cU(t,e.field,n),a=t=>t==null?!!t===e.value:t.hasOwnProperty(i)===e.value;return iU(r,i)?r.some(a):a(r)},CU=oU((e,t)=>typeof t==`number`&&t%e.value[0]===e.value[1]),wU=(e,t,{get:n})=>{let[r,i]=cU(t,e.field,n),a=t=>{let r=n(t,i);return Array.isArray(r)&&r.length===e.value};return e.field!==`__itself__`&&iU(r,i)?r.some(a):a(r)},TU=oU((e,t)=>typeof t==`string`&&e.value.test(t)),EU=oU((e,t,{compare:n})=>rU(e.value,t,n)),DU=(e,t,n)=>!EU(e,t,n),OU=(e,t,{compare:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&e.value.every(e=>rU(i,e,n))},kU=(e,t,{interpret:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&i.some(t=>n(e.value,t))},AU=Object.freeze({__proto__:null,or:fU,nor:pU,and:mU,not:hU,eq:gU,ne:_U,lte:vU,lt:yU,gt:bU,gte:xU,exists:SU,mod:CU,size:wU,regex:TU,within:EU,nin:DU,all:OU,elemMatch:kU,where:(e,t)=>e.value.call(t)}),jU=Object.assign({},AU,{in:EU});dU(jU);function MU(e){return typeof e!=`object`||!e?e:e instanceof Date?e.getTime():e&&typeof e.toJSON==`function`?e.toJSON():e}var NU=(e,t)=>uU(MU(e),MU(t));function PU(e,t,n){let r=new tU(e),i=dU(t,Object.assign({compare:NU},n));if(n&&n.forPrimitives){let e={field:fH},t=r.parse;r.setParse(n=>t(n,e))}return AH(r.parse,i)}PU(nU,jU),PU([`$and`,`$or`].reduce((e,t)=>(e[t]=Object.assign({},e[t],{type:`field`}),e),Object.assign({},nU,{$nor:Object.assign({},nU.$nor,{type:`field`,parse:TH.compound})})),jU,{forPrimitives:!0});var FU=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t));function IU(e){return Array.isArray(e)?e:[e]}var LU=`__caslSubjectType__`;function RU(e,t){if(t){if(!FU(t,LU))Object.defineProperty(t,LU,{value:e});else if(e!==t[LU])throw Error(`Trying to cast object to subject type ${e} but previously it was casted to ${t[LU]}`)}return t}var zU=e=>{let t=typeof e;return t===`string`||t===`function`},BU=e=>e.modelName||e.name;function VU(e){return typeof e==`string`?e:BU(e)}function HU(e){return FU(e,LU)?e[LU]:BU(e.constructor)}var UU={function:e=>e.constructor,string:HU};function WU(e,t,n){for(let r=n;r<t.length;r++)e.push(t[r])}function GU(e,t){if(!e||!e.length)return t||[];if(!t||!t.length)return e||[];let n=0,r=0,i=[];for(;n<e.length&&r<t.length;)e[n].priority<t[r].priority?(i.push(e[n]),n++):(i.push(t[r]),r++);return WU(i,e,n),WU(i,t,r),i}function KU(e,t,n){let r=e.get(t);return r||(r=n(),e.set(t,r)),r}var qU=e=>e;function JU(e,t){if(Array.isArray(e.fields)&&!e.fields.length)throw Error("`rawRule.fields` cannot be an empty array. https://bit.ly/390miLa");if(e.fields&&!t.fieldMatcher)throw Error(`You need to pass "fieldMatcher" option in order to restrict access by fields`);if(e.conditions&&!t.conditionsMatcher)throw Error(`You need to pass "conditionsMatcher" option in order to restrict access by conditions`)}var YU=class{constructor(e,t,n=0){JU(e,t),this.action=t.resolveAction(e.action),this.subject=e.subject,this.inverted=!!e.inverted,this.conditions=e.conditions,this.reason=e.reason,this.origin=e,this.fields=e.fields?IU(e.fields):void 0,this.priority=n,this.t=t}i(){return this.conditions&&!this.o&&(this.o=this.t.conditionsMatcher(this.conditions)),this.o}get ast(){let e=this.i();return e?e.ast:void 0}matchesConditions(e){return this.conditions?!e||zU(e)?!this.inverted:this.i()(e):!0}matchesField(e){return this.fields?e?(this.u||=this.t.fieldMatcher(this.fields),this.u(e)):!this.inverted:!0}};function XU(e,t){let n={value:e,prev:t,next:null};return t&&(t.next=n),n}function ZU(e){e.next&&(e.next.prev=e.prev),e.prev&&(e.prev.next=e.next),e.next=e.prev=null}var QU=e=>({value:e.value,prev:e.prev,next:e.next}),$U=()=>({rules:[],merged:!1}),eW=()=>new Map,tW=class{constructor(e=[],t={}){this.h=!1,this.l=new Map,this.p={conditionsMatcher:t.conditionsMatcher,fieldMatcher:t.fieldMatcher,resolveAction:t.resolveAction||qU},this.$=t.anyAction||`manage`,this.A=t.anySubjectType||`all`,this.m=e,this.M=!!t.detectSubjectType,this.j=t.detectSubjectType||HU,this.v(e)}get rules(){return this.m}detectSubjectType(e){return zU(e)?e:e?this.j(e):this.A}update(e){let t={rules:e,ability:this,target:this};return this._(`update`,t),this.m=e,this.v(e),this._(`updated`,t),this}v(e){let t=new Map,n;for(let r=e.length-1;r>=0;r--){let i=e.length-r-1,a=new YU(e[r],this.p,i),o=IU(a.action),s=IU(a.subject||this.A);!this.h&&a.fields&&(this.h=!0);for(let e=0;e<s.length;e++){let r=KU(t,s[e],eW);n===void 0&&(n=typeof s[e]),typeof s[e]!==n&&n!==`mixed`&&(n=`mixed`);for(let e=0;e<o.length;e++)KU(r,o[e],$U).rules.push(a)}}this.l=t,n!==`mixed`&&!this.M&&(this.j=UU[n]||UU.string)}possibleRulesFor(e,t=this.A){if(!zU(t))throw Error(`"possibleRulesFor" accepts only subject types (i.e., string or class) as the 2nd parameter`);let n=KU(this.l,t,eW),r=KU(n,e,$U);if(r.merged)return r.rules;let i=e!==this.$&&n.has(this.$)?n.get(this.$).rules:void 0,a=GU(r.rules,i);return t!==this.A&&(a=GU(a,this.possibleRulesFor(e,this.A))),r.rules=a,r.merged=!0,a}rulesFor(e,t,n){let r=this.possibleRulesFor(e,t);if(n&&typeof n!=`string`)throw Error("The 3rd, `field` parameter is expected to be a string. See https://stalniy.github.io/casl/en/api/casl-ability#can-of-pure-ability for details");return this.h?r.filter(e=>e.matchesField(n)):r}actionsFor(e){if(!zU(e))throw Error(`"actionsFor" accepts only subject types (i.e., string or class) as a parameter`);let t=new Set,n=this.l.get(e);n&&Array.from(n.keys()).forEach(e=>t.add(e));let r=e===this.A?void 0:this.l.get(this.A);return r&&Array.from(r.keys()).forEach(e=>t.add(e)),Array.from(t)}on(e,t){this.F=this.F||new Map;let n=this.F,r=XU(t,n.get(e)||null);return n.set(e,r),()=>{let t=n.get(e);!r.next&&!r.prev&&t===r?n.delete(e):r===t&&n.set(e,r.prev),ZU(r)}}_(e,t){if(!this.F)return;let n=this.F.get(e)||null;for(;n!==null;){let e=n.prev?QU(n.prev):null;n.value(t),n=e}}},nW=class extends tW{can(e,t,n){let r=this.relevantRuleFor(e,t,n);return!!r&&!r.inverted}relevantRuleFor(e,t,n){let r=this.detectSubjectType(t),i=this.rulesFor(e,r,n);for(let e=0,n=i.length;e<n;e++)if(i[e].matchesConditions(t))return i[e];return null}cannot(e,t,n){return!this.can(e,t,n)}},rW=PU({$eq:YH,$ne:XH,$lt:qH,$lte:JH,$gt:KH,$gte:GH,$in:BH,$nin:VH,$all:HH,$size:zH,$regex:ZH,$options:QH,$elemMatch:RH,$exists:WH},{eq:gU,ne:_U,lt:yU,lte:vU,gt:bU,gte:xU,in:EU,nin:DU,all:OU,size:wU,regex:TU,elemMatch:kU,exists:SU,and:mU}),iW=/[-/\\^$+?.()|[\]{}]/g,aW=/\.?\*+\.?/g,oW=/\*+/,sW=/\./g;function cW(e,t,n){let r=n[0]===`*`||e[0]===`.`&&e[e.length-1]===`.`?`+`:`*`,i=e.indexOf(`**`)===-1?`[^.]`:`.`,a=e.replace(sW,`\\$&`).replace(oW,i+r);return t+e.length===n.length?`(?:${a})?`:a}function lW(e,t,n){return e===`.`&&(n[t-1]===`*`||n[t+1]===`*`)?e:`\\${e}`}function uW(e){let t=e.map(e=>e.replace(iW,lW).replace(aW,cW)),n=t.length>1?`(?:${t.join(`|`)})`:t[0];return RegExp(`^${n}$`)}var dW=e=>{let t;return n=>(t===void 0&&(t=e.every(e=>e.indexOf(`*`)===-1)?null:uW(e)),t===null?e.indexOf(n)!==-1:t.test(n))};function fW(e=[],t={}){return new nW(e,Object.assign({conditionsMatcher:rW,fieldMatcher:dW},t))}var pW=e=>`Cannot execute "${e.action}" on "${e.subjectType}"`,mW=function(e){this.message=e};mW.prototype=Object.create(Error.prototype);var hW=class extends mW{static setDefaultMessage(e){this.P=typeof e==`string`?()=>e:e}static from(e){return new this(e)}constructor(e){super(``),this.ability=e,typeof Error.captureStackTrace==`function`&&(this.name=`ForbiddenError`,Error.captureStackTrace(this,this.constructor))}setMessage(e){return this.message=e,this}throwUnlessCan(e,t,n){let r=this.unlessCan(e,t,n);if(r)throw r}unlessCan(e,t,n){let r=this.ability.relevantRuleFor(e,t,n);if(r&&!r.inverted)return;this.action=e,this.subject=t,this.subjectType=VU(this.ability.detectSubjectType(t)),this.field=n;let i=r?r.reason:``;return this.message=this.message||i||this.constructor.P(this),this}};hW.P=pW,Object.freeze({__proto__:null});var gW=new Set([`read-project-private`,`read-project-public`]),_W=[`Table`,`Row`,`Branch`,`Revision`,`Endpoint`],vW=class{ability=fW();loadedScopes=new Set;addSystemPermissions(e){let t=this.scopeToKey({type:`system`});if(this.loadedScopes.has(t))return;let n=this.permissionsToRules(e,null),r=this.expandPermissions(e,null);this.ability.update([...this.ability.rules,...n,...r]),this.loadedScopes.add(t)}addOrganizationPermissions(e,t){let n=this.scopeToKey({type:`organization`,organizationId:e});if(this.loadedScopes.has(n))return;let r={organizationId:e},i=this.permissionsToRules(t,r),a=this.expandPermissions(t,r);this.ability.update([...this.ability.rules,...i,...a]),this.loadedScopes.add(n)}addProjectPermissions(e,t){let n=this.scopeToKey({type:`project`,projectId:e});if(this.loadedScopes.has(n))return;let r={projectId:e},i=this.permissionsToRules(t,r),a=this.expandPermissions(t,r);this.ability.update([...this.ability.rules,...i,...a]),this.loadedScopes.add(n)}addPublicReadPermissions(e){let t=`public:${e}`;if(this.loadedScopes.has(t))return;let n={projectId:e},r={action:`read`,subject:`Project`,conditions:{...n,isPublic:!0}},i=_W.map(e=>({action:`read`,subject:e,conditions:{...n}}));this.ability.update([...this.ability.rules,r,...i]),this.loadedScopes.add(t)}can(e,t,n){let r=RU(t,n?{...n}:{});return this.ability.can(e,r)}cannot(e,t,n){return!this.can(e,t,n)}hasScope(e){return this.loadedScopes.has(this.scopeToKey(e))}clearAll(){this.ability.update([]),this.loadedScopes.clear()}scopeToKey(e){switch(e.type){case`system`:return`system`;case`organization`:return`organization:${e.organizationId}`;case`project`:return`project:${e.projectId}`}}permissionsToRules(e,t){return e.map(e=>this.permissionToRule(e,t))}permissionToRule(e,t){let n={action:e.action,subject:e.subject},r=this.mergeConditions(e.condition,t);return r&&(n.conditions=r),n}mergeConditions(e,t){let n=e&&Object.keys(e).length>0,r=t&&Object.keys(t).length>0;if(!(!n&&!r))return n&&r?{...e,...t}:n?{...e}:{...t}}expandPermissions(e,t){let n=[];for(let r of e)if(gW.has(r.id))for(let e of _W){let r={action:`read`,subject:e};t&&Object.keys(t).length>0&&(r.conditions={...t}),n.push(r)}return n}};Y.register(vW,()=>new vW,{scope:`singleton`});var yW=class{constructor(e){this.permissionService=e,f(this,{},{autoBind:!0})}setUserRole(e){if(e?.permissions){let t=e.permissions.map(e=>({id:e.id,action:e.action,subject:e.subject,condition:e.condition??null}));this.permissionService.addSystemPermissions(t)}}clearAll(){this.permissionService.clearAll()}get canCreateProject(){return this.permissionService.can(`create`,`Project`)}get canReadUser(){return this.permissionService.can(`read`,`User`)}get canCreateUser(){return this.permissionService.can(`create`,`User`)}get canAddUser(){return this.permissionService.can(`add`,`User`)}get canUpdateUser(){return this.permissionService.can(`update`,`User`)}get canDeleteUser(){return this.permissionService.can(`delete`,`User`)}get canManageUsers(){return this.canAddUser||this.canReadUser}get canReadOrganization(){return this.permissionService.can(`read`,`Organization`)}get canUpdateOrganization(){return this.permissionService.can(`update`,`Organization`)}get canDeleteOrganization(){return this.permissionService.can(`delete`,`Organization`)}};Y.register(yW,()=>new yW(Y.get(vW)),{scope:`singleton`});var bW=class{_contextProvider=null;constructor(e){this.permissionService=e,f(this,{},{autoBind:!0})}setContextProvider(e){this._contextProvider=e}get context(){return this._contextProvider?.()??{projectId:null,organizationId:null,isPublic:!1,projectRoleName:null}}get projectId(){return this.context.projectId}get organizationId(){return this.context.organizationId}get isPublic(){return this.context.isPublic}get projectRoleName(){return this.context.projectRoleName}getProjectContext(){let e=this.context,t={};return e.projectId&&(t.projectId=e.projectId),e.organizationId&&(t.organizationId=e.organizationId),t}can(e,t,n){let r=n??this.getProjectContext();return this.permissionService.can(e,t,Object.keys(r).length>0?r:void 0)}get canReadProject(){return this.can(`read`,`Project`,{...this.getProjectContext(),isPublic:this.context.isPublic})}get canUpdateProject(){return this.can(`update`,`Project`)}get canDeleteProject(){return this.can(`delete`,`Project`)}get canReadBranch(){return this.can(`read`,`Branch`)}get canCreateBranch(){return this.can(`create`,`Branch`)}get canDeleteBranch(){return this.can(`delete`,`Branch`)}get canReadRevision(){return this.can(`read`,`Revision`)}get canCreateRevision(){return this.can(`create`,`Revision`)}get canRevertRevision(){return this.can(`revert`,`Revision`)}get canReadTable(){return this.can(`read`,`Table`)}get canCreateTable(){return this.can(`create`,`Table`)}get canUpdateTable(){return this.can(`update`,`Table`)}get canDeleteTable(){return this.can(`delete`,`Table`)}get canReadRow(){return this.can(`read`,`Row`)}get canCreateRow(){return this.can(`create`,`Row`)}get canUpdateRow(){return this.can(`update`,`Row`)}get canDeleteRow(){return this.can(`delete`,`Row`)}get canReadEndpoint(){return this.can(`read`,`Endpoint`)}get canCreateEndpoint(){return this.can(`create`,`Endpoint`)}get canDeleteEndpoint(){return this.can(`delete`,`Endpoint`)}get canAddUser(){return this.can(`add`,`User`)}get canUpdateUser(){return this.can(`update`,`User`)}get canDeleteUser(){return this.can(`delete`,`User`)}get canReadUser(){return this.can(`read`,`User`)}get canManageApiKeys(){return this.can(`manage`,`ApiKey`)}get canManageUsers(){return this.canAddUser||this.canReadUser}get canAccessSettings(){return this.canUpdateProject||this.canDeleteProject}get canWrite(){return this.canCreateTable||this.canUpdateTable||this.canDeleteTable||this.canCreateRow||this.canUpdateRow||this.canDeleteRow}get isReadOnly(){return!this.canWrite}};Y.register(bW,()=>new bW(Y.get(vW)),{scope:`singleton`});var xW;n((()=>{xW=function(){return xW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xW.apply(this,arguments)}}))();var SW=new Map,CW=new Map,wW=!0,TW=!1;function EW(e){return e.replace(/[\s,]+/g,` `).trim()}function DW(e){return EW(e.source.body.substring(e.start,e.end))}function OW(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if(e.kind===`FragmentDefinition`){var r=e.name.value,i=DW(e.loc),a=CW.get(r);a&&!a.has(i)?wW&&console.warn(`Warning: fragment with name `+r+` already exists.
|
|
382
|
+
`))}catch{return Promise.resolve()}}async function ZR(e,t,n,r){let i;try{i=await navigator.clipboard.readText()}catch{return}let a=JR(i);for(let[i,o]of a.entries()){let a=n[e+i];if(!a)break;for(let[e,n]of o.entries()){let i=r[t+e];if(!i)break;let o=a.getCellVM(i);o.isEditable&&o.applyPastedText(n)}}}function QR(e,t,n){let r=e.focusedCell;if(!r)return null;let i=t.findIndex(e=>e.field===r.field),a=n.findIndex(e=>e.rowId===r.rowId);return i===-1||a===-1?null:{colIndex:i,rowIndex:a}}function $R(e,t,n){for(let r=e.startRow;r<=e.endRow;r++)for(let i=e.startCol;i<=e.endCol;i++){let e=t[r],a=n[i];e&&a&&e.getCellVM(a).clearToDefault()}}var ez=`#ededed`,tz=`inset 0 -1px 0 0 ${ez}`;function nz(){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,left:`-8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:`var(--shadow-right-opacity, 0)`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}function rz(e,t){return t<=0?e:e===`0px`?`${t}px`:`calc(${e} + ${t}px)`}var iz=40,az=g(({field:e,columnsModel:t})=>{let[n,r]=(0,L.useState)(!1),i=(0,L.useRef)(0),a=(0,L.useRef)(0),o=(0,L.useRef)(0),s=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>{s.current&&s.current()},[]),(0,I.jsx)(A,{role:`separator`,position:`absolute`,right:`-4px`,top:0,bottom:0,width:`8px`,cursor:`col-resize`,zIndex:10,onMouseDown:(0,L.useCallback)(n=>{n.preventDefault(),n.stopPropagation();let c=t.resolveColumnWidth(e);i.current=n.clientX,a.current=c,r(!0),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let l=n=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{let r=n.clientX-i.current,o=Math.max(iz,a.current+r);t.setColumnWidth(e,o)})},u=()=>{cancelAnimationFrame(o.current),t.commitColumnWidth(),r(!1),document.body.style.cursor=``,document.body.style.userSelect=``,document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,d),s.current=null},d=()=>{u()};s.current=u,document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,d)},[e,t]),"data-testid":`resize-${e}`,children:(0,I.jsx)(A,{position:`absolute`,left:`3px`,top:0,bottom:0,width:`2px`,bg:n?`blue.500`:`transparent`,_groupHover:{bg:`blue.500`},transition:`background 0.1s`})})}),oz=g(({field:e,sortModel:t})=>{let n=t.getSortDirection(e),r=t.getSortIndex(e),i=t.sortCount>1;return n?(0,I.jsxs)(j,{alignItems:`center`,gap:`1px`,color:`blue.500`,fontSize:`xs`,flexShrink:0,"data-testid":`sort-indicator-${e}`,children:[n===`asc`?(0,I.jsx)(uk,{size:12}):(0,I.jsx)(ak,{size:12}),i&&r!==null&&(0,I.jsx)(A,{as:`span`,fontSize:`10px`,fontWeight:`medium`,lineHeight:1,children:r})]}):null}),sz=g(({field:e,columnsModel:t})=>t.isPinned(e)?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`pin-indicator-${e}`,children:(0,I.jsx)(Ck,{size:12})}):null),cz=g(({field:e,filterModel:t})=>t.hasFilterForField(e)?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`filter-indicator-${e}`,children:(0,I.jsx)(yk,{size:12})}):null),lz=({column:e})=>e.hasFormula?(0,I.jsx)(j,{alignItems:`center`,color:`gray.400`,flexShrink:0,"data-testid":`formula-indicator-${e.field}`,children:(0,I.jsx)(Yf,{size:12})}):null,uz=g(({field:e,sortModel:t})=>{let n=t.getSortDirection(e),r=t.isSorted(e);return(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:`Sort`}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`160px`,children:[(0,I.jsxs)(gt,{value:`sort-asc`,onClick:()=>{t.setSingleSort(e,`asc`)},color:n===`asc`?`blue.600`:void 0,children:[(0,I.jsx)(ck,{}),(0,I.jsx)(k,{children:`Sort A → Z`})]}),(0,I.jsxs)(gt,{value:`sort-desc`,onClick:()=>{t.setSingleSort(e,`desc`)},color:n===`desc`?`blue.600`:void 0,children:[(0,I.jsx)(ik,{}),(0,I.jsx)(k,{children:`Sort Z → A`})]}),r&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`remove-sort`,onClick:()=>{t.removeSort(e)},children:[(0,I.jsx)(Dk,{}),(0,I.jsx)(k,{children:`Remove sort`})]})]})]})})})]})}),dz=g(({field:e,columnsModel:t})=>{let n=t.canMoveLeft(e),r=t.canMoveRight(e),i=t.canMoveToStart(e),a=t.canMoveToEnd(e);return!n&&!r?null:(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:`Move column`}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`160px`,children:[n&&(0,I.jsxs)(gt,{value:`move-left`,onClick:()=>t.moveColumnLeft(e),children:[(0,I.jsx)(pk,{}),(0,I.jsx)(k,{children:`Move left`})]}),i&&(0,I.jsxs)(gt,{value:`move-to-start`,onClick:()=>t.moveColumnToStart(e),children:[(0,I.jsx)(ok,{}),(0,I.jsx)(k,{children:`Move to start`})]}),r&&(0,I.jsxs)(gt,{value:`move-right`,onClick:()=>t.moveColumnRight(e),children:[(0,I.jsx)(mk,{}),(0,I.jsx)(k,{children:`Move right`})]}),a&&(0,I.jsxs)(gt,{value:`move-to-end`,onClick:()=>t.moveColumnToEnd(e),children:[(0,I.jsx)(sk,{}),(0,I.jsx)(k,{children:`Move to end`})]})]})})})]})}),fz=(0,L.memo)(({field:e,name:t,fieldType:n,valuePrefix:r,onClick:i})=>(0,I.jsx)(gt,{value:r?`${r}-${e}`:e,onClick:()=>i(e),children:(0,I.jsxs)(A,{display:`flex`,alignItems:`center`,gap:2,width:`100%`,children:[(0,I.jsx)(A,{as:`span`,fontSize:`xs`,fontWeight:`medium`,color:`gray.400`,fontFamily:`mono`,minWidth:`20px`,children:sL(n)}),(0,I.jsx)(k,{truncate:!0,children:t||`(unnamed)`})]})})),pz=({group:e,parentVisible:t,valuePrefix:n,onClick:r})=>e.children.length===0&&!t?(0,I.jsx)(fz,{field:e.parent.field,name:e.parent.label,fieldType:e.parent.fieldType,valuePrefix:n,onClick:r}):(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{"data-testid":`file-group-${e.parent.field}`,children:[(0,I.jsxs)(A,{display:`flex`,alignItems:`center`,gap:2,flex:1,children:[(0,I.jsx)(A,{as:`span`,fontSize:`xs`,fontWeight:`medium`,color:`gray.400`,fontFamily:`mono`,minWidth:`20px`,children:sL(e.parent.fieldType)}),(0,I.jsx)(k,{truncate:!0,children:e.parent.label})]}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{maxH:`300px`,minW:`200px`,overflowY:`auto`,children:[!t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(fz,{field:e.parent.field,name:e.parent.label,fieldType:e.parent.fieldType,valuePrefix:n,onClick:r}),(0,I.jsx)(dt,{})]}),e.children.map(e=>(0,I.jsx)(fz,{field:e.field,name:e.label,fieldType:e.fieldType,valuePrefix:n,onClick:r},e.field))]})})})]}),mz=({label:e,valuePrefix:t,availableFields:n,allColumns:r,onSelect:i})=>{if(n.length===0)return null;let a=EI(n,r);return(0,I.jsxs)(en,{positioning:{placement:`right-start`,gutter:2},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(nn,{children:[(0,I.jsx)(k,{flex:1,children:e}),(0,I.jsx)(mk,{})]}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsx)(v,{maxH:`300px`,minW:`200px`,overflowY:`auto`,children:a.map(e=>TI(e)?(0,I.jsx)(pz,{group:e,parentVisible:e.parentVisible,valuePrefix:t,onClick:i},e.parent.field):(0,I.jsx)(fz,{field:e.field,name:e.label,fieldType:e.fieldType,valuePrefix:t,onClick:i},e.field))})})})]})},hz=g(({column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,onClose:a})=>{let o=t.canRemoveColumn,s=t.availableFieldsToInsert,c=s.length>0,l=t.canMoveLeft(e.field)||t.canMoveRight(e.field),u=t.isPinned(e.field),d=t.canPinLeft(e.field),f=t.canPinRight(e.field);return(0,I.jsxs)(v,{minW:`180px`,children:[n&&e.isSortable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uz,{field:e.field,sortModel:n}),(0,I.jsx)(dt,{})]}),r&&e.isSortable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(gt,{value:`add-filter`,onClick:()=>{r&&(r.addConditionForField(e.field),r.setOpen(!0))},children:[(0,I.jsx)(yk,{}),(0,I.jsx)(k,{children:`Add filter`})]}),(0,I.jsx)(dt,{})]}),u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(gt,{value:`unpin`,onClick:()=>{t.unpin(e.field)},children:[(0,I.jsx)(Sk,{}),(0,I.jsx)(k,{children:`Unpin column`})]}),(0,I.jsx)(dt,{})]}):(0,I.jsxs)(I.Fragment,{children:[d&&(0,I.jsxs)(gt,{value:`pin-left`,onClick:()=>{t.pinLeft(e.field)},children:[(0,I.jsx)(Ck,{}),(0,I.jsx)(k,{children:`Pin to left`})]}),f&&(0,I.jsxs)(gt,{value:`pin-right`,onClick:()=>{t.pinRight(e.field)},children:[(0,I.jsx)(Ck,{}),(0,I.jsx)(k,{children:`Pin to right`})]}),(d||f)&&(0,I.jsx)(dt,{})]}),l&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dz,{field:e.field,columnsModel:t}),(0,I.jsx)(dt,{})]}),c&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(mz,{label:`Insert before`,valuePrefix:`before`,availableFields:s,allColumns:t.allColumns,onSelect:n=>{t.insertColumnBefore(e.field,n),a?.()}}),(0,I.jsx)(mz,{label:`Insert after`,valuePrefix:`after`,availableFields:s,allColumns:t.allColumns,onSelect:n=>{t.insertColumnAfter(e.field,n),a?.()}}),(0,I.jsx)(dt,{})]}),(0,I.jsxs)(gt,{value:`hide`,disabled:!o,onClick:()=>{t.hideColumn(e.field)},children:[(0,I.jsx)(dne,{}),(0,I.jsx)(k,{children:`Hide column`})]}),(0,I.jsxs)(gt,{value:`hide-all`,disabled:!o,onClick:t.hideAll,children:[(0,I.jsx)(Qf,{}),(0,I.jsx)(k,{children:`Hide all columns`})]}),(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`copy-path`,onClick:()=>{i?i(e.field):navigator.clipboard.writeText(e.field).catch(()=>{})},children:[(0,I.jsx)(vk,{}),(0,I.jsx)(k,{children:`Copy path`})]})]})});function gz(e){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:e.side===`left`?`var(--shadow-left-opacity, 0)`:`var(--shadow-right-opacity, 0)`,...e.side===`left`?{right:`-8px`,boxShadow:`inset 8px 0 12px -8px rgba(0,0,0,0.1)`}:{left:`-8px`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}}function _z(e){return e?`${tz}, ${e.side===`left`?`inset -1px 0 0 0 ${ez}`:`inset 1px 0 0 0 ${ez}`}`:tz}var vz=g(({column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,stickyPosition:a})=>{let[o,s]=(0,L.useState)(!1),c=t.columnWidthCssVar(e.field),l=!!a;return(0,I.jsxs)(A,{as:`th`,position:l?`sticky`:`relative`,left:a?.side===`left`?a.offsetCss:void 0,right:a?.side===`right`?a.offsetCss:void 0,zIndex:l?2:void 0,width:c,minWidth:c,maxWidth:c,height:`inherit`,bg:`white`,boxShadow:_z(a),textAlign:`left`,fontWeight:`normal`,p:0,css:a?.isBoundary?gz(a):void 0,children:[(0,I.jsxs)(en,{positioning:{placement:`bottom-end`},lazyMount:!0,unmountOnExit:!0,open:o,onOpenChange:e=>s(e.open),children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsxs)(j,{alignItems:`center`,height:`100%`,pl:`8px`,pr:`16px`,gap:`4px`,cursor:`pointer`,transition:`background 0.15s`,overflow:`hidden`,_hover:{bg:`gray.100`},"data-testid":`header-${e.field}`,children:[(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,flexShrink:0,fontSize:`xs`,color:`gray.400`,width:`16px`,children:sL(e.fieldType)}),(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.400`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,overflow:`hidden`,flex:1,minWidth:0,textDecoration:e.isDeprecated?`line-through`:void 0,children:e.label}),(0,I.jsx)(lz,{column:e}),(0,I.jsx)(sz,{field:e.field,columnsModel:t}),r&&e.isSortable&&(0,I.jsx)(cz,{field:e.field,filterModel:r}),n&&e.isSortable&&(0,I.jsx)(oz,{field:e.field,sortModel:n})]})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsx)(hz,{column:e,columnsModel:t,sortModel:n,filterModel:r,onCopyPath:i,onClose:()=>s(!1)})})})]}),(0,I.jsx)(az,{field:e.field,columnsModel:t})]})}),yz=g(({columnsModel:e})=>{let t=e.availableFieldsToAdd,n=e.availableSystemFieldsToAdd;if(!e.hasHiddenColumns)return null;let r=EI(t,e.allColumns);return(0,I.jsx)(j,{alignItems:`center`,px:`4px`,height:`100%`,children:(0,I.jsxs)(en,{positioning:{placement:`bottom-start`},lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsx)(Ze,{"aria-label":`Add column`,size:`xs`,variant:`ghost`,color:`gray.400`,_hover:{bg:`gray.100`,color:`gray.600`},focusRing:`none`,"data-testid":`add-column-button`,children:(0,I.jsx)(ep,{})})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`200px`,maxH:`340px`,overflowY:`auto`,children:[(0,I.jsxs)(gt,{value:`add-all`,onClick:e.addAll,children:[(0,I.jsx)(Qf,{}),(0,I.jsx)(k,{children:`Add all columns`})]}),r.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(tn,{children:[(0,I.jsx)(Ut,{fontWeight:`medium`,color:`gray.500`,fontSize:`xs`,children:`Data fields`}),r.map(t=>TI(t)?(0,I.jsx)(pz,{group:t,parentVisible:t.parentVisible,onClick:e.showColumn},t.parent.field):(0,I.jsx)(fz,{field:t.field,name:t.label,fieldType:t.fieldType,onClick:e.showColumn},t.field))]})]}),n.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dt,{}),(0,I.jsxs)(tn,{children:[(0,I.jsx)(Ut,{fontWeight:`medium`,color:`gray.500`,fontSize:`xs`,children:`System fields`}),n.map(t=>(0,I.jsx)(fz,{field:t.field,name:t.label,fieldType:t.fieldType,onClick:e.showColumn},t.field))]})]})]})})})]})})}),bz=40,xz=40,Sz=g(({columnsModel:e,sortModel:t,filterModel:n,onCopyPath:r,showSelection:i})=>{let a=i?bz:0,o=e.hasHiddenColumns;return(0,I.jsxs)(A,{as:`tr`,height:`40px`,children:[i&&(0,I.jsx)(A,{as:`th`,width:`40px`,minWidth:`40px`,maxWidth:`40px`,bg:`white`,p:0,position:`sticky`,left:0,zIndex:2,boxShadow:tz}),e.visibleColumns.map(i=>(0,I.jsx)(vz,{column:i,columnsModel:e,sortModel:t,filterModel:n,onCopyPath:r,stickyPosition:Cz(i.field,e,a,o)},i.field)),o?(0,I.jsx)(A,{as:`th`,width:`100%`,minWidth:`${xz}px`,bg:`white`,p:0,position:`sticky`,right:0,zIndex:2,boxShadow:tz,css:e.pinnedRightCount===0?nz():void 0,children:(0,I.jsx)(yz,{columnsModel:e})}):(0,I.jsx)(A,{as:`th`,width:`100%`,bg:`white`,p:0,boxShadow:tz})]})});function Cz(e,t,n,r){let i=t.getColumnStickyLeftCss(e,n);if(i!==void 0)return{side:`left`,offsetCss:i,isBoundary:t.isStickyLeftBoundary(e)};let a=t.getColumnStickyRightCss(e);if(a!==void 0)return{side:`right`,offsetCss:rz(a,r?xz:0),isBoundary:t.isStickyRightBoundary(e)}}var wz=({rowId:e,testIdPrefix:t,onSelect:n,onDuplicate:r,onDelete:i})=>(0,I.jsxs)(I.Fragment,{children:[n&&(0,I.jsxs)(gt,{value:`select`,onClick:()=>n(e),"data-testid":`${t}-select-${e}`,children:[(0,I.jsx)(Kf,{}),(0,I.jsx)(k,{children:`Select`})]}),r&&(0,I.jsxs)(gt,{value:`duplicate`,onClick:()=>r(e),"data-testid":`${t}-duplicate-${e}`,children:[(0,I.jsx)(vk,{}),(0,I.jsx)(k,{children:`Duplicate`})]}),i&&(0,I.jsxs)(I.Fragment,{children:[(n||r)&&(0,I.jsx)(dt,{}),(0,I.jsxs)(gt,{value:`delete`,onClick:()=>i(e),"data-testid":`${t}-delete-${e}`,children:[(0,I.jsx)(Ek,{}),(0,I.jsx)(k,{color:`red.600`,children:`Delete`})]})]})]}),Tz=({rowId:e,onOpen:t,onPick:n,onSelect:r,onDuplicate:i,onDelete:a})=>{let[o,s]=(0,L.useState)(!1),c=n??t,l=n?Kf:df,u=n?`row-action-pick-${e}`:`row-action-open-${e}`,d=!!(t||r||i||a);return(0,I.jsx)(j,{position:`absolute`,right:`8px`,top:`50%`,transform:`translateY(-50%)`,alignItems:`center`,className:`row-action-buttons`,"data-menu-open":o||void 0,"data-testid":`row-action-buttons-${e}`,children:(0,I.jsxs)(j,{alignItems:`center`,height:`24px`,borderRadius:`6px`,bg:`white`,boxShadow:`0px 2px 8px rgba(0,0,0,0.16)`,overflow:`hidden`,"data-testid":`row-action-split-${e}`,children:[c&&(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,width:`28px`,minWidth:`28px`,cursor:`pointer`,_hover:{bg:`gray.100`},onClick:t=>{t.stopPropagation(),c(e)},"data-testid":u,children:(0,I.jsx)(Ve,{boxSize:`20px`,color:`gray.400`,as:l})}),d&&(0,I.jsxs)(en,{lazyMount:!0,unmountOnExit:!0,onOpenChange:({open:e})=>s(e),positioning:{placement:`bottom-start`},children:[(0,I.jsx)(Lt,{asChild:!0,children:(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,width:`18px`,minWidth:`18px`,cursor:`pointer`,borderLeft:c?`1px solid`:void 0,borderColor:`gray.100`,_hover:{bg:`gray.100`},onClick:e=>e.stopPropagation(),"data-testid":`row-action-trigger-${e}`,children:(0,I.jsx)(Ve,{as:nf,boxSize:`16px`,color:`gray.300`})})}),(0,I.jsx)(R,{children:(0,I.jsx)(Ot,{children:(0,I.jsxs)(v,{minW:`180px`,"data-testid":`row-action-menu-${e}`,children:[t&&(0,I.jsxs)(gt,{value:`open`,onClick:()=>t(e),"data-testid":`row-action-menu-open-${e}`,children:[(0,I.jsx)(df,{}),(0,I.jsx)(k,{children:`Open`})]}),t&&(r||i||a)&&(0,I.jsx)(dt,{}),(0,I.jsx)(wz,{rowId:e,testIdPrefix:`row-action`,onSelect:r,onDuplicate:i,onDelete:a})]})})})]})]})})},Ez=({rowId:e,isSelected:t,onToggleSelection:n})=>(0,I.jsx)(A,{as:`td`,width:`40px`,minWidth:`40px`,maxWidth:`40px`,p:0,position:`sticky`,left:0,zIndex:1,bg:`white`,boxShadow:`inset 0 -1px 0 0 ${ez}, inset -1px 0 0 0 ${ez}`,children:(0,I.jsx)(j,{alignItems:`center`,justifyContent:`center`,height:`100%`,children:(0,I.jsxs)(Ne,{checked:t,onCheckedChange:()=>n(),size:`sm`,"data-testid":`select-${e}`,children:[(0,I.jsx)($e,{}),(0,I.jsx)(Ye,{})]})})}),Dz=40,Oz=40;function kz(e){return{"&::after":{content:`""`,position:`absolute`,top:0,bottom:0,width:`8px`,pointerEvents:`none`,transition:`opacity 0.15s`,opacity:e===`left`?`var(--shadow-left-opacity, 0)`:`var(--shadow-right-opacity, 0)`,...e===`left`?{right:`-8px`,boxShadow:`inset 8px 0 12px -8px rgba(0,0,0,0.1)`}:{left:`-8px`,boxShadow:`inset -8px 0 12px -8px rgba(0,0,0,0.1)`}}}}function Az(e,t,n,r){let i=r&&n,a=i?{"& .row-action-buttons":{opacity:0},"&:hover .row-action-buttons, & .row-action-buttons[data-menu-open]":{opacity:1,transition:`opacity 0.15s ease`}}:{};if(e)return{...a,...kz(t)};if(i)return a}function jz(e,t,n,r){let i=t.getColumnStickyLeftCss(e.field,n),a=t.getColumnStickyRightCss(e.field),o=i!==void 0,s=a!==void 0,c=o||s,l=t.isStickyLeftBoundary(e.field),u=t.isStickyRightBoundary(e.field),d=s&&a!==void 0?rz(a,r):a;return{isSticky:c,isBoundary:l||u,boundarySide:o?`left`:`right`,leftCss:o?i:void 0,rightCss:s?d:void 0,colWidth:c?t.columnWidthCssVar(e.field):void 0}}function Mz(e,t){return e?`${tz}, ${t===`left`?`inset -1px 0 0 0 ${ez}`:`inset 1px 0 0 0 ${ez}`}`:tz}var Nz=g(({row:e,columnsModel:t,showSelection:n,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a,onOpenRow:o,onPickRow:s,onSelectRow:c,onDuplicateRow:l,onDeleteRow:u})=>{let d=!!(o||s||c||l||u),f=n?Dz:0,p=t.hasHiddenColumns,m=p?Oz:0;return(0,I.jsxs)(I.Fragment,{children:[n&&(0,I.jsx)(Ez,{rowId:e.rowId,isSelected:e.isSelected,onToggleSelection:()=>e.toggleSelection()}),t.visibleColumns.map((n,p)=>{let h=e.getCellVM(n),g=p===0,_=g&&d&&!h.isEditing,v=jz(n,t,f,m);return(0,I.jsxs)(A,{as:`td`,width:v.colWidth,minWidth:v.colWidth,maxWidth:v.isSticky?v.colWidth:`0`,overflow:v.isBoundary?`visible`:`hidden`,borderRight:v.isSticky?void 0:`1px solid`,borderColor:v.isSticky?void 0:ez,p:0,position:v.isSticky?`sticky`:`relative`,left:v.leftCss,right:v.rightCss,zIndex:v.isSticky?1:void 0,bg:v.isSticky?`white`:void 0,boxShadow:Mz(v.isSticky,v.boundarySide),css:Az(v.isBoundary,v.boundarySide,d,g),children:[v.isBoundary?(0,I.jsx)(A,{overflow:`hidden`,children:(0,I.jsx)(UR,{cell:h,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a})}):(0,I.jsx)(UR,{cell:h,onSearchForeignKey:r,onUploadFile:i,onOpenFile:a}),_&&(0,I.jsx)(Tz,{rowId:e.rowId,onOpen:o,onPick:s,onSelect:c,onDuplicate:l,onDelete:u})]},n.field)}),p?(0,I.jsx)(A,{as:`td`,width:`100%`,minWidth:`${Oz}px`,p:0,position:`sticky`,right:0,zIndex:1,bg:`white`,boxShadow:tz,css:t.pinnedRightCount===0?nz():void 0}):(0,I.jsx)(A,{as:`td`,width:`100%`,p:0,boxShadow:tz})]})}),Pz=g(({selection:e,allRowIds:t,onDuplicate:n,onDelete:r})=>{let i=e.isAllSelected(t);return(0,I.jsx)(tee,{open:e.isSelectionMode,children:(0,I.jsx)(R,{children:(0,I.jsx)(vt,{zIndex:5,children:(0,I.jsxs)(pt,{"data-testid":`selection-toolbar`,children:[(0,I.jsxs)(zt,{children:[e.selectedCount,` selected`]}),(0,I.jsx)(wt,{}),!i&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>e.selectAll(t),"data-testid":`select-all`,children:[(0,I.jsx)(Kf,{}),`Select all`]}),n&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>n(e.selectedIds),"data-testid":`duplicate-selected`,children:[(0,I.jsx)(vk,{}),`Duplicate`]}),r&&(0,I.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>r(e.selectedIds),"data-testid":`delete-selected`,children:[(0,I.jsx)(Ek,{}),`Delete`]}),(0,I.jsx)(iee,{asChild:!0,children:(0,I.jsx)(N,{variant:`ghost`,size:`sm`,"aria-label":`Exit selection`,onClick:()=>e.exitSelectionMode(),"data-testid":`exit-selection`,children:(0,I.jsx)(ip,{})})})]})})})})}),Fz=({isOpen:e,onClose:t,onConfirm:n,count:r})=>{let i=(0,L.useRef)(null),a=r&&r>1?`Are you sure you want to delete ${r} rows?`:`Are you sure you want to delete this row?`;return(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>{e||t()},initialFocusEl:()=>i.current,role:`alertdialog`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{maxWidth:`400px`,"data-testid":`delete-confirm-dialog`,children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Delete confirmation`})}),(0,I.jsx)(be,{children:(0,I.jsx)(k,{children:a})}),(0,I.jsx)(w,{children:(0,I.jsxs)(j,{gap:2,children:[(0,I.jsx)(N,{ref:i,variant:`outline`,size:`sm`,onClick:t,"data-testid":`delete-cancel`,children:`Cancel`}),(0,I.jsx)(N,{colorPalette:`red`,size:`sm`,onClick:n,"data-testid":`delete-confirm`,children:`Delete`})]})})]})})]})})},Iz=({style:e,children:t,...n})=>(0,I.jsx)(`table`,{...n,style:{...e,width:`max-content`,minWidth:`100%`,tableLayout:`fixed`,borderCollapse:`separate`,borderSpacing:0},children:t}),Lz=({"data-index":e,context:t,style:n,children:r,...i})=>{let a=t?.rows[e];return(0,I.jsx)(`tr`,{...i,className:`group`,"data-testid":a?`row-${a.rowId}`:void 0,style:{...n,height:`40px`},children:r})},Rz={left:!1,right:!1},zz=class{_left=!1;_right=!1;_paused=!1;_dirty=!1;_onChange=null;get showLeftShadow(){return this._left}get showRightShadow(){return this._right}setOnChange(e){this._onChange=e}pause(){this._paused=!0,this._dirty=!1}resume(){this._paused=!1,this._dirty&&(this._dirty=!1,this._notify())}update(e,t){if(!(this._left===e&&this._right===t)){if(this._left=e,this._right=t,this._paused){this._dirty=!0;return}this._notify()}}reset(){if(!(!this._left&&!this._right)){if(this._left=!1,this._right=!1,this._paused){this._dirty=!0;return}this._notify()}}_notify(){this._onChange&&this._onChange({left:this._left,right:this._right})}};function Bz(e){return e instanceof HTMLElement?e:document.scrollingElement}function Vz(){let e=(0,L.useRef)(null);e.current||=new zz;let t=e.current,[n,r]=(0,L.useState)(Rz);t.setOnChange(r),(0,L.useEffect)(()=>()=>{t.setOnChange(null)},[t]);let i={"--shadow-left-opacity":n.left?`1`:`0`,"--shadow-right-opacity":n.right?`1`:`0`},a=(0,L.useRef)(null),o=(0,L.useRef)(0),s=(0,L.useRef)(null),c=(0,L.useCallback)(()=>{let e=a.current;if(!e)return;let n=Bz(e);if(!n)return;let r=n.scrollLeft,i=n.scrollWidth-n.clientWidth;t.update(r>0,i>1&&r<i-1)},[t]),l=(0,L.useCallback)(()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(c)},[c]),u=(0,L.useCallback)(e=>{let n=a.current;if(n&&n.removeEventListener(`scroll`,l),s.current&&=(s.current.disconnect(),null),e){a.current=e,e.addEventListener(`scroll`,l,{passive:!0}),o.current=requestAnimationFrame(c);let t=Bz(e);if(t){let e=new ResizeObserver(l),n=t.querySelector(`table`);n&&e.observe(n),s.current=e}}else a.current=null,t.reset()},[l,c,t]);return(0,L.useEffect)(()=>()=>{let e=a.current;e&&e.removeEventListener(`scroll`,l),s.current&&s.current.disconnect(),o.current&&cancelAnimationFrame(o.current)},[l]),{shadowCssVars:i,shadowModel:t,setScrollerRef:u}}var Hz={Table:Iz,TableRow:Lz},Uz=g(({rows:e,columnsModel:t,cellFSM:n,selection:r,sortModel:i,filterModel:a,onSearchForeignKey:o,onUploadFile:s,onOpenFile:c,onOpenRow:l,onPickRow:u,onDeleteSelected:d,onDuplicateSelected:f,onDeleteRow:p,onDuplicateRow:m,onCopyPath:h,onEndReached:g,isLoadingMore:_,useWindowScroll:v})=>{let y=r.isSelectionMode,b=e.map(e=>e.rowId),[x,S]=(0,L.useState)(null),{shadowCssVars:C,shadowModel:w,setScrollerRef:T}=Vz(),E=t.isResizing;(0,L.useEffect)(()=>{E?w.pause():w.resume()},[E,w]);let[D,ee]=(0,L.useState)(null),te=(0,L.useCallback)(e=>{ee(e),t.setWrapperElement(e)},[t]);(0,L.useEffect)(()=>{if(!(!v||!D))return T(D),()=>{T(null)}},[v,D,T]);let ne=(0,L.useCallback)(e=>{r.enterSelectionMode(e)},[r]),O=(0,L.useCallback)(e=>{S({rowId:e})},[]),re=(0,L.useCallback)(e=>{S({batchIds:e})},[]),ie=(0,L.useCallback)(()=>{x?.rowId?(r.deselect(x.rowId),p?p(x.rowId):d&&d([x.rowId])):x?.batchIds&&(d?.(x.batchIds),r.exitSelectionMode()),S(null)},[x,p,d,r]),ae=(0,L.useCallback)(()=>{S(null)},[]),oe=x?.batchIds?.length,se=!!(p||d),ce=!!m,le=se||ce||!!f,ue=(0,L.useMemo)(()=>({copyRange:()=>{let r=n?.getSelectedRange(),i=t.visibleColumns;r&&XR(r,e,i)},pasteRange:()=>{if(!n)return;let r=t.visibleColumns,i=n.getSelectedRange(),a=QR(n,r,e);i?ZR(i.startRow,i.startCol,e,r):a&&ZR(a.rowIndex,a.colIndex,e,r)},clearRange:()=>{let r=n?.getSelectedRange(),i=t.visibleColumns;r&&$R(r,e,i)}}),[n,e,t]),de=(0,L.useCallback)(r=>{if(!n)return;let i=r.ctrlKey||r.metaKey,a=t.visibleColumns;if(i&&r.key===`v`&&n.focusedCell){let t=n.getSelectedRange(),i=QR(n,a,e);t?(r.preventDefault(),ZR(t.startRow,t.startCol,e,a)):i&&(r.preventDefault(),ZR(i.rowIndex,i.colIndex,e,a));return}if(n.hasSelection){if(i&&r.key===`c`){let t=n.getSelectedRange();t&&(r.preventDefault(),XR(t,e,a));return}if(r.key===`Delete`||r.key===`Backspace`){let t=n.getSelectedRange();t&&(r.preventDefault(),$R(t,e,a))}}},[n,e,t]),fe=(0,L.useCallback)((e,n)=>(0,I.jsx)(Nz,{row:n,columnsModel:t,showSelection:y,onSearchForeignKey:o,onUploadFile:s,onOpenFile:c,onOpenRow:l,onPickRow:u,onSelectRow:le?ne:void 0,onDuplicateRow:ce?m:void 0,onDeleteRow:se?O:void 0}),[t,y,o,s,c,l,u,le,se,ce,ne,m,O]),pe=(0,L.useCallback)(()=>(0,I.jsx)(Sz,{columnsModel:t,sortModel:i,filterModel:a,onCopyPath:h,showSelection:y}),[t,i,a,h,y]),me=(0,L.useMemo)(()=>({rows:e}),[e]),he=t.visibleColumns.length+(y?2:1),ge=(0,L.useCallback)(()=>_?(0,I.jsx)(`tfoot`,{children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:he,style:{textAlign:`center`,padding:`16px 0`},children:(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`})})})}):null,[_,he]),_e=(0,L.useMemo)(()=>({...Hz,Footer:ge}),[ge]);return t.visibleColumns.length===0?(0,I.jsx)(A,{p:4,children:(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`No columns to display.`})}):(0,I.jsxs)(nR.Provider,{value:n?ue:null,children:[(0,I.jsxs)(A,{ref:te,position:`relative`,height:v?void 0:`100%`,overflowX:`auto`,overflowY:v?`clip`:void 0,"data-testid":`table-widget`,onKeyDown:de,style:{...t.columnWidthCssVars,...C},children:[e.length===0?(0,I.jsxs)(A,{children:[(0,I.jsx)(`table`,{style:{width:`max-content`,minWidth:`100%`,tableLayout:`fixed`,borderCollapse:`separate`,borderSpacing:0},children:(0,I.jsx)(`thead`,{children:(0,I.jsx)(Sz,{columnsModel:t,sortModel:i,filterModel:a,onCopyPath:h,showSelection:y})})}),(0,I.jsx)(A,{p:4,children:(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`No rows to display.`})})]}):(0,I.jsx)(Foe,{useWindowScroll:v,style:v?void 0:{height:`100%`},data:e,context:me,defaultItemHeight:40,initialItemCount:Math.min(e.length,20),increaseViewportBy:2e3,endReached:g,fixedHeaderContent:pe,itemContent:fe,components:_e,scrollerRef:v?void 0:T}),(0,I.jsx)(Pz,{selection:r,allRowIds:b,onDuplicate:f,onDelete:d?re:void 0})]}),(0,I.jsx)(Fz,{isOpen:x!==null,onClose:ae,onConfirm:ie,count:oe})]})}),Wz=class{_cellFSM;_columnsModel;constructor(e,t){this._cellFSM=e,this._columnsModel=t,f(this,{},{autoBind:!0})}get _focusedColumn(){let e=this._cellFSM.focusedCell;return e?this._columnsModel.allColumns.find(t=>t.field===e.field)??null:null}get isVisible(){return this._focusedColumn!==null&&!this._cellFSM.hasSelection}get fieldLabel(){return this._focusedColumn?.label??``}get formulaExpression(){return this._focusedColumn?.formulaExpression}get foreignKeyTableId(){return this._focusedColumn?.foreignKeyTableId}},Gz=class{_totalCount=0;_baseTotalCount=0;_isFiltering=!1;_isRefetching=!1;constructor(){f(this,{},{autoBind:!0})}get totalCount(){return this._totalCount}get baseTotalCount(){return this._baseTotalCount}get isFiltering(){return this._isFiltering}get isRefetching(){return this._isRefetching}get text(){return this._isFiltering?`${this._totalCount} of ${this._baseTotalCount} ${this._baseTotalCount===1?`row`:`rows`}`:`${this._totalCount} ${this._totalCount===1?`row`:`rows`}`}setTotalCount(e){this._totalCount=e}setBaseTotalCount(e){this._baseTotalCount=e}setIsFiltering(e){this._isFiltering=e}setRefetching(e){this._isRefetching=e}decrementBaseTotalCount(e=1){this._baseTotalCount=Math.max(0,this._baseTotalCount-e),this._totalCount=Math.max(0,this._totalCount-e)}},Kz=class{_snapshot=null;_currentSnapshot=null;_canSave=!1;_isPopoverOpen=!1;_onSave=null;_onRevert=null;constructor(){f(this,{},{autoBind:!0})}get hasChanges(){return this._snapshot!==this._currentSnapshot}get isVisible(){return this.hasChanges}get canSave(){return this._canSave}get isPopoverOpen(){return this._isPopoverOpen}saveSnapshot(e){let t=JSON.stringify(e);this._snapshot=t,this._currentSnapshot=t}checkForChanges(e){this._currentSnapshot=JSON.stringify(e)}async save(){this._onSave&&await this._onSave()}revert(){this._onRevert&&this._onRevert(),this._currentSnapshot=this._snapshot}setCanSave(e){this._canSave=e}setPopoverOpen(e){this._isPopoverOpen=e}setOnSave(e){this._onSave=e}setOnRevert(e){this._onRevert=e}dispose(){this._onSave=null,this._onRevert=null}},qz=50,Jz=class{columns;filters;sorts;search;viewBadge;cellFSM;selection;rowCount;cellInfo;_dataSource;_pageSize;_breadcrumbs;_callbacks;_tableId;_schemaContext=new oI;_readonly=!1;_rows=[];_isBootstrapping=!0;_isLoadingMore=!1;_hasNextPage=!1;_endCursor=null;_savedViewState=null;constructor(e,t){this._dataSource=e,this._tableId=t.tableId,this._pageSize=t.pageSize??qz,this._readonly=t.readonly??!1,this._breadcrumbs=t.breadcrumbs??[],this._callbacks=t.callbacks??{},this.columns=new wI,this.filters=new oL,this.sorts=new TL,this.search=new xL(e=>this._handleSearch(e)),this.viewBadge=new Kz,this.cellFSM=new GL,this.selection=new jL,this.rowCount=new Gz,this.cellInfo=new Wz(this.cellFSM,this.columns),this.columns.setOnChange(()=>this._handleColumnsChange()),this.filters.setOnChange(()=>this._handleFilterChange()),this.filters.setOnApply(e=>this._handleFilterApply()),this.sorts.setOnChange(()=>this._handleSortChange()),this.sorts.setOnApply(e=>this._handleSortApply()),this.viewBadge.setOnSave(()=>this._handleViewSave()),this.viewBadge.setOnRevert(()=>this._handleViewRevert()),this.cellFSM.setOnReadonlyEditAttempt(this._callbacks.onReadonlyEditAttempt??null),f(this,{},{autoBind:!0}),queueMicrotask(()=>void this._bootstrap())}get rows(){return this._rows}get isBootstrapping(){return this._isBootstrapping}get isLoadingMore(){return this._isLoadingMore}get readonly(){return this._readonly}get tableId(){return this._tableId}get breadcrumbs(){return this._breadcrumbs}get callbacks(){return this._callbacks}getViewState(){return{columns:this.columns.serializeToViewColumns(),filters:null,sorts:this.sorts.serializeToViewSorts(),search:``}}applyViewState(e){this.columns.applyViewColumns(e.columns),this.sorts.applyViewSorts(e.sorts)}async loadMore(){if(!(!this._hasNextPage||this._isLoadingMore)){this._isLoadingMore=!0;try{let e=this._buildQuery(this._endCursor),t=await this._dataSource.fetchRows(e);c(()=>{this._appendRowVMs(t.rows),this._endCursor=t.endCursor,this._hasNextPage=t.hasNextPage,this._isLoadingMore=!1})}catch{c(()=>{this._isLoadingMore=!1})}}}async deleteRows(e){(await this._dataSource.deleteRows(e)).ok&&c(()=>{let t=new Set(e);this._rows=this._rows.filter(e=>!t.has(e.rowId)),this.rowCount.decrementBaseTotalCount(e.length),this.selection.exitSelectionMode(),this._updateNavigationContext()})}dispose(){this.columns.dispose(),this.filters.dispose(),this.sorts.dispose(),this.search.dispose(),this.viewBadge.dispose(),this.selection.exitSelectionMode(),this.cellFSM.blur();for(let e of this._rows)e.dispose()}async _bootstrap(){try{let e=await this._dataSource.fetchMetadata();c(()=>{this._schemaContext.init(e.dataSchema,e.refSchemas),this._readonly=this._readonly||e.readonly,this.viewBadge.setCanSave(!this._readonly)}),this.columns.init(this._schemaContext.allColumns),this.sorts.init(this._schemaContext.sortableFields),this.filters.init(this._schemaContext.filterableFields),e.viewState&&this.applyViewState(e.viewState),this._saveViewSnapshot(),await this._loadRows(),c(()=>{this._isBootstrapping=!1})}catch{c(()=>{this._isBootstrapping=!1})}}_buildQuery(e=null){return{where:this.filters.hasActiveFilters?this.filters.buildCurrentWhereClause():null,orderBy:this.sorts.serializeToQuerySorts(),search:this.search.debouncedQuery,first:this._pageSize,after:e}}async _loadRows(){let e=this._buildQuery(),t=await this._dataSource.fetchRows(e);c(()=>{this._replaceRowVMs(t.rows),this._endCursor=t.endCursor,this._hasNextPage=t.hasNextPage;let e=this.filters.hasActiveFilters||this.search.hasActiveSearch;this.rowCount.setTotalCount(t.totalCount),e||this.rowCount.setBaseTotalCount(t.totalCount),this.rowCount.setIsFiltering(e),this._updateNavigationContext()})}async _reloadRows(){this._isBootstrapping||(this.selection.exitSelectionMode(),this.cellFSM.blur(),await this._loadRows())}_replaceRowVMs(e){for(let e of this._rows)e.dispose();this._rows=this._createRowVMs(e)}_appendRowVMs(e){let t=this._createRowVMs(e);this._rows=[...this._rows,...t],this._updateNavigationContext()}_createRowVMs(e){let t=this._schemaContext.wrappedDataSchema;if(!t)return[];let n=kc({tableId:this._tableId,schema:t,rows:e.map(e=>({rowId:e.rowId,data:{data:e.data}})),refSchemas:this._schemaContext.fullRefSchemas}),r=new Map;for(let t of e)r.set(t.rowId,this._buildSystemValues(t));return n.rows.map(e=>new qL(e,e.rowId,this.cellFSM,this.selection,(e,t,n,r)=>this._commitCell(e,t,n,r),r.get(e.rowId),this._readonly))}_buildSystemValues(e){return{...e.systemFields,id:e.rowId}}_toPatchField(e){return nI(e)}async _commitCell(e,t,n,r){let i=this._toPatchField(t),a=(await this._dataSource.patchCells([{rowId:e,field:i,value:n}]))[0];a&&!a.ok&&c(()=>{let n=this._rows.find(t=>t.rowId===e);if(n&&r!==void 0){let e=n.rowModel.get(t);e?.isPrimitive()?e.setValue(r):e?.isObject()&&e.setValue(r,{internal:!0})}})}_updateNavigationContext(){this.cellFSM.setNavigationContext(this.columns.visibleColumns.map(e=>e.field),this._rows.map(e=>e.rowId))}_handleColumnsChange(){this.cellFSM.updateNavigationContext(this.columns.visibleColumns.map(e=>e.field),this.cellFSM.rowIds),this._checkViewChanges()}_handleFilterChange(){}_handleFilterApply(){this._reloadRows()}_handleSortChange(){this._checkViewChanges()}_handleSortApply(){this._reloadRows(),this._checkViewChanges()}_handleSearch(e){this._reloadRows()}async _handleViewSave(){try{let e=this.getViewState();(await this._dataSource.saveView(e)).ok&&this._saveViewSnapshot()}catch{}}_handleViewRevert(){this._savedViewState&&(this.applyViewState(this._savedViewState),this._reloadRows())}_saveViewSnapshot(){let e=this.getViewState();this._savedViewState=e,this.viewBadge.saveSnapshot(e)}_checkViewChanges(){this.viewBadge.checkForChanges(this.getViewState())}};function Yz(e,{delayMs:t=150,minShowMs:n=300}={}){let[r,i]=(0,L.useState)(!1),a=(0,L.useRef)(null);return(0,L.useEffect)(()=>{if(e){let e=setTimeout(()=>{a.current=Date.now(),i(!0)},t);return()=>clearTimeout(e)}if(a.current!==null){let e=n-(Date.now()-a.current);if(e>0){let t=setTimeout(()=>{a.current=null,i(!1)},e);return()=>clearTimeout(t)}a.current=null}i(!1)},[e,t,n]),r}var Xz=g(({model:e})=>e.isVisible?(0,I.jsxs)(j,{alignItems:`center`,gap:2,overflow:`hidden`,flexShrink:1,minW:0,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-field`,children:e.fieldLabel}),e.formulaExpression&&(0,I.jsxs)(k,{fontSize:`sm`,color:`purple.400`,fontFamily:`mono`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-formula`,children:[`= `,e.formulaExpression]}),e.foreignKeyTableId&&!e.formulaExpression&&(0,I.jsxs)(k,{fontSize:`sm`,color:`blue.400`,fontFamily:`mono`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,"data-testid":`cell-info-fk`,children:[`→ `,e.foreignKeyTableId]})]}):null),Zz=g(({model:e})=>(0,I.jsxs)(j,{alignItems:`center`,gap:2,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,"data-testid":`row-count-text`,children:e.text}),e.isRefetching&&(0,I.jsx)(Ht,{size:`xs`,color:`gray.400`,"data-testid":`row-count-spinner`})]})),Qz=g(({model:e})=>{if(!e.isVisible)return null;let t=e.canSave?`orange`:`gray`,n=e.canSave?`orange.500`:`gray.400`,r=e.canSave?`unsaved`:`local`,i=e.canSave?`Unsaved view settings`:`Local view changes`,a=e.canSave?`Column order, widths, and sort settings will be saved to the Default view and shared with everyone.`:`View settings can only be saved in draft revisions. These changes are temporary and will be lost when you leave.`,o=e.canSave?`Revert`:`Reset`;return(0,I.jsxs)(ge,{open:e.isPopoverOpen,onOpenChange:t=>e.setPopoverOpen(t.open),lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsx)(me,{asChild:!0,children:(0,I.jsxs)(It,{variant:`subtle`,size:`sm`,colorPalette:t,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:1,_hover:{opacity:.8},"data-testid":`view-settings-badge`,children:[(0,I.jsx)(A,{width:`6px`,height:`6px`,borderRadius:`full`,bg:n}),r]})}),(0,I.jsx)(R,{children:(0,I.jsx)(se,{children:(0,I.jsxs)(le,{p:3,maxW:`300px`,children:[(0,I.jsxs)(P,{mb:2,children:[(0,I.jsx)(A,{color:`gray.400`,children:(0,I.jsx)(bk,{size:16})}),(0,I.jsx)(k,{fontWeight:`semibold`,fontSize:`sm`,children:i})]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,mb:3,children:a}),(0,I.jsxs)(P,{children:[(0,I.jsx)(N,{variant:`ghost`,size:`xs`,onClick:()=>{e.revert(),e.setPopoverOpen(!1)},"data-testid":`view-settings-revert`,children:o}),e.canSave&&(0,I.jsx)(N,{colorPalette:`blue`,size:`xs`,onClick:()=>{e.save(),e.setPopoverOpen(!1)},"data-testid":`view-settings-save`,children:`Save`})]})]})})})]})}),$z=40,eB=40,tB=8,nB=[120,150,120,100,130],rB=[[80,110,70,60,90],[100,90,100,80,110],[60,130,80,70,80],[90,100,60,90,100],[75,120,90,55,70],[110,80,75,80,120],[85,140,95,65,95],[95,70,110,85,80]],iB=({breadcrumbs:e,onBreadcrumbClick:t,showCreateButton:n,useWindowScroll:r})=>(0,I.jsxs)(A,{display:`flex`,flexDirection:`column`,height:r?void 0:`100%`,flex:r?1:void 0,children:[(0,I.jsxs)(j,{px:3,pt:`32px`,pb:`48px`,alignItems:`flex-start`,justifyContent:`space-between`,...r&&{position:`sticky`,top:0,zIndex:3,bg:`white`},children:[e.length>0?(0,I.jsx)(JN,{segments:e,highlightLast:!1,onSegmentClick:t,action:n?(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}):void 0}):(0,I.jsx)(A,{}),(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,children:[(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}),(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`}),(0,I.jsx)(sn,{height:`32px`,width:`32px`,borderRadius:`6px`})]})]}),(0,I.jsxs)(A,{children:[(0,I.jsx)(j,{height:`${$z}px`,alignItems:`center`,px:3,borderBottom:`1px solid`,borderColor:`gray.100`,children:nB.map((e,t)=>(0,I.jsx)(A,{width:`${e}px`,flexShrink:0,children:(0,I.jsx)(sn,{height:`12px`,width:`60px`,borderRadius:`4px`})},`h-${t}`))}),rB.slice(0,tB).map((e,t)=>(0,I.jsx)(j,{height:`${eB}px`,alignItems:`center`,px:3,borderBottom:`1px solid`,borderColor:`gray.100`,children:nB.map((n,r)=>(0,I.jsx)(A,{width:`${n}px`,flexShrink:0,children:(0,I.jsx)(sn,{height:`14px`,width:`${e[r]}px`,borderRadius:`4px`})},`r-${t}-c-${r}`))},`r-${t}`))]})]}),aB=()=>{};function oB(e,t,n){return{onDeleteRow:e?void 0:e=>t.deleteRows([e]),onDuplicateRow:e?void 0:n.onDuplicateRow,onDeleteSelected:e?void 0:e=>t.deleteRows(e),onUploadFile:e?void 0:n.onUploadFile}}var sB=g(({viewModel:e,useWindowScroll:t})=>{let n=Yz(e.isBootstrapping);if(e.isBootstrapping)return n?(0,I.jsx)(iB,{breadcrumbs:e.breadcrumbs,onBreadcrumbClick:e.callbacks.onBreadcrumbClick,showCreateButton:!e.readonly&&!!e.callbacks.onCreateRow,useWindowScroll:t}):null;let r=e.readonly,{breadcrumbs:i,callbacks:a}=e;return(0,I.jsxs)(A,{display:`flex`,flexDirection:`column`,height:t?void 0:`100%`,flex:t?1:void 0,children:[(0,I.jsxs)(j,{px:3,pt:`32px`,pb:`48px`,alignItems:`flex-start`,justifyContent:`space-between`,...t&&{position:`sticky`,top:0,zIndex:3,bg:`white`},children:[i.length>0&&(0,I.jsx)(JN,{segments:i,highlightLast:!1,onSegmentClick:a.onBreadcrumbClick,action:a.onCreateRow?(0,I.jsx)(XN,{tooltip:`New row`,onClick:a.onCreateRow,dataTestId:`create-row-button`}):void 0}),(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,children:[(0,I.jsx)(CL,{model:e.search}),(0,I.jsx)(bL,{model:e.filters,availableFields:e.columns.filterableFields}),(0,I.jsx)(AL,{model:e.sorts,availableFields:e.columns.sortableFields,onChange:aB})]})]}),(0,I.jsx)(A,{flex:1,minHeight:0,children:(0,I.jsx)(Uz,{rows:e.rows,columnsModel:e.columns,cellFSM:e.cellFSM,selection:e.selection,sortModel:e.sorts,filterModel:e.filters,isLoadingMore:e.isLoadingMore,onEndReached:e.loadMore,onOpenRow:a.onOpenRow,onPickRow:a.onPickRow,...oB(r,e,a),onSearchForeignKey:a.onSearchForeignKey,onOpenFile:a.onOpenFile,onCopyPath:a.onCopyPath,useWindowScroll:t})}),(0,I.jsxs)(j,{px:3,py:2,alignItems:`center`,overflow:`hidden`,...t&&{position:`sticky`,bottom:0,bg:`white`,zIndex:3},children:[(0,I.jsx)(Zz,{model:e.rowCount}),(0,I.jsxs)(j,{alignItems:`center`,gap:3,overflow:`hidden`,flexShrink:1,minW:0,flex:1,justifyContent:`flex-end`,children:[(0,I.jsx)(Xz,{model:e.cellInfo}),(0,I.jsx)(Qz,{model:e.viewBadge})]})]})]})}),cB=Sn(),lB=e=>{let t={BASE_URL:`/`,DEV:!1,GIT_BRANCH_NAME:`HEAD`,GIT_COMMIT_HASH:`085f8f4`,MODE:`production`,PACKAGE_VERSION:`2.7.0`,PROD:!0,REACT_APP_ENDPOINT_HOST:``,REACT_APP_ENDPOINT_PORT:``,REACT_APP_ENDPOINT_SERVER_URL:`/endpoint`,REACT_APP_GRAPHQL_SERVER_URL:`/graphql`,REACT_APP_SWAGGER_SERVER_URL:`/api`,SSR:!1}[e];return globalThis.__env__?.[e]||t},uB=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},dB=[`light`,`dark`],fB=`(prefers-color-scheme: dark)`,pB=typeof window>`u`,mB=L.createContext(void 0),hB=e=>L.useContext(mB)?L.createElement(L.Fragment,null,e.children):L.createElement(_B,{...e}),gB=[`light`,`dark`],_B=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=gB,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=L.useState(()=>yB(i,o)),[m,h]=L.useState(()=>f===`system`?xB():f),g=c?Object.values(c):a,_=L.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=xB());let a=c?c[i]:i,l=t?bB(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=dB.includes(o)?o:null,t=dB.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=L.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=L.useCallback(t=>{h(xB(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);L.useEffect(()=>{let e=window.matchMedia(fB);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),L.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),L.useEffect(()=>{_(e??f)},[e,f]);let b=L.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return L.createElement(mB.Provider,{value:b},L.createElement(vB,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},vB=L.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return L.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${uB.toString()})(${u})`}})}),yB=(e,t)=>{if(pB)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},bB=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},xB=e=>(e||=window.matchMedia(fB),e.matches?`dark`:`light`),SB=()=>(0,L.useCallback)(e=>{e&&e.focus()},[]),CB=(e,...t)=>{let n=(0,L.useRef)(null),[r,i]=(0,L.useState)(t),a=(0,L.useMemo)(()=>r.length!==t.length||r.some((e,n)=>e!==t[n])?(i(t),t):r,[t,r]);return n.current||=Y.get(e),(0,L.useEffect)(()=>{let e=n.current;return e?.init?.(...a),()=>{e?.dispose?.()}},[a]),n.current};function wB(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function TB(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}var EB=365.2425,DB=6048e5,OB=864e5,kB=43200,AB=1440,jB=3600*24;jB*7,jB*EB/12*3;var MB={};function NB(){return MB}function PB(e,t){let n=NB(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=wB(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function FB(e){return PB(e,{weekStartsOn:1})}function IB(e){let t=wB(e),n=t.getFullYear(),r=TB(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=FB(r),a=TB(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=FB(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function LB(e){let t=wB(e);return t.setHours(0,0,0,0),t}function RB(e){let t=wB(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function zB(e,t){let n=LB(e),r=LB(t),i=+n-RB(n),a=+r-RB(r);return Math.round((i-a)/OB)}function BB(e){let t=IB(e),n=TB(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),FB(n)}function VB(e,t){let n=wB(e),r=wB(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function HB(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function UB(e){if(!HB(e)&&typeof e!=`number`)return!1;let t=wB(e);return!isNaN(Number(t))}function WB(e,t){let n=wB(e),r=wB(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function GB(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function KB(e,t){return wB(e)-+wB(t)}function qB(e){let t=wB(e);return t.setHours(23,59,59,999),t}function JB(e){let t=wB(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function YB(e){let t=wB(e);return+qB(t)==+JB(t)}function XB(e,t){let n=wB(e),r=wB(t),i=VB(n,r),a=Math.abs(WB(n,r)),o;if(a<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let t=VB(n,r)===-i;YB(wB(e))&&a===1&&VB(e,r)===1&&(t=!1),o=i*(a-Number(t))}return o===0?0:o}function ZB(e,t,n){let r=KB(e,t)/1e3;return GB(n?.roundingMethod)(r)}function QB(e){let t=wB(e),n=TB(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}var $B={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},eV=(e,t,n)=>{let r,i=$B[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function tV(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var nV={date:tV({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:tV({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:tV({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},rV={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},iV=(e,t,n,r)=>rV[e];function aV(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var oV={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:aV({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:aV({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:aV({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:aV({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:aV({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function sV(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?lV(s,e=>e.test(o)):cV(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function cV(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lV(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uV(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var dV={code:`en-US`,formatDistance:eV,formatLong:nV,formatRelative:iV,localize:oV,match:{ordinalNumber:uV({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sV({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:sV({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:sV({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:sV({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:sV({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function fV(e){let t=wB(e);return zB(t,QB(t))+1}function pV(e){let t=wB(e),n=FB(t)-+BB(t);return Math.round(n/DB)+1}function mV(e,t){let n=wB(e),r=n.getFullYear(),i=NB(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=TB(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=PB(o,t),c=TB(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=PB(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function hV(e,t){let n=NB(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=mV(e,t),a=TB(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),PB(a,t)}function gV(e,t){let n=wB(e),r=PB(n,t)-+hV(n,t);return Math.round(r/DB)+1}function _V(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var vV={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return _V(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):_V(n+1,2)},d(e,t){return _V(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return _V(e.getHours()%12||12,t.length)},H(e,t){return _V(e.getHours(),t.length)},m(e,t){return _V(e.getMinutes(),t.length)},s(e,t){return _V(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return _V(Math.trunc(r*10**(n-3)),t.length)}},yV={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},bV={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return vV.y(e,t)},Y:function(e,t,n,r){let i=mV(e,r),a=i>0?i:1-i;return t===`YY`?_V(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):_V(a,t.length)},R:function(e,t){return _V(IB(e),t.length)},u:function(e,t){return _V(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return _V(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return _V(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return vV.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return _V(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=gV(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):_V(i,t.length)},I:function(e,t,n){let r=pV(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):_V(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):vV.d(e,t)},D:function(e,t,n){let r=fV(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):_V(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return _V(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return _V(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return _V(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?yV.noon:r===0?yV.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?yV.evening:r>=12?yV.afternoon:r>=4?yV.morning:yV.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return vV.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):vV.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):_V(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):_V(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):vV.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):vV.s(e,t)},S:function(e,t){return vV.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return SV(r);case`XXXX`:case`XX`:return CV(r);default:return CV(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return SV(r);case`xxxx`:case`xx`:return CV(r);default:return CV(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+xV(r,`:`);default:return`GMT`+CV(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+xV(r,`:`);default:return`GMT`+CV(r,`:`)}},t:function(e,t,n){return _V(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return _V(e.getTime(),t.length)}};function xV(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+_V(a,2)}function SV(e,t){return e%60==0?(e>0?`-`:`+`)+_V(Math.abs(e)/60,2):CV(e,t)}function CV(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=_V(Math.trunc(r/60),2),a=_V(r%60,2);return n+i+t+a}var wV=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},TV=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},EV={p:TV,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return wV(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,wV(r,t)).replace(`{{time}}`,TV(i,t))}},DV=/^D+$/,OV=/^Y+$/,kV=[`D`,`DD`,`YY`,`YYYY`];function AV(e){return DV.test(e)}function jV(e){return OV.test(e)}function MV(e,t,n){let r=NV(e,t,n);if(console.warn(r),kV.includes(e))throw RangeError(r)}function NV(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var PV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IV=/^'([^]*?)'?$/,LV=/''/g,RV=/[a-zA-Z]/;function zV(e,t,n){let r=NB(),i=n?.locale??r.locale??dV,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=wB(e);if(!UB(s))throw RangeError(`Invalid time value`);let c=t.match(FV).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=EV[t];return n(e,i.formatLong)}return e}).join(``).match(PV).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:BV(e)};if(bV[t])return{isToken:!0,value:e};if(t.match(RV))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&jV(a)||!n?.useAdditionalDayOfYearTokens&&AV(a))&&MV(a,t,String(e));let o=bV[a[0]];return o(s,a,i.localize,l)}).join(``)}function BV(e){let t=e.match(IV);return t?t[1].replace(LV,`'`):e}function VV(e,t,n){let r=NB(),i=n?.locale??r.locale??dV,a=VB(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),s,c;a>0?(s=wB(t),c=wB(e)):(s=wB(e),c=wB(t));let l=ZB(c,s),u=(RB(c)-RB(s))/1e3,d=Math.round((l-u)/60),f;if(d<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):d===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,d,o);if(d<45)return i.formatDistance(`xMinutes`,d,o);if(d<90)return i.formatDistance(`aboutXHours`,1,o);if(d<1440){let e=Math.round(d/60);return i.formatDistance(`aboutXHours`,e,o)}else if(d<2520)return i.formatDistance(`xDays`,1,o);else if(d<43200){let e=Math.round(d/AB);return i.formatDistance(`xDays`,e,o)}else if(d<43200*2)return f=Math.round(d/kB),i.formatDistance(`aboutXMonths`,f,o);if(f=XB(c,s),f<12){let e=Math.round(d/kB);return i.formatDistance(`xMonths`,e,o)}else{let e=f%12,t=Math.trunc(f/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function HV(e,t){return VV(e,Date.now(),t)}function UV(e,t=`dd.MM.yyyy, HH:mm`,n){if(!e)return``;let r=new Date(e);return Number.isNaN(r.getTime())?(console.warn(`Invalid date:`,e),``):zV(r,t,{locale:n})}var WV=()=>globalThis.location.origin,GV=e=>navigator.clipboard.writeText(e),Y=new class{registrations=new Map;register(e,t,n){this.registrations.set(e,{factory:t,scope:n.scope})}get(e){let t=this.registrations.get(e);if(!t)throw Error(`No provider found for ${e.name}`);return t.scope===`singleton`?(t.instance??=t.factory(),t.instance):t.factory()}},KV=class extends Error{constructor(){super(`Aborted`),this.name=`AbortError`}},X=class e{_data=null;_error=null;_isLoading=!1;_isLoaded=!1;_abortController=null;static of(t,n){return new e(t,n)}constructor(e,t){this.fetchFunction=e,this.options=t,f(this)}get data(){return this._data}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get error(){return this._error}get errorMessage(){return this._error?.response.errors?.[0].message}abort(){this._abortController?.abort(),this._abortController=null}setDataDirectly(e){this._data=e,this._isLoaded=!0}async fetch(...e){this.abort(),this._abortController=new AbortController;let t=this._abortController.signal;this.options?.skipResetting||this.reset();try{this.setIsLoading(!0);let n=await this.fetchFunction(...e);return t.aborted?{isRight:!1,error:new KV}:(this.setData(n),{isRight:!0,data:n})}catch(e){return t.aborted?{isRight:!1,error:new KV}:(console.error(e),this.setError(e),{isRight:!1,error:e})}finally{this.setIsLoading(!1),this.setIsLoaded(!0)}}reset(){this.setIsLoading(!1),this.setData(null),this.setError(null)}setData(e){this._data=e}setIsLoading(e){this._isLoading=e}setIsLoaded(e){this._isLoaded=e}setError(e){this._error=e}};function qV(e){return!e.isRight&&e.error instanceof KV}var JV=class{values;constructor(e){this.values=e,f(this,{},{autoBind:!0})}setValue(e,t){this.values[e]=t}get isValid(){return Object.values(this.values).every(Boolean)}},YV=e=>{if(e&&e.startsWith(`/`)&&!e.startsWith(`//`))return e},XV=e=>{if(!e)return null;try{let t=JSON.parse(e)?.redirect;return typeof t==`string`?t:null}catch{return null}},ZV=e=>{if(e)return JSON.stringify({redirect:e})},QV=()=>YV(new URLSearchParams(globalThis.location.search).get(`redirect`)),$V=e=>{let t=YV(e);return!t||t===`/`?``:`?redirect=${encodeURIComponent(t)}`},eH=function(e){return e.Loading=`loading`,e.Empty=`empty`,e.List=`list`,e.NotFound=`notFound`,e.Error=`error`,e}({}),tH=class{_state=eH.Loading;_items=[];_hasNextPage=!1;_endCursor=null;_totalCount=0;_isInitialLoad=!0;constructor(){f(this,{},{autoBind:!0})}get state(){return this._state}get items(){return this._items}get hasNextPage(){return this._hasNextPage}get endCursor(){return this._endCursor}get totalCount(){return this._totalCount}get isInitialLoad(){return this._isInitialLoad}get showLoading(){return this._state===eH.Loading&&this._isInitialLoad}get showEmpty(){return this._state===eH.Empty}get showNotFound(){return this._state===eH.NotFound}get showList(){return this._state===eH.List}get showError(){return this._state===eH.Error}setLoading(){this._state=eH.Loading}setError(){this._isInitialLoad=!1,this._state=eH.Error}setItems(e,t){this._isInitialLoad=!1,this._items=e,this._hasNextPage=t.hasNextPage,this._endCursor=t.endCursor,this._totalCount=t.totalCount,e.length>0?this._state=eH.List:t.isSearching?this._state=eH.NotFound:this._state=eH.Empty}appendItems(e,t){this._items=[...this._items,...e],this._hasNextPage=t.hasNextPage,this._endCursor=t.endCursor}removeItem(e){let t=this._items.length;this._items=this._items.filter(t=>!e(t));let n=t-this._items.length;this._totalCount=Math.max(0,this._totalCount-n)}updateStateAfterRemove(e){this._items.length===0&&(this._state=e?eH.NotFound:eH.Empty)}reset(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._isInitialLoad=!1,this._state=eH.Loading}resetToLoading(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._totalCount=0,this._isInitialLoad=!0,this._state=eH.Loading}},nH=class{cachedItemViewModels=u.map();constructor(e){this.dataSource=e,h(this,{cachedItemViewModels:u,showLoading:a,showEmpty:a,showList:a,showError:a,items:a,totalCount:a,hasNextPage:a,init:m,dispose:m,tryToFetchNextPage:m,getOrCreateItemViewModel:!1})}get showLoading(){return this.dataSource.state===eH.Loading&&this.dataSource.isInitialLoad}get showEmpty(){return this.dataSource.state===eH.Empty}get showList(){return this.dataSource.state===eH.List}get showError(){return this.dataSource.state===eH.Error}get items(){return this.dataSource.items.map(e=>this.getOrCreateItemViewModel(e))}get totalCount(){return this.dataSource.totalCount}get hasNextPage(){return this.dataSource.hasNextPage}init(){this.dataSource.load()}dispose(){this.dataSource.dispose(),this.cachedItemViewModels.clear()}async tryToFetchNextPage(){await this.dataSource.loadNextPage()}getOrCreateItemViewModel(e){let t=this.getItemKey(e),n=this.cachedItemViewModels.get(t);return n||(n=this.createItemViewModel(e),this.cachedItemViewModels.set(t,n)),n}},rH=class{listState=new tH;request;config;constructor(e,t={}){this.request=X.of(e,{skipResetting:!0}),this.config={pageSize:t.pageSize??50},h(this,{items:a,hasNextPage:a,totalCount:a,isLoading:a,isInitialLoad:a,state:a,load:m,loadNextPage:m,reset:m,dispose:m},{autoBind:!0})}get items(){return this.listState.items}get hasNextPage(){return this.listState.hasNextPage}get totalCount(){return this.listState.totalCount}get isLoading(){return this.request.isLoading}get isInitialLoad(){return this.listState.isInitialLoad}get state(){return this.listState.state}async load(e){this.listState.setLoading();let t=await this.request.fetch(this.buildFetchArgs(e));if(!t.isRight){if(qV(t))return;c(()=>{this.listState.setError()});return}c(()=>{let e=this.extractItems(t.data),n=this.extractPageInfo(t.data);this.listState.setItems(e,n)})}async loadNextPage(){if(!this.hasNextPage||this.isLoading)return!1;let e=await this.request.fetch(this.buildFetchArgs(void 0,this.listState.endCursor||void 0));return e.isRight?(c(()=>{let t=this.extractItems(e.data),n=this.extractPageInfo(e.data);this.listState.appendItems(t,{hasNextPage:n.hasNextPage,endCursor:n.endCursor})}),!0):!1}reset(){this.listState.reset(),this.request.abort()}dispose(){this.request.abort()}},iH=class{id=ds();pendingRequestInternal=null;resolverInternal=null;constructor(){h(this,{pendingRequestInternal:u,hasPendingRequest:a,pendingRequest:a,setPendingRequest:m,clearPendingRequest:m})}setResolver(e){this.resolverInternal=e}resolve(e){this.resolverInternal?.(e)}get hasPendingRequest(){return this.pendingRequestInternal!==null}get pendingRequest(){return this.pendingRequestInternal}setPendingRequest(e){this.pendingRequestInternal=e}clearPendingRequest(){this.pendingRequestInternal=null}init(){}dispose(){}};function aH(e,t,n){return{payload:e,resolve:t,reject:n}}var oH=class{stack=[];constructor(){h(this,{stack:u,initStack:m.bound,pushRequest:m.bound,resolveToParent:m.bound,rejectRequest:m.bound,cancelFromItem:m.bound,dispose:m.bound})}initStack(e){this.stack=[e],this.setupItemResolver(e)}pushRequest(e,t,n,r){let i=aH(t,n,r);e.setPendingRequest(i);let a=this.createItemForRequest(i);this.addItem(a)}resolveToParent(e,t){let n=this.stack.indexOf(e);if(n===-1)return;let r=this.stack[n-1];r?.pendingRequest&&(r.pendingRequest.resolve(t),r.clearPendingRequest()),this.stack.splice(n).forEach(e=>e.dispose())}rejectRequest(e){let t=this.stack.indexOf(e);t!==-1&&this.stack.splice(t+1).forEach(e=>e.dispose());let n=t-1;if(n>=0){let e=this.stack[n];e.pendingRequest&&(e.pendingRequest.reject(),e.clearPendingRequest())}}cancelFromItem(e){let t=this.stack.indexOf(e);t!==-1&&(this.stack.splice(t+1).forEach(e=>e.dispose()),e.pendingRequest&&(e.pendingRequest.reject(),e.clearPendingRequest()))}dispose(){this.stack.forEach(e=>e.dispose()),this.stack=[]}addItem(e){this.setupItemResolver(e),this.stack.push(e)}setupItemResolver(e){e.setResolver(t=>this.handleItemResult(e,t))}},sH=class{_isFullscreen=!1;_isInitialized=!1;_containerRef=null;constructor(){h(this,{_isFullscreen:u,_containerRef:u,setContainerRef:m.bound,toggleFullscreen:m.bound,init:m.bound,dispose:m.bound,handleFullscreenChange:m.bound})}get isFullscreen(){return this._isFullscreen}setContainerRef(e){this._containerRef=e}toggleFullscreen(){this._isFullscreen?this.exitFullscreen():this.enterFullscreen()}init(){this._isInitialized||(this._isInitialized=!0,document.addEventListener(`fullscreenchange`,this.handleFullscreenChange))}dispose(){this._isInitialized&&(this._isInitialized=!1,document.removeEventListener(`fullscreenchange`,this.handleFullscreenChange),this._containerRef=null,this._isFullscreen=!1)}async enterFullscreen(){if(this._containerRef)try{await this._containerRef.requestFullscreen()}catch(e){console.error(e)}}async exitFullscreen(){try{await document.exitFullscreen()}catch(e){console.error(e)}}handleFullscreenChange(){this._isFullscreen=document.fullscreenElement===this._containerRef}},cH=class{_timer=null;constructor(e){this.delayMs=e}schedule(e){this.cancel(),this._timer=setTimeout(e,this.delayMs)}cancel(){this._timer&&=(clearTimeout(this._timer),null)}dispose(){this.cancel()}},lH=class{constructor(e,t){this.operator=e,this.value=t,Object.defineProperty(this,`t`,{writable:!0})}get notes(){return this.t}addNote(e){this.t=this.t||[],this.t.push(e)}},uH=class extends lH{},dH=class extends uH{constructor(e,t){if(!Array.isArray(t))throw Error(`"${e}" operator expects to receive an array of conditions`);super(e,t)}},fH=`__itself__`,pH=class extends lH{constructor(e,t,n){super(e,n),this.field=t}},mH=new uH(`__null__`,null),hH=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function gH(e,t){return t instanceof dH&&t.operator===e}function _H(e,t){return t.length===1?t[0]:new dH(e,function e(t,n,r){let i=r||[];for(let r=0,a=n.length;r<a;r++){let a=n[r];gH(t,a)?e(t,a.value,i):i.push(a)}return i}(e,t))}var vH=e=>e,yH=()=>Object.create(null),bH=Object.defineProperty(yH(),`__@type@__`,{value:`ignore value`});function xH(e,t,n=!1){if(!e||e&&e.constructor!==Object)return!1;for(let r in e)if(hH(e,r)&&hH(t,r)&&(!n||e[r]!==bH))return!0;return!1}function SH(e){let t=[];for(let n in e)hH(e,n)&&e[n]!==bH&&t.push(n);return t}function CH(e,t){t!==mH&&e.push(t)}var wH=e=>_H(`and`,e),TH={compound(e,t,n){let r=(Array.isArray(t)?t:[t]).map(e=>n.parse(e));return new dH(e.name,r)},field:(e,t,n)=>new pH(e.name,n.field,t),document:(e,t)=>new uH(e.name,t)},EH=class{constructor(e,t=yH()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:t.operatorToConditionName||vH,defaultOperatorName:t.defaultOperatorName||`eq`,mergeFinalConditions:t.mergeFinalConditions||wH},this.o=Object.keys(e).reduce((t,n)=>(t[n]=Object.assign({name:this.u.operatorToConditionName(n)},e[n]),t),{}),this.s=Object.assign({},t.fieldContext,{field:``,query:{},parse:this.parse,hasOperators:e=>xH(e,this.o,t.useIgnoreValue)}),this.i=Object.assign({},t.documentContext,{parse:this.parse,query:{}}),this.h=t.useIgnoreValue?SH:Object.keys}setParse(e){this.parse=e,this.s.parse=e,this.i.parse=e}parseField(e,t,n,r){let i=this.o[t];if(!i)throw Error(`Unsupported operator "${t}"`);if(i.type!==`field`)throw Error(`Unexpected ${i.type} operator "${t}" at field level`);return this.s.field=e,this.s.query=r,this.parseInstruction(i,n,this.s)}parseInstruction(e,t,n){return typeof e.validate==`function`&&e.validate(e,t),(e.parse||TH[e.type])(e,t,n)}parseFieldOperators(e,t){let n=[],r=this.h(t);for(let i=0,a=r.length;i<a;i++){let a=r[i];if(!this.o[a])throw Error(`Field query for "${e}" may contain only operators or a plain object as a value`);CH(n,this.parseField(e,a,t[a],t))}return n}parse(e){let t=[],n=this.h(e);this.i.query=e;for(let r=0,i=n.length;r<i;r++){let i=n[r],a=e[i],o=this.o[i];if(o){if(o.type!==`document`&&o.type!==`compound`)throw Error(`Cannot use parsing instruction for operator "${i}" in "document" context as it is supposed to be used in "${o.type}" context`);CH(t,this.parseInstruction(o,a,this.i))}else this.s.hasOperators(a)?t.push(...this.parseFieldOperators(i,a)):CH(t,this.parseField(i,this.u.defaultOperatorName,a,e))}return this.u.mergeFinalConditions(t)}};function DH(e,t){let n=e[t];if(typeof n!=`function`)throw Error(`Unable to interpret "${t}" condition. Did you forget to register interpreter for it?`);return n}function OH(e){return e.operator}function kH(e,t){let n=t,r=n&&n.getInterpreterName||OH,i;switch(n?n.numberOfArguments:0){case 1:i=t=>DH(e,r(t,n))(t,a);break;case 3:i=(t,i,o)=>DH(e,r(t,n))(t,i,o,a);break;default:i=(t,i)=>DH(e,r(t,n))(t,i,a)}let a=Object.assign({},n,{interpret:i});return a.interpret}function AH(e,t){return(n,...r)=>{let i=e(n,...r),a=t.bind(null,i);return a.ast=i,a}}EH.prototype.parseInstruction;function jH(e,t){if(!Array.isArray(t))throw Error(`"${e.name}" expects value to be an array`)}function MH(e,t){if(jH(e,t),!t.length)throw Error(`"${e.name}" expects to have at least one element in array`)}var NH=e=>(t,n)=>{if(typeof n!==e)throw Error(`"${t.name}" expects value to be a "${e}"`)},PH={type:`compound`,validate:MH,parse(e,t,{parse:n}){let r=t.map(e=>n(e));return _H(e.name,r)}},FH=PH,IH={type:`compound`,validate:MH},LH={type:`field`,validate(e,t){if(!(t&&(t instanceof RegExp||t.constructor===Object)))throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`)},parse(e,t,n){let r=t instanceof RegExp?new pH(`regex`,n.field,t):n.parse(t,n);return new dH(e.name,[r])}},RH={type:`field`,validate(e,t){if(!t||t.constructor!==Object)throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`)},parse(e,t,{parse:n,field:r,hasOperators:i}){let a=i(t)?n(t,{field:fH}):n(t);return new pH(e.name,r,a)}},zH={type:`field`,validate:NH(`number`)},BH={type:`field`,validate:jH},VH=BH,HH=BH,UH={type:`field`,validate(e,t){if(!Array.isArray(t)||t.length!==2)throw Error(`"${e.name}" expects an array with 2 numeric elements`)}},WH={type:`field`,validate:NH(`boolean`)},GH={type:`field`,validate:function(e,t){if(!(typeof t==`string`||typeof t==`number`||t instanceof Date))throw Error(`"${e.name}" expects value to be comparable (i.e., string, number or date)`)}},KH=GH,qH=KH,JH=KH,YH={type:`field`},XH=YH,ZH={type:`field`,validate(e,t){if(!(t instanceof RegExp)&&typeof t!=`string`)throw Error(`"${e.name}" expects value to be a regular expression or a string that represents regular expression`)},parse(e,t,n){let r=typeof t==`string`?new RegExp(t,n.query.$options||``):t;return new pH(e.name,n.field,r)}},QH={type:`field`,parse:()=>mH},$H={type:`document`,validate:NH(`function`)},eU=Object.freeze({__proto__:null,$and:PH,$or:FH,$nor:IH,$not:LH,$elemMatch:RH,$size:zH,$in:BH,$nin:VH,$all:HH,$mod:UH,$exists:WH,$gte:GH,$gt:KH,$lt:qH,$lte:JH,$eq:YH,$ne:XH,$regex:ZH,$options:QH,$where:$H}),tU=class extends EH{constructor(e){super(e,{defaultOperatorName:`$eq`,operatorToConditionName:e=>e.slice(1)})}parse(e,t){return t&&t.field?wH(this.parseFieldOperators(t.field,e)):super.parse(e)}},nU=eU;function rU(e,t,n){for(let r=0,i=e.length;r<i;r++)if(n(e[r],t)===0)return!0;return!1}function iU(e,t){return Array.isArray(e)&&Number.isNaN(Number(t))}function aU(e,t,n){if(!iU(e,t))return n(e,t);let r=[];for(let i=0;i<e.length;i++){let a=n(e[i],t);a!==void 0&&(r=r.concat(a))}return r}function oU(e){return(t,n,r)=>{let i=r.get(n,t.field);return Array.isArray(i)?i.some(n=>e(t,n,r)):e(t,i,r)}}var sU=(e,t)=>e[t];function cU(e,t,n){let r=t.lastIndexOf(`.`);return r===-1?[e,t]:[n(e,t.slice(0,r)),t.slice(r+1)]}function lU(e,t,n=sU){if(t===`__itself__`)return e;if(!e)throw Error(`Unable to get field "${t}" out of ${String(e)}.`);return function(e,t,n){if(t.indexOf(`.`)===-1)return aU(e,t,n);let r=t.split(`.`),i=e;for(let e=0,t=r.length;e<t;e++)if(i=aU(i,r[e],n),!i||typeof i!=`object`)return i;return i}(e,t,n)}function uU(e,t){return e===t?0:e>t?1:-1}function dU(e,t={}){return kH(e,Object.assign({get:lU,compare:uU},t))}var fU=(e,t,{interpret:n})=>e.value.some(e=>n(e,t)),pU=(e,t,n)=>!fU(e,t,n),mU=(e,t,{interpret:n})=>e.value.every(e=>n(e,t)),hU=(e,t,{interpret:n})=>!n(e.value[0],t),gU=(e,t,{compare:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&!Array.isArray(e.value)?rU(i,e.value,n):n(i,e.value)===0},_U=(e,t,n)=>!gU(e,t,n),vU=oU((e,t,n)=>{let r=n.compare(t,e.value);return r===0||r===-1}),yU=oU((e,t,n)=>n.compare(t,e.value)===-1),bU=oU((e,t,n)=>n.compare(t,e.value)===1),xU=oU((e,t,n)=>{let r=n.compare(t,e.value);return r===0||r===1}),SU=(e,t,{get:n})=>{if(e.field===`__itself__`)return t!==void 0;let[r,i]=cU(t,e.field,n),a=t=>t==null?!!t===e.value:t.hasOwnProperty(i)===e.value;return iU(r,i)?r.some(a):a(r)},CU=oU((e,t)=>typeof t==`number`&&t%e.value[0]===e.value[1]),wU=(e,t,{get:n})=>{let[r,i]=cU(t,e.field,n),a=t=>{let r=n(t,i);return Array.isArray(r)&&r.length===e.value};return e.field!==`__itself__`&&iU(r,i)?r.some(a):a(r)},TU=oU((e,t)=>typeof t==`string`&&e.value.test(t)),EU=oU((e,t,{compare:n})=>rU(e.value,t,n)),DU=(e,t,n)=>!EU(e,t,n),OU=(e,t,{compare:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&e.value.every(e=>rU(i,e,n))},kU=(e,t,{interpret:n,get:r})=>{let i=r(t,e.field);return Array.isArray(i)&&i.some(t=>n(e.value,t))},AU=Object.freeze({__proto__:null,or:fU,nor:pU,and:mU,not:hU,eq:gU,ne:_U,lte:vU,lt:yU,gt:bU,gte:xU,exists:SU,mod:CU,size:wU,regex:TU,within:EU,nin:DU,all:OU,elemMatch:kU,where:(e,t)=>e.value.call(t)}),jU=Object.assign({},AU,{in:EU});dU(jU);function MU(e){return typeof e!=`object`||!e?e:e instanceof Date?e.getTime():e&&typeof e.toJSON==`function`?e.toJSON():e}var NU=(e,t)=>uU(MU(e),MU(t));function PU(e,t,n){let r=new tU(e),i=dU(t,Object.assign({compare:NU},n));if(n&&n.forPrimitives){let e={field:fH},t=r.parse;r.setParse(n=>t(n,e))}return AH(r.parse,i)}PU(nU,jU),PU([`$and`,`$or`].reduce((e,t)=>(e[t]=Object.assign({},e[t],{type:`field`}),e),Object.assign({},nU,{$nor:Object.assign({},nU.$nor,{type:`field`,parse:TH.compound})})),jU,{forPrimitives:!0});var FU=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t));function IU(e){return Array.isArray(e)?e:[e]}var LU=`__caslSubjectType__`;function RU(e,t){if(t){if(!FU(t,LU))Object.defineProperty(t,LU,{value:e});else if(e!==t[LU])throw Error(`Trying to cast object to subject type ${e} but previously it was casted to ${t[LU]}`)}return t}var zU=e=>{let t=typeof e;return t===`string`||t===`function`},BU=e=>e.modelName||e.name;function VU(e){return typeof e==`string`?e:BU(e)}function HU(e){return FU(e,LU)?e[LU]:BU(e.constructor)}var UU={function:e=>e.constructor,string:HU};function WU(e,t,n){for(let r=n;r<t.length;r++)e.push(t[r])}function GU(e,t){if(!e||!e.length)return t||[];if(!t||!t.length)return e||[];let n=0,r=0,i=[];for(;n<e.length&&r<t.length;)e[n].priority<t[r].priority?(i.push(e[n]),n++):(i.push(t[r]),r++);return WU(i,e,n),WU(i,t,r),i}function KU(e,t,n){let r=e.get(t);return r||(r=n(),e.set(t,r)),r}var qU=e=>e;function JU(e,t){if(Array.isArray(e.fields)&&!e.fields.length)throw Error("`rawRule.fields` cannot be an empty array. https://bit.ly/390miLa");if(e.fields&&!t.fieldMatcher)throw Error(`You need to pass "fieldMatcher" option in order to restrict access by fields`);if(e.conditions&&!t.conditionsMatcher)throw Error(`You need to pass "conditionsMatcher" option in order to restrict access by conditions`)}var YU=class{constructor(e,t,n=0){JU(e,t),this.action=t.resolveAction(e.action),this.subject=e.subject,this.inverted=!!e.inverted,this.conditions=e.conditions,this.reason=e.reason,this.origin=e,this.fields=e.fields?IU(e.fields):void 0,this.priority=n,this.t=t}i(){return this.conditions&&!this.o&&(this.o=this.t.conditionsMatcher(this.conditions)),this.o}get ast(){let e=this.i();return e?e.ast:void 0}matchesConditions(e){return this.conditions?!e||zU(e)?!this.inverted:this.i()(e):!0}matchesField(e){return this.fields?e?(this.u||=this.t.fieldMatcher(this.fields),this.u(e)):!this.inverted:!0}};function XU(e,t){let n={value:e,prev:t,next:null};return t&&(t.next=n),n}function ZU(e){e.next&&(e.next.prev=e.prev),e.prev&&(e.prev.next=e.next),e.next=e.prev=null}var QU=e=>({value:e.value,prev:e.prev,next:e.next}),$U=()=>({rules:[],merged:!1}),eW=()=>new Map,tW=class{constructor(e=[],t={}){this.h=!1,this.l=new Map,this.p={conditionsMatcher:t.conditionsMatcher,fieldMatcher:t.fieldMatcher,resolveAction:t.resolveAction||qU},this.$=t.anyAction||`manage`,this.A=t.anySubjectType||`all`,this.m=e,this.M=!!t.detectSubjectType,this.j=t.detectSubjectType||HU,this.v(e)}get rules(){return this.m}detectSubjectType(e){return zU(e)?e:e?this.j(e):this.A}update(e){let t={rules:e,ability:this,target:this};return this._(`update`,t),this.m=e,this.v(e),this._(`updated`,t),this}v(e){let t=new Map,n;for(let r=e.length-1;r>=0;r--){let i=e.length-r-1,a=new YU(e[r],this.p,i),o=IU(a.action),s=IU(a.subject||this.A);!this.h&&a.fields&&(this.h=!0);for(let e=0;e<s.length;e++){let r=KU(t,s[e],eW);n===void 0&&(n=typeof s[e]),typeof s[e]!==n&&n!==`mixed`&&(n=`mixed`);for(let e=0;e<o.length;e++)KU(r,o[e],$U).rules.push(a)}}this.l=t,n!==`mixed`&&!this.M&&(this.j=UU[n]||UU.string)}possibleRulesFor(e,t=this.A){if(!zU(t))throw Error(`"possibleRulesFor" accepts only subject types (i.e., string or class) as the 2nd parameter`);let n=KU(this.l,t,eW),r=KU(n,e,$U);if(r.merged)return r.rules;let i=e!==this.$&&n.has(this.$)?n.get(this.$).rules:void 0,a=GU(r.rules,i);return t!==this.A&&(a=GU(a,this.possibleRulesFor(e,this.A))),r.rules=a,r.merged=!0,a}rulesFor(e,t,n){let r=this.possibleRulesFor(e,t);if(n&&typeof n!=`string`)throw Error("The 3rd, `field` parameter is expected to be a string. See https://stalniy.github.io/casl/en/api/casl-ability#can-of-pure-ability for details");return this.h?r.filter(e=>e.matchesField(n)):r}actionsFor(e){if(!zU(e))throw Error(`"actionsFor" accepts only subject types (i.e., string or class) as a parameter`);let t=new Set,n=this.l.get(e);n&&Array.from(n.keys()).forEach(e=>t.add(e));let r=e===this.A?void 0:this.l.get(this.A);return r&&Array.from(r.keys()).forEach(e=>t.add(e)),Array.from(t)}on(e,t){this.F=this.F||new Map;let n=this.F,r=XU(t,n.get(e)||null);return n.set(e,r),()=>{let t=n.get(e);!r.next&&!r.prev&&t===r?n.delete(e):r===t&&n.set(e,r.prev),ZU(r)}}_(e,t){if(!this.F)return;let n=this.F.get(e)||null;for(;n!==null;){let e=n.prev?QU(n.prev):null;n.value(t),n=e}}},nW=class extends tW{can(e,t,n){let r=this.relevantRuleFor(e,t,n);return!!r&&!r.inverted}relevantRuleFor(e,t,n){let r=this.detectSubjectType(t),i=this.rulesFor(e,r,n);for(let e=0,n=i.length;e<n;e++)if(i[e].matchesConditions(t))return i[e];return null}cannot(e,t,n){return!this.can(e,t,n)}},rW=PU({$eq:YH,$ne:XH,$lt:qH,$lte:JH,$gt:KH,$gte:GH,$in:BH,$nin:VH,$all:HH,$size:zH,$regex:ZH,$options:QH,$elemMatch:RH,$exists:WH},{eq:gU,ne:_U,lt:yU,lte:vU,gt:bU,gte:xU,in:EU,nin:DU,all:OU,size:wU,regex:TU,elemMatch:kU,exists:SU,and:mU}),iW=/[-/\\^$+?.()|[\]{}]/g,aW=/\.?\*+\.?/g,oW=/\*+/,sW=/\./g;function cW(e,t,n){let r=n[0]===`*`||e[0]===`.`&&e[e.length-1]===`.`?`+`:`*`,i=e.indexOf(`**`)===-1?`[^.]`:`.`,a=e.replace(sW,`\\$&`).replace(oW,i+r);return t+e.length===n.length?`(?:${a})?`:a}function lW(e,t,n){return e===`.`&&(n[t-1]===`*`||n[t+1]===`*`)?e:`\\${e}`}function uW(e){let t=e.map(e=>e.replace(iW,lW).replace(aW,cW)),n=t.length>1?`(?:${t.join(`|`)})`:t[0];return RegExp(`^${n}$`)}var dW=e=>{let t;return n=>(t===void 0&&(t=e.every(e=>e.indexOf(`*`)===-1)?null:uW(e)),t===null?e.indexOf(n)!==-1:t.test(n))};function fW(e=[],t={}){return new nW(e,Object.assign({conditionsMatcher:rW,fieldMatcher:dW},t))}var pW=e=>`Cannot execute "${e.action}" on "${e.subjectType}"`,mW=function(e){this.message=e};mW.prototype=Object.create(Error.prototype);var hW=class extends mW{static setDefaultMessage(e){this.P=typeof e==`string`?()=>e:e}static from(e){return new this(e)}constructor(e){super(``),this.ability=e,typeof Error.captureStackTrace==`function`&&(this.name=`ForbiddenError`,Error.captureStackTrace(this,this.constructor))}setMessage(e){return this.message=e,this}throwUnlessCan(e,t,n){let r=this.unlessCan(e,t,n);if(r)throw r}unlessCan(e,t,n){let r=this.ability.relevantRuleFor(e,t,n);if(r&&!r.inverted)return;this.action=e,this.subject=t,this.subjectType=VU(this.ability.detectSubjectType(t)),this.field=n;let i=r?r.reason:``;return this.message=this.message||i||this.constructor.P(this),this}};hW.P=pW,Object.freeze({__proto__:null});var gW=new Set([`read-project-private`,`read-project-public`]),_W=[`Table`,`Row`,`Branch`,`Revision`,`Endpoint`],vW=class{ability=fW();loadedScopes=new Set;addSystemPermissions(e){let t=this.scopeToKey({type:`system`});if(this.loadedScopes.has(t))return;let n=this.permissionsToRules(e,null),r=this.expandPermissions(e,null);this.ability.update([...this.ability.rules,...n,...r]),this.loadedScopes.add(t)}addOrganizationPermissions(e,t){let n=this.scopeToKey({type:`organization`,organizationId:e});if(this.loadedScopes.has(n))return;let r={organizationId:e},i=this.permissionsToRules(t,r),a=this.expandPermissions(t,r);this.ability.update([...this.ability.rules,...i,...a]),this.loadedScopes.add(n)}addProjectPermissions(e,t){let n=this.scopeToKey({type:`project`,projectId:e});if(this.loadedScopes.has(n))return;let r={projectId:e},i=this.permissionsToRules(t,r),a=this.expandPermissions(t,r);this.ability.update([...this.ability.rules,...i,...a]),this.loadedScopes.add(n)}addPublicReadPermissions(e){let t=`public:${e}`;if(this.loadedScopes.has(t))return;let n={projectId:e},r={action:`read`,subject:`Project`,conditions:{...n,isPublic:!0}},i=_W.map(e=>({action:`read`,subject:e,conditions:{...n}}));this.ability.update([...this.ability.rules,r,...i]),this.loadedScopes.add(t)}can(e,t,n){let r=RU(t,n?{...n}:{});return this.ability.can(e,r)}cannot(e,t,n){return!this.can(e,t,n)}hasScope(e){return this.loadedScopes.has(this.scopeToKey(e))}clearAll(){this.ability.update([]),this.loadedScopes.clear()}scopeToKey(e){switch(e.type){case`system`:return`system`;case`organization`:return`organization:${e.organizationId}`;case`project`:return`project:${e.projectId}`}}permissionsToRules(e,t){return e.map(e=>this.permissionToRule(e,t))}permissionToRule(e,t){let n={action:e.action,subject:e.subject},r=this.mergeConditions(e.condition,t);return r&&(n.conditions=r),n}mergeConditions(e,t){let n=e&&Object.keys(e).length>0,r=t&&Object.keys(t).length>0;if(!(!n&&!r))return n&&r?{...e,...t}:n?{...e}:{...t}}expandPermissions(e,t){let n=[];for(let r of e)if(gW.has(r.id))for(let e of _W){let r={action:`read`,subject:e};t&&Object.keys(t).length>0&&(r.conditions={...t}),n.push(r)}return n}};Y.register(vW,()=>new vW,{scope:`singleton`});var yW=class{constructor(e){this.permissionService=e,f(this,{},{autoBind:!0})}setUserRole(e){if(e?.permissions){let t=e.permissions.map(e=>({id:e.id,action:e.action,subject:e.subject,condition:e.condition??null}));this.permissionService.addSystemPermissions(t)}}clearAll(){this.permissionService.clearAll()}get canCreateProject(){return this.permissionService.can(`create`,`Project`)}get canReadUser(){return this.permissionService.can(`read`,`User`)}get canCreateUser(){return this.permissionService.can(`create`,`User`)}get canAddUser(){return this.permissionService.can(`add`,`User`)}get canUpdateUser(){return this.permissionService.can(`update`,`User`)}get canDeleteUser(){return this.permissionService.can(`delete`,`User`)}get canManageUsers(){return this.canAddUser||this.canReadUser}get canReadOrganization(){return this.permissionService.can(`read`,`Organization`)}get canUpdateOrganization(){return this.permissionService.can(`update`,`Organization`)}get canDeleteOrganization(){return this.permissionService.can(`delete`,`Organization`)}};Y.register(yW,()=>new yW(Y.get(vW)),{scope:`singleton`});var bW=class{_contextProvider=null;constructor(e){this.permissionService=e,f(this,{},{autoBind:!0})}setContextProvider(e){this._contextProvider=e}get context(){return this._contextProvider?.()??{projectId:null,organizationId:null,isPublic:!1,projectRoleName:null}}get projectId(){return this.context.projectId}get organizationId(){return this.context.organizationId}get isPublic(){return this.context.isPublic}get projectRoleName(){return this.context.projectRoleName}getProjectContext(){let e=this.context,t={};return e.projectId&&(t.projectId=e.projectId),e.organizationId&&(t.organizationId=e.organizationId),t}can(e,t,n){let r=n??this.getProjectContext();return this.permissionService.can(e,t,Object.keys(r).length>0?r:void 0)}get canReadProject(){return this.can(`read`,`Project`,{...this.getProjectContext(),isPublic:this.context.isPublic})}get canUpdateProject(){return this.can(`update`,`Project`)}get canDeleteProject(){return this.can(`delete`,`Project`)}get canReadBranch(){return this.can(`read`,`Branch`)}get canCreateBranch(){return this.can(`create`,`Branch`)}get canDeleteBranch(){return this.can(`delete`,`Branch`)}get canReadRevision(){return this.can(`read`,`Revision`)}get canCreateRevision(){return this.can(`create`,`Revision`)}get canRevertRevision(){return this.can(`revert`,`Revision`)}get canReadTable(){return this.can(`read`,`Table`)}get canCreateTable(){return this.can(`create`,`Table`)}get canUpdateTable(){return this.can(`update`,`Table`)}get canDeleteTable(){return this.can(`delete`,`Table`)}get canReadRow(){return this.can(`read`,`Row`)}get canCreateRow(){return this.can(`create`,`Row`)}get canUpdateRow(){return this.can(`update`,`Row`)}get canDeleteRow(){return this.can(`delete`,`Row`)}get canReadEndpoint(){return this.can(`read`,`Endpoint`)}get canCreateEndpoint(){return this.can(`create`,`Endpoint`)}get canDeleteEndpoint(){return this.can(`delete`,`Endpoint`)}get canAddUser(){return this.can(`add`,`User`)}get canUpdateUser(){return this.can(`update`,`User`)}get canDeleteUser(){return this.can(`delete`,`User`)}get canReadUser(){return this.can(`read`,`User`)}get canManageApiKeys(){return this.can(`manage`,`ApiKey`)}get canManageUsers(){return this.canAddUser||this.canReadUser}get canAccessSettings(){return this.canUpdateProject||this.canDeleteProject}get canWrite(){return this.canCreateTable||this.canUpdateTable||this.canDeleteTable||this.canCreateRow||this.canUpdateRow||this.canDeleteRow}get isReadOnly(){return!this.canWrite}};Y.register(bW,()=>new bW(Y.get(vW)),{scope:`singleton`});var xW;n((()=>{xW=function(){return xW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xW.apply(this,arguments)}}))();var SW=new Map,CW=new Map,wW=!0,TW=!1;function EW(e){return e.replace(/[\s,]+/g,` `).trim()}function DW(e){return EW(e.source.body.substring(e.start,e.end))}function OW(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if(e.kind===`FragmentDefinition`){var r=e.name.value,i=DW(e.loc),a=CW.get(r);a&&!a.has(i)?wW&&console.warn(`Warning: fragment with name `+r+` already exists.
|
|
383
383
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
384
384
|
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||CW.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)}),xW(xW({},e),{definitions:n})}function kW(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&typeof r==`object`&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function AW(e){var t=EW(e);if(!SW.has(t)){var n=see(e,{experimentalFragmentVariables:TW,allowLegacyFragmentVariables:TW});if(!n||n.kind!==`Document`)throw Error(`Not a valid GraphQL document.`);SW.set(t,kW(OW(n)))}return SW.get(t)}function jW(e){var t=[...arguments].slice(1);typeof e==`string`&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&t.kind===`Document`?n+=t.loc.source.body:n+=t,n+=e[r+1]}),AW(n)}function MW(){SW.clear(),CW.clear()}function NW(){wW=!1}function PW(){TW=!0}function FW(){TW=!1}var IW={gql:jW,resetCaches:MW,disableFragmentWarnings:NW,enableExperimentalFragmentVariables:PW,disableExperimentalFragmentVariables:FW};(function(e){e.gql=IW.gql,e.resetCaches=IW.resetCaches,e.disableFragmentWarnings=IW.disableFragmentWarnings,e.enableExperimentalFragmentVariables=IW.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=IW.disableExperimentalFragmentVariables})(jW||={}),jW.default=jW;var Z=jW,LW=function(e){return e.Applied=`applied`,e.Failed=`failed`,e.Skipped=`skipped`,e}({}),RW=function(e){return e.Active=`active`,e.Cancelled=`cancelled`,e.EarlyAdopter=`early_adopter`,e.Free=`free`,e.PastDue=`past_due`,e}({}),zW=function(e){return e.Added=`ADDED`,e.Modified=`MODIFIED`,e.Removed=`REMOVED`,e.Renamed=`RENAMED`,e.RenamedAndModified=`RENAMED_AND_MODIFIED`,e}({}),BW=function(e){return e.Graphql=`GRAPHQL`,e.RestApi=`REST_API`,e}({}),VW=function(e){return e.CreatedAt=`createdAt`,e.Data=`data`,e.Id=`id`,e.PublishedAt=`publishedAt`,e.UpdatedAt=`updatedAt`,e}({}),HW=function(e){return e.Boolean=`boolean`,e.Float=`float`,e.Int=`int`,e.Text=`text`,e.Timestamp=`timestamp`,e}({}),UW=function(e){return e.Replace=`replace`,e}({}),WW=function(e){return e.Default=`default`,e.Insensitive=`insensitive`,e}({}),GW=function(e){return e.All=`all`,e.Booleans=`booleans`,e.Keys=`keys`,e.Numbers=`numbers`,e.Strings=`strings`,e.Values=`values`,e}({}),KW=function(e){return e.Phrase=`phrase`,e.Plain=`plain`,e.Prefix=`prefix`,e.Tsquery=`tsquery`,e}({}),qW=function(e){return e.Asc=`asc`,e.Desc=`desc`,e}({}),JW=function(e){return e.Developer=`developer`,e.Editor=`editor`,e.OrganizationAdmin=`organizationAdmin`,e.OrganizationOwner=`organizationOwner`,e.Reader=`reader`,e}({}),YW=function(e){return e.Developer=`developer`,e.Editor=`editor`,e.Reader=`reader`,e}({}),XW=function(e){return e.SystemAdmin=`systemAdmin`,e.SystemFullApiRead=`systemFullApiRead`,e.SystemUser=`systemUser`,e}({}),ZW=Z`
|
|
385
385
|
fragment BranchLoaderFragment on BranchModel {
|
|
@@ -2163,7 +2163,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
|
|
|
2163
2163
|
}
|
|
2164
2164
|
}
|
|
2165
2165
|
${LG}
|
|
2166
|
-
`,jq=(e,t,n,r)=>e();function Mq(e,t=jq){return{getBranchForLoader(n,r){return t(t=>e.request(RG,n,{...r,...t}),`getBranchForLoader`,`query`,n)},organizationProjects(n,r){return t(t=>e.request(zG,n,{...r,...t}),`organizationProjects`,`query`,n)},getProject(n,r){return t(t=>e.request(BG,n,{...r,...t}),`getProject`,`query`,n)},getProjectForLoader(n,r){return t(t=>e.request(VG,n,{...r,...t}),`getProjectForLoader`,`query`,n)},getRevisionForLoader(n,r){return t(t=>e.request(HG,n,{...r,...t}),`getRevisionForLoader`,`query`,n)},getRowForLoader(n,r){return t(t=>e.request(UG,n,{...r,...t}),`getRowForLoader`,`query`,n)},getRowCountForeignKeysToForLoader(n,r){return t(t=>e.request(WG,n,{...r,...t}),`getRowCountForeignKeysToForLoader`,`query`,n)},ForeignKeysBy(n,r){return t(t=>e.request(GG,n,{...r,...t}),`ForeignKeysBy`,`query`,n)},ForeignKeysByRows(n,r){return t(t=>e.request(KG,n,{...r,...t}),`ForeignKeysByRows`,`query`,n)},getTableForLoader(n,r){return t(t=>e.request(qG,n,{...r,...t}),`getTableForLoader`,`query`,n)},updatePassword(n,r){return t(t=>e.request(JG,n,{...r,...t}),`updatePassword`,`mutation`,n)},myApiKeys(n,r){return t(t=>e.request(YG,n,{...r,...t}),`myApiKeys`,`query`,n)},serviceApiKeys(n,r){return t(t=>e.request(XG,n,{...r,...t}),`serviceApiKeys`,`query`,n)},apiKeyById(n,r){return t(t=>e.request(ZG,n,{...r,...t}),`apiKeyById`,`query`,n)},createPersonalApiKey(n,r){return t(t=>e.request(QG,n,{...r,...t}),`createPersonalApiKey`,`mutation`,n)},createServiceApiKey(n,r){return t(t=>e.request($G,n,{...r,...t}),`createServiceApiKey`,`mutation`,n)},revokeApiKey(n,r){return t(t=>e.request(eK,n,{...r,...t}),`revokeApiKey`,`mutation`,n)},rotateApiKey(n,r){return t(t=>e.request(tK,n,{...r,...t}),`rotateApiKey`,`mutation`,n)},createProject(n,r){return t(t=>e.request(nK,n,{...r,...t}),`createProject`,`mutation`,n)},findForeignKey(n,r){return t(t=>e.request(rK,n,{...r,...t}),`findForeignKey`,`query`,n)},adminCacheStats(n,r){return t(t=>e.request(iK,n,{...r,...t}),`adminCacheStats`,`query`,n)},adminResetAllCache(n,r){return t(t=>e.request(aK,n,{...r,...t}),`adminResetAllCache`,`mutation`,n)},AdminDashboardStats(n,r){return t(t=>e.request(oK,n,{...r,...t}),`AdminDashboardStats`,`query`,n)},adminGetUser(n,r){return t(t=>e.request(sK,n,{...r,...t}),`adminGetUser`,`query`,n)},adminResetPassword(n,r){return t(t=>e.request(cK,n,{...r,...t}),`adminResetPassword`,`mutation`,n)},adminUsers(n,r){return t(t=>e.request(lK,n,{...r,...t}),`adminUsers`,`query`,n)},adminUser(n,r){return t(t=>e.request(uK,n,{...r,...t}),`adminUser`,`query`,n)},assetsTablesData(n,r){return t(t=>e.request(dK,n,{...r,...t}),`assetsTablesData`,`query`,n)},assetsRowsData(n,r){return t(t=>e.request(fK,n,{...r,...t}),`assetsRowsData`,`query`,n)},subSchemaItemsData(n,r){return t(t=>e.request(pK,n,{...r,...t}),`subSchemaItemsData`,`query`,n)},getProjectBranches(n,r){return t(t=>e.request(mK,n,{...r,...t}),`getProjectBranches`,`query`,n)},deleteBranch(n,r){return t(t=>e.request(hK,n,{...r,...t}),`deleteBranch`,`mutation`,n)},getBranchesForSelect(n,r){return t(t=>e.request(gK,n,{...r,...t}),`getBranchesForSelect`,`query`,n)},getBranchRevisionsForCreate(n,r){return t(t=>e.request(_K,n,{...r,...t}),`getBranchRevisionsForCreate`,`query`,n)},createBranch(n,r){return t(t=>e.request(vK,n,{...r,...t}),`createBranch`,`mutation`,n)},GetRevisionChanges(n,r){return t(t=>e.request(yK,n,{...r,...t}),`GetRevisionChanges`,`query`,n)},GetTableChanges(n,r){return t(t=>e.request(bK,n,{...r,...t}),`GetTableChanges`,`query`,n)},confirmEmailCode(n,r){return t(t=>e.request(xK,n,{...r,...t}),`confirmEmailCode`,`mutation`,n)},getEndpointBranches(n,r){return t(t=>e.request(SK,n,{...r,...t}),`getEndpointBranches`,`query`,n)},getProjectEndpoints(n,r){return t(t=>e.request(CK,n,{...r,...t}),`getProjectEndpoints`,`query`,n)},getBranchRevisions(n,r){return t(t=>e.request(wK,n,{...r,...t}),`getBranchRevisions`,`query`,n)},createEndpoint(n,r){return t(t=>e.request(TK,n,{...r,...t}),`createEndpoint`,`mutation`,n)},deleteEndpoint(n,r){return t(t=>e.request(EK,n,{...r,...t}),`deleteEndpoint`,`mutation`,n)},issueAccessToken(n,r){return t(t=>e.request(DK,n,{...r,...t}),`issueAccessToken`,`query`,n)},loginGithub(n,r){return t(t=>e.request(OK,n,{...r,...t}),`loginGithub`,`mutation`,n)},loginGoogle(n,r){return t(t=>e.request(kK,n,{...r,...t}),`loginGoogle`,`mutation`,n)},login(n,r){return t(t=>e.request(AK,n,{...r,...t}),`login`,`mutation`,n)},getMigrationBranches(n,r){return t(t=>e.request(jK,n,{...r,...t}),`getMigrationBranches`,`query`,n)},getBranchMigrations(n,r){return t(t=>e.request(MK,n,{...r,...t}),`getBranchMigrations`,`query`,n)},applyMigrations(n,r){return t(t=>e.request(NK,n,{...r,...t}),`applyMigrations`,`mutation`,n)},getMigrations(n,r){return t(t=>e.request(PK,n,{...r,...t}),`getMigrations`,`query`,n)},activateEarlyAccess(n,r){return t(t=>e.request(FK,n,{...r,...t}),`activateEarlyAccess`,`mutation`,n)},createCheckout(n,r){return t(t=>e.request(IK,n,{...r,...t}),`createCheckout`,`mutation`,n)},cancelSubscription(n,r){return t(t=>e.request(LK,n,{...r,...t}),`cancelSubscription`,`mutation`,n)},getLimitsPageData(n,r){return t(t=>e.request(RK,n,{...r,...t}),`getLimitsPageData`,`query`,n)},getLimitsPagePlans(n,r){return t(t=>e.request(zK,n,{...r,...t}),`getLimitsPagePlans`,`query`,n)},getUsersOrganization(n,r){return t(t=>e.request(BK,n,{...r,...t}),`getUsersOrganization`,`query`,n)},addUserToOrganization(n,r){return t(t=>e.request(VK,n,{...r,...t}),`addUserToOrganization`,`mutation`,n)},removeUserFromOrganization(n,r){return t(t=>e.request(HK,n,{...r,...t}),`removeUserFromOrganization`,`mutation`,n)},adminValidateProjectFileBytes(n,r){return t(t=>e.request(UK,n,{...r,...t}),`adminValidateProjectFileBytes`,`query`,n)},adminRestoreProjectFileBytes(n,r){return t(t=>e.request(WK,n,{...r,...t}),`adminRestoreProjectFileBytes`,`mutation`,n)},updateProject(n,r){return t(t=>e.request(GK,n,{...r,...t}),`updateProject`,`mutation`,n)},deleteProjectForSettings(n,r){return t(t=>e.request(KK,n,{...r,...t}),`deleteProjectForSettings`,`mutation`,n)},fetchTableForStack(n,r){return t(t=>e.request(qK,n,{...r,...t}),`fetchTableForStack`,`query`,n)},createTableForStack(n,r){return t(t=>e.request(JK,n,{...r,...t}),`createTableForStack`,`mutation`,n)},updateTableForStack(n,r){return t(t=>e.request(YK,n,{...r,...t}),`updateTableForStack`,`mutation`,n)},renameTableForStack(n,r){return t(t=>e.request(XK,n,{...r,...t}),`renameTableForStack`,`mutation`,n)},rowPageData(n,r){return t(t=>e.request(ZK,n,{...r,...t}),`rowPageData`,`query`,n)},signUp(n,r){return t(t=>e.request(QK,n,{...r,...t}),`signUp`,`mutation`,n)},setUsername(n,r){return t(t=>e.request($K,n,{...r,...t}),`setUsername`,`mutation`,n)},getUsersProject(n,r){return t(t=>e.request(eq,n,{...r,...t}),`getUsersProject`,`query`,n)},searchUsers(n,r){return t(t=>e.request(tq,n,{...r,...t}),`searchUsers`,`query`,n)},addUserToProject(n,r){return t(t=>e.request(nq,n,{...r,...t}),`addUserToProject`,`mutation`,n)},removeUserFromProject(n,r){return t(t=>e.request(rq,n,{...r,...t}),`removeUserFromProject`,`mutation`,n)},updateUserProjectRole(n,r){return t(t=>e.request(iq,n,{...r,...t}),`updateUserProjectRole`,`mutation`,n)},createUser(n,r){return t(t=>e.request(aq,n,{...r,...t}),`createUser`,`mutation`,n)},configuration(n,r){return t(t=>e.request(oq,n,{...r,...t}),`configuration`,`query`,n)},getMe(n,r){return t(t=>e.request(sq,n,{...r,...t}),`getMe`,`query`,n)},getProjectGraph(n,r){return t(t=>e.request(cq,n,{...r,...t}),`getProjectGraph`,`query`,n)},findBranches(n,r){return t(t=>e.request(lq,n,{...r,...t}),`findBranches`,`query`,n)},findRevisions(n,r){return t(t=>e.request(uq,n,{...r,...t}),`findRevisions`,`query`,n)},meProjectsList(n,r){return t(t=>e.request(dq,n,{...r,...t}),`meProjectsList`,`query`,n)},GetRowChanges(n,r){return t(t=>e.request(fq,n,{...r,...t}),`GetRowChanges`,`query`,n)},GetTableChangesForFilter(n,r){return t(t=>e.request(pq,n,{...r,...t}),`GetTableChangesForFilter`,`query`,n)},foreignKeyTableWithRows(n,r){return t(t=>e.request(mq,n,{...r,...t}),`foreignKeyTableWithRows`,`query`,n)},createRowForStack(n,r){return t(t=>e.request(hq,n,{...r,...t}),`createRowForStack`,`mutation`,n)},updateRowForStack(n,r){return t(t=>e.request(gq,n,{...r,...t}),`updateRowForStack`,`mutation`,n)},renameRowForStack(n,r){return t(t=>e.request(_q,n,{...r,...t}),`renameRowForStack`,`mutation`,n)},RowListRows(n,r){return t(t=>e.request(vq,n,{...r,...t}),`RowListRows`,`query`,n)},DeleteRow(n,r){return t(t=>e.request(yq,n,{...r,...t}),`DeleteRow`,`mutation`,n)},DeleteRows(n,r){return t(t=>e.request(bq,n,{...r,...t}),`DeleteRows`,`mutation`,n)},PatchRowInline(n,r){return t(t=>e.request(xq,n,{...r,...t}),`PatchRowInline`,`mutation`,n)},GetTableViews(n,r){return t(t=>e.request(Sq,n,{...r,...t}),`GetTableViews`,`query`,n)},UpdateTableViews(n,r){return t(t=>e.request(Cq,n,{...r,...t}),`UpdateTableViews`,`mutation`,n)},searchRows(n,r){return t(t=>e.request(wq,n,{...r,...t}),`searchRows`,`query`,n)},revertChangesForSidebar(n,r){return t(t=>e.request(Tq,n,{...r,...t}),`revertChangesForSidebar`,`mutation`,n)},createRevisionForSidebar(n,r){return t(t=>e.request(Eq,n,{...r,...t}),`createRevisionForSidebar`,`mutation`,n)},createBranchForSidebar(n,r){return t(t=>e.request(Dq,n,{...r,...t}),`createBranchForSidebar`,`mutation`,n)},deleteTableForList(n,r){return t(t=>e.request(Oq,n,{...r,...t}),`deleteTableForList`,`mutation`,n)},tableListData(n,r){return t(t=>e.request(kq,n,{...r,...t}),`tableListData`,`query`,n)},tableRelationsData(n,r){return t(t=>e.request(Aq,n,{...r,...t}),`tableRelationsData`,`query`,n)}}}var Nq=class{constructor(){}get(e){let t=globalThis.__env__?.[e],n={BASE_URL:`/`,DEV:!1,GIT_BRANCH_NAME:`HEAD`,GIT_COMMIT_HASH:`59fa0fa`,MODE:`production`,PACKAGE_VERSION:`2.7.0-alpha.2`,PROD:!0,REACT_APP_ENDPOINT_HOST:``,REACT_APP_ENDPOINT_PORT:``,REACT_APP_ENDPOINT_SERVER_URL:`/endpoint`,REACT_APP_GRAPHQL_SERVER_URL:`/graphql`,REACT_APP_SWAGGER_SERVER_URL:`/api`,SSR:!1}[e];return t||n}};Y.register(Nq,()=>new Nq,{scope:`singleton`});var Pq=`revisium:sidebar-collapsed`,Fq=200,Iq=class{_isCollapsed=!1;_isHoverExpanded=!1;_hoverDelay=new cH(Fq);_leaveDelay=new cH(Fq);_keyboardHandler=null;constructor(e){this.storage=e,this._isCollapsed=e.getItem(Pq)===`true`,f(this,{},{autoBind:!0}),s(()=>this._isCollapsed,e=>{this.storage.setItem(Pq,String(e))})}get isCollapsed(){return this._isCollapsed}get isHoverExpanded(){return this._isHoverExpanded}get isSidebarVisible(){return!this._isCollapsed||this._isHoverExpanded}toggle(){this._isCollapsed=!this._isCollapsed,this._isHoverExpanded=!1}setHoverExpanded(e){this._isHoverExpanded=e}startHoverIntent(){this._leaveDelay.cancel(),this._hoverDelay.schedule(()=>{this.setHoverExpanded(!0)})}cancelHoverIntent(){this._hoverDelay.cancel()}startLeaveIntent(){this._leaveDelay.schedule(()=>{this.setHoverExpanded(!1)})}cancelLeaveIntent(){this._leaveDelay.cancel()}dismissOverlay(){this.setHoverExpanded(!1)}initKeyboard(){this._keyboardHandler||(this._keyboardHandler=e=>{(e.metaKey||e.ctrlKey)&&e.key===`\\`&&(e.preventDefault(),this.toggle())},globalThis.addEventListener(`keydown`,this._keyboardHandler))}disposeKeyboard(){this._keyboardHandler&&=(globalThis.removeEventListener(`keydown`,this._keyboardHandler),null),this._hoverDelay.dispose(),this._leaveDelay.dispose()}};Y.register(Iq,()=>new Iq(localStorage),{scope:`singleton`});var Lq=({sidebar:e,footer:t})=>(0,I.jsxs)(I.Fragment,{children:[e,t&&(0,I.jsx)(A,{alignSelf:`center`,mt:`1rem`,children:t})]}),Rq=288,zq=48,Bq=`0.2s`,Vq=g(({hideSidebar:e,sidebar:t,title:n,actions:r,children:i,footer:a})=>{let o=Y.get(Iq);(0,L.useEffect)(()=>(o.initKeyboard(),()=>{o.disposeKeyboard()}),[o]);let s=!e,c=s&&o.isCollapsed,l=c&&o.isHoverExpanded,u=s?c?`${zq}px`:`${Rq}px`:`0px`;return(0,I.jsxs)(j,{minHeight:`100vh`,children:[s&&(0,I.jsx)(j,{width:u,minWidth:u,flexShrink:0,height:`100vh`,top:0,position:`sticky`,transition:`width ${Bq} ease, min-width ${Bq} ease`,overflow:`hidden`,children:c?(0,I.jsx)(j,{width:`${zq}px`,minWidth:`${zq}px`,height:`100vh`,flexDirection:`column`,alignItems:`center`,paddingTop:`20px`,onMouseEnter:o.startHoverIntent,onMouseLeave:o.cancelHoverIntent,children:(0,I.jsx)(A,{as:`button`,fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.600`},display:`flex`,alignItems:`center`,onClick:o.toggle,"aria-label":`Toggle sidebar`,children:(0,I.jsx)(Zte,{})})}):(0,I.jsx)(j,{width:`${Rq}px`,minWidth:`${Rq}px`,borderRight:`1px solid`,borderRightColor:`newGray.100`,flexDirection:`column`,justifyContent:t?`space-between`:`flex-end`,padding:`16px`,height:`100vh`,children:(0,I.jsx)(Lq,{sidebar:t,footer:a})})}),c&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(A,{position:`fixed`,left:0,top:0,width:`100vw`,height:`100vh`,zIndex:9,pointerEvents:l?`auto`:`none`,onClick:o.dismissOverlay}),(0,I.jsx)(j,{position:`fixed`,left:0,top:0,width:`${Rq}px`,height:`100vh`,zIndex:10,backgroundColor:`white`,borderRight:`1px solid`,borderRightColor:`newGray.100`,flexDirection:`column`,justifyContent:t?`space-between`:`flex-end`,padding:`16px`,boxShadow:l?`4px 0 12px rgba(0, 0, 0, 0.08)`:`none`,transform:l?`translateX(0)`:`translateX(-${Rq}px)`,transition:`transform ${Bq} ease, box-shadow ${Bq} ease`,onMouseLeave:o.startLeaveIntent,onMouseEnter:o.cancelLeaveIntent,pointerEvents:l?`auto`:`none`,children:(0,I.jsx)(Lq,{sidebar:t,footer:a})})]}),(0,I.jsxs)(j,{flex:1,minWidth:0,flexDirection:`column`,alignItems:`center`,children:[(n||r)&&(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`white`,borderBottom:`1px solid`,borderBottomColor:`gray.50`,justifyContent:`space-between`,maxWidth:`900px`,padding:`8px`,width:`100%`,position:`sticky`,zIndex:1,top:0,children:[n,r]}),(0,I.jsx)(j,{flex:1,flexDirection:`column`,maxWidth:`900px`,padding:`1rem 1rem 0rem 1rem`,width:`100%`,children:i})]})]})}),Hq=({height:e=`2.5rem`,title:t,onClick:n,disabled:r,isSelected:i,isLoading:a,icon:o,dataTestId:s})=>(0,I.jsx)(N,{"data-testid":s,_hover:{color:`gray.400`,backgroundColor:`white`},_disabled:i?{backgroundColor:`gray.50`,cursor:`not-allowed`}:void 0,alignSelf:`flex-start`,color:`gray.300`,fontWeight:`500`,fontSize:16,height:e,disabled:r||i,loading:a,variant:`ghost`,onClick:n,children:(0,I.jsxs)(j,{alignItems:`center`,gap:`0.5rem`,children:[o&&(0,I.jsx)(A,{fontSize:`sm`,children:o}),(0,I.jsx)(k,{children:t})]})}),Uq=e=>(0,I.jsx)(Hq,{...e,icon:(0,I.jsx)(af,{})}),Wq=({height:e=`2.5rem`,loading:t,isDisabled:n,onClick:r,title:i,dataTestId:a})=>(0,I.jsxs)(N,{"data-testid":a,_hover:{backgroundColor:`gray.50`},alignSelf:`flex-start`,color:`gray.400`,height:e,loading:t,disabled:n,variant:`ghost`,onClick:r,width:`48px`,children:[(0,I.jsx)(Ve,{size:`sm`,mr:i?8:0,children:(0,I.jsx)(ef,{})}),i]}),Gq=({height:e=`2.5rem`,onClick:t,disabled:n,dataTestId:r})=>(0,I.jsx)(N,{"data-testid":r,disabled:n,_hover:{backgroundColor:`gray.50`},alignSelf:`flex-start`,color:`gray.400`,height:e,variant:`ghost`,onClick:t,width:`48px`,children:(0,I.jsx)(Ve,{size:`md`,children:(0,I.jsx)(ip,{})})}),Kq=({dataTestId:e,...t})=>(0,I.jsx)(Ze,{"data-testid":e,_hover:{backgroundColor:`gray.100`},color:`gray.400`,variant:`ghost`,size:`lg`,width:`40px`,height:`40px`,...t,children:(0,I.jsx)(nf,{})}),qq=({value:e,placeholder:t,autoFocus:n,onChange:r,onBlur:i,onEnter:a,width:o,height:s,type:c,dataTestId:l,autoComplete:u})=>{let d=SB();return(0,I.jsx)(qt,{autoComplete:u,"data-testid":l,borderColor:`gray.100`,padding:`0 9px`,placeholder:t,ref:n?d:void 0,value:e,variant:`outline`,onChange:r,onBlur:i,width:o,height:s,type:c,onKeyDown:a?e=>{e.key===`Enter`&&a()}:void 0})},Jq=Rd({placement:`top`,pauseOnPageIdle:!0,duration:1500}),Yq=Rd({placement:`bottom`,pauseOnPageIdle:!0,duration:1500}),Xq=e=>(0,I.jsxs)(_t,{width:{md:`sm`},children:[e.type===`loading`?(0,I.jsx)(Ht,{size:`sm`,color:`blue.solid`}):(0,I.jsx)(ft,{}),(0,I.jsxs)(_e,{gap:`1`,flex:`1`,maxWidth:`100%`,children:[e.title&&(0,I.jsx)(eee,{children:e.title}),e.description&&(0,I.jsx)(ree,{color:`gray.500`,children:e.description})]}),e.action&&(0,I.jsx)(lt,{children:e.action.label}),e.closable&&(0,I.jsx)(Ft,{})]}),Zq=()=>(0,I.jsxs)(R,{children:[(0,I.jsx)(Rt,{toaster:Jq,insetInline:{mdDown:`4`},children:e=>(0,I.jsx)(Xq,{...e})}),(0,I.jsx)(Rt,{toaster:Yq,insetInline:{mdDown:`4`},children:e=>(0,I.jsx)(Xq,{...e})})]}),Qq=L.forwardRef(function(e,t){let{showArrow:n,children:r,disabled:i,portalled:a=!0,content:o,contentProps:s,portalRef:c,...l}=e;return i?r:(0,I.jsxs)(Wt,{...l,children:[(0,I.jsx)(Qt,{asChild:!0,children:r}),(0,I.jsx)(R,{disabled:!a,container:c,children:(0,I.jsx)(rt,{children:(0,I.jsxs)(Et,{ref:t,...s,children:[n&&(0,I.jsx)(Vt,{children:(0,I.jsx)(Yt,{})}),o]})})})]})}),$q={deprecated:{type:`boolean`},title:{type:`string`},description:{type:`string`}};({...$q});var eJ={type:{const:`string`},default:{type:`string`},readOnly:{type:`boolean`},pattern:{type:`string`,format:`regex`},enum:{type:`array`,items:{type:`string`},minItems:1,uniqueItems:!0},format:{type:`string`,enum:[`date-time`,`date`,`time`,`email`,`regex`]},contentMediaType:{type:`string`,enum:[`text/plain`,`text/markdown`,`text/html`,`application/json`,`application/schema+json`,`application/yaml`]},...$q};({...eJ}),{...eJ},{...$q},{...$q},{...$q},{...$q};var tJ=new(e(vd(),1)).default;tJ.addKeyword({keyword:`foreignKey`,type:`string`}),tJ.addFormat(`regex`,{type:`string`,validate:e=>{try{return new RegExp(e),!0}catch{return!1}}});var nJ=(e,t)=>({result:tJ.validate(e,t),errors:tJ.errors}),rJ=({dataTestId:e,...t})=>(0,I.jsx)(Ze,{"data-testid":e,_hover:{backgroundColor:`gray.100`},color:`gray.400`,variant:`ghost`,...t,children:(0,I.jsx)(qf,{})}),iJ={JsonCard:`_JsonCard_15gzu_1`,CopyButton:`_CopyButton_15gzu_1`},aJ=({data:e,readonly:t,onChange:n,schema:r,onBlur:i})=>{let[a,o]=(0,L.useState)(``),s=JSON.stringify(e,null,3),[c,l]=(0,L.useState)(s),u=(0,L.useRef)(!1),d=u.current?c:s,f=(0,L.useCallback)(async()=>{await navigator.clipboard.writeText(d),Jq.info({duration:1500,description:`Copied to clipboard`})},[d]),p=(0,L.useCallback)(e=>{l(e);try{let t=JSON.parse(e);if(r){let e=nJ(r,t);if(!e.result){o(`"${e.errors?.[0]?.instancePath||`/`}": ${e.errors?.[0]?.message}`);return}}o(``),n?.(t)}catch(e){console.error(e),o(`Invalid JSON`)}},[n,r]),m=(0,L.useCallback)(()=>{u.current=!0,l(s)},[s]),h=(0,L.useCallback)(()=>{u.current=!1,l(s),i?.()},[i,s]);return(0,I.jsxs)(j,{position:`relative`,width:`100%`,flex:1,className:iJ.JsonCard,direction:`column`,gap:`1rem`,children:[(0,I.jsxs)(A,{p:1,flex:1,children:[(0,I.jsx)(DO,{value:d,extensions:[G.lineWrapping,nk()],editable:!t,theme:pC,maxWidth:`100%`,basicSetup:{lineNumbers:!0,foldGutter:!0},onChange:p,onFocus:m,onBlur:h}),(0,I.jsx)(rJ,{dataTestId:`json-card-copy-button`,"aria-label":``,position:`absolute`,top:`8px`,right:`8px`,className:iJ.CopyButton,onClick:f})]}),(0,I.jsx)(j,{height:`40px`,paddingBottom:`8px`,alignItems:`flex-end`,backgroundColor:`white`,width:`100%`,position:`sticky`,bottom:0,justifyContent:`center`,children:(0,I.jsx)(k,{color:`gray`,children:a})})]})},oJ=g(()=>{let e=Y.get(Iq),t=e.isCollapsed&&e.isHoverExpanded,n=t?`Expand sidebar`:`Collapse sidebar`,r=t?Ite:Fte;return(0,I.jsx)(Qq,{content:n,children:(0,I.jsx)(A,{as:`button`,fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.600`},display:`flex`,alignItems:`center`,flexShrink:0,onClick:e.toggle,opacity:+!!t,_groupHover:{opacity:1},transition:`opacity 0.15s ease`,"aria-label":n,children:(0,I.jsx)(r,{})})})}),sJ=({to:e,label:t,isActive:n,icon:r,onClick:i,badge:a})=>{let o=(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:n?`newGray.100`:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:n?`black`:`newGray.600`,fontWeight:`400`,textDecoration:`none`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,onClick:i,children:[r&&(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:r}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:t}),a!=null&&a>0&&(0,I.jsx)(A,{fontSize:`11px`,fontWeight:`600`,color:`newGray.400`,backgroundColor:`newGray.100`,borderRadius:`4px`,paddingX:`6px`,paddingY:`2px`,minWidth:`20px`,textAlign:`center`,children:a>99?`99+`:a})]});return e&&!i?(0,I.jsx)(An,{to:e,style:{textDecoration:`none`,width:`100%`},children:o}):o},cJ=g(({model:e,roleSlot:t,disableRemove:n})=>(0,I.jsx)(A,{borderWidth:`1px`,borderColor:`newGray.200`,borderRadius:`md`,padding:`1rem`,backgroundColor:`white`,_hover:{borderColor:`newGray.300`},transition:`border-color 0.2s`,children:(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsxs)(P,{gap:3,children:[(0,I.jsx)(A,{color:`newGray.400`,children:(0,I.jsx)(zf,{size:20})}),(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontWeight:`500`,color:`newGray.600`,children:e.displayName}),e.username&&e.email&&(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,children:e.email})]})]}),(0,I.jsxs)(P,{gap:3,children:[t,e.canRemove&&(0,I.jsx)(N,{variant:`ghost`,size:`sm`,color:`red.500`,onClick:()=>e.remove(),loading:e.isRemoving,disabled:n,children:(0,I.jsx)(Rf,{})})]})]})})),lJ=g(({model:e,title:t,roleSelect:n})=>(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`lg`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:t})}),(0,I.jsx)(be,{children:(0,I.jsxs)(rn,{value:e.activeTab,onValueChange:({value:t})=>e.setActiveTab(t),children:[(0,I.jsxs)(et,{marginBottom:`1rem`,children:[(0,I.jsx)(fn,{value:`search`,children:`Search User`}),e.canCreateUser&&(0,I.jsx)(fn,{value:`create`,children:`Create New`})]}),(0,I.jsx)(bt,{value:`search`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Search by username or email`}),(0,I.jsx)(qt,{placeholder:`Enter username or email...`,value:e.searchQuery,onChange:t=>e.setSearchQuery(t.target.value),autoComplete:`off`})]}),e.isSearching?(0,I.jsx)(j,{justify:`center`,padding:`2rem`,children:(0,I.jsx)(Ht,{})}):e.searchResults.length>0?(0,I.jsx)(M,{align:`stretch`,gap:`0.5rem`,maxHeight:`200px`,overflowY:`auto`,children:e.searchResults.map(t=>(0,I.jsx)(A,{padding:`0.75rem`,borderWidth:`1px`,borderColor:e.selectedUserId===t.id?`blue.500`:`newGray.200`,borderRadius:`md`,backgroundColor:e.selectedUserId===t.id?`blue.50`:`white`,cursor:`pointer`,onClick:()=>e.setSelectedUserId(t.id),_hover:{borderColor:`blue.300`},transition:`all 0.2s`,children:(0,I.jsxs)(j,{align:`center`,justify:`space-between`,children:[(0,I.jsxs)(j,{align:`center`,gap:2,children:[(0,I.jsx)(zf,{size:16}),(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,children:t.username||t.email||t.id}),t.username&&t.email&&(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:t.email})]})]}),e.selectedUserId===t.id&&(0,I.jsx)(Lte,{size:16,color:`var(--chakra-colors-blue-500)`})]})},t.id))}):e.searchQuery.length>0?(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,textAlign:`center`,padding:`2rem`,children:`No users found`}):null,(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Role`}),n]})]})}),e.canCreateUser&&(0,I.jsx)(bt,{value:`create`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username *`}),(0,I.jsx)(qt,{placeholder:`Enter username...`,value:e.newUsername,onChange:t=>e.setNewUsername(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Password *`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter password (min 6 characters)...`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email (optional)`}),(0,I.jsx)(qt,{type:`email`,placeholder:`Enter email...`,value:e.newEmail,onChange:t=>e.setNewEmail(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Role`}),n]})]})})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(N,{variant:`outline`,onClick:e.close,children:`Cancel`}),e.activeTab===`search`?(0,I.jsx)(N,{onClick:e.addSelectedUser,disabled:!e.canAddSelectedUser,loading:e.isAdding,children:`Add User`}):(0,I.jsx)(N,{onClick:e.createAndAddUser,disabled:!e.canCreateNewUser,loading:e.isCreating,children:`Create & Add`})]}),(0,I.jsx)(Ie,{})]})})]})})),uJ=g(({model:e,sidebar:t,label:n,emptyTitle:r,emptySubtitle:i,subtitle:a,onAddClick:o,modal:s,children:c})=>e.showInitialLoading?(0,I.jsx)(Vq,{sidebar:t,children:(0,I.jsx)(j,{justify:`center`,align:`center`,height:`200px`,children:(0,I.jsx)(Ht,{})})}):e.showError?(0,I.jsx)(Vq,{sidebar:t,children:(0,I.jsx)(j,{justify:`center`,align:`center`,height:`200px`,children:(0,I.jsxs)(k,{color:`red.500`,children:[`Error loading `,n.toLowerCase()]})})}):e.showNoMembers?(0,I.jsxs)(Vq,{sidebar:t,children:[(0,I.jsx)(A,{mb:`4rem`,children:(0,I.jsxs)(j,{justify:`center`,align:`center`,height:`200px`,flexDirection:`column`,gap:4,children:[(0,I.jsxs)(A,{textAlign:`center`,children:[(0,I.jsx)(Bf,{size:48,color:`var(--chakra-colors-newGray-400)`,style:{margin:`0 auto`}}),(0,I.jsx)(k,{color:`newGray.400`,mt:2,children:r}),(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,mt:1,children:i})]}),e.canAddMember&&(0,I.jsxs)(N,{color:`gray`,variant:`ghost`,size:`sm`,onClick:o,focusRing:`none`,children:[(0,I.jsx)(Pf,{}),`Add`]})]})}),s]}):(0,I.jsxs)(Vq,{sidebar:t,children:[(0,I.jsxs)(A,{mb:`4rem`,children:[(0,I.jsxs)(j,{justify:`space-between`,align:`center`,marginBottom:`0.5rem`,children:[(0,I.jsxs)(k,{fontSize:`20px`,fontWeight:`600`,color:`newGray.500`,children:[n,` (`,e.totalCount,`)`]}),e.canAddMember&&(0,I.jsxs)(N,{color:`gray`,variant:`ghost`,size:`sm`,onClick:o,children:[(0,I.jsx)(Pf,{}),`Add`]})]}),(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,marginBottom:`1.5rem`,children:a}),(0,I.jsx)(M,{align:`stretch`,gap:3,children:c}),e.hasNextPage&&(0,I.jsx)(j,{justify:`center`,mt:4,children:(0,I.jsx)(N,{variant:`plain`,onClick:()=>e.tryToFetchNextPage(),loading:e.isLoading,children:`Load more`})})]}),s]})),dJ=class e{graphQLClient;client;onUnauthorized=null;constructor(t){this.environmentService=t;let n=this.environmentService.get(`REACT_APP_GRAPHQL_SERVER_URL`);if(!n)throw Error(`Invalid REACT_APP_GRAPHQL_SERVER_URL`);this.graphQLClient=new cee(n,{credentials:`include`,responseMiddleware:t=>{if(t instanceof Pn&&e.isUnauthorized(t))return;let n=t?.response?.errors?.[0]?.message;n&&Jq.info({duration:3e3,description:n})}}),this.wrapRequestWithRefreshRetry(),this.client=Mq(this.graphQLClient)}setToken(e){this.graphQLClient.setHeaders(e?{Authorization:`Bearer ${e}`}:{})}setUnauthorizedHandler(e){this.onUnauthorized=e}wrapRequestWithRefreshRetry(){let t=this.graphQLClient.request.bind(this.graphQLClient),n=async(n,r,i)=>{try{return await t(n,r,i)}catch(a){if(!e.isUnauthorized(a)||!this.onUnauthorized||!await this.onUnauthorized())throw a;return await t(n,r,i)}};this.graphQLClient.request=n}static isUnauthorized(e){if(!(e instanceof Pn))return!1;if(e.response.status===401)return!0;let t=e.response?.errors;return!Array.isArray(t)||t.length===0?!1:t.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e,n=typeof t.message==`string`?t.message:``;if(/^unauthorized$/i.test(n.trim()))return!0;let r=t.extensions?.code;return!!(typeof r==`string`&&/^UNAUTHENTICATED$/i.test(r)||t.extensions?.originalError?.statusCode===401)})}};Y.register(dJ,()=>new dJ(Y.get(Nq)),{scope:`singleton`});var Q=Y.get(dJ).client,fJ=`/api/auth/refresh`,pJ=`/api/auth/logout`,mJ=`rev_session`,hJ=class e{isLoaded=!1;user=null;token=null;refreshPromise=null;constructor(e,t,n){this.apiService=e,this.systemPermissions=t,this.permissionService=n,f(this),this.apiService.setUnauthorizedHandler(()=>this.tryRefresh())}async initialize(){if(!e.hasSessionCookie()){c(()=>{this.isLoaded=!0});return}try{await this.fetchMe()}catch{if(await this.tryRefresh())try{await this.fetchMe()}catch{}}c(()=>{this.isLoaded=!0})}async afterLogin(e){e!==void 0&&c(()=>{this.token=e}),await this.fetchMe()}setBearerToken(e){c(()=>{this.token=e}),this.apiService.setToken(e)}async logout(){try{await fetch(pJ,{method:`POST`,credentials:`include`})}catch{}this.apiService.setToken(null),c(()=>{this.user=null,this.token=null}),this.systemPermissions.clearAll()}async refresh(){return this.tryRefresh()}async fetchMe(){try{let e=await this.apiService.client.getMe();c(()=>{this.user=e.me}),this.systemPermissions.setUserRole(e.me.role??null),this.loadOrganizationPermissions(e.me)}catch(e){throw c(()=>{this.user=null}),e}}tryRefresh(){if(this.refreshPromise)return this.refreshPromise;let e=this.doRefresh();return c(()=>{this.refreshPromise=e}),e.finally(()=>{c(()=>{this.refreshPromise=null})}),e}async doRefresh(){try{return(await fetch(fJ,{method:`POST`,credentials:`include`})).ok}catch{return!1}}static hasSessionCookie(){if(typeof document>`u`)return!1;let e=document.cookie;return e?e.split(`;`).some(e=>e.trim()===`${mJ}=1`):!1}loadOrganizationPermissions(e){let t=e.organization?.userOrganization?.role?.permissions,n=e.organization?.id;if(t&&n){let e=t.map(e=>({id:e.id,action:e.action,subject:e.subject,condition:e.condition??null}));this.permissionService.addOrganizationPermissions(n,e)}}};Y.register(hJ,()=>{let e=new hJ(Y.get(dJ),Y.get(yW),Y.get(vW));return e.initialize(),e},{scope:`singleton`});var gJ=class{isLoaded=!1;error=null;data=null;constructor(e){this.apiService=e,f(this)}async initialize(){await this.init()}get availableSignUp(){return this.availableEmailSignUp||this.availableGoogleOauth||this.availableGithubOauth}get availableEmailSignUp(){return this.data?.availableEmailSignUp}get availableGoogleOauth(){return!!this.data?.google.available}get googleOauthClientId(){if(!this.data?.google.clientId)throw Error(`Invalid Google client id`);return this.data?.google.clientId}get availableGithubOauth(){return!!this.data?.github.available}get githubOauthClientId(){if(!this.data?.github.clientId)throw Error(`Invalid Github client id`);return this.data?.github.clientId}get billingEnabled(){return this.data?.billing.enabled??!1}get cacheEnabled(){return this.data?.cache?.enabled??!1}get noAuth(){return this.data?.noAuth??!1}async init(){await this.request()}async request(){try{let e=await this.apiService.client.configuration();this.setData(e.configuration)}catch(e){this.setError(e),console.error(e)}finally{this.setIsLoaded(!0)}}setData(e){this.data=e}setError(e){this.error=e}setIsLoaded(e){this.isLoaded=e}};Y.register(gJ,()=>{let e=new gJ(Y.get(dJ));return e.initialize(),e},{scope:`singleton`});var _J=class{constructor(e,t){this.authService=e,this.configurationService=t,f(this)}get isLoaded(){return this.authService.isLoaded&&this.configurationService.isLoaded}};Y.register(_J,()=>new _J(Y.get(hJ),Y.get(gJ)),{scope:`singleton`});var vJ=`sandbox`,yJ=`login`,bJ=`logout`,xJ=`signup`,SJ=`username`,CJ=`github`,wJ=`google`,TJ=`authorize`,EJ=`get-token`,DJ=`get-mcp-token`,OJ=`completed`,kJ=`confirm`,AJ=`:organizationId`,jJ=`-/settings`,MJ=`-/members`,NJ=`-/limits`,PJ=`:projectName`,FJ=`-/settings`,IJ=`-/users`,LJ=`-/api-keys`,RJ=`-/mcp`,zJ=`:branchName`,BJ=`-/changes`,VJ=`-/assets`,HJ=`-/migrations`,UJ=`-/endpoints`,WJ=`-/branches`,GJ=`-/relations`,KJ=`-/branch-map`,qJ=`:revisionIdOrTag`,JJ=`:tableId`,YJ=`:rowId`,XJ=`draft`,ZJ=`head`,QJ=`admin`,$J=`users`,eY=`:userId`,tY=`organizations`,nY=`cache`,rY=function(e){return e.Organization=`organization`,e.Project=`project`,e.Branch=`branch`,e.Revision=`revision`,e.Table=`table`,e.Row=`row`,e.Changes=`changes`,e.Assets=`assets`,e.Migrations=`migrations`,e.Endpoints=`endpoints`,e.Branches=`branches`,e.Relations=`relations`,e.BranchMap=`branchMap`,e.OrganizationOverview=`organizationOverview`,e.OrganizationSettings=`organizationSettings`,e.OrganizationMembers=`organizationMembers`,e.OrganizationLimits=`organizationLimits`,e.ProjectSettings=`projectSettings`,e.ProjectUsers=`projectUsers`,e.ProjectApiKeys=`projectApiKeys`,e.ProjectMcp=`projectMcp`,e.Admin=`admin`,e.AdminUsers=`adminUsers`,e.AdminUserDetail=`adminUserDetail`,e.AdminOrganizations=`adminOrganizations`,e.AdminCache=`adminCache`,e}({}),iY=async()=>Y.get(yW).canReadUser?!0:Cn(`/`),aY=async({request:e})=>{let t=Y.get(hJ),n=Y.get(gJ);if(!t.user){if(n.noAuth)try{let e=await Q.login({data:{emailOrUsername:`admin`,password:``}});return t.setBearerToken(e.login.accessToken),await t.afterLogin(),!0}catch(e){console.error(`noAuth bootstrap failed`,e),t.setBearerToken(null)}let r=new URL(e.url),i=$V(`${r.pathname}${r.search}`);return Cn(`${n.availableSignUp?`/${xJ}`:`/${yJ}`}${i}`)}return t.user.username?!0:Cn(`/${SJ}`)},oY=async e=>{let t=Y.get(hJ),n=Y.get(gJ);if(!t.user){if(n.noAuth){try{let e=await Q.login({data:{emailOrUsername:`admin`,password:``}});t.setBearerToken(e.login.accessToken),await t.afterLogin()}catch(e){console.error(`noAuth bootstrap failed`,e),t.setBearerToken(null)}return!0}return!0}return t.user.username?!0:Cn(`/${SJ}`)},sY=async()=>Y.get(hJ).user?Cn(`/`):!0,cY=async()=>{let e=Y.get(hJ),t=Y.get(gJ);return e.user||!t.availableSignUp?Cn(`/`):!0},lY=(...e)=>async t=>{let n=null;for(let r of e){let e=await r(t);if(e&&typeof e==`object`&&`status`in e&&e.status===302)return e;n=e}return n},uY=async()=>!0,dY=class{statsRequest=X.of(Q.adminCacheStats);resetRequest=X.of(Q.adminResetAllCache);configurationService;_resetSuccess=!1;_showConfirm=!1;constructor(e){this.configurationService=e,f(this,{},{autoBind:!0})}get cacheEnabled(){return this.configurationService.cacheEnabled}get isLoading(){return this.statsRequest.isLoading}get isResetting(){return this.resetRequest.isLoading}get resetSuccess(){return this._resetSuccess}get showConfirm(){return this._showConfirm}get totalHits(){return this.statsRequest.data?.adminCacheStats.totalHits??0}get totalMisses(){return this.statsRequest.data?.adminCacheStats.totalMisses??0}get totalWrites(){return this.statsRequest.data?.adminCacheStats.totalWrites??0}get totalDeletes(){return this.statsRequest.data?.adminCacheStats.totalDeletes??0}get totalClears(){return this.statsRequest.data?.adminCacheStats.totalClears??0}get overallHitRate(){return this.statsRequest.data?.adminCacheStats.overallHitRate??0}get byCategory(){return this.statsRequest.data?.adminCacheStats.byCategory??[]}get resetError(){return this.resetRequest.errorMessage??null}openConfirm(){this._showConfirm=!0,this._resetSuccess=!1}closeConfirm(){this._showConfirm=!1}async confirmReset(){this._showConfirm=!1,(await this.resetRequest.fetch({})).isRight&&(c(()=>{this._resetSuccess=!0}),this.statsRequest.fetch({}))}init(){this.cacheEnabled&&this.statsRequest.fetch({})}dispose(){this.statsRequest.abort(),this.resetRequest.abort()}};Y.register(dY,()=>new dY(Y.get(gJ)),{scope:`request`});var fY=({label:e,value:t,isLoading:n})=>(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,minWidth:`160px`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,marginBottom:`8px`,children:e}),n?(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`}):(0,I.jsx)(k,{fontSize:`2xl`,fontWeight:`600`,color:`gray.900`,children:t})]}),pY=({keyName:e,hits:t,misses:n,writes:r,deletes:i,hitRate:a})=>(0,I.jsxs)(j,{padding:`12px 16px`,borderBottom:`1px solid`,borderColor:`gray.100`,alignItems:`center`,gap:`16px`,_last:{borderBottom:`none`},children:[(0,I.jsx)(k,{flex:`1`,fontSize:`sm`,fontWeight:`500`,fontFamily:`mono`,children:e}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[t,` hits`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[n,` misses`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[r,` writes`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[i,` del`]}),(0,I.jsxs)(k,{fontSize:`sm`,fontWeight:`500`,minWidth:`60px`,textAlign:`right`,children:[(a*100).toFixed(1),`%`]})]}),mY=g(()=>{let e=CB(dY);return(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsx)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsx)(Gt,{fontSize:`16px`,children:(0,I.jsx)(Dt,{children:(0,I.jsx)(Xt,{color:`gray`,children:`Cache`})})})})})}),e.cacheEnabled?(0,I.jsxs)(A,{padding:`8px`,paddingTop:`16px`,children:[(0,I.jsxs)(j,{gap:`16px`,flexWrap:`wrap`,marginBottom:`24px`,children:[(0,I.jsx)(fY,{label:`Hit Rate`,value:`${(e.overallHitRate*100).toFixed(1)}%`,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Hits`,value:e.totalHits,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Misses`,value:e.totalMisses,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Writes`,value:e.totalWrites,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Deletes`,value:e.totalDeletes,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Clears`,value:e.totalClears,isLoading:e.isLoading})]}),e.byCategory.length>0&&(0,I.jsxs)(A,{marginBottom:`24px`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`600`,color:`gray.700`,marginBottom:`8px`,children:`By Cache Type`}),(0,I.jsx)(A,{border:`1px solid`,borderColor:`gray.200`,borderRadius:`8px`,backgroundColor:`white`,children:e.byCategory.map(e=>(0,I.jsx)(pY,{keyName:e.key,hits:e.hits,misses:e.misses,writes:e.writes,deletes:e.deletes,hitRate:e.hitRate},e.key))})]}),(0,I.jsxs)(A,{children:[(0,I.jsx)(N,{colorPalette:`red`,variant:`outline`,size:`sm`,onClick:e.openConfirm,loading:e.isResetting,children:`Reset All Cache`}),e.resetSuccess&&(0,I.jsx)(k,{fontSize:`sm`,color:`green.500`,marginTop:`8px`,children:`Cache has been cleared successfully`}),e.resetError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,marginTop:`8px`,children:e.resetError})]})]}):(0,I.jsx)(A,{padding:`8px`,paddingTop:`16px`,children:(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,children:[(0,I.jsx)(k,{fontSize:`md`,fontWeight:`500`,color:`gray.500`,children:`Caching is disabled`}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.400`,marginTop:`4px`,children:`Set CACHE_ENABLED=1 to enable caching.`})]})}),(0,I.jsx)(Ue,{open:e.showConfirm,onOpenChange:({open:t})=>!t&&e.closeConfirm(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Reset All Cache`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsx)(k,{children:`Are you sure you want to clear the entire cache?`}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This will flush all cached data including rows, revisions, auth, and billing caches. The cache will be rebuilt automatically as data is accessed.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`red`,onClick:e.confirmReset,children:`Reset Cache`})]}),(0,I.jsx)(Ie,{})]})})]})})]})}),hY=class{usersRequest=X.of(Q.AdminDashboardStats);constructor(){f(this,{},{autoBind:!0})}get isLoadingUsers(){return this.usersRequest.isLoading}get isLoadingProjects(){return!1}get usersCount(){return this.usersRequest.data?.searchUsers.totalCount??null}get projectsCount(){return null}init(){this.usersRequest.fetch({first:1})}dispose(){this.usersRequest.abort()}};Y.register(hY,()=>new hY,{scope:`request`});var gY=({label:e,value:t,isLoading:n})=>(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,minWidth:`200px`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,marginBottom:`8px`,children:e}),n?(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`}):(0,I.jsx)(k,{fontSize:`2xl`,fontWeight:`600`,color:`gray.900`,children:t??`-`})]}),_Y=g(()=>{let e=CB(hY);return(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsx)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsx)(Gt,{fontSize:`16px`,children:(0,I.jsx)(Dt,{children:(0,I.jsx)(Xt,{color:`gray`,children:`Admin`})})})})})}),(0,I.jsx)(A,{padding:`8px`,paddingTop:`16px`,children:(0,I.jsxs)(j,{gap:`16px`,flexWrap:`wrap`,children:[(0,I.jsx)(gY,{label:`Total Users`,value:e.usersCount,isLoading:e.isLoadingUsers}),(0,I.jsx)(gY,{label:`Total Projects`,value:e.projectsCount,isLoading:e.isLoadingProjects})]})})]})}),vY=class{constructor(e){this.data=e,f(this)}get id(){return this.data.id}get name(){return this.data.name}get prefix(){return this.data.prefix}get type(){return this.data.type}get isExpired(){return this.data.expiresAt?new Date(this.data.expiresAt)<new Date:!1}get isRevoked(){return this.data.revokedAt!==null}get isActive(){return!this.isExpired&&!this.isRevoked}get statusLabel(){return this.isRevoked?`Revoked`:this.isExpired?`Expired`:`Active`}get lastUsedAt(){return this.data.lastUsedAt??null}get createdAt(){return this.data.createdAt}get expiresAt(){return this.data.expiresAt??null}get readOnly(){return this.data.readOnly}get organizationId(){return this.data.organizationId??null}get projectIds(){return this.data.projectIds}get resolvedProjects(){return this.data.projects}get permissionLabel(){if(this.data.type===`PERSONAL`)return this.data.readOnly?`Read only`:`Full access`;let e=this.data.permissions?.rules?.[0]?.action??[];return e.includes(`delete`)?`Full access`:e.includes(`create`)||e.includes(`update`)?`Read & Write`:`Read only`}get permissionColorPalette(){switch(this.permissionLabel){case`Full access`:return`orange`;case`Read & Write`:return`blue`;default:return`gray`}}},yY={Active:{colorPalette:`green`},Expired:{colorPalette:`yellow`},Revoked:{colorPalette:`gray`}},bY=({status:e})=>{let t=yY[e];return(0,I.jsx)(It,{variant:`subtle`,colorPalette:t.colorPalette,size:`sm`,children:e})};function xY(e){if(e==null)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:HV(t,{addSuffix:!0})}var SY=({name:e,prefix:t,status:n,permissionLabel:r,permissionColor:i,projects:a,lastUsedAt:o,createdAt:s,expiresAt:c,actions:l})=>(0,I.jsx)(A,{width:`100%`,p:4,borderWidth:`1px`,borderColor:`gray.200`,borderRadius:`lg`,bg:`white`,transition:`all 0.2s`,_hover:{borderColor:`gray.300`},children:(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:1,flex:1,minWidth:0,children:[(0,I.jsxs)(P,{gap:2,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`600`,color:`gray.700`,truncate:!0,children:e}),n!==`Active`&&(0,I.jsx)(bY,{status:n}),(0,I.jsx)(It,{variant:`outline`,colorPalette:i,size:`sm`,children:r})]}),(0,I.jsxs)(P,{gap:2,children:[(0,I.jsx)(k,{fontSize:`xs`,fontFamily:`mono`,color:`gray.400`,children:t}),a.length>0&&(0,I.jsx)(P,{gap:1,children:a.map(e=>(0,I.jsx)(It,{variant:`outline`,colorPalette:`gray`,size:`sm`,children:e.name},e.id))}),a.length===0&&(0,I.jsx)(It,{variant:`outline`,colorPalette:`gray`,size:`sm`,children:`All projects`})]}),(0,I.jsxs)(P,{gap:4,mt:1,flexWrap:`wrap`,children:[(0,I.jsxs)(k,{fontSize:`xs`,color:`gray.500`,children:[`Created `,UV(s)]}),c&&(0,I.jsxs)(k,{fontSize:`xs`,color:`gray.500`,children:[`Expires `,UV(c)]}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:o?`Last used ${xY(o)}`:`Never used`})]})]}),l&&(0,I.jsx)(P,{gap:1,children:l})]})}),CY=[{value:`30d`,label:`30 days`},{value:`60d`,label:`60 days`},{value:`90d`,label:`90 days`},{value:`1y`,label:`1 year`},{value:`none`,label:`No expiration`}],wY=[{value:`read-only`,label:`Read only`,description:`Can only read data`},{value:`read-write`,label:`Read & Write`,description:`Can read, create, and update data`},{value:`full-access`,label:`Full access`,description:`Can read, create, update, and delete data`}],TY=g(({model:e})=>(0,I.jsx)(Ue,{open:e.isCreateDialogOpen,onOpenChange:({open:t})=>!t&&e.closeCreateDialog(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:e.mode===`personal`?`Create Personal API Key`:`Create Service API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Name`}),(0,I.jsx)(qt,{placeholder:`e.g., CI/CD pipeline, Data sync...`,value:e.createKeyName,onChange:t=>e.setCreateKeyName(t.target.value),autoFocus:!0})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Expiration`}),(0,I.jsx)(P,{gap:2,flexWrap:`wrap`,children:CY.map(t=>(0,I.jsx)(N,{size:`sm`,variant:e.createKeyExpirationPreset===t.value?`solid`:`outline`,onClick:()=>e.setExpirationPreset(t.value),children:t.label},t.value))})]}),e.mode===`personal`&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(P,{gap:2,children:(0,I.jsxs)(A,{as:`button`,onClick:()=>e.setCreateKeyReadOnly(!e.createKeyReadOnly),display:`flex`,alignItems:`center`,gap:2,cursor:`pointer`,children:[(0,I.jsx)(A,{width:`18px`,height:`18px`,borderWidth:`1px`,borderColor:e.createKeyReadOnly?`blue.500`:`gray.300`,borderRadius:`sm`,bg:e.createKeyReadOnly?`blue.500`:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s`,children:e.createKeyReadOnly&&(0,I.jsx)(k,{color:`white`,fontSize:`xs`,fontWeight:`bold`,lineHeight:1,children:`✓`})}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.700`,children:`Read only`})]})}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,pl:`26px`,children:`Key can only read data, not modify it`})]}),e.mode===`service`&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Permissions`}),(0,I.jsx)(M,{align:`stretch`,gap:2,children:wY.map(t=>(0,I.jsxs)(A,{as:`button`,onClick:()=>e.setPermissionPreset(t.value),width:`100%`,p:3,borderWidth:`1px`,borderColor:e.createKeyPermissionPreset===t.value?`blue.400`:`gray.200`,borderRadius:`md`,bg:e.createKeyPermissionPreset===t.value?`blue.50`:`white`,cursor:`pointer`,textAlign:`left`,transition:`all 0.2s`,_hover:{borderColor:`blue.300`},children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.700`,children:t.label}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:t.description})]},t.value))})]}),e.defaultProjectId&&(0,I.jsx)(j,{align:`center`,gap:2,p:3,bg:`blue.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`blue.200`,children:(0,I.jsxs)(k,{fontSize:`sm`,color:`blue.700`,children:[`This key will be scoped to project `,(0,I.jsx)(`strong`,{children:e.defaultProjectId})]})})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{onClick:e.createKey,disabled:!e.canCreateKey,loading:e.isMutating,children:`Create key`})]}),(0,I.jsx)(Ie,{})]})})]})})),EY=g(({isOpen:e,keyName:t,isLoading:n,onConfirm:r,onClose:i})=>(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&i(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Revoke API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(k,{children:[`Are you sure you want to revoke the key `,(0,I.jsx)(`strong`,{children:t}),`?`]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This action cannot be undone. Any applications using this key will immediately lose access.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`red`,onClick:r,loading:n,children:`Revoke key`})]}),(0,I.jsx)(Ie,{})]})})]})})),DY=g(({isOpen:e,keyName:t,isLoading:n,onConfirm:r,onClose:i})=>(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&i(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Rotate API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(k,{children:[`Are you sure you want to rotate the key `,(0,I.jsx)(`strong`,{children:t}),`?`]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This will generate a new secret and invalidate the current one. Any applications using the current key will need to be updated.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`orange`,onClick:r,loading:n,children:`Rotate key`})]}),(0,I.jsx)(Ie,{})]})})]})})),OY=g(({isOpen:e,secret:t,keyName:n,onClose:r})=>{let i=(0,L.useCallback)(async()=>{t&&(await navigator.clipboard.writeText(t),Jq.info({description:`Copied to clipboard`}))},[t]);return(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&r(),size:`md`,closeOnInteractOutside:!1,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Your API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[n&&(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,children:[`Key `,(0,I.jsx)(`strong`,{children:n}),` has been created successfully.`]}),(0,I.jsx)(A,{children:(0,I.jsxs)(j,{gap:2,children:[(0,I.jsx)(qt,{value:t??``,readOnly:!0,fontFamily:`mono`,fontSize:`sm`,bg:`gray.50`}),(0,I.jsxs)(N,{variant:`outline`,onClick:i,flexShrink:0,children:[(0,I.jsx)(qf,{}),`Copy`]})]})}),(0,I.jsxs)(j,{align:`center`,gap:2,p:3,bg:`yellow.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`yellow.200`,children:[(0,I.jsx)(one,{color:`var(--chakra-colors-yellow-600)`}),(0,I.jsx)(k,{fontSize:`sm`,color:`yellow.800`,children:`Make sure to copy your API key now. You won't be able to see it again.`})]})]})}),(0,I.jsx)(w,{children:(0,I.jsx)(N,{onClick:r,children:`I've copied the key`})})]})})]})})}),kY=g(({model:e,showCreateButton:t=!0})=>((0,L.useEffect)(()=>(e.loadKeys().catch(e.handleLoadKeysError),()=>e.reset()),[e]),e.isLoaded?e.error?(0,I.jsx)(A,{p:4,bg:`red.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`red.200`,children:(0,I.jsx)(k,{fontSize:`sm`,color:`red.600`,children:e.error})}):(0,I.jsxs)(M,{align:`stretch`,gap:3,children:[t&&!e.isEmpty&&(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`${e.sortedItems.length} key${e.sortedItems.length===1?``:`s`}`}),(0,I.jsxs)(N,{size:`sm`,onClick:e.openCreateDialog,children:[(0,I.jsx)(Pf,{}),`Create key`]})]}),e.isEmpty&&e.isLoaded&&(0,I.jsxs)(A,{p:6,textAlign:`center`,borderWidth:`1px`,borderColor:`gray.200`,borderRadius:`lg`,bg:`gray.50`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:e.emptyStateMessage}),t&&(0,I.jsxs)(N,{size:`sm`,mt:3,onClick:e.openCreateDialog,children:[(0,I.jsx)(Pf,{}),`Create your first key`]})]}),e.sortedItems.map(t=>(0,I.jsx)(SY,{name:t.name,prefix:t.prefix,status:t.statusLabel,permissionLabel:t.permissionLabel,permissionColor:t.permissionColorPalette,projects:t.resolvedProjects,lastUsedAt:t.lastUsedAt,createdAt:t.createdAt,expiresAt:t.expiresAt,actions:t.isActive?(0,I.jsxs)(P,{gap:1,children:[(0,I.jsx)(N,{size:`xs`,variant:`ghost`,color:`gray.500`,_hover:{color:`orange.600`,bg:`orange.50`},onClick:()=>e.openRotateDialog(t.id),children:(0,I.jsx)(Ate,{})}),(0,I.jsx)(N,{size:`xs`,variant:`ghost`,color:`gray.500`,_hover:{color:`red.600`,bg:`red.50`},onClick:()=>e.openRevokeDialog(t.id),children:(0,I.jsx)(Rf,{})})]}):void 0},t.id)),(0,I.jsx)(TY,{model:e}),(0,I.jsx)(OY,{isOpen:e.isSecretDialogOpen,secret:e.lastSecret,keyName:e.lastCreatedKeyName,onClose:e.closeSecretDialog}),(0,I.jsx)(EY,{isOpen:e.isRevokeDialogOpen,keyName:e.selectedKey?.name,isLoading:e.isMutating,onConfirm:e.revokeKey,onClose:e.closeRevokeDialog}),(0,I.jsx)(DY,{isOpen:e.isRotateDialogOpen,keyName:e.selectedKey?.name,isLoading:e.isMutating,onConfirm:e.rotateKey,onClose:e.closeRotateDialog})]}):(0,I.jsx)(j,{justify:`center`,py:8,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}))),AY=class{myKeysRequest=X.of(Q.myApiKeys,{skipResetting:!0});serviceKeysRequest=X.of(Q.serviceApiKeys,{skipResetting:!0});createPersonalRequest=X.of(Q.createPersonalApiKey);createServiceRequest=X.of(Q.createServiceApiKey);revokeRequest=X.of(Q.revokeApiKey);rotateRequest=X.of(Q.rotateApiKey);constructor(){f(this)}get isLoading(){return this.myKeysRequest.isLoading||this.serviceKeysRequest.isLoading}get error(){return this.myKeysRequest.errorMessage??this.serviceKeysRequest.errorMessage??null}get isMutating(){return this.createPersonalRequest.isLoading||this.createServiceRequest.isLoading||this.revokeRequest.isLoading||this.rotateRequest.isLoading}fetchPersonalKeys(){return this.myKeysRequest.fetch()}fetchServiceKeys(e){return this.serviceKeysRequest.fetch({organizationId:e})}async createPersonalKey(e){let t=await this.createPersonalRequest.fetch({data:e});return t.isRight?t.data.createPersonalApiKey:null}async createServiceKey(e){let t=await this.createServiceRequest.fetch({data:e});return t.isRight?t.data.createServiceApiKey:null}async revokeKey(e){let t=await this.revokeRequest.fetch({id:e});return t.isRight?t.data.revokeApiKey:null}async rotateKey(e){let t=await this.rotateRequest.fetch({id:e});return t.isRight?t.data.rotateApiKey:null}dispose(){this.myKeysRequest.abort(),this.serviceKeysRequest.abort(),this.createPersonalRequest.abort(),this.createServiceRequest.abort(),this.revokeRequest.abort(),this.rotateRequest.abort()}};Y.register(AY,()=>new AY,{scope:`request`});var jY={"read-only":[{action:[`read`],subject:[`all`]}],"read-write":[{action:[`read`,`create`,`update`],subject:[`all`]}],"full-access":[{action:[`read`,`create`,`update`,`delete`],subject:[`all`]}]},MY=class{_config={mode:`personal`};_items=[];_isLoaded=!1;_loadError=null;_isCreateDialogOpen=!1;_isSecretDialogOpen=!1;_isRevokeDialogOpen=!1;_isRotateDialogOpen=!1;_selectedKeyId=null;_lastSecret=null;_lastCreatedKeyName=null;createKeyName=``;createKeyReadOnly=!1;createKeyExpiresAt=null;createKeyExpirationPreset=`none`;createKeyPermissionPreset=`read-only`;constructor(e){this.dataSource=e,f(this,{},{autoBind:!0})}get mode(){return this._config.mode}get organizationId(){return this._config.organizationId}get defaultProjectId(){return this._config.defaultProjectId}get filterByProjectId(){return this._config.filterByProjectId}get items(){return this._items}get filteredItems(){if(!this._config.filterByProjectId)return this._items;let e=this._config.filterByProjectId;return this._items.filter(t=>t.projectIds.includes(e))}get sortedItems(){return[...this.filteredItems].sort((e,t)=>{let n={Active:0,Expired:1,Revoked:2},r=n[e.statusLabel]-n[t.statusLabel];return r===0?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():r})}get isLoading(){return this.dataSource.isLoading}get isLoaded(){return this._isLoaded}get isMutating(){return this.dataSource.isMutating}get error(){return this._loadError??this.dataSource.error}get isEmpty(){return this.filteredItems.length===0}get isCreateDialogOpen(){return this._isCreateDialogOpen}get isSecretDialogOpen(){return this._isSecretDialogOpen}get isRevokeDialogOpen(){return this._isRevokeDialogOpen}get isRotateDialogOpen(){return this._isRotateDialogOpen}get selectedKeyId(){return this._selectedKeyId}get lastSecret(){return this._lastSecret}get lastCreatedKeyName(){return this._lastCreatedKeyName}get selectedKey(){return this._items.find(e=>e.id===this._selectedKeyId)}get canCreateKey(){return this.createKeyName.trim().length>0&&!this.isMutating}get emptyStateMessage(){return this._config.mode===`personal`?`No API keys yet. Create one for programmatic access to your data.`:`No integration keys for this organization.`}configure(e){this._config=e}init(){}dispose(){this.dataSource.dispose()}reset(){this._items=[],this._isLoaded=!1,this._loadError=null}async loadKeys(){if(c(()=>{this._loadError=null}),this._config.mode===`personal`){let e=await this.dataSource.fetchPersonalKeys();if(!e.isRight){if(qV(e))return;c(()=>{this._isLoaded=!0});return}c(()=>{this._items=e.data.myApiKeys.filter(e=>e.type!==`INTERNAL`).map(e=>new vY(e)),this._isLoaded=!0})}else if(this._config.organizationId){let e=await this.dataSource.fetchServiceKeys(this._config.organizationId);if(!e.isRight){if(qV(e))return;c(()=>{this._isLoaded=!0});return}c(()=>{this._items=e.data.serviceApiKeys.filter(e=>e.type!==`INTERNAL`).map(e=>new vY(e)),this._isLoaded=!0})}}handleLoadKeysError(e){console.error(e),c(()=>{this._loadError=e instanceof Error?e.message:`Failed to load API keys`,this._isLoaded=!0})}openCreateDialog(){this._isCreateDialogOpen=!0,this.createKeyName=``,this.createKeyReadOnly=!1,this.createKeyExpiresAt=null,this.createKeyExpirationPreset=`none`,this.createKeyPermissionPreset=`read-only`}closeCreateDialog(){this._isCreateDialogOpen=!1}setCreateKeyName(e){this.createKeyName=e}setCreateKeyReadOnly(e){this.createKeyReadOnly=e}setExpirationPreset(e){this.createKeyExpirationPreset=e;let t=new Date;switch(e){case`30d`:t.setDate(t.getDate()+30),this.createKeyExpiresAt=t.toISOString();break;case`60d`:t.setDate(t.getDate()+60),this.createKeyExpiresAt=t.toISOString();break;case`90d`:t.setDate(t.getDate()+90),this.createKeyExpiresAt=t.toISOString();break;case`1y`:t.setFullYear(t.getFullYear()+1),this.createKeyExpiresAt=t.toISOString();break;case`none`:this.createKeyExpiresAt=null;break}}setPermissionPreset(e){this.createKeyPermissionPreset=e}async createKey(){if(this.canCreateKey){if(this._config.mode===`personal`){let e={name:this.createKeyName.trim(),readOnly:this.createKeyReadOnly,expiresAt:this.createKeyExpiresAt??void 0,projectIds:this._config.defaultProjectId?[this._config.defaultProjectId]:void 0},t=await this.dataSource.createPersonalKey(e);t&&(c(()=>{this._lastSecret=t.secret,this._lastCreatedKeyName=t.apiKey.name,this._isCreateDialogOpen=!1,this._isSecretDialogOpen=!0}),await this.loadKeys())}else if(this._config.organizationId){let e={name:this.createKeyName.trim(),organizationId:this._config.organizationId,readOnly:this.createKeyReadOnly,expiresAt:this.createKeyExpiresAt??void 0,projectIds:this._config.defaultProjectId?[this._config.defaultProjectId]:void 0,permissions:{rules:jY[this.createKeyPermissionPreset]}},t=await this.dataSource.createServiceKey(e);t&&(c(()=>{this._lastSecret=t.secret,this._lastCreatedKeyName=t.apiKey.name,this._isCreateDialogOpen=!1,this._isSecretDialogOpen=!0}),await this.loadKeys())}}}closeSecretDialog(){this._isSecretDialogOpen=!1,this._lastSecret=null,this._lastCreatedKeyName=null}openRevokeDialog(e){this._selectedKeyId=e,this._isRevokeDialogOpen=!0}closeRevokeDialog(){this._isRevokeDialogOpen=!1,this._selectedKeyId=null}async revokeKey(){this._selectedKeyId&&await this.dataSource.revokeKey(this._selectedKeyId)&&(c(()=>{this._isRevokeDialogOpen=!1,this._selectedKeyId=null}),await this.loadKeys())}openRotateDialog(e){this._selectedKeyId=e,this._isRotateDialogOpen=!0}closeRotateDialog(){this._isRotateDialogOpen=!1,this._selectedKeyId=null}async rotateKey(){if(!this._selectedKeyId)return;let e=await this.dataSource.rotateKey(this._selectedKeyId);e&&(c(()=>{this._lastSecret=e.secret,this._lastCreatedKeyName=e.apiKey.name,this._isRotateDialogOpen=!1,this._selectedKeyId=null,this._isSecretDialogOpen=!0}),await this.loadKeys())}};Y.register(MY,()=>new MY(Y.get(AY)),{scope:`request`});var NY=g(({model:e})=>{let t=(0,L.useCallback)(async()=>{await e.savePassword()&&Jq.success({description:`Password updated successfully`})},[e]);return(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Account Settings`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(rn,{value:e.activeTab,onValueChange:({value:t})=>e.setActiveTab(t),lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(et,{marginBottom:`1rem`,children:[(0,I.jsxs)(fn,{value:`account`,children:[(0,I.jsx)(zf,{}),`Account`]}),(0,I.jsxs)(fn,{value:`password`,children:[(0,I.jsx)(Of,{}),`Password`]}),(0,I.jsxs)(fn,{value:`api-keys`,children:[(0,I.jsx)(Df,{}),`Personal Tokens`]})]}),(0,I.jsx)(bt,{value:`account`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[e.username&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username`}),(0,I.jsx)(qt,{value:e.username,readOnly:!0})]}),e.email&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email`}),(0,I.jsx)(qt,{value:e.email,readOnly:!0})]}),(0,I.jsx)(A,{paddingTop:`1rem`,borderTop:`1px solid`,borderTopColor:`newGray.100`,children:(0,I.jsxs)(N,{variant:`outline`,onClick:e.logout,width:`100%`,children:[(0,I.jsx)(tne,{}),`Sign out`]})})]})}),(0,I.jsx)(bt,{value:`password`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[e.hasPassword?(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Current Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter current password...`,value:e.oldPassword,onChange:t=>e.setOldPassword(t.target.value),autoComplete:`current-password`})]}):(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`You signed in with a social account. Set a password to enable password login.`}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:e.hasPassword?`New Password`:`Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter new password (min 8 characters)...`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Confirm Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Confirm new password...`,value:e.confirmPassword,onChange:t=>e.setConfirmPassword(t.target.value),autoComplete:`new-password`})]}),e.passwordError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,children:e.passwordError}),e.error&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,children:e.error}),(0,I.jsx)(j,{justifyContent:`flex-end`,children:(0,I.jsx)(N,{onClick:t,disabled:!e.canSavePassword,loading:e.isLoading,children:e.hasPassword?`Update Password`:`Set Password`})})]})}),(0,I.jsx)(bt,{value:`api-keys`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.700`,children:`Personal Access Keys`}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,mt:1,children:`Personal keys act on your behalf and inherit your permissions. Use them for scripts, CLI tools, or any programmatic access to your data.`})]}),(0,I.jsx)(kY,{model:e.apiKeyManager})]})})]})}),(0,I.jsx)(Ie,{})]})})]})})}),PY=class{updatePasswordRequest=X.of(Q.updatePassword);constructor(){f(this)}get isLoading(){return this.updatePasswordRequest.isLoading}get error(){return this.updatePasswordRequest.errorMessage??null}async updatePassword(e){return(await this.updatePasswordRequest.fetch({data:{oldPassword:e.oldPassword,newPassword:e.newPassword}})).isRight}dispose(){this.updatePasswordRequest.abort()}};Y.register(PY,()=>new PY,{scope:`request`});var FY=class{_isOpen=!1;_activeTab=`account`;apiKeyManager;oldPassword=``;newPassword=``;confirmPassword=``;constructor(e,t,n){this.dataSource=e,this.authService=t,f(this,{},{autoBind:!0}),this.apiKeyManager=n,this.apiKeyManager.configure({mode:`personal`})}get isOpen(){return this._isOpen}get activeTab(){return this._activeTab}get isLoading(){return this.dataSource.isLoading}get error(){return this.dataSource.error}get username(){return this.authService.user?.username}get email(){return this.authService.user?.email}get hasPassword(){return this.authService.user?.hasPassword??!0}get canSavePassword(){return!(this.isLoading||this.newPassword.length<8||this.newPassword!==this.confirmPassword||this.hasPassword&&!this.oldPassword)}get passwordError(){return this.newPassword&&this.newPassword.length<8?`Password must be at least 8 characters`:this.confirmPassword&&this.newPassword!==this.confirmPassword?`Passwords do not match`:null}open(){this._isOpen=!0,this._activeTab=`account`,this.resetPasswordForm()}close(){this._isOpen=!1,this.resetPasswordForm()}setActiveTab(e){this._activeTab=e}setOldPassword(e){this.oldPassword=e}setNewPassword(e){this.newPassword=e}setConfirmPassword(e){this.confirmPassword=e}async savePassword(){if(!this.canSavePassword)return!1;let e=await this.dataSource.updatePassword({oldPassword:this.oldPassword,newPassword:this.newPassword});return e&&(this.resetPasswordForm(),await this.authService.fetchMe()),e}logout(){this.close(),globalThis.location.href=`/${bJ}`}resetPasswordForm(){this.oldPassword=``,this.newPassword=``,this.confirmPassword=``}init(){}dispose(){this.dataSource.dispose(),this.apiKeyManager.dispose()}};Y.register(FY,()=>new FY(Y.get(PY),Y.get(hJ),Y.get(MY)),{scope:`singleton`});var IY=g(()=>{let e=CB(FY);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:`newGray.600`,fontWeight:`400`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,onClick:e.open,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:(0,I.jsx)(zf,{})}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:`Account Settings`})]}),(0,I.jsx)(NY,{model:e})]})}),LY=({onBack:e})=>(0,I.jsx)(j,{className:`group`,flexDirection:`column`,alignItems:`flex-start`,width:`100%`,minWidth:`0`,children:(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,padding:`4px`,width:`100%`,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.500`},onClick:e,display:`flex`,alignItems:`center`,flexShrink:0,children:(0,I.jsx)(pf,{})}),(0,I.jsx)(A,{color:`black`,fontWeight:`600`,fontSize:`18px`,lineHeight:`26px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:`Admin`}),(0,I.jsx)(T,{}),(0,I.jsx)(oJ,{})]})}),RY=({to:e,label:t,isActive:n,icon:r})=>(0,I.jsx)(An,{to:e,style:{textDecoration:`none`,width:`100%`},children:(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:n?`newGray.100`:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:n?`black`:`newGray.600`,fontWeight:`400`,textDecoration:`none`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:r}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:t})]})}),zY=g(()=>{let e=kn(),t=Tn(),n=e.pathname,r=n===`/${QJ}`,i=n.startsWith(`/${QJ}/${$J}`),a=n.startsWith(`/${QJ}/${tY}`),o=n.startsWith(`/${QJ}/${nY}`);return(0,I.jsxs)(M,{alignItems:`flex-start`,gap:0,width:`100%`,flex:1,children:[(0,I.jsx)(LY,{onBack:(0,L.useCallback)(()=>{t(`/`)},[t])}),(0,I.jsx)(A,{width:`100%`,paddingY:`16px`,children:(0,I.jsx)(O,{borderColor:`newGray.100`})}),(0,I.jsxs)(j,{flexDirection:`column`,width:`100%`,gap:1,children:[(0,I.jsx)(RY,{to:`/${QJ}`,label:`Dashboard`,icon:(0,I.jsx)(Xte,{}),isActive:r}),(0,I.jsx)(RY,{to:`/${QJ}/${$J}`,label:`Users`,icon:(0,I.jsx)(Bf,{}),isActive:i}),(0,I.jsx)(RY,{to:`/${QJ}/${tY}`,label:`Organizations`,icon:(0,I.jsx)(Pte,{}),isActive:a}),(0,I.jsx)(RY,{to:`/${QJ}/${nY}`,label:`Cache`,icon:(0,I.jsx)(yf,{}),isActive:o})]}),(0,I.jsx)(T,{}),(0,I.jsx)(j,{flexDirection:`column`,width:`100%`,gap:1,children:(0,I.jsx)(IY,{})})]})}),BY=()=>(0,I.jsx)(Vq,{sidebar:(0,I.jsx)(zY,{}),children:(0,I.jsx)(En,{})}),VY=({breadcrumbs:e,headerRight:t,children:n})=>(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:[(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsxs)(Gt,{fontSize:`16px`,children:[(0,I.jsx)(Dt,{children:(0,I.jsx)(it,{asChild:!0,color:`gray`,children:(0,I.jsx)(An,{to:`/${QJ}`,children:`Admin`})})}),e.map((e,t)=>(0,I.jsxs)(L.Fragment,{children:[(0,I.jsx)(ut,{children:`/`}),(0,I.jsx)(Dt,{children:e.to?(0,I.jsx)(it,{asChild:!0,color:`gray`,children:(0,I.jsx)(An,{to:e.to,children:e.label})}):(0,I.jsx)(Xt,{color:`gray`,children:e.label})})]},t))]})})}),t]}),(0,I.jsx)(A,{flex:1,children:n})]}),HY=()=>(0,I.jsx)(VY,{breadcrumbs:[{label:`Organizations`}],children:(0,I.jsx)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:(0,I.jsx)(k,{fontSize:`md`,children:`Coming soon`})})}),UY=class{request=X.of(Q.adminGetUser);resetPasswordRequest=X.of(Q.adminResetPassword);_userId=null;_user=null;_newPassword=``;_resetPasswordSuccess=!1;constructor(){f(this,{},{autoBind:!0})}get isLoading(){return this.request.isLoading}get error(){return this.request.errorMessage??null}get user(){return this._user}get username(){return this._user?.username??null}get email(){return this._user?.email??null}get roleName(){return this._user?.role?.name??null}get newPassword(){return this._newPassword}get isResetPasswordLoading(){return this.resetPasswordRequest.isLoading}get resetPasswordError(){return this.resetPasswordRequest.errorMessage??null}get resetPasswordSuccess(){return this._resetPasswordSuccess}get canResetPassword(){return this._newPassword.length>=6}setUserId(e){this._userId=e,this.loadUser()}setNewPassword(e){this._newPassword=e,this._resetPasswordSuccess=!1}async resetPassword(){!this._userId||!this.canResetPassword||(await this.resetPasswordRequest.fetch({userId:this._userId,newPassword:this._newPassword})).isRight&&c(()=>{this._newPassword=``,this._resetPasswordSuccess=!0})}init(){this._userId&&this.loadUser()}dispose(){this.request.abort(),this.resetPasswordRequest.abort()}async loadUser(){if(!this._userId)return;let e=await this.request.fetch({userId:this._userId});e.isRight&&c(()=>{this._user=e.data.adminUser??null})}};Y.register(UY,()=>new UY,{scope:`request`});var WY=({label:e,value:t})=>(0,I.jsxs)(j,{gap:`16px`,alignItems:`baseline`,children:[(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,minWidth:`80px`,children:e}),(0,I.jsx)(k,{fontSize:`sm`,color:`newGray.600`,children:t||`-`})]}),GY=g(({model:e})=>(0,I.jsxs)(A,{padding:`16px`,borderWidth:`1px`,borderColor:`newGray.100`,borderRadius:`md`,marginTop:`16px`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`newGray.500`,marginBottom:`12px`,children:`Reset Password`}),(0,I.jsxs)(j,{gap:`12px`,alignItems:`flex-start`,children:[(0,I.jsx)(qt,{placeholder:`New password (min 6 characters)`,type:`password`,size:`sm`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),maxWidth:`300px`}),(0,I.jsx)(N,{size:`sm`,colorPalette:`gray`,onClick:e.resetPassword,disabled:!e.canResetPassword,loading:e.isResetPasswordLoading,children:`Reset`})]}),e.resetPasswordError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,marginTop:`8px`,children:e.resetPasswordError}),e.resetPasswordSuccess&&(0,I.jsx)(k,{fontSize:`sm`,color:`green.500`,marginTop:`8px`,children:`Password has been reset successfully`})]})),KY=g(()=>{let{userId:e}=bn(),t=CB(UY);return(0,L.useEffect)(()=>{e&&t.setUserId(e)},[e,t]),(0,I.jsx)(VY,{breadcrumbs:(0,L.useMemo)(()=>[{label:`Users`,to:`/${QJ}/${$J}`},{label:t.username||e||``}],[t.username,e]),children:(0,I.jsxs)(A,{flex:1,padding:`8px`,children:[t.isLoading&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,paddingY:`48px`,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}),t.error&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:[(0,I.jsx)(k,{fontSize:`md`,children:`Could not load user`}),(0,I.jsx)(k,{fontSize:`sm`,children:t.error})]}),!t.isLoading&&!t.error&&!t.user&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:(0,I.jsx)(k,{fontSize:`md`,children:`User not found`})}),t.user&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(A,{padding:`16px`,borderWidth:`1px`,borderColor:`newGray.100`,borderRadius:`md`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`newGray.500`,marginBottom:`12px`,children:`User Info`}),(0,I.jsxs)(M,{alignItems:`flex-start`,gap:`8px`,children:[(0,I.jsx)(WY,{label:`ID`,value:t.user.id}),(0,I.jsx)(WY,{label:`Username`,value:t.username}),(0,I.jsx)(WY,{label:`Email`,value:t.email}),(0,I.jsx)(WY,{label:`Role`,value:t.roleName})]})]}),(0,I.jsx)(GY,{model:t})]})]})})}),qY=class{request=X.of(Q.createUser);constructor(){f(this)}get isLoading(){return this.request.isLoading}get error(){return this.request.errorMessage??null}async create(e){let t=await this.request.fetch({username:e.username,password:e.password,email:e.email,roleId:e.roleId});return t.isRight&&t.data.createUser}dispose(){this.request.abort()}};Y.register(qY,()=>new qY,{scope:`request`});var JY=class{_isOpen=!1;_username=``;_password=``;_email=``;_selectedRole=XW.SystemUser;constructor(e,t,n){this.dataSource=e,this.systemPermissions=t,this.onUserCreated=n,f(this,{},{autoBind:!0})}get isOpen(){return this._isOpen}get canCreateUser(){return this.systemPermissions.canCreateUser}get username(){return this._username}get password(){return this._password}get email(){return this._email}get selectedRole(){return this._selectedRole}get isCreating(){return this.dataSource.isLoading}get canSubmit(){return this._username.trim().length>0&&this._password.length>=6&&!this.isCreating}open(){this._isOpen=!0,this.reset()}close(){this._isOpen=!1,this.reset()}setUsername(e){this._username=e}setPassword(e){this._password=e}setEmail(e){this._email=e}setSelectedRole(e){this._selectedRole=e}async createUser(){if(!this.canSubmit)return;let e=await this.dataSource.create({username:this._username.trim(),password:this._password,email:this._email.trim()||void 0,roleId:this._selectedRole});c(()=>{e&&(this.onUserCreated(),this.close())})}dispose(){this.dataSource.dispose()}reset(){this._username=``,this._password=``,this._email=``,this._selectedRole=XW.SystemUser}},YY=class extends rH{currentFilters={};constructor(){super(Q.adminUsers,{pageSize:50})}extractItems(e){return e.adminUsers.edges.map(e=>e.node)}extractPageInfo(e){return{hasNextPage:e.adminUsers.pageInfo.hasNextPage,endCursor:e.adminUsers.pageInfo.endCursor||null,totalCount:e.adminUsers.totalCount}}buildFetchArgs(e,t){return e&&(this.currentFilters=e),{first:this.config.pageSize,after:t,search:this.currentFilters.search||void 0}}};Y.register(YY,()=>new YY,{scope:`request`});var XY=class{constructor(e){this.data=e,f(this)}get id(){return this.data.id}get username(){return this.data.username??null}get email(){return this.data.email??null}get roleName(){return this.data.role?.name??null}get link(){return Dn(`/${QJ}/${$J}/:userId`,{userId:this.data.id})}},ZY=class extends nH{createUserModal;_searchQuery=``;_debounceTimer=null;constructor(e,t,n){super(e),this.createUserModal=new JY(t,n,()=>this.reload()),h(this,{_searchQuery:u,searchQuery:a,canCreateUser:a,setSearchQuery:m,reload:m,init:_,dispose:_})}getItemKey(e){return e.id}createItemViewModel(e){return new XY(e)}get canCreateUser(){return this.createUserModal.canCreateUser}get searchQuery(){return this._searchQuery}init(){this.dataSource.load()}dispose(){this._debounceTimer&&clearTimeout(this._debounceTimer),super.dispose(),this.createUserModal.dispose()}reload(){this.dataSource.load({search:this._searchQuery||void 0})}setSearchQuery(e){this._searchQuery=e,this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.dataSource.load({search:e||void 0})},300)}};Y.register(ZY,()=>new ZY(Y.get(YY),Y.get(qY),Y.get(yW)),{scope:`request`});var QY={[XW.SystemAdmin]:`System Admin`,[XW.SystemFullApiRead]:`Full API Read`,[XW.SystemUser]:`User`},$Y=g(({value:e,onChange:t,disabled:n})=>(0,I.jsx)(Qe,{size:`sm`,width:`160px`,...n&&{opacity:.5,pointerEvents:`none`},children:(0,I.jsx)(Xe,{value:e,onChange:e=>t(e.target.value),children:Object.values(XW).map(e=>(0,I.jsx)(`option`,{value:e,children:QY[e]},e))})})),eX=g(({model:e})=>(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Create User`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username *`}),(0,I.jsx)(qt,{placeholder:`Enter username...`,value:e.username,onChange:t=>e.setUsername(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Password *`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter password (min 6 characters)...`,value:e.password,onChange:t=>e.setPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email (optional)`}),(0,I.jsx)(qt,{type:`email`,placeholder:`Enter email...`,value:e.email,onChange:t=>e.setEmail(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`System Role`}),(0,I.jsx)($Y,{value:e.selectedRole,onChange:t=>e.setSelectedRole(t)})]})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(N,{variant:`outline`,onClick:e.close,children:`Cancel`}),(0,I.jsx)(N,{onClick:e.createUser,disabled:!e.canSubmit,loading:e.isCreating,children:`Create`})]}),(0,I.jsx)(Ie,{})]})})]})})),tX=g(({model:e})=>(0,I.jsx)(A,{height:`2.5rem`,width:`100%`,children:(0,I.jsx)(An,{to:e.link,style:{textDecoration:`none`,width:`100%`},children:(0,I.jsxs)(j,{_hover:{backgroundColor:`gray.50`},alignItems:`center`,gap:`4px`,paddingLeft:`1rem`,height:`100%`,children:[(0,I.jsx)(j,{width:`200px`,children:(0,I.jsx)(k,{maxWidth:`190px`,textDecoration:`underline`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:e.username||e.email||`No username`})}),(0,I.jsx)(j,{alignItems:`center`,flex:1,minHeight:`40px`,children:(0,I.jsx)(k,{color:`gray.400`,fontWeight:`300`,ml:`16px`,children:e.roleName||`-`})})]})})})),nX=g(()=>{let e=CB(ZY);return(0,I.jsxs)(VY,{breadcrumbs:[{label:`Users`}],headerRight:(0,I.jsx)(j,{alignItems:`center`,gap:`8px`,children:(0,I.jsx)(qt,{placeholder:`Search...`,value:e.searchQuery,onChange:t=>e.setSearchQuery(t.target.value),variant:`flushed`,size:`sm`,width:`200px`,_placeholder:{color:`gray.400`}})}),children:[(0,I.jsxs)(A,{flex:1,paddingX:`16px`,paddingTop:`16px`,children:[e.canCreateUser&&(0,I.jsx)(j,{paddingBottom:`16px`,children:(0,I.jsxs)(N,{variant:`ghost`,size:`sm`,color:`gray`,onClick:()=>e.createUserModal.open(),children:[(0,I.jsx)(Pf,{}),`Add`]})}),e.showLoading&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}),e.showError&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,children:[(0,I.jsx)(k,{fontSize:`md`,children:`Could not load users`}),(0,I.jsx)(k,{fontSize:`sm`,children:`Please retry later`})]}),e.showEmpty&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,children:[(0,I.jsx)(Bf,{size:48}),(0,I.jsx)(k,{fontSize:`md`,children:`No users found`})]}),e.showList&&(0,I.jsx)(QM,{useWindowScroll:!0,totalCount:e.items.length,defaultItemHeight:40,endReached:e.hasNextPage?e.tryToFetchNextPage:void 0,itemContent:t=>{let n=e.items[t];return n?(0,I.jsx)(tX,{model:n},n.id):null}})]}),(0,I.jsx)(eX,{model:e.createUserModal})]})}),rX=i((e=>{e.removeLeadingAndTrailingHTTPWhitespace=e=>e.replace(/^[ \t\n\r]+/u,``).replace(/[ \t\n\r]+$/u,``),e.removeTrailingHTTPWhitespace=e=>e.replace(/[ \t\n\r]+$/u,``),e.isHTTPWhitespaceChar=e=>e===` `||e===` `||e===`
|
|
2166
|
+
`,jq=(e,t,n,r)=>e();function Mq(e,t=jq){return{getBranchForLoader(n,r){return t(t=>e.request(RG,n,{...r,...t}),`getBranchForLoader`,`query`,n)},organizationProjects(n,r){return t(t=>e.request(zG,n,{...r,...t}),`organizationProjects`,`query`,n)},getProject(n,r){return t(t=>e.request(BG,n,{...r,...t}),`getProject`,`query`,n)},getProjectForLoader(n,r){return t(t=>e.request(VG,n,{...r,...t}),`getProjectForLoader`,`query`,n)},getRevisionForLoader(n,r){return t(t=>e.request(HG,n,{...r,...t}),`getRevisionForLoader`,`query`,n)},getRowForLoader(n,r){return t(t=>e.request(UG,n,{...r,...t}),`getRowForLoader`,`query`,n)},getRowCountForeignKeysToForLoader(n,r){return t(t=>e.request(WG,n,{...r,...t}),`getRowCountForeignKeysToForLoader`,`query`,n)},ForeignKeysBy(n,r){return t(t=>e.request(GG,n,{...r,...t}),`ForeignKeysBy`,`query`,n)},ForeignKeysByRows(n,r){return t(t=>e.request(KG,n,{...r,...t}),`ForeignKeysByRows`,`query`,n)},getTableForLoader(n,r){return t(t=>e.request(qG,n,{...r,...t}),`getTableForLoader`,`query`,n)},updatePassword(n,r){return t(t=>e.request(JG,n,{...r,...t}),`updatePassword`,`mutation`,n)},myApiKeys(n,r){return t(t=>e.request(YG,n,{...r,...t}),`myApiKeys`,`query`,n)},serviceApiKeys(n,r){return t(t=>e.request(XG,n,{...r,...t}),`serviceApiKeys`,`query`,n)},apiKeyById(n,r){return t(t=>e.request(ZG,n,{...r,...t}),`apiKeyById`,`query`,n)},createPersonalApiKey(n,r){return t(t=>e.request(QG,n,{...r,...t}),`createPersonalApiKey`,`mutation`,n)},createServiceApiKey(n,r){return t(t=>e.request($G,n,{...r,...t}),`createServiceApiKey`,`mutation`,n)},revokeApiKey(n,r){return t(t=>e.request(eK,n,{...r,...t}),`revokeApiKey`,`mutation`,n)},rotateApiKey(n,r){return t(t=>e.request(tK,n,{...r,...t}),`rotateApiKey`,`mutation`,n)},createProject(n,r){return t(t=>e.request(nK,n,{...r,...t}),`createProject`,`mutation`,n)},findForeignKey(n,r){return t(t=>e.request(rK,n,{...r,...t}),`findForeignKey`,`query`,n)},adminCacheStats(n,r){return t(t=>e.request(iK,n,{...r,...t}),`adminCacheStats`,`query`,n)},adminResetAllCache(n,r){return t(t=>e.request(aK,n,{...r,...t}),`adminResetAllCache`,`mutation`,n)},AdminDashboardStats(n,r){return t(t=>e.request(oK,n,{...r,...t}),`AdminDashboardStats`,`query`,n)},adminGetUser(n,r){return t(t=>e.request(sK,n,{...r,...t}),`adminGetUser`,`query`,n)},adminResetPassword(n,r){return t(t=>e.request(cK,n,{...r,...t}),`adminResetPassword`,`mutation`,n)},adminUsers(n,r){return t(t=>e.request(lK,n,{...r,...t}),`adminUsers`,`query`,n)},adminUser(n,r){return t(t=>e.request(uK,n,{...r,...t}),`adminUser`,`query`,n)},assetsTablesData(n,r){return t(t=>e.request(dK,n,{...r,...t}),`assetsTablesData`,`query`,n)},assetsRowsData(n,r){return t(t=>e.request(fK,n,{...r,...t}),`assetsRowsData`,`query`,n)},subSchemaItemsData(n,r){return t(t=>e.request(pK,n,{...r,...t}),`subSchemaItemsData`,`query`,n)},getProjectBranches(n,r){return t(t=>e.request(mK,n,{...r,...t}),`getProjectBranches`,`query`,n)},deleteBranch(n,r){return t(t=>e.request(hK,n,{...r,...t}),`deleteBranch`,`mutation`,n)},getBranchesForSelect(n,r){return t(t=>e.request(gK,n,{...r,...t}),`getBranchesForSelect`,`query`,n)},getBranchRevisionsForCreate(n,r){return t(t=>e.request(_K,n,{...r,...t}),`getBranchRevisionsForCreate`,`query`,n)},createBranch(n,r){return t(t=>e.request(vK,n,{...r,...t}),`createBranch`,`mutation`,n)},GetRevisionChanges(n,r){return t(t=>e.request(yK,n,{...r,...t}),`GetRevisionChanges`,`query`,n)},GetTableChanges(n,r){return t(t=>e.request(bK,n,{...r,...t}),`GetTableChanges`,`query`,n)},confirmEmailCode(n,r){return t(t=>e.request(xK,n,{...r,...t}),`confirmEmailCode`,`mutation`,n)},getEndpointBranches(n,r){return t(t=>e.request(SK,n,{...r,...t}),`getEndpointBranches`,`query`,n)},getProjectEndpoints(n,r){return t(t=>e.request(CK,n,{...r,...t}),`getProjectEndpoints`,`query`,n)},getBranchRevisions(n,r){return t(t=>e.request(wK,n,{...r,...t}),`getBranchRevisions`,`query`,n)},createEndpoint(n,r){return t(t=>e.request(TK,n,{...r,...t}),`createEndpoint`,`mutation`,n)},deleteEndpoint(n,r){return t(t=>e.request(EK,n,{...r,...t}),`deleteEndpoint`,`mutation`,n)},issueAccessToken(n,r){return t(t=>e.request(DK,n,{...r,...t}),`issueAccessToken`,`query`,n)},loginGithub(n,r){return t(t=>e.request(OK,n,{...r,...t}),`loginGithub`,`mutation`,n)},loginGoogle(n,r){return t(t=>e.request(kK,n,{...r,...t}),`loginGoogle`,`mutation`,n)},login(n,r){return t(t=>e.request(AK,n,{...r,...t}),`login`,`mutation`,n)},getMigrationBranches(n,r){return t(t=>e.request(jK,n,{...r,...t}),`getMigrationBranches`,`query`,n)},getBranchMigrations(n,r){return t(t=>e.request(MK,n,{...r,...t}),`getBranchMigrations`,`query`,n)},applyMigrations(n,r){return t(t=>e.request(NK,n,{...r,...t}),`applyMigrations`,`mutation`,n)},getMigrations(n,r){return t(t=>e.request(PK,n,{...r,...t}),`getMigrations`,`query`,n)},activateEarlyAccess(n,r){return t(t=>e.request(FK,n,{...r,...t}),`activateEarlyAccess`,`mutation`,n)},createCheckout(n,r){return t(t=>e.request(IK,n,{...r,...t}),`createCheckout`,`mutation`,n)},cancelSubscription(n,r){return t(t=>e.request(LK,n,{...r,...t}),`cancelSubscription`,`mutation`,n)},getLimitsPageData(n,r){return t(t=>e.request(RK,n,{...r,...t}),`getLimitsPageData`,`query`,n)},getLimitsPagePlans(n,r){return t(t=>e.request(zK,n,{...r,...t}),`getLimitsPagePlans`,`query`,n)},getUsersOrganization(n,r){return t(t=>e.request(BK,n,{...r,...t}),`getUsersOrganization`,`query`,n)},addUserToOrganization(n,r){return t(t=>e.request(VK,n,{...r,...t}),`addUserToOrganization`,`mutation`,n)},removeUserFromOrganization(n,r){return t(t=>e.request(HK,n,{...r,...t}),`removeUserFromOrganization`,`mutation`,n)},adminValidateProjectFileBytes(n,r){return t(t=>e.request(UK,n,{...r,...t}),`adminValidateProjectFileBytes`,`query`,n)},adminRestoreProjectFileBytes(n,r){return t(t=>e.request(WK,n,{...r,...t}),`adminRestoreProjectFileBytes`,`mutation`,n)},updateProject(n,r){return t(t=>e.request(GK,n,{...r,...t}),`updateProject`,`mutation`,n)},deleteProjectForSettings(n,r){return t(t=>e.request(KK,n,{...r,...t}),`deleteProjectForSettings`,`mutation`,n)},fetchTableForStack(n,r){return t(t=>e.request(qK,n,{...r,...t}),`fetchTableForStack`,`query`,n)},createTableForStack(n,r){return t(t=>e.request(JK,n,{...r,...t}),`createTableForStack`,`mutation`,n)},updateTableForStack(n,r){return t(t=>e.request(YK,n,{...r,...t}),`updateTableForStack`,`mutation`,n)},renameTableForStack(n,r){return t(t=>e.request(XK,n,{...r,...t}),`renameTableForStack`,`mutation`,n)},rowPageData(n,r){return t(t=>e.request(ZK,n,{...r,...t}),`rowPageData`,`query`,n)},signUp(n,r){return t(t=>e.request(QK,n,{...r,...t}),`signUp`,`mutation`,n)},setUsername(n,r){return t(t=>e.request($K,n,{...r,...t}),`setUsername`,`mutation`,n)},getUsersProject(n,r){return t(t=>e.request(eq,n,{...r,...t}),`getUsersProject`,`query`,n)},searchUsers(n,r){return t(t=>e.request(tq,n,{...r,...t}),`searchUsers`,`query`,n)},addUserToProject(n,r){return t(t=>e.request(nq,n,{...r,...t}),`addUserToProject`,`mutation`,n)},removeUserFromProject(n,r){return t(t=>e.request(rq,n,{...r,...t}),`removeUserFromProject`,`mutation`,n)},updateUserProjectRole(n,r){return t(t=>e.request(iq,n,{...r,...t}),`updateUserProjectRole`,`mutation`,n)},createUser(n,r){return t(t=>e.request(aq,n,{...r,...t}),`createUser`,`mutation`,n)},configuration(n,r){return t(t=>e.request(oq,n,{...r,...t}),`configuration`,`query`,n)},getMe(n,r){return t(t=>e.request(sq,n,{...r,...t}),`getMe`,`query`,n)},getProjectGraph(n,r){return t(t=>e.request(cq,n,{...r,...t}),`getProjectGraph`,`query`,n)},findBranches(n,r){return t(t=>e.request(lq,n,{...r,...t}),`findBranches`,`query`,n)},findRevisions(n,r){return t(t=>e.request(uq,n,{...r,...t}),`findRevisions`,`query`,n)},meProjectsList(n,r){return t(t=>e.request(dq,n,{...r,...t}),`meProjectsList`,`query`,n)},GetRowChanges(n,r){return t(t=>e.request(fq,n,{...r,...t}),`GetRowChanges`,`query`,n)},GetTableChangesForFilter(n,r){return t(t=>e.request(pq,n,{...r,...t}),`GetTableChangesForFilter`,`query`,n)},foreignKeyTableWithRows(n,r){return t(t=>e.request(mq,n,{...r,...t}),`foreignKeyTableWithRows`,`query`,n)},createRowForStack(n,r){return t(t=>e.request(hq,n,{...r,...t}),`createRowForStack`,`mutation`,n)},updateRowForStack(n,r){return t(t=>e.request(gq,n,{...r,...t}),`updateRowForStack`,`mutation`,n)},renameRowForStack(n,r){return t(t=>e.request(_q,n,{...r,...t}),`renameRowForStack`,`mutation`,n)},RowListRows(n,r){return t(t=>e.request(vq,n,{...r,...t}),`RowListRows`,`query`,n)},DeleteRow(n,r){return t(t=>e.request(yq,n,{...r,...t}),`DeleteRow`,`mutation`,n)},DeleteRows(n,r){return t(t=>e.request(bq,n,{...r,...t}),`DeleteRows`,`mutation`,n)},PatchRowInline(n,r){return t(t=>e.request(xq,n,{...r,...t}),`PatchRowInline`,`mutation`,n)},GetTableViews(n,r){return t(t=>e.request(Sq,n,{...r,...t}),`GetTableViews`,`query`,n)},UpdateTableViews(n,r){return t(t=>e.request(Cq,n,{...r,...t}),`UpdateTableViews`,`mutation`,n)},searchRows(n,r){return t(t=>e.request(wq,n,{...r,...t}),`searchRows`,`query`,n)},revertChangesForSidebar(n,r){return t(t=>e.request(Tq,n,{...r,...t}),`revertChangesForSidebar`,`mutation`,n)},createRevisionForSidebar(n,r){return t(t=>e.request(Eq,n,{...r,...t}),`createRevisionForSidebar`,`mutation`,n)},createBranchForSidebar(n,r){return t(t=>e.request(Dq,n,{...r,...t}),`createBranchForSidebar`,`mutation`,n)},deleteTableForList(n,r){return t(t=>e.request(Oq,n,{...r,...t}),`deleteTableForList`,`mutation`,n)},tableListData(n,r){return t(t=>e.request(kq,n,{...r,...t}),`tableListData`,`query`,n)},tableRelationsData(n,r){return t(t=>e.request(Aq,n,{...r,...t}),`tableRelationsData`,`query`,n)}}}var Nq=class{constructor(){}get(e){let t=globalThis.__env__?.[e],n={BASE_URL:`/`,DEV:!1,GIT_BRANCH_NAME:`HEAD`,GIT_COMMIT_HASH:`085f8f4`,MODE:`production`,PACKAGE_VERSION:`2.7.0`,PROD:!0,REACT_APP_ENDPOINT_HOST:``,REACT_APP_ENDPOINT_PORT:``,REACT_APP_ENDPOINT_SERVER_URL:`/endpoint`,REACT_APP_GRAPHQL_SERVER_URL:`/graphql`,REACT_APP_SWAGGER_SERVER_URL:`/api`,SSR:!1}[e];return t||n}};Y.register(Nq,()=>new Nq,{scope:`singleton`});var Pq=`revisium:sidebar-collapsed`,Fq=200,Iq=class{_isCollapsed=!1;_isHoverExpanded=!1;_hoverDelay=new cH(Fq);_leaveDelay=new cH(Fq);_keyboardHandler=null;constructor(e){this.storage=e,this._isCollapsed=e.getItem(Pq)===`true`,f(this,{},{autoBind:!0}),s(()=>this._isCollapsed,e=>{this.storage.setItem(Pq,String(e))})}get isCollapsed(){return this._isCollapsed}get isHoverExpanded(){return this._isHoverExpanded}get isSidebarVisible(){return!this._isCollapsed||this._isHoverExpanded}toggle(){this._isCollapsed=!this._isCollapsed,this._isHoverExpanded=!1}setHoverExpanded(e){this._isHoverExpanded=e}startHoverIntent(){this._leaveDelay.cancel(),this._hoverDelay.schedule(()=>{this.setHoverExpanded(!0)})}cancelHoverIntent(){this._hoverDelay.cancel()}startLeaveIntent(){this._leaveDelay.schedule(()=>{this.setHoverExpanded(!1)})}cancelLeaveIntent(){this._leaveDelay.cancel()}dismissOverlay(){this.setHoverExpanded(!1)}initKeyboard(){this._keyboardHandler||(this._keyboardHandler=e=>{(e.metaKey||e.ctrlKey)&&e.key===`\\`&&(e.preventDefault(),this.toggle())},globalThis.addEventListener(`keydown`,this._keyboardHandler))}disposeKeyboard(){this._keyboardHandler&&=(globalThis.removeEventListener(`keydown`,this._keyboardHandler),null),this._hoverDelay.dispose(),this._leaveDelay.dispose()}};Y.register(Iq,()=>new Iq(localStorage),{scope:`singleton`});var Lq=({sidebar:e,footer:t})=>(0,I.jsxs)(I.Fragment,{children:[e,t&&(0,I.jsx)(A,{alignSelf:`center`,mt:`1rem`,children:t})]}),Rq=288,zq=48,Bq=`0.2s`,Vq=g(({hideSidebar:e,sidebar:t,title:n,actions:r,children:i,footer:a})=>{let o=Y.get(Iq);(0,L.useEffect)(()=>(o.initKeyboard(),()=>{o.disposeKeyboard()}),[o]);let s=!e,c=s&&o.isCollapsed,l=c&&o.isHoverExpanded,u=s?c?`${zq}px`:`${Rq}px`:`0px`;return(0,I.jsxs)(j,{minHeight:`100vh`,children:[s&&(0,I.jsx)(j,{width:u,minWidth:u,flexShrink:0,height:`100vh`,top:0,position:`sticky`,transition:`width ${Bq} ease, min-width ${Bq} ease`,overflow:`hidden`,children:c?(0,I.jsx)(j,{width:`${zq}px`,minWidth:`${zq}px`,height:`100vh`,flexDirection:`column`,alignItems:`center`,paddingTop:`20px`,onMouseEnter:o.startHoverIntent,onMouseLeave:o.cancelHoverIntent,children:(0,I.jsx)(A,{as:`button`,fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.600`},display:`flex`,alignItems:`center`,onClick:o.toggle,"aria-label":`Toggle sidebar`,children:(0,I.jsx)(Zte,{})})}):(0,I.jsx)(j,{width:`${Rq}px`,minWidth:`${Rq}px`,borderRight:`1px solid`,borderRightColor:`newGray.100`,flexDirection:`column`,justifyContent:t?`space-between`:`flex-end`,padding:`16px`,height:`100vh`,children:(0,I.jsx)(Lq,{sidebar:t,footer:a})})}),c&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(A,{position:`fixed`,left:0,top:0,width:`100vw`,height:`100vh`,zIndex:9,pointerEvents:l?`auto`:`none`,onClick:o.dismissOverlay}),(0,I.jsx)(j,{position:`fixed`,left:0,top:0,width:`${Rq}px`,height:`100vh`,zIndex:10,backgroundColor:`white`,borderRight:`1px solid`,borderRightColor:`newGray.100`,flexDirection:`column`,justifyContent:t?`space-between`:`flex-end`,padding:`16px`,boxShadow:l?`4px 0 12px rgba(0, 0, 0, 0.08)`:`none`,transform:l?`translateX(0)`:`translateX(-${Rq}px)`,transition:`transform ${Bq} ease, box-shadow ${Bq} ease`,onMouseLeave:o.startLeaveIntent,onMouseEnter:o.cancelLeaveIntent,pointerEvents:l?`auto`:`none`,children:(0,I.jsx)(Lq,{sidebar:t,footer:a})})]}),(0,I.jsxs)(j,{flex:1,minWidth:0,flexDirection:`column`,alignItems:`center`,children:[(n||r)&&(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`white`,borderBottom:`1px solid`,borderBottomColor:`gray.50`,justifyContent:`space-between`,maxWidth:`900px`,padding:`8px`,width:`100%`,position:`sticky`,zIndex:1,top:0,children:[n,r]}),(0,I.jsx)(j,{flex:1,flexDirection:`column`,maxWidth:`900px`,padding:`1rem 1rem 0rem 1rem`,width:`100%`,children:i})]})]})}),Hq=({height:e=`2.5rem`,title:t,onClick:n,disabled:r,isSelected:i,isLoading:a,icon:o,dataTestId:s})=>(0,I.jsx)(N,{"data-testid":s,_hover:{color:`gray.400`,backgroundColor:`white`},_disabled:i?{backgroundColor:`gray.50`,cursor:`not-allowed`}:void 0,alignSelf:`flex-start`,color:`gray.300`,fontWeight:`500`,fontSize:16,height:e,disabled:r||i,loading:a,variant:`ghost`,onClick:n,children:(0,I.jsxs)(j,{alignItems:`center`,gap:`0.5rem`,children:[o&&(0,I.jsx)(A,{fontSize:`sm`,children:o}),(0,I.jsx)(k,{children:t})]})}),Uq=e=>(0,I.jsx)(Hq,{...e,icon:(0,I.jsx)(af,{})}),Wq=({height:e=`2.5rem`,loading:t,isDisabled:n,onClick:r,title:i,dataTestId:a})=>(0,I.jsxs)(N,{"data-testid":a,_hover:{backgroundColor:`gray.50`},alignSelf:`flex-start`,color:`gray.400`,height:e,loading:t,disabled:n,variant:`ghost`,onClick:r,width:`48px`,children:[(0,I.jsx)(Ve,{size:`sm`,mr:i?8:0,children:(0,I.jsx)(ef,{})}),i]}),Gq=({height:e=`2.5rem`,onClick:t,disabled:n,dataTestId:r})=>(0,I.jsx)(N,{"data-testid":r,disabled:n,_hover:{backgroundColor:`gray.50`},alignSelf:`flex-start`,color:`gray.400`,height:e,variant:`ghost`,onClick:t,width:`48px`,children:(0,I.jsx)(Ve,{size:`md`,children:(0,I.jsx)(ip,{})})}),Kq=({dataTestId:e,...t})=>(0,I.jsx)(Ze,{"data-testid":e,_hover:{backgroundColor:`gray.100`},color:`gray.400`,variant:`ghost`,size:`lg`,width:`40px`,height:`40px`,...t,children:(0,I.jsx)(nf,{})}),qq=({value:e,placeholder:t,autoFocus:n,onChange:r,onBlur:i,onEnter:a,width:o,height:s,type:c,dataTestId:l,autoComplete:u})=>{let d=SB();return(0,I.jsx)(qt,{autoComplete:u,"data-testid":l,borderColor:`gray.100`,padding:`0 9px`,placeholder:t,ref:n?d:void 0,value:e,variant:`outline`,onChange:r,onBlur:i,width:o,height:s,type:c,onKeyDown:a?e=>{e.key===`Enter`&&a()}:void 0})},Jq=Rd({placement:`top`,pauseOnPageIdle:!0,duration:1500}),Yq=Rd({placement:`bottom`,pauseOnPageIdle:!0,duration:1500}),Xq=e=>(0,I.jsxs)(_t,{width:{md:`sm`},children:[e.type===`loading`?(0,I.jsx)(Ht,{size:`sm`,color:`blue.solid`}):(0,I.jsx)(ft,{}),(0,I.jsxs)(_e,{gap:`1`,flex:`1`,maxWidth:`100%`,children:[e.title&&(0,I.jsx)(eee,{children:e.title}),e.description&&(0,I.jsx)(ree,{color:`gray.500`,children:e.description})]}),e.action&&(0,I.jsx)(lt,{children:e.action.label}),e.closable&&(0,I.jsx)(Ft,{})]}),Zq=()=>(0,I.jsxs)(R,{children:[(0,I.jsx)(Rt,{toaster:Jq,insetInline:{mdDown:`4`},children:e=>(0,I.jsx)(Xq,{...e})}),(0,I.jsx)(Rt,{toaster:Yq,insetInline:{mdDown:`4`},children:e=>(0,I.jsx)(Xq,{...e})})]}),Qq=L.forwardRef(function(e,t){let{showArrow:n,children:r,disabled:i,portalled:a=!0,content:o,contentProps:s,portalRef:c,...l}=e;return i?r:(0,I.jsxs)(Wt,{...l,children:[(0,I.jsx)(Qt,{asChild:!0,children:r}),(0,I.jsx)(R,{disabled:!a,container:c,children:(0,I.jsx)(rt,{children:(0,I.jsxs)(Et,{ref:t,...s,children:[n&&(0,I.jsx)(Vt,{children:(0,I.jsx)(Yt,{})}),o]})})})]})}),$q={deprecated:{type:`boolean`},title:{type:`string`},description:{type:`string`}};({...$q});var eJ={type:{const:`string`},default:{type:`string`},readOnly:{type:`boolean`},pattern:{type:`string`,format:`regex`},enum:{type:`array`,items:{type:`string`},minItems:1,uniqueItems:!0},format:{type:`string`,enum:[`date-time`,`date`,`time`,`email`,`regex`]},contentMediaType:{type:`string`,enum:[`text/plain`,`text/markdown`,`text/html`,`application/json`,`application/schema+json`,`application/yaml`]},...$q};({...eJ}),{...eJ},{...$q},{...$q},{...$q},{...$q};var tJ=new(e(vd(),1)).default;tJ.addKeyword({keyword:`foreignKey`,type:`string`}),tJ.addFormat(`regex`,{type:`string`,validate:e=>{try{return new RegExp(e),!0}catch{return!1}}});var nJ=(e,t)=>({result:tJ.validate(e,t),errors:tJ.errors}),rJ=({dataTestId:e,...t})=>(0,I.jsx)(Ze,{"data-testid":e,_hover:{backgroundColor:`gray.100`},color:`gray.400`,variant:`ghost`,...t,children:(0,I.jsx)(qf,{})}),iJ={JsonCard:`_JsonCard_15gzu_1`,CopyButton:`_CopyButton_15gzu_1`},aJ=({data:e,readonly:t,onChange:n,schema:r,onBlur:i})=>{let[a,o]=(0,L.useState)(``),s=JSON.stringify(e,null,3),[c,l]=(0,L.useState)(s),u=(0,L.useRef)(!1),d=u.current?c:s,f=(0,L.useCallback)(async()=>{await navigator.clipboard.writeText(d),Jq.info({duration:1500,description:`Copied to clipboard`})},[d]),p=(0,L.useCallback)(e=>{l(e);try{let t=JSON.parse(e);if(r){let e=nJ(r,t);if(!e.result){o(`"${e.errors?.[0]?.instancePath||`/`}": ${e.errors?.[0]?.message}`);return}}o(``),n?.(t)}catch(e){console.error(e),o(`Invalid JSON`)}},[n,r]),m=(0,L.useCallback)(()=>{u.current=!0,l(s)},[s]),h=(0,L.useCallback)(()=>{u.current=!1,l(s),i?.()},[i,s]);return(0,I.jsxs)(j,{position:`relative`,width:`100%`,flex:1,className:iJ.JsonCard,direction:`column`,gap:`1rem`,children:[(0,I.jsxs)(A,{p:1,flex:1,children:[(0,I.jsx)(DO,{value:d,extensions:[G.lineWrapping,nk()],editable:!t,theme:pC,maxWidth:`100%`,basicSetup:{lineNumbers:!0,foldGutter:!0},onChange:p,onFocus:m,onBlur:h}),(0,I.jsx)(rJ,{dataTestId:`json-card-copy-button`,"aria-label":``,position:`absolute`,top:`8px`,right:`8px`,className:iJ.CopyButton,onClick:f})]}),(0,I.jsx)(j,{height:`40px`,paddingBottom:`8px`,alignItems:`flex-end`,backgroundColor:`white`,width:`100%`,position:`sticky`,bottom:0,justifyContent:`center`,children:(0,I.jsx)(k,{color:`gray`,children:a})})]})},oJ=g(()=>{let e=Y.get(Iq),t=e.isCollapsed&&e.isHoverExpanded,n=t?`Expand sidebar`:`Collapse sidebar`,r=t?Ite:Fte;return(0,I.jsx)(Qq,{content:n,children:(0,I.jsx)(A,{as:`button`,fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.600`},display:`flex`,alignItems:`center`,flexShrink:0,onClick:e.toggle,opacity:+!!t,_groupHover:{opacity:1},transition:`opacity 0.15s ease`,"aria-label":n,children:(0,I.jsx)(r,{})})})}),sJ=({to:e,label:t,isActive:n,icon:r,onClick:i,badge:a})=>{let o=(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:n?`newGray.100`:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:n?`black`:`newGray.600`,fontWeight:`400`,textDecoration:`none`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,onClick:i,children:[r&&(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:r}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:t}),a!=null&&a>0&&(0,I.jsx)(A,{fontSize:`11px`,fontWeight:`600`,color:`newGray.400`,backgroundColor:`newGray.100`,borderRadius:`4px`,paddingX:`6px`,paddingY:`2px`,minWidth:`20px`,textAlign:`center`,children:a>99?`99+`:a})]});return e&&!i?(0,I.jsx)(An,{to:e,style:{textDecoration:`none`,width:`100%`},children:o}):o},cJ=g(({model:e,roleSlot:t,disableRemove:n})=>(0,I.jsx)(A,{borderWidth:`1px`,borderColor:`newGray.200`,borderRadius:`md`,padding:`1rem`,backgroundColor:`white`,_hover:{borderColor:`newGray.300`},transition:`border-color 0.2s`,children:(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsxs)(P,{gap:3,children:[(0,I.jsx)(A,{color:`newGray.400`,children:(0,I.jsx)(zf,{size:20})}),(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontWeight:`500`,color:`newGray.600`,children:e.displayName}),e.username&&e.email&&(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,children:e.email})]})]}),(0,I.jsxs)(P,{gap:3,children:[t,e.canRemove&&(0,I.jsx)(N,{variant:`ghost`,size:`sm`,color:`red.500`,onClick:()=>e.remove(),loading:e.isRemoving,disabled:n,children:(0,I.jsx)(Rf,{})})]})]})})),lJ=g(({model:e,title:t,roleSelect:n})=>(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`lg`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:t})}),(0,I.jsx)(be,{children:(0,I.jsxs)(rn,{value:e.activeTab,onValueChange:({value:t})=>e.setActiveTab(t),children:[(0,I.jsxs)(et,{marginBottom:`1rem`,children:[(0,I.jsx)(fn,{value:`search`,children:`Search User`}),e.canCreateUser&&(0,I.jsx)(fn,{value:`create`,children:`Create New`})]}),(0,I.jsx)(bt,{value:`search`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Search by username or email`}),(0,I.jsx)(qt,{placeholder:`Enter username or email...`,value:e.searchQuery,onChange:t=>e.setSearchQuery(t.target.value),autoComplete:`off`})]}),e.isSearching?(0,I.jsx)(j,{justify:`center`,padding:`2rem`,children:(0,I.jsx)(Ht,{})}):e.searchResults.length>0?(0,I.jsx)(M,{align:`stretch`,gap:`0.5rem`,maxHeight:`200px`,overflowY:`auto`,children:e.searchResults.map(t=>(0,I.jsx)(A,{padding:`0.75rem`,borderWidth:`1px`,borderColor:e.selectedUserId===t.id?`blue.500`:`newGray.200`,borderRadius:`md`,backgroundColor:e.selectedUserId===t.id?`blue.50`:`white`,cursor:`pointer`,onClick:()=>e.setSelectedUserId(t.id),_hover:{borderColor:`blue.300`},transition:`all 0.2s`,children:(0,I.jsxs)(j,{align:`center`,justify:`space-between`,children:[(0,I.jsxs)(j,{align:`center`,gap:2,children:[(0,I.jsx)(zf,{size:16}),(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,children:t.username||t.email||t.id}),t.username&&t.email&&(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:t.email})]})]}),e.selectedUserId===t.id&&(0,I.jsx)(Lte,{size:16,color:`var(--chakra-colors-blue-500)`})]})},t.id))}):e.searchQuery.length>0?(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,textAlign:`center`,padding:`2rem`,children:`No users found`}):null,(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Role`}),n]})]})}),e.canCreateUser&&(0,I.jsx)(bt,{value:`create`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username *`}),(0,I.jsx)(qt,{placeholder:`Enter username...`,value:e.newUsername,onChange:t=>e.setNewUsername(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Password *`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter password (min 6 characters)...`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email (optional)`}),(0,I.jsx)(qt,{type:`email`,placeholder:`Enter email...`,value:e.newEmail,onChange:t=>e.setNewEmail(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Role`}),n]})]})})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(N,{variant:`outline`,onClick:e.close,children:`Cancel`}),e.activeTab===`search`?(0,I.jsx)(N,{onClick:e.addSelectedUser,disabled:!e.canAddSelectedUser,loading:e.isAdding,children:`Add User`}):(0,I.jsx)(N,{onClick:e.createAndAddUser,disabled:!e.canCreateNewUser,loading:e.isCreating,children:`Create & Add`})]}),(0,I.jsx)(Ie,{})]})})]})})),uJ=g(({model:e,sidebar:t,label:n,emptyTitle:r,emptySubtitle:i,subtitle:a,onAddClick:o,modal:s,children:c})=>e.showInitialLoading?(0,I.jsx)(Vq,{sidebar:t,children:(0,I.jsx)(j,{justify:`center`,align:`center`,height:`200px`,children:(0,I.jsx)(Ht,{})})}):e.showError?(0,I.jsx)(Vq,{sidebar:t,children:(0,I.jsx)(j,{justify:`center`,align:`center`,height:`200px`,children:(0,I.jsxs)(k,{color:`red.500`,children:[`Error loading `,n.toLowerCase()]})})}):e.showNoMembers?(0,I.jsxs)(Vq,{sidebar:t,children:[(0,I.jsx)(A,{mb:`4rem`,children:(0,I.jsxs)(j,{justify:`center`,align:`center`,height:`200px`,flexDirection:`column`,gap:4,children:[(0,I.jsxs)(A,{textAlign:`center`,children:[(0,I.jsx)(Bf,{size:48,color:`var(--chakra-colors-newGray-400)`,style:{margin:`0 auto`}}),(0,I.jsx)(k,{color:`newGray.400`,mt:2,children:r}),(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,mt:1,children:i})]}),e.canAddMember&&(0,I.jsxs)(N,{color:`gray`,variant:`ghost`,size:`sm`,onClick:o,focusRing:`none`,children:[(0,I.jsx)(Pf,{}),`Add`]})]})}),s]}):(0,I.jsxs)(Vq,{sidebar:t,children:[(0,I.jsxs)(A,{mb:`4rem`,children:[(0,I.jsxs)(j,{justify:`space-between`,align:`center`,marginBottom:`0.5rem`,children:[(0,I.jsxs)(k,{fontSize:`20px`,fontWeight:`600`,color:`newGray.500`,children:[n,` (`,e.totalCount,`)`]}),e.canAddMember&&(0,I.jsxs)(N,{color:`gray`,variant:`ghost`,size:`sm`,onClick:o,children:[(0,I.jsx)(Pf,{}),`Add`]})]}),(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,marginBottom:`1.5rem`,children:a}),(0,I.jsx)(M,{align:`stretch`,gap:3,children:c}),e.hasNextPage&&(0,I.jsx)(j,{justify:`center`,mt:4,children:(0,I.jsx)(N,{variant:`plain`,onClick:()=>e.tryToFetchNextPage(),loading:e.isLoading,children:`Load more`})})]}),s]})),dJ=class e{graphQLClient;client;onUnauthorized=null;constructor(t){this.environmentService=t;let n=this.environmentService.get(`REACT_APP_GRAPHQL_SERVER_URL`);if(!n)throw Error(`Invalid REACT_APP_GRAPHQL_SERVER_URL`);this.graphQLClient=new cee(n,{credentials:`include`,responseMiddleware:t=>{if(t instanceof Pn&&e.isUnauthorized(t))return;let n=t?.response?.errors?.[0]?.message;n&&Jq.info({duration:3e3,description:n})}}),this.wrapRequestWithRefreshRetry(),this.client=Mq(this.graphQLClient)}setToken(e){this.graphQLClient.setHeaders(e?{Authorization:`Bearer ${e}`}:{})}setUnauthorizedHandler(e){this.onUnauthorized=e}wrapRequestWithRefreshRetry(){let t=this.graphQLClient.request.bind(this.graphQLClient),n=async(n,r,i)=>{try{return await t(n,r,i)}catch(a){if(!e.isUnauthorized(a)||!this.onUnauthorized||!await this.onUnauthorized())throw a;return await t(n,r,i)}};this.graphQLClient.request=n}static isUnauthorized(e){if(!(e instanceof Pn))return!1;if(e.response.status===401)return!0;let t=e.response?.errors;return!Array.isArray(t)||t.length===0?!1:t.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e,n=typeof t.message==`string`?t.message:``;if(/^unauthorized$/i.test(n.trim()))return!0;let r=t.extensions?.code;return!!(typeof r==`string`&&/^UNAUTHENTICATED$/i.test(r)||t.extensions?.originalError?.statusCode===401)})}};Y.register(dJ,()=>new dJ(Y.get(Nq)),{scope:`singleton`});var Q=Y.get(dJ).client,fJ=`/api/auth/refresh`,pJ=`/api/auth/logout`,mJ=`rev_session`,hJ=class e{isLoaded=!1;user=null;token=null;refreshPromise=null;constructor(e,t,n){this.apiService=e,this.systemPermissions=t,this.permissionService=n,f(this),this.apiService.setUnauthorizedHandler(()=>this.tryRefresh())}async initialize(){if(!e.hasSessionCookie()){c(()=>{this.isLoaded=!0});return}try{await this.fetchMe()}catch{if(await this.tryRefresh())try{await this.fetchMe()}catch{}}c(()=>{this.isLoaded=!0})}async afterLogin(e){e!==void 0&&c(()=>{this.token=e}),await this.fetchMe()}setBearerToken(e){c(()=>{this.token=e}),this.apiService.setToken(e)}async logout(){try{await fetch(pJ,{method:`POST`,credentials:`include`})}catch{}this.apiService.setToken(null),c(()=>{this.user=null,this.token=null}),this.systemPermissions.clearAll()}async refresh(){return this.tryRefresh()}async fetchMe(){try{let e=await this.apiService.client.getMe();c(()=>{this.user=e.me}),this.systemPermissions.setUserRole(e.me.role??null),this.loadOrganizationPermissions(e.me)}catch(e){throw c(()=>{this.user=null}),e}}tryRefresh(){if(this.refreshPromise)return this.refreshPromise;let e=this.doRefresh();return c(()=>{this.refreshPromise=e}),e.finally(()=>{c(()=>{this.refreshPromise=null})}),e}async doRefresh(){try{return(await fetch(fJ,{method:`POST`,credentials:`include`})).ok}catch{return!1}}static hasSessionCookie(){if(typeof document>`u`)return!1;let e=document.cookie;return e?e.split(`;`).some(e=>e.trim()===`${mJ}=1`):!1}loadOrganizationPermissions(e){let t=e.organization?.userOrganization?.role?.permissions,n=e.organization?.id;if(t&&n){let e=t.map(e=>({id:e.id,action:e.action,subject:e.subject,condition:e.condition??null}));this.permissionService.addOrganizationPermissions(n,e)}}};Y.register(hJ,()=>{let e=new hJ(Y.get(dJ),Y.get(yW),Y.get(vW));return e.initialize(),e},{scope:`singleton`});var gJ=class{isLoaded=!1;error=null;data=null;constructor(e){this.apiService=e,f(this)}async initialize(){await this.init()}get availableSignUp(){return this.availableEmailSignUp||this.availableGoogleOauth||this.availableGithubOauth}get availableEmailSignUp(){return this.data?.availableEmailSignUp}get availableGoogleOauth(){return!!this.data?.google.available}get googleOauthClientId(){if(!this.data?.google.clientId)throw Error(`Invalid Google client id`);return this.data?.google.clientId}get availableGithubOauth(){return!!this.data?.github.available}get githubOauthClientId(){if(!this.data?.github.clientId)throw Error(`Invalid Github client id`);return this.data?.github.clientId}get billingEnabled(){return this.data?.billing.enabled??!1}get cacheEnabled(){return this.data?.cache?.enabled??!1}get noAuth(){return this.data?.noAuth??!1}async init(){await this.request()}async request(){try{let e=await this.apiService.client.configuration();this.setData(e.configuration)}catch(e){this.setError(e),console.error(e)}finally{this.setIsLoaded(!0)}}setData(e){this.data=e}setError(e){this.error=e}setIsLoaded(e){this.isLoaded=e}};Y.register(gJ,()=>{let e=new gJ(Y.get(dJ));return e.initialize(),e},{scope:`singleton`});var _J=class{constructor(e,t){this.authService=e,this.configurationService=t,f(this)}get isLoaded(){return this.authService.isLoaded&&this.configurationService.isLoaded}};Y.register(_J,()=>new _J(Y.get(hJ),Y.get(gJ)),{scope:`singleton`});var vJ=`sandbox`,yJ=`login`,bJ=`logout`,xJ=`signup`,SJ=`username`,CJ=`github`,wJ=`google`,TJ=`authorize`,EJ=`get-token`,DJ=`get-mcp-token`,OJ=`completed`,kJ=`confirm`,AJ=`:organizationId`,jJ=`-/settings`,MJ=`-/members`,NJ=`-/limits`,PJ=`:projectName`,FJ=`-/settings`,IJ=`-/users`,LJ=`-/api-keys`,RJ=`-/mcp`,zJ=`:branchName`,BJ=`-/changes`,VJ=`-/assets`,HJ=`-/migrations`,UJ=`-/endpoints`,WJ=`-/branches`,GJ=`-/relations`,KJ=`-/branch-map`,qJ=`:revisionIdOrTag`,JJ=`:tableId`,YJ=`:rowId`,XJ=`draft`,ZJ=`head`,QJ=`admin`,$J=`users`,eY=`:userId`,tY=`organizations`,nY=`cache`,rY=function(e){return e.Organization=`organization`,e.Project=`project`,e.Branch=`branch`,e.Revision=`revision`,e.Table=`table`,e.Row=`row`,e.Changes=`changes`,e.Assets=`assets`,e.Migrations=`migrations`,e.Endpoints=`endpoints`,e.Branches=`branches`,e.Relations=`relations`,e.BranchMap=`branchMap`,e.OrganizationOverview=`organizationOverview`,e.OrganizationSettings=`organizationSettings`,e.OrganizationMembers=`organizationMembers`,e.OrganizationLimits=`organizationLimits`,e.ProjectSettings=`projectSettings`,e.ProjectUsers=`projectUsers`,e.ProjectApiKeys=`projectApiKeys`,e.ProjectMcp=`projectMcp`,e.Admin=`admin`,e.AdminUsers=`adminUsers`,e.AdminUserDetail=`adminUserDetail`,e.AdminOrganizations=`adminOrganizations`,e.AdminCache=`adminCache`,e}({}),iY=async()=>Y.get(yW).canReadUser?!0:Cn(`/`),aY=async({request:e})=>{let t=Y.get(hJ),n=Y.get(gJ);if(!t.user){if(n.noAuth)try{let e=await Q.login({data:{emailOrUsername:`admin`,password:``}});return t.setBearerToken(e.login.accessToken),await t.afterLogin(),!0}catch(e){console.error(`noAuth bootstrap failed`,e),t.setBearerToken(null)}let r=new URL(e.url),i=$V(`${r.pathname}${r.search}`);return Cn(`${n.availableSignUp?`/${xJ}`:`/${yJ}`}${i}`)}return t.user.username?!0:Cn(`/${SJ}`)},oY=async e=>{let t=Y.get(hJ),n=Y.get(gJ);if(!t.user){if(n.noAuth){try{let e=await Q.login({data:{emailOrUsername:`admin`,password:``}});t.setBearerToken(e.login.accessToken),await t.afterLogin()}catch(e){console.error(`noAuth bootstrap failed`,e),t.setBearerToken(null)}return!0}return!0}return t.user.username?!0:Cn(`/${SJ}`)},sY=async()=>Y.get(hJ).user?Cn(`/`):!0,cY=async()=>{let e=Y.get(hJ),t=Y.get(gJ);return e.user||!t.availableSignUp?Cn(`/`):!0},lY=(...e)=>async t=>{let n=null;for(let r of e){let e=await r(t);if(e&&typeof e==`object`&&`status`in e&&e.status===302)return e;n=e}return n},uY=async()=>!0,dY=class{statsRequest=X.of(Q.adminCacheStats);resetRequest=X.of(Q.adminResetAllCache);configurationService;_resetSuccess=!1;_showConfirm=!1;constructor(e){this.configurationService=e,f(this,{},{autoBind:!0})}get cacheEnabled(){return this.configurationService.cacheEnabled}get isLoading(){return this.statsRequest.isLoading}get isResetting(){return this.resetRequest.isLoading}get resetSuccess(){return this._resetSuccess}get showConfirm(){return this._showConfirm}get totalHits(){return this.statsRequest.data?.adminCacheStats.totalHits??0}get totalMisses(){return this.statsRequest.data?.adminCacheStats.totalMisses??0}get totalWrites(){return this.statsRequest.data?.adminCacheStats.totalWrites??0}get totalDeletes(){return this.statsRequest.data?.adminCacheStats.totalDeletes??0}get totalClears(){return this.statsRequest.data?.adminCacheStats.totalClears??0}get overallHitRate(){return this.statsRequest.data?.adminCacheStats.overallHitRate??0}get byCategory(){return this.statsRequest.data?.adminCacheStats.byCategory??[]}get resetError(){return this.resetRequest.errorMessage??null}openConfirm(){this._showConfirm=!0,this._resetSuccess=!1}closeConfirm(){this._showConfirm=!1}async confirmReset(){this._showConfirm=!1,(await this.resetRequest.fetch({})).isRight&&(c(()=>{this._resetSuccess=!0}),this.statsRequest.fetch({}))}init(){this.cacheEnabled&&this.statsRequest.fetch({})}dispose(){this.statsRequest.abort(),this.resetRequest.abort()}};Y.register(dY,()=>new dY(Y.get(gJ)),{scope:`request`});var fY=({label:e,value:t,isLoading:n})=>(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,minWidth:`160px`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,marginBottom:`8px`,children:e}),n?(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`}):(0,I.jsx)(k,{fontSize:`2xl`,fontWeight:`600`,color:`gray.900`,children:t})]}),pY=({keyName:e,hits:t,misses:n,writes:r,deletes:i,hitRate:a})=>(0,I.jsxs)(j,{padding:`12px 16px`,borderBottom:`1px solid`,borderColor:`gray.100`,alignItems:`center`,gap:`16px`,_last:{borderBottom:`none`},children:[(0,I.jsx)(k,{flex:`1`,fontSize:`sm`,fontWeight:`500`,fontFamily:`mono`,children:e}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[t,` hits`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[n,` misses`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[r,` writes`]}),(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,minWidth:`80px`,textAlign:`right`,children:[i,` del`]}),(0,I.jsxs)(k,{fontSize:`sm`,fontWeight:`500`,minWidth:`60px`,textAlign:`right`,children:[(a*100).toFixed(1),`%`]})]}),mY=g(()=>{let e=CB(dY);return(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsx)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsx)(Gt,{fontSize:`16px`,children:(0,I.jsx)(Dt,{children:(0,I.jsx)(Xt,{color:`gray`,children:`Cache`})})})})})}),e.cacheEnabled?(0,I.jsxs)(A,{padding:`8px`,paddingTop:`16px`,children:[(0,I.jsxs)(j,{gap:`16px`,flexWrap:`wrap`,marginBottom:`24px`,children:[(0,I.jsx)(fY,{label:`Hit Rate`,value:`${(e.overallHitRate*100).toFixed(1)}%`,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Hits`,value:e.totalHits,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Misses`,value:e.totalMisses,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Writes`,value:e.totalWrites,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Deletes`,value:e.totalDeletes,isLoading:e.isLoading}),(0,I.jsx)(fY,{label:`Clears`,value:e.totalClears,isLoading:e.isLoading})]}),e.byCategory.length>0&&(0,I.jsxs)(A,{marginBottom:`24px`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`600`,color:`gray.700`,marginBottom:`8px`,children:`By Cache Type`}),(0,I.jsx)(A,{border:`1px solid`,borderColor:`gray.200`,borderRadius:`8px`,backgroundColor:`white`,children:e.byCategory.map(e=>(0,I.jsx)(pY,{keyName:e.key,hits:e.hits,misses:e.misses,writes:e.writes,deletes:e.deletes,hitRate:e.hitRate},e.key))})]}),(0,I.jsxs)(A,{children:[(0,I.jsx)(N,{colorPalette:`red`,variant:`outline`,size:`sm`,onClick:e.openConfirm,loading:e.isResetting,children:`Reset All Cache`}),e.resetSuccess&&(0,I.jsx)(k,{fontSize:`sm`,color:`green.500`,marginTop:`8px`,children:`Cache has been cleared successfully`}),e.resetError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,marginTop:`8px`,children:e.resetError})]})]}):(0,I.jsx)(A,{padding:`8px`,paddingTop:`16px`,children:(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,children:[(0,I.jsx)(k,{fontSize:`md`,fontWeight:`500`,color:`gray.500`,children:`Caching is disabled`}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.400`,marginTop:`4px`,children:`Set CACHE_ENABLED=1 to enable caching.`})]})}),(0,I.jsx)(Ue,{open:e.showConfirm,onOpenChange:({open:t})=>!t&&e.closeConfirm(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Reset All Cache`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsx)(k,{children:`Are you sure you want to clear the entire cache?`}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This will flush all cached data including rows, revisions, auth, and billing caches. The cache will be rebuilt automatically as data is accessed.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`red`,onClick:e.confirmReset,children:`Reset Cache`})]}),(0,I.jsx)(Ie,{})]})})]})})]})}),hY=class{usersRequest=X.of(Q.AdminDashboardStats);constructor(){f(this,{},{autoBind:!0})}get isLoadingUsers(){return this.usersRequest.isLoading}get isLoadingProjects(){return!1}get usersCount(){return this.usersRequest.data?.searchUsers.totalCount??null}get projectsCount(){return null}init(){this.usersRequest.fetch({first:1})}dispose(){this.usersRequest.abort()}};Y.register(hY,()=>new hY,{scope:`request`});var gY=({label:e,value:t,isLoading:n})=>(0,I.jsxs)(A,{padding:`24px`,borderRadius:`8px`,border:`1px solid`,borderColor:`gray.200`,backgroundColor:`white`,minWidth:`200px`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,marginBottom:`8px`,children:e}),n?(0,I.jsx)(Ht,{size:`sm`,color:`gray.400`}):(0,I.jsx)(k,{fontSize:`2xl`,fontWeight:`600`,color:`gray.900`,children:t??`-`})]}),_Y=g(()=>{let e=CB(hY);return(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsx)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsx)(Gt,{fontSize:`16px`,children:(0,I.jsx)(Dt,{children:(0,I.jsx)(Xt,{color:`gray`,children:`Admin`})})})})})}),(0,I.jsx)(A,{padding:`8px`,paddingTop:`16px`,children:(0,I.jsxs)(j,{gap:`16px`,flexWrap:`wrap`,children:[(0,I.jsx)(gY,{label:`Total Users`,value:e.usersCount,isLoading:e.isLoadingUsers}),(0,I.jsx)(gY,{label:`Total Projects`,value:e.projectsCount,isLoading:e.isLoadingProjects})]})})]})}),vY=class{constructor(e){this.data=e,f(this)}get id(){return this.data.id}get name(){return this.data.name}get prefix(){return this.data.prefix}get type(){return this.data.type}get isExpired(){return this.data.expiresAt?new Date(this.data.expiresAt)<new Date:!1}get isRevoked(){return this.data.revokedAt!==null}get isActive(){return!this.isExpired&&!this.isRevoked}get statusLabel(){return this.isRevoked?`Revoked`:this.isExpired?`Expired`:`Active`}get lastUsedAt(){return this.data.lastUsedAt??null}get createdAt(){return this.data.createdAt}get expiresAt(){return this.data.expiresAt??null}get readOnly(){return this.data.readOnly}get organizationId(){return this.data.organizationId??null}get projectIds(){return this.data.projectIds}get resolvedProjects(){return this.data.projects}get permissionLabel(){if(this.data.type===`PERSONAL`)return this.data.readOnly?`Read only`:`Full access`;let e=this.data.permissions?.rules?.[0]?.action??[];return e.includes(`delete`)?`Full access`:e.includes(`create`)||e.includes(`update`)?`Read & Write`:`Read only`}get permissionColorPalette(){switch(this.permissionLabel){case`Full access`:return`orange`;case`Read & Write`:return`blue`;default:return`gray`}}},yY={Active:{colorPalette:`green`},Expired:{colorPalette:`yellow`},Revoked:{colorPalette:`gray`}},bY=({status:e})=>{let t=yY[e];return(0,I.jsx)(It,{variant:`subtle`,colorPalette:t.colorPalette,size:`sm`,children:e})};function xY(e){if(e==null)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:HV(t,{addSuffix:!0})}var SY=({name:e,prefix:t,status:n,permissionLabel:r,permissionColor:i,projects:a,lastUsedAt:o,createdAt:s,expiresAt:c,actions:l})=>(0,I.jsx)(A,{width:`100%`,p:4,borderWidth:`1px`,borderColor:`gray.200`,borderRadius:`lg`,bg:`white`,transition:`all 0.2s`,_hover:{borderColor:`gray.300`},children:(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:1,flex:1,minWidth:0,children:[(0,I.jsxs)(P,{gap:2,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`600`,color:`gray.700`,truncate:!0,children:e}),n!==`Active`&&(0,I.jsx)(bY,{status:n}),(0,I.jsx)(It,{variant:`outline`,colorPalette:i,size:`sm`,children:r})]}),(0,I.jsxs)(P,{gap:2,children:[(0,I.jsx)(k,{fontSize:`xs`,fontFamily:`mono`,color:`gray.400`,children:t}),a.length>0&&(0,I.jsx)(P,{gap:1,children:a.map(e=>(0,I.jsx)(It,{variant:`outline`,colorPalette:`gray`,size:`sm`,children:e.name},e.id))}),a.length===0&&(0,I.jsx)(It,{variant:`outline`,colorPalette:`gray`,size:`sm`,children:`All projects`})]}),(0,I.jsxs)(P,{gap:4,mt:1,flexWrap:`wrap`,children:[(0,I.jsxs)(k,{fontSize:`xs`,color:`gray.500`,children:[`Created `,UV(s)]}),c&&(0,I.jsxs)(k,{fontSize:`xs`,color:`gray.500`,children:[`Expires `,UV(c)]}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:o?`Last used ${xY(o)}`:`Never used`})]})]}),l&&(0,I.jsx)(P,{gap:1,children:l})]})}),CY=[{value:`30d`,label:`30 days`},{value:`60d`,label:`60 days`},{value:`90d`,label:`90 days`},{value:`1y`,label:`1 year`},{value:`none`,label:`No expiration`}],wY=[{value:`read-only`,label:`Read only`,description:`Can only read data`},{value:`read-write`,label:`Read & Write`,description:`Can read, create, and update data`},{value:`full-access`,label:`Full access`,description:`Can read, create, update, and delete data`}],TY=g(({model:e})=>(0,I.jsx)(Ue,{open:e.isCreateDialogOpen,onOpenChange:({open:t})=>!t&&e.closeCreateDialog(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:e.mode===`personal`?`Create Personal API Key`:`Create Service API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Name`}),(0,I.jsx)(qt,{placeholder:`e.g., CI/CD pipeline, Data sync...`,value:e.createKeyName,onChange:t=>e.setCreateKeyName(t.target.value),autoFocus:!0})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Expiration`}),(0,I.jsx)(P,{gap:2,flexWrap:`wrap`,children:CY.map(t=>(0,I.jsx)(N,{size:`sm`,variant:e.createKeyExpirationPreset===t.value?`solid`:`outline`,onClick:()=>e.setExpirationPreset(t.value),children:t.label},t.value))})]}),e.mode===`personal`&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(P,{gap:2,children:(0,I.jsxs)(A,{as:`button`,onClick:()=>e.setCreateKeyReadOnly(!e.createKeyReadOnly),display:`flex`,alignItems:`center`,gap:2,cursor:`pointer`,children:[(0,I.jsx)(A,{width:`18px`,height:`18px`,borderWidth:`1px`,borderColor:e.createKeyReadOnly?`blue.500`:`gray.300`,borderRadius:`sm`,bg:e.createKeyReadOnly?`blue.500`:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s`,children:e.createKeyReadOnly&&(0,I.jsx)(k,{color:`white`,fontSize:`xs`,fontWeight:`bold`,lineHeight:1,children:`✓`})}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.700`,children:`Read only`})]})}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,pl:`26px`,children:`Key can only read data, not modify it`})]}),e.mode===`service`&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Permissions`}),(0,I.jsx)(M,{align:`stretch`,gap:2,children:wY.map(t=>(0,I.jsxs)(A,{as:`button`,onClick:()=>e.setPermissionPreset(t.value),width:`100%`,p:3,borderWidth:`1px`,borderColor:e.createKeyPermissionPreset===t.value?`blue.400`:`gray.200`,borderRadius:`md`,bg:e.createKeyPermissionPreset===t.value?`blue.50`:`white`,cursor:`pointer`,textAlign:`left`,transition:`all 0.2s`,_hover:{borderColor:`blue.300`},children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.700`,children:t.label}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,children:t.description})]},t.value))})]}),e.defaultProjectId&&(0,I.jsx)(j,{align:`center`,gap:2,p:3,bg:`blue.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`blue.200`,children:(0,I.jsxs)(k,{fontSize:`sm`,color:`blue.700`,children:[`This key will be scoped to project `,(0,I.jsx)(`strong`,{children:e.defaultProjectId})]})})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{onClick:e.createKey,disabled:!e.canCreateKey,loading:e.isMutating,children:`Create key`})]}),(0,I.jsx)(Ie,{})]})})]})})),EY=g(({isOpen:e,keyName:t,isLoading:n,onConfirm:r,onClose:i})=>(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&i(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Revoke API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(k,{children:[`Are you sure you want to revoke the key `,(0,I.jsx)(`strong`,{children:t}),`?`]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This action cannot be undone. Any applications using this key will immediately lose access.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`red`,onClick:r,loading:n,children:`Revoke key`})]}),(0,I.jsx)(Ie,{})]})})]})})),DY=g(({isOpen:e,keyName:t,isLoading:n,onConfirm:r,onClose:i})=>(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&i(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Rotate API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(k,{children:[`Are you sure you want to rotate the key `,(0,I.jsx)(`strong`,{children:t}),`?`]}),(0,I.jsx)(k,{fontSize:`sm`,color:`gray.600`,children:`This will generate a new secret and invalidate the current one. Any applications using the current key will need to be updated.`})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(oe,{asChild:!0,children:(0,I.jsx)(N,{variant:`outline`,children:`Cancel`})}),(0,I.jsx)(N,{colorPalette:`orange`,onClick:r,loading:n,children:`Rotate key`})]}),(0,I.jsx)(Ie,{})]})})]})})),OY=g(({isOpen:e,secret:t,keyName:n,onClose:r})=>{let i=(0,L.useCallback)(async()=>{t&&(await navigator.clipboard.writeText(t),Jq.info({description:`Copied to clipboard`}))},[t]);return(0,I.jsx)(Ue,{open:e,onOpenChange:({open:e})=>!e&&r(),size:`md`,closeOnInteractOutside:!1,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Your API Key`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[n&&(0,I.jsxs)(k,{fontSize:`sm`,color:`gray.600`,children:[`Key `,(0,I.jsx)(`strong`,{children:n}),` has been created successfully.`]}),(0,I.jsx)(A,{children:(0,I.jsxs)(j,{gap:2,children:[(0,I.jsx)(qt,{value:t??``,readOnly:!0,fontFamily:`mono`,fontSize:`sm`,bg:`gray.50`}),(0,I.jsxs)(N,{variant:`outline`,onClick:i,flexShrink:0,children:[(0,I.jsx)(qf,{}),`Copy`]})]})}),(0,I.jsxs)(j,{align:`center`,gap:2,p:3,bg:`yellow.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`yellow.200`,children:[(0,I.jsx)(one,{color:`var(--chakra-colors-yellow-600)`}),(0,I.jsx)(k,{fontSize:`sm`,color:`yellow.800`,children:`Make sure to copy your API key now. You won't be able to see it again.`})]})]})}),(0,I.jsx)(w,{children:(0,I.jsx)(N,{onClick:r,children:`I've copied the key`})})]})})]})})}),kY=g(({model:e,showCreateButton:t=!0})=>((0,L.useEffect)(()=>(e.loadKeys().catch(e.handleLoadKeysError),()=>e.reset()),[e]),e.isLoaded?e.error?(0,I.jsx)(A,{p:4,bg:`red.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`red.200`,children:(0,I.jsx)(k,{fontSize:`sm`,color:`red.600`,children:e.error})}):(0,I.jsxs)(M,{align:`stretch`,gap:3,children:[t&&!e.isEmpty&&(0,I.jsxs)(j,{justify:`space-between`,align:`center`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`${e.sortedItems.length} key${e.sortedItems.length===1?``:`s`}`}),(0,I.jsxs)(N,{size:`sm`,onClick:e.openCreateDialog,children:[(0,I.jsx)(Pf,{}),`Create key`]})]}),e.isEmpty&&e.isLoaded&&(0,I.jsxs)(A,{p:6,textAlign:`center`,borderWidth:`1px`,borderColor:`gray.200`,borderRadius:`lg`,bg:`gray.50`,children:[(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:e.emptyStateMessage}),t&&(0,I.jsxs)(N,{size:`sm`,mt:3,onClick:e.openCreateDialog,children:[(0,I.jsx)(Pf,{}),`Create your first key`]})]}),e.sortedItems.map(t=>(0,I.jsx)(SY,{name:t.name,prefix:t.prefix,status:t.statusLabel,permissionLabel:t.permissionLabel,permissionColor:t.permissionColorPalette,projects:t.resolvedProjects,lastUsedAt:t.lastUsedAt,createdAt:t.createdAt,expiresAt:t.expiresAt,actions:t.isActive?(0,I.jsxs)(P,{gap:1,children:[(0,I.jsx)(N,{size:`xs`,variant:`ghost`,color:`gray.500`,_hover:{color:`orange.600`,bg:`orange.50`},onClick:()=>e.openRotateDialog(t.id),children:(0,I.jsx)(Ate,{})}),(0,I.jsx)(N,{size:`xs`,variant:`ghost`,color:`gray.500`,_hover:{color:`red.600`,bg:`red.50`},onClick:()=>e.openRevokeDialog(t.id),children:(0,I.jsx)(Rf,{})})]}):void 0},t.id)),(0,I.jsx)(TY,{model:e}),(0,I.jsx)(OY,{isOpen:e.isSecretDialogOpen,secret:e.lastSecret,keyName:e.lastCreatedKeyName,onClose:e.closeSecretDialog}),(0,I.jsx)(EY,{isOpen:e.isRevokeDialogOpen,keyName:e.selectedKey?.name,isLoading:e.isMutating,onConfirm:e.revokeKey,onClose:e.closeRevokeDialog}),(0,I.jsx)(DY,{isOpen:e.isRotateDialogOpen,keyName:e.selectedKey?.name,isLoading:e.isMutating,onConfirm:e.rotateKey,onClose:e.closeRotateDialog})]}):(0,I.jsx)(j,{justify:`center`,py:8,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}))),AY=class{myKeysRequest=X.of(Q.myApiKeys,{skipResetting:!0});serviceKeysRequest=X.of(Q.serviceApiKeys,{skipResetting:!0});createPersonalRequest=X.of(Q.createPersonalApiKey);createServiceRequest=X.of(Q.createServiceApiKey);revokeRequest=X.of(Q.revokeApiKey);rotateRequest=X.of(Q.rotateApiKey);constructor(){f(this)}get isLoading(){return this.myKeysRequest.isLoading||this.serviceKeysRequest.isLoading}get error(){return this.myKeysRequest.errorMessage??this.serviceKeysRequest.errorMessage??null}get isMutating(){return this.createPersonalRequest.isLoading||this.createServiceRequest.isLoading||this.revokeRequest.isLoading||this.rotateRequest.isLoading}fetchPersonalKeys(){return this.myKeysRequest.fetch()}fetchServiceKeys(e){return this.serviceKeysRequest.fetch({organizationId:e})}async createPersonalKey(e){let t=await this.createPersonalRequest.fetch({data:e});return t.isRight?t.data.createPersonalApiKey:null}async createServiceKey(e){let t=await this.createServiceRequest.fetch({data:e});return t.isRight?t.data.createServiceApiKey:null}async revokeKey(e){let t=await this.revokeRequest.fetch({id:e});return t.isRight?t.data.revokeApiKey:null}async rotateKey(e){let t=await this.rotateRequest.fetch({id:e});return t.isRight?t.data.rotateApiKey:null}dispose(){this.myKeysRequest.abort(),this.serviceKeysRequest.abort(),this.createPersonalRequest.abort(),this.createServiceRequest.abort(),this.revokeRequest.abort(),this.rotateRequest.abort()}};Y.register(AY,()=>new AY,{scope:`request`});var jY={"read-only":[{action:[`read`],subject:[`all`]}],"read-write":[{action:[`read`,`create`,`update`],subject:[`all`]}],"full-access":[{action:[`read`,`create`,`update`,`delete`],subject:[`all`]}]},MY=class{_config={mode:`personal`};_items=[];_isLoaded=!1;_loadError=null;_isCreateDialogOpen=!1;_isSecretDialogOpen=!1;_isRevokeDialogOpen=!1;_isRotateDialogOpen=!1;_selectedKeyId=null;_lastSecret=null;_lastCreatedKeyName=null;createKeyName=``;createKeyReadOnly=!1;createKeyExpiresAt=null;createKeyExpirationPreset=`none`;createKeyPermissionPreset=`read-only`;constructor(e){this.dataSource=e,f(this,{},{autoBind:!0})}get mode(){return this._config.mode}get organizationId(){return this._config.organizationId}get defaultProjectId(){return this._config.defaultProjectId}get filterByProjectId(){return this._config.filterByProjectId}get items(){return this._items}get filteredItems(){if(!this._config.filterByProjectId)return this._items;let e=this._config.filterByProjectId;return this._items.filter(t=>t.projectIds.includes(e))}get sortedItems(){return[...this.filteredItems].sort((e,t)=>{let n={Active:0,Expired:1,Revoked:2},r=n[e.statusLabel]-n[t.statusLabel];return r===0?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():r})}get isLoading(){return this.dataSource.isLoading}get isLoaded(){return this._isLoaded}get isMutating(){return this.dataSource.isMutating}get error(){return this._loadError??this.dataSource.error}get isEmpty(){return this.filteredItems.length===0}get isCreateDialogOpen(){return this._isCreateDialogOpen}get isSecretDialogOpen(){return this._isSecretDialogOpen}get isRevokeDialogOpen(){return this._isRevokeDialogOpen}get isRotateDialogOpen(){return this._isRotateDialogOpen}get selectedKeyId(){return this._selectedKeyId}get lastSecret(){return this._lastSecret}get lastCreatedKeyName(){return this._lastCreatedKeyName}get selectedKey(){return this._items.find(e=>e.id===this._selectedKeyId)}get canCreateKey(){return this.createKeyName.trim().length>0&&!this.isMutating}get emptyStateMessage(){return this._config.mode===`personal`?`No API keys yet. Create one for programmatic access to your data.`:`No integration keys for this organization.`}configure(e){this._config=e}init(){}dispose(){this.dataSource.dispose()}reset(){this._items=[],this._isLoaded=!1,this._loadError=null}async loadKeys(){if(c(()=>{this._loadError=null}),this._config.mode===`personal`){let e=await this.dataSource.fetchPersonalKeys();if(!e.isRight){if(qV(e))return;c(()=>{this._isLoaded=!0});return}c(()=>{this._items=e.data.myApiKeys.filter(e=>e.type!==`INTERNAL`).map(e=>new vY(e)),this._isLoaded=!0})}else if(this._config.organizationId){let e=await this.dataSource.fetchServiceKeys(this._config.organizationId);if(!e.isRight){if(qV(e))return;c(()=>{this._isLoaded=!0});return}c(()=>{this._items=e.data.serviceApiKeys.filter(e=>e.type!==`INTERNAL`).map(e=>new vY(e)),this._isLoaded=!0})}}handleLoadKeysError(e){console.error(e),c(()=>{this._loadError=e instanceof Error?e.message:`Failed to load API keys`,this._isLoaded=!0})}openCreateDialog(){this._isCreateDialogOpen=!0,this.createKeyName=``,this.createKeyReadOnly=!1,this.createKeyExpiresAt=null,this.createKeyExpirationPreset=`none`,this.createKeyPermissionPreset=`read-only`}closeCreateDialog(){this._isCreateDialogOpen=!1}setCreateKeyName(e){this.createKeyName=e}setCreateKeyReadOnly(e){this.createKeyReadOnly=e}setExpirationPreset(e){this.createKeyExpirationPreset=e;let t=new Date;switch(e){case`30d`:t.setDate(t.getDate()+30),this.createKeyExpiresAt=t.toISOString();break;case`60d`:t.setDate(t.getDate()+60),this.createKeyExpiresAt=t.toISOString();break;case`90d`:t.setDate(t.getDate()+90),this.createKeyExpiresAt=t.toISOString();break;case`1y`:t.setFullYear(t.getFullYear()+1),this.createKeyExpiresAt=t.toISOString();break;case`none`:this.createKeyExpiresAt=null;break}}setPermissionPreset(e){this.createKeyPermissionPreset=e}async createKey(){if(this.canCreateKey){if(this._config.mode===`personal`){let e={name:this.createKeyName.trim(),readOnly:this.createKeyReadOnly,expiresAt:this.createKeyExpiresAt??void 0,projectIds:this._config.defaultProjectId?[this._config.defaultProjectId]:void 0},t=await this.dataSource.createPersonalKey(e);t&&(c(()=>{this._lastSecret=t.secret,this._lastCreatedKeyName=t.apiKey.name,this._isCreateDialogOpen=!1,this._isSecretDialogOpen=!0}),await this.loadKeys())}else if(this._config.organizationId){let e={name:this.createKeyName.trim(),organizationId:this._config.organizationId,readOnly:this.createKeyReadOnly,expiresAt:this.createKeyExpiresAt??void 0,projectIds:this._config.defaultProjectId?[this._config.defaultProjectId]:void 0,permissions:{rules:jY[this.createKeyPermissionPreset]}},t=await this.dataSource.createServiceKey(e);t&&(c(()=>{this._lastSecret=t.secret,this._lastCreatedKeyName=t.apiKey.name,this._isCreateDialogOpen=!1,this._isSecretDialogOpen=!0}),await this.loadKeys())}}}closeSecretDialog(){this._isSecretDialogOpen=!1,this._lastSecret=null,this._lastCreatedKeyName=null}openRevokeDialog(e){this._selectedKeyId=e,this._isRevokeDialogOpen=!0}closeRevokeDialog(){this._isRevokeDialogOpen=!1,this._selectedKeyId=null}async revokeKey(){this._selectedKeyId&&await this.dataSource.revokeKey(this._selectedKeyId)&&(c(()=>{this._isRevokeDialogOpen=!1,this._selectedKeyId=null}),await this.loadKeys())}openRotateDialog(e){this._selectedKeyId=e,this._isRotateDialogOpen=!0}closeRotateDialog(){this._isRotateDialogOpen=!1,this._selectedKeyId=null}async rotateKey(){if(!this._selectedKeyId)return;let e=await this.dataSource.rotateKey(this._selectedKeyId);e&&(c(()=>{this._lastSecret=e.secret,this._lastCreatedKeyName=e.apiKey.name,this._isRotateDialogOpen=!1,this._selectedKeyId=null,this._isSecretDialogOpen=!0}),await this.loadKeys())}};Y.register(MY,()=>new MY(Y.get(AY)),{scope:`request`});var NY=g(({model:e})=>{let t=(0,L.useCallback)(async()=>{await e.savePassword()&&Jq.success({description:`Password updated successfully`})},[e]);return(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Account Settings`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(rn,{value:e.activeTab,onValueChange:({value:t})=>e.setActiveTab(t),lazyMount:!0,unmountOnExit:!0,children:[(0,I.jsxs)(et,{marginBottom:`1rem`,children:[(0,I.jsxs)(fn,{value:`account`,children:[(0,I.jsx)(zf,{}),`Account`]}),(0,I.jsxs)(fn,{value:`password`,children:[(0,I.jsx)(Of,{}),`Password`]}),(0,I.jsxs)(fn,{value:`api-keys`,children:[(0,I.jsx)(Df,{}),`Personal Tokens`]})]}),(0,I.jsx)(bt,{value:`account`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[e.username&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username`}),(0,I.jsx)(qt,{value:e.username,readOnly:!0})]}),e.email&&(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email`}),(0,I.jsx)(qt,{value:e.email,readOnly:!0})]}),(0,I.jsx)(A,{paddingTop:`1rem`,borderTop:`1px solid`,borderTopColor:`newGray.100`,children:(0,I.jsxs)(N,{variant:`outline`,onClick:e.logout,width:`100%`,children:[(0,I.jsx)(tne,{}),`Sign out`]})})]})}),(0,I.jsx)(bt,{value:`password`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[e.hasPassword?(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Current Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter current password...`,value:e.oldPassword,onChange:t=>e.setOldPassword(t.target.value),autoComplete:`current-password`})]}):(0,I.jsx)(k,{fontSize:`sm`,color:`gray.500`,children:`You signed in with a social account. Set a password to enable password login.`}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:e.hasPassword?`New Password`:`Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter new password (min 8 characters)...`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Confirm Password`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Confirm new password...`,value:e.confirmPassword,onChange:t=>e.setConfirmPassword(t.target.value),autoComplete:`new-password`})]}),e.passwordError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,children:e.passwordError}),e.error&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,children:e.error}),(0,I.jsx)(j,{justifyContent:`flex-end`,children:(0,I.jsx)(N,{onClick:t,disabled:!e.canSavePassword,loading:e.isLoading,children:e.hasPassword?`Update Password`:`Set Password`})})]})}),(0,I.jsx)(bt,{value:`api-keys`,children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(A,{children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.700`,children:`Personal Access Keys`}),(0,I.jsx)(k,{fontSize:`xs`,color:`gray.500`,mt:1,children:`Personal keys act on your behalf and inherit your permissions. Use them for scripts, CLI tools, or any programmatic access to your data.`})]}),(0,I.jsx)(kY,{model:e.apiKeyManager})]})})]})}),(0,I.jsx)(Ie,{})]})})]})})}),PY=class{updatePasswordRequest=X.of(Q.updatePassword);constructor(){f(this)}get isLoading(){return this.updatePasswordRequest.isLoading}get error(){return this.updatePasswordRequest.errorMessage??null}async updatePassword(e){return(await this.updatePasswordRequest.fetch({data:{oldPassword:e.oldPassword,newPassword:e.newPassword}})).isRight}dispose(){this.updatePasswordRequest.abort()}};Y.register(PY,()=>new PY,{scope:`request`});var FY=class{_isOpen=!1;_activeTab=`account`;apiKeyManager;oldPassword=``;newPassword=``;confirmPassword=``;constructor(e,t,n){this.dataSource=e,this.authService=t,f(this,{},{autoBind:!0}),this.apiKeyManager=n,this.apiKeyManager.configure({mode:`personal`})}get isOpen(){return this._isOpen}get activeTab(){return this._activeTab}get isLoading(){return this.dataSource.isLoading}get error(){return this.dataSource.error}get username(){return this.authService.user?.username}get email(){return this.authService.user?.email}get hasPassword(){return this.authService.user?.hasPassword??!0}get canSavePassword(){return!(this.isLoading||this.newPassword.length<8||this.newPassword!==this.confirmPassword||this.hasPassword&&!this.oldPassword)}get passwordError(){return this.newPassword&&this.newPassword.length<8?`Password must be at least 8 characters`:this.confirmPassword&&this.newPassword!==this.confirmPassword?`Passwords do not match`:null}open(){this._isOpen=!0,this._activeTab=`account`,this.resetPasswordForm()}close(){this._isOpen=!1,this.resetPasswordForm()}setActiveTab(e){this._activeTab=e}setOldPassword(e){this.oldPassword=e}setNewPassword(e){this.newPassword=e}setConfirmPassword(e){this.confirmPassword=e}async savePassword(){if(!this.canSavePassword)return!1;let e=await this.dataSource.updatePassword({oldPassword:this.oldPassword,newPassword:this.newPassword});return e&&(this.resetPasswordForm(),await this.authService.fetchMe()),e}logout(){this.close(),globalThis.location.href=`/${bJ}`}resetPasswordForm(){this.oldPassword=``,this.newPassword=``,this.confirmPassword=``}init(){}dispose(){this.dataSource.dispose(),this.apiKeyManager.dispose()}};Y.register(FY,()=>new FY(Y.get(PY),Y.get(hJ),Y.get(MY)),{scope:`singleton`});var IY=g(()=>{let e=CB(FY);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:`newGray.600`,fontWeight:`400`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,onClick:e.open,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:(0,I.jsx)(zf,{})}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:`Account Settings`})]}),(0,I.jsx)(NY,{model:e})]})}),LY=({onBack:e})=>(0,I.jsx)(j,{className:`group`,flexDirection:`column`,alignItems:`flex-start`,width:`100%`,minWidth:`0`,children:(0,I.jsxs)(j,{alignItems:`center`,gap:`8px`,padding:`4px`,width:`100%`,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,cursor:`pointer`,_hover:{color:`newGray.500`},onClick:e,display:`flex`,alignItems:`center`,flexShrink:0,children:(0,I.jsx)(pf,{})}),(0,I.jsx)(A,{color:`black`,fontWeight:`600`,fontSize:`18px`,lineHeight:`26px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:`Admin`}),(0,I.jsx)(T,{}),(0,I.jsx)(oJ,{})]})}),RY=({to:e,label:t,isActive:n,icon:r})=>(0,I.jsx)(An,{to:e,style:{textDecoration:`none`,width:`100%`},children:(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:n?`newGray.100`:`transparent`,_hover:{backgroundColor:`newGray.100`},borderRadius:`8px`,height:`36px`,paddingX:`8px`,width:`100%`,color:n?`black`:`newGray.600`,fontWeight:`400`,textDecoration:`none`,fontSize:`14px`,minWidth:`0`,cursor:`pointer`,gap:`12px`,userSelect:`none`,children:[(0,I.jsx)(A,{fontSize:`20px`,color:`newGray.400`,children:r}),(0,I.jsx)(A,{flex:`1`,minWidth:`0`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:t})]})}),zY=g(()=>{let e=kn(),t=Tn(),n=e.pathname,r=n===`/${QJ}`,i=n.startsWith(`/${QJ}/${$J}`),a=n.startsWith(`/${QJ}/${tY}`),o=n.startsWith(`/${QJ}/${nY}`);return(0,I.jsxs)(M,{alignItems:`flex-start`,gap:0,width:`100%`,flex:1,children:[(0,I.jsx)(LY,{onBack:(0,L.useCallback)(()=>{t(`/`)},[t])}),(0,I.jsx)(A,{width:`100%`,paddingY:`16px`,children:(0,I.jsx)(O,{borderColor:`newGray.100`})}),(0,I.jsxs)(j,{flexDirection:`column`,width:`100%`,gap:1,children:[(0,I.jsx)(RY,{to:`/${QJ}`,label:`Dashboard`,icon:(0,I.jsx)(Xte,{}),isActive:r}),(0,I.jsx)(RY,{to:`/${QJ}/${$J}`,label:`Users`,icon:(0,I.jsx)(Bf,{}),isActive:i}),(0,I.jsx)(RY,{to:`/${QJ}/${tY}`,label:`Organizations`,icon:(0,I.jsx)(Pte,{}),isActive:a}),(0,I.jsx)(RY,{to:`/${QJ}/${nY}`,label:`Cache`,icon:(0,I.jsx)(yf,{}),isActive:o})]}),(0,I.jsx)(T,{}),(0,I.jsx)(j,{flexDirection:`column`,width:`100%`,gap:1,children:(0,I.jsx)(IY,{})})]})}),BY=()=>(0,I.jsx)(Vq,{sidebar:(0,I.jsx)(zY,{}),children:(0,I.jsx)(En,{})}),VY=({breadcrumbs:e,headerRight:t,children:n})=>(0,I.jsxs)(j,{flexDirection:`column`,height:`100%`,children:[(0,I.jsxs)(j,{alignItems:`center`,backgroundColor:`white`,justifyContent:`space-between`,width:`100%`,position:`sticky`,zIndex:1,top:0,padding:`8px`,children:[(0,I.jsx)(j,{alignItems:`center`,gap:`4px`,height:`40px`,children:(0,I.jsx)($t,{color:`gray`,fontWeight:`600`,fontSize:`16px`,children:(0,I.jsxs)(Gt,{fontSize:`16px`,children:[(0,I.jsx)(Dt,{children:(0,I.jsx)(it,{asChild:!0,color:`gray`,children:(0,I.jsx)(An,{to:`/${QJ}`,children:`Admin`})})}),e.map((e,t)=>(0,I.jsxs)(L.Fragment,{children:[(0,I.jsx)(ut,{children:`/`}),(0,I.jsx)(Dt,{children:e.to?(0,I.jsx)(it,{asChild:!0,color:`gray`,children:(0,I.jsx)(An,{to:e.to,children:e.label})}):(0,I.jsx)(Xt,{color:`gray`,children:e.label})})]},t))]})})}),t]}),(0,I.jsx)(A,{flex:1,children:n})]}),HY=()=>(0,I.jsx)(VY,{breadcrumbs:[{label:`Organizations`}],children:(0,I.jsx)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:(0,I.jsx)(k,{fontSize:`md`,children:`Coming soon`})})}),UY=class{request=X.of(Q.adminGetUser);resetPasswordRequest=X.of(Q.adminResetPassword);_userId=null;_user=null;_newPassword=``;_resetPasswordSuccess=!1;constructor(){f(this,{},{autoBind:!0})}get isLoading(){return this.request.isLoading}get error(){return this.request.errorMessage??null}get user(){return this._user}get username(){return this._user?.username??null}get email(){return this._user?.email??null}get roleName(){return this._user?.role?.name??null}get newPassword(){return this._newPassword}get isResetPasswordLoading(){return this.resetPasswordRequest.isLoading}get resetPasswordError(){return this.resetPasswordRequest.errorMessage??null}get resetPasswordSuccess(){return this._resetPasswordSuccess}get canResetPassword(){return this._newPassword.length>=6}setUserId(e){this._userId=e,this.loadUser()}setNewPassword(e){this._newPassword=e,this._resetPasswordSuccess=!1}async resetPassword(){!this._userId||!this.canResetPassword||(await this.resetPasswordRequest.fetch({userId:this._userId,newPassword:this._newPassword})).isRight&&c(()=>{this._newPassword=``,this._resetPasswordSuccess=!0})}init(){this._userId&&this.loadUser()}dispose(){this.request.abort(),this.resetPasswordRequest.abort()}async loadUser(){if(!this._userId)return;let e=await this.request.fetch({userId:this._userId});e.isRight&&c(()=>{this._user=e.data.adminUser??null})}};Y.register(UY,()=>new UY,{scope:`request`});var WY=({label:e,value:t})=>(0,I.jsxs)(j,{gap:`16px`,alignItems:`baseline`,children:[(0,I.jsx)(k,{fontSize:`xs`,color:`newGray.400`,minWidth:`80px`,children:e}),(0,I.jsx)(k,{fontSize:`sm`,color:`newGray.600`,children:t||`-`})]}),GY=g(({model:e})=>(0,I.jsxs)(A,{padding:`16px`,borderWidth:`1px`,borderColor:`newGray.100`,borderRadius:`md`,marginTop:`16px`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`newGray.500`,marginBottom:`12px`,children:`Reset Password`}),(0,I.jsxs)(j,{gap:`12px`,alignItems:`flex-start`,children:[(0,I.jsx)(qt,{placeholder:`New password (min 6 characters)`,type:`password`,size:`sm`,value:e.newPassword,onChange:t=>e.setNewPassword(t.target.value),maxWidth:`300px`}),(0,I.jsx)(N,{size:`sm`,colorPalette:`gray`,onClick:e.resetPassword,disabled:!e.canResetPassword,loading:e.isResetPasswordLoading,children:`Reset`})]}),e.resetPasswordError&&(0,I.jsx)(k,{fontSize:`sm`,color:`red.500`,marginTop:`8px`,children:e.resetPasswordError}),e.resetPasswordSuccess&&(0,I.jsx)(k,{fontSize:`sm`,color:`green.500`,marginTop:`8px`,children:`Password has been reset successfully`})]})),KY=g(()=>{let{userId:e}=bn(),t=CB(UY);return(0,L.useEffect)(()=>{e&&t.setUserId(e)},[e,t]),(0,I.jsx)(VY,{breadcrumbs:(0,L.useMemo)(()=>[{label:`Users`,to:`/${QJ}/${$J}`},{label:t.username||e||``}],[t.username,e]),children:(0,I.jsxs)(A,{flex:1,padding:`8px`,children:[t.isLoading&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,paddingY:`48px`,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}),t.error&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:[(0,I.jsx)(k,{fontSize:`md`,children:`Could not load user`}),(0,I.jsx)(k,{fontSize:`sm`,children:t.error})]}),!t.isLoading&&!t.error&&!t.user&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,paddingY:`48px`,children:(0,I.jsx)(k,{fontSize:`md`,children:`User not found`})}),t.user&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(A,{padding:`16px`,borderWidth:`1px`,borderColor:`newGray.100`,borderRadius:`md`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`newGray.500`,marginBottom:`12px`,children:`User Info`}),(0,I.jsxs)(M,{alignItems:`flex-start`,gap:`8px`,children:[(0,I.jsx)(WY,{label:`ID`,value:t.user.id}),(0,I.jsx)(WY,{label:`Username`,value:t.username}),(0,I.jsx)(WY,{label:`Email`,value:t.email}),(0,I.jsx)(WY,{label:`Role`,value:t.roleName})]})]}),(0,I.jsx)(GY,{model:t})]})]})})}),qY=class{request=X.of(Q.createUser);constructor(){f(this)}get isLoading(){return this.request.isLoading}get error(){return this.request.errorMessage??null}async create(e){let t=await this.request.fetch({username:e.username,password:e.password,email:e.email,roleId:e.roleId});return t.isRight&&t.data.createUser}dispose(){this.request.abort()}};Y.register(qY,()=>new qY,{scope:`request`});var JY=class{_isOpen=!1;_username=``;_password=``;_email=``;_selectedRole=XW.SystemUser;constructor(e,t,n){this.dataSource=e,this.systemPermissions=t,this.onUserCreated=n,f(this,{},{autoBind:!0})}get isOpen(){return this._isOpen}get canCreateUser(){return this.systemPermissions.canCreateUser}get username(){return this._username}get password(){return this._password}get email(){return this._email}get selectedRole(){return this._selectedRole}get isCreating(){return this.dataSource.isLoading}get canSubmit(){return this._username.trim().length>0&&this._password.length>=6&&!this.isCreating}open(){this._isOpen=!0,this.reset()}close(){this._isOpen=!1,this.reset()}setUsername(e){this._username=e}setPassword(e){this._password=e}setEmail(e){this._email=e}setSelectedRole(e){this._selectedRole=e}async createUser(){if(!this.canSubmit)return;let e=await this.dataSource.create({username:this._username.trim(),password:this._password,email:this._email.trim()||void 0,roleId:this._selectedRole});c(()=>{e&&(this.onUserCreated(),this.close())})}dispose(){this.dataSource.dispose()}reset(){this._username=``,this._password=``,this._email=``,this._selectedRole=XW.SystemUser}},YY=class extends rH{currentFilters={};constructor(){super(Q.adminUsers,{pageSize:50})}extractItems(e){return e.adminUsers.edges.map(e=>e.node)}extractPageInfo(e){return{hasNextPage:e.adminUsers.pageInfo.hasNextPage,endCursor:e.adminUsers.pageInfo.endCursor||null,totalCount:e.adminUsers.totalCount}}buildFetchArgs(e,t){return e&&(this.currentFilters=e),{first:this.config.pageSize,after:t,search:this.currentFilters.search||void 0}}};Y.register(YY,()=>new YY,{scope:`request`});var XY=class{constructor(e){this.data=e,f(this)}get id(){return this.data.id}get username(){return this.data.username??null}get email(){return this.data.email??null}get roleName(){return this.data.role?.name??null}get link(){return Dn(`/${QJ}/${$J}/:userId`,{userId:this.data.id})}},ZY=class extends nH{createUserModal;_searchQuery=``;_debounceTimer=null;constructor(e,t,n){super(e),this.createUserModal=new JY(t,n,()=>this.reload()),h(this,{_searchQuery:u,searchQuery:a,canCreateUser:a,setSearchQuery:m,reload:m,init:_,dispose:_})}getItemKey(e){return e.id}createItemViewModel(e){return new XY(e)}get canCreateUser(){return this.createUserModal.canCreateUser}get searchQuery(){return this._searchQuery}init(){this.dataSource.load()}dispose(){this._debounceTimer&&clearTimeout(this._debounceTimer),super.dispose(),this.createUserModal.dispose()}reload(){this.dataSource.load({search:this._searchQuery||void 0})}setSearchQuery(e){this._searchQuery=e,this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.dataSource.load({search:e||void 0})},300)}};Y.register(ZY,()=>new ZY(Y.get(YY),Y.get(qY),Y.get(yW)),{scope:`request`});var QY={[XW.SystemAdmin]:`System Admin`,[XW.SystemFullApiRead]:`Full API Read`,[XW.SystemUser]:`User`},$Y=g(({value:e,onChange:t,disabled:n})=>(0,I.jsx)(Qe,{size:`sm`,width:`160px`,...n&&{opacity:.5,pointerEvents:`none`},children:(0,I.jsx)(Xe,{value:e,onChange:e=>t(e.target.value),children:Object.values(XW).map(e=>(0,I.jsx)(`option`,{value:e,children:QY[e]},e))})})),eX=g(({model:e})=>(0,I.jsx)(Ue,{open:e.isOpen,onOpenChange:({open:t})=>!t&&e.close(),size:`md`,children:(0,I.jsxs)(R,{children:[(0,I.jsx)(pe,{}),(0,I.jsx)(ue,{children:(0,I.jsxs)(_n,{children:[(0,I.jsx)(Ge,{children:(0,I.jsx)(qe,{children:`Create User`})}),(0,I.jsx)(be,{children:(0,I.jsxs)(M,{align:`stretch`,gap:`1rem`,children:[(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Username *`}),(0,I.jsx)(qt,{placeholder:`Enter username...`,value:e.username,onChange:t=>e.setUsername(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Password *`}),(0,I.jsx)(qt,{type:`password`,placeholder:`Enter password (min 6 characters)...`,value:e.password,onChange:t=>e.setPassword(t.target.value),autoComplete:`new-password`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`Email (optional)`}),(0,I.jsx)(qt,{type:`email`,placeholder:`Enter email...`,value:e.email,onChange:t=>e.setEmail(t.target.value),autoComplete:`off`})]}),(0,I.jsxs)(j,{flexDirection:`column`,gap:`0.5rem`,children:[(0,I.jsx)(k,{fontSize:`sm`,fontWeight:`500`,color:`gray.600`,children:`System Role`}),(0,I.jsx)($Y,{value:e.selectedRole,onChange:t=>e.setSelectedRole(t)})]})]})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(N,{variant:`outline`,onClick:e.close,children:`Cancel`}),(0,I.jsx)(N,{onClick:e.createUser,disabled:!e.canSubmit,loading:e.isCreating,children:`Create`})]}),(0,I.jsx)(Ie,{})]})})]})})),tX=g(({model:e})=>(0,I.jsx)(A,{height:`2.5rem`,width:`100%`,children:(0,I.jsx)(An,{to:e.link,style:{textDecoration:`none`,width:`100%`},children:(0,I.jsxs)(j,{_hover:{backgroundColor:`gray.50`},alignItems:`center`,gap:`4px`,paddingLeft:`1rem`,height:`100%`,children:[(0,I.jsx)(j,{width:`200px`,children:(0,I.jsx)(k,{maxWidth:`190px`,textDecoration:`underline`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,children:e.username||e.email||`No username`})}),(0,I.jsx)(j,{alignItems:`center`,flex:1,minHeight:`40px`,children:(0,I.jsx)(k,{color:`gray.400`,fontWeight:`300`,ml:`16px`,children:e.roleName||`-`})})]})})})),nX=g(()=>{let e=CB(ZY);return(0,I.jsxs)(VY,{breadcrumbs:[{label:`Users`}],headerRight:(0,I.jsx)(j,{alignItems:`center`,gap:`8px`,children:(0,I.jsx)(qt,{placeholder:`Search...`,value:e.searchQuery,onChange:t=>e.setSearchQuery(t.target.value),variant:`flushed`,size:`sm`,width:`200px`,_placeholder:{color:`gray.400`}})}),children:[(0,I.jsxs)(A,{flex:1,paddingX:`16px`,paddingTop:`16px`,children:[e.canCreateUser&&(0,I.jsx)(j,{paddingBottom:`16px`,children:(0,I.jsxs)(N,{variant:`ghost`,size:`sm`,color:`gray`,onClick:()=>e.createUserModal.open(),children:[(0,I.jsx)(Pf,{}),`Add`]})}),e.showLoading&&(0,I.jsx)(M,{flex:1,justifyContent:`center`,children:(0,I.jsx)(Ht,{size:`md`,color:`gray.400`})}),e.showError&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,children:[(0,I.jsx)(k,{fontSize:`md`,children:`Could not load users`}),(0,I.jsx)(k,{fontSize:`sm`,children:`Please retry later`})]}),e.showEmpty&&(0,I.jsxs)(M,{flex:1,justifyContent:`center`,gap:`8px`,color:`gray.400`,children:[(0,I.jsx)(Bf,{size:48}),(0,I.jsx)(k,{fontSize:`md`,children:`No users found`})]}),e.showList&&(0,I.jsx)(QM,{useWindowScroll:!0,totalCount:e.items.length,defaultItemHeight:40,endReached:e.hasNextPage?e.tryToFetchNextPage:void 0,itemContent:t=>{let n=e.items[t];return n?(0,I.jsx)(tX,{model:n},n.id):null}})]}),(0,I.jsx)(eX,{model:e.createUserModal})]})}),rX=i((e=>{e.removeLeadingAndTrailingHTTPWhitespace=e=>e.replace(/^[ \t\n\r]+/u,``).replace(/[ \t\n\r]+$/u,``),e.removeTrailingHTTPWhitespace=e=>e.replace(/[ \t\n\r]+$/u,``),e.isHTTPWhitespaceChar=e=>e===` `||e===` `||e===`
|
|
2167
2167
|
`||e===`\r`,e.solelyContainsHTTPTokenCodePoints=e=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(e),e.soleyContainsHTTPQuotedStringTokenCodePoints=e=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(e),e.asciiLowercase=e=>e.replace(/[A-Z]/gu,e=>e.toLowerCase()),e.collectAnHTTPQuotedString=(e,t)=>{let n=``;for(t++;;){for(;t<e.length&&e[t]!==`"`&&e[t]!==`\\`;)n+=e[t],++t;if(t>=e.length)break;let r=e[t];if(++t,r===`\\`){if(t>=e.length){n+=`\\`;break}n+=e[t],++t}else break}return[n,t]}})),iX=i(((e,t)=>{var{asciiLowercase:n,solelyContainsHTTPTokenCodePoints:r,soleyContainsHTTPQuotedStringTokenCodePoints:i}=rX();t.exports=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=n(String(e)),this._map.get(e)}has(e){return e=n(String(e)),this._map.has(e)}set(e,t){if(e=n(String(e)),t=String(t),!r(e))throw Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!i(t))throw Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=n(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}})),aX=i(((e,t)=>{var{removeLeadingAndTrailingHTTPWhitespace:n,removeTrailingHTTPWhitespace:r,isHTTPWhitespaceChar:i,solelyContainsHTTPTokenCodePoints:a,soleyContainsHTTPQuotedStringTokenCodePoints:o,asciiLowercase:s,collectAnHTTPQuotedString:c}=rX();t.exports=e=>{e=n(e);let t=0,l=``;for(;t<e.length&&e[t]!==`/`;)l+=e[t],++t;if(l.length===0||!a(l)||t>=e.length)return null;++t;let u=``;for(;t<e.length&&e[t]!==`;`;)u+=e[t],++t;if(u=r(u),u.length===0||!a(u))return null;let d={type:s(l),subtype:s(u),parameters:new Map};for(;t<e.length;){for(++t;i(e[t]);)++t;let n=``;for(;t<e.length&&e[t]!==`;`&&e[t]!==`=`;)n+=e[t],++t;if(n=s(n),t<e.length){if(e[t]===`;`)continue;++t}let l=null;if(e[t]===`"`)for([l,t]=c(e,t);t<e.length&&e[t]!==`;`;)++t;else{for(l=``;t<e.length&&e[t]!==`;`;)l+=e[t],++t;if(l=r(l),l===``)continue}n.length>0&&a(n)&&o(l)&&!d.parameters.has(n)&&d.parameters.set(n,l)}return d}})),oX=i(((e,t)=>{var{solelyContainsHTTPTokenCodePoints:n}=rX();t.exports=e=>{let t=`${e.type}/${e.subtype}`;if(e.parameters.size===0)return t;for(let[r,i]of e.parameters)t+=`;`,t+=r,t+=`=`,(!n(i)||i.length===0)&&(i=i.replace(/(["\\])/gu,`\\$1`),i=`"${i}"`),t+=i;return t}})),sX=e(i(((e,t)=>{var n=iX(),r=aX(),i=oX(),{asciiLowercase:a,solelyContainsHTTPTokenCodePoints:o}=rX();t.exports=class{constructor(e){e=String(e);let t=r(e);if(t===null)throw Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new n(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=a(String(e)),e.length===0)throw Error(`Invalid type: must be a non-empty string`);if(!o(e))throw Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=a(String(e)),e.length===0)throw Error(`Invalid subtype: must be a non-empty string`);if(!o(e))throw Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return i(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case`text`:switch(this._subtype){case`ecmascript`:case`javascript`:case`javascript1.0`:case`javascript1.1`:case`javascript1.2`:case`javascript1.3`:case`javascript1.4`:case`javascript1.5`:case`jscript`:case`livescript`:case`x-ecmascript`:case`x-javascript`:return!e||this._parameters.size===0;default:return!1}case`application`:switch(this._subtype){case`ecmascript`:case`javascript`:case`x-ecmascript`:case`x-javascript`:return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype===`xml`&&(this._type===`text`||this._type===`application`)||this._subtype.endsWith(`+xml`)}isHTML(){return this._subtype===`html`&&this._type===`text`}}}))(),1);function cX(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=lX(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2168
2168
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lX(e,t){if(e){if(typeof e==`string`)return uX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uX(e,t)}}function uX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fX(e,t,n){return t&&dX(e.prototype,t),n&&dX(e,n),e}var pX=function(){return typeof Symbol==`function`},mX=function(e){return pX()&&!!Symbol[e]},hX=function(e){return mX(e)?Symbol[e]:`@@`+e};pX()&&!mX(`observable`)&&(Symbol.observable=Symbol(`observable`));var gX=hX(`iterator`),_X=hX(`observable`),vX=hX(`species`);function yX(e,t){var n=e[t];if(n!=null){if(typeof n!=`function`)throw TypeError(n+` is not a function`);return n}}function bX(e){var t=e.constructor;return t!==void 0&&(t=t[vX],t===null&&(t=void 0)),t===void 0?jX:t}function xX(e){return e instanceof jX}function SX(e){SX.log?SX.log(e):setTimeout(function(){throw e})}function CX(e){Promise.resolve().then(function(){try{e()}catch(e){SX(e)}})}function wX(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,t))try{if(typeof t==`function`)t();else{var n=yX(t,`unsubscribe`);n&&n.call(t)}}catch(e){SX(e)}}function TX(e){e._observer=void 0,e._queue=void 0,e._state=`closed`}function EX(e){var t=e._queue;if(t){e._queue=void 0,e._state=`ready`;for(var n=0;n<t.length&&(DX(e,t[n].type,t[n].value),e._state!==`closed`);++n);}}function DX(e,t,n){e._state=`running`;var r=e._observer;try{var i=yX(r,t);switch(t){case`next`:i&&i.call(r,n);break;case`error`:if(TX(e),i)i.call(r,n);else throw n;break;case`complete`:TX(e),i&&i.call(r);break}}catch(e){SX(e)}e._state===`closed`?wX(e):e._state===`running`&&(e._state=`ready`)}function OX(e,t,n){if(e._state!==`closed`){if(e._state===`buffering`){e._queue.push({type:t,value:n});return}if(e._state!==`ready`){e._state=`buffering`,e._queue=[{type:t,value:n}],CX(function(){return EX(e)});return}DX(e,t,n)}}var kX=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state=`initializing`;var n=new AX(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}this._state===`initializing`&&(this._state=`ready`)}var t=e.prototype;return t.unsubscribe=function(){this._state!==`closed`&&(TX(this),wX(this))},fX(e,[{key:`closed`,get:function(){return this._state===`closed`}}]),e}(),AX=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){OX(this._subscription,`next`,e)},t.error=function(e){OX(this._subscription,`error`,e)},t.complete=function(){OX(this._subscription,`complete`)},fX(e,[{key:`closed`,get:function(){return this._subscription._state===`closed`}}]),e}(),jX=function(){function e(t){if(!(this instanceof e))throw TypeError(`Observable cannot be called as a function`);if(typeof t!=`function`)throw TypeError(`Observable initializer must be a function`);this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return(typeof e!=`object`||!e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new kX(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise(function(n,r){if(typeof e!=`function`){r(TypeError(e+` is not a function`));return}function i(){a.unsubscribe(),n()}var a=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),a.unsubscribe()}},error:r,complete:n})})},t.map=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);return new(bX(this))(function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.filter=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);return new(bX(this))(function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.reduce=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);var n=bX(this),r=arguments.length>1,i=!1,a=arguments[1];return new n(function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError(`Cannot reduce an empty sequence`));n.next(a),n.complete()}})})},t.concat=function(){var e=this,t=[...arguments],n=bX(this);return new n(function(r){var i,a=0;function o(e){i=e.subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){a===t.length?(i=void 0,r.complete()):o(n.from(t[a++]))}})}return o(e),function(){i&&=(i.unsubscribe(),void 0)}})},t.flatMap=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);var n=bX(this);return new n(function(r){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var a=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&i.length===0&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[_X]=function(){return this},e.from=function(t){var n=typeof this==`function`?this:e;if(t==null)throw TypeError(t+` is not an object`);var r=yX(t,_X);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+` is not an object`);return xX(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(mX(`iterator`)&&(r=yX(t,gX),r))return new n(function(e){CX(function(){if(!e.closed){for(var n=cX(r.call(t)),i;!(i=n()).done;){var a=i.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){CX(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})});throw TypeError(t+` is not observable`)},e.of=function(){var t=[...arguments];return new(typeof this==`function`?this:e)(function(e){CX(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})})},fX(e,null,[{key:vX,get:function(){return this}}]),e}();pX()&&Object.defineProperty(jX,Symbol(`extensions`),{value:{symbol:_X,hostReportError:SX},configurable:!0});var MX=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}));function NX(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function PX(e){return NX(e)===`object`}function FX(e){return Array.isArray(e)&&e.length>0&&e.every(e=>`message`in e)}function IX(e,t){return e.length<124?e:t}var LX=`graphql-transport-ws`,RX;(function(e){e[e.InternalServerError=4500]=`InternalServerError`,e[e.InternalClientError=4005]=`InternalClientError`,e[e.BadRequest=4400]=`BadRequest`,e[e.BadResponse=4004]=`BadResponse`,e[e.Unauthorized=4401]=`Unauthorized`,e[e.Forbidden=4403]=`Forbidden`,e[e.SubprotocolNotAcceptable=4406]=`SubprotocolNotAcceptable`,e[e.ConnectionInitialisationTimeout=4408]=`ConnectionInitialisationTimeout`,e[e.ConnectionAcknowledgementTimeout=4504]=`ConnectionAcknowledgementTimeout`,e[e.SubscriberAlreadyExists=4409]=`SubscriberAlreadyExists`,e[e.TooManyInitialisationRequests=4429]=`TooManyInitialisationRequests`})(RX||={});var zX;(function(e){e.ConnectionInit=`connection_init`,e.ConnectionAck=`connection_ack`,e.Ping=`ping`,e.Pong=`pong`,e.Subscribe=`subscribe`,e.Next=`next`,e.Error=`error`,e.Complete=`complete`})(zX||={});function BX(e){if(!PX(e))throw Error(`Message is expected to be an object, but got ${NX(e)}`);if(!e.type)throw Error(`Message is missing the 'type' property`);if(typeof e.type!=`string`)throw Error(`Message is expects the 'type' property to be a string, but got ${NX(e.type)}`);switch(e.type){case zX.ConnectionInit:case zX.ConnectionAck:case zX.Ping:case zX.Pong:if(e.payload!=null&&!PX(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case zX.Subscribe:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${NX(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!PX(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${NX(e.payload)}`);if(typeof e.payload.query!=`string`)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${NX(e.payload.query)}`);if(e.payload.variables!=null&&!PX(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${NX(e.payload.variables)}`);if(e.payload.operationName!=null&&NX(e.payload.operationName)!==`string`)throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${NX(e.payload.operationName)}`);if(e.payload.extensions!=null&&!PX(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${NX(e.payload.extensions)}`);break;case zX.Next:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${NX(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!PX(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${NX(e.payload)}`);break;case zX.Error:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${NX(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!FX(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case zX.Complete:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${NX(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function VX(e,t){return BX(typeof e==`string`?JSON.parse(e,t):e)}function HX(e,t){return BX(e),JSON.stringify(e,t)}var UX=function(e){return this instanceof UX?(this.v=e,this):new UX(e)},WX=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof UX?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function GX(e){let{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:l=5,retryWait:u=async function(e){let t=1e3;for(let n=0;n<e;n++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(Math.random()*2700+300)))},shouldRetry:d=qX,isFatalConnectionProblem:f,on:p,webSocketImpl:m,generateID:h=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})},jsonMessageReplacer:g,jsonMessageReviver:_}=e,v;if(m){if(!YX(m))throw Error(`Invalid WebSocket implementation provided`);v=m}else typeof WebSocket<`u`?v=WebSocket:typeof global<`u`?v=global.WebSocket||global.MozWebSocket:typeof window<`u`&&(v=window.WebSocket||window.MozWebSocket);if(!v)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let y=v,b=(()=>{let e=(()=>{let e={};return{on(t,n){return e[t]=n,()=>{delete e[t]}},emit(t){var n;`id`in t&&((n=e[t.id])==null||n.call(e,t))}}})(),t={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[e.emit,p.message]:[e.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:e.on,on(e,n){let r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(let r of[...t[e]])r(...n)}}})();function x(e){let t=[b.on(`error`,n=>{t.forEach(e=>e()),e(n)}),b.on(`closed`,n=>{t.forEach(e=>e()),e(n)})]}let S,C=0,w,T=!1,E=0,D=!1;async function ee(){clearTimeout(w);let[e,r]=await(S??=new Promise((e,r)=>(async()=>{if(T){if(await u(E),!C)return S=void 0,r({code:1e3,reason:`All Subscriptions Gone`});E++}b.emit(`connecting`,T);let i=new y(typeof t==`function`?await t():t,LX),a,l;function d(){isFinite(o)&&o>0&&(clearTimeout(l),l=setTimeout(()=>{i.readyState===y.OPEN&&(i.send(HX({type:zX.Ping})),b.emit(`ping`,!1,void 0))},o))}x(e=>{S=void 0,clearTimeout(a),clearTimeout(l),r(e),e instanceof KX&&(i.close(4499,`Terminated`),i.onerror=null,i.onclose=null)}),i.onerror=e=>b.emit(`error`,e),i.onclose=e=>b.emit(`closed`,e),i.onopen=async()=>{try{b.emit(`opened`,i);let e=typeof n==`function`?await n():n;if(i.readyState!==y.OPEN)return;i.send(HX(e?{type:zX.ConnectionInit,payload:e}:{type:zX.ConnectionInit},g)),isFinite(c)&&c>0&&(a=setTimeout(()=>{i.close(RX.ConnectionAcknowledgementTimeout,`Connection acknowledgement timeout`)},c)),d()}catch(e){b.emit(`error`,e),i.close(RX.InternalClientError,IX(e instanceof Error?e.message:Error(e).message,`Internal client error`))}};let f=!1;i.onmessage=({data:t})=>{try{let n=VX(t,_);if(b.emit(`message`,n),n.type===`ping`||n.type===`pong`){b.emit(n.type,!0,n.payload),n.type===`pong`?d():s||(i.send(HX(n.payload?{type:zX.Pong,payload:n.payload}:{type:zX.Pong})),b.emit(`pong`,!1,n.payload));return}if(f)return;if(n.type!==zX.ConnectionAck)throw Error(`First message cannot be of type ${n.type}`);clearTimeout(a),f=!0,b.emit(`connected`,i,n.payload,T),T=!1,E=0,e([i,new Promise((e,t)=>x(t))])}catch(e){i.onmessage=null,b.emit(`error`,e),i.close(RX.BadResponse,IX(e instanceof Error?e.message:Error(e).message,`Bad response`))}}})()));e.readyState===y.CLOSING&&await r;let i=()=>{},l=new Promise(e=>i=e);return[e,i,Promise.race([l.then(()=>{if(!C){let t=()=>e.close(1e3,`Normal Closure`);isFinite(a)&&a>0?w=setTimeout(()=>{e.readyState===y.OPEN&&t()},a):t()}}),r])]}function te(e){if(qX(e)&&(JX(e.code)||[RX.InternalServerError,RX.InternalClientError,RX.BadRequest,RX.BadResponse,RX.Unauthorized,RX.SubprotocolNotAcceptable,RX.SubscriberAlreadyExists,RX.TooManyInitialisationRequests].includes(e.code)))throw e;if(D)return!1;if(qX(e)&&e.code===1e3)return C>0;if(!l||E>=l||!d(e)||f?.(e))throw e;return T=!0}r||(async()=>{for(C++;;)try{let[,,e]=await ee();await e}catch(e){try{if(!te(e))return}catch(e){return i?.(e)}}})();function ne(e,t){let n=h(e),r=!1,i=!1,a=()=>{C--,r=!0};return(async()=>{for(C++;;)try{let[o,s,c]=await ee();if(r)return s();let l=b.onMessage(n,e=>{switch(e.type){case zX.Next:t.next(e.payload);return;case zX.Error:i=!0,r=!0,t.error(e.payload),a();return;case zX.Complete:r=!0,a();return}});o.send(HX({id:n,type:zX.Subscribe,payload:e},g)),a=()=>{!r&&o.readyState===y.OPEN&&o.send(HX({id:n,type:zX.Complete},g)),C--,r=!0,s()},await c.finally(l);return}catch(e){if(!te(e))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||a()}}return{on:b.on,subscribe:ne,iterate(e){let t=[],n={done:!1,error:null,resolve:()=>{}},r=ne(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=(function(){return WX(this,arguments,function*(){for(;;){for(t.length||(yield UX(new Promise(e=>n.resolve=e)));t.length;)yield yield UX(t.shift());if(n.error)throw n.error;if(n.done)return yield UX(void 0)}})})();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(D=!0,S){let[e]=await S;e.close(1e3,`Normal Closure`)}},terminate(){S&&b.emit(`closed`,new KX)}}}var KX=class extends Error{constructor(){super(...arguments),this.name=`TerminatedCloseEvent`,this.message=`4499: Terminated`,this.code=4499,this.reason=`Terminated`,this.wasClean=!1}};function qX(e){return PX(e)&&`code`in e&&`reason`in e}function JX(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function YX(e){return typeof e==`function`&&`constructor`in e&&`CLOSED`in e&&`CLOSING`in e&&`CONNECTING`in e&&`OPEN`in e}var XX=i(((e,t)=>{t.exports=n;function n(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}n.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}})),ZX=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return typeof e==`string`}e.default=t})),QX=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return typeof e==`object`&&!!e}e.default=t}));function $X(e){var t,n=e.Symbol;return typeof n==`function`?n.observable?t=n.observable:(t=n(`observable`),n.observable=t):t=`@@observable`,t}var eZ=n((()=>{})),tZ=r({default:()=>rZ}),nZ,rZ,iZ=n((()=>{eZ(),nZ=typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:typeof module<`u`?module:Function(`return this`)(),rZ=$X(nZ)})),aZ=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GRAPHQL_SUBSCRIPTIONS=e.GRAPHQL_WS=void 0,e.GRAPHQL_WS=`graphql-ws`,e.GRAPHQL_SUBSCRIPTIONS=`graphql-subscriptions`})),oZ=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WS_TIMEOUT=e.MIN_WS_TIMEOUT=void 0,e.MIN_WS_TIMEOUT=1e3,e.WS_TIMEOUT=3e4})),sZ=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=function(){function e(){throw Error(`Static Class`)}return e.GQL_CONNECTION_INIT=`connection_init`,e.GQL_CONNECTION_ACK=`connection_ack`,e.GQL_CONNECTION_ERROR=`connection_error`,e.GQL_CONNECTION_KEEP_ALIVE=`ka`,e.GQL_CONNECTION_TERMINATE=`connection_terminate`,e.GQL_START=`start`,e.GQL_DATA=`data`,e.GQL_ERROR=`error`,e.GQL_COMPLETE=`complete`,e.GQL_STOP=`stop`,e.SUBSCRIPTION_START=`subscription_start`,e.SUBSCRIPTION_DATA=`subscription_data`,e.SUBSCRIPTION_SUCCESS=`subscription_success`,e.SUBSCRIPTION_FAIL=`subscription_fail`,e.SUBSCRIPTION_END=`subscription_end`,e.INIT=`init`,e.INIT_SUCCESS=`init_success`,e.INIT_FAIL=`init_fail`,e.KEEP_ALIVE=`keepalive`,e}()})),cZ=i((e=>{var n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},r=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},i=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},a=e&&e.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscriptionClient=void 0;var o=typeof global<`u`?global:typeof window<`u`?window:{},s=o.WebSocket||o.MozWebSocket,c=XX(),l=MX(),u=ZX(),d=QX(),f=(Mn(),t(Fn)),p=(Nn(),t(In)),m=(iZ(),t(tZ)),h=aZ(),g=oZ(),_=sZ();e.SubscriptionClient=function(){function e(e,t,n,r){var i=t||{},a=i.connectionCallback,o=a===void 0?void 0:a,u=i.connectionParams,d=u===void 0?{}:u,f=i.minTimeout,p=f===void 0?g.MIN_WS_TIMEOUT:f,m=i.timeout,_=m===void 0?g.WS_TIMEOUT:m,v=i.reconnect,y=v===void 0?!1:v,b=i.reconnectionAttempts,x=b===void 0?1/0:b,S=i.lazy,C=S===void 0?!1:S,w=i.inactivityTimeout,T=w===void 0?0:w,E=i.wsOptionArguments,D=E===void 0?[]:E;if(this.wsImpl=n||s,!this.wsImpl)throw Error(`Unable to find native implementation, or alternative implementation for WebSocket!`);this.wsProtocols=r||h.GRAPHQL_WS,this.connectionCallback=o,this.url=e,this.operations={},this.nextOperationId=0,this.minWsTimeout=p,this.wsTimeout=_,this.unsentMessagesQueue=[],this.reconnect=y,this.reconnecting=!1,this.reconnectionAttempts=x,this.lazy=!!C,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new c({jitter:.5}),this.eventEmitter=new l.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(d),this.wsOptionArguments=D,this.lazy||this.connect()}return Object.defineProperty(e.prototype,`status`,{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=t,e&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit(`disconnected`),e||this.tryReconnect())},e.prototype.request=function(e){var t,n=this.getObserver.bind(this),r=this.executeOperation.bind(this),i=this.unsubscribe.bind(this),a;return this.clearInactivityTimeout(),t={},t[m.default]=function(){return this},t.subscribe=function(t,o,s){var c=n(t,o,s);return a=r(e,function(e,t){e===null&&t===null?c.complete&&c.complete():e?c.error&&c.error(e[0]):c.next&&c.next(t)}),{unsubscribe:function(){a&&=(i(a),null)}}},t},e.prototype.on=function(e,t,n){var r=this.eventEmitter.on(e,t,n);return function(){r.off(e,t,n)}},e.prototype.onConnected=function(e,t){return this.on(`connected`,e,t)},e.prototype.onConnecting=function(e,t){return this.on(`connecting`,e,t)},e.prototype.onDisconnected=function(e,t){return this.on(`disconnected`,e,t)},e.prototype.onReconnected=function(e,t){return this.on(`reconnected`,e,t)},e.prototype.onReconnecting=function(e,t){return this.on(`reconnecting`,e,t)},e.prototype.onError=function(e,t){return this.on(`error`,e,t)},e.prototype.unsubscribeAll=function(){var e=this;Object.keys(this.operations).forEach(function(t){e.unsubscribe(t)})},e.prototype.applyMiddlewares=function(e){var t=this;return new Promise(function(n,r){(function(t,i){var a=function(o){if(o)r(o);else if(t.length>0){var s=t.shift();s&&s.applyMiddleware.apply(i,[e,a])}else n(e)};a()})(a([],t.middlewares,!0),t)})},e.prototype.use=function(e){var t=this;return e.map(function(e){if(typeof e.applyMiddleware==`function`)t.middlewares.push(e);else throw Error(`Middleware must implement the applyMiddleware function.`)}),this},e.prototype.getConnectionParams=function(e){return function(){return new Promise(function(t,n){if(typeof e==`function`)try{return t(e.call(null))}catch(e){return n(e)}t(e)})}},e.prototype.executeOperation=function(e,t){var n=this;this.client===null&&this.connect();var r=this.generateOperationId();return this.operations[r]={options:e,handler:t},this.applyMiddlewares(e).then(function(e){n.checkOperationOptions(e,t),n.operations[r]&&(n.operations[r]={options:e,handler:t},n.sendMessage(r,_.default.GQL_START,e))}).catch(function(e){n.unsubscribe(r),t(n.formatErrors(e))}),r},e.prototype.getObserver=function(e,t,n){return typeof e==`function`?{next:function(t){return e(t)},error:function(e){return t&&t(e)},complete:function(){return n&&n()}}:e},e.prototype.createMaxConnectTimeGenerator=function(){var e=this.minWsTimeout,t=this.wsTimeout;return new c({min:e,max:t,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&=(clearInterval(this.checkConnectionIntervalId),null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&=(clearTimeout(this.maxConnectTimeoutId),null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&=(clearTimeout(this.tryReconnectTimeoutId),null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&=(clearTimeout(this.inactivityTimeoutId),null)},e.prototype.setInactivityTimeout=function(){var e=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(e.operations).length===0&&e.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(e,t){var n=e.query,r=e.variables,i=e.operationName;if(!n)throw Error(`Must provide a query.`);if(!t)throw Error(`Must provide an handler.`);if(!(0,u.default)(n)&&!(0,p.getOperationAST)(n,i)||i&&!(0,u.default)(i)||r&&!(0,d.default)(r))throw Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(e,t,r){return{id:e,type:t,payload:r&&r.query?n(n({},r),{query:typeof r.query==`string`?r.query:(0,f.print)(r.query)}):r}},e.prototype.formatErrors=function(e){return Array.isArray(e)?e:e&&e.errors?this.formatErrors(e.errors):e&&e.message?[e]:[{name:`FormatedError`,message:`Unknown error`,originalError:e}]},e.prototype.sendMessage=function(e,t,n){this.sendMessageRaw(this.buildMessage(e,t,n))},e.prototype.sendMessageRaw=function(e){switch(this.status){case this.wsImpl.OPEN:var t=JSON.stringify(e);try{JSON.parse(t)}catch{this.eventEmitter.emit(`error`,Error(`Message must be JSON-serializable. Got: `+e))}this.client.send(t);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(e);break;default:this.reconnecting||this.eventEmitter.emit(`error`,Error(`A message was not sent because socket is not connected, is closing or is already closed. Message was: `+JSON.stringify(e)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var e=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||=(Object.keys(this.operations).forEach(function(t){e.unsentMessagesQueue.push(e.buildMessage(t,_.default.GQL_START,e.operations[t].options))}),!0),this.clearTryReconnectTimeout();var t=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){e.connect()},t)}},e.prototype.flushUnsentMessagesQueue=function(){var e=this;this.unsentMessagesQueue.forEach(function(t){e.sendMessageRaw(t)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var e=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){e.status!==e.wsImpl.OPEN&&(e.reconnecting=!0,e.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var e,t=this;this.client=new((e=this.wsImpl).bind.apply(e,a([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return r(t,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?`reconnecting`:`connecting`),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return e=n.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,e),this.flushUnsentMessagesQueue(),[3,4];case 3:return t=n.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,t),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){t.closedByUser||t.close(!1,!1)},this.client.onerror=function(e){t.eventEmitter.emit(`error`,e)},this.client.onmessage=function(e){var n=e.data;t.processReceivedData(n)}},e.prototype.processReceivedData=function(e){var t,r;try{t=JSON.parse(e),r=t.id}catch{throw Error(`Message must be JSON-parseable. Got: `+e)}if([_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(t.type)!==-1&&!this.operations[r]){this.unsubscribe(r);return}switch(t.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(t.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?`reconnected`:`connected`,t.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var i=this.operations[r].handler;delete this.operations[r],i.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[r].handler(this.formatErrors(t.payload),null),delete this.operations[r];break;case _.default.GQL_DATA:var a=t.payload.errors?n(n({},t.payload),{errors:this.formatErrors(t.payload.errors)}):t.payload;this.operations[r].handler(null,a);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var o=this.wasKeepAliveReceived===void 0;this.wasKeepAliveReceived=!0,o&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw Error(`Invalid message type!`)}},e.prototype.unsubscribe=function(e){this.operations[e]&&(delete this.operations[e],this.setInactivityTimeout(),this.sendMessage(e,_.default.GQL_STOP,void 0))},e}()})),lZ=e(MX(),1),uZ=cZ(),dZ=(e=!1)=>e?`https://embed.apollo.local:3000`:`https://sandbox.embed.apollographql.com`,fZ=`SchemaError`,pZ=`SchemaResponse`,mZ=`ExplorerRequest`,hZ=`ExplorerResponse`,gZ=`ExplorerSubscriptionRequest`,_Z=`ExplorerSubscriptionResponse`,vZ=`ExplorerSubscriptionTermination`,yZ=`ExplorerSetSocketError`,bZ=`ExplorerSetSocketStatus`,xZ=e=>`apollo-embed-${e}`,SZ=`ExplorerListeningForHandshake`,CZ=`HandshakeResponse`,wZ=`SetPartialAuthenticationTokenForParent`,TZ=`TriggerLogoutInParent`,EZ=`ExplorerListeningForPartialToken`,DZ=`PartialAuthenticationTokenResponse`,OZ=`PreflightOAuthRequest`,kZ=`PreflightOAuthProviderResponse`,AZ=`PreflightOAuthResponse`,jZ=`IntrospectionQueryWithHeaders`,MZ=`ParentLogoutSuccess`,NZ=({legacyIncludeCookies:e})=>(t,n)=>fetch(t,Object.assign(Object.assign({},n),e?{credentials:`include`}:e===void 0?{}:{credentials:`omit`}));function PZ(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function FZ(e,t){if(e.body===null)throw Error(`Missing body`);if(typeof e.body.tee!=`function`)throw Error(`Streaming bodies not supported by provided fetch implementation`);let n=new TextDecoder(`utf-8`),r=``,i=`--${t.parameters.get(`boundary`)||`-`}`,a=e.body.getReader();return{closeReadableStream:()=>a.cancel(),observable:new jX(e=>{function t(){a.read().then(a=>{var o,s;if(a.done){(o=e.complete)==null||o.call(e);return}let c=n.decode(a.value);r+=c;let l=r.indexOf(i);for(;l>-1;){let t=r.slice(0,l);if(r=r.slice(l+i.length),t.trim()){let n=`\r
|
|
2169
2169
|
\r
|